Initial commit

This commit is contained in:
Dynamitos committed 2026-06-09 11:08:04 +02:00
commit 67a4d0e0ec
148 files changed
+34596

No files matched your search

+1
View File
@@ -0,0 +1 @@
{}
+1
View File
@@ -0,0 +1 @@
{}
+3
View File
@@ -0,0 +1,3 @@
[
"yolo"
]
@@ -0,0 +1 @@
{"internalDocumentIDStore":{"internalIdToId":["c1aa7d5b9157e851549771ce36b9a82d","10f909b338807868764b0637c85918c5","8cf4d5a491b063fbbb56d6ff96eb7262","eb011816dd7511f83d63fa505ba588b3","693f84abf3ffb4995745057deb0f05e5","54a262b34ff8a6f837752b6b9879e03b","8db7f57e30c15caaaf13a484ce1c0d5e","a8fba41cf8b76f8d0ecf1abce2953314","f7f305919da4639f8406da23d17c48ef","258392362f83bd9bf7f12a3e527004df","c61d9e960f88b0a7d74b5377f0153582","4e47dda7f91a8b9479115856974d9cab","855ca31374cfb34b901ed56a4f9ee91b","34ccf3e71f7c926e8b4b09f69cb2480e","d92ce40d09eb56a006e981d918143236"]},"index":{"indexes":{"id":{"type":"Radix","node":{"w":"","s":"","c":{"1":{"w":"10f909b338807868764b0637c85918c5","s":"10f909b338807868764b0637c85918c5","c":{},"d":[2],"e":true},"2":{"w":"258392362f83bd9bf7f12a3e527004df","s":"258392362f83bd9bf7f12a3e527004df","c":{},"d":[10],"e":true},"3":{"w":"34ccf3e71f7c926e8b4b09f69cb2480e","s":"34ccf3e71f7c926e8b4b09f69cb2480e","c":{},"d":[14],"e":true},"4":{"w":"4e47dda7f91a8b9479115856974d9cab","s":"4e47dda7f91a8b9479115856974d9cab","c":{},"d":[12],"e":true},"5":{"w":"54a262b34ff8a6f837752b6b9879e03b","s":"54a262b34ff8a6f837752b6b9879e03b","c":{},"d":[6],"e":true},"6":{"w":"693f84abf3ffb4995745057deb0f05e5","s":"693f84abf3ffb4995745057deb0f05e5","c":{},"d":[5],"e":true},"8":{"w":"8","s":"8","c":{"5":{"w":"855ca31374cfb34b901ed56a4f9ee91b","s":"55ca31374cfb34b901ed56a4f9ee91b","c":{},"d":[13],"e":true},"c":{"w":"8cf4d5a491b063fbbb56d6ff96eb7262","s":"cf4d5a491b063fbbb56d6ff96eb7262","c":{},"d":[3],"e":true},"d":{"w":"8db7f57e30c15caaaf13a484ce1c0d5e","s":"db7f57e30c15caaaf13a484ce1c0d5e","c":{},"d":[7],"e":true}},"d":[],"e":false},"c":{"w":"c","s":"c","c":{"1":{"w":"c1aa7d5b9157e851549771ce36b9a82d","s":"1aa7d5b9157e851549771ce36b9a82d","c":{},"d":[1],"e":true},"6":{"w":"c61d9e960f88b0a7d74b5377f0153582","s":"61d9e960f88b0a7d74b5377f0153582","c":{},"d":[11],"e":true}},"d":[],"e":false},"e":{"w":"eb011816dd7511f83d63fa505ba588b3","s":"eb011816dd7511f83d63fa505ba588b3","c":{},"d":[4],"e":true},"a":{"w":"a8fba41cf8b76f8d0ecf1abce2953314","s":"a8fba41cf8b76f8d0ecf1abce2953314","c":{},"d":[8],"e":true},"f":{"w":"f7f305919da4639f8406da23d17c48ef","s":"f7f305919da4639f8406da23d17c48ef","c":{},"d":[9],"e":true},"d":{"w":"d92ce40d09eb56a006e981d918143236","s":"d92ce40d09eb56a006e981d918143236","c":{},"d":[15],"e":true}},"d":[],"e":false},"isArray":false},"title":{"type":"Radix","node":{"w":"","s":"","c":{"w":{"w":"world","s":"world","c":{},"d":[1,9],"e":true},"m":{"w":"m","s":"m","c":{"o":{"w":"mora","s":"ora","c":{},"d":[2],"e":true},"e":{"w":"mechanics","s":"echanics","c":{},"d":[10],"e":true}},"d":[],"e":false},"b":{"w":"b","s":"b","c":{"l":{"w":"blessing","s":"lessing","c":{"s":{"w":"blessings","s":"s","c":{},"d":[3],"e":true}},"d":[4],"e":true},"a":{"w":"basics","s":"asics","c":{},"d":[5,6,7,8,15],"e":true}},"d":[],"e":false},"i":{"w":"ideas","s":"ideas","c":{},"d":[4],"e":true},"g":{"w":"gameplay","s":"gameplay","c":{},"d":[10],"e":true},"c":{"w":"conversation","s":"conversation","c":{},"d":[11,12,13,14],"e":true}},"d":[],"e":false},"isArray":false},"path":{"type":"Radix","node":{"w":"","s":"","c":{"w":{"w":"world","s":"world","c":{},"d":[1,9],"e":true},"m":{"w":"m","s":"m","c":{"d":{"w":"md","s":"d","c":{},"d":[1,2,3,4,5,6,7,8,10,11,12,13,14,15,9],"e":true},"o":{"w":"mora","s":"ora","c":{},"d":[2],"e":true},"e":{"w":"mechanics","s":"echanics","c":{},"d":[10],"e":true}},"d":[],"e":false},"b":{"w":"b","s":"b","c":{"l":{"w":"blessing","s":"lessing","c":{"s":{"w":"blessings","s":"s","c":{},"d":[3],"e":true}},"d":[4],"e":true},"a":{"w":"basics","s":"asics","c":{},"d":[5,6,7,8,15],"e":true}},"d":[],"e":false},"i":{"w":"ideas","s":"ideas","c":{},"d":[4],"e":true},"g":{"w":"gameplay","s":"gameplay","c":{},"d":[10],"e":true},"c":{"w":"conversation","s":"conversation","c":{},"d":[11,12,13,14],"e":true}},"d":[],"e":false},"isArray":false},"content":{"type":"Radix","node":{"w":"","s":"","c":{"0":{"w":"0","s":"0","c":{"0":{"w":"00","s":"0","c":{},"d":[5,6,7,8,11,12,13,14,15],"e":true},"5":{"w":"05","s":"5","c":{},"d":[1,2,3,4,5,6,7,8,10,11,12,13,14,15,9],"e":true}},"d":[1,2,3,4,5,10,11,15,9],"e":true},"1":{"w":"1","s":"1","c":{"0":{"w":"10","s":"0","c":{},"d":[1,2,3,4,5,6,7,8,10,11,12,13,14,15,9],"e":true},"1":{"w":"11","s":"1","c":{},"d":[2,3,4,5,6,7,8,11,12,13,14,15],"e":true},"3":{"w":"13","s":"3","c":{},"d":[3],"e":true},"4":{"w":"14","s":"4","c":{},"d":[3,5,6,7,8,11,12,13,14,15],"e":true},"6":{"w":"16","s":"6","c":{},"d":[3],"e":true},"7":{"w":"17","s":"7","c":{},"d":[1,9],"e":true},"8":{"w":"18","s":"8","c":{},"d":[1,2,5,6,7,8,11,12,13,14,15],"e":true}},"d":[6,12],"e":true},"2":{"w":"2","s":"2","c":{"0":{"w":"20","s":"0","c":{"2":{"w":"2026","s":"26","c":{},"d":[1,2,3,4,5,6,7,8,10,11,12,13,14,15,9],"e":true}},"d":[4,10,15,9],"e":true},"2":{"w":"22","s":"2","c":{},"d":[10],"e":true},"4":{"w":"24","s":"4","c":{},"d":[15],"e":true},"5":{"w":"25","s":"5","c":{},"d":[10],"e":true},"6":{"w":"26","s":"6","c":{},"d":[6,12,Line truncated
+33
View File
@@ -0,0 +1,33 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"footnotes": false,
"properties": true,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": true,
"bases": true,
"webviewer": false
}
+22
View File
@@ -0,0 +1,22 @@
{
"collapse-filter": true,
"search": "",
"showTags": false,
"showAttachments": false,
"hideUnresolved": false,
"showOrphans": true,
"collapse-color-groups": true,
"colorGroups": [],
"collapse-display": true,
"showArrow": false,
"textFadeMultiplier": 0,
"nodeSizeMultiplier": 1,
"lineSizeMultiplier": 1,
"collapse-forces": true,
"centerStrength": 0.518713248970312,
"repelStrength": 10,
"linkStrength": 1,
"linkDistance": 250,
"scale": 1,
"close": true
}
+105
View File
@@ -0,0 +1,105 @@
{
"claude": {
"id": "claude-code-acp",
"displayName": "Claude Code",
"apiKey": "",
"command": "claude-agent-acp",
"args": [],
"env": []
},
"codex": {
"id": "codex-acp",
"displayName": "Codex",
"apiKey": "",
"command": "codex-acp",
"args": [],
"env": []
},
"gemini": {
"id": "gemini-cli",
"displayName": "Gemini CLI",
"apiKey": "",
"command": "gemini",
"args": [
"--experimental-acp"
],
"env": []
},
"customAgents": [
{
"id": "llama3.1",
"displayName": "Llama3.1",
"command": "opencode",
"args": [
"acp"
],
"env": []
}
],
"defaultAgentId": "llama3.1",
"autoAllowPermissions": false,
"autoMentionActiveNote": true,
"enableSystemNotifications": true,
"debugMode": false,
"nodePath": "/usr/bin/node",
"exportSettings": {
"defaultFolder": "Agent Client",
"filenameTemplate": "agent_client_{date}_{time}",
"autoExportOnNewChat": false,
"autoExportOnCloseChat": false,
"openFileAfterExport": true,
"includeImages": true,
"imageLocation": "obsidian",
"imageCustomFolder": "Agent Client",
"frontmatterTag": "agent-client"
},
"windowsWslMode": false,
"sendMessageShortcut": "enter",
"chatViewLocation": "right-tab",
"displaySettings": {
"autoCollapseDiffs": false,
"diffCollapseThreshold": 10,
"maxNoteLength": 10000,
"maxSelectionLength": 10000,
"showEmojis": true,
"fontSize": null
},
"savedSessions": [
{
"sessionId": "ses_1ed40d9d9ffe6xBP145sV755Wk",
"agentId": "llama3.1",
"cwd": "/home/dynamitos/Documents/VNGame",
"title": "organize the following conversation into structure...",
"createdAt": "2026-05-10T16:36:35.882Z",
"updatedAt": "2026-05-10T16:36:35.882Z"
},
{
"sessionId": "ses_1ed41b31affepnZGfYVduv4th2",
"agentId": "llama3.1",
"cwd": "/home/dynamitos/Documents/VNGame",
"title": "organize the following conversation into structure...",
"createdAt": "2026-05-10T16:36:15.735Z",
"updatedAt": "2026-05-10T16:36:15.735Z"
},
{
"sessionId": "ses_1ed449357ffeiuGN2CvVk6WjzN",
"agentId": "llama3.1",
"cwd": "/home/dynamitos/Documents/VNGame",
"title": "I had the following conversation with you in the c...",
"createdAt": "2026-05-10T16:33:29.641Z",
"updatedAt": "2026-05-10T16:33:29.641Z"
}
],
"lastUsedModels": {
"llama3.1": "ollama/llama3.1"
},
"lastUsedModes": {},
"enableFloatingChat": false,
"floatingButtonImage": "",
"floatingWindowSize": {
"width": 400,
"height": 500
},
"floatingWindowPosition": null,
"floatingButtonPosition": null
}
+218
View File
@@ -0,0 +1,218 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var sM=Object.create;var Cs=Object.defineProperty;var lM=Object.getOwnPropertyDescriptor;var cM=Object.getOwnPropertyNames;var uM=Object.getPrototypeOf,dM=Object.prototype.hasOwnProperty;var fM=(e,t,n)=>t in e?Cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var te=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ei=(e,t)=>{for(var n in t)Cs(e,n,{get:t[n],enumerable:!0})},g$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of cM(t))!dM.call(e,i)&&i!==n&&Cs(e,i,{get:()=>t[i],enumerable:!(r=lM(t,i))||r.enumerable});return e};var G=(e,t,n)=>(n=e!=null?sM(uM(e)):{},g$(t||!e||!e.__esModule?Cs(n,"default",{value:e,enumerable:!0}):n,e)),mM=e=>g$(Cs({},"__esModule",{value:!0}),e);var qc=(e,t,n)=>(fM(e,typeof t!="symbol"?t+"":t,n),n),kp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ie=(e,t,n)=>(kp(e,t,"read from private field"),n?n.call(e):t.get(e)),pt=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Fn=(e,t,n,r)=>(kp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),h$=(e,t,n,r)=>({set _(i){Fn(e,t,i,n)},get _(){return ie(e,t,r)}}),ti=(e,t,n)=>(kp(e,t,"access private method"),n);var Es=te((J3,v$)=>{"use strict";var pM="2.0.0",gM=Number.MAX_SAFE_INTEGER||9007199254740991,hM=16,vM=256-6,yM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];v$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:hM,MAX_SAFE_BUILD_LENGTH:vM,MAX_SAFE_INTEGER:gM,RELEASE_TYPES:yM,SEMVER_SPEC_VERSION:pM,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var As=te((K3,y$)=>{"use strict";var SM=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};y$.exports=SM});var Po=te((ni,S$)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Np,MAX_SAFE_BUILD_LENGTH:bM,MAX_LENGTH:xM}=Es(),_M=As();ni=S$.exports={};var wM=ni.re=[],$M=ni.safeRe=[],X=ni.src=[],CM=ni.safeSrc=[],Y=ni.t={},EM=0,Op="[a-zA-Z0-9-]",AM=[["\\s",1],["\\d",xM],[Op,bM]],zM=e=>{for(let[t,n]of AM)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},le=(e,t,n)=>{let r=zM(t),i=EM++;_M(e,i,t),Y[e]=i,X[i]=t,CM[i]=r,wM[i]=new RegExp(t,n?"g":void 0),$M[i]=new RegExp(r,n?"g":void 0)};le("NUMERICIDENTIFIER","0|[1-9]\\d*");le("NUMERICIDENTIFIERLOOSE","\\d+");le("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Op}*`);le("MAINVERSION",`(${X[Y.NUMERICIDENTIFIER]})\\.(${X[Y.NUMERICIDENTIFIER]})\\.(${X[Y.NUMERICIDENTIFIER]})`);le("MAINVERSIONLOOSE",`(${X[Y.NUMERICIDENTIFIERLOOSE]})\\.(${X[Y.NUMERICIDENTIFIERLOOSE]})\\.(${X[Y.NUMERICIDENTIFIERLOOSE]})`);le("PRERELEASEIDENTIFIER",`(?:${X[Y.NONNUMERICIDENTIFIER]}|${X[Y.NUMERICIDENTIFIER]})`);le("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Y.NONNUMERICIDENTIFIER]}|${X[Y.NUMERICIDENTIFIERLOOSE]})`);le("PRERELEASE",`(?:-(${X[Y.PRERELEASEIDENTIFIER]}(?:\\.${X[Y.PRERELEASEIDENTIFIER]})*))`);le("PRERELEASELOOSE",`(?:-?(${X[Y.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Y.PRERELEASEIDENTIFIERLOOSE]})*))`);le("BUILDIDENTIFIER",`${Op}+`);le("BUILD",`(?:\\+(${X[Y.BUILDIDENTIFIER]}(?:\\.${X[Y.BUILDIDENTIFIER]})*))`);le("FULLPLAIN",`v?${X[Y.MAINVERSION]}${X[Y.PRERELEASE]}?${X[Y.BUILD]}?`);le("FULL",`^${X[Y.FULLPLAIN]}$`);le("LOOSEPLAIN",`[v=\\s]*${X[Y.MAINVERSIONLOOSE]}${X[Y.PRERELEASELOOSE]}?${X[Y.BUILD]}?`);le("LOOSE",`^${X[Y.LOOSEPLAIN]}$`);le("GTLT","((?:<|>)?=?)");le("XRANGEIDENTIFIERLOOSE",`${X[Y.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);le("XRANGEIDENTIFIER",`${X[Y.NUMERICIDENTIFIER]}|x|X|\\*`);le("XRANGEPLAIN",`[v=\\s]*(${X[Y.XRANGEIDENTIFIER]})(?:\\.(${X[Y.XRANGEIDENTIFIER]})(?:\\.(${X[Y.XRANGEIDENTIFIER]})(?:${X[Y.PRERELEASE]})?${X[Y.BUILD]}?)?)?`);le("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Y.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Y.XRANGEIDENTIFIERLOOSE]})(?:${X[Y.PRERELEASELOOSE]})?${X[Y.BUILD]}?)?)?`);le("XRANGE",`^${X[Y.GTLT]}\\s*${X[Y.XRANGEPLAIN]}$`);le("XRANGELOOSE",`^${X[Y.GTLT]}\\s*${X[Y.XRANGEPLAINLOOSE]}$`);le("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Np}})(?:\\.(\\d{1,${Np}}))?(?:\\.(\\d{1,${Np}}))?`);le("COERCE",`${X[Y.COERCEPLAIN]}(?:$|[^\\d])`);le("COERCEFULL",X[Y.COERCEPLAIN]+`(?:${X[Y.PRERELEASE]})?(?:${X[Y.BUILD]})?(?:$|[^\\d])`);le("COERCERTL",X[Y.COERCE],!0);le("COERCERTLFULL",X[Y.COERCEFULL],!0);le("LONETILDE","(?:~>?)");le("TILDETRIM",`(\\s*)${X[Y.LONETILDE]}\\s+`,!0);ni.tildeTrimReplace="$1~";le("TILDE",`^${X[Y.LONETILDE]}${X[Y.XRANGEPLAIN]}$`);le("TILDELOOSE",`^${X[Y.LONETILDE]}${X[Y.XRANGEPLAINLOOSE]}$`);le("LONECARET","(?:\\^)");le("CARETTRIM",`(\\s*)${X[Y.LONECARET]}\\s+`,!0);ni.caretTrimReplace="$1^";le("CARET",`^${X[Y.LONECARET]}${X[Y.XRANGEPLAIN]}$`);le("CARETLOOSE",`^${X[Y.LONECARET]}${X[Y.XRANGEPLAINLOOSE]}$`);le("COMPARATORLOOSE",`^${X[Y.GTLT]}\\s*(${X[Y.LOOSEPLAIN]})$|^$`);le("COMPARATOR",`^${X[Y.GTLT]}\\s*(${X[Y.FULLPLAIN]})$|^$`);le("COMPARATORTRIM",`(\\s*)${X[Y.GTLT]}\\s*(${X[Y.LOOSEPLAIN]}|${X[Y.XRANGEPLAIN]})`,!0);ni.comparatorTrimReplace="$1$2$3";le("HYPHELine truncated
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+dg+e+DC}var fg=!1;function mg(e,t){if(!e||fg)return"";fg=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var l=function(){throw Error()};if(Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(p){var f=p}Reflect.construct(e,[],l)}else{try{l.call()}catch(p){f=p}e.call(l.prototype)}}else{try{throw Error()}catch(p){f=p}(l=e())&&typeof l.catch=="function"&&l.catch(function(){})}}catch(p){if(p&&f&&typeof p.stack=="string")return[p.stack,f.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=r.DetermineComponentFrameRoot(),a=o[0],s=o[1];if(a&&s){var c=a.split(`
`),d=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes("DetermineComponentFrameRoot");)r++;for(;i<d.length&&!d[i].includes("DetermineComponentFrameRoot");)i++;if(r===c.length||i===d.length)for(r=c.length-1,i=d.length-1;1<=r&&0<=i&&c[r]!==d[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==d[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==d[i]){var m=`
`+c[r].replace(" at new "," at ");return e.displayName&&m.includes("<anonymous>")&&(m=m.replace("<anonymous>",e.displayName)),m}while(1<=r&&0<=i);break}}}finally{fg=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Yr(n):""}function MU(e,t){switch(e.tag){case 26:case 27:case 5:return Yr(e.type);case 16:return Yr("Lazy");case 13:return e.child!==t&&t!==null?Yr("Suspense Fallback"):Yr("Suspense");case 19:return Yr("SuspenseList");case 0:case 15:return mg(e.type,!1);case 11:return mg(e.type.render,!1);case 1:return mg(e.type,!0);case 31:return Yr("Activity");default:return""}}function RC(e){try{var t="",n=null;do t+=MU(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}var Kg=Object.prototype.hasOwnProperty,Zh=ht.unstable_scheduleCallback,pg=ht.unstable_cancelCallback,DU=ht.unstable_shouldYield,RU=ht.unstable_requestPaint,mn=ht.unstable_now,UU=ht.unstable_getCurrentPriorityLevel,dA=ht.unstable_ImmediatePriority,fA=ht.unstable_UserBlockingPriority,qu=ht.unstable_NormalPriority,PU=ht.unstable_LowPriority,mA=ht.unstable_IdlePriority,LU=ht.log,jU=ht.unstable_setDisableYieldValue,wl=null,pn=null;function cr(e){if(typeof LU=="function"&&jU(e),pn&&typeof pn.setStrictMode=="function")try{pn.setStrictMode(wl,e)}catch(t){}}var gn=Math.clz32?Math.clz32:VU,ZU=Math.log,qU=Math.LN2;function VU(e){return e>>>=0,e===0?32:31-(ZU(e)/qU|0)|0}var su=256,lu=262144,cu=4194304;function Jr(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function pd(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,o=e.suspendedLanes,a=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s!==0?(r=s&~o,r!==0?i=Jr(r):(a&=s,a!==0?i=Jr(a):n||(n=s&~e,n!==0&&(i=Jr(n))))):(s=r&~o,s!==0?i=Jr(s):a!==0?i=Jr(a):n||(n=r&~e,n!==0&&(i=Jr(n)))),i===0?0:t!==0&&t!==i&&!(t&o)&&(o=i&-i,n=t&-t,o>=n||o===32&&(n&4194048)!==0)?t:i}function $l(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function FU(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pA(){var e=cu;return cu<<=1,!(cu&62914560)&&(cu=4194304),e}function gg(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Cl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function HU(e,t,n,r,i,o){var a=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,d=e.hiddenUpdates;for(n=a&~n;0<n;){var m=31-gn(n),l=1<<m;s[m]=0,c[m]=-1;var f=d[m];if(f!==null)for(d[m]=null,m=0;m<f.length;m++){var p=f[m];p!==null&&(p.lane&=-536870913)}n&=~l}r!==0&&gA(e,r,0),o!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=o&~(a&~t))}function gA(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-gn(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function hA(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vA(e,t){var n=t&-t;return n=n&42?1:qh(n),n&(e.suspendedLanes|t)?0:n}function qh(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Vh(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yA(){var e=_e.p;return e!==0?e:(e=window.event,e===void 0?32:ZT(e.type))}function UC(e,t){var n=_e.p;try{return _e.p=e,t()}finally{_e.p=n}}var Ar=Math.random().toString(36).slice(2),Ct="__reactFiber$"+Ar,Wt="__reactProps$"+Ar,Ca="__reactContainer$"+Ar,Wg="__reactEvents$"+Ar,BU="__reactListeners$"+Ar,GU="__reactHandles$"+Ar,PC="__reactResources$"+Ar,El="__reactMarker$"+Ar;function Fh(e){delete e[Ct],delete e[Wt],delete e[Wg],delete e[BU],delete e[GU]}function Ko(e){var t=e[Ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ca]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=BE(e);e!==null;){if(n=e[Ct])return n;e=BE(e)}return t}e=n,n=e.parentNode}return null}function Ea(e){if(e=e[Ct]||e[Ca]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Bs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(I(33))}function sa(e){var t=e[PC];return t||(t=e[PC]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[El]=!0}var SA=new Set,bA={};function co(e,t){ga(e,t),ga(e+"Capture",t)}function ga(e,t){for(bA[e]=t,e=0;e<t.length;e++)SA.add(t[e])}var XU=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\Line truncated
`).replace(wP,"")}function TT(e,t){return t=LE(t),LE(e)===t}function Ie(e,t,n,r,i,o){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||ha(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&ha(e,""+r);break;case"className":uu(e,"class",r);break;case"tabIndex":uu(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":uu(e,n,r);break;case"style":EA(e,r,o);break;case"data":if(t!=="object"){uu(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Cu(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(n==="formAction"?(t!=="input"&&Ie(e,t,"name",i.name,i,null),Ie(e,t,"formEncType",i.formEncType,i,null),Ie(e,t,"formMethod",i.formMethod,i,null),Ie(e,t,"formTarget",i.formTarget,i,null)):(Ie(e,t,"encType",i.encType,i,null),Ie(e,t,"method",i.method,i,null),Ie(e,t,"target",i.target,i,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Cu(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=ki);break;case"onScroll":r!=null&&ge("scroll",e);break;case"onScrollEnd":r!=null&&ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(I(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(I(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Cu(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ge("beforetoggle",e),ge("toggle",e),$u(e,"popover",r);break;case"xlinkActuate":wi(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":wi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":wi(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":wi(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":wi(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":wi(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":wi(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":wi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":wi(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":$u(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=QU.get(n)||n,$u(e,n,r))}}function Th(e,t,n,r,i,o){switch(n){case"style":EA(e,r,o);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(I(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(I(60));e.innerHTML=n}}break;case"children":typeof r=="string"?ha(e,r):(typeof r=="number"||typeof r=="bigint")&&ha(e,""+r);break;case"onScroll":r!=null&&ge("scroll",e);break;case"onScrollEnd":r!=null&&ge("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ki);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"inne Line truncated
${p}`,y=this.plugin.app.vault.getAbstractFileByPath(l),x;return y instanceof Dl.TFile?(await this.plugin.app.vault.modify(y,h),x=y):x=await this.plugin.app.vault.create(l,h),a&&await this.plugin.app.workspace.getLeaf(!1).openFile(x),this.logger.log(`Chat exported to: ${l}`),l}catch(f){throw this.logger.error("Export error:",f),f}}async ensureFolderExists(t){this.plugin.app.vault.getAbstractFileByPath(t)||await this.plugin.app.vault.createFolder(t)}getSessionIdFromFile(t){var i;let n=this.plugin.app.metadataCache.getFileCache(t),r=(i=n==null?void 0:n.frontmatter)==null?void 0:i.session_id;return r!=null?r:null}resolveExportFilePath(t,n,r){let i=`${t}/${n}.md`,o=this.plugin.app.vault.getAbstractFileByPath(i);if(!(o instanceof Dl.TFile)||this.getSessionIdFromFile(o)===r)return i;for(let s=2;s<=100;s++){let c=`${t}/${n}_${s}.md`,d=this.plugin.app.vault.getAbstractFileByPath(c);if(!(d instanceof Dl.TFile)||this.getSessionIdFromFile(d)===r)return c}return this.logger.warn(`Too many export files with same base name: ${n}`),`${t}/${n}_101.md`}generateFileName(t){let r=this.plugin.settings.exportSettings.filenameTemplate||"agent_client_{date}_{time}",i=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0"),s=`${i}${o}${a}`,c=String(t.getHours()).padStart(2,"0"),d=String(t.getMinutes()).padStart(2,"0"),m=String(t.getSeconds()).padStart(2,"0"),l=`${c}${d}${m}`;return r.replace("{date}",s).replace("{time}",l)}generateFrontmatter(t,n,r,i){let o=this.plugin.settings.exportSettings,a=i.getFullYear(),s=String(i.getMonth()+1).padStart(2,"0"),c=String(i.getDate()).padStart(2,"0"),d=String(i.getHours()).padStart(2,"0"),m=String(i.getMinutes()).padStart(2,"0"),l=String(i.getSeconds()).padStart(2,"0"),f=`${a}-${s}-${c}T${d}:${m}:${l}`,p=o.frontmatterTag.trim()?`
tags: [${o.frontmatterTag.trim()}]`:"";return`---
created: ${f}
agentDisplayName: ${t}
agentId: ${n}
session_id: ${r}${p}
---`}async convertMessagesToMarkdown(t,n,r){let i=this.plugin.settings.exportSettings,o={exportFilePath:r,imageIndex:0,includeImages:i.includeImages,imageLocation:i.imageLocation,imageCustomFolder:i.imageCustomFolder},a=`# ${n}
`;for(let s of t){let c=s.timestamp.toLocaleTimeString(),d=s.role==="user"?"User":"Assistant";a+=`## ${c} - ${d}
`;for(let m of s.content)a+=await this.convertContentToMarkdown(m,o);a+=`
---
`}return a}async convertContentToMarkdown(t,n){switch(t.type){case"text":return t.text+`
`;case"text_with_context":{let r="";if(t.autoMentionContext){let{noteName:i,selection:o}=t.autoMentionContext;o?r+=`@[[${i}]]:${o.fromLine}-${o.toLine}
`:r+=`@[[${i}]]
`}return r+=t.text+`
`,r}case"agent_thought":return`> [!info]- Thinking
> ${t.text.split(`
`).join(`
> `)}
`;case"tool_call":return this.convertToolCallToMarkdown(t);case"terminal":return`### \u{1F5A5}\uFE0F Terminal: ${t.terminalId.slice(0,8)}
`;case"plan":return this.convertPlanToMarkdown(t);case"permission_request":return this.convertPermissionRequestToMarkdown(t);case"resource_link":return`[${t.name}](${t.uri})
`;case"image":if(!n.includeImages)return"";if(t.uri)return`![Image](${t.uri})
`;if(n.imageLocation==="base64")return`![Image](data:${t.mimeType};base64,${t.data})
`;try{return n.imageIndex++,`![[${(await this.saveImageAsAttachment(t.data,t.mimeType,n.exportFilePath,n.imageIndex,n.imageLocation,n.imageCustomFolder)).split("/").pop()}]]
`}catch(r){return this.logger.error(`Failed to save image as attachment: ${r}`),`![Image](data:${t.mimeType};base64,${t.data})
`}default:return""}}convertToolCallToMarkdown(t){let n=`### \u{1F527} ${t.title||"Tool"}
`;if(t.locations&&t.locations.length>0){let r=t.locations.map(i=>i.line!=null?`\`${i.path}:${i.line}\``:`\`${i.path}\``);n+=`**Locations**: ${r.join(", ")}
`}if(n+=`**Status**: ${t.status}
`,t.content&&t.content.length>0)for(let r of t.content)r.type==="diff"&&(n+=this.convertDiffToMarkdown(r));return n}convertDiffToMarkdown(t){let n=`**File**: \`${t.path}\`
`;if(t.oldText===null||t.oldText===void 0||t.oldText==="")return n+="```diff\n",t.newText.split(`
`).forEach(o=>{n+=`+ ${o}
`}),n+="```\n\n",n;let r=t.oldText.split(`
`),i=t.newText.split(`
`);return n+="```diff\n",r.forEach(o=>{n+=`- ${o}
`}),i.forEach(o=>{n+=`+ ${o}
`}),n+="```\n\n",n}convertPlanToMarkdown(t){let n=`> [!plan] Plan
`;for(let r of t.entries){let i=r.status==="completed"?"\u2705":r.status==="in_progress"?"\u{1F504}":"\u23F3";n+=`> ${i} ${r.content}
`}return n+=`
`,n}convertPermissionRequestToMarkdown(t){let n=t.isCancelled?"Cancelled":"Requested";return`### \u26A0\uFE0F Permission: ${t.toolCall.title||"Unknown"} (${n})
`}async saveImageAsAttachment(t,n,r,i,o,a){let s=this.getExtensionFromMimeType(n),m=`${r.replace(/\.md$/,"").split("/").pop()||"image"}_${String(i).padStart(3,"0")}.${s}`,l;if(o==="custom"){let p=a||"Agent Client";if(await this.ensureFolderExists(p),l=`${p}/${m}`,this.plugin.app.vault.getAbstractFileByPath(l)instanceof Dl.TFile)return this.logger.log(`Image already exists, skipping: ${l}`),l}else if(l=await this.plugin.app.fileManager.getAvailablePathForAttachment(m,r),!l.endsWith(m)){let p=l.replace(/ \d+(\.[^.]+)$/,"$1");return this.logger.log(`Image already exists, skipping: ${p}`),p}let f=this.base64ToArrayBuffer(t);return await this.plugin.app.vault.createBinary(l,f),this.logger.log(`Image saved as attachment: ${l}`),l}getExtensionFromMimeType(t){return{"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp"}[t]||"png"}base64ToArrayBuffer(t){let n=atob(t),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r.buffer}};var Zd=require("child_process"),rI=require("obsidian");var Pv=require("child_process"),go=require("obsidian");function tI(e){let t=e.replace(/%/g,"%%").replace(/"/g,'""');return/[\s&()<>|^]/.test(e)?`"${t}"`:t}function jv(){return process.env.SHELL?process.env.SHELL:go.Platform.isMacOS?"/bin/zsh":"/bin/sh"}function Lv(e){return`'${e.replace(/'/g,"'\\''")}'`}var Pd=null;function s6(){if(!go.Platform.isWin)return null;if(Pd!==null)return Pd;try{let e=(0,Pv.execSync)('reg query "HKLM\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment" /v Path',{encoding:"utf8",windowsHide:!0}),t=(0,Pv.execSync)('reg query "HKCU\\Environment" /v Path',{encoding:"utf8",windowsHide:!0}),n=nI(e),r=nI(t),i=[];return r&&i.push(r),n&&i.push(n),Pd=i.join(";"),Pd}catch(e){return null}}function nI(e){let t=e.split(`
`);for(let n of t){let r=n.trim();if(r.toLowerCase().startsWith("path")){let i=r.match(/Path\s+REG_(?:EXPAND_)?SZ\s+(.+)/i);if(i)return i[1].trim()}}return null}function Ld(e){if(!go.Platform.isWin)return e;let t=s6();if(!t)return e;let r=(e.PATH||"").split(";").filter(a=>a.length>0),i=t.split(";").filter(a=>a.length>0),o=[...r];for(let a of i)o.some(s=>s.toLowerCase()===a.toLowerCase())||o.push(a);return{...e,PATH:o.join(";")}}function Pn(e){let n=e.replace(/\\/g,"/").match(/^([A-Za-z]):(\/.*)/);if(n){let r=n[1].toLowerCase(),i=n[2];return`/mnt/${r}${i}`}return e}function iI(e){let t=e.match(/^\/mnt\/([a-zA-Z])\/(.*)/);if(t){let n=t[1].toUpperCase(),r=t[2].replace(/\//g,"\\");return`${n}:\\${r}`}return e}function Zv(e){let t=e.replace(/'/g,"'\\''");return`. ~/.profile 2>/dev/null; case \${SHELL:-/bin/sh} in */fish|*/elvish|*/nushell|*/xonsh) exec /bin/sh -l -c '${t}';; *) exec \${SHELL:-/bin/sh} -l -c '${t}';; esac`}function l6(e,t,n,r,i){if(/^\\\\/.test(n))throw new Error(`UNC paths are not supported in WSL mode: ${n}. Please use a local drive path.`);let o=Pn(n);if(o===n&&/^[A-Za-z]:[\\/]/.test(n))throw new Error(`Failed to convert Windows path to WSL format: ${n}`);let a=[];if(r){if(!/^[a-zA-Z0-9._-]+$/.test(r))throw new Error(`Invalid WSL distribution name: ${r}`);a.push("-d",r)}let s=t.map(Lv).join(" "),c=s.length>0?` ${s}`:"",d="";if(i){let l=Pn(i);d=`export PATH="${c6(l)}:$PATH"; `}let m=`${d}cd ${Lv(o)} && ${e}${c}`;return a.push("sh","-c",Zv(m)),{command:"C:\\Windows\\System32\\wsl.exe",args:a}}function c6(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function jd(e,t,n,r){var o;let i=(o=r.alwaysEscape)!=null?o:!0;if(go.Platform.isWin&&r.wslMode){let a=l6(e,t,n,r.wslDistribution,r.nodeDir);return{command:a.command,args:a.args,needsShell:!1}}if(go.Platform.isMacOS||go.Platform.isLinux){let a=jv(),s;return t.length>0||i?s=[e,...t].map(Lv).join(" "):s=e,r.nodeDir&&(s=`export PATH='${r.nodeDir.replace(/'/g,"'\\''")}':"$PATH"; ${s}`),{command:a,args:["-l","-c",s],needsShell:!1}}return t.length>0||i?{command:tI(e),args:t.map(tI),needsShell:!0}:{command:e,args:t,needsShell:!0}}function Ul(e){return e.startsWith("/")||/^[A-Za-z]:[\\/]/.test(e)}function oI(e){if(!e||e.trim().length===0)return Promise.resolve(null);let t=e.trim();return Ul(t)?Promise.resolve(t):new Promise(n=>{if(rI.Platform.isWin)(0,Zd.execFile)("where",[t],{timeout:5e3,windowsHide:!0},(r,i)=>{if(r){n(null);return}let o=i.split(`
`)[0].trim();n(o.length>0?o:null)});else{let r=jv(),i=t.replace(/'/g,"'\\''");(0,Zd.execFile)(r,["-l","-c",`which '${i}'`],{timeout:5e3},(o,a)=>{if(o){n(null);return}let s=a.split(`
`)[0].trim();n(s.length>0?s:null)})}})}function aI(e,t){if(!e||e.trim().length===0)return Promise.resolve(null);let n=e.trim();return Ul(n)?Promise.resolve(n):new Promise(r=>{let i=n.replace(/'/g,"'\\''"),o=[];t&&o.push("-d",t);let a=`which '${i}'`;o.push("sh","-c",Zv(a)),(0,Zd.execFile)("C:\\Windows\\System32\\wsl.exe",o,{timeout:5e3},(s,c)=>{if(s){r(null);return}let d=c.split(`
`)[0].trim();r(d.length>0?d:null)})})}function u6(e){if(!e)return null;let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t<=0?null:e.slice(0,t)}function qd(e){if(!e)return;let t=e.trim();if(Ul(t))return u6(t)||void 0}function sI(e,t){let n=t.replace(/\/+$/,""),r=e.replace(/\/+$/,"");return r.startsWith(n+"/")?r.slice(n.length+1):e}function Pl(e){let t=e.replace(/\\/g,"/");return/^[A-Za-z]:/.test(t)?`file:///${t}`:`file://${t}`}function lI(e,t,n,r,i,o,a,s){let c=Ne(),[d,m]=(0,Tt.useState)(null),[l,f]=(0,Tt.useState)(null),p=(0,Tt.useCallback)(async(P,V,O)=>{if((P==="newChat"?e.settings.exportSettings.autoExportOnNewChat:e.settings.exportSettings.autoExportOnCloseChat)&&V.length!==0&&O.sessionId)try{let w=new Rl(e),k=e.settings.exportSettings.openFileAfterExport,N=await w.exportToMarkdown(V,O.agentDisplayName,O.agentId,O.sessionId,O.createdAt,k);if(N){let j=P==="newChat"?"new session":"closing chat";new Xn.Notice(`[Agent Client] Chat exported to ${N}`),c.log(`Chat auto-exported before ${j}`)}}catch(w){new Xn.Notice("[Agent Client] Failed to export chat")}},[e,c]),h=Xn.Platform.isWin&&a.windowsWslMode,y=(0,Tt.useCallback)(async(P,V)=>{var k,N;t.clearError(),f(null);let O=o.length===0,L=[],w=[];if(V){for(let j of V)if(j.kind==="image"&&j.data)L.push({type:"image",data:j.data,mimeType:j.mimeType});else if(j.kind==="file"&&j.path){let F=j.path;h&&(F=Pn(F)),w.push({type:"resource_link",uri:Pl(F),name:(N=(k=j.name)!=null?k:j.path.split("/").pop())!=null?N:"file",mimeType:j.mimeType||void 0,size:j.size})}}await t.sendMessage(P,{activeNote:a.autoMentionActiveNote?r.mentions.activeNote:null,vaultBasePath:s,isAutoMentionDisabled:r.mentions.isAutoMentionDisabled,images:L.length>0?L:void 0,resourceLinks:w.length>0?w:void 0}),O&&i.sessionId&&(await n.saveSessionLocally(i.sessionId,P),c.log(`[ChatPanel] Session saved locally: ${i.sessionId}`))},[t.clearError,t.sendMessage,o.length,i.sessionId,n.saveSessionLocally,c,a.autoMentionActiveNote,r.mentions.activeNote,r.mentions.isAutoMentionDisabled,h,s]),x=(0,Tt.useCallback)(async()=>{c.log("Cancelling current operation...");let P=t.lastUserMessage;await t.cancelOperation(),P&&m(P)},[c,t.cancelOperation,t.lastUserMessage]),S=(0,Tt.useCallback)(async P=>{let V=P&&P!==i.agentId;if(o.length===0&&!V){new Xn.Notice("[Agent Client] Already a new session");return}t.isSending&&await t.cancelOperation(),c.log(`[Debug] Creating new session${V?` with agent: ${P}`:""}...`),o.length>0&&await p("newChat",o,i),r.mentions.toggleAutoMention(!1),t.clearMessages();let O=V?P:i.agentId;await t.restartSession(O),n.invalidateCache()},[o,i,c,p,t.isSending,t.cancelOperation,t.clearMessages,t.restartSession,r.mentions.toggleAutoMention,n.invalidateCache]),g=(0,Tt.useCallback)(async()=>{if(o.length===0){new Xn.Notice("[Agent Client] No messages to export");return}try{let P=new Rl(e),V=e.settings.exportSettings.openFileAfterExport,O=await P.exportToMarkdown(o,i.agentDisplayName,i.agentId,i.sessionId||"unknown",i.createdAt,V);new Xn.Notice(`[Agent Client] Chat exported to ${O}`)}catch(P){new Xn.Notice("[Agent Client] Failed to export chat"),c.error("Export error:",P)}},[o,i,e,c]),b=(0,Tt.useCallback)(async P=>{P!==i.agentId&&await S(P)},[i.agentId,S]),v=(0,Tt.useCallback)(async()=>{c.log("[ChatPanel] Restarting agent process..."),o.length>0&&await p("newChat",o,i),t.clearMessages();try{await t.forceRestartAgent(),new Xn.Notice("[Agent Client] Agent restarted")}catch(P){new Xn.Notice("[Agent Client] Failed to restart agent"),c.error("Restart error:",P)}},[c,o,i,p,t.clearMessages,t.forceRestartAgent]),_=(0,Tt.useCallback)(async P=>{await t.setMode(P)},[t.setMode]),C=(0,Tt.useCallback)(async P=>{await t.setModel(P)},[t.setModel]),E=(0,Tt.useCallback)(async(P,V)=>{await t.setConfigOption(P,V)},[t.setConfigOption]),A=(0,Tt.useCallback)(()=>{t.clearError()},[t.clearError]),T=(0,Tt.useCallback)(()=>{f(null)},[]),M=(0,Tt.useCallback)(()=>{m(null)},[]);return{handleSendMessage:y,handleStopGeneration:x,handleNewChat:S,handleExportChat:g,handleSwitchAgent:b,handleRestartAgent:v,handleSetMode:_,handleSetModel:C,handleSetConfigOption:E,handleClearError:A,handleClearAgentUpdate:T,handleRestoredMessageConsumed:M,restoredMessage:d,agentUpdateNotification:l,setAgentUpdateNotification:f,autoExportIfEnabled:p}}var cI=require("obsidian"),Ll=class extends cI.Modal{constructor(n,r,i){super(n);this.currentPath=r,this.onSelect=i}onOpen(){let{contentEl:n}=this;n.empty(),n.createEl("h2",{text:"New chat in directory"}),n.createEl("p",{text:"Start a new chat session with the agent working in the specified directory.",cls:"agent-client-change-dir-description"});let r=n.createDiv({cls:"agent-client-change-dir-input-row"}),i=r.createEl("input",{type:"text",cls:"agent-client-change-dir-input",placeholder:"/path/to/directory"});i.value=this.currentPath,r.createEl("button",{text:"Browse..."}).addEventListener("click",()=>{this.openFolderPicker().then(s=>{s&&(i.value=s)})}),setTimeout(()=>{i.focus(),i.select()},10),i.addEventLis Line truncated
`))return null;a=o,s=t}let c={start:i,end:s,query:a};return n.log("[detectMention] Mention context:",c),c}function fI(e,t,n){let r=e.slice(0,t.start),i=e.slice(t.end),o=` @[[${n}]] `,a=r+o+i,s=t.start+o.length;return{newText:a,newCursorPos:s}}function mI(e,t){let n=/@\[\[([^\]]+)\]\]/g,r=Array.from(e.matchAll(n)),i=[],o=new Set;for(let a of r){let s=a[1];if(o.has(s))continue;o.add(s);let c=t.getAllFiles().find(d=>d.basename===s);i.push({noteTitle:s,file:c})}return i}function pI(e,t,n){let[r,i]=(0,Xe.useState)([]),[o,a]=(0,Xe.useState)(0),[s,c]=(0,Xe.useState)(null),[d,m]=(0,Xe.useState)(null),[l,f]=(0,Xe.useState)(!1),p=r.length>0&&s!==null,[h,y]=(0,Xe.useState)([]),[x,S]=(0,Xe.useState)(0),g=h.length>0,b=(0,Xe.useCallback)(w=>{f(w===void 0?k=>!k:w)},[]),v=(0,Xe.useCallback)(async(w,k)=>{let N=dI(w,k);if(!N){i([]),a(0),c(null);return}let j=await e.searchNotes(N.query);i(j),a(0),c(N)},[e,t]),_=(0,Xe.useCallback)((w,k)=>{if(!s)return w;let{newText:N}=fI(w,s,k.name);return i([]),a(0),c(null),N},[s]),C=(0,Xe.useCallback)(w=>{if(!p)return;let k=r.length-1;a(N=>w==="down"?Math.min(N+1,k):Math.max(N-1,0))},[p,r.length]),E=(0,Xe.useCallback)(()=>{i([]),a(0),c(null)},[]),A=(0,Xe.useCallback)(async()=>{let w=await e.getActiveNote();m(w)},[e]),T=(0,Xe.useCallback)((w,k)=>{let N=h.length>0;if(!w.startsWith("/")){N&&b(!1),y([]),S(0);return}let F=w.slice(0,k).slice(1);if(F.includes(" ")){y([]),S(0),b(!0);return}let K=F.toLowerCase(),ne=n.filter(ue=>ue.name.toLowerCase().includes(K));y(ne),S(0),b(!0)},[n,b,h.length]),M=(0,Xe.useCallback)((w,k)=>{let N=`/${k.name} `;return y([]),S(0),N},[]),P=(0,Xe.useCallback)(w=>{if(h.length===0)return;let k=h.length-1;S(N=>w==="down"?Math.min(N+1,k):Math.max(N-1,0))},[h.length]),V=(0,Xe.useCallback)(()=>{y([]),S(0)},[]),O=(0,Xe.useMemo)(()=>({suggestions:r,selectedIndex:o,isOpen:p,context:s,updateSuggestions:v,selectSuggestion:_,navigate:C,close:E,activeNote:d,isAutoMentionDisabled:l,toggleAutoMention:b,updateActiveNote:A}),[r,o,p,s,v,_,C,E,d,l,b,A]),L=(0,Xe.useMemo)(()=>({suggestions:h,selectedIndex:x,isOpen:g,updateSuggestions:T,selectSuggestion:M,navigate:P,close:V}),[h,x,g,T,M,P,V]);return(0,Xe.useMemo)(()=>({mentions:O,commands:L}),[O,L])}var A6=G(Ce());var d6=G(Ce());var jl=e=>{if(e==null)return null;let t=(()=>{if(typeof e=="number")return e;if(typeof e=="string"){let n=e.trim();return n.length===0||!/^-?\d+$/.test(n)?Number.NaN:Number.parseInt(n,10)}return Number.NaN})();return Number.isFinite(t)?Math.min(30,Math.max(10,Math.round(t))):null},Oa=e=>Array.isArray(e)?e.map(t=>typeof t=="string"?t.trim():"").filter(t=>t.length>0):typeof e=="string"?e.split(/\r?\n/).map(t=>t.trim()).filter(t=>t.length>0):[],ho=e=>{let t=[];if(!e)return t;if(Array.isArray(e)){for(let r of e)if(r&&typeof r=="object"){let i=r,o="key"in i?i.key:void 0,a="value"in i?i.value:void 0;typeof o=="string"&&o.trim().length>0&&t.push({key:o.trim(),value:typeof a=="string"?a:""})}}else if(typeof e=="object")for(let[r,i]of Object.entries(e))typeof r=="string"&&r.trim().length>0&&t.push({key:r.trim(),value:typeof i=="string"?i:""});let n=new Set;return t.filter(r=>n.has(r.key)?!1:(n.add(r.key),!0))},gI=e=>{let t=e&&typeof e.id=="string"&&e.id.trim().length>0?e.id.trim():"custom-agent",n=e&&typeof e.displayName=="string"&&e.displayName.trim().length>0?e.displayName.trim():t;return{id:t,displayName:n,command:e&&typeof e.command=="string"&&e.command.trim().length>0?e.command.trim():"",args:Oa(e==null?void 0:e.args),env:ho(e==null?void 0:e.env)}},hI=e=>{let t=new Set;return e.map(n=>{let r=n.id&&n.id.trim().length>0?n.id.trim():"custom-agent",i=r,o=2;for(;t.has(i);)i=`${r}-${o}`,o+=1;return t.add(i),{...n,id:i}})},vI=(e,t)=>{let n=e.env.reduce((r,{key:i,value:o})=>(r[i]=o,r),{});return{id:e.id,displayName:e.displayName,command:e.command,args:e.args,env:n,workingDirectory:t}};function tt(e,t){return typeof e=="string"?e:t}function en(e,t){return typeof e=="boolean"?e:t}function Vd(e,t,n){return typeof e!="number"||n!==void 0&&e<n?t:e}function Fd(e,t,n){return t.includes(e)?e:n}function di(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function qv(e){let t={},n=di(e);if(!n)return t;for(let[r,i]of Object.entries(n))typeof r=="string"&&r.length>0&&typeof i=="string"&&i.length>0&&(t[r]=i);return t}function Vv(e){let t=di(e);return!t||typeof t.x!="number"||typeof t.y!="number"?null:{x:t.x,y:t.y}}function Hd(e){return e.defaultAgentId||e.claude.id}function Fv(e){return[{id:e.claude.id,displayName:e.claude.displayName||e.claude.id},{id:e.codex.id,displayName:e.codex.displayName||e.codex.id},{id:e.gemini.id,displayName:e.gemini.displayName||e.gemini.id},...e.customAgents.map(t=>({id:t.id,displayName:t.displayName||t.id}))]}function Hv(e,t){let n=t||Hd(e);return Fv(e).find(i=>i.id===n)||{id:n,displayName:n}}function yI(e,t){return t===e.claude.id?e.claude:t===e.codex.id?e.codex:t===e.gemini.id?e.gemini:e.customAgents.find(r=>r.id===t)||null}function SI(e,t,n,r){let i=vI(t,r);if(n===e.claude.id){let o=t;return{...i,env Line truncated
`).slice(t.from.line,t.to.line+1).join(`
`),c=s.length>r;return{text:c?s.substring(0,r):s,wasTruncated:c,originalLength:s.length}}catch(i){return console.error(`Failed to read selection from ${e}:`,i),null}}function TI(e,t){return!e||t?"":e.selection?`@[[${e.name}]]:${e.selection.from.line+1}-${e.selection.to.line+1}
`:`@[[${e.name}]]
`}function II(e){return[...e.message?[{type:"text",text:e.message}]:[],...e.images||[],...e.resourceLinks||[]]}function kI(e,t){if(!(!e||t))return{noteName:e.name,notePath:e.path,selection:e.selection?{fromLine:e.selection.from.line+1,toLine:e.selection.to.line+1}:void 0}}function NI(e,t,n){let r=t?`${t}/${e}`:e;return n&&(r=Pn(r)),r}async function OI(e,t,n){let r=mI(e.message,n);return e.supportsEmbeddedContext?v6(e,t,r):y6(e,t,r)}async function v6(e,t,n){var c,d,m,l;let r=(c=e.maxNoteLength)!=null?c:CI,i=[];for(let{file:f}of n){if(!f)continue;let p=await AI(f,e.vaultBasePath,t,(d=e.convertToWsl)!=null?d:!1,r);if(!p)continue;let h=p.wasTruncated?p.content+`
[Note: Truncated from ${p.originalLength} to ${r} characters]`:p.content;i.push({type:"resource",resource:{uri:p.uri,mimeType:"text/markdown",text:h},annotations:{audience:["assistant"],priority:1,lastModified:p.lastModified}})}let o=[];if(e.activeNote&&!e.isAutoMentionDisabled){let f=await S6(e.activeNote,e.vaultBasePath,t,(m=e.convertToWsl)!=null?m:!1,(l=e.maxSelectionLength)!=null?l:EI);o.push(...f)}let a=TI(e.activeNote,e.isAutoMentionDisabled),s=[...i,...o,...e.message||a?[{type:"text",text:a+e.message}]:[],...e.images||[],...e.resourceLinks||[]];return{displayContent:II(e),agentContent:s,autoMentionContext:kI(e.activeNote,e.isAutoMentionDisabled)}}async function y6(e,t,n){var c,d,m,l;let r=(c=e.maxNoteLength)!=null?c:CI,i=[];for(let{file:f}of n){if(!f)continue;let p=await AI(f,e.vaultBasePath,t,(d=e.convertToWsl)!=null?d:!1,r);if(!p)continue;let h=p.wasTruncated?`
[Note: This note was truncated. Original length: ${p.originalLength} characters, showing first ${r} characters]`:"";i.push(`<obsidian_mentioned_note ref="${p.absolutePath}">
${p.content}${h}
</obsidian_mentioned_note>`)}if(e.activeNote&&!e.isAutoMentionDisabled){let f=await b6(e.activeNote.path,e.vaultBasePath,t,(m=e.convertToWsl)!=null?m:!1,e.activeNote.selection,(l=e.maxSelectionLength)!=null?l:EI);i.push(f)}let o=TI(e.activeNote,e.isAutoMentionDisabled),a=i.length>0?i.join(`
`)+`
`+o+e.message:o+e.message,s=[...a?[{type:"text",text:a}]:[],...e.images||[],...e.resourceLinks||[]];return{displayContent:II(e),agentContent:s,autoMentionContext:kI(e.activeNote,e.isAutoMentionDisabled)}}async function S6(e,t,n,r,i){let o=NI(e.path,t,r),a=Pl(o);if(e.selection){let s=e.selection.from.line+1,c=e.selection.to.line+1,d=await zI(e.path,e.selection,n,i);if(!d)return[{type:"text",text:`The user has selected lines ${s}-${c} in ${a}. If relevant, use the Read tool to examine the specific lines.`}];let m=d.wasTruncated?d.text+`
[Note: Truncated from ${d.originalLength} to ${i} characters]`:d.text;return[{type:"resource",resource:{uri:a,mimeType:"text/markdown",text:m},annotations:{audience:["assistant"],priority:.8,lastModified:new Date(e.modified).toISOString()}},{type:"text",text:`The user has selected lines ${s}-${c} in the above note. This is what they are currently focusing on.`}]}return[{type:"text",text:`The user has opened the note ${a} in Obsidian. This may or may not be related to the current conversation. If it seems relevant, consider using the Read tool to examine its content.`}]}async function b6(e,t,n,r,i,o){let a=NI(e,t,r);if(i){let s=i.from.line+1,c=i.to.line+1,d=await zI(e,i,n,o);if(!d)return`<obsidian_opened_note selection="lines ${s}-${c}">The user opened the note ${a} in Obsidian and is focusing on lines ${s}-${c}. This may or may not be related to the current conversation. If it seems relevant, consider using the Read tool to examine the specific lines.</obsidian_opened_note>`;let m=d.wasTruncated?`
[Note: The selection was truncated. Original length: ${d.originalLength} characters, showing first ${o} characters]`:"";return`<obsidian_opened_note selection="lines ${s}-${c}">
The user opened the note ${a} in Obsidian and selected the following text (lines ${s}-${c}):
${d.text}${m}
This is what the user is currently focusing on.
</obsidian_opened_note>`}return`<obsidian_opened_note>The user opened the note ${a} in Obsidian. This may or may not be related to the current conversation. If it seems relevant, consider using the Read tool to examine the content.</obsidian_opened_note>`}async function MI(e,t){try{return await t.sendPrompt(e.sessionId,e.agentContent),{success:!0,displayContent:e.displayContent,agentContent:e.agentContent}}catch(n){return await x6(n,e.sessionId,e.agentContent,e.displayContent,e.authMethods,t)}}async function x6(e,t,n,r,i,o){if(Gd(e))return{success:!0,displayContent:r,agentContent:n};if(Vl(e)===lt.AUTHENTICATION_REQUIRED&&i&&i.length>0){if(i.length===1){let s=await _6(t,n,r,i[0].id,o);if(s)return s}return{success:!1,displayContent:r,agentContent:n,requiresAuth:!0,error:Bd(e,t)}}return{success:!1,displayContent:r,agentContent:n,error:Bd(e,t)}}async function _6(e,t,n,r,i){try{return await i.authenticate(r)?(await i.sendPrompt(e,t),{success:!0,displayContent:n,agentContent:t,retriedSuccessfully:!0}):null}catch(o){return{success:!1,displayContent:n,agentContent:t,error:Bd(o,e)}}}var LI=require("obsidian");function DI(e,t){let n=e.content||[];if(t.content!==void 0){let r=t.content||[];r.some(o=>o.type==="diff")&&(n=n.filter(o=>o.type!=="diff")),n=[...n,...r]}return{...e,toolCallId:t.toolCallId,title:t.title!==void 0?t.title:e.title,kind:t.kind!==void 0?t.kind:e.kind,status:t.status!==void 0?t.status:e.status,content:n,locations:t.locations!==void 0?t.locations:e.locations,rawInput:t.rawInput!==void 0&&Object.keys(t.rawInput).length>0?t.rawInput:e.rawInput,permissionRequest:t.permissionRequest!==void 0?t.permissionRequest:e.permissionRequest}}function Jv(e,t){if(e.length===0||e[e.length-1].role!=="assistant"){let i={id:crypto.randomUUID(),role:"assistant",content:[t],timestamp:new Date};return[...e,i]}let r={...e[e.length-1]};if(t.type==="text"||t.type==="agent_thought"){let i=r.content.findIndex(o=>o.type===t.type);if(i>=0){let o=r.content[i];(o.type==="text"||o.type==="agent_thought")&&(r.content[i]={type:t.type,text:o.text+t.text})}else r.content.push(t)}else{let i=r.content.findIndex(o=>o.type===t.type);i>=0?r.content[i]=t:r.content.push(t)}return[...e.slice(0,-1),r]}function w6(e,t){if(e.length===0||e[e.length-1].role!=="user"){let i={id:crypto.randomUUID(),role:"user",content:[t],timestamp:new Date};return[...e,i]}let r={...e[e.length-1]};if(t.type==="text"){let i=r.content.findIndex(o=>o.type==="text");if(i>=0){let o=r.content[i];o.type==="text"&&(r.content[i]={type:"text",text:o.text+t.text})}else r.content.push(t)}else{let i=r.content.findIndex(o=>o.type===t.type);i>=0?r.content[i]=t:r.content.push(t)}return[...e.slice(0,-1),r]}function $6(e,t,n){let r=n.get(t.toolCallId);if(r!==void 0&&r<e.length){let a=e[r];if(a.content.some(c=>c.type==="tool_call"&&c.toolCallId===t.toolCallId)){let c={...a,content:a.content.map(m=>m.type==="tool_call"&&m.toolCallId===t.toolCallId?DI(m,t):m)},d=[...e];return d[r]=c,d}}let i=!1,o=e.map((a,s)=>a.content.some(d=>d.type==="tool_call"&&d.toolCallId===t.toolCallId)?(i=!0,n.set(t.toolCallId,s),{...a,content:a.content.map(d=>d.type==="tool_call"&&d.toolCallId===t.toolCallId?DI(d,t):d)}):a);return i?o:(n.set(t.toolCallId,e.length),[...e,{id:crypto.randomUUID(),role:"assistant",content:[t],timestamp:new Date}])}function Kv(e,t){t.clear(),e.forEach((n,r)=>{for(let i of n.content)i.type==="tool_call"&&t.set(i.toolCallId,r)})}function RI(e,t,n){switch(t.type){case"agent_message_chunk":return Jv(e,{type:"text",text:t.text});case"agent_thought_chunk":return Jv(e,{type:"agent_thought",text:t.text});case"user_message_chunk":return w6(e,{type:"text",text:t.text});case"tool_call":case"tool_call_update":return $6(e,{type:"tool_call",toolCallId:t.toolCallId,title:t.title,status:t.status||"pending",kind:t.kind,content:t.content,locations:t.locations,rawInput:t.rawInput,permissionRequest:t.permissionRequest},n);case"plan":return Jv(e,{type:"plan",entries:t.entries});default:return e}}function UI(e){for(let t of e)for(let n of t.content)if(n.type==="tool_call"){let r=n.permissionRequest;if(r!=null&&r.isActive)return{requestId:r.requestId,toolCallId:n.toolCallId,options:r.options}}return null}function Wv(e,t,n){for(let r of t){let i=e.find(o=>o.kind===r);if(i)return i}if(n){let r=e.find(n);if(r)return r}return e[0]}var{useState:Qv,useCallback:jn,useMemo:PI,useRef:Xd,useEffect:E6}=C6;function jI(e,t,n,r,i){let[o,a]=Qv([]),[s,c]=Qv(!1),[d,m]=Qv(null),l=Xd(new Map),f=Xd(!1),p=Xd([]),h=Xd(!1),y=jn(()=>{h.current=!1;let L=p.current;L.length!==0&&(p.current=[],a(w=>{let k=w;for(let N of L)k=RI(k,N,l.current);return k}))},[]),x=jn(L=>{f.current||(p.current.push(L),h.current||(h.current=!0,requestAnimationFrame(y)))},[y]);E6(()=>()=>{p.current=[],h.current=!1,l.current.clear()},[]);let S=jn(L=>{a(w=>[...w,L])},[]),g=jn(L=>{f.current=L},[]),b=jn(()=>{a([]),l.current.clear(),m(null),c(!1),i(null)},[i]),v=jn(L=>{let w=L.map(k=>({id:crypto.randomUUID(),role:k.role,content:k.content.map(N=>({type:N.type,teLine truncated
Run the following in your terminal:`,suggestion:`npm uninstall -g ${e.name} && npm install -g ${t}`};let n=M6[e.name];if(!n||!e.version)return null;try{let r=await R6(n);if(r&&Da.valid(e.version)&&Da.gt(r,e.version))return{variant:"info",title:"Agent Update Available",message:`${n}: ${e.version} \u2192 ${r}.
Run the following in your terminal:`,suggestion:`npm install -g ${n}@latest`}}catch(r){}return null}async function R6(e){var r;let n=(await(0,VI.requestUrl)({url:`https://registry.npmjs.org/${e}/latest`})).json;return n.version&&(r=Da.clean(n.version))!=null?r:null}var j6=G(Ce()),Fl=require("obsidian");var U6=G(Ce()),ty=require("obsidian"),ny=G(ve()),{useRef:HI,useEffect:BI,useImperativeHandle:P6,forwardRef:L6}=U6;function Yn({name:e,className:t}){let n=HI(null);return BI(()=>{n.current&&(0,ty.setIcon)(n.current,e)},[e]),(0,ny.jsx)("span",{ref:n,className:t})}var Yd=L6(function({iconName:t,tooltip:n,onClick:r},i){let o=HI(null);return P6(i,()=>o.current,[]),BI(()=>{o.current&&(0,ty.setIcon)(o.current,t)},[t]),(0,ny.jsx)("button",{ref:o,title:n,onClick:r,className:"clickable-icon agent-client-header-button"})});var Ge=G(ve()),{useRef:Kd,useEffect:iy}=j6;function Jd({icon:e,label:t,onClick:n}){let r=Kd(null);return iy(()=>{r.current&&(0,Fl.setIcon)(r.current,e)},[e]),(0,Ge.jsx)("div",{ref:r,className:"clickable-icon nav-action-button","aria-label":t,onClick:n})}function Z6({agentLabel:e,isUpdateAvailable:t,hasHistoryCapability:n=!1,onNewChat:r,onExportChat:i,onShowMenu:o,onOpenHistory:a}){return(0,Ge.jsx)("div",{className:"nav-header agent-client-chat-view-header",children:(0,Ge.jsxs)("div",{className:"nav-buttons-container",children:[(0,Ge.jsx)("span",{className:"agent-client-chat-view-header-title",children:e}),t&&(0,Ge.jsx)("span",{className:"agent-client-chat-view-header-update",children:"Plugin update available!"}),(0,Ge.jsx)(Jd,{icon:"plus",label:"New chat",onClick:r}),a&&(0,Ge.jsx)(Jd,{icon:"history",label:"Session history",onClick:a}),(0,Ge.jsx)(Jd,{icon:"save",label:"Export chat to Markdown",onClick:i}),(0,Ge.jsx)(Jd,{icon:"more-vertical",label:"More",onClick:o})]})})}function q6({agentLabel:e,availableAgents:t,currentAgentId:n,isUpdateAvailable:r,onAgentChange:i,onShowMenu:o,onMinimize:a,onClose:s}){let c=Kd(null),d=Kd(null),m=Kd(i);return m.current=i,iy(()=>{let l=c.current;if(l){if(t.length<=1){d.current&&(l.empty(),d.current=null);return}if(!d.current){let f=new Fl.DropdownComponent(l);d.current=f;for(let p of t)f.addOption(p.id,p.displayName);n&&f.setValue(n),f.onChange(p=>{var h;(h=m.current)==null||h.call(m,p)})}return()=>{d.current&&(l.empty(),d.current=null)}}},[t]),iy(()=>{d.current&&n&&d.current.setValue(n)},[n]),(0,Ge.jsxs)("div",{className:"agent-client-inline-header agent-client-inline-header-floating",children:[(0,Ge.jsx)("div",{className:"agent-client-inline-header-main",children:t.length>1?(0,Ge.jsxs)("div",{className:"agent-client-agent-selector",children:[(0,Ge.jsx)("div",{ref:c}),(0,Ge.jsx)("span",{className:"agent-client-agent-selector-icon",ref:l=>{l&&(0,Fl.setIcon)(l,"chevron-down")}})]}):(0,Ge.jsx)("span",{className:"agent-client-agent-label",children:e})}),r&&(0,Ge.jsx)("p",{className:"agent-client-chat-view-header-update",children:"Plugin update available!"}),(0,Ge.jsxs)("div",{className:"agent-client-inline-header-actions",children:[(0,Ge.jsx)(Yd,{iconName:"more-vertical",tooltip:"More",onClick:o}),a&&(0,Ge.jsx)(Yd,{iconName:"minimize-2",tooltip:"Minimize",onClick:a}),s&&(0,Ge.jsx)(Yd,{iconName:"x",tooltip:"Close",onClick:s})]})]})}function ry(e){return e.variant==="floating"?(0,Ge.jsx)(q6,{...e}):(0,Ge.jsx)(Z6,{...e})}var fL=G(Ce()),_k=require("obsidian");var by=G(Ce()),xy=require("obsidian");var V6=G(Ce()),Ir=require("obsidian");var GI=G(ve()),{useRef:F6,useEffect:H6}=V6;function oy({text:e,plugin:t}){let n=F6(null);return H6(()=>{var d;let r=n.current;if(!r)return;(d=r.empty)==null||d.call(r),r.classList.add("markdown-rendered");let i=new Ir.Component;i.load(),Ir.MarkdownRenderer.render(t.app,e,r,"",i);let o=t.app.vault.adapter instanceof Ir.FileSystemAdapter?t.app.vault.adapter.getBasePath():null,a=Ir.Platform.isWin&&t.settings.windowsWslMode,s=o?o.replace(/\\/g,"/").replace(/\/+$/,""):null,c=m=>{let f=m.target.closest("a.internal-link");if(f){m.preventDefault();let p=f.getAttribute("data-href");if(p){let h=decodeURIComponent(p);a&&h.startsWith("/mnt/")&&(h=iI(h));let y=h.replace(/\\/g,"/");if(s&&y.startsWith(s+"/")){let x=y.slice(s.length+1);t.app.workspace.openLinkText(x,"")}else Ul(h)||t.app.workspace.openLinkText(h,"")}}};return r.addEventListener("click",c),()=>{r.removeEventListener("click",c),i.unload()}},[e,t]),(0,GI.jsx)("div",{ref:n,className:"agent-client-markdown-text-renderer"})}var ly=G(Ce());var sy=G(ve()),{useState:ay,useRef:B6,useEffect:XI}=ly,Wd=ly.memo(function({terminalId:t,terminalClient:n,plugin:r}){let i=Ne(),[o,a]=ay(""),[s,c]=ay(null),[d,m]=ay(!0),l=B6(null);return i.log(`[TerminalBlock] Component rendered for terminal ${t}, terminalClient: ${!!n}`),XI(()=>{if(i.log(`[TerminalBlock] useEffect triggered for ${t}, terminalClient: ${!!n}`),!t||!n)return;let f=async()=>{var p,h;try{let y=await n.getTerminalOutput(t);i.log(`[TerminalBlock] Poll result for ${t}:`,y),a(y.output),y.exitStatus&&(c({exitCode:(p=y.exitStatus.exitCode)!=null?p:null,signal: Line truncated
`))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
`))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
`)&&(t=t.slice(0,-1)),n.endsWith(`
`)&&(n=n.slice(0,-1))),super.equals(t,n,r)}},Y6=new vy;function yy(e,t,n){return Y6.diff(e,t,n)}function J6(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let i=0;i<r.length;i++){let o=r[i];i%2&&!t.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}function Sy(e,t,n,r,i,o,a){let s;a?typeof a=="function"?s={callback:a}:s=a:s={},typeof s.context=="undefined"&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){let{callback:m}=s;yy(n,r,Object.assign(Object.assign({},s),{callback:l=>{let f=d(l);m(f)}}))}else return d(yy(n,r,s));function d(m){if(!m)return;m.push({value:"",lines:[]});function l(g){return g.map(function(b){return" "+b})}let f=[],p=0,h=0,y=[],x=1,S=1;for(let g=0;g<m.length;g++){let b=m[g],v=b.lines||K6(b.value);if(b.lines=v,b.added||b.removed){if(!p){let _=m[g-1];p=x,h=S,_&&(y=c>0?l(_.lines.slice(-c)):[],p-=y.length,h-=y.length)}for(let _ of v)y.push((b.added?"+":"-")+_);b.added?S+=v.length:x+=v.length}else{if(p)if(v.length<=c*2&&g<m.length-2)for(let _ of l(v))y.push(_);else{let _=Math.min(v.length,c);for(let E of l(v.slice(0,_)))y.push(E);let C={oldStart:p,oldLines:x-p+_,newStart:h,newLines:S-h+_,lines:y};f.push(C),p=0,h=0,y=[]}x+=v.length,S+=v.length}}for(let g of f)for(let b=0;b<g.lines.length;b++)g.lines[b].endsWith(`
`)?g.lines[b]=g.lines[b].slice(0,-1):(g.lines.splice(b+1,0,"\\ No newline at end of file"),b++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:o,hunks:f}}}function K6(e){let t=e.endsWith(`
`),n=e.split(`
`).map(r=>r+`
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var we=G(ve()),{useState:tk,useMemo:nk}=Bl,rk=Bl.memo(function({content:t,plugin:n,terminalClient:r,onApprovePermission:i}){let{kind:o,title:a,status:s,toolCallId:c,permissionRequest:d,locations:m,rawInput:l,content:f}=t,[p,h]=tk(d==null?void 0:d.selectedOptionId);Bl.useEffect(()=>{(d==null?void 0:d.selectedOptionId)!==p&&h(d==null?void 0:d.selectedOptionId)},[d==null?void 0:d.selectedOptionId]);let y=nk(()=>{let g=n.app.vault.adapter;return g instanceof ik.FileSystemAdapter?g.getBasePath():""},[n]),x=n.settings.displaySettings.showEmojis;return(0,we.jsxs)("div",{className:"agent-client-message-tool-call",children:[(0,we.jsxs)("div",{className:"agent-client-message-tool-call-header",children:[(0,we.jsxs)("div",{className:"agent-client-message-tool-call-title",children:[x&&(0,we.jsx)(Yn,{name:(g=>{switch(g){case"read":return"book-open";case"edit":return"pencil";case"delete":return"trash";case"move":return"folder-open";case"search":return"search";case"execute":return"square-terminal";case"think":return"message-circle-more";case"fetch":return"globe";case"switch_mode":return"arrow-left-right";default:return"hammer"}})(o),className:"agent-client-message-tool-call-icon"}),(0,we.jsx)("span",{className:"agent-client-message-tool-call-title-text",children:a}),s!=="completed"&&(0,we.jsx)(Yn,{name:s==="failed"?"x":"ellipsis",className:`agent-client-message-tool-call-status-icon agent-client-status-${s}`})]}),o==="execute"&&l&&typeof l.command=="string"&&(0,we.jsx)("div",{className:"agent-client-message-tool-call-command",children:(0,we.jsxs)("code",{children:[l.command,Array.isArray(l.args)&&l.args.length>0&&` ${l.args.join(" ")}`]})}),m&&m.length>0&&(0,we.jsx)("div",{className:"agent-client-message-tool-call-locations",children:m.map((g,b)=>(0,we.jsxs)("span",{className:"agent-client-message-tool-call-location",children:[sI(g.path,y),g.line!=null&&`:${g.line}`]},b))})]}),f&&f.map((g,b)=>g.type==="terminal"?(0,we.jsx)(Wd,{terminalId:g.terminalId,terminalClient:r||null,plugin:n},b):g.type==="diff"?(0,we.jsx)(nL,{diff:g,plugin:n,autoCollapse:n.settings.displaySettings.autoCollapseDiffs,collapseThreshold:n.settings.displaySettings.diffCollapseThreshold},b):null),d&&(0,we.jsx)(YI,{permissionRequest:{...d,selectedOptionId:p},toolCallId:c,plugin:n,onApprovePermission:i,onOptionSelected:h})]})});function ek(e){return e.oldText===null||e.oldText===void 0||e.oldText===""}function Q6(e){return e.map(t=>({type:t.added?"added":t.removed?"removed":"context",value:t.value}))}function eL(e,t){let n=e.filter(r=>!(t==="removed"&&r.type==="added"||t==="added"&&r.type==="removed"));return(0,we.jsx)(we.Fragment,{children:n.map((r,i)=>r.type==="added"?(0,we.jsx)("span",{className:"agent-client-diff-word-added",children:r.value},i):r.type==="removed"?(0,we.jsx)("span",{className:"agent-client-diff-word-removed",children:r.value},i):(0,we.jsx)("span",{children:r.value},i))})}var tL=3;function nL({diff:e,autoCollapse:t=!1,collapseThreshold:n=10}){let r=nk(()=>{if(ek(e))return e.newText.split(`
`).map((x,S)=>({type:"added",newLineNumber:S+1,content:x}));let m=e.oldText||"",l=Sy("old","new",m,e.newText,"","",{context:tL}),f=[],p=0,h=0;for(let y of l.hunks){l.hunks.length>1&&f.push({type:"context",content:`@@ -${y.oldStart},${y.oldLines} +${y.newStart},${y.newLines} @@`}),p=y.oldStart,h=y.newStart;for(let x of y.lines){let S=x[0],g=x.substring(1);S==="+"?f.push({type:"added",newLineNumber:h++,content:g}):S==="-"?f.push({type:"removed",oldLineNumber:p++,content:g}):f.push({type:"context",oldLineNumber:p++,newLineNumber:h++,content:g})}}for(let y=0;y<f.length-1;y++){let x=f[y],S=f[y+1];if(x.type==="removed"&&S.type==="added"){let g=hy(x.content,S.content),b=Q6(g);x.wordDiff=b,S.wordDiff=b}}return f},[e.oldText,e.newText]),i=(m,l)=>{if(m.type==="context"&&m.content.startsWith("@@"))return(0,we.jsx)("div",{className:"agent-client-diff-hunk-header",children:m.content},l);let p="agent-client-diff-line";return m.type==="added"?p+=" agent-client-diff-line-added":m.type==="removed"?p+=" agent-client-diff-line-removed":p+=" agent-client-diff-line-context",(0,we.jsx)("div",{className:p,children:(0,we.jsx)("span",{className:"agent-client-diff-line-content",children:m.wordDiff&&(m.type==="added"||m.type==="removed")?eL(m.wordDiff,m.type):m.content})},l)},o=t&&r.length>n,[a,s]=tk(o),c=a?r.slice(0,n):r,d=r.length-n;return(0,we.jsxs)("div",{className:"agent-client-tool-call-diff",children:[ek(e)?(0,we.jsx)("div",{className:"agent-client-diff-line-info",children:"New file"}):null,(0,we.jsx)("div",{className:"agent-client-tool-call-diff-content",children:c.map((m,l)=>i(m,l))}),o&&(0,we.jsxs)("div",{className:"agent-client-diff-expand-bar",onClick:()=>s(!a),children:[(0,we.jsx)("span",{className:"agent-client-diff-expand-text",children:a?`${d} more lines`:"Collapse"}),(0,we.jsx)(Yn,{name:a?"chevron-right":"chevron-up",className:"agent-client-diff-expand-icon"})]})]})}var ye=G(ve()),{useState:lk,useCallback:ok}=by;function ak({text:e,plugin:t,autoMentionContext:n}){let r=/@\[\[([^\]]+)\]\]/g,i=[];if(n){let s=n.selection?`@${n.noteName}:${n.selection.fromLine}-${n.selection.toLine}`:`@${n.noteName}`;i.push((0,ye.jsx)("span",{className:"agent-client-text-mention",onClick:()=>{t.app.workspace.openLinkText(n.notePath,"")},children:s},"auto-mention")),i.push(`
`)}let o=0,a;for(;(a=r.exec(e))!==null;){a.index>o&&i.push(e.slice(o,a.index));let s=a[1],c=t.app.vault.getMarkdownFiles().find(d=>d.basename===s);c?i.push((0,ye.jsxs)("span",{className:"agent-client-text-mention",onClick:()=>{t.app.workspace.openLinkText(c.path,"")},children:["@",s]},a.index)):i.push(`@${s}`),o=a.index+a[0].length}return o<e.length&&i.push(e.slice(o)),(0,ye.jsx)("div",{className:"agent-client-text-with-mentions",children:i})}function iL({text:e,plugin:t}){let[n,r]=lk(!1),i=t.settings.displaySettings.showEmojis;return(0,ye.jsxs)("div",{className:"agent-client-collapsible-thought",onClick:()=>r(!n),children:[(0,ye.jsxs)("div",{className:"agent-client-collapsible-thought-header",children:[i&&(0,ye.jsx)(Yn,{name:"lightbulb",className:"agent-client-collapsible-thought-label-icon"}),"Thinking",(0,ye.jsx)(Yn,{name:n?"chevron-down":"chevron-right",className:"agent-client-collapsible-thought-icon"})]}),n&&(0,ye.jsx)("div",{className:"agent-client-collapsible-thought-content",children:(0,ye.jsx)(oy,{text:e,plugin:t})})]})}function sk({content:e,plugin:t,messageId:n,messageRole:r,terminalClient:i,onApprovePermission:o}){switch(e.type){case"text":return r==="user"?(0,ye.jsx)(ak,{text:e.text,plugin:t}):(0,ye.jsx)(oy,{text:e.text,plugin:t});case"text_with_context":return(0,ye.jsx)(ak,{text:e.text,autoMentionContext:e.autoMentionContext,plugin:t});case"agent_thought":return(0,ye.jsx)(iL,{text:e.text,plugin:t});case"tool_call":return(0,ye.jsx)(rk,{content:e,plugin:t,terminalClient:i,onApprovePermission:o});case"plan":{let a=t.settings.displaySettings.showEmojis;return(0,ye.jsxs)("div",{className:"agent-client-message-plan",children:[(0,ye.jsxs)("div",{className:"agent-client-message-plan-title",children:[a&&(0,ye.jsx)(Yn,{name:"list-checks",className:"agent-client-message-plan-label-icon"}),"Plan"]}),e.entries.map((s,c)=>(0,ye.jsxs)("div",{className:`agent-client-message-plan-entry agent-client-plan-status-${s.status}`,children:[a&&(0,ye.jsx)("span",{className:`agent-client-message-plan-entry-icon agent-client-status-${s.status}`,children:(0,ye.jsx)(Yn,{name:s.status==="completed"?"check":s.status==="in_progress"?"loader":"circle"})})," ",s.content]},c))]})}case"terminal":return(0,ye.jsx)(Wd,{terminalId:e.terminalId,terminalClient:i||null,plugin:t});case"image":return(0,ye.jsx)("div",{className:"agent-client-message-image",children:(0,ye.jsx)("img",{src:`data:${e.mimeType};base64,${e.data}`,alt:"Attached image",className:"agent-client-message-image-thumbnail"})});case"resource_link":return(0,ye.jsxs)("div",{className:"agent-client-message-resource-link",children:[(0,ye.jsx)("span",{className:"agent-client-message-resource-link-icon",ref:a=>{a&&(0,xy.setIcon)(a,"file")}}),(0,ye.jsx)("span",{className:"agent-client-message-resource-link-name",children:e.name})]});default:return(0,ye.jsx)("span",{children:"Unsupported content type"})}}function rL(e){return e.filter(t=>t.type==="text"||t.type==="text_with_context").map(t=>"text"in t?t.text:"").join(`
`)}function oL({contents:e}){let[t,n]=lk(!1),r=ok(()=>{let o=rL(e);o&&navigator.clipboard.writeText(o).then(()=>{n(!0),setTimeout(()=>n(!1),2e3)}).catch(()=>{})},[e]),i=ok(o=>{o&&(0,xy.setIcon)(o,t?"check":"copy")},[t]);return(0,ye.jsx)("button",{className:"clickable-icon agent-client-message-action-button",onClick:r,"aria-label":"Copy message",ref:i})}function aL(e){let t=[],n=[];for(let r of e)r.type==="image"||r.type==="resource_link"?n.push(r):(n.length>0&&(t.push({type:"attachments",items:n}),n=[]),t.push({type:"single",item:r}));return n.length>0&&t.push({type:"attachments",items:n}),t}var ck=by.memo(function({message:t,plugin:n,terminalClient:r,onApprovePermission:i}){let o=aL(t.content);return(0,ye.jsxs)("div",{className:`agent-client-message-renderer ${t.role==="user"?"agent-client-message-user":"agent-client-message-assistant"}`,children:[o.map((a,s)=>a.type==="attachments"?(0,ye.jsx)("div",{className:"agent-client-message-images-strip",children:a.items.map((c,d)=>(0,ye.jsx)(sk,{content:c,plugin:n,messageId:t.id,messageRole:t.role,terminalClient:r,onApprovePermission:i},d))},s):(0,ye.jsx)("div",{children:(0,ye.jsx)(sk,{content:a.item,plugin:n,messageId:t.id,messageRole:t.role,terminalClient:r,onApprovePermission:i})},s)),t.content.some(a=>(a.type==="text"||a.type==="text_with_context")&&a.text)&&(0,ye.jsx)("div",{className:"agent-client-message-actions",children:(0,ye.jsx)(oL,{contents:t.content})})]})});var Nr=G(Ce(),1),bk=G(ug(),1);function yo(e,t,n){var s;let r=(s=n.initialDeps)!=null?s:[],i,o=!0;function a(){var c,d,m;let l;n.key&&((c=n.debug)!=null&&c.call(n))&&(l=Date.now());let f=e();if(!(f.length!==r.length||f.some((y,x)=>r[x]!==y)))return i;r=f;let h;if(n.key&&((d=n.debug)!=null&&d.call(n))&&(h=Date.now()),i=t(...f),n.key&&((m=n.debug)!=null&&m.call(n))){let y=Math.round((Date.now()-l)*100)/100,x=Math.round((Date.now()-h)*100)/100,S=x/16,g=(b,v)=>{for(b=String(b);b.length<v;)b=" "+b;return b};console.info(`%c\u23F1 ${g(x,5)} /${g(y,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*S,120))}deg 100% 31%);`,n==null?void 0:n.key)}return n!=null&&n.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(i),o=!1,i}return a.updateDeps=c=>{r=c},a}function _y(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}var uk=(e,t)=>Math.abs(e-t)<1.01,dk=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};var fk=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},sL=e=>e,lL=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let i=t;i<=n;i++)r.push(i);return r},gk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=a=>{let{width:s,height:c}=a;t({width:Math.round(s),height:Math.round(c)})};if(i(fk(n)),!r.ResizeObserver)return()=>{};let o=new r.ResizeObserver(a=>{let s=()=>{let c=a[0];if(c!=null&&c.borderBoxSize){let d=c.borderBoxSize[0];if(d){i({width:d.inlineSize,height:d.blockSize});return}}i(fk(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},mk={passive:!0};var pk=typeof window=="undefined"?!0:"onscrollend"in window,hk=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=0,o=e.options.useScrollendEvent&&pk?()=>{}:dk(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=m=>()=>{let{horizontal:l,isRtl:f}=e.options;i=l?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(i,m)},s=a(!0),c=a(!1);n.addEventListener("scroll",s,mk);let d=e.options.useScrollendEvent&&pk;return d&&n.addEventListener("scrollend",c,mk),()=>{n.removeEventListener("scroll",s),d&&n.removeEventListener("scrollend",c)}};var cL=(e,t,n)=>{if(t!=null&&t.borderBoxSize){let r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]};var vk=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;let a=e+t;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:a,behavior:n})},rf=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.now=()=>{var o;var n,r,i;return(o=(i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))!=null?o:Date.now()},this.observer=(()=>{let n=null,r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{let a=()=>{let s=o.target,c=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);return}this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(s,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,i])=>{typeof i=="undefined"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:sL,rangeExtractor:lL,onChange:()=>{},measureElement:cL,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=yo(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var i;var n;let r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(i=(n=this.scrollElement)==null?void 0:n.window)!=nu Line truncated
$${m.cost.amount.toFixed(2)}`:`${sf(m.used)} / ${sf(m.size)} tokens`,children:[Math.round(m.used/m.size*100),"%"]}),c&&c.length>0?(0,qt.jsx)("div",{ref:y,className:"agent-client-config-options-container"}):(0,qt.jsxs)(qt.Fragment,{children:[i&&i.availableModes.length>1&&(0,qt.jsxs)("div",{className:"agent-client-mode-selector",title:(M=(T=i.availableModes.find(O=>O.id===i.currentModeId))==null?void 0:T.description)!=null?M:"Select mode",children:[(0,qt.jsx)("div",{ref:p}),(0,qt.jsx)("span",{className:"agent-client-mode-selector-icon",ref:O=>{O&&(0,Or.setIcon)(O,"chevron-down")}})]}),a&&a.availableModels.length>1&&(0,qt.jsxs)("div",{className:"agent-client-model-selector",title:(V=(P=a.availableModels.find(O=>O.modelId===a.currentModelId))==null?void 0:P.description)!=null?V:"Select model",children:[(0,qt.jsx)("div",{ref:h}),(0,qt.jsx)("span",{className:"agent-client-model-selector-icon",ref:O=>{O&&(0,Or.setIcon)(O,"chevron-down")}})]})]}),(0,qt.jsx)("button",{ref:f,onClick:r,disabled:t,className:`agent-client-chat-send-button ${e?"sending":""} ${t?"agent-client-disabled":""}`,title:l?e?"Stop generation":"Send message":"Connecting..."})]})}var vt=G(ve()),{useRef:cf,useState:Ey,useEffect:lf,useCallback:ct,useMemo:wL}=_L,Ik=5,$L=Ik*1024*1024,Ay=10,Tk=["image/png","image/jpeg","image/gif","image/webp"];function CL(e,t){let n=cf(-1),r=cf(null),i=wL(()=>e.filter(s=>s.role==="user").map(s=>{let c=s.content.find(d=>d.type==="text"||d.type==="text_with_context");return c&&"text"in c?c.text:""}).filter(s=>s.trim()!==""),[e]),o=ct((s,c)=>{if(!c||s.nativeEvent.isComposing||i.length===0)return!1;if(n.current!==-1&&(s.key==="ArrowLeft"||s.key==="ArrowRight"||r.current!==null&&c.value!==r.current))return n.current=-1,r.current=null,!1;if(s.key==="ArrowUp"){if(c.value.trim()!==""&&n.current===-1)return!1;s.preventDefault();let d=n.current+1;if(d>=i.length)return!0;n.current=d;let m=i[i.length-1-d];return r.current=m,t(m),window.setTimeout(()=>{c.selectionStart=m.length,c.selectionEnd=m.length},0),!0}if(s.key==="ArrowDown"){let d=n.current;if(d===-1)return!1;s.preventDefault();let m=d-1;if(n.current=m,m===-1)r.current=null,t("");else{let l=i[i.length-1-m];r.current=l,t(l),window.setTimeout(()=>{c.selectionStart=l.length,c.selectionEnd=l.length},0)}return!0}return!1},[i,t]),a=ct(()=>{n.current=-1,r.current=null},[]);return{handleHistoryKeyDown:o,resetHistory:a}}function kk({isSending:e,isSessionReady:t,isRestoringSession:n,agentLabel:r,availableCommands:i,autoMentionEnabled:o,restoredMessage:a,suggestions:s,plugin:c,view:d,onSendMessage:m,onStopGeneration:l,onRestoredMessageConsumed:f,modes:p,onModeChange:h,models:y,onModelChange:x,configOptions:S,onConfigOptionChange:g,usage:b,supportsImages:v=!1,agentId:_,inputValue:C,onInputChange:E,attachedFiles:A,onAttachedFilesChange:T,errorInfo:M,onClearError:P,agentUpdateNotification:V,onClearAgentUpdate:O,messages:L}){var $s;let{mentions:w,commands:k}=s,N=Ne(),j=Tr(c),F=c.settings.displaySettings.showEmojis,K=($s=c.app.vault.getConfig("spellcheck"))!=null?$s:!0,[ne,ue]=Ey(null),[Ue,ft]=Ey(""),[Wn,wt]=Ey(!1),{handleHistoryKeyDown:Qn,resetHistory:No}=CL(L,E),mt=cf(null),xi=cf(0);lf(()=>{T([])},[_,T]);let Oo=ct(q=>{if(q.length===0)return;let Q=Ay-A.length;if(Q<=0){new mi.Notice(`[Agent Client] Maximum ${Ay} attachments allowed`);return}let se=q.slice(0,Q);se.length<q.length&&new mi.Notice(`[Agent Client] Maximum ${Ay} attachments allowed`),T([...A,...se])},[A,T]),Cp=ct(q=>{T(A.filter(Q=>Q.id!==q))},[A,T]),Mc=ct(async q=>new Promise((Q,se)=>{let pe=new FileReader;pe.onload=()=>{let _n=pe.result.split(",")[1];Q(_n)},pe.onerror=se,pe.readAsDataURL(q)}),[]),Mo=ct(async q=>{let Q=[];for(let se of q){if(se.size>$L){new mi.Notice(`[Agent Client] Image too large (max ${Ik}MB)`);continue}try{let pe=await Mc(se);Q.push({id:crypto.randomUUID(),kind:"image",data:pe,mimeType:se.type})}catch(pe){console.error("Failed to convert image:",pe),new mi.Notice("[Agent Client] Failed to attach image")}}return Q},[Mc]),Ji=ct(q=>{let{webUtils:Q}=require("electron"),se=[];for(let pe of q){let St=Q.getPathForFile(pe);if(!St){new mi.Notice("[Agent Client] Could not determine file path");continue}se.push({id:crypto.randomUUID(),kind:"file",mimeType:pe.type||"application/octet-stream",name:pe.name,path:St,size:pe.size})}return se},[]),Ep=ct(async q=>{var _n;let Q=(_n=q.clipboardData)==null?void 0:_n.items;if(!Q)return;let se=[],pe=[];for(let sn of Array.from(Q)){if(sn.kind!=="file")continue;let wn=sn.getAsFile();wn&&(Tk.includes(sn.type)?se.push(wn):pe.push(wn))}if(se.length===0&&pe.length===0)return;q.preventDefault();let St=[];if(se.length>0)if(v)St.push(...await Mo(se));else{let sn=Ji(se);sn.length>0?St.push(...sn):new mi.Notice("[Agent Client] This agent does not support image paste. Try drag & drop instead.")}pe.length>0&&St.push(...Ji(pe)),Oo(St)},[v,Mo,Ji,Oo]),Ap=ct(q=>{var Q;(Q=q.dataTransfer)!=null&&Q.types.includes("Files")&&(q.preventDefault(),q.dataTransfer.dropEffect="copy")},[]),zp=ct(q=>{var Q;(Q=q Line truncated
--another=value`).setValue(this.formatArgs(r.args)).onChange(async c=>{this.plugin.settings.customAgents[i].args=this.parseArgs(c),await this.plugin.saveSettings()}),s.inputEl.rows=3}),new J.Setting(o).setName("Environment variables").setDesc("Enter KEY=VALUE pairs, one per line. (Stored as plain text)").addTextArea(s=>{s.setPlaceholder("TOKEN=...").setValue(this.formatEnv(r.env)).onChange(async c=>{this.plugin.settings.customAgents[i].env=this.parseEnv(c),await this.plugin.saveSettings()}),s.inputEl.rows=3})}generateCustomAgentDisplayName(){let n="Custom agent",r=new Set;r.add(this.plugin.settings.claude.displayName||this.plugin.settings.claude.id),r.add(this.plugin.settings.codex.displayName||this.plugin.settings.codex.id),r.add(this.plugin.settings.gemini.displayName||this.plugin.settings.gemini.id);for(let a of this.plugin.settings.customAgents)r.add(a.displayName||a.id);if(!r.has(n))return n;let i=2,o=`${n} ${i}`;for(;r.has(o);)i+=1,o=`${n} ${i}`;return o}generateCustomAgentId(){let n="custom-agent",r=new Set(this.plugin.settings.customAgents.map(a=>a.id));if(!r.has(n))return n;let i=2,o=`${n}-${i}`;for(;r.has(o);)i+=1,o=`${n}-${i}`;return o}addInstallHint(n,r){let i=`npm install -g ${r}@latest`,o=document.createDocumentFragment();o.append("Not installed? Run in terminal: "),o.appendChild(document.createElement("code")).textContent=i,new J.Setting(n).setDesc(o).addButton(a=>{a.setButtonText("Copy").onClick(()=>{navigator.clipboard.writeText(i).then(()=>{a.setButtonText("Copied!"),setTimeout(()=>{a.setButtonText("Copy")},1500)},()=>{})})})}addAutoDetectButton(n,r,i){n.addButton(o=>{let a=J.Platform.isWin&&this.plugin.settings.windowsWslMode,s=J.Platform.isWin&&!a?"where":"which";o.setButtonText("Auto-detect").setTooltip(`Run \`${s} ${r}\` to find the path`).onClick(async()=>{o.setButtonText("Detecting\u2026"),o.setDisabled(!0);try{let c=a?await aI(r,this.plugin.settings.windowsWslDistribution||void 0):await oI(r);c?(await i(c),this.display()):(o.setButtonText("Not found"),setTimeout(()=>{o.setButtonText("Auto-detect"),o.setDisabled(!1)},2e3))}catch(c){o.setButtonText("Error"),setTimeout(()=>{o.setButtonText("Auto-detect"),o.setDisabled(!1)},2e3)}})})}formatArgs(n){return n.join(`
`)}parseArgs(n){return n.split(/\r?\n/).map(r=>r.trim()).filter(r=>r.length>0)}formatEnv(n){return n.map(r=>{var i;return`${r.key}=${(i=r.value)!=null?i:""}`}).join(`
`)}parseEnv(n){let r=[];for(let i of n.split(/\r?\n/)){let o=i.trim();if(!o)continue;let a=o.indexOf("=");if(a===-1)continue;let s=o.slice(0,a).trim(),c=o.slice(a+1).trim();s&&r.push({key:s,value:c})}return ho(r)}};var a$=require("child_process");var u={};ei(u,{$brand:()=>_f,$input:()=>ex,$output:()=>Qb,NEVER:()=>Dy,TimePrecision:()=>rx,ZodAny:()=>X_,ZodArray:()=>W_,ZodBase64:()=>Ym,ZodBase64URL:()=>Jm,ZodBigInt:()=>gs,ZodBigIntFormat:()=>Qm,ZodBoolean:()=>ps,ZodCIDRv4:()=>Gm,ZodCIDRv6:()=>Xm,ZodCUID:()=>jm,ZodCUID2:()=>Zm,ZodCatch:()=>bw,ZodCodec:()=>sp,ZodCustom:()=>Ac,ZodCustomStringFormat:()=>fs,ZodDate:()=>_c,ZodDefault:()=>pw,ZodDiscriminatedUnion:()=>ew,ZodE164:()=>Km,ZodEmail:()=>Um,ZodEmoji:()=>Pm,ZodEnum:()=>us,ZodError:()=>dZ,ZodExactOptional:()=>dw,ZodFile:()=>cw,ZodFirstPartyTypeKind:()=>Nw,ZodFunction:()=>Tw,ZodGUID:()=>vc,ZodIPv4:()=>Hm,ZodIPv6:()=>Bm,ZodISODate:()=>km,ZodISODateTime:()=>Im,ZodISODuration:()=>Om,ZodISOTime:()=>Nm,ZodIntersection:()=>tw,ZodIssueCode:()=>mZ,ZodJWT:()=>Wm,ZodKSUID:()=>Fm,ZodLazy:()=>Ew,ZodLiteral:()=>lw,ZodMAC:()=>Z_,ZodMap:()=>aw,ZodNaN:()=>_w,ZodNanoID:()=>Lm,ZodNever:()=>J_,ZodNonOptional:()=>op,ZodNull:()=>B_,ZodNullable:()=>mw,ZodNumber:()=>ms,ZodNumberFormat:()=>To,ZodObject:()=>$c,ZodOptional:()=>rp,ZodPipe:()=>ap,ZodPrefault:()=>hw,ZodPromise:()=>zw,ZodReadonly:()=>ww,ZodRealError:()=>on,ZodRecord:()=>Ec,ZodSet:()=>sw,ZodString:()=>ds,ZodStringFormat:()=>Me,ZodSuccess:()=>Sw,ZodSymbol:()=>F_,ZodTemplateLiteral:()=>Cw,ZodTransform:()=>uw,ZodTuple:()=>iw,ZodType:()=>fe,ZodULID:()=>qm,ZodURL:()=>xc,ZodUUID:()=>Si,ZodUndefined:()=>H_,ZodUnion:()=>Cc,ZodUnknown:()=>Y_,ZodVoid:()=>K_,ZodXID:()=>Vm,ZodXor:()=>Q_,_ZodString:()=>Rm,_default:()=>gw,_function:()=>_O,any:()=>eO,array:()=>wc,base64:()=>UN,base64url:()=>PN,bigint:()=>YN,boolean:()=>V_,catch:()=>xw,check:()=>wO,cidrv4:()=>DN,cidrv6:()=>RN,clone:()=>Vt,codec:()=>SO,coerce:()=>lp,config:()=>We,core:()=>yi,cuid:()=>AN,cuid2:()=>zN,custom:()=>$O,date:()=>nO,decode:()=>M_,decodeAsync:()=>R_,describe:()=>CO,discriminatedUnion:()=>lO,e164:()=>LN,email:()=>vN,emoji:()=>CN,encode:()=>O_,encodeAsync:()=>D_,endsWith:()=>ts,enum:()=>np,exactOptional:()=>fw,file:()=>gO,flattenError:()=>oc,float32:()=>HN,float64:()=>BN,formatError:()=>ac,fromJSONSchema:()=>NO,function:()=>_O,getErrorMap:()=>gZ,globalRegistry:()=>It,gt:()=>hi,gte:()=>Ft,guid:()=>yN,hash:()=>FN,hex:()=>VN,hostname:()=>qN,httpUrl:()=>$N,includes:()=>Qa,instanceof:()=>AO,int:()=>Dm,int32:()=>GN,int64:()=>JN,intersection:()=>nw,ipv4:()=>NN,ipv6:()=>MN,iso:()=>Ao,json:()=>TO,jwt:()=>jN,keyof:()=>iO,ksuid:()=>kN,lazy:()=>Aw,length:()=>Eo,literal:()=>pO,locales:()=>wo,looseObject:()=>aO,looseRecord:()=>uO,lowercase:()=>Ka,lt:()=>gi,lte:()=>xn,mac:()=>ON,map:()=>dO,maxLength:()=>Co,maxSize:()=>jr,meta:()=>EO,mime:()=>ns,minLength:()=>Yi,minSize:()=>vi,multipleOf:()=>Lr,nan:()=>yO,nanoid:()=>EN,nativeEnum:()=>mO,negative:()=>bm,never:()=>ep,nonnegative:()=>_m,nonoptional:()=>yw,nonpositive:()=>xm,normalize:()=>is,null:()=>G_,nullable:()=>Sc,nullish:()=>hO,number:()=>q_,object:()=>rO,optional:()=>yc,overwrite:()=>Kn,parse:()=>T_,parseAsync:()=>I_,partialRecord:()=>cO,pipe:()=>bc,positive:()=>Sm,prefault:()=>vw,preprocess:()=>IO,prettifyError:()=>Gy,promise:()=>xO,property:()=>wm,readonly:()=>$w,record:()=>ow,refine:()=>Iw,regex:()=>Ja,regexes:()=>bn,registry:()=>Wf,safeDecode:()=>P_,safeDecodeAsync:()=>j_,safeEncode:()=>U_,safeEncodeAsync:()=>L_,safeParse:()=>k_,safeParseAsync:()=>N_,set:()=>fO,setErrorMap:()=>pZ,size:()=>$o,slugify:()=>ss,startsWith:()=>es,strictObject:()=>oO,string:()=>Mm,stringFormat:()=>ZN,stringbool:()=>zO,success:()=>vO,superRefine:()=>kw,symbol:()=>WN,templateLiteral:()=>bO,toJSONSchema:()=>Am,toLowerCase:()=>os,toUpperCase:()=>as,transform:()=>ip,treeifyError:()=>By,trim:()=>rs,tuple:()=>rw,uint32:()=>XN,uint64:()=>KN,ulid:()=>TN,undefined:()=>QN,union:()=>tp,unknown:()=>zo,uppercase:()=>Wa,url:()=>wN,util:()=>U,uuid:()=>SN,uuidv4:()=>bN,uuidv6:()=>xN,uuidv7:()=>_N,void:()=>tO,xid:()=>IN,xor:()=>sO});var yi={};ei(yi,{$ZodAny:()=>xb,$ZodArray:()=>Eb,$ZodAsyncError:()=>Jn,$ZodBase64:()=>db,$ZodBase64URL:()=>fb,$ZodBigInt:()=>Hf,$ZodBigIntFormat:()=>vb,$ZodBoolean:()=>uc,$ZodCIDRv4:()=>lb,$ZodCIDRv6:()=>cb,$ZodCUID:()=>JS,$ZodCUID2:()=>KS,$ZodCatch:()=>Fb,$ZodCheck:()=>Re,$ZodCheckBigIntFormat:()=>ES,$ZodCheckEndsWith:()=>PS,$ZodCheckGreaterThan:()=>Pf,$ZodCheckIncludes:()=>RS,$ZodCheckLengthEquals:()=>NS,$ZodCheckLessThan:()=>Uf,$ZodCheckLowerCase:()=>MS,$ZodCheckMaxLength:()=>IS,$ZodCheckMaxSize:()=>AS,$ZodCheckMimeType:()=>jS,$ZodCheckMinLength:()=>kS,$ZodCheckMinSize:()=>zS,$ZodCheckMultipleOf:()=>$S,$ZodCheckNumberFormat:()=>CS,$ZodCheckOverwrite:()=>ZS,$ZodCheckProperty:()=>LS,$ZodCheckRegex:()=>OS,$ZodCheckSizeEquals:()=>TS,$ZodCheckStartsWith:()=>US,$ZodCheckStringFormat:()=>Xa,$ZodCheckUpperCase:()=>DS,$ZodCodec:()=>fc,$ZodCustom:()=>Wb,$ZodCustomStringFormat:()=>gb,$ZodDate:()=>Cb,$ZodDefault:()=>jb,$ZodDiscriminatedUnion:()=>T Line truncated
`)}var Fa=e=>(t,n,r,i)=>{var s;let o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new Jn;if(a.issues.length){let c=new((s=i==null?void 0:i.Err)!=null?s:e)(a.issues.map(d=>nn(d,o,We())));throw $f(c,i==null?void 0:i.callee),c}return a.value},Cf=Fa(rn),Ha=e=>async(t,n,r,i)=>{var s;let o=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new((s=i==null?void 0:i.Err)!=null?s:e)(a.issues.map(d=>nn(d,o,We())));throw $f(c,i==null?void 0:i.callee),c}return a.value},Ef=Ha(rn),Ba=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Jn;return o.issues.length?{success:!1,error:new(e!=null?e:rc)(o.issues.map(a=>nn(a,i,We())))}:{success:!0,data:o.value}},Xy=Ba(rn),Ga=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>nn(a,i,We())))}:{success:!0,data:o.value}},Yy=Ga(rn),Af=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fa(e)(t,n,i)},uj=Af(rn),zf=e=>(t,n,r)=>Fa(e)(t,n,r),dj=zf(rn),Tf=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ha(e)(t,n,i)},fj=Tf(rn),If=e=>async(t,n,r)=>Ha(e)(t,n,r),mj=If(rn),kf=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ba(e)(t,n,i)},pj=kf(rn),Nf=e=>(t,n,r)=>Ba(e)(t,n,r),gj=Nf(rn),Of=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ga(e)(t,n,i)},hj=Of(rn),Mf=e=>async(t,n,r)=>Ga(e)(t,n,r),vj=Mf(rn);var bn={};ei(bn,{base64:()=>dS,base64url:()=>Df,bigint:()=>vS,boolean:()=>SS,browserEmail:()=>Cj,cidrv4:()=>cS,cidrv6:()=>uS,cuid:()=>Jy,cuid2:()=>Ky,date:()=>mS,datetime:()=>gS,domain:()=>zj,duration:()=>nS,e164:()=>fS,email:()=>rS,emoji:()=>oS,extendedDuration:()=>yj,guid:()=>iS,hex:()=>Tj,hostname:()=>Aj,html5Email:()=>_j,idnEmail:()=>$j,integer:()=>yS,ipv4:()=>aS,ipv6:()=>sS,ksuid:()=>eS,lowercase:()=>_S,mac:()=>lS,md5_base64:()=>kj,md5_base64url:()=>Nj,md5_hex:()=>Ij,nanoid:()=>tS,null:()=>bS,number:()=>Rf,rfc5322Email:()=>wj,sha1_base64:()=>Mj,sha1_base64url:()=>Dj,sha1_hex:()=>Oj,sha256_base64:()=>Uj,sha256_base64url:()=>Pj,sha256_hex:()=>Rj,sha384_base64:()=>jj,sha384_base64url:()=>Zj,sha384_hex:()=>Lj,sha512_base64:()=>Vj,sha512_base64url:()=>Fj,sha512_hex:()=>qj,string:()=>hS,time:()=>pS,ulid:()=>Wy,undefined:()=>xS,unicodeEmail:()=>Yk,uppercase:()=>wS,uuid:()=>xo,uuid4:()=>Sj,uuid6:()=>bj,uuid7:()=>xj,xid:()=>Qy});var Jy=/^[cC][^\s-]{8,}$/,Ky=/^[0-9a-z]+$/,Wy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qy=/^[0-9a-vA-V]{20}$/,eS=/^[A-Za-z0-9]{27}$/,tS=/^[a-zA-Z0-9_-]{21}$/,nS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,iS=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,xo=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Sj=xo(4),bj=xo(6),xj=xo(7),rS=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_j=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,wj=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Yk=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,$j=Yk,Cj=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Ej="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function oS(){return new RegExp(Ej,"u")}var aS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,sS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,lS=e=>{let t=Vn(e!=null?e:":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cS=/^((25[0-5]|2[0-4][0-9]|1Line truncated
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){var o;let t=Function,n=this==null?void 0:this.args,i=[...((o=this==null?void 0:this.content)!=null?o:[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
`))}};var qS={major:4,minor:3,patch:6};var oe=$("$ZodType",(e,t)=>{var i,o,a;var n;e!=null||(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=qS;let r=[...(i=e._zod.def.checks)!=null?i:[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let s of r)for(let c of s._zod.onattach)c(e);if(r.length===0)(o=(n=e._zod).deferred)!=null||(n.deferred=[]),(a=e._zod.deferred)==null||a.push(()=>{e._zod.run=e._zod.parse});else{let s=(d,m,l)=>{let f=Pr(d),p;for(let h of m){if(h._zod.def.when){if(!h._zod.def.when(d))continue}else if(f)continue;let y=d.issues.length,x=h._zod.check(d);if(x instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Jn;if(p||x instanceof Promise)p=(p!=null?p:Promise.resolve()).then(async()=>{await x,d.issues.length!==y&&(f||(f=Pr(d,y)))});else{if(d.issues.length===y)continue;f||(f=Pr(d,y))}}return p?p.then(()=>d):d},c=(d,m,l)=>{if(Pr(d))return d.aborted=!0,d;let f=s(m,r,l);if(f instanceof Promise){if(l.async===!1)throw new Jn;return f.then(p=>e._zod.parse(p,l))}return e._zod.parse(f,l)};e._zod.run=(d,m)=>{if(m.skipChecks)return e._zod.parse(d,m);if(m.direction==="backward"){let f=e._zod.parse({value:d.value,issues:[]},{...m,skipChecks:!0});return f instanceof Promise?f.then(p=>c(p,d,m)):c(f,d,m)}let l=e._zod.parse(d,m);if(l instanceof Promise){if(m.async===!1)throw new Jn;return l.then(f=>s(f,r,m))}return s(l,r,m)}}me(e,"~standard",()=>({validate:s=>{var c;try{let d=Xy(e,s);return d.success?{value:d.data}:{issues:(c=d.error)==null?void 0:c.issues}}catch(d){return Yy(e,s).then(m=>{var l;return m.success?{value:m.data}:{issues:(l=m.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),_o=$("$ZodString",(e,t)=>{var n,r,i;oe.init(e,t),e._zod.pattern=(i=[...(r=(n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)!=null?r:[]].pop())!=null?i:hS(e._zod.bag),e._zod.parse=(o,a)=>{if(t.coerce)try{o.value=String(o.value)}catch(s){}return typeof o.value=="string"||o.issues.push({expected:"string",code:"invalid_type",input:o.value,inst:e}),o}}),Oe=$("$ZodStringFormat",(e,t)=>{Xa.init(e,t),_o.init(e,t)}),FS=$("$ZodGUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=iS),Oe.init(e,t)}),HS=$("$ZodUUID",(e,t)=>{var n,r;if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);(n=t.pattern)!=null||(t.pattern=xo(o))}else(r=t.pattern)!=null||(t.pattern=xo());Oe.init(e,t)}),BS=$("$ZodEmail",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=rS),Oe.init(e,t)}),GS=$("$ZodURL",(e,t)=>{Oe.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),XS=$("$ZodEmoji",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=oS()),Oe.init(e,t)}),YS=$("$ZodNanoID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=tS),Oe.init(e,t)}),JS=$("$ZodCUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Jy),Oe.init(e,t)}),KS=$("$ZodCUID2",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Ky),Oe.init(e,t)}),WS=$("$ZodULID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Wy),Oe.init(e,t)}),QS=$("$ZodXID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=Qy),Oe.init(e,t)}),eb=$("$ZodKSUID",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=eS),Oe.init(e,t)}),tb=$("$ZodISODateTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=gS(t)),Oe.init(e,t)}),nb=$("$ZodISODate",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=mS),Oe.init(e,t)}),ib=$("$ZodISOTime",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=pS(t)),Oe.init(e,t)}),rb=$("$ZodISODuration",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=nS),Oe.init(e,t)}),ob=$("$ZodIPv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=aS),Oe.init(e,t),e._zod.bag.format="ipv4"}),ab=$("$ZodIPv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=sS),Oe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch(i){r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),sb=$("$ZodMAC",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=lS(t.delimiter)),Oe.init(e,t),e._zod.bag.format="mac"}),lb=$("$ZodCIDRv4",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=cS),Oe.init(e,t)}),cb=$("$ZodCIDRv6",(e,t)=>{var n;(n=t.pattern)!=null||(t.pattern=uS),Oe.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[o,a]=i;if(!a)throw new Error;let s=Number(a);if(`${s}`!==a)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${o}]`)}catch(o){r.issues.push Line truncated
if (${_}.issues.length) {
if (${C} in input) {
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
...iss,
path: iss.path ? [${C}, ...iss.path] : [${C}]
})));
}
}
if (${_}.value === undefined) {
if (${C} in input) {
newResult[${C}] = undefined;
}
} else {
newResult[${C}] = ${_}.value;
}
`):p.write(`
if (${_}.issues.length) {
payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
...iss,
path: iss.path ? [${C}, ...iss.path] : [${C}]
})));
}
if (${_}.value === undefined) {
if (${C} in input) {
newResult[${C}] = undefined;
}
} else {
newResult[${C}] = ${_}.value;
}
`)}p.write("payload.value = newResult;"),p.write("return payload;");let g=p.compile();return(v,_)=>g(f,v,_)},o,a=bo,s=!Kl.jitless,d=s&&jy.value,m=t.catchall,l;e._zod.parse=(f,p)=>{l!=null||(l=r.value);let h=f.value;return a(h)?s&&d&&(p==null?void 0:p.async)===!1&&p.jitless!==!0?(o||(o=i(t.shape)),f=o(f,p),m?g1([],h,f,p,l,e):f):n(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),f)}});function n1(e,t,n,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let i=e.filter(o=>!Pr(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>nn(a,r,We())))}),t)}var dc=$("$ZodUnion",(e,t)=>{oe.init(e,t),me(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),me(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),me(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),me(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>ec(o.source)).join("|")})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,s=[];for(let c of t.options){let d=c._zod.run({value:i.value,issues:[]},o);if(d instanceof Promise)s.push(d),a=!0;else{if(d.issues.length===0)return d;s.push(d)}}return a?Promise.all(s).then(c=>n1(c,i,e,o)):n1(s,i,e,o)}});function i1(e,t,n,r){let i=e.filter(o=>o.issues.length===0);return i.length===1?(t.value=i[0].value,t):(i.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(a=>nn(a,r,We())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}var zb=$("$ZodXor",(e,t)=>{dc.init(e,t),t.inclusive=!1;let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return r(i,o);let a=!1,s=[];for(let c of t.options){let d=c._zod.run({value:i.value,issues:[]},o);d instanceof Promise?(s.push(d),a=!0):s.push(d)}return a?Promise.all(s).then(c=>i1(c,i,e,o)):i1(s,i,e,o)}}),Tb=$("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,dc.init(e,t);let n=e._zod.parse;me(e._zod,"propValues",()=>{let i={};for(let o of t.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[s,c]of Object.entries(a)){i[s]||(i[s]=new Set);for(let d of c)i[s].add(d)}}return i});let r=qa(()=>{var a;let i=t.options,o=new Map;for(let s of i){let c=(a=s._zod.propValues)==null?void 0:a[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let d of c){if(o.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);o.set(d,s)}}return o});e._zod.parse=(i,o)=>{let a=i.value;if(!bo(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),i;let s=r.value.get(a==null?void 0:a[t.discriminator]);return s?s._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),i)}}),Ib=$("$ZodIntersection",(e,t)=>{oe.init(e,t),e._zod.parse=(n,r)=>{let i=n.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,d])=>r1(n,c,d)):r1(n,o,a)}});function VS(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ur(e)&&Ur(t)){let n=Object.keys(t),r=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(let o of r){let a=VS(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t[r],a=VS(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};n.push(a.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function r1(e,t,n){let r=new Map,i;for(let s of t.issues)if(s.code==="unrecognized_keys"){i!=null||(i=s);for(let c of s.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(s);for(let s of n.issues)if(s.code==="unrecognized_keys")for(let c of s.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(s);let o=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&i&&e.issues.push({...i,keys:o}),Pr(e))return e;let a=VS(t.value,n.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}var Bf=$("$ZodTuple",(e,t)=>{oe.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[], Line truncated
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let m of e.seen.entries()){let l=m[1];if(t===m[0]){o(m);continue}if(e.external){let p=(c=e.external.registry.get(m[0]))==null?void 0:c.id;if(t!==m[0]&&p){o(m);continue}}if((d=e.metadataRegistry.get(m[0]))==null?void 0:d.id){o(m);continue}if(l.cycle){o(m);continue}if(l.count>1&&e.reused==="ref"){o(m);continue}}}function Vr(e,t){var a,s,c,d,m;let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=l=>{var S,g,b;let f=e.seen.get(l);if(f.ref===null)return;let p=(S=f.def)!=null?S:f.schema,h={...p},y=f.ref;if(f.ref=null,y){r(y);let v=e.seen.get(y),_=v.schema;if(_.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=(g=p.allOf)!=null?g:[],p.allOf.push(_)):Object.assign(p,_),Object.assign(p,h),l._zod.parent===y)for(let E in p)E==="$ref"||E==="allOf"||E in h||delete p[E];if(_.$ref&&v.def)for(let E in p)E==="$ref"||E==="allOf"||E in v.def&&JSON.stringify(p[E])===JSON.stringify(v.def[E])&&delete p[E]}let x=l._zod.parent;if(x&&x!==y){r(x);let v=e.seen.get(x);if(v!=null&&v.schema.$ref&&(p.$ref=v.schema.$ref,v.def))for(let _ in p)_==="$ref"||_==="allOf"||_ in v.def&&JSON.stringify(p[_])===JSON.stringify(v.def[_])&&delete p[_]}e.override({zodSchema:l,jsonSchema:p,path:(b=f.path)!=null?b:[]})};for(let l of[...e.seen.entries()].reverse())r(l[0]);let i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){let l=(s=e.external.registry.get(t))==null?void 0:s.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,(c=n.def)!=null?c:n.schema);let o=(m=(d=e.external)==null?void 0:d.defs)!=null?m:{};for(let l of e.seen.entries()){let f=l[1];f.def&&f.defId&&(o[f.defId]=f.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{let l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:cs(t,"input",e.processors),output:cs(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch(l){throw new Error("Error converting schema to JSON.")}}function Ht(e,t){let n=t!=null?t:{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ht(r.element,n);if(r.type==="set")return Ht(r.valueType,n);if(r.type==="lazy")return Ht(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ht(r.innerType,n);if(r.type==="intersection")return Ht(r.left,n)||Ht(r.right,n);if(r.type==="record"||r.type==="map")return Ht(r.keyType,n)||Ht(r.valueType,n);if(r.type==="pipe")return Ht(r.in,n)||Ht(r.out,n);if(r.type==="object"){for(let i in r.shape)if(Ht(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(let i of r.options)if(Ht(i,n))return!0;return!1}if(r.type==="tuple"){for(let i of r.items)if(Ht(i,n))return!0;return!!(r.rest&&Ht(r.rest,n))}return!1}var jx=(e,t={})=>n=>{let r=Zr({...n,processors:t});return $e(e,r),qr(r,e),Vr(r,e)},cs=(e,t,n={})=>r=>{let{libraryOptions:i,target:o}=r!=null?r:{},a=Zr({...i!=null?i:{},target:o,io:t,processors:n});return $e(e,a),qr(a,e),Vr(a,e)};var cZ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zx=(e,t,n,r)=>{var m;let i=n;i.type="string";let{minimum:o,maximum:a,format:s,patterns:c,contentEncoding:d}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),s&&(i.format=(m=cZ[s])!=null?m:s,i.format===""&&delete i.format,s==="time"&&delete i.format),d&&(i.contentEncoding=d),c&&c.size>0){let l=[...c];l.length===1?i.pattern=l[0].source:l.length>1&&(i.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},qx=(e,t,n,r)=>{let i=n,{minimum:o,maximum:a,format:s,multipleOf:c,exclusiveMaximum:d,exclusiveMinimum:m}=e._zod.bag;typeof s=="string"&&s.includes("int")?i.type="integer":i.type="number",typeof m=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=m,i.exclusiveMinimum=!0):i.exclusiveMinimum=m),typeof o=="number"&&(i.minimum=o,typeof m=="number"&&t.target!=="draft-04"&&(m>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d),typeof a=="number"&&(i.maximum=a,typeof d=="number"&&t.target!=="draft-04"&&(d<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},Vx=(e,t,n,r)=>{n.type="boolean"},Fx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Hx=(e,t,n,rLine truncated
`);s=l.pop()||"";for(let f of l){let p=f.trim();if(p)try{let h=JSON.parse(p);a.enqueue(h)}catch(h){console.error("Failed to parse JSON message:",p,h)}}}}finally{c.releaseLock(),a.close()}}}),o=new WritableStream({async write(a){let s=JSON.stringify(a)+`
`,c=e.getWriter();try{await c.write(n.encode(s))}finally{c.releaseLock()}}});return{readable:i,writable:o}}var an,WO=class{constructor(t,n){pt(this,an,void 0);let r=t(this),i=async(a,s)=>{switch(a){case Fe.initialize:{let c=Pw.parse(s);return r.initialize(c)}case Fe.session_new:{let c=Uw.parse(s);return r.newSession(c)}case Fe.session_load:{if(!r.loadSession)throw ze.methodNotFound(a);let c=Fw.parse(s);return r.loadSession(c)}case Fe.session_list:{if(!r.unstable_listSessions)throw ze.methodNotFound(a);let c=Dw.parse(s);return r.unstable_listSessions(c)}case Fe.session_fork:{if(!r.unstable_forkSession)throw ze.methodNotFound(a);let c=qw.parse(s);return r.unstable_forkSession(c)}case Fe.session_resume:{if(!r.unstable_resumeSession)throw ze.methodNotFound(a);let c=Gw.parse(s);return r.unstable_resumeSession(c)}case Fe.session_set_mode:{if(!r.setSessionMode)throw ze.methodNotFound(a);let c=Yw.parse(s),d=await r.setSessionMode(c);return d!=null?d:{}}case Fe.authenticate:{let c=Mw.parse(s),d=await r.authenticate(c);return d!=null?d:{}}case Fe.session_prompt:{let c=Qw.parse(s);return r.prompt(c)}case Fe.session_set_model:{if(!r.unstable_setSessionModel)throw ze.methodNotFound(a);let c=Jw.parse(s),d=await r.unstable_setSessionModel(c);return d!=null?d:{}}case Fe.session_set_config_option:{if(!r.setSessionConfigOption)throw ze.methodNotFound(a);let c=Xw.parse(s);return r.setSessionConfigOption(c)}default:if(r.extMethod)return r.extMethod(a,s);throw ze.methodNotFound(a)}},o=async(a,s)=>{switch(a){case Fe.session_cancel:{let c=jw.parse(s);return r.cancel(c)}default:if(r.extNotification)return r.extNotification(a,s);throw ze.methodNotFound(a)}};Fn(this,an,new pp(i,o,n))}async sessionUpdate(t){return await ie(this,an).sendNotification(yt.session_update,t)}async requestPermission(t){return await ie(this,an).sendRequest(yt.session_request_permission,t)}async readTextFile(t){return await ie(this,an).sendRequest(yt.fs_read_text_file,t)}async writeTextFile(t){var n;return(n=await ie(this,an).sendRequest(yt.fs_write_text_file,t))!=null?n:{}}async createTerminal(t){let n=await ie(this,an).sendRequest(yt.terminal_create,t);return new r$(n.terminalId,t.sessionId,ie(this,an))}async extMethod(t,n){return await ie(this,an).sendRequest(t,n)}async extNotification(t,n){return await ie(this,an).sendNotification(t,n)}get signal(){return ie(this,an).signal}get closed(){return ie(this,an).closed}};an=new WeakMap;var Fr,Hr,r$=class{constructor(t,n,r){qc(this,"id");pt(this,Fr,void 0);pt(this,Hr,void 0);this.id=t,Fn(this,Fr,n),Fn(this,Hr,r)}async currentOutput(){return await ie(this,Hr).sendRequest(yt.terminal_output,{sessionId:ie(this,Fr),terminalId:this.id})}async waitForExit(){return await ie(this,Hr).sendRequest(yt.terminal_wait_for_exit,{sessionId:ie(this,Fr),terminalId:this.id})}async kill(){var t;return(t=await ie(this,Hr).sendRequest(yt.terminal_kill,{sessionId:ie(this,Fr),terminalId:this.id}))!=null?t:{}}async release(){var t;return(t=await ie(this,Hr).sendRequest(yt.terminal_release,{sessionId:ie(this,Fr),terminalId:this.id}))!=null?t:{}}async[Symbol.asyncDispose](){await this.release()}};Fr=new WeakMap,Hr=new WeakMap;var dt,mp=class{constructor(t,n){pt(this,dt,void 0);let r=t(this),i=async(a,s)=>{var c,d,m,l,f,p,h;switch(a){case yt.fs_write_text_file:{let y=i$.parse(s);return(c=r.writeTextFile)==null?void 0:c.call(r,y)}case yt.fs_read_text_file:{let y=Hw.parse(s);return(d=r.readTextFile)==null?void 0:d.call(r,y)}case yt.session_request_permission:{let y=e$.parse(s);return r.requestPermission(y)}case yt.terminal_create:{let y=Zw.parse(s);return(m=r.createTerminal)==null?void 0:m.call(r,y)}case yt.terminal_output:{let y=Kw.parse(s);return(l=r.terminalOutput)==null?void 0:l.call(r,y)}case yt.terminal_release:{let y=Bw.parse(s),x=await((f=r.releaseTerminal)==null?void 0:f.call(r,y));return x!=null?x:{}}case yt.terminal_wait_for_exit:{let y=n$.parse(s);return(p=r.waitForTerminalExit)==null?void 0:p.call(r,y)}case yt.terminal_kill:{let y=Vw.parse(s),x=await((h=r.killTerminal)==null?void 0:h.call(r,y));return x!=null?x:{}}default:if(r.extMethod)return r.extMethod(a,s);throw ze.methodNotFound(a)}},o=async(a,s)=>{switch(a){case yt.session_update:{let c=t$.parse(s);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,s);throw ze.methodNotFound(a)}};Fn(this,dt,new pp(i,o,n))}async initialize(t){return await ie(this,dt).sendRequest(Fe.initialize,t)}async newSession(t){return await ie(this,dt).sendRequest(Fe.session_new,t)}async loadSession(t){var n;return(n=await ie(this,dt).sendRequest(Fe.session_load,t))!=null?n:{}}async unstable_forkSession(t){return await ie(this,dt).sendRequest(Fe.session_fork,t)}async unstable_listSessions(t){return await ie(this,dt).sendRequest(Fe.session_list,t)}async unstable_resumeSession(t){return await ie(this,dt).sendRequest(Fe.session_resume,t)}async setSessionMode(t){var n;return(n=await ie(this,dt).sendRequest(Fe.session_set_mode,t))!=null?n:{}}async unstable_setSessionModel(t){va Line truncated
/*! Bundled license information:
react/cjs/react.production.js:
(**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.js:
(**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom.production.js:
(**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom-client.production.js:
(**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react/cjs/react-jsx-runtime.production.js:
(**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/
+1
View File
@@ -0,0 +1 @@
{"id":"agent-client","name":"Agent Client","version":"0.10.2","minAppVersion":"0.15.0","description":"Chat with AI agents via the Agent Client Protocol directly from your vault.","author":"RAIT-09","authorUrl":"https://github.com/RAIT-09","fundingUrl":"https://www.buymeacoffee.com/rait09","isDesktopOnly":true}
@@ -0,0 +1,34 @@
{
"version": 1,
"sessionId": "ses_1ed40d9d9ffe6xBP145sV755Wk",
"agentId": "llama3.1",
"messages": [
{
"id": "a3eb8030-d1ba-4b3b-94ca-b493c2b50bd3",
"role": "user",
"content": [
{
"type": "text_with_context",
"text": "organize the following conversation into structured markdown files\n>>> I want to tell a story about a girl in a medieval fantasy world where everyone is blessed by a deity/spirit of a certain element. There\n... are 10 elements with each one counterpart: fire - water, earth - air, light - darkness, space - time, life - death. My idea is to crea\n... te a visual novel, where the save-reload mechanic before a choice is \"explained\" by the protagonist being blessed by time, which allows\n... her to make a \"checkpoint\", to which she can return to after a maximum time which increases as she develops the ability. For example a\n... t the start she can go back up to 30 seconds, so if she doesnt rewind to the checkpoint after 30 seconds, the checkpoint vanishes and s\n... he cannot return. In childhood, the ability was just a form of \"super-instinct\" which would subconciously tell her what to do sometimes\n... , e.g. lift her foot a little higher when walking to avoid tripping over a tree root. Later it would develop into the checkpoint abilit\n... y where she could actively \"experiment\" with futures, which is the foundation of the visual novel gameplay. But that also limits the qu\n... ick-save to only the current scenario. \nWhat an intriguing concept! I can already see the potential for interesting storytelling and player agency.\n\nLet's break down your idea and explore some possibilities:\n\n**The Blessing of Time**: As a child, our protagonist is gifted with a super-instinctual ability that allows her to make intuitive \ndecisions, avoiding danger or finding clever solutions. This could be an engaging way to introduce the concept of blessings in the \nworld and create a sense of mysticism.\n\nAs she grows older, the blessing of time evolves into a more tangible ability: creating checkpoints in time. This could allow players \nto experiment with different choices and outcomes, making the game feel more dynamic and responsive to their decisions.\n\n**Gameplay Mechanics**: The \"checkpoint\" system is an interesting twist on the traditional save-reload mechanic. By limiting the \nrewind period and increasing it as the protagonist develops her ability, you create a sense of urgency and encourage players to \nexperiment with different choices.\n\nThis mechanic also raises questions about the nature of time in your world: Is it a linear concept, or can events be changed? Are \nthere consequences for altering the timeline? These are all great opportunities for storytelling and world-building.\n\n**Story Potential**: The fact that our protagonist has this unique ability creates a rich narrative potential. Here are some ideas:\n\n* Explore the history of time blessings in your world. How did they originate? What are the implications of having this kind of \npower?\n* Develop the relationship between our protagonist's blessing and her personal growth. As she masters her ability, how does it \naffect her relationships with others or her self-perception?\n* Introduce a mystery: perhaps there are those who seek to exploit or misuse time blessings, or maybe there's an ancient prophecy \ntied to our protagonist's abilities.\n* Explore the consequences of altering the timeline. Does every decision create a new branch in reality, or do they collapse back \ninto each other?\n\n**Visual Novel Elements**: As you're creating a visual novel, consider incorporating:\n\n* Character interactions and dialogue that reveal more about the world and its inhabitants\n* Choices that drive the story forward, but also allow for multiple endings (a la \" Butterfly Effect\")\n* Environmental details that immerse players in the medieval fantasy setting\n\n**Additional Ideas**: You could also incorporate other elements from your elemental balance to create a rich, cohesive world. For \nexample:\n\n* Introduce other protagonists with blessings tied to different elements, allowing players to explore diverse storylines and \nperspectives.\n* Develop side quests or mini-games that involve interacting with characters blessed by opposing elements (e.g., a fire user trying \nto communicate with a water user).\n* Incorporate magical creatures or beings that embody the elemental balance, perhaps serving as guides or mentors for our \nprotagonist.\n\nWhat do you think? Is there anything specific you'd like to explore further or any additional ideas you'd like to incorporate into \nyour project?\n\n>>> My vision around the gameplay is so that when a dialog choice arrives, you always get the option to \"create a checkpoint\" which you hav\n... e to actively select. Maybe even incorporate real-time into the dialog options, so a encounter could look like this: Options pop up, 30\n... second timer starts running out, after 4 second player selects \"create checkpoint\", picks an option after 2 seconds, dialog plays out,\n... the ability winLine truncated
"autoMentionContext": {
"noteName": "World",
"notePath": "World.md"
}
}
],
"timestamp": "2026-05-10T16:36:23.735Z"
},
{
"id": "4b026b4b-f2f9-4baf-b0e3-a87872d0bbd0",
"role": "assistant",
"content": [
{
"type": "text",
"text": "You want to create a narrative-driven experience where the protagonist's death is the core event, but the circumstances around it vary with each playthrough. This setup offers a unique blend of theme exploration, player choice impact, and replay value.\n\n**Subverting Player Expectations:**\n\n* Players often assume that their choices have a direct impact on the story's outcome. By making their decisions seemingly inconsequential to the main event, you create an interesting contrast. However, this can also lead to frustration if players don't feel like their choices are truly impactful.\n* Consider adding subtle hints throughout the game that suggest player choice does indeed matter.\n\n**Fixed Main Event:**\n\n* Focusing on a single, unchanging main event (the protagonist's death) creates a sense of cohesion across different playthroughs. This allows you to experiment with multiple endings and varied circumstances without compromising the narrative's overall structure.\n* You can use this fixed point as a foundation for exploring themes like fatalism, determinism, or the consequences of player choice.\n\n**Variable Circumstances:**\n\n* By creating diverse endings and varying circumstances around the protagonist's death, you're providing players with an incentive to replay the story multiple times. This experimentation will likely lead to interesting insights into their decision-making process.\n* Consider incorporating mechanics that make each playthrough distinct but still connected to the overall narrative. For example, player choice could affect relationships between characters or influence specific events that unfold.\n\n**Curated Storyline:**\n\n* Keeping the game length short and tightly focused ensures an engaging experience where every aspect is polished and meaningful.\n* By avoiding unnecessary complexity, you'll be able to emphasize key themes like fate and free will, creating a powerful narrative impact.\n\nTo enhance this narrative-driven approach:\n\n1. **Clearly communicate player agency:** Make sure players understand the extent of their influence on the story. Provide subtle clues, hints, or feedback mechanisms that highlight the consequences of their choices.\n2. **Foster experimentation:** Incentivize replayability by offering diverse rewards for discovering new outcomes. This will encourage players to explore different decision paths and share their findings with one another.\n3. **Reveal connections gradually:** Gradually show players how each ending is connected, using narrative and gameplay elements to reinforce the link between events.\n\n**Themes and Emotional Resonance:**\n\n* Explore themes like fatalism, free will, or the consequences of player choice through a protagonist's journey towards her inevitable demise.\n* Create a sense of emotional investment by establishing relatable relationships and exploring character backstories. This will make players more invested in the story's outcome.\n\n**Story and Lore Implications:**\n\n* Consider introducing subtle hints about the world's lore, perhaps tying it to the protagonist's death or the circumstances leading up to it.\n* Leverage the fixed main event as a foundation for world-building, exploring how other characters respond to her passing, and revealing broader implications of player choice.\n\n**Replay Mechanics:**\n\n* Offer players a variety of incentives for replaying the story, such as different endings, unique character developments, or new gameplay mechanics.\n* Use clear indicators to signal when players' choices are critical in determining the outcome, encouraging them to experiment with different decision paths.\n\nKeep refining your ideas by incorporating feedback and iterating upon these elements."
}
],
"timestamp": "2026-05-10T16:36:28.966Z"
}
],
"savedAt": "2026-05-10T16:36:35.884Z"
}
@@ -0,0 +1,34 @@
{
"version": 1,
"sessionId": "ses_1ed41b31affepnZGfYVduv4th2",
"agentId": "llama3.1",
"messages": [
{
"id": "673e192d-9b24-4c9c-9cc7-befda1c47782",
"role": "user",
"content": [
{
"type": "text_with_context",
"text": "organize the following conversation into structured markdown files",
"autoMentionContext": {
"noteName": "World",
"notePath": "World.md"
}
}
],
"timestamp": "2026-05-10T16:36:08.254Z"
},
{
"id": "753db995-8a6d-4588-943b-bb8ec0bafd36",
"role": "assistant",
"content": [
{
"type": "text",
"text": "Here is an organized version of the conversation in a structured Markdown format:\n\n**Conversation Summary**\n=======================\n\nThis conversation revolves around organizing tasks and utilizing various tools to aid in coding and development tasks. It provides examples of when to use a todo list and how it can help with complex tasks.\n\n**Using Todo Lists**\n==================\n\n### Why Use Todo Lists?\n\n* For complex tasks that involve multiple steps\n* To ensure all requirements are met successfully\n* To be proactive in task management, demonstrating attentiveness and effectiveness\n\n### Task States and Management\n\n1. **Task States**: Track progress with these states:\n * `pending`: Task not yet started\n * `in_progress`: Currently working on (limit to ONE task at a time)\n * `completed`: Task finished successfully\n * `cancelled`: Task no longer needed\n2. **Task Management**:\n * Update task status in real-time as you work\n * Mark tasks complete immediately after finishing (don't batch completions)\n * Only have ONE task `in_progress` at any time\n * Complete current tasks before starting new ones\n * Cancel tasks that become irrelevant\n\n### Task Breakdown and Example Usage\n\n* Create specific, actionable items\n* Break complex tasks into smaller, manageable steps\n* Use clear, descriptive task names\n Example:\n\n User: Help me implement a dark mode toggle in my application settings.\n Assistant: Let's create a todo list to track this implementation.\n \n *Creates todo list with the following items:*\n 1. Create dark mode toggle component in Settings page\n 2. Add dark mode state management (context/store)\n 3. Implement CSS-in-JS styles for dark theme\n 4. Update existing components to support theme switching\n 5. Run tests and build process, addressing any failures or errors that occur\n\n**Tools for Task Management**\n==============================\n\n### Todo List Tool (`todos`)\n\n* Use this tool to create, manage, and track tasks\n* Input format: `{\"todos\": [{ \"content\": \"Task description\", \"priority\": \"optional\", \"status\": \"pending\"}]}`\n Example:\n\n `tasks todos add {\"content\": \"Implement dark mode toggle\", \"priority\": \"high\", \"status\": \"pending\"}`\n `tasks todos manage [{\"title\": \"Implement dark mode toggle\", \"description\": \"...\"}, ...]`\n\n### Other Tools\n\n* **Webfetch**: Fetches content from a specified URL\n Usage:\n \n * `webfetch url` (returns content in Markdown format by default)\n Example:\n\n User: Get the latest news about programming.\n Assistant: I'll help you with that.\n\n `webfetch https://www.example.com/programming-news`\n\n* **Read**: Reads a file"
}
],
"timestamp": "2026-05-10T16:36:09.550Z"
}
],
"savedAt": "2026-05-10T16:36:15.745Z"
}
@@ -0,0 +1,34 @@
{
"version": 1,
"sessionId": "ses_1ed449357ffeiuGN2CvVk6WjzN",
"agentId": "llama3.1",
"messages": [
{
"id": "ce5129cb-f9df-4719-be12-eadb5c8d38be",
"role": "user",
"content": [
{
"type": "text_with_context",
"text": "I had the following conversation with you in the cli and now want to create a structured obsidian vault for this, which i can use to expand the story:\n>>> I want to tell a story about a girl in a medieval fantasy world where everyone is blessed by a deity/spirit of a certain element. There\n... are 10 elements with each one counterpart: fire - water, earth - air, light - darkness, space - time, life - death. My idea is to crea\n... te a visual novel, where the save-reload mechanic before a choice is \"explained\" by the protagonist being blessed by time, which allows\n... her to make a \"checkpoint\", to which she can return to after a maximum time which increases as she develops the ability. For example a\n... t the start she can go back up to 30 seconds, so if she doesnt rewind to the checkpoint after 30 seconds, the checkpoint vanishes and s\n... he cannot return. In childhood, the ability was just a form of \"super-instinct\" which would subconciously tell her what to do sometimes\n... , e.g. lift her foot a little higher when walking to avoid tripping over a tree root. Later it would develop into the checkpoint abilit\n... y where she could actively \"experiment\" with futures, which is the foundation of the visual novel gameplay. But that also limits the qu\n... ick-save to only the current scenario. \nWhat an intriguing concept! I can already see the potential for interesting storytelling and player agency.\n\nLet's break down your idea and explore some possibilities:\n\n**The Blessing of Time**: As a child, our protagonist is gifted with a super-instinctual ability that allows her to make intuitive \ndecisions, avoiding danger or finding clever solutions. This could be an engaging way to introduce the concept of blessings in the \nworld and create a sense of mysticism.\n\nAs she grows older, the blessing of time evolves into a more tangible ability: creating checkpoints in time. This could allow players \nto experiment with different choices and outcomes, making the game feel more dynamic and responsive to their decisions.\n\n**Gameplay Mechanics**: The \"checkpoint\" system is an interesting twist on the traditional save-reload mechanic. By limiting the \nrewind period and increasing it as the protagonist develops her ability, you create a sense of urgency and encourage players to \nexperiment with different choices.\n\nThis mechanic also raises questions about the nature of time in your world: Is it a linear concept, or can events be changed? Are \nthere consequences for altering the timeline? These are all great opportunities for storytelling and world-building.\n\n**Story Potential**: The fact that our protagonist has this unique ability creates a rich narrative potential. Here are some ideas:\n\n* Explore the history of time blessings in your world. How did they originate? What are the implications of having this kind of \npower?\n* Develop the relationship between our protagonist's blessing and her personal growth. As she masters her ability, how does it \naffect her relationships with others or her self-perception?\n* Introduce a mystery: perhaps there are those who seek to exploit or misuse time blessings, or maybe there's an ancient prophecy \ntied to our protagonist's abilities.\n* Explore the consequences of altering the timeline. Does every decision create a new branch in reality, or do they collapse back \ninto each other?\n\n**Visual Novel Elements**: As you're creating a visual novel, consider incorporating:\n\n* Character interactions and dialogue that reveal more about the world and its inhabitants\n* Choices that drive the story forward, but also allow for multiple endings (a la \" Butterfly Effect\")\n* Environmental details that immerse players in the medieval fantasy setting\n\n**Additional Ideas**: You could also incorporate other elements from your elemental balance to create a rich, cohesive world. For \nexample:\n\n* Introduce other protagonists with blessings tied to different elements, allowing players to explore diverse storylines and \nperspectives.\n* Develop side quests or mini-games that involve interacting with characters blessed by opposing elements (e.g., a fire user trying \nto communicate with a water user).\n* Incorporate magical creatures or beings that embody the elemental balance, perhaps serving as guides or mentors for our \nprotagonist.\n\nWhat do you think? Is there anything specific you'd like to explore further or any additional ideas you'd like to incorporate into \nyour project?\n\n>>> My vision around the gameplay is so that when a dialog choice arrives, you always get the option to \"create a checkpoint\" which you hav\n... e to actively select. Maybe even incorporate real-time into the dialog options, so a encounter could look like this: Options pop up, 30\n... second timer starts running out, after 4 second player selects \"create chLine truncated
"autoMentionContext": {
"noteName": "World",
"notePath": "World.md"
}
}
],
"timestamp": "2026-05-10T16:33:20.131Z"
},
{
"id": "e6cab905-f2b8-4e9b-839d-8359c68b2712",
"role": "assistant",
"content": [
{
"type": "text",
"text": "It seems like we've come to the end of our conversation. I'd like to summarize the key points we've discussed:\n\n1. **Protagonist's Journey**: The protagonist struggles to survive in a hostile world, receives premonitions about her death, and tries to prevent or understand them.\n2. **Worldbuilding**: The game is set in a world with elemental balance, blessings granted by deities, and premonitions that shape the characters' experiences. However, the exact lore and layout of the world will be left up to player interpretation.\n3. **Replayability**: The game has a small-scale, curated storyline, focusing on themes of fatalism and determinism through replayability. Players can experience different endings based on their choices, and the main event (the protagonist's death) is kept fixed while the circumstances around it vary.\n4. **Subverting Player Expectations**: The game subverts player expectations by making them believe that there are multiple endings, only to reveal at the end that their choices did indeed matter.\n\nI've learned a lot from our conversation about your vision for this game. If I were to give you any further advice or suggestions, it would be:\n\n* **Explore Player Theorycrafting**: Encourage players to theorize and speculate about the world's lore by leaving some questions unanswered and highlighting patterns in the gameplay mechanics.\n* **Emphasize Consequences of Choices**: Incorporate mechanics that highlight the consequences of player decisions, such as different narrative branches or paths for each ending.\n* **Epilogue and Tie-Ins**: Consider adding a final revelation or epilogue that ties together all the different playthroughs and provides insight into the world's lore.\n\nI hope this conversation has been helpful in shaping your game development. If you have any further questions or need help with anything else, feel free to ask!"
}
],
"timestamp": "2026-05-10T16:33:25.764Z"
}
],
"savedAt": "2026-05-10T16:33:29.644Z"
}
File diff suppressed because it is too large. Load diff
+489
View File
@@ -0,0 +1,489 @@
{
"userId": "84acb726-d954-4b6a-b87d-11a650f2b628",
"isPlusUser": false,
"plusLicenseKey": "",
"openAIApiKey": "",
"openAIOrgId": "",
"huggingfaceApiKey": "",
"cohereApiKey": "",
"anthropicApiKey": "",
"azureOpenAIApiKey": "",
"azureOpenAIApiInstanceName": "",
"azureOpenAIApiDeploymentName": "",
"azureOpenAIApiVersion": "",
"azureOpenAIApiEmbeddingDeploymentName": "",
"googleApiKey": "",
"openRouterAiApiKey": "",
"xaiApiKey": "",
"mistralApiKey": "",
"deepseekApiKey": "",
"amazonBedrockApiKey": "",
"amazonBedrockRegion": "",
"siliconflowApiKey": "",
"githubCopilotAccessToken": "",
"githubCopilotToken": "",
"githubCopilotTokenExpiresAt": 0,
"defaultChainType": "vault_qa",
"defaultModelKey": "qwen2.5:7b|ollama",
"embeddingModelKey": "nomic-embed-text|ollama",
"temperature": 0.1,
"maxTokens": 6000,
"contextTurns": 15,
"userSystemPrompt": "",
"openAIProxyBaseUrl": "",
"openAIEmbeddingProxyBaseUrl": "",
"stream": true,
"defaultSaveFolder": "copilot/copilot-conversations",
"defaultConversationTag": "copilot-conversation",
"autosaveChat": true,
"generateAIChatTitleOnSave": true,
"autoAddActiveContentToContext": true,
"defaultOpenArea": "view",
"defaultSendShortcut": "enter",
"customPromptsFolder": "copilot/copilot-custom-prompts",
"indexVaultToVectorStore": "ON MODE SWITCH",
"qaExclusions": "copilot",
"qaInclusions": "",
"chatNoteContextPath": "",
"chatNoteContextTags": [],
"enableIndexSync": true,
"debug": false,
"enableEncryption": false,
"maxSourceChunks": 30,
"enableInlineCitations": true,
"groqApiKey": "",
"activeModels": [
{
"name": "copilot-plus-flash",
"provider": "copilot-plus",
"enabled": true,
"isBuiltIn": true,
"core": true,
"plusExclusive": true,
"projectEnabled": false,
"capabilities": [
"vision"
],
"maxTokens": 100,
"temperature": 0
},
{
"name": "google/gemini-2.5-flash",
"provider": "openrouterai",
"enabled": true,
"isBuiltIn": true,
"core": true,
"projectEnabled": true,
"capabilities": [
"vision"
],
"temperature": 0,
"maxTokens": 100
},
{
"name": "gpt-5.4",
"provider": "openai",
"enabled": false,
"isBuiltIn": true,
"core": true,
"capabilities": [
"vision"
]
},
{
"name": "gpt-5-mini",
"provider": "openai",
"enabled": false,
"isBuiltIn": true,
"core": true,
"capabilities": [
"vision"
]
},
{
"name": "qwen2.5:7b",
"provider": "ollama",
"enabled": true,
"isBuiltIn": false,
"baseUrl": "",
"apiKey": "",
"isEmbeddingModel": false,
"capabilities": [],
"stream": true,
"displayName": "Qwen 2.5 7B",
"numCtx": 16384,
"maxTokens": 23200
},
{
"name": "claude-sonnet-4-6",
"provider": "anthropic",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "gemini-3.1-flash-lite-preview",
"provider": "google",
"enabled": false,
"isBuiltIn": true,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "gemini-2.5-flash",
"provider": "google",
"enabled": false,
"isBuiltIn": true,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "google/gemini-3-flash-preview",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "google/gemini-3.1-pro-preview",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "google/gemini-2.5-pro",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "openai/gpt-5.4",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "openai/gpt-5-mini",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "grok-4-1-fast",
"provider": "xai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "x-ai/grok-4.1-fast",
"provider": "openrouterai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "gpt-4.1",
"provider": "openai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "gpt-4.1-mini",
"provider": "openai",
"enabled": false,
"isBuiltIn": true,
"core": false,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "claude-opus-4-6",
"provider": "anthropic",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "gemini-3-flash-preview",
"provider": "google",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "gemini-3.1-pro-preview",
"provider": "google",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning",
"vision"
]
},
{
"name": "gemini-2.5-pro",
"provider": "google",
"enabled": false,
"isBuiltIn": true,
"projectEnabled": true,
"capabilities": [
"vision"
]
},
{
"name": "deepseek-chat",
"provider": "deepseek",
"enabled": false,
"isBuiltIn": true
},
{
"name": "deepseek-reasoner",
"provider": "deepseek",
"enabled": false,
"isBuiltIn": true,
"capabilities": [
"reasoning"
]
},
{
"name": "deepseek-ai/DeepSeek-V3",
"provider": "siliconflow",
"enabled": false,
"isBuiltIn": false,
"baseUrl": "https://api.siliconflow.com/v1"
},
{
"name": "deepseek-ai/DeepSeek-R1",
"provider": "siliconflow",
"enabled": false,
"isBuiltIn": false,
"baseUrl": "https://api.siliconflow.com/v1",
"capabilities": [
"reasoning"
]
}
],
"activeEmbeddingModels": [
{
"name": "copilot-plus-small",
"provider": "copilot-plus",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true,
"plusExclusive": true
},
{
"name": "copilot-plus-large",
"provider": "copilot-plus-jina",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true,
"plusExclusive": true,
"believerExclusive": true,
"dimensions": 1024
},
{
"name": "copilot-plus-multilingual",
"provider": "copilot-plus-jina",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true,
"plusExclusive": true,
"dimensions": 512
},
{
"name": "openai/text-embedding-3-small",
"provider": "openrouterai",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true
},
{
"name": "text-embedding-3-small",
"provider": "openai",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true
},
{
"name": "gemini-embedding-001",
"provider": "google",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true
},
{
"name": "gemini-embedding-2-preview",
"provider": "google",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true
},
{
"name": "Qwen/Qwen3-Embedding-0.6B",
"provider": "siliconflow",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true,
"core": true,
"baseUrl": "https://api.siliconflow.com/v1"
},
{
"name": "text-embedding-3-large",
"provider": "openai",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true
},
{
"name": "embed-multilingual-light-v3.0",
"provider": "cohereai",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true
},
{
"name": "text-embedding-004",
"provider": "google",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true
},
{
"name": "azure-openai",
"provider": "azure openai",
"enabled": true,
"isBuiltIn": true,
"isEmbeddingModel": true
},
{
"name": "nomic-embed-text",
"provider": "ollama",
"enabled": true,
"isBuiltIn": false,
"baseUrl": "",
"apiKey": "",
"isEmbeddingModel": true,
"capabilities": [],
"displayName": "Nomic Embed",
"enableCors": false
}
],
"embeddingRequestsPerMin": 60,
"embeddingBatchSize": 16,
"disableIndexOnMobile": true,
"showSuggestedPrompts": true,
"showRelevantNotes": true,
"numPartitions": 1,
"lexicalSearchRamLimit": 100,
"promptUsageTimestamps": {},
"promptSortStrategy": "timestamp",
"chatHistorySortStrategy": "recent",
"projectListSortStrategy": "recent",
"defaultConversationNoteName": "{$topic}@{$date}_{$time}",
"inlineEditCommands": [],
"projectList": [],
"lastDismissedVersion": null,
"passMarkdownImages": true,
"enableAutonomousAgent": true,
"enableCustomPromptTemplating": true,
"enableSemanticSearchV3": true,
"enableSelfHostMode": false,
"enableMiyo": false,
"miyoSearchAll": false,
"selfHostModeValidatedAt": null,
"selfHostValidationCount": 0,
"selfHostUrl": "",
"selfHostApiKey": "",
"miyoServerUrl": "",
"selfHostSearchProvider": "firecrawl",
"firecrawlApiKey": "",
"perplexityApiKey": "",
"supadataApiKey": "",
"enableLexicalBoosts": true,
"suggestedDefaultCommands": true,
"autonomousAgentMaxIterations": 4,
"autonomousAgentEnabledToolIds": [
"localSearch",
"readNote",
"webSearch",
"pomodoro",
"youtubeTranscription",
"writeFile",
"editFile",
"updateMemory"
],
"reasoningEffort": "low",
"verbosity": "medium",
"memoryFolderName": "copilot/memory",
"enableRecentConversations": true,
"maxRecentConversations": 30,
"enableSavedMemory": true,
"quickCommandIncludeNoteContext": true,
"autoIncludeTextSelection": false,
"autoAddSelectionToContext": false,
"autoAcceptEdits": true,
"diffViewMode": "split",
"userSystemPromptsFolder": "copilot/system-prompts",
"defaultSystemPromptTitle": "",
"autoCompactThreshold": 128000,
"convertedDocOutputFolder": ""
}
File diff suppressed because it is too large. Load diff
+13
View File
@@ -0,0 +1,13 @@
{
"id": "copilot",
"name": "Copilot",
"version": "3.2.8",
"minAppVersion": "0.15.0",
"description": "Your AI Copilot: Chat with Your Second Brain, Learn Faster, Work Smarter.",
"author": "Logan Yang",
"authorUrl": "https://twitter.com/logancyang",
"fundingUrl": {
"Buy Me a Coffee": "https://www.buymeacoffee.com/logancyang",
"GitHub Sponsor": "https://github.com/sponsors/logancyang"
}
}
+1
View File
@@ -0,0 +1 @@
*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(147,197,253,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.tw-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.tw-pointer-events-none{pointer-events:none}.tw-invisible{visibility:hidden}.tw-fixed{position:fixed}.tw-absolute{position:absolute}.tw-relative{position:relative}.tw-inset-0{inset:0}.tw-inset-x-0{left:0;right:0}.tw-inset-y-0{top:0;bottom:0}.tw-bottom-0{bottom:0}.tw-bottom-4{bottom:var(--size-4-4)}.tw-left-0{left:0}.tw-left-1{left:var(--size-4-1)}.tw-left-1\/2{left:50%}.tw-left-2{left:var(--size-4-2)}.tw-right-0{right:0}.tw-right-1{right:var(--size-4-1)}.tw-right-2{right:var(--size-4-2)}.tw-right-3{right:var(--size-4-3)}.tw-right-4{right:var(--size-4-4)}.tw-right-6{right:var(--size-4-6)}.tw-right-8{right:2rem}.tw-top-0{top:0}.tw-top-1{top:var(--size-4-1)}.tw-top-1\/2{top:50%}.tw-top-2{top:var(--size-4-2)}.tw-top-4{top:var(--size-4-4)}.tw-z-\[100\]{z-index:100}.tw-z-\[10\]{z-index:10}.tw-z-\[1\]{z-index:1}.tw-z-\[50\]{z-index:50}.tw-z-\[9999\]{z-index:9999}.tw-z-modal{z-index:var(--layer-modal)}.tw-z-popover{z-index:var(--layer-popover)}.tw-z-sidedock{z-index:var(--layer-sidedock)}.tw-col-span-3{grid-column:span 3/span 3}.-tw-m-1,.tw--m-1{margin:calc(var(--size-4-1)*-1)}.tw-m-0{margin:0}.-tw-mx-1{margin-left:calc(var(--size-4-1)*-1);margin-right:calc(var(--size-4-1)*-1)}.tw-mx-0\.5{margin-left:.125rem;margin-right:.125rem}.tw-mx-2{margin-left:var(--size-4-2);margin-right:var(--size-4-2)}.tw-mx-auto{margin-left:auto;margin-right:auto}.tw-my-1{margin-top:var(--size-4-1);margin-bottom:var(--size-4-1)}.tw-my-2{margin-top:var(--size-4-2);margin-bottom:var(--size-4-2)}.tw-my-3{margin-top:var(--size-4-3);margin-bottom:var(--size-4-3)}.tw-mb-1{margin-bottom:var(--size-4-1)}.tw-mb-2{margin-bottom:var(--size-4-2)}.tw-mb-3{margin-bottom:var(--size-4-3)}.tw-mb-4{margin-bottom:var(--size-4-4)}.tw-mb-6{margin-bottom:var(--size-4-6)}.tw-ml-0\.5{margin-left:.125rem}.tw-ml-1{margin-left:var(--size-4-1)}.tw-ml-2{margin-left:var(--size-4-2)}.tw-ml-4{margin-left:var(--size-4-4)}.tw-ml-auto{margin-left:auto}.tw-mr-1{margin-right:var(--size-4-1)}.tw-mr-1\.5{margin-right:.375rem}.tw-mr-2{margin-right:var(--size-4-2)}.tw-mt-0{margin-top:0}.tw-mt-0\.5{margin-top:.125rem}.tw-mt-1{margin-top:var(--size-4-1)}.tw-mt-10{margin-top:2.5rem}.tw-mt-2{margin-top:var(--size-4-2)}.tw-mt-3{margin-top:var(--size-4-3)}.tw-mt-4{margin-top:var(--size-4-4)}.tw-mt-6{margin-top:var(--size-4-6)}.tw-mt-auto{margin-top:auto}.tw-line-clamp-2{-webkit-line-clamp:2}.tw-line-clamp-2,.tw-line-clamp-3{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical}.tw-line-clamp-3{-webkit-line-clamp:3}.tw-block{display:block}.tw-inline-block{display:inline-block}.tw-flex{display:flex}.tw-inline-flex{display:inline-flex}.tw-grid{displayLine truncated
@@ -0,0 +1,5 @@
{
"appliedMigrations": [
"tokens-to-secretstorage-v1"
]
}
+17
View File
@@ -0,0 +1,17 @@
{
"pluginList": [],
"pluginSubListFrozenVersion": [],
"themesList": [],
"updateAtStartup": true,
"updateThemesAtStartup": true,
"enableAfterInstall": true,
"loggingEnabled": false,
"loggingPath": "BRAT-log",
"loggingVerboseEnabled": false,
"debuggingMode": false,
"notificationsEnabled": true,
"globalTokenName": "",
"personalAccessToken": "",
"selectLatestPluginVersionByDefault": false,
"allowIncompatiblePlugins": false
}
+45
View File
@@ -0,0 +1,45 @@
"use strict";var nn=Object.create;var pe=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var rn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var x=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ln=(s,e)=>{for(var t in e)pe(s,t,{get:e[t],enumerable:!0})},Ze=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of on(e))!an.call(s,i)&&i!==t&&pe(s,i,{get:()=>e[i],enumerable:!(n=sn(e,i))||n.enumerable});return s};var un=(s,e,t)=>(t=s!=null?nn(rn(s)):{},Ze(e||!s||!s.__esModule?pe(t,"default",{value:s,enumerable:!0}):t,s)),cn=s=>Ze(pe({},"__esModule",{value:!0}),s);var $e=x((ms,et)=>{"use strict";var gn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};et.exports=gn});var xe=x((hs,tt)=>{"use strict";var dn="2.0.0",pn=Number.MAX_SAFE_INTEGER||9007199254740991,mn=16,hn=250,fn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];tt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:mn,MAX_SAFE_BUILD_LENGTH:hn,MAX_SAFE_INTEGER:pn,RELEASE_TYPES:fn,SEMVER_SPEC_VERSION:dn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Be=x((F,nt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Oe,MAX_SAFE_BUILD_LENGTH:bn,MAX_LENGTH:wn}=xe(),Tn=$e();F=nt.exports={};var En=F.re=[],yn=F.safeRe=[],h=F.src=[],vn=F.safeSrc=[],f=F.t={},Pn=0,Fe="[a-zA-Z0-9-]",Rn=[["\\s",1],["\\d",wn],[Fe,bn]],In=s=>{for(let[e,t]of Rn)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},y=(s,e,t)=>{let n=In(e),i=Pn++;Tn(s,i,e),f[s]=i,h[i]=e,vn[i]=n,En[i]=new RegExp(e,t?"g":void 0),yn[i]=new RegExp(n,t?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*");y("NUMERICIDENTIFIERLOOSE","\\d+");y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Fe}*`);y("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`);y("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`);y("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`);y("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`);y("BUILDIDENTIFIER",`${Fe}+`);y("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`);y("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`);y("FULL",`^${h[f.FULLPLAIN]}$`);y("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`);y("LOOSE",`^${h[f.LOOSEPLAIN]}$`);y("GTLT","((?:<|>)?=?)");y("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);y("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`);y("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`);y("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`);y("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`);y("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`);y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Oe}})(?:\\.(\\d{1,${Oe}}))?(?:\\.(\\d{1,${Oe}}))?`);y("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`);y("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`);y("COERCERTL",h[f.COERCE],!0);y("COERCERTLFULL",h[f.COERCEFULL],!0);y("LONETILDE","(?:~>?)");y("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0);F.tildeTrimReplace="$1~";y("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`);y("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`);y("LONECARET","(?:\\^)");y("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0);F.caretTrimReplace="$1^";y("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`);y("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`);y("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`);y("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`);y("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0);F.comparatorTrimReplace="$1$2$3";y("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`);y("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`);y("STAR","(<|>)?=?\\s*\\*");y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var it=x((fs,st)=>{"use strict";var Nn=Object.freeze({loose:!0}),An=Object.freeze({}),Cn=s=>s?typeof s!="object"?Nn:s:An;st.exports=Cn});var lt=x((bs,at)=>{"use strict";var ot=/^[0-9]+$/,rt=(s,e)=>{if(typeof s=="number"&&typeof e=="number")return s===e?0:s<e?-1:1;let t=ot.test(s),n=ot.test(e);return t&&n&&(s=+s,e=+e),s===e?0:t&&!n?-1:n&&!t?1:s<e?-1:1},Ln=(s,eLine truncated
GitHub API rate limit exceeded:`,`
Request: ${u.requestUrl}`,`
Rate limits - Remaining: ${u.remaining}`,`
Reset in: ${u.getMinutesToReset()} minutes`),u}throw e&&console.log("GitHub request failed:",o),a}};var je={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!0,updateThemesAtStartup:!0,enableAfterInstall:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!1,notificationsEnabled:!0,globalTokenName:"",personalAccessToken:"",selectLatestPluginVersionByDefault:!1,allowIncompatiblePlugins:!1};function Nt(s,e,t="latest",n=!1,i=""){let o=!1;s.settings.pluginList.contains(e)||(s.settings.pluginList.unshift(e),o=!0);let a=s.settings.pluginSubListFrozenVersion.find(c=>c.repo===e);a?(Object.assign(a,{repo:e,version:t,token:void 0,tokenName:i||a.tokenName,isIncompatible:n||void 0}),o=!0):(s.settings.pluginSubListFrozenVersion.unshift({repo:e,version:t,token:void 0,tokenName:i||void 0,isIncompatible:n||void 0}),o=!0),o&&s.saveSettings()}function Pe(s,e){return s.settings.pluginList.contains(e)}function At(s,e,t){let n={repo:e,lastUpdate:Z(t)};s.settings.themesList.unshift(n),s.saveSettings()}function Ct(s,e){return!!s.settings.themesList.find(n=>n.repo===e)}function ze(s,e,t){let n=s.settings.pluginSubListFrozenVersion.find(i=>i.repo===e);n&&(n.tokenName=t||void 0,s.saveSettings())}function Lt(s,e,t){for(let n of s.settings.themesList)n.repo===e&&(n.lastUpdate=t,s.saveSettings())}var L=require("obsidian");var j=class{constructor(e){this.statusEl=e}async validateToken(e,t){var n,i,o,a,c,u,g,m,l;if(!e)return(n=this.statusEl)==null||n.setText("No token provided"),(i=this.statusEl)==null||i.addClass("invalid"),(o=this.statusEl)==null||o.removeClass("valid"),!1;try{let r=await Et(e,t);return(a=this.statusEl)==null||a.removeClass("invalid","valid"),(c=this.statusEl)==null||c.empty(),r.validToken?((u=this.statusEl)==null||u.addClass("valid"),this.showValidTokenInfo(r),!0):((g=this.statusEl)==null||g.addClass("invalid"),this.showErrorMessage(r.error),!1)}catch(r){return console.error("Token validation error:",r),(m=this.statusEl)==null||m.setText("Failed to validate token"),(l=this.statusEl)==null||l.addClass("invalid"),!1}}showValidTokenInfo(e){var n,i;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-details"});if(t&&(t.createDiv({text:"\u2713 Valid token",cls:"brat-token-status valid"}),(i=e.currentScopes)!=null&&i.length&&t.createDiv({text:`Scopes: ${e.currentScopes.join(", ")}`,cls:"brat-token-scopes"}),e.rateLimit&&t.createDiv({text:`Rate Limit: ${e.rateLimit.remaining}/${e.rateLimit.limit}`,cls:"brat-token-rate"}),e.expirationDate)){let o=new Date(e.expirationDate),a=Math.ceil((o.getTime()-Date.now())/(1e3*60*60*24));a<7&&t.createDiv({text:`\u26A0\uFE0F Token expires in ${a} days`,cls:"brat-token-warning"})}}showErrorMessage(e){var n,i,o;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-error"});if(t&&(t.createDiv({text:e.message}),e.details))switch(e.type){case"invalid_prefix":t.createDiv({text:`Valid prefixes: ${(i=e.details.validPrefixes)==null?void 0:i.join(", ")}`});break;case"insufficient_scope":t.createDiv({text:`Required scopes: ${(o=e.details.requiredScopes)==null?void 0:o.join(", ")}`});break}}};function te(s,e){let t=new DocumentFragment,n=document.createElement("a");if(n.textContent=s,n.href=`https://github.com/${s}`,n.target="_blank",t.appendChild(n),e){let i=document.createTextNode(e);t.appendChild(i)}return t}function kt({prependText:s,url:e,text:t,appendText:n}){let i=new DocumentFragment,o=document.createElement("a");if(o.textContent=t,o.href=e,s){let a=document.createTextNode(s);i.appendChild(a)}if(i.appendChild(o),n){let a=document.createTextNode(n);i.appendChild(a)}return i}var Re=require("obsidian");function E(s,e,t=10,n){if(!s.settings.notificationsEnabled)return;let i=n?Re.Platform.isDesktop?"(click=dismiss, right-click=Info)":"(click=dismiss)":"",o=new Re.Notice(`BRAT
${e}
${i}`,t*1e3);n&&(o.noticeEl.oncontextmenu=()=>{n()})}var z=(s,e=!0)=>{let t=s.createEl("div");t.style.float="right",e?(t.style.padding="15px",t.style.paddingLeft="15px",t.style.paddingRight="15px",t.style.marginLeft="15px"):(t.style.padding="10px",t.style.paddingLeft="15px",t.style.paddingRight="15px");let n=t.createDiv("coffee");n.addClass("ex-twitter-span"),n.style.paddingLeft="10px";let i=n.createDiv();i.innerText="Learn more about my work at:",n.appendChild(i);let o=n.createEl("a",{href:"https://tfthacker.com"});return o.innerText="https://tfthacker.com",t};var St=require("obsidian"),Ie=class extends St.SuggestModal{constructor(e,t,n,i,o){super(e),this.versions=n,this.selected=i,this.onChoose=o,this.setTitle("Select a version"),this.setPlaceholder(`Type to search for a version for ${t}`),this.setInstructions([{command:"\u2191\u2193",purpose:"Navigate versions"},{command:"\u21B5",purpose:"Select version"},{command:"esc",purpose:"Dismiss modal"}])}getSuggestions(e){let t=e.toLowerCase();return this.versions.filter(n=>n.version.toLowerCase().contains(t))}renderSuggestion(e,t){t.createEl("div",{text:`${e.version} ${e.prerelease?"(Prerelease)":""}`})}onChooseSuggestion(e){this.onChoose(e.version)}onNoSuggestion(){this.onChoose(this.selected?this.selected:""),this.close()}};var U=class extends L.Modal{constructor(t,n,i=!1,o=!1,a="",c="",u=""){super(t.app);this.versionSetting=null;this.repositoryAddressEl=null;this.tokenInputEl=null;this.validateButton=null;this.validator=null;this.addPluginButton=null;this.cancelButton=null;this.plugin=t,this.betaPlugins=n,this.address=a,this.version=c,this.secretName=u,this.openSettingsTabAfterwards=i,this.updateVersion=o,this.enableAfterInstall=t.settings.enableAfterInstall}async submitForm(){var o,a,c,u,g,m,l,r;if(this.address==="")return;let t=ye(this.address);if(this.plugin.settings.pluginSubListFrozenVersion.find(d=>d.repo===t)){await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!0,this.enableAfterInstall,this.secretName)&&this.close(),(o=this.cancelButton)==null||o.setDisabled(!1),(a=this.addPluginButton)==null||a.setDisabled(!1),(c=this.addPluginButton)==null||c.setButtonText("Add Plugin"),(u=this.versionSetting)==null||u.setDisabled(!1);return}if(!this.version&&Pe(this.plugin,t)){E(this.plugin,"This plugin is already in the list for beta testing",10);return}await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!1,this.enableAfterInstall,this.secretName)&&this.close(),(g=this.cancelButton)==null||g.setDisabled(!1),(m=this.addPluginButton)==null||m.setDisabled(!1),(l=this.addPluginButton)==null||l.setButtonText("Add Plugin"),(r=this.versionSetting)==null||r.setDisabled(!1)}updateVersionDropdown(t,n,i=""){let o;t.clear(),n.length>0&&!i&&this.plugin.settings.selectLatestPluginVersionByDefault?(o="latest",this.version="latest"):o=i,n.length<20||L.Platform.isMobile?t.addDropdown(c=>{c.addOption("","Select a version"),c.addOption("latest","Latest version");for(let u of n)c.addOption(u.version,`${u.version} ${u.prerelease?"(Prerelease)":""}`);c.onChange(u=>{var g;this.version=u,(g=this.addPluginButton)==null||g.setDisabled(this.version==="")}),c.setValue(o),c.selectEl.addClass("brat-version-selector"),c.selectEl.style.width="100%"}):t.addButton(c=>{c.setButtonText(o==="latest"?"Latest version":o||"Select a version...").setClass("brat-version-selector").setClass("button").onClick(()=>{let g=[{version:"latest",prerelease:!1},...n];new Ie(this.app,this.address,g,o,l=>{var r;this.version=l,c.setButtonText(l==="latest"?"Latest version":l||"Select a version..."),(r=this.addPluginButton)==null||r.setDisabled(this.version==="")}).open()})})}onOpen(){let t=this.contentEl.createEl("h4");this.address?(t.appendText("Change plugin version: "),t.appendChild(te(this.address))):t.setText("Github repository for beta plugin:"),this.contentEl.createEl("form",{},n=>{var g;n.addClass("brat-modal"),(!this.address||!this.updateVersion)&&new L.Setting(n).setClass("repository-setting").then(l=>{l.addText(r=>{this.repositoryAddressEl=r,r.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name)"),r.setValue(this.address),r.onChange(d=>{var b,w;this.address=ye(d.trim()),this.version!==""&&(!this.address||!this.isGitHubRepositoryMatch(this.address))&&this.versionSetting&&(this.updateVersionDropdown(this.versionSetting,[]),this.versionSetting.settingEl.classList.add("disabled-setting"),this.versionSetting.setDisabled(!0),r.inputEl.classList.remove("valid-repository"),r.inputEl.classList.remove("invalid-repository")),this.version||(this.isGitHubRepositoryMatch(this.address)?(b=this.addPluginButton)==null||b.setDisabled(!1):(w=this.addPluginButton)==null||w.setDisabled(!0))}),r.inputEl.addEventListener("keydown",async d=>{var b,w,p;d.key==="Enter"&&(this.address&&(this.updateVersion&&this.version!==""||!this.updateVersion)&&(d.preventDefault(),(b=this.addPluginButton)==null||b.setDisabled(!0),(w=this.cancelButton)==null||w.setDisabled(!0),(p=this.versionSetting)==nu Line truncated
This does not seem to be an obsidian plugin with valid releases, as there are no releases available.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let m=await Q(g,"manifest.json",this.plugin.settings.debuggingMode,u,c);if(!m)return n&&(E(this.plugin,`${e}
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let l=JSON.parse(m);if(!("id"in l))return n&&E(this.plugin,`${e}
The plugin id attribute for the release is missing from the manifest file`,15),null;if(!("version"in l))return n&&E(this.plugin,`${e}
The version attribute for the release is missing from the manifest file`,15),null;try{let r=Ae(g.tag_name,{includePrerelease:!0,loose:!0}),d=Ae(l.version,{includePrerelease:!0,loose:!0});$t(r,d)!==0&&(n&&E(this.plugin,`${e}
Version mismatch detected:
Release tag version: ${g.tag_name}
Manifest version: ${l.version}
The release tag version will be used to ensure consistency.`,15),l.version=r.version)}catch(r){}return l}catch(u){if(u instanceof D){let g=`GitHub API rate limit exceeded. Reset in ${u.getMinutesToReset()} minutes.`;throw n&&E(this.plugin,g,15),console.error(`BRAT: validateRepository ${u}`),E(this.plugin,`${u.message} Consider adding a personal access token in BRAT settings for higher limits. See documentation for details.`,20,()=>{window.open("https://github.com/TfTHacker/obsidian42-brat/blob/main/BRAT-DEVELOPER-GUIDE.md#github-api-rate-limits")}),u}if(u instanceof O)throw n&&(u.status===401?E(this.plugin,`${e}
GitHub API Authentication error. Please verify that your personal access token is valid and set correctly.`,15):E(this.plugin,`${e}
GitHub API error ${u.status}: ${u.message}`,15)),console.error(`BRAT: validateRepository ${u}`),u;return n&&E(this.plugin,`${e}
Unspecified error encountered: ${u}, verify debug for more information.`,15),null}}async getAllReleaseFiles(e,t,n="",i=""){let o=i,a=await He(e,this.plugin.settings.debuggingMode,o),c=await Ge(e,n,t,this.plugin.settings.debuggingMode,a,o);if(!c)return Promise.reject("No release found");let u=t||n!=="";return console.log({reallyGetManifestOrNot:u,version:c.tag_name}),{mainJs:await Q(c,"main.js",this.plugin.settings.debuggingMode,a,o),manifest:u?await Q(c,"manifest.json",this.plugin.settings.debuggingMode,a,o):"",styles:await Q(c,"styles.css",this.plugin.settings.debuggingMode,a,o)}}async writeReleaseFilesToPluginFolder(e,t){var o,a;let n=`${(0,k.normalizePath)(`${this.plugin.app.vault.configDir}/plugins/${e}`)}/`,{adapter:i}=this.plugin.app.vault;await i.exists(n)||await i.mkdir(n),await i.write(`${n}main.js`,(o=t.mainJs)!=null?o:""),await i.write(`${n}manifest.json`,(a=t.manifest)!=null?a:""),t.styles&&await i.write(`${n}styles.css`,t.styles)}async addPlugin(e,t=!1,n=!1,i=!1,o="",a=!1,c=this.plugin.settings.enableAfterInstall,u=""){try{this.plugin.settings.debuggingMode&&console.log("BRAT: addPlugin",e,t,n,i,o,a,c,u?"with secret":"public");let g="";u&&u.trim()!==""?(g=await this.plugin.app.secretStorage.getSecret(u)||"",g||E(this.plugin,`Secret not found for token name: ${u}. Please add it to SecretStorage or clear the token name for this plugin.`,10)):this.plugin.settings.globalTokenName&&(g=await this.plugin.app.secretStorage.getSecret(this.plugin.settings.globalTokenName)||"");let m=10,l=await this.validateRepository(e,!0,!0,o,g),r=!!l;if(r||(l=await this.validateRepository(e,!1,!0,o,g)),l===null){let w=`${e}
A manifest.json file does not exist in the latest release of the repository. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}if(!Object.hasOwn(l,"version")){let w=`${e}
The manifest.json file in the latest release or pre-release of the repository does not have a version number in the file. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}let d=!1;if(Object.hasOwn(l,"minAppVersion")&&!(0,k.requireApiVersion)(l.minAppVersion)){if(o===""||o==="latest"||!this.plugin.settings.allowIncompatiblePlugins){let p=`Plugin: ${e}
The manifest.json for this plugin indicates that the Obsidian version of the app needs to be ${l.minAppVersion}, but this installation of Obsidian is ${k.apiVersion}.
You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return await this.plugin.log(p,!0),E(this.plugin,p,30),!1}if(!await De({app:this.plugin.app,message:createFragment(p=>{p.appendText("Plugin: "),p.createEl("code",{text:e}),p.createEl("br"),p.appendText("The "),p.createEl("code",{text:"manifest.json"}),p.appendText(" for this plugin indicates that the Obsidian version of the app needs to be "),p.createEl("code",{text:l.minAppVersion}),p.appendText(", but this installation of Obsidian is "),p.createEl("code",{text:k.apiVersion}),p.appendText("."),p.createEl("br"),p.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),p.createEl("br"),p.appendText("Do you want to install it anyways?")})}))return!1;d=!0}let b=async()=>{var T,C;let w=await this.getAllReleaseFiles(e,r,o,g);console.log("rFiles",w),(r||w.manifest==="")&&(w.manifest=JSON.stringify(l));let p=JSON.parse((T=w.manifest)!=null?T:"");if(d&&(p.brat={isIncompatible:!0,minAppVersionOriginal:p.minAppVersion},p.minAppVersion=k.apiVersion),k.Platform.isMobile&&p.isDesktopOnly)if(this.plugin.settings.allowIncompatiblePlugins){if(!await De({app:this.plugin.app,message:createFragment(R=>{R.appendText("Plugin: "),R.createEl("code",{text:e}),R.createEl("br"),R.appendText("The "),R.createEl("code",{text:"manifest.json"}),R.appendText(" for this plugin indicates that the plugin has "),R.createEl("code",{text:"isDesktopOnly: true"}),R.appendText(", but you are using a mobile device."),R.createEl("br"),R.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),R.createEl("br"),R.appendText("Do you want to forcefully run it on mobile anyways?")})}))return null;p.isDesktopOnly=!1,(C=p.brat)!=null||(p.brat={}),p.brat.isDesktopOnlyOriginal=!0,p.brat.isIncompatible=!0,d=!0}else{let N=`Plugin: ${e}
The manifest.json for this plugin indicates that the plugin has isDesktopOnly: true, but you are using a mobile device.
The plugin will not be installed.`;return await this.plugin.log(N,!0),E(this.plugin,N,30),null}if(d&&(w.manifest=JSON.stringify(p)),this.plugin.settings.debuggingMode&&console.log("BRAT: rFiles.manifest",r,w),w.mainJs===null){let N=`${e}
The release is not complete and cannot be downloaded. main.js is missing from the Release`;return await this.plugin.log(N,!0),E(this.plugin,N,m),null}return w};if(!t||a){let w=await b();if(w===null)return!1;if(await this.writeReleaseFilesToPluginFolder(l.id,w),Nt(this.plugin,e,o,d,u),c){let{plugins:p}=this.plugin.app,T=(0,k.normalizePath)(`${p.getPluginFolder()}/${l.id}`);await p.loadManifest(T),await p.enablePluginAndSave(l.id)}if(await this.plugin.app.plugins.loadManifests(),a)await this.reloadPlugin(l.id),await this.plugin.log(`${e} reinstalled`,!0),E(this.plugin,`${e}
Plugin has been reinstalled and reloaded with version ${l.version}`,m);else{let p=o===""?"":` (version: ${o})`,T=`${e}${p}
The plugin has been registered with BRAT.`;c||(T+=" You may still need to enable it the Community Plugin List."),await this.plugin.log(T,!0),E(this.plugin,T,m)}}else{let w=`${this.plugin.app.vault.configDir}/plugins/${l.id}/`,p="";try{p=await this.plugin.app.vault.adapter.read(`${w}manifest.json`)}catch(R){if(R.errno===-4058||R.errno===-2)return await this.addPlugin(e,!1,r,!1,o,!1,c,u),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(R,null,2))}if(o!==""&&o!=="latest")return E(this.plugin,`The version of ${e} is frozen, not updating.`,3),!1;let T=await JSON.parse(p),C=Ae(T.version,{includePrerelease:!0,loose:!0}),N=Ae(l.version,{includePrerelease:!0,loose:!0});if($t(C,N)===-1){let R=await b();if(R===null)return!1;if(n){let J=`There is an update available for ${l.id} from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${J}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,J,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!1}await this.writeReleaseFilesToPluginFolder(l.id,R),await this.plugin.app.plugins.loadManifests(),await this.reloadPlugin(l.id);let P=`${l.id}
Plugin has been updated from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${P}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,P,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!0}return i&&E(this.plugin,`No update available for ${e}`,3),!0}}catch(g){console.error(`BRAT: Error adding plugin ${e}:`,{error:g,updatePluginFiles:t,seeIfUpdatedOnly:n,specifyVersion:o,forceReinstall:a});let m=g instanceof Error?g.message:"Unknown error occurred";return await this.plugin.log(`Error ${t?"updating":"adding"} plugin ${e}: ${m}`,!0),!1}return!0}async reloadPlugin(e){let{plugins:t}=this.plugin.app;try{await t.disablePlugin(e),await t.enablePlugin(e)}catch(n){this.plugin.settings.debuggingMode&&console.log("reload plugin",n)}}async updatePlugin(e,t=!1,n=!1,i=!1,o=""){let a=await this.addPlugin(e,!0,t,n,"",i,!1,o);return!a&&!t&&E(this.plugin,`${e}
Update of plugin failed.`),a}async checkForPluginUpdatesAndInstallUpdates(e=!1,t=!1){if(!await Ne()){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";await this.plugin.log(i,!0),e&&this.plugin.settings.notificationsEnabled&&(n=new k.Notice(`BRAT
${i}`,3e4));let o=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.version])),a=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.tokenName||""]));for(let u of this.plugin.settings.pluginList){let g=o.get(u);g&&g!=="latest"||await this.updatePlugin(u,t,!1,!1,a.get(u)||"")}let c="Checking for plugin updates COMPLETED";await this.plugin.log(c,!0),e&&(n&&n.hide(),E(this.plugin,c,10))}deletePlugin(e){let t=`Removed ${e} from BRAT plugin list`;this.plugin.log(t,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!==e),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!==e),this.plugin.saveSettings()}getEnabledDisabledPlugins(e){let t=this.plugin.app.plugins,n=Object.values(t.manifests),i=Object.values(t.plugins).map(o=>o.manifest);return e?n.filter(o=>i.find(a=>o.id===a.id)):n.filter(o=>!i.find(a=>o.id===a.id))}checkIncompatiblePlugins(){let e=this.plugin.settings.pluginSubListFrozenVersion.filter(t=>t.isIncompatible).map(t=>t.repo);e.length>0&&E(this.plugin,`The following incompatible plugins were forcefully installed by BRAT and may not work as expected:
${e.join(`
`)}`,30)}};var _=require("obsidian");var se=async(s,e,t)=>{let n=await G(e,!0,s.settings.debuggingMode);if(n||(n=await G(e,!1,s.settings.debuggingMode)),!n)return E(s,"There is no theme.css or theme-beta.css file in the root path of this repository, so there is no theme to install."),!1;let i=await Rt(e,s.settings.debuggingMode);if(!i)return E(s,"There is no manifest.json file in the root path of this repository, so theme cannot be installed."),!1;let o=await JSON.parse(i),a=(0,_.normalizePath)(Un(s)+o.name),{adapter:c}=s.app.vault;await c.exists(a)||await c.mkdir(a),await c.write((0,_.normalizePath)(`${a}/theme.css`),n),await c.write((0,_.normalizePath)(`${a}/manifest.json`),i),Lt(s,e,Z(n));let u="";return t?(At(s,e,n),u=`${o.name} theme installed from ${e}. `,setTimeout(()=>{s.app.customCss.setTheme(o.name)},500)):u=`${o.name} theme updated from ${e}.`,s.log(`${u}[Theme Info](https://github.com/${e})`,!1),E(s,u,20,()=>{window.open(`https://github.com/${e}`)}),!0},q=async(s,e)=>{if(!await Ne()){console.log("BRAT: No internet detected.");return}let t,n="Checking for beta theme updates STARTED";await s.log(n,!0),e&&s.settings.notificationsEnabled&&(t=new _.Notice(`BRAT
${n}`,3e4));for(let o of s.settings.themesList){let a=await ee(o.repo,!0,s.settings.debuggingMode);a==="0"&&(a=await ee(o.repo,!1,s.settings.debuggingMode)),console.log("BRAT: lastUpdateOnline",a),a!==o.lastUpdate&&await se(s,o.repo,!1)}let i="Checking for beta theme updates COMPLETED";(async()=>await s.log(i,!0))(),e&&(s.settings.notificationsEnabled&&t&&t.hide(),E(s,i))},Ce=(s,e)=>{s.settings.themesList=s.settings.themesList.filter(n=>n.repo!==e),s.saveSettings();let t=`Removed ${e} from BRAT themes list and will no longer be updated. However, the theme files still exist in the vault. To remove them, go into Settings > Appearance and remove the theme.`;s.log(t,!0),E(s,t)},Un=s=>`${(0,_.normalizePath)(`${s.app.vault.configDir}/themes`)}/`;var xt="brat-migrations";async function _n(s,e){try{let t=await s.vault.adapter.read(`${s.vault.configDir}/plugins/obsidian42-brat/${xt}.json`);return JSON.parse(t).appliedMigrations.includes(e)}catch(t){return!1}}async function Hn(s,e){try{let t=`${s.vault.configDir}/plugins/obsidian42-brat/${xt}.json`,n={appliedMigrations:[]};try{let i=await s.vault.adapter.read(t);n=JSON.parse(i)}catch(i){}n.appliedMigrations.includes(e)||(n.appliedMigrations.push(e),await s.vault.adapter.write(t,JSON.stringify(n,null,2)))}catch(t){console.error(`BRAT: Failed to mark migration ${e} complete:`,t)}}async function Ot(s,e,t){let n="tokens-to-secretstorage-v1";if(!await _n(s,n))try{let i=0,o=u=>{let m=`brat-gh-${u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}`;return m.length>64?m.substring(0,64).replace(/-$/,""):m},a=u=>{let g=s.secretStorage.listSecrets();for(let m of g)if(s.secretStorage.getSecret(m)===u)return m;return null},c=(u,g)=>{let m=a(u);return m?(console.log(`BRAT: Reusing existing secret "${m}"`),m):(s.secretStorage.setSecret(g,u),console.log(`BRAT: Created new secret "${g}"`),g)};if(e.personalAccessToken&&e.personalAccessToken.trim()!==""){let u=e.personalAccessToken.trim(),m=c(u,"brat-gh-global");e.globalTokenName=m,e.personalAccessToken="",i++}if(e.pluginSubListFrozenVersion){for(let u of e.pluginSubListFrozenVersion)if(u.token&&u.token.trim()!==""){let g=u.token.trim(),m=o(u.repo),l=c(g,m);u.tokenName=l,u.token=void 0,i++}}i>0&&(await t(),console.log(`BRAT: Migrated ${i} token(s) to SecretStorage`)),await Hn(s,n)}catch(i){console.error("BRAT: Failed to migrate tokens to SecretStorage:",i)}}var H=require("obsidian");var B=class extends H.Modal{constructor(e,t=!1){super(e.app),this.plugin=e,this.address="",this.openSettingsTabAfterwards=t}async submitForm(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(Ct(this.plugin,e)){E(this.plugin,"This theme is already in the list for beta testing",10);return}await se(this.plugin,e,!0)&&this.close()}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{e.addClass("brat-modal"),new H.Setting(e).addText(i=>{i.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name"),i.setValue(this.address),i.onChange(o=>{this.address=o.trim()}),i.inputEl.addEventListener("keydown",o=>{o.key==="Enter"&&this.address!==" "&&(o.preventDefault(),this.submitForm())}),i.inputEl.style.width="100%",window.setTimeout(()=>{let o=document.querySelector(".setting-item-info");o&&o.remove(),i.inputEl.focus()},10)}),e.createDiv("modal-button-container",i=>{new H.ButtonComponent(i).setButtonText("Never mind").onClick(()=>{this.close()}),new H.ButtonComponent(i).setButtonText("Add theme").setCta().onClick(o=>{o.preventDefault(),console.log("Add theme button clicked"),this.address!==""&&this.submitForm()})});let t=e.createDiv();t.style.borderTop="1px solid #ccc",t.style.marginTop="30px";let n=t.createSpan();n.createEl("a",{href:"https://bit.ly/o42-twitter",text:"TFTHacker"}),n.appendText(" and "),n.createEl("a",{href:"https://github.com/johannrichard",text:"johannrichard"}),n.style.fontStyle="italic",t.appendChild(n),z(t,!1),window.setTimeout(()=>{let i=e.querySelectorAll(".brat-modal .setting-item-info");for(let o of Array.from(i))o.remove()},50)})}onClose(){this.openSettingsTabAfterwards&&(this.plugin.app.setting.openTab(),this.plugin.app.setting.openTabById(this.plugin.APP_ID))}};var Ft=require("obsidian");function Bt(){(0,Ft.addIcon)("BratIcon",'<path fill="currentColor" stroke="currentColor" d="M 41.667969 41.667969 C 41.667969 39.367188 39.800781 37.5 37.5 37.5 C 35.199219 37.5 33.332031 39.367188 33.332031 41.667969 C 33.332031 43.96875 35.199219 45.832031 37.5 45.832031 C 39.800781 45.832031 41.667969 43.96875 41.667969 41.667969 Z M 60.417969 58.582031 C 59.460938 58.023438 58.320312 57.867188 57.25 58.148438 C 56.179688 58.429688 55.265625 59.125 54.707031 60.082031 C 53.746094 61.777344 51.949219 62.820312 50 62.820312 C 48.050781 62.820312 46.253906 61.777344 45.292969 60.082031 C 44.734375 59.125 43.820312 58.429688 42.75 58.148438 C 41.679688 57.867188 40.539062 58.023438 39.582031 58.5820 Line truncated
${o}`,3),this.plugin.betaPlugins.updatePlugin(i.info,!1,!0,!1,a==null?void 0:a.token)})}},{id:"reinstallOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin to reinstall",showInRibbon:!0,callback:()=>{let e=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),t=Object.values(this.plugin.settings.pluginList).filter(i=>!e.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{let o=`Reinstalling ${i.info}`;E(this.plugin,`
${o}`,3),this.plugin.log(o,!0),this.plugin.betaPlugins.updatePlugin(i.info,!1,!1,!0)})}},{id:"restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>{let e=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{E(this.plugin,`${n.info}
Plugin reloading .....`,5),this.plugin.betaPlugins.reloadPlugin(n.info)})}},{id:"disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.log(n.info),this.plugin.app.plugins.disablePluginAndSave(n.info)})}},{id:"enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin enabled`,!1),this.plugin.app.plugins.enablePluginAndSave(n.info)})}},{id:"openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:async()=>{let e=await vt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:`BRAT: ${o}`,info:o}));for(let o of t)n.push(o);let i=new S(this.plugin);i.setSuggesterData(n),i.display(o=>{o.info&&window.open(`https://github.com/${o.info}`)})}}},{id:"openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:async()=>{let e=await Pt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{i.info&&window.open(`https://github.com/${i.info}`)})}}},{id:"opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>{let e=this.plugin.app.setting,t=Object.values(e.pluginTabs).map(o=>({display:`Plugin: ${o.name}`,info:o.id})),n=new S(this.plugin),i=Object.values(e.settingTabs).map(o=>({display:`Core: ${o.name}`,info:o.id}));for(let o of t)i.push(o);n.setSuggesterData(i),n.display(o=>{e.open(),e.openTabById(o.info)})}},{id:"GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>{new B(this.plugin).open()}},{id:"updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:async()=>{await q(this.plugin,!0)}},{id:"allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>{this.ribbonDisplayCommands()}}];this.plugin=e;for(let t of this.bratCommands)this.plugin.addCommand({id:t.id,name:t.name,icon:t.icon,callback:()=>{t.callback()}})}ribbonDisplayCommands(){let e=[];for(let a of this.bratCommands)a.showInRibbon&&e.push({display:a.name,info:a.callback});let t=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(a=>({display:`Core: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}})),o=Object.values(n.pluginTabs).map(a=>({display:`Plugin: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}}));e.push({display:"---- Core Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of i)e.push(a);e.push({display:"---- Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of o)e.push(a);t.setSuggesterData(e),t.display(a=>{typeof a.info=="function"&&a.info()})}};var A=require("obsidian");var Le=class extends A.PluginSettingTab{constructor(t,n){super(t,n);this.accessTokenSetting=null;this.accessTokenButton=null;this.tokenInfo=null;this.validator=null;this.plugin=n}display(){let{containerEl:t}=this;t.empty(),t.addClass("brat-settings"),new A.Setting(t).setName("Auto-enable plugins after installation").setDesc('If enabled beta plugins will be automatically enabled after installtion by default. Note: you can toggle this on and off for each plugin in the "Add Plugin" form.').addToggle(l=>{l.setValue(this.plugin.settings.enableAfterInstall).onChange(async r=>{this.plugin.settings.enableAfterInstall=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(l=>{l.setValue(this.plugin.settings.updateAtStartup).onChange(async r=>{this.plugin.settings.updateAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(l=>{l.setValue(this.plugin.settings.updateThemesAtStartup).onChange(async r=>{this.plugin.settings.updateThemesAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Select latest plugin version by default").setDesc("If enabled the latest version will be selected by default when adding Line truncated
`," ")}
`,u=s.app.vault.getAbstractFileByPath(n);u?await s.app.vault.append(u,c):u=await s.app.vault.create(n,c)}}var ke=class extends tn.Plugin{constructor(){super(...arguments);this.APP_NAME="BRAT";this.APP_ID="obsidian42-brat";this.settings=je;this.betaPlugins=new ne(this);this.commands=new ie(this);this.bratApi=new oe(this);this.obsidianProtocolHandler=t=>{if(!t.plugin&&!t.theme){E(this,"Could not locate the repository from the URL.",10);return}for(let n of["plugin","theme"])if(t[n]){let i;switch(n){case"plugin":i=new U(this,this.betaPlugins,!0,!1,t[n],t.version?t.version:void 0),i.open();break;case"theme":i=new B(this),i.address=t[n],i.open();break}return}}}onload(){console.log(`loading ${this.APP_NAME}`),Bt(),this.addRibbonIcon("BratIcon","BRAT",()=>{this.commands.ribbonDisplayCommands()}),this.loadSettings().then(async()=>{await Ot(this.app,this.settings,()=>this.saveSettings()),this.app.workspace.onLayoutReady(()=>{this.addSettingTab(new Le(this.app,this)),this.registerObsidianProtocolHandler("brat",this.obsidianProtocolHandler),this.betaPlugins.checkIncompatiblePlugins(),this.settings.updateAtStartup&&setTimeout(()=>{this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(!1)},6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>{q(this,!1)},12e4),setTimeout(()=>{window.bratAPI=this.bratApi},500)})}).catch(t=>{console.error("Failed to load settings:",t)})}async log(t,n=!1){await en(this,t,n)}onunload(){console.log(`unloading ${this.APP_NAME}`)}async loadSettings(){this.settings=Object.assign({},je,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};
/* nosourcemap */
+14
View File
@@ -0,0 +1,14 @@
{
"id": "obsidian42-brat",
"name": "BRAT",
"version": "2.0.4",
"minAppVersion": "1.11.4",
"description": "Easily install a beta version of a plugin for testing.",
"author": "TfTHacker",
"authorUrl": "https://github.com/TfTHacker/obsidian42-brat",
"helpUrl": "https://tfthacker.com/BRAT",
"isDesktopOnly": false,
"fundingUrl": {
"Visit my site": "https://tfthacker.com"
}
}
+152
View File
@@ -0,0 +1,152 @@
.brat-modal .modal-button-container {
margin-top: 5px;
}
.brat-modal .disabled-setting {
opacity: 0.5;
}
.brat-modal .disabled-setting:hover {
cursor: not-allowed;
}
/* Input validation styles */
.brat-settings .valid-input,
.brat-modal .valid-repository {
border-color: var(--color-green);
}
.brat-settings .invalid-input,
.brat-modal .invalid-repository {
border-color: var(--color-red);
}
.brat-settings .validation-error,
.brat-modal .validation-error {
border-color: var(--color-orange);
}
/* Version selector */
.brat-version-selector {
width: 100%;
max-width: 400px;
justify-content: left;
}
.brat-token-input {
min-width: 33%;
}
/* Token info container styles */
.brat-token-info {
margin-top: 8px;
font-size: 0.8em;
padding: 8px;
border-radius: 4px;
background-color: var(--background-secondary);
}
/* Token status indicators */
.brat-token-info.valid,
.brat-token-status.valid {
color: var(--color-green);
}
.brat-token-info.invalid,
.brat-token-status.invalid {
color: var(--color-red);
}
.brat-token-info.valid {
border-left: 3px solid var(--color-green);
}
.brat-token-info.invalid {
border-left: 3px solid var(--color-red);
}
/* Token details and status */
.brat-token-status {
margin-bottom: 4px;
}
.brat-token-details {
margin-top: 4px;
color: var(--text-muted);
}
/* Token warnings */
.brat-token-warning {
color: var(--color-orange);
margin-top: 4px;
}
/* Token additional info */
.brat-token-scopes,
.brat-token-rate {
color: var(--text-muted);
margin-top: 2px;
}
/* Flex break utility */
.brat-modal .break {
flex-basis: 100%;
height: 0;
}
/* Validation status */
.brat-modal .validation-status-error {
color: var(--text-error);
}
.brat-modal .validation-status {
margin-top: 0.5em;
margin-bottom: 0.5em;
font-size: 0.8em;
text-align: left;
}
.confirm-modal .ok-button {
margin-right: 10px;
margin-top: 20px;
}
/* Hide filtered plugin items */
.brat-plugin-item[hidden] {
display: none !important;
}
/* Hide filtered theme items */
.brat-theme-item[hidden] {
display: none !important;
}
/* Filter and button layout */
.brat-filter-and-button {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin: 0.75em 0;
}
.brat-filter-input {
max-width: 300px;
padding: 4px 8px;
border: 1px solid var(--background-modifier-border);
border-radius: 4px;
background-color: var(--background-secondary);
color: var(--text-normal);
}
.brat-filter-input:focus {
outline: none;
border-color: var(--interactive-accent);
}
.brat-filter-and-button .setting-item {
border: none;
padding: 0;
}
.brat-filter-and-button .setting-item-control {
justify-content: flex-end;
}
+273
View File
@@ -0,0 +1,273 @@
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/main.ts
var main_exports = {};
__export(main_exports, {
default: () => main_default
});
module.exports = __toCommonJS(main_exports);
// src/service/kebabCase.ts
function kebabCase(str) {
return str.replace(/[^a-zA-Z0-9 ]/g, " ").replace(/\s+/g, "-").toLocaleLowerCase();
}
// src/Ollama.ts
var import_obsidian2 = require("obsidian");
// src/OllamaSettingTab.ts
var import_obsidian = require("obsidian");
// src/data/defaultSettings.ts
var DEFAULT_SETTINGS = {
ollamaUrl: "http://localhost:11434",
commands: [
{
name: "Summarize selection",
prompt: "Act as a writer. Summarize the text in a view sentences highlighting the key takeaways. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Explain selection",
prompt: "Act as a writer. Explain the text in simple and concise terms keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Expand selection",
prompt: "Act as a writer. Expand the text by adding more details while keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Rewrite selection (formal)",
prompt: "Act as a writer. Rewrite the text in a more formal style while keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Rewrite selection (casual)",
prompt: "Act as a writer. Rewrite the text in a more casual style while keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Rewrite selection (active voice)",
prompt: "Act as a writer. Rewrite the text in with an active voice while keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Rewrite selection (bullet points)",
prompt: "Act as a writer. Rewrite the text into bullet points while keeping the same meaning. Output only the text and nothing else, do not chat, no preamble, get to the point.",
model: "llama2"
},
{
name: "Caption selection",
prompt: "Act as a writer. Create only one single heading for the whole text that is giving a good understanding of what the reader can expect. Output only the caption and nothing else, do not chat, no preamble, get to the point. Your format should be ## Caption.",
model: "llama2"
}
]
};
// src/OllamaSettingTab.ts
var OllamaSettingTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
new import_obsidian.Setting(containerEl).setName("Ollama URL").setDesc("URL of the Ollama server (e.g. http://localhost:11434)").addText(
(text) => text.setPlaceholder("http://localhost:11434").setValue(this.plugin.settings.ollamaUrl).onChange(async (value) => {
this.plugin.settings.ollamaUrl = value;
await this.plugin.saveSettings();
})
);
containerEl.createEl("h3", { text: "Commands" });
const newCommand = {
name: "",
prompt: "",
model: "",
temperature: void 0
};
new import_obsidian.Setting(containerEl).setName("New command name").addText((text) => {
text.setPlaceholder("e.g. Summarize selection");
text.onChange(async (value) => {
newCommand.name = value;
});
});
new import_obsidian.Setting(containerEl).setName("New command prompt").addTextArea((text) => {
text.setPlaceholder(
"e.g. Act as a writer. Summarize the text in a view sentences highlighting the key takeaways. Output only the text and nothing else, do not chat, no preamble, get to the point."
);
text.onChange(async (value) => {
newCommand.prompt = value;
});
});
new import_obsidian.Setting(containerEl).setName("New command model").addText((text) => {
text.setPlaceholder("e.g. llama2");
text.onChange(async (value) => {
newCommand.model = value;
});
});
new import_obsidian.Setting(containerEl).setName("New command temperature").addSlider((slider) => {
slider.setLimits(0, 1, 0.01);
slider.setValue(0.2);
slider.onChange(async (value) => {
newCommand.temperature = value;
});
});
new import_obsidian.Setting(containerEl).setDesc("This requires a reload of obsidian to take effect.").addButton(
(button) => button.setButtonText("Add Command").onClick(async () => {
if (!newCommand.name) {
new import_obsidian.Notice("Please enter a name for the command.");
return;
}
if (this.plugin.settings.commands.find(
(command) => command.name === newCommand.name
)) {
new import_obsidian.Notice(
`A command with the name "${newCommand.name}" already exists.`
);
return;
}
if (!newCommand.prompt) {
new import_obsidian.Notice("Please enter a prompt for the command.");
return;
}
if (!newCommand.model) {
new import_obsidian.Notice("Please enter a model for the command.");
return;
}
this.plugin.settings.commands.push(newCommand);
await this.plugin.saveSettings();
this.display();
})
);
containerEl.createEl("h4", { text: "Existing Commands" });
this.plugin.settings.commands.forEach((command) => {
new import_obsidian.Setting(containerEl).setName(command.name).setDesc(`${command.prompt} - ${command.model}`).addButton(
(button) => button.setButtonText("Remove").onClick(async () => {
this.plugin.settings.commands = this.plugin.settings.commands.filter(
(c) => c.name !== command.name
);
await this.plugin.saveSettings();
this.display();
})
);
});
containerEl.createEl("h4", { text: "Reset Commands" });
new import_obsidian.Setting(containerEl).setName("Update Commands").setDesc(
"Update commands to the default commands. This cannot be undone and will overwrite some commands by matching names. This requires a reload of obsidian to take effect."
).addButton((button) => {
button.setWarning();
return button.setButtonText("Update").onClick(async () => {
DEFAULT_SETTINGS.commands.forEach((command) => {
const existingCommand = this.plugin.settings.commands.find(
(c) => c.name === command.name
);
if (existingCommand) {
existingCommand.prompt = command.prompt;
existingCommand.model = command.model;
existingCommand.temperature = command.temperature;
} else {
this.plugin.settings.commands.push(command);
}
});
await this.plugin.saveSettings();
this.display();
});
});
new import_obsidian.Setting(containerEl).setName("Reset Commands").setDesc(
"Reset all commands to the default commands. This cannot be undone and will delete all your custom commands. This requires a reload of obsidian to take effect."
).addButton((button) => {
button.setWarning();
return button.setButtonText("Reset").onClick(async () => {
this.plugin.settings.commands = DEFAULT_SETTINGS.commands;
await this.plugin.saveSettings();
this.display();
});
});
}
};
// src/Ollama.ts
var Ollama = class extends import_obsidian2.Plugin {
async onload() {
await this.loadSettings();
this.addPromptCommands();
this.addSettingTab(new OllamaSettingTab(this.app, this));
}
addPromptCommands() {
this.settings.commands.forEach((command) => {
this.addCommand({
id: kebabCase(command.name),
name: command.name,
editorCallback: (editor) => {
const selection = editor.getSelection();
const text = selection ? selection : editor.getValue();
const cursorPosition = editor.getCursor();
editor.replaceRange("\u270D\uFE0F", cursorPosition);
(0, import_obsidian2.requestUrl)({
method: "POST",
url: `${this.settings.ollamaUrl}/api/generate`,
body: JSON.stringify({
prompt: command.prompt + "\n\n" + text,
model: command.model,
options: {
temperature: command.temperature || 0.2
}
})
}).then((response) => {
const steps = response.text.split("\n").filter((step) => step && step.length > 0).map((step) => JSON.parse(step));
editor.replaceRange(
steps.map((step) => step.response).join("").trim(),
cursorPosition,
{
ch: cursorPosition.ch + 1,
line: cursorPosition.line
}
);
}).catch((error) => {
new import_obsidian2.Notice(`Error while generating text: ${error.message}`);
editor.replaceRange("", cursorPosition, {
ch: cursorPosition.ch + 1,
line: cursorPosition.line
});
});
}
});
});
}
onunload() {
}
async loadSettings() {
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
}
async saveSettings() {
await this.saveData(this.settings);
}
};
// src/main.ts
var main_default = Ollama;
/* nosourcemap */
+10
View File
@@ -0,0 +1,10 @@
{
"id": "ollama",
"name": "Ollama",
"version": "0.0.1",
"minAppVersion": "0.15.0",
"description": "This is a plugin for Obsidian that enables the usage of Ollama within your notes.",
"author": "hinterdupfinger",
"authorUrl": "https://github.com/hinterdupfinger",
"isDesktopOnly": true
}
+206
View File
@@ -0,0 +1,206 @@
{
"version": 51,
"providers": [
{
"id": "ollama",
"presetType": "ollama",
"apiType": "openai-compatible",
"baseUrl": "http://127.0.0.1:11434",
"apiKey": ""
}
],
"chatModels": [
{
"providerId": "ollama",
"id": "ollama/qwen2.5:7b",
"model": "qwen2.5:7b",
"name": "qwen2.5:7b",
"modalities": [
"text"
],
"toolType": "none",
"gptTools": {
"webSearch": {
"enabled": false
}
},
"reasoningType": "none",
"enable": true
}
],
"embeddingModels": [
{
"providerId": "ollama",
"id": "ollama/nomic-embed-text:latest",
"model": "nomic-embed-text:latest",
"name": "nomic-embed-text:latest",
"dimension": 768,
"nativeDimension": 768
}
],
"chatModelId": "ollama/qwen2.5:7b",
"chatTitleModelId": "ollama/qwen2.5:7b",
"embeddingModelId": "ollama/nomic-embed-text:latest",
"systemPrompt": "",
"ragOptions": {
"enabled": true,
"chunkSize": 1000,
"thresholdTokens": 20000,
"minSimilarity": 0,
"limit": 10,
"excludePatterns": [],
"includePatterns": [],
"indexPdf": true,
"autoUpdateEnabled": true,
"autoUpdateIntervalHours": 0,
"lastAutoUpdateAt": 1778518294409
},
"mcp": {
"servers": [],
"builtinToolOptions": {}
},
"webSearch": {
"providers": [],
"common": {
"resultSize": 10,
"searchTimeoutMs": 120000,
"scrapeTimeoutMs": 20000
}
},
"skills": {
"disabledSkillIds": []
},
"yolo": {
"baseDir": "YOLO"
},
"debug": {
"logModelRequestContext": false
},
"chatOptions": {
"includeCurrentFileContent": true,
"mentionDisplayMode": "inline",
"mentionContextMode": "light",
"chatApplyMode": "review-required",
"chatTitlePrompt": "",
"chatMode": "chat",
"agentModeWarningConfirmed": false,
"reasoningLevelByModelId": {},
"historyArchiveEnabled": true,
"historyArchiveThreshold": 50,
"autoContextCompactionEnabled": false,
"autoContextCompactionThresholdMode": "tokens",
"autoContextCompactionThresholdTokens": 24000,
"autoContextCompactionThresholdRatio": 0.8,
"imageReadingEnabled": true,
"imageCompressionEnabled": true,
"imageCompressionQuality": 85,
"externalImageFetchEnabled": false
},
"notificationOptions": {
"enabled": false,
"channel": "sound",
"timing": "when-unfocused",
"notifyOnApprovalRequired": true,
"notifyOnTaskCompleted": true
},
"continuationOptions": {
"continuationModelId": "",
"enableSmartSpace": true,
"enableSelectionChat": true,
"persistSelectionHighlight": true,
"manualContextEnabled": false,
"manualContextFolders": [],
"referenceRuleFolders": [],
"knowledgeBaseFolders": [],
"stream": true,
"maxContinuationChars": 8000,
"enableTabCompletion": false,
"tabCompletionModelId": "",
"tabCompletionOptions": {
"idleTriggerEnabled": false,
"autoTriggerDelayMs": 3000,
"autoTriggerCooldownMs": 15000,
"triggerDelayMs": 3000,
"minContextLength": 20,
"contextRange": 4000,
"maxSuggestionLength": 2000,
"temperature": 0.5,
"requestTimeoutMs": 12000
},
"tabCompletionTriggers": [
{
"id": "sentence-end-comma",
"type": "string",
"pattern": ", ",
"enabled": true
},
{
"id": "sentence-end-chinese-comma",
"type": "string",
"pattern": ",",
"enabled": true
},
{
"id": "sentence-end-colon",
"type": "string",
"pattern": ": ",
"enabled": true
},
{
"id": "sentence-end-chinese-colon",
"type": "string",
"pattern": ":",
"enabled": true
},
{
"id": "newline",
"type": "regex",
"pattern": "\\n$",
"enabled": true
},
{
"id": "list-item",
"type": "regex",
"pattern": "(?:^|\\n)[-*+]\\s$",
"enabled": true
}
],
"tabCompletionSystemPrompt": "Your job is to predict the most logical text that should be written at the location of the <mask/>. Your answer can be either code, a single word, or multiple sentences. Your answer must be in the same language as the text that is already there.\n\nAdditional constraints:\n{{tab_completion_constraints}}\n\nOutput only the text that should appear at the <mask/>. Do not include explanations, labels, or formatting.",
"tabCompletionConstraints": "",
"tabCompletionLengthPreset": "medium",
"smartSpaceTriggerMode": "single-space",
"smartSpaceUseWebSearch": false,
"smartSpaceUseUrlContext": false,
"enableQuickAsk": true,
"quickAskTrigger": "@",
"quickAskMode": "chat",
"quickAskAutoDockToTopRight": true,
"quickAskContextBeforeChars": 5000,
"quickAskContextAfterChars": 2000,
"streamFallbackRecoveryEnabled": true,
"primaryRequestTimeoutMs": 60000
},
"assistants": [
{
"id": "__default_agent__",
"name": "Default",
"description": "Default editing agent for sidebar chat.",
"systemPrompt": "",
"modelId": "ollama/qwen2.5:7b",
"persona": "balanced",
"enableTools": true,
"includeBuiltinTools": true,
"enabledToolNames": [],
"toolPreferences": {},
"enabledSkills": [],
"skillPreferences": {},
"createdAt": 1778518156827,
"updatedAt": 1778518242609
}
],
"currentAssistantId": "__default_agent__",
"__meta": {
"updatedAt": 1778518302206,
"deviceId": "513eb0fd-60a0-459a-a9d8-bdfbdee0f714"
}
}
File diff suppressed because it is too large. Load diff
+11
View File
@@ -0,0 +1,11 @@
{
"id": "yolo",
"name": "YOLO",
"version": "1.5.7.5",
"minAppVersion": "1.8.0",
"description": "Agent-native AI assistant — chat, write, search, orchestrate, all in one.",
"author": "Lapix0x0",
"authorUrl": "https://github.com/Lapis0x0",
"fundingUrl": "https://afdian.com/a/lapis0x0",
"isDesktopOnly": false
}
@@ -0,0 +1,4 @@
{
"version": "pglite-runtime-0.4.4-r1",
"readyAt": 1778518291420
}
@@ -0,0 +1,29 @@
{
"runtimeVersion": "pglite-runtime-0.4.4-r1",
"files": [
{
"name": "pglite.data",
"size": 5289109,
"sha256": "4507d476e23421aab8201ee9d58059c53736db40e1bfe5d14bb86124e59a116d",
"url": "https://github.com/Lapis0x0/obsidian-yolo/releases/download/pglite-runtime-0.4.4-r1/pglite.data"
},
{
"name": "pglite.wasm",
"size": 8739902,
"sha256": "551cf9bcfb34e4b0ea118b8e658b5e3e85b20d620a6f365239ce02f32ffc20e9",
"url": "https://github.com/Lapis0x0/obsidian-yolo/releases/download/pglite-runtime-0.4.4-r1/pglite.wasm"
},
{
"name": "initdb.wasm",
"size": 169969,
"sha256": "13ed8475e33d092d03e2378d6b78d52da0c4d497b1df2c2a62d33fe32ceb67e2",
"url": "https://github.com/Lapis0x0/obsidian-yolo/releases/download/pglite-runtime-0.4.4-r1/initdb.wasm"
},
{
"name": "vector.tar.gz",
"size": 46052,
"sha256": "3d968eee93191a2a0073b8c18a773c8aa315f4d4b4734cf5ff5e1fe6d100485b",
"url": "https://github.com/Lapis0x0/obsidian-yolo/releases/download/pglite-runtime-0.4.4-r1/vector.tar.gz"
}
]
}
File diff suppressed because it is too large. Load diff
+262
View File
@@ -0,0 +1,262 @@
{
"main": {
"id": "57b8444dba9f22e6",
"type": "split",
"children": [
{
"id": "db826df6282b4fa4",
"type": "tabs",
"children": [
{
"id": "00c99d665bea087c",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Blessing Ideas.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Blessing Ideas"
}
},
{
"id": "0b676211187f3b77",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Mora.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Mora"
}
},
{
"id": "410cd755824f26ee",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "End.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "End"
}
},
{
"id": "27b7bbc01da3cac1",
"type": "leaf",
"state": {
"type": "markdown",
"state": {
"file": "Blessing Ideas.md",
"mode": "source",
"source": false
},
"icon": "lucide-file",
"title": "Blessing Ideas"
}
}
]
}
],
"direction": "vertical"
},
"left": {
"id": "f47f1d3ffdee43ee",
"type": "split",
"children": [
{
"id": "126cd60656d56cec",
"type": "tabs",
"children": [
{
"id": "55c3d4069420e861",
"type": "leaf",
"state": {
"type": "file-explorer",
"state": {
"sortOrder": "alphabetical",
"autoReveal": false
},
"icon": "lucide-folder-closed",
"title": "Files"
}
},
{
"id": "85504bd9566f86fc",
"type": "leaf",
"state": {
"type": "search",
"state": {
"query": "",
"matchingCase": false,
"explainSearch": false,
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical"
},
"icon": "lucide-search",
"title": "Search"
}
},
{
"id": "73090fff461d22fb",
"type": "leaf",
"state": {
"type": "bookmarks",
"state": {},
"icon": "lucide-bookmark",
"title": "Bookmarks"
}
}
]
}
],
"direction": "horizontal",
"width": 300
},
"right": {
"id": "43810faef7a93b26",
"type": "split",
"children": [
{
"id": "4ebf036f1e2e4112",
"type": "tabs",
"children": [
{
"id": "7c42c5355f223394",
"type": "leaf",
"state": {
"type": "backlink",
"state": {
"file": "Blessings.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
"showSearch": false,
"searchQuery": "",
"backlinkCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-coming-in",
"title": "Backlinks for Blessings"
}
},
{
"id": "1544e92d4b41a7e4",
"type": "leaf",
"state": {
"type": "outgoing-link",
"state": {
"file": "Blessings.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
},
"icon": "links-going-out",
"title": "Outgoing links from Blessings"
}
},
{
"id": "3e3c362bcf215bfa",
"type": "leaf",
"state": {
"type": "tag",
"state": {
"sortOrder": "frequency",
"useHierarchy": true,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-tags",
"title": "Tags"
}
},
{
"id": "36072a2d0e01b06d",
"type": "leaf",
"state": {
"type": "all-properties",
"state": {
"sortOrder": "frequency",
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-archive",
"title": "All properties"
}
},
{
"id": "5dca4108df73a383",
"type": "leaf",
"state": {
"type": "outline",
"state": {
"file": "Blessing Ideas.md",
"followCursor": false,
"showSearch": false,
"searchQuery": ""
},
"icon": "lucide-list",
"title": "Outline of Blessing Ideas"
}
},
{
"id": "cfa1d349e502f4df",
"type": "leaf",
"state": {
"type": "smtcmp-chat-view",
"state": {},
"icon": "wand-sparkles",
"title": "新对话"
}
}
],
"currentTab": 5
}
],
"direction": "horizontal",
"width": 470.5
},
"left-ribbon": {
"hiddenItems": {
"switcher:Open quick switcher": false,
"graph:Open graph view": false,
"canvas:Create new canvas": false,
"daily-notes:Open today's daily note": false,
"templates:Insert template": false,
"command-palette:Open command palette": false,
"bases:Create new base": false,
"obsidian42-brat:BRAT": false,
"agent-client:Open agent client": false,
"copilot:Open Copilot Chat": false,
"yolo:Open chat": false
}
},
"active": "cfa1d349e502f4df",
"lastOpenFiles": [
"YOLO",
"copilot/copilot-conversations/Final_Event_Alternatives@20260510_201609.md",
"Blessings.md",
"Conversation.md",
"End.md",
"Gameplay Mechanics.md",
"Mora.md",
"World.md",
"Blessing Ideas.md",
"Basics.md",
"Untitled.base",
"copilot/copilot-conversations/Conversation_Restructuring_Plan@20260510_201609.md",
"copilot/copilot-conversations/Error_in_File_Splitting_Request@20260510_192223.md",
"copilot/copilot-conversations",
"copilot/Copilot-Indexed-Files-10-05-2026.md",
"copilot",
"Welcome.md"
]
}