@rizom/brain 0.2.0-alpha.749 → 0.2.0-alpha.750
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brain.js +11 -11
- package/dist/chunks/app-7e5m9g6k.js +5 -0
- package/dist/chunks/{index-sw6zmn97.js → index-18gtvkxj.js} +2 -2
- package/dist/chunks/{index-dz05sh35.js → index-68ge01gj.js} +6 -6
- package/dist/chunks/{index-dz05sh35.js.map → index-68ge01gj.js.map} +6 -6
- package/dist/chunks/{index-k8mhqgy0.js → index-dv5k8aft.js} +3 -3
- package/dist/chunks/{index-k8mhqgy0.js.map → index-dv5k8aft.js.map} +1 -1
- package/dist/chunks/{index-tchhjqm2.js → index-g3c3c3y0.js} +2 -2
- package/dist/chunks/{index-key3y4em.js → index-ppg0xa7k.js} +2 -2
- package/dist/chunks/{index-qfgnh1b2.js → index-q6pcp7gc.js} +4 -4
- package/dist/chunks/{index-qfgnh1b2.js.map → index-q6pcp7gc.js.map} +4 -4
- package/dist/chunks/{package-zw8n5jm7.js → package-6203jv7y.js} +3 -3
- package/dist/chunks/{package-zw8n5jm7.js.map → package-6203jv7y.js.map} +1 -1
- package/dist/entities.js +1 -1
- package/dist/git-broker.js +1 -1
- package/dist/index.js +1 -1
- package/dist/interfaces.js +1 -1
- package/dist/model.js +6 -6
- package/dist/model.js.map +4 -4
- package/dist/services.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/ui/studio-chunks/main-5ndk80hz.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/app-32s4n60w.js +0 -5
- /package/dist/chunks/{app-32s4n60w.js.map → app-7e5m9g6k.js.map} +0 -0
- /package/dist/chunks/{index-sw6zmn97.js.map → index-18gtvkxj.js.map} +0 -0
- /package/dist/chunks/{index-tchhjqm2.js.map → index-g3c3c3y0.js.map} +0 -0
- /package/dist/chunks/{index-key3y4em.js.map → index-ppg0xa7k.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tx as t}from"./index-7ne5672k.js";var g={name:"@rizom/brain",version:"0.2.0-alpha.
|
|
2
|
+
import{Tx as t}from"./index-7ne5672k.js";var g={name:"@rizom/brain",version:"0.2.0-alpha.750",description:"Brain runtime + CLI \u2014 scaffold, run, and manage AI brain instances",keywords:["brain","ai","cli","mcp","agent","personal-ai","knowledge-management"],license:"AGPL-3.0-only",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{brain:"./dist/brain.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@clack/prompts":"^1.5.1","@modelcontextprotocol/client":"^2.3.1","@modelcontextprotocol/server":"^2.3.1","@tailwindcss/postcss":"^4.3.1","@tailwindcss/typography":"^0.5.20","@types/react":"^19.2.17",postcss:"^8.5.29",react:"^19.2.7","react-dom":"^19.2.7",tailwindcss:"^4.3.1",yaml:"^2.9.0",zod:"^4.2.0"},devDependencies:{"@brains/a2a":"workspace:*","@brains/action-board":"workspace:*","@brains/action-items":"workspace:*","@brains/admin":"workspace:*","@brains/agent-discovery":"workspace:*","@brains/ai-evaluation":"workspace:*","@brains/ai-service":"workspace:*","@brains/analytics":"workspace:*","@brains/app":"workspace:*","@brains/ask-content":"workspace:*","@brains/assessment":"workspace:*","@brains/atproto":"workspace:*","@brains/atproto-registry":"workspace:*","@brains/auth-service":"workspace:*","@brains/blog":"workspace:*","@brains/book":"workspace:*","@brains/build-tools":"workspace:*","@brains/chat":"workspace:*","@brains/conflict":"workspace:*","@brains/contact":"workspace:*","@brains/content-formatters":"workspace:*","@brains/content-pipeline":"workspace:*","@brains/contracts":"workspace:*","@brains/conversation-memory":"workspace:*","@brains/core":"workspace:*","@brains/dashboard":"workspace:*","@brains/decks":"workspace:*","@brains/deploy-support":"workspace:*","@brains/directory-sync":"workspace:*","@brains/doc":"workspace:*","@brains/document":"workspace:*","@brains/document-plugin":"workspace:*","@brains/email":"workspace:*","@brains/email-workflows":"workspace:*","@brains/entity-service":"workspace:*","@brains/eslint-config":"workspace:*","@brains/faq":"workspace:*","@brains/form":"workspace:*","@brains/forms":"workspace:*","@brains/guide":"workspace:*","@brains/http-host":"workspace:*","@brains/image":"workspace:*","@brains/image-plugin":"workspace:*","@brains/knowledge-map":"workspace:*","@brains/link":"workspace:*","@brains/linkedin-import":"workspace:*","@brains/mcp":"workspace:*","@brains/mcp-service":"workspace:*","@brains/newsletter":"workspace:*","@brains/note":"workspace:*","@brains/notifications":"workspace:*","@brains/oauth-broker":"workspace:*","@brains/obsidian-vault":"workspace:*","@brains/onboarding":"workspace:*","@brains/operation-context":"workspace:*","@brains/playbooks":"workspace:*","@brains/plugins":"workspace:*","@brains/portfolio":"workspace:*","@brains/profile":"workspace:*","@brains/prompt":"workspace:*","@brains/quiz":"workspace:*","@brains/refined-note":"workspace:*","@brains/sdk":"workspace:*","@brains/series":"workspace:*","@brains/site-builder-plugin":"workspace:*","@brains/site-composition":"workspace:*","@brains/site-content":"workspace:*","@brains/site-default":"workspace:*","@brains/site-info":"workspace:*","@brains/site-organization":"workspace:*","@brains/site-personal":"workspace:*","@brains/site-professional":"workspace:*","@brains/social-media":"workspace:*","@brains/stock-photo":"workspace:*","@brains/studio":"workspace:*","@brains/style-guide":"workspace:*","@brains/templates":"workspace:*","@brains/test-utils":"workspace:*","@brains/theme-rizom":"workspace:*","@brains/topics":"workspace:*","@brains/typescript-config":"workspace:*","@brains/unified-inbox":"workspace:*","@brains/utils":"workspace:*","@brains/web-chat":"workspace:*","@brains/webdav":"workspace:*","@brains/wishlist":"workspace:*","@libsql/client":"^0.17.4","@manypkg/get-packages":"^3.1.0","@rizom/theme-default":"workspace:*","@types/bun":"^1.4.0","@types/react-dom":"^19.0.3",rolldown:"^1.0.0","rolldown-plugin-dts":"^0.27.4",typescript:"^7.0.2"},engines:{bun:">=1.4.0"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./chat":{types:"./dist/chat.d.ts",import:"./dist/chat.js"},"./cli":"./dist/brain.js","./model":{types:"./dist/model.d.ts",import:"./dist/model.js"},"./entities":{types:"./dist/entities.d.ts",import:"./dist/entities.js"},"./services":{types:"./dist/services.d.ts",import:"./dist/services.js"},"./interfaces":{types:"./dist/interfaces.d.ts",import:"./dist/interfaces.js"},"./testing":{types:"./dist/testing.d.ts",import:"./dist/testing.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js"},"./tsconfig.instance.json":"./tsconfig.instance.json"},files:["dist","templates","tsconfig.instance.json"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brain-cli#readme",optionalDependencies:{"@bitwarden/sdk-napi":"^1.0.0","@libsql/client":"^0.17.4","@tailwindcss/oxide":"^4.1.4",lightningcss:"^1.29.2","react-devtools-core":"^7.0.1"},publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brain-cli"},scripts:{build:"bun scripts/build.ts","build:ui":"turbo run build --filter=@brains/web-chat --filter=@brains/studio",eval:"bun run build && brain-eval","eval:headless":"bun run eval --suite headless","eval:personal":"bun run eval --suite personal","eval:professional":"bun run eval --suite professional","eval:team":"bun run eval --suite team","eval:git":"bun run eval --suite professional --tags requires-supervised-git --mcp-basic --url http://localhost:8080 --token $MCP_AUTH_TOKEN",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts","start:minimal":"sh scripts/start-test-app.sh minimal","start:unified-inbox":"sh scripts/start-test-app.sh unified-inbox","start:personal":"sh scripts/start-test-app.sh personal","start:publishing":"sh scripts/start-test-app.sh publishing","start:team":"sh scripts/start-test-app.sh team",test:"bun test --parallel=4 --path-ignore-patterns='**/{boot-smoke,served-surface,canonical-eval-suites,public-plugin-api,public-authoring-golden,public-authoring-docs,public-chat-contract,package-metadata}.test.ts'","test:boot-smoke":"bun run build && bun run test:boot-smoke:prebuilt","test:boot-smoke:prebuilt":"bun test test/boot-smoke.test.ts test/served-surface.test.ts","test:evals":"bun test test/canonical-eval-suites.test.ts","test:surface":"bun test test/public-plugin-api.test.ts test/public-authoring-golden.test.ts test/public-authoring-docs.test.ts test/public-chat-contract.test.ts test/package-metadata.test.ts && bun run test:boot-smoke:prebuilt","test:packed:compat":"bun scripts/run-packed-compatibility.ts",typecheck:"tsc --noEmit && tsc --noEmit -p tsconfig.model.json"},type:"module"};import{existsSync as d,readFileSync as b}from"fs";import{dirname as u,join as a}from"path";var k=t.looseObject({name:t.string().min(1),version:t.string().min(1),dependencies:t.record(t.string(),t.string()).optional(),peerDependencies:t.record(t.string(),t.string()).optional()});class r extends Error{constructor(e,s,i){super(i?`Package "${e.name}@${e.version}" requires @rizom/brain "${i}", but "${s}" is installed; install a compatible Brain version or update the peer range only after testing that release`:`Package "${e.name}@${e.version}" must declare a @rizom/brain peer dependency; add the tested range under peerDependencies in its package.json`);this.name="PackagePeerCompatibilityError"}}function o(e){let s=u(e);return s===e?[e]:[e,...o(s)]}function m(e,s){return Object.freeze({name:e.name,version:e.version,dependencies:Object.freeze({...e.dependencies??{}}),peerDependencies:Object.freeze({...e.peerDependencies??{}}),directory:s})}function v(e){let s=o(e).find((p)=>d(a(p,"package.json")));if(s===void 0)throw Error(`No package.json at or above "${e}"; run from the package's own directory`);let i=a(s,"package.json"),c=JSON.parse(b(i,"utf8")),n=k.safeParse(c);if(!n.success)throw Error(`"${i}" must declare non-empty name and version fields`);return m(n.data,s)}function j(e,s){let i=e.peerDependencies["@rizom/brain"];if(!i||!Bun.semver.satisfies(s,i))throw new r(e,s,i)}
|
|
3
3
|
export{v as M,j as N,g as O};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
6
|
-
//# sourceMappingURL=index-
|
|
5
|
+
//# debugId=C787F2C37D59403F64756E2164756E21
|
|
6
|
+
//# sourceMappingURL=index-dv5k8aft.js.map
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { z } from \"@brains/utils/zod\";\n\nconst packageManifestSchema = z.looseObject({\n name: z.string().min(1),\n version: z.string().min(1),\n dependencies: z.record(z.string(), z.string()).optional(),\n peerDependencies: z.record(z.string(), z.string()).optional(),\n});\n\nexport interface InstalledPackageManifest {\n readonly name: string;\n readonly version: string;\n readonly dependencies: Readonly<Record<string, string>>;\n readonly peerDependencies: Readonly<Record<string, string>>;\n readonly directory: string;\n}\n\nexport class PackagePeerCompatibilityError extends Error {\n constructor(\n packageMetadata: InstalledPackageManifest,\n brainVersion: string,\n peerRange: string | undefined,\n ) {\n super(\n peerRange\n ? `Package \"${packageMetadata.name}@${packageMetadata.version}\" requires @rizom/brain \"${peerRange}\", but \"${brainVersion}\" is installed; install a compatible Brain version or update the peer range only after testing that release`\n : `Package \"${packageMetadata.name}@${packageMetadata.version}\" must declare a @rizom/brain peer dependency; add the tested range under peerDependencies in its package.json`,\n );\n this.name = \"PackagePeerCompatibilityError\";\n }\n}\n\nfunction matchesPackageRef(packageRef: string, packageName: string): boolean {\n return packageRef === packageName || packageRef.startsWith(`${packageName}/`);\n}\n\nfunction ancestorDirectories(directory: string): string[] {\n const parent = dirname(directory);\n return parent === directory\n ? [directory]\n : [directory, ...ancestorDirectories(parent)];\n}\n\nfunction installedManifest(\n manifest: z.output<typeof packageManifestSchema>,\n directory: string,\n): InstalledPackageManifest {\n return Object.freeze({\n name: manifest.name,\n version: manifest.version,\n dependencies: Object.freeze({ ...(manifest.dependencies ?? {}) }),\n peerDependencies: Object.freeze({ ...(manifest.peerDependencies ?? {}) }),\n directory,\n });\n}\n\n/**\n * The package a directory belongs to: the nearest `package.json` at or above\n * it, the way an installed module's package is found.\n */\nexport function findPackageManifest(\n fromDirectory: string,\n): InstalledPackageManifest {\n const directory = ancestorDirectories(fromDirectory).find((candidate) =>\n existsSync(join(candidate, \"package.json\")),\n );\n if (directory === undefined) {\n throw new Error(\n `No package.json at or above \"${fromDirectory}\"; run from the package's own directory`,\n );\n }\n const manifestPath = join(directory, \"package.json\");\n const rawManifest: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const parsed = packageManifestSchema.safeParse(rawManifest);\n if (!parsed.success) {\n throw new Error(\n `\"${manifestPath}\" must declare non-empty name and version fields`,\n );\n }\n return installedManifest(parsed.data, directory);\n}\n\nexport function resolveInstalledPackageManifest(\n packageRef: string,\n fromDirectory: string,\n): InstalledPackageManifest {\n let resolved: string;\n try {\n resolved = Bun.resolveSync(packageRef, fromDirectory);\n } catch (error) {\n throw new Error(\n `Could not resolve installed package \"${packageRef}\" from \"${fromDirectory}\"; install it in the Brain application or correct the package reference`,\n { cause: error },\n );\n }\n\n for (const directory of ancestorDirectories(dirname(resolved))) {\n const manifestPath = join(directory, \"package.json\");\n if (!existsSync(manifestPath)) continue;\n\n const rawManifest: unknown = JSON.parse(readFileSync(manifestPath, \"utf8\"));\n const parsed = packageManifestSchema.safeParse(rawManifest);\n if (parsed.success && matchesPackageRef(packageRef, parsed.data.name)) {\n return installedManifest(parsed.data, directory);\n }\n }\n\n throw new Error(\n `Resolved package \"${packageRef}\" from \"${fromDirectory}\" but could not find valid package metadata; ensure its package.json declares matching non-empty name and version fields`,\n );\n}\n\n/** A package runs only on a Brain its `@rizom/brain` peer range admits. */\nexport function assertBrainPeerCompatibility(\n packageMetadata: InstalledPackageManifest,\n brainVersion: string,\n): void {\n const peerRange = packageMetadata.peerDependencies[\"@rizom/brain\"];\n if (!peerRange || !Bun.semver.satisfies(brainVersion, peerRange)) {\n throw new PackagePeerCompatibilityError(\n packageMetadata,\n brainVersion,\n peerRange,\n );\n }\n}\n\nexport function resolveBrainDefinitionDependencies(\n brainPackageRef: string,\n fromDirectory: string,\n): InstalledPackageManifest[] {\n const brain = resolveInstalledPackageManifest(brainPackageRef, fromDirectory);\n if (brain.name === \"@rizom/brain\") return [];\n\n const runtime = resolveInstalledPackageManifest(\n \"@rizom/brain\",\n fromDirectory,\n );\n assertBrainPeerCompatibility(brain, runtime.version);\n\n const definitionDependencies = Object.keys(brain.dependencies)\n .map((dependency) =>\n resolveInstalledPackageManifest(dependency, brain.directory),\n )\n .filter(\n (dependency) => dependency.peerDependencies[\"@rizom/brain\"] !== undefined,\n );\n for (const dependency of definitionDependencies) {\n assertBrainPeerCompatibility(dependency, runtime.version);\n }\n return definitionDependencies;\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";olNAAA,qBAAS,kBAAY,WACrB,kBAAS,UAAS,aAGlB,IAAM,EAAwB,EAAE,YAAY,CAC1C,KAAM,EAAE,OAAO,EAAE,IAAI,CAAC,EACtB,QAAS,EAAE,OAAO,EAAE,IAAI,CAAC,EACzB,aAAc,EAAE,OAAO,EAAE,OAAO,EAAG,EAAE,OAAO,CAAC,EAAE,SAAS,EACxD,iBAAkB,EAAE,OAAO,EAAE,OAAO,EAAG,EAAE,OAAO,CAAC,EAAE,SAAS,CAC9D,CAAC,EAUM,MAAM,UAAsC,KAAM,CACvD,WAAW,CACT,EACA,EACA,EACA,CACA,MACE,EACI,YAAY,EAAgB,QAAQ,EAAgB,mCAAmC,YAAoB,+GAC3G,YAAY,EAAgB,QAAQ,EAAgB,uHAC1D,EACA,KAAK,KAAO,gCAEhB,CAMA,SAAS,CAAmB,CAAC,EAA6B,CACxD,IAAM,EAAS,EAAQ,CAAS,EAChC,OAAO,IAAW,EACd,CAAC,CAAS,EACV,CAAC,EAAW,GAAG,EAAoB,CAAM,CAAC,EAGhD,SAAS,CAAiB,CACxB,EACA,EAC0B,CAC1B,OAAO,OAAO,OAAO,CACnB,KAAM,EAAS,KACf,QAAS,EAAS,QAClB,aAAc,OAAO,OAAO,IAAM,EAAS,cAAgB,CAAC,CAAG,CAAC,EAChE,iBAAkB,OAAO,OAAO,IAAM,EAAS,kBAAoB,CAAC,CAAG,CAAC,EACxE,WACF,CAAC,EAOI,SAAS,CAAmB,CACjC,EAC0B,CAC1B,IAAM,EAAY,EAAoB,CAAa,EAAE,KAAK,CAAC,IACzD,EAAW,EAAK,EAAW,cAAc,CAAC,CAC5C,EACA,GAAI,IAAc,OAChB,MAAU,MACR,gCAAgC,0CAClC,EAEF,IAAM,EAAe,EAAK,EAAW,cAAc,EAC7C,EAAuB,KAAK,MAAM,EAAa,EAAc,MAAM,CAAC,EACpE,EAAS,EAAsB,UAAU,CAAW,EAC1D,GAAI,CAAC,EAAO,QACV,MAAU,MACR,IAAI,mDACN,EAEF,OAAO,EAAkB,EAAO,KAAM,CAAS,EAkC1C,SAAS,CAA4B,CAC1C,EACA,EACM,CACN,IAAM,EAAY,EAAgB,iBAAiB,gBACnD,GAAI,CAAC,GAAa,CAAC,IAAI,OAAO,UAAU,EAAc,CAAS,EAC7D,MAAM,IAAI,EACR,EACA,EACA,CACF",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "C787F2C37D59403F64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Sg as n}from"./index-
|
|
2
|
+
import{Sg as n}from"./index-q6pcp7gc.js";function t(i,e={}){if(!n(i))throw Error("use() expects a package definition returned by a @rizom/brain define helper");return Object.freeze({kind:"rizom-configured-plugin",definition:i,config:Object.freeze({...e})})}function f(i){if(i===null||typeof i!=="object")return!1;return Reflect.get(i,"kind")==="rizom-configured-plugin"&&n(Reflect.get(i,"definition"))&&typeof Reflect.get(i,"config")==="object"}
|
|
3
3
|
export{t as Sa,f as Ta};
|
|
4
4
|
|
|
5
5
|
//# debugId=9B3DF62A233E8A1264756E2164756E21
|
|
6
|
-
//# sourceMappingURL=index-
|
|
6
|
+
//# sourceMappingURL=index-g3c3c3y0.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as j,b as T}from"./index-ckdf9ghv.js";import{d as g,e as m}from"./index-pjejyeqk.js";import"./index-e84v85w3.js";import{L as Z}from"./index-4mffgwx9.js";import"./index-x8e40qwv.js";import"./index-wpzfnffx.js";import{Bj as E,Nh as N,Oh as F,Si as H,Th as I,Uh as P,Vh as R,Wh as L,Xh as B,cj as w,dj as M,gj as D,nj as O}from"./index-
|
|
2
|
+
import{a as j,b as T}from"./index-ckdf9ghv.js";import{d as g,e as m}from"./index-pjejyeqk.js";import"./index-e84v85w3.js";import{L as Z}from"./index-4mffgwx9.js";import"./index-x8e40qwv.js";import"./index-wpzfnffx.js";import{Bj as E,Nh as N,Oh as F,Si as H,Th as I,Uh as P,Vh as R,Wh as L,Xh as B,cj as w,dj as M,gj as D,nj as O}from"./index-q6pcp7gc.js";import{jm as A,nl as S}from"./index-9881eck9.js";import"./index-nwdvz1vw.js";import"./index-6gqg29bj.js";import{Tx as v}from"./index-7ne5672k.js";import"./index-amf6s7a5.js";import{ay as b}from"./index-p39p7p8h.js";var x=v.object({theme:v.object({primaryColor:v.string().describe("Primary color for the CLI theme").default("#0066cc"),accentColor:v.string().describe("Accent color for the CLI theme").default("#ff6600")}).describe("Theme configuration for the CLI interface").default({primaryColor:"#0066cc",accentColor:"#ff6600"})});var V={completed:"\u2713",declined:"\u25CB",failed:"\u2717"},q={deniedCardIds:void 0,resolveUrl:(r)=>r,isHiddenUrl:()=>!1,eventActionUnavailableLabel:void 0},y="cli",k={identity:{kind:"external",externalActorId:S("cli","operator")},interfaceType:"cli",role:"user"};function _(){return{inkApp:null,removeSignalHandlers:void 0,responseCallback:void 0,systemMessageCallback:void 0}}function z(r,e){let{logger:t}=r,o=new D({loadMessages:async(i)=>r.conversations.getMessages(i,{limit:50}),onRestoreError:(i,s)=>{t.debug("Failed to restore pending CLI approvals",{error:i,conversationId:s})}}),n=(i)=>{e.responseCallback?.(i)},a=()=>r.permissions.isAnchor("cli","local"),u=async(i,s)=>{let l=new Set(s);if(!M(i,l))return!1;let c=w({message:Y(i,s),approvalIds:l});if(c.kind==="not-confirmation")return!1;if(c.kind==="notice")return n(`_${c.message}_`),!0;o.removeApproval(y,c.approvalId);let C=await r.agent.confirmPendingAction(y,c.confirmed,c.approvalId,{userPermissionLevel:"admin",isAnchor:a(),interfaceType:"cli",actor:k});return o.syncFromResponse(y,C,c.approvalId),n(K(C.text,C.cards)),!0};return{async processInput(i){r.messages.startProcessingInput();try{let s=[...await o.getApprovalIds(y)];if(s.length>0){if(await u(i,s))return}let l=await r.agent.chat(i,y,{userPermissionLevel:"admin",isAnchor:a(),interfaceType:"cli",channelId:"cli",channelName:"CLI Terminal",actor:k}),c=P(l.cards),C=c.length>0?c.map((p)=>p.id):l.pendingConfirmations?.map((p)=>p.id)??[];o.replaceApprovals(y,C);let h=G(l);t.debug("Agent response received",{textLength:l.text.length,toolResultsCount:l.toolResults?.length??0,toolResults:l.toolResults?.map((p)=>({toolName:p.toolName,hasData:p.data!==void 0}))}),n(h)}catch(s){t.error("Error processing input",{error:s,input:i});let l=A(s,"An unknown error occurred");n(`**Error:** ${l}`)}finally{r.messages.endProcessingInput()}}}}function G(r){let e=O(r,{deniedCardIds:void 0}),t=[],o=[],n="";for(let a of e.directives)switch(a.kind){case"text":n=a.text;break;case"approvals":t.push(...a.cards);break;default:if(a.card.kind==="tool-approval"&&a.card.state==="approval-requested"){t.push(a.card);break}o.push(E(a.card,q))}return[J(n,t),...o].filter((a)=>a.trim().length>0).join(`
|
|
3
3
|
|
|
4
4
|
`)}function J(r,e){if(e.length===0)return r;let t=L(r,e);if(e.length===1){let n=e[0];if(!n)return r;let a=n.preview?`
|
|
5
5
|
|
|
@@ -16,4 +16,4 @@ _Please reply with **yes 1** / **no 1** for the matching action._`}function K(r,
|
|
|
16
16
|
${o.error}`:`${n} ${o.summary}`}function Y(r,e){let t=/^(.*?)\s+#?(\d+)$/.exec(r.trim());if(!t?.[1]||!t[2])return r;let o=e[Number(t[2])-1];return o?`${t[1]} ${o}`:r}var Q=H({id:"cli",config:x,setup:(r)=>(I(r).logger.debug("CLI interface registered with AgentService"),_())}),W=N(Q,(r)=>{let{state:e}=r,t=I(r),{logger:o,messages:n}=t,a=z(t,e),u=()=>{e.responseCallback=void 0,e.systemMessageCallback=void 0},i=()=>{if(n.unregisterProgressCallback(),u(),e.removeSignalHandlers?.(),e.removeSignalHandlers=void 0,e.inkApp)e.inkApp.unmount(),e.inkApp=null};return{id:"cli",start:async()=>{o.debug("Starting CLI interface");try{let[s,l,c]=await Promise.all([import("./index-9s1yc539.js"),import("react"),import("./EnhancedApp-85bb86z6.js")]),h=l.default.createElement(c.default,{interface:a,registerProgressCallback:(p)=>{n.registerProgressCallback(p)},unregisterProgressCallback:()=>{n.unregisterProgressCallback()},registerResponseCallback:(p)=>{e.responseCallback=p},registerSystemMessageCallback:(p)=>{e.systemMessageCallback=p},unregisterMessageCallbacks:u});e.inkApp=s.render(h),e.removeSignalHandlers=Z(["SIGINT","SIGTERM"],()=>{o.debug("Received termination signal, stopping CLI"),i()})}catch(s){throw o.error("Failed to start CLI interface",{error:s}),s}},stop:async()=>{o.debug("Stopping CLI interface"),i()},healthCheck:async()=>{let s=e.inkApp!==null;return{status:s?"healthy":"error",message:s?"CLI interface is running":"CLI interface not running",lastCheck:new Date,details:{hasInkApp:e.inkApp!==null,hasCallbacks:n.hasProgressCallback()}}}}}),X=F(W,({state:r})=>({send:({message:e})=>{let t=typeof e==="string"?e:e.fallbackText??"";if(!t)return;(r.systemMessageCallback??r.responseCallback)?.(t)}})),ee=X;import{jsx as d,jsxs as f}from"react/jsx-runtime";function re({batchStatus:r,showDetails:e=!0}){let{batchId:t,totalOperations:o,completedOperations:n,failedOperations:a,currentOperation:u,errors:i,status:s}=r,l=s==="processing",c=s==="completed",C=s==="failed",h=n-a;return f(g,{flexDirection:"column",marginY:1,children:[d(g,{marginBottom:1,children:f(m,{bold:!0,color:"cyan",children:["Batch Operation: ",t.slice(0,8),"..."]})}),d(g,{marginBottom:1,children:d(T,{current:n,total:o,message:"Overall Progress:",color:C?"red":c?"green":"yellow"})}),l&&u&&f(g,{marginBottom:1,children:[d(m,{color:"green",children:d(j,{type:"dots"})}),f(m,{color:"gray",children:[" ",u]})]}),e&&f(g,{flexDirection:"column",marginLeft:2,children:[h>0&&f(g,{children:[d(m,{color:"green",children:"\u2713 "}),f(m,{color:"gray",children:[h," successful"]})]}),a>0&&f(g,{children:[d(m,{color:"red",children:"\u2717 "}),f(m,{color:"gray",children:[a," failed"]})]}),i.length>0&&f(g,{flexDirection:"column",marginTop:1,children:[d(m,{color:"red",bold:!0,children:"Errors:"}),i.slice(0,3).map((p,U)=>f(g,{marginLeft:2,children:[d(m,{color:"red",children:"\u2022 "}),d(m,{color:"gray",children:p})]},U)),i.length>3&&d(g,{marginLeft:2,children:f(m,{color:"gray",children:["... and ",i.length-3," more"]})})]})]}),c&&d(g,{marginTop:1,children:d(m,{color:"green",bold:!0,children:"\u2713 Batch completed successfully"})}),C&&d(g,{marginTop:1,children:d(m,{color:"red",bold:!0,children:"\u2717 Batch failed"})})]})}export{re as BatchProgress,T as ProgressBar,x as cliConfigSchema,ee as default};
|
|
17
17
|
|
|
18
18
|
//# debugId=C81A70DDFACF001064756E2164756E21
|
|
19
|
-
//# sourceMappingURL=index-
|
|
19
|
+
//# sourceMappingURL=index-ppg0xa7k.js.map
|
|
@@ -325,7 +325,7 @@ ${e.map((n)=>`- ${[n.entityType!==void 0?`entityType: ${n.entityType}`:void 0,`e
|
|
|
325
325
|
|
|
326
326
|
The user cancelled this ${r.data.toolName} proposal: ${c}`]}).join("")}function pPe(e){let t=oc(e),n=mPe(t?.agentContactCandidates);return _K(n)}function mPe(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{let n=kP.safeParse(t);return n.success?[n.data]:[]})}function fPe(e){if(!Array.isArray(e))return[];return e.flatMap((t)=>{let n=AK.safeParse(t);return n.success?[n.data]:[]})}function oc(e){if(yn(e))return e;if(typeof e!=="string")return null;try{let t=JSON.parse(e);return yn(t)?t:null}catch{return null}}var jK={public:0,trusted:1,admin:2};function AP(e,t){if(t==="admin")return e;return e.filter((n)=>{let o=oc(n.metadata)?.userPermissionLevel;if(o!=="public"&&o!=="trusted"&&o!=="admin")return!1;return jK[o]<=jK[t]})}function PP(e,t){return[...sPe(e),{role:"user",content:t}]}var gPe=i.looseObject({uploadId:i.string(),entityType:i.string(),entityId:i.string()}),hPe=i.looseObject({kind:i.literal("tool-approval"),toolName:i.literal("system_create"),state:i.literal("output-available"),output:i.looseObject({success:i.literal(!0),data:i.looseObject({items:i.array(i.unknown()).optional()})})});function yPe(e){let t=new Map;for(let n of e){let r=oc(n.metadata)?.cards;if(!Array.isArray(r))continue;for(let o of r){let a=hPe.safeParse(o);if(!a.success)continue;let{data:s}=a.data.output;for(let c of[s,...s.items??[]]){let l=gPe.safeParse(c);if(!l.success)continue;t.set(`upload:${l.data.uploadId}`,{entityType:l.data.entityType,entityId:l.data.entityId})}}}return t}function NK(e){return`${e.source.kind}:${e.source.id}`}function $K(e){if(e.source===void 0)return null;return{filename:e.filename,mediaType:e.mediaType,source:e.source}}function bPe(e){if(!yn(e))return null;let t=e.source;if(!yn(t))return null;let{kind:n,id:r}=t,o=e.filename,a=e.mediaType;if(typeof n!=="string"||typeof r!=="string"||typeof o!=="string"||typeof a!=="string")return null;return{filename:o,mediaType:a,source:{kind:n,id:r}}}function _P(e){return e!==null}function SPe(e){let t=e.flatMap((n)=>{let o=oc(n.metadata)?.attachments;if(!Array.isArray(o))return[];return o.map(bPe).filter(_P)});return OP(t)}var vPe=6;function BK(e){let t=yPe(e.historyMessages),n=wPe({message:e.message,currentAttachments:e.currentAttachments,historyMessages:e.historyMessages}).map((a)=>{let s=t.get(NK(a));return s?{...a,savedAs:s}:a}),r=n.length>0?RPe(e.historyMessages):void 0,o=r!==void 0&&LK.test(e.message)&&e.currentAttachments.length===0&&e.historyMessages.filter((a)=>a.role==="assistant").at(-1)?.id===r.messageId&&!EPe(e.message,n);return{kind:"selected",message:e.message,refs:o?[]:n,attachments:e.currentAttachments,...r?{priorResponseRef:r}:{}}}function wPe(e){let t=e.currentAttachments.map($K).filter(_P),n=SPe(e.historyMessages).slice(-vPe).reverse(),r=OP([...t,...n]),o=xPe(e.message);if(o===void 0)return r;return r.filter((a)=>TPe(a,o)).slice(0,1)}function xPe(e){let t=e.toLowerCase();if(t.includes("uploaded image"))return"image";if(t.includes("uploaded pdf"))return"pdf";return}function TPe(e,t){if(t==="image")return e.mediaType.startsWith("image/");return e.mediaType==="application/pdf"}function OP(e){let t=new Set,n=[];for(let r of e){let o=NK(r);if(t.has(o))continue;t.add(o),n.push(r)}return n}var LK=/\b(?:save|keep|store)\b/i,CPe=/\bnotes?\b/i,IPe=/\b(?:upload(?:s|ed)?|files?|attachments?|pdfs?|images?|photos?|pictures?|documents?)\b/i;function EPe(e,t){let n=e.toLowerCase();return IPe.test(e)||t.some((r)=>n.includes(r.filename.toLowerCase()))}function RPe(e){for(let t=e.length-1;t>=0;t-=1){let n=e[t];if(n?.role!=="assistant")continue;if(n.content.trim().length===0)continue;if(kPe(n))continue;if(APe(n))continue;return{messageId:n.id}}return}function kPe(e){let t=oc(e.metadata);return Array.isArray(t?.entityMemoryRefs)}function APe(e){let n=oc(e.metadata)?.cards;if(!Array.isArray(n))return!1;return n.some((r)=>yn(r)&&r.kind==="actions")}function qK(e,t,n={}){let r=t??[],o=r.filter((c)=>c.kind==="text").map(_Pe),a=[e,PPe(e),...o,MPe(e,r,n.uploadRefs??[],n.priorResponseRef)].map((c)=>c.trim()).filter((c)=>c.length>0).join(`
|
|
327
327
|
|
|
328
|
-
`),s=r.filter((c)=>c.kind==="file");if(s.length===0)return a;return[...a.length>0?[{type:"text",text:a}]:[],...s.map((c)=>({type:"file",data:c.data,mediaType:c.mediaType,filename:c.filename}))]}function PPe(e){let t=e.split(/\r?\n/).map((s)=>s.trim()),n=(s)=>t.indexOf(s)===t.lastIndexOf(s),r=t.findIndex((s,c)=>/^BEGIN\s+\S/.test(s)&&n(s)&&t.indexOf(`END${s.slice(5)}`)>c&&n(`END${s.slice(5)}`)),o=t[r];if(o===void 0)return"";let a=`END${o.slice(5)}`;return`Available source for the text between the lines ${JSON.stringify(o)} and ${JSON.stringify(a)} of this message, read from the message instead of copied, as system_create source or system_update operation.source: { kind: "user-message", boundaryMode: "lines", startAfter: ${JSON.stringify(o)}, endBefore: ${JSON.stringify(a)} }`}function _Pe(e){return GS("a file",e.filename,e.content)}function zK(e,t,n){let r=t.flatMap((o)=>o.source?[`{ id: "${o.source.id}", transform: "${n(o)}" }`]:[]);return`Available system_create candidate for keeping every file attached to this message${e} (call without confirmed to request confirmation): { entityType: "note", source: { kind: "uploads", items: [${r.join(", ")}] } }`}function OPe(e){let t=e.filter((r)=>r.source);if(t.length<2)return[];let n=t.some(Cf);return[zK(n?", each as itself, text files as notes and PDFs as documents":", each as itself and text files as notes",t,(r)=>r.kind==="text"?"extract-markdown":"preserve"),...n?[zK(" as notes, each PDF's text extracted into its note, when the user asks for notes",t,(r)=>r.kind==="text"||Cf(r)?"extract-markdown":"preserve")]:[],"To keep them as another type, such as posts, use this call with that entityType; what the user states about one file, such as its publication date, goes in that file's item fields."]}function MPe(e,t,n,r){let o=t.map($K).filter(_P),a=OP([...n,...o]),s=a.map(jPe),c=r?["Available system_create candidate for saving the prior assistant response (call without confirmed to request confirmation):",`{ entityType: "note", source: { kind: "prior-response", messageId: "${r.messageId}" } }`].join(" "):"";if(s.length===0)return c;let l='Available upload refs from this conversation. Refs are ordered newest-first. Treat this as structured candidate data; resolve any user reference to a specific upload in typed tool arguments, or ask a clarification if the candidates are insufficient. For phrases like "the uploaded image" or "the uploaded PDF" without a filename, use the newest ref matching that media type; do not ask for clarification just because older uploads exist. Describe, summarize, analyze, or discuss uploads directly from the file bytes as read-only chat responses; do not call system_create unless the user explicitly asks to save, import, preserve, or create an entity. In read-only upload summaries, answer the request directly and do not offer to save/import/create unless asked. A reply of only a word or a name, after you asked what to do with an upload, is no request to save, create or change anything: ask what the user wants done with the upload. Upload candidates are file bytes; previous assistant answers are saved separately. If the user says "save it" after your summary/answer about an upload, save the prior assistant response as a note with source.kind "prior-response" unless they explicitly ask to save the uploaded file/document itself. Use system_create source.kind upload with its upload id as source.id and transform "preserve" for preserving raw file bytes as a document/image, or transform "extract-markdown" for extracting/importing upload text as a note. To keep several uploads at once, call system_create once with source.kind uploads listing every attached file. These upload transforms preserve the source wording: extract-markdown does not apply edits, summaries, translations, or restructuring. When the user asks to create a new note with such changes to an upload, use system_generate with operation.kind "prompt" instead of importing the original. Request only generation confirmation for that note; do not also call system_create to import the source as a second action. Include the readable source content and all requested changes in operation.prompt; the generation job does not receive this conversation or its attachments. An upload ref or filename alone is not source content, and is not a durable entity ref for prompt-from-source. Once a note has been created, use system_get to read its current content when asked to show it; do not substitute the original upload or reconstruct the note from chat.',u=OPe(t),d=r===void 0&&u.length===0&&(LK.test(e)||CPe.test(e))?DPe(a[0]):"";return[l,c,d,...u,...s].filter((p)=>p.length>0).join(`
|
|
328
|
+
`),s=r.filter((c)=>c.kind==="file");if(s.length===0)return a;return[...a.length>0?[{type:"text",text:a}]:[],...s.map((c)=>({type:"file",data:c.data,mediaType:c.mediaType,filename:c.filename}))]}function PPe(e){let t=e.split(/\r?\n/).map((s)=>s.trim()),n=(s)=>t.indexOf(s)===t.lastIndexOf(s),r=t.findIndex((s,c)=>/^BEGIN\s+\S/.test(s)&&n(s)&&t.indexOf(`END${s.slice(5)}`)>c&&n(`END${s.slice(5)}`)),o=t[r];if(o===void 0)return"";let a=`END${o.slice(5)}`;return`Available source for the text between the lines ${JSON.stringify(o)} and ${JSON.stringify(a)} of this message, read from the message instead of copied, as system_create source or system_update operation.source: { kind: "user-message", boundaryMode: "lines", startAfter: ${JSON.stringify(o)}, endBefore: ${JSON.stringify(a)} }`}function _Pe(e){return GS("a file",e.filename,e.content)}function zK(e,t,n){let r=t.flatMap((o)=>o.source?[`{ id: "${o.source.id}", transform: "${n(o)}" }`]:[]);return`Available system_create candidate for keeping every file attached to this message${e} (call without confirmed to request confirmation): { entityType: "note", source: { kind: "uploads", items: [${r.join(", ")}] } }`}function OPe(e){let t=e.filter((r)=>r.source);if(t.length<2)return[];let n=t.some(Cf);return[zK(n?", each as itself, text files as notes and PDFs as documents":", each as itself and text files as notes",t,(r)=>r.kind==="text"?"extract-markdown":"preserve"),...n?[zK(" as notes, each PDF's text extracted into its note, when the user asks for notes",t,(r)=>r.kind==="text"||Cf(r)?"extract-markdown":"preserve")]:[],"To keep them as another type, such as posts, use this call with that entityType; what the user states about one file, such as its publication date, goes in that file's item fields."]}function MPe(e,t,n,r){let o=t.map($K).filter(_P),a=OP([...n,...o]),s=a.map(jPe),c=r?["Available system_create candidate for saving the prior assistant response (call without confirmed to request confirmation):",`{ entityType: "note", source: { kind: "prior-response", messageId: "${r.messageId}" } }`].join(" "):"";if(s.length===0)return c;let l='Available upload refs from this conversation. Refs are ordered newest-first. Treat this as structured candidate data; resolve any user reference to a specific upload in typed tool arguments, or ask a clarification if the candidates are insufficient. For phrases like "the uploaded image" or "the uploaded PDF" without a filename, use the newest ref matching that media type; do not ask for clarification just because older uploads exist. Describe, summarize, analyze, or discuss uploads directly from the file bytes as read-only chat responses; do not call system_create unless the user explicitly asks to save, import, preserve, or create an entity. In read-only upload summaries, answer the request directly and do not offer to save/import/create unless asked. A reply of only a word or a name, after you asked what to do with an upload, is no request to save, create or change anything: ask what the user wants done with the upload. Upload candidates are file bytes; previous assistant answers are saved separately. If the user says "save it" after your summary/answer about an upload, save the prior assistant response as a note with source.kind "prior-response" unless they explicitly ask to save the uploaded file/document itself. Use system_create source.kind upload with its upload id as source.id and transform "preserve" for preserving raw file bytes as a document/image, or transform "extract-markdown" for extracting/importing upload text as a note. Turning an upload into a note with no changes asked is extract-markdown, however little text it holds. To keep several uploads at once, call system_create once with source.kind uploads listing every attached file. These upload transforms preserve the source wording: extract-markdown does not apply edits, summaries, translations, or restructuring. When the user asks to create a new note with such changes to an upload, use system_generate with operation.kind "prompt" instead of importing the original. Request only generation confirmation for that note; do not also call system_create to import the source as a second action. Include the readable source content and all requested changes in operation.prompt; the generation job does not receive this conversation or its attachments. An upload ref or filename alone is not source content, and is not a durable entity ref for prompt-from-source. Once a note has been created, use system_get to read its current content when asked to show it; do not substitute the original upload or reconstruct the note from chat.',u=OPe(t),d=r===void 0&&u.length===0&&(LK.test(e)||CPe.test(e))?DPe(a[0]):"";return[l,c,d,...u,...s].filter((p)=>p.length>0).join(`
|
|
329
329
|
`)}function DPe(e){if(!e||e.savedAs)return"";let t=e.mediaType.toLowerCase(),n=t.startsWith("image/")?{saved:"an image",entityType:"image",transform:"preserve"}:t==="application/pdf"?{saved:"a document",entityType:"document",transform:"preserve"}:t.startsWith("text/")?{saved:"a note",entityType:"note",transform:"extract-markdown"}:void 0;if(!n)return"";let r=`Available system_create candidate for saving the newest upload, ${e.filename}, as ${n.saved} when the user asks to save it without naming another file (call without confirmed to request confirmation): { entityType: "${n.entityType}", source: { kind: "upload", id: "${e.source.id}", transform: "${n.transform}" } }`;if(t!=="application/pdf")return r;return[r,`Available system_create candidate for saving the newest upload, ${e.filename}, as a note of its text when the user asks for a note (call without confirmed to request confirmation): { entityType: "note", source: { kind: "upload", id: "${e.source.id}", transform: "extract-markdown" } }`].join(`
|
|
330
330
|
`)}function jPe(e){return[`- ${e.filename}`,`upload id: "${e.source.id}"`,`mediaType: ${e.mediaType}`,...e.savedAs?[`saved as ${e.savedAs.entityType} "${e.savedAs.entityId}" holding this upload text verbatim: change it there with system_update edits quoting that text, without system_get first, never as a new ${e.savedAs.entityType}`]:[]].join("; ")}function MP(e){if(e===void 0)return;return e.length===0?zPe():NPe(e)}function zPe(){return"No relevant conversation memory was retrieved for this turn. If the user asks about conversation memory available in this turn, say none was retrieved rather than inferring from general instructions or other background knowledge."}function NPe(e){return["Relevant conversation memory retrieved for this turn.",'Use it only when it helps answer the user. If the user asks what conversation memory says, explicitly ground the answer in the retrieved memory (for example, "According to conversation memory...") rather than general background knowledge. Preserve source/provenance when referencing memory. Ignore unrelated memory; when memory conflicts, prefer the most specific or newest source and mention uncertainty if the conflict remains unresolved.',"",e.map((n,r)=>$Pe(n,r)).join(`
|
|
331
331
|
|
|
@@ -339,7 +339,7 @@ Confirmation required.`:"Confirmation required."}function VPe(e){return{kind:e.k
|
|
|
339
339
|
|
|
340
340
|
${w.text}`:b?`${v.resultText}
|
|
341
341
|
|
|
342
|
-
${b}`:v.resultText,C=[...v.cards,...w?.cards??[]],x=[v.toolResult,...w?.toolResults??[]],y=w?Ef(w.toolResults??[]):[],R=[...v.entityMemoryRefs,...y];return t?.throwIfAborted(),await this.saveAssistantMessage({conversationId:n,content:T,channelId:s,channelName:c,userPermissionLevel:l,cards:C,entityMemoryRefs:R}),{text:T,toolResults:x,cards:C,...w?.pendingConfirmations?{pendingConfirmations:w.pendingConfirmations}:{},usage:w?.usage??{promptTokens:0,completionTokens:0,totalTokens:0}}}async fetchAgentContext(e){if(e.interfaceType===xt||!this.deps.agentContextProvider)return;try{return await this.deps.agentContextProvider({conversationId:e.conversationId,message:e.message,interfaceType:e.interfaceType,channelId:e.channelId,channelName:e.channelName,userPermissionLevel:e.userPermissionLevel??"public"})}catch(t){this.deps.logger.warn("Agent context provider failed",{conversationId:e.conversationId,error:he(t)});return}}async followUpAfterConfirmedAction(e){try{return await this.generatePostConfirmationFollowUp(e)}catch(t){e.signal?.throwIfAborted(),this.deps.logger.warn("Follow-up reply after confirmed action failed",{conversationId:e.conversationId,toolName:e.toolName,error:he(t)});return}}async generatePostConfirmationFollowUp(e){if(e.signal?.throwIfAborted(),!this.deps.agentContextProvider)return;let t=`The operator approved the pending action. The system executed it successfully: ${e.resultText} Continue the conversation naturally. If an active playbook is underway, use the current playbook context as the source of truth, ask only for what is missing in the current playbook state, and give the next immediate action or question. Do not skip ahead or imply uncompleted playbook steps are done. Do not ask for the same confirmation again. Do not suggest repeating the same collection, save, or create task unless the current playbook context explicitly asks for another item. If the approved action saved, created, or updated an item for a completed playbook collection step, do not ask for another item; follow the refreshed current state instead. Do not offer a completed prior-state task as an alternative to the current playbook task. Do not say you found, retrieved, or showed an entity unless the approved action or latest tool result actually performed retrieval or display; after a save or update, say it was saved or updated.`,n=await this.fetchAgentContext({conversationId:e.conversationId,message:t,interfaceType:e.interfaceType,channelId:e.channelId,channelName:e.channelName,userPermissionLevel:e.userPermissionLevel});if(e.signal?.throwIfAborted(),!n||n.length===0)return;let r=await this.deps.conversationService.getMessages(e.conversationId,{limit:50}),o=AP(r,e.userPermissionLevel),a=PP(o,t),s=MP(n),c=await this.deps.getAgent(e.interfaceType).generate({messages:a,options:{userPermissionLevel:e.userPermissionLevel,isAnchor:e.isAnchor,conversationId:e.conversationId,...e.channelId?{channelId:e.channelId}:{},channelName:e.channelName,interfaceType:e.interfaceType,...s?{agentContextInstructions:s}:{},disableTools:!0},...e.signal?{abortSignal:e.signal}:{}});e.signal?.throwIfAborted();let{toolResults:l,pendingConfirmations:u,cards:d}=RP(c.steps,c.text,this.deps.entityLinks);return{text:u.length>0?jP(c.text):c.text,toolResults:l,...d.length>0?{cards:d}:{},...u.length>0?{pendingConfirmations:u}:{},usage:wl(c.usage)}}async saveAssistantMessage({conversationId:e,content:t,channelId:n,channelName:r,...o}){await this.deps.conversationService.addMessage({conversationId:e,role:"assistant",content:t,...await this.memberMessageMetadata({actor:this.getAssistantActor(),source:this.buildAssistantSource(n,r),...o})})}async saveGuestReply(e,t,n){await this.deps.conversationService.addMessage({conversationId:e,role:"assistant",content:t,...HK(n)})}async memberMessageMetadata({actorAlreadyEnriched:e=!1,...t}){return GK(await WK({...t,...!e&&this.deps.canonicalIdentityResolver?{canonicalIdentityResolver:this.deps.canonicalIdentityResolver}:{}}))}async enrichActor(e){if(!e||!this.deps.canonicalIdentityResolver)return e;return this.deps.canonicalIdentityResolver.enrichActor(e)}getAssistantActor(){return DP({character:this.deps.identityService.getCharacter(),...this.deps.assistantAgentId?{agentId:this.deps.assistantAgentId}:{}})}buildAssistantSource(e,t){return{...e?{channelId:e}:{},channelName:t}}}var QPe=i.object({conversationId:i.string().min(1),toolResults:i.array(dv)}),NP=ln("agent:turn-completed",QPe);class $P{runtime;activeOperations=new Set;closePromise=null;closed=!1;constructor(){let e=ve.runSync(un.make()),t=ve.runSync(un.provide(Jc.make(),e));this.runtime={scope:e,fibers:t}}async run(e,t){if(this.closed)throw Error("Agent service has been shut down");t?.throwIfAborted();let n=ve.runFork(ve.tryPromise({try:(o)=>this.trackOperation(e,o),catch:(o)=>o}));Jc.addUnsafe(this.runtime.fibers,n);let r=()=>{n.interruptUnsafe()};if(t?.addEventListener("abort",r,{once:!0}),t?.aborted)r();try{let o=await ve.runPromise(Ou.await(n));if(An.isSuccess(o))return o.value;if(t?.aborted)throw t.reason;throw Lo.squash(o.cause)}finally{t?.removeEventListener("abort",r)}}close(){return this.closed=!0,this.closePromise??=Promise.resolve().then(()=>this.closeSupervisor()),this.closePromise}trackOperation(e,t){let n=JK();this.activeOperations.add(n.promise);let r=()=>{this.activeOperations.delete(n.promise)};n.promise.then(r,r);try{e(t).then(n.resolve,n.reject)}catch(o){n.reject(o)}return n.promise}async closeSupervisor(){let e=await ve.runPromiseExit(un.close(this.runtime.scope,An.void));if(await Promise.allSettled([...this.activeOperations]),An.isFailure(e))throw Lo.squash(e.cause)}}function pv(e,t){return e_e(e.identity,t.userPermissionLevel,e.pluginInstructions,e.profile,e.agentInstructions,t.agentContextInstructions,t.isAnchor)}var YPe=86400000;function XPe(e){return`${e.toLocaleDateString("en-US",{weekday:"long",timeZone:"UTC"})} ${e.toISOString().slice(0,10)}`}function e_e(e,t,n,r,o,a,s=!1,c=new Date){let l=t==="admin"?"The current caller's canonical permission level is **Admin**. This authorizes administrative actions and reading restricted/private content returned by tools. If asked to show/read a restricted record and the tool returns content, display it.":t==="trusted"?"The current caller's canonical permission level is **Trusted**.":"The current caller's canonical permission level is **Public**. Public access is limited and read-oriented and generally cannot create, update, delete, publish, sync, or otherwise mutate content.",u=s?"The current caller is the brain's configured Anchor identity. This identity fact does not grant Admin permission; authorization comes only from the permission level above.":"The current caller is not the brain's configured Anchor identity. This is a definitive account-relationship fact for the current request, not an unknown or unverified state. Their permission level must not be treated as proof that they are the Anchor, owner, or profile person.",d=Array.from({length:7},(h,v)=>XPe(new Date(c.getTime()+v*YPe))),p=`Today is ${d[0]} (UTC). Resolve relative dates ("Friday", "next week") from it. A bare weekday ("Friday", "by Friday") is its next date on or after today, never a past one: ${d.join(", ")}.`,f=`
|
|
342
|
+
${b}`:v.resultText,C=[...v.cards,...w?.cards??[]],x=[v.toolResult,...w?.toolResults??[]],y=w?Ef(w.toolResults??[]):[],R=[...v.entityMemoryRefs,...y];return t?.throwIfAborted(),await this.saveAssistantMessage({conversationId:n,content:T,channelId:s,channelName:c,userPermissionLevel:l,cards:C,entityMemoryRefs:R}),{text:T,toolResults:x,cards:C,...w?.pendingConfirmations?{pendingConfirmations:w.pendingConfirmations}:{},usage:w?.usage??{promptTokens:0,completionTokens:0,totalTokens:0}}}async fetchAgentContext(e){if(e.interfaceType===xt||!this.deps.agentContextProvider)return;try{return await this.deps.agentContextProvider({conversationId:e.conversationId,message:e.message,interfaceType:e.interfaceType,channelId:e.channelId,channelName:e.channelName,userPermissionLevel:e.userPermissionLevel??"public"})}catch(t){this.deps.logger.warn("Agent context provider failed",{conversationId:e.conversationId,error:he(t)});return}}async followUpAfterConfirmedAction(e){try{return await this.generatePostConfirmationFollowUp(e)}catch(t){e.signal?.throwIfAborted(),this.deps.logger.warn("Follow-up reply after confirmed action failed",{conversationId:e.conversationId,toolName:e.toolName,error:he(t)});return}}async generatePostConfirmationFollowUp(e){if(e.signal?.throwIfAborted(),!this.deps.agentContextProvider)return;let t=`The operator approved the pending action. The system executed it successfully: ${e.resultText} Continue the conversation naturally. If an active playbook is underway, use the current playbook context as the source of truth, ask only for what is missing in the current playbook state, and give the next immediate action or question. Do not skip ahead or imply uncompleted playbook steps are done. Do not ask for the same confirmation again. Do not suggest repeating the same collection, save, or create task unless the current playbook context explicitly asks for another item. If the approved action saved, created, or updated an item for a completed playbook collection step, do not ask for another item; follow the refreshed current state instead. Do not offer a completed prior-state task as an alternative to the current playbook task. Do not say you found, retrieved, or showed an entity unless the approved action or latest tool result actually performed retrieval or display; after a save or update, say it was saved or updated.`,n=await this.fetchAgentContext({conversationId:e.conversationId,message:t,interfaceType:e.interfaceType,channelId:e.channelId,channelName:e.channelName,userPermissionLevel:e.userPermissionLevel});if(e.signal?.throwIfAborted(),!n||n.length===0)return;let r=await this.deps.conversationService.getMessages(e.conversationId,{limit:50}),o=AP(r,e.userPermissionLevel),a=PP(o,t),s=MP(n),c=await this.deps.getAgent(e.interfaceType).generate({messages:a,options:{userPermissionLevel:e.userPermissionLevel,isAnchor:e.isAnchor,conversationId:e.conversationId,...e.channelId?{channelId:e.channelId}:{},channelName:e.channelName,interfaceType:e.interfaceType,...s?{agentContextInstructions:s}:{},disableTools:!0},...e.signal?{abortSignal:e.signal}:{}});e.signal?.throwIfAborted();let{toolResults:l,pendingConfirmations:u,cards:d}=RP(c.steps,c.text,this.deps.entityLinks);return{text:u.length>0?jP(c.text):c.text,toolResults:l,...d.length>0?{cards:d}:{},...u.length>0?{pendingConfirmations:u}:{},usage:wl(c.usage)}}async saveAssistantMessage({conversationId:e,content:t,channelId:n,channelName:r,...o}){await this.deps.conversationService.addMessage({conversationId:e,role:"assistant",content:t,...await this.memberMessageMetadata({actor:this.getAssistantActor(),source:this.buildAssistantSource(n,r),...o})})}async saveGuestReply(e,t,n){await this.deps.conversationService.addMessage({conversationId:e,role:"assistant",content:t,...HK(n)})}async memberMessageMetadata({actorAlreadyEnriched:e=!1,...t}){return GK(await WK({...t,...!e&&this.deps.canonicalIdentityResolver?{canonicalIdentityResolver:this.deps.canonicalIdentityResolver}:{}}))}async enrichActor(e){if(!e||!this.deps.canonicalIdentityResolver)return e;return this.deps.canonicalIdentityResolver.enrichActor(e)}getAssistantActor(){return DP({character:this.deps.identityService.getCharacter(),...this.deps.assistantAgentId?{agentId:this.deps.assistantAgentId}:{}})}buildAssistantSource(e,t){return{...e?{channelId:e}:{},channelName:t}}}var QPe=i.object({conversationId:i.string().min(1),toolResults:i.array(dv)}),NP=ln("agent:turn-completed",QPe);class $P{runtime;activeOperations=new Set;closePromise=null;closed=!1;constructor(){let e=ve.runSync(un.make()),t=ve.runSync(un.provide(Jc.make(),e));this.runtime={scope:e,fibers:t}}async run(e,t){if(this.closed)throw Error("Agent service has been shut down");t?.throwIfAborted();let n=ve.runFork(ve.tryPromise({try:(o)=>this.trackOperation(e,o),catch:(o)=>o}));Jc.addUnsafe(this.runtime.fibers,n);let r=()=>{n.interruptUnsafe()};if(t?.addEventListener("abort",r,{once:!0}),t?.aborted)r();try{let o=await ve.runPromise(Ou.await(n));if(An.isSuccess(o))return o.value;if(t?.aborted)throw t.reason;throw Lo.squash(o.cause)}finally{t?.removeEventListener("abort",r)}}close(){return this.closed=!0,this.closePromise??=Promise.resolve().then(()=>this.closeSupervisor()),this.closePromise}trackOperation(e,t){let n=JK();this.activeOperations.add(n.promise);let r=()=>{this.activeOperations.delete(n.promise)};n.promise.then(r,r);try{e(t).then(n.resolve,n.reject)}catch(o){n.reject(o)}return n.promise}async closeSupervisor(){let e=await ve.runPromiseExit(un.close(this.runtime.scope,An.void));if(await Promise.allSettled([...this.activeOperations]),An.isFailure(e))throw Lo.squash(e.cause)}}function pv(e,t){return e_e(e.identity,t.userPermissionLevel,e.pluginInstructions,e.profile,e.agentInstructions,t.agentContextInstructions,t.isAnchor)}var YPe=86400000;function XPe(e){return`${e.toLocaleDateString("en-US",{weekday:"long",timeZone:"UTC"})} ${e.toISOString().slice(0,10)}`}function e_e(e,t,n,r,o,a,s=!1,c=new Date){let l=t==="admin"?"The current caller's canonical permission level is **Admin**. This authorizes administrative actions and reading restricted/private content returned by tools. If asked to show/read a restricted record and the tool returns content, display it.":t==="trusted"?"The current caller's canonical permission level is **Trusted**. Trusted access cannot delete: refuse a delete request directly, without reading or searching for the target.":"The current caller's canonical permission level is **Public**. Public access is limited and read-oriented and generally cannot create, update, delete, publish, sync, or otherwise mutate content.",u=s?"The current caller is the brain's configured Anchor identity. This identity fact does not grant Admin permission; authorization comes only from the permission level above.":"The current caller is not the brain's configured Anchor identity. This is a definitive account-relationship fact for the current request, not an unknown or unverified state. Their permission level must not be treated as proof that they are the Anchor, owner, or profile person.",d=Array.from({length:7},(h,v)=>XPe(new Date(c.getTime()+v*YPe))),p=`Today is ${d[0]} (UTC). Resolve relative dates ("Friday", "next week") from it. A bare weekday ("Friday", "by Friday") is its next date on or after today, never a past one: ${d.join(", ")}.`,f=`
|
|
343
343
|
## Current User
|
|
344
344
|
${l}
|
|
345
345
|
${u}
|
|
@@ -416,5 +416,5 @@ Result:`);if(n===-1)return;let r=e.slice(n+9).trim();if(!r)return;try{return JSO
|
|
|
416
416
|
`)}function oDe(e){return e.split(`
|
|
417
417
|
`).flatMap((t)=>{let n=t.match(rDe);if(!n)return[];let r=(n[3]??"").split(",").map((o)=>o.trim()).filter(Boolean);return[{name:n[1]??"",description:n[2]??"",tags:r}]})}var U6=new _s(Hv,{title:"Agent",mappings:[{key:"about",label:"About",type:"string"},{key:"skills",label:"Skills",type:"custom",formatter:iDe,parser:oDe},{key:"notes",label:"Notes",type:"string"}]});function aDe(e){return U6.format(e)}function sDe(e){if(!e.trim())return Hv.parse({});try{return U6.parse(e)}catch{return Hv.parse({})}}import{EventEmitter as Y6}from"events";var pn={REGISTERED:"registered",INITIALIZED:"initialized",ERROR:"error",DISABLED:"disabled"},Hi={REGISTERED:"plugin:registered",BEFORE_INITIALIZE:"plugin:before_initialize",INITIALIZED:"plugin:initialized",ERROR:"plugin:error",DISABLED:"plugin:disabled"};class Ji extends Error{pluginId;constructor(e,t){super(`Plugin ${e}: ${t}`);this.name="PluginError",this.pluginId=e}}class Z6 extends Error{pluginId;constructor(e,t){super(t);this.name="FatalPluginConfigurationError",this.pluginId=e}}var W6=Symbol.for("brains.httpRouteSnapshotProvider");function Jv(e){let t=Reflect.get(e,W6);return typeof t==="function"?t:void 0}function cDe(e,t){if(Jv(e))throw Error("HTTP route snapshot provider is already bound");Object.defineProperty(e,W6,{value:t,enumerable:!1,configurable:!0,writable:!1})}function G6(e,t){let n=Jv(e);if(!n)throw Error("HTTP route snapshot provider is not bound");if(Jv(t))return;cDe(t,n)}function Ywt(e){let t=Jv(e);if(!t)throw Error("HTTP route snapshot provider is not bound");return t()}function J6(e,t){return Reflect.get(e,t,e)}function V6(e,t,n){if(typeof e!=="function")throw TypeError("Cannot apply a non-callable trapped member");return Reflect.apply(e,t,n)}class I_{scope;ingress=new Set;closePromise=null;closed=!1;constructor(){this.scope=ve.runSync(un.make())}assertOpen(){if(this.closed)throw Error("Cannot register a resource after plugin teardown")}acquire(e,t){this.assertOpen();let n=e();try{this.addFinalizer(()=>t(n))}catch(r){try{t(n)}catch(o){throw AggregateError([r,o],"Plugin acquisition rollback failed",{cause:o})}throw r}return n}addFinalizer(e){this.assertOpen(),ve.runSync(un.addFinalizer(this.scope,ve.promise(async()=>{await e()})))}addIngress(e){this.assertOpen(),this.ingress.add(e)}close(e=An.void){return this.closed=!0,this.closePromise??=this.closeScope(e),this.closePromise}async closeScope(e){let t,n=!1,r=[...this.ingress].reverse();for(let c of r)try{c.stopAdmission()}catch(l){if(!n)t=l;n=!0}let o=await Promise.allSettled(r.map((c)=>Promise.resolve().then(()=>c.drain())));this.ingress.clear();let a=o.find((c)=>c.status==="rejected");if(!n&&a)t=a.reason,n=!0;let s=await ve.runPromiseExit(un.close(this.scope,e));if(!n&&An.isFailure(s))t=Lo.squash(s.cause),n=!0;if(n)throw t}}function Al(e,t,n,r){return new Proxy(e,{get(o,a){let s=J6(o,a);if(typeof a==="string"&&t.some((c)=>c===a)&&typeof s==="function")return(...c)=>n.acquire(()=>V6(s,o,c),(l)=>r(c,l));return typeof s==="function"?s.bind(o):s}})}function H6(e){return typeof e==="function"}function qf(e,t,n){return Al(e,t,n,(r)=>{let o=r[0];if(typeof o==="string")e.unregisterPlugin(o)})}function K6(e,t){let n=e.getMessageBus(),r=new Set,o=(A,k,D)=>{t.assertOpen();let z=!0,H=new Set,N=D((B)=>{if(!z)return{noop:!0};let Q,ee=new Promise((ae)=>{Q=ae});H.add(ee);let F=()=>{H.delete(ee),Q()},M;try{M=Promise.resolve(k(B))}catch(ae){throw F(),ae}return M.then((ae)=>(F(),ae),(ae)=>{throw F(),ae})}),q={type:A,originalHandler:k,stopAdmission:()=>{if(!z)return;z=!1,N(),r.delete(q)}};r.add(q);try{t.addIngress({stopAdmission:q.stopAdmission,drain:async()=>{await Promise.all(H)}})}catch(B){throw q.stopAdmission(),B}return q.stopAdmission},a={send:(A)=>n.send(A),hasHandlers:(A)=>n.hasHandlers?.(A)??!1,subscribe:(A,k,D)=>o(A,k,(z)=>n.subscribe(A,z,D)),observe:(A,k)=>o(A,k,(D)=>n.observe(A,D)),deliverPeer:(A,k)=>n.deliverPeer(A,k),unsubscribe:(A,k)=>{let D=[...r].filter((z)=>z.type===A&&z.originalHandler===k);if(D.length===0){n.unsubscribe(A,k);return}for(let z of D)z.stopAdmission()},collect:(A)=>n.collect(A),validateMessage:(A,k)=>n.validateMessage(A,k),getHandlerCount:(A)=>n.getHandlerCount(A),getTargetedHandlerCount:(A,k)=>n.getTargetedHandlerCount(A,k),clearHandlers:(A)=>n.clearHandlers(A),clearAllHandlers:()=>n.clearAllHandlers()},s=e.getAttachmentRegistry(),c={...s,register:(A,k,D)=>t.acquire(()=>s.register(A,k,D),(z)=>z())},l=e.getEntityRegistry(),u=Al(l,["registerEntityType"],t,(A)=>{let k=A[0];if(typeof k==="string")l.unregisterEntityType(k)}),d=qf(e.getProfileKindRegistry(),["register"],t),p=qf(e.getChannelRegistry(),["registerDescriptor","registerDeliveryProvider"],t),f=qf(e.getInboxRegistry(),["registerSource"],t),g=qf(e.getInboxFollowUpRegistry(),["registerKind"],t),h=e.getAccountSettingsRegistry(),v=Al(h,["register"],t,(A,k)=>{V6(h.unregister,h,[k])}),S=Al(e.getAuthRegistry(),["bindBackend"],t,(A,k)=>{if(H6(k))k()}),w=Al(e.getAtprotoProjectionRegistry(),["register"],t,(A,k)=>{if(H6(k))k()}),b=qf(e.getOperationalHealthRegistry(),["register"],t),T=e.getDataSourceRegistry(),C=Al(T,["register"],t,(A)=>{let k=A[0];if(typeof k==="object"&&k!==null&&"id"in k&&typeof k.id==="string"){let D=k.id.includes(":")?k.id:`shell:${k.id}`;T.unregister(D)}}),x=e.getAnalyticsRegistry(),y=Al(x,["register"],t,(A)=>{let k=A[0];if(typeof k==="object"&&k!==null&&"type"in k&&typeof k.type==="string")x.unregister(k.type)}),R=new Proxy(e,{get(A,k){if(k==="getMessageBus")return()=>a;if(k==="getAttachmentRegistry")return()=>c;if(k==="getEntityRegistry")return()=>u;if(k==="getDataSourceRegistry")return()=>C;if(k==="getProfileKindRegistry")return()=>d;if(k==="getChannelRegistry")return()=>p;if(k==="getInboxRegistry")return()=>f;if(k==="getInboxFollowUpRegistry")return()=>g;if(k==="getOperationalHealthRegistry")return()=>b;if(k==="getAccountSettingsRegistry")return()=>v;if(k==="getAuthRegistry")return()=>S;if(k==="getAtprotoProjectionRegistry")return()=>w;if(k==="getAnalyticsRegistry")return()=>y;let D=J6(A,k);return typeof D==="function"?D.bind(A):D}});return G6(e,R),R}class E_{plugins;events;daemonRegistry;logger;projectionRegistry;resourceScopes=new Map;releasePromises=new Map;constructor(e,t,n,r,o){this.plugins=e,this.events=t,this.daemonRegistry=n,this.projectionRegistry=r,this.logger=o.child("PluginLifecycle")}async initializePlugin(e,t,n){let r=this.plugins.get(e);if(!r)throw new Ji(e,"Registration failed: Plugin is not registered");let o=r.plugin,a=new I_;a.addFinalizer(()=>t.unregisterPluginCapabilities?.(e)),a.addFinalizer(()=>t.getJobQueueService().unregisterPluginHandlers(e)),a.addFinalizer(()=>this.projectionRegistry.unregisterPlugin(e)),this.resourceScopes.set(e,a),this.releasePromises.delete(e),this.logger.debug(`Initializing plugin: ${e}`);try{this.events.emit(Hi.BEFORE_INITIALIZE,e,o);let s=await o.register(K6(t,a),n);return r.status=pn.INITIALIZED,this.logger.debug(`Initialized plugin: ${e}`),this.events.emit(Hi.INITIALIZED,e,o),s}catch(s){throw this.logger.error(`Error initializing plugin ${e}: ${he(s)}`),await this.failPluginInitialization(e,s),s}}async finalizePluginRegistration(e){let t=this.plugins.get(e);if(!t)throw new Ji(e,"Registration finalization failed: Plugin is not registered");if(t.status!==pn.INITIALIZED)return;try{await t.plugin.finalizeRegistration?.(),this.logger.debug(`Registration finalized for plugin: ${e}`)}catch(n){throw await this.failPluginInitialization(e,n),n}}async readyPlugin(e){let t=this.plugins.get(e);if(!t)throw new Ji(e,"Ready failed: Plugin is not registered");if(t.status!==pn.INITIALIZED){this.logger.debug(`Skipping ready hook for non-initialized plugin: ${e}`);return}try{await t.plugin.ready?.(),this.logger.debug(`Ready hook completed for plugin: ${e}`)}catch(n){let r=ta(n);t.status=pn.ERROR,t.error=r;try{this.events.emit(Hi.ERROR,e,r)}catch(o){this.logger.error(`Plugin error listener failed for ${e}`,o)}throw r}}async startPluginDaemons(e){let t=this.plugins.get(e);if(t?.status!==pn.INITIALIZED)return;try{await this.daemonRegistry.startPlugin(e),this.logger.debug(`Started daemons for plugin: ${e}`)}catch(n){if(t.plugin.requiresDaemonStartup?.())throw n;this.logger.warn(`Daemon ${e} failed to start: ${he(n)}`)}}async failPluginInitialization(e,t){let n=this.plugins.get(e);if(!n)return;let r=n.status!==pn.ERROR,o=ta(t);if(n.status=pn.ERROR,n.error=o,await this.releasePluginResources(e,An.fail(t)),r)try{this.events.emit(Hi.ERROR,e,o)}catch(a){this.logger.error(`Plugin error listener failed for ${e}`,a)}}async disablePlugin(e){let t=this.plugins.get(e);if(!t){this.logger.warn(`Cannot disable plugin ${e}: not registered`);return}if(t.status===pn.DISABLED)return;this.logger.debug(`Disabling plugin: ${e}`);let n=t.status===pn.ERROR;await this.releasePluginResources(e,An.void);let r=this.plugins.get(e);if(!n&&r&&r.status!==pn.DISABLED)r.status=pn.DISABLED,this.events.emit(Hi.DISABLED,e,r.plugin);this.logger.debug(`Disabled plugin: ${e}`)}releasePluginResources(e,t){let n=this.releasePromises.get(e);if(n)return n;let r=this.releasePluginResourcesOnce(e,t);return this.releasePromises.set(e,r),r}async releasePluginResourcesOnce(e,t){let n=this.plugins.get(e);if(!n)return;try{await this.daemonRegistry.stopPlugin(e),this.logger.debug(`Stopped daemons for plugin: ${e}`)}catch(o){this.logger.error(`Failed to stop daemons for plugin: ${e}`,o)}let r=this.resourceScopes.get(e);if(this.resourceScopes.delete(e),r)try{await r.close(t)}catch(o){this.logger.error(`Failed to close resources for plugin ${e}`,o)}if(n.plugin.shutdown)try{await n.plugin.shutdown(),this.logger.debug(`Shutdown completed for plugin: ${e}`)}catch(o){this.logger.error(`Plugin shutdown failed for ${e}:`,o)}for(let o of this.daemonRegistry.getByPlugin(e))try{await this.daemonRegistry.unregister(o.name)}catch(a){this.logger.error(`Failed to unregister daemon ${o.name} for plugin ${e}`,a)}}}class R_{plugins;events;logger;constructor(e,t,n){this.plugins=e,this.events=t,this.logger=n.child("DependencyResolver")}async resolveInitializationOrder(e){this.logger.debug("Resolving plugin initialization order...");let t=Array.from(this.plugins.keys()),n=new Set,r=!0;while(r&&n.size<t.length){r=!1;for(let s of t){if(n.has(s))continue;if(!this.plugins.get(s))continue;if(this.getUnmetDependencies(s).length===0)try{await e(s),n.add(s),r=!0}catch(u){let d=he(u);this.logger.error(`Failed to initialize plugin ${s}: ${d}`),n.add(s),r=!0}}}let o=t.filter((s)=>!n.has(s));if(o.length>0){let s=o.join(", ");this.logger.error(`Failed to initialize plugins due to dependency issues: ${s}`);for(let c of o){let l=this.getUnmetDependencies(c);this.logger.error(`Plugin ${c} has unmet dependencies: ${l.join(", ")}`);let u=this.plugins.get(c);if(u)u.status=pn.ERROR,u.error=new Ji(c,`Unmet dependencies: ${l.join(", ")}`);this.events.emit(Hi.ERROR,c,u?.error)}}let a=new Set;for(let[s,c]of this.plugins)if(c.status===pn.INITIALIZED)a.add(s);return this.logger.debug(`Resolved ${a.size} of ${t.length} plugins`),{initialized:a,failed:o}}getUnmetDependencies(e){let t=this.plugins.get(e);if(!t)return[];let{dependencies:n}=t,r=[];for(let o of n){let a=this.plugins.get(o);if(!a){r.push(o);continue}if(a.status!==pn.INITIALIZED)r.push(o)}return r}}class k_{logger;projectionRegistry;constructor(e,t){this.logger=e.child("CapabilityRegistrar"),this.projectionRegistry=t}async registerCapabilities(e,t,n,r){if(!r?.executionOnly&&n.tools.length>0)e.registerTools(t,n.tools),this.logger.debug(`Registered ${n.tools.length} tools from ${t}`);if(!r?.executionOnly&&n.resources.length>0)e.registerResources(t,n.resources),this.logger.debug(`Registered ${n.resources.length} resources from ${t}`);if(!r?.executionOnly&&n.instructions)e.registerInstructions(t,n.instructions),this.logger.debug(`Registered instructions from ${t}`);let o=n.projectionRules??[];try{for(let a of o)this.projectionRegistry.registerRule(t,a)}catch(a){throw this.projectionRegistry.unregisterPlugin(t),a}if(o.length>0)this.logger.debug(`Registered ${o.length} projection rules from ${t}`)}}class Vv{projections=new Map;rules=new Map;static createFresh(){return new Vv}constructor(){}registerRule(e,t){if(!Object.isFrozen(t))throw Error(`Projection rule "${t.id}" must be created with defineProjectionRule`);let n=this.projections.get(t.id);if(n)throw Error(`Projection "${t.id}" is already registered by "${n.pluginId}"`);let r={id:t.id,pluginId:e,targetType:t.targetType,sources:t.sources.map((a)=>({kind:a.kind,types:[...a.types],...a.excludeTypes?{excludeTypes:[...a.excludeTypes]}:{}}))};this.projections.set(t.id,r),this.rules.set(t.id,t);let o=!0;return()=>{if(!o)return;if(o=!1,this.rules.get(t.id)===t)this.rules.delete(t.id);if(this.projections.get(t.id)===r)this.projections.delete(t.id)}}unregisterPlugin(e){for(let[t,n]of this.projections)if(n.pluginId===e)this.projections.delete(t),this.rules.delete(t)}list(){return Array.from(this.projections.values()).sort((e,t)=>e.id.localeCompare(t.id)).map(dDe)}listRules(){return[...this.rules.values()].sort((e,t)=>e.id.localeCompare(t.id))}validate(e){let t=this.list(),n=new Set(e.map(({type:s})=>s));for(let s of t)if(!n.has(s.targetType))throw Error(`Projection "${s.id}" targets unregistered entity type "${s.targetType}"`);let r=e.filter(({projectionSource:s})=>s).map(({type:s})=>s).sort(),o=pDe(t,r),a=fDe(t,o)[0];if(a){let s=gDe(a,o);throw Error(`Projection cycle is not supported: ${[...s,s[0]].join(" -> ")}`)}return uDe({projections:t,edges:o,unknownSourceTypes:lDe(t,n)})}}function lDe(e,t){let n=[];for(let r of e){let o=[...new Set(r.sources.flatMap((a)=>[...a.types,...a.excludeTypes??[]]).filter((a)=>a!=="*"&&!t.has(a)))].sort();if(o.length>0)n.push({projectionId:r.id,types:o})}return n}function uDe(e){for(let t of e.projections){for(let n of t.sources){if(Object.freeze(n.types),n.excludeTypes)Object.freeze(n.excludeTypes);Object.freeze(n)}Object.freeze(t.sources),Object.freeze(t)}for(let t of e.edges)Object.freeze(t.causes),Object.freeze(t);for(let t of e.unknownSourceTypes)Object.freeze(t.types),Object.freeze(t);return Object.freeze(e.unknownSourceTypes),Object.freeze(e.projections),Object.freeze(e.edges),Object.freeze(e)}function dDe(e){return{...e,sources:e.sources.map((t)=>({...t,types:[...t.types],...t.excludeTypes?{excludeTypes:[...t.excludeTypes]}:{}}))}}function pDe(e,t){let n=new Map;for(let r of e)for(let o of e){let a=mDe(r,o,t);if(a.length===0)continue;n.set(`${r.id}\x00${o.id}`,new Set(a))}return Array.from(n,([r,o])=>{let[a="",s=""]=r.split("\x00");return{from:a,to:s,causes:[...o].sort()}}).sort((r,o)=>r.from.localeCompare(o.from)||r.to.localeCompare(o.to))}function mDe(e,t,n){let r=[];for(let o of t.sources){let a=new Set(o.excludeTypes??[]);if((o.types.includes("*")?[...o.types.filter((c)=>c!=="*"),...n]:o.types).includes(e.targetType)&&!a.has(e.targetType))r.push(`entity:${e.targetType}`)}return[...new Set(r)]}function fDe(e,t){let n=e.map(({id:p})=>p).sort(),r=Q6(n,t),o=new Map,a=new Map,s=[],c=new Set,l=[],u=0,d=(p)=>{o.set(p,u),a.set(p,u),u++,s.push(p),c.add(p);for(let v of r.get(p)??[])if(!o.has(v))d(v),a.set(p,Math.min(a.get(p)??0,a.get(v)??0));else if(c.has(v))a.set(p,Math.min(a.get(p)??0,o.get(v)??0));if(a.get(p)!==o.get(p))return;let f=[],g;do{if(g=s.pop(),!g)break;c.delete(g),f.push(g)}while(g!==p);let h=r.get(p)?.includes(p)??!1;if(f.length>1||h)l.push(f.sort())};for(let p of n)if(!o.has(p))d(p);return l.sort((p,f)=>(p[0]??"").localeCompare(f[0]??""))}function gDe(e,t){let n=new Set(e),r=Q6(e,t),o=[...e].sort()[0];if(!o)return[];if(r.get(o)?.includes(o))return[o];let a=(s,c)=>{for(let l of r.get(s)??[]){if(!n.has(l))continue;if(l===o)return c;if(c.includes(l))continue;let u=a(l,[...c,l]);if(u)return u}return};return a(o,[o])??[...e].sort()}function Q6(e,t){let n=new Map;for(let r of e)n.set(r,[]);for(let r of t){let o=n.get(r.from);if(o&&!o.includes(r.to))o.push(r.to)}for(let r of n.values())r.sort();return n}class Kv{plugins=new Map;logger;events=new Y6;daemonRegistry;shell=null;initializedPluginIds=[];channelOnlyPlugins=[];pluginLifecycle;dependencyResolver;capabilityRegistrar;projectionRegistry=Vv.createFresh();projectionGraph;static createFresh(e,t){return new Kv(e,t)}setShell(e){this.shell=e}constructor(e,t){this.logger=e.child("PluginManager"),this.events=new Y6,this.daemonRegistry=t,this.pluginLifecycle=new E_(this.plugins,this.events,this.daemonRegistry,this.projectionRegistry,e),this.dependencyResolver=new R_(this.plugins,this.events,e),this.capabilityRegistrar=new k_(e,this.projectionRegistry)}registerPlugin(e){if(!e.id)throw new Ji("unknown","Registration failed: Plugin must have an id");if(this.logger.debug(`Registering plugin: ${e.id} (${e.version})`),this.plugins.has(e.id)){let o=this.plugins.get(e.id)?.plugin.version;throw new Ji(e.id,`Registration failed: Plugin is already registered with version ${o}`)}let t=e.dependencies??[],n={plugin:e,status:pn.REGISTERED,dependencies:t};this.plugins.set(e.id,n),this.logger.debug(`Registered plugin: ${e.id} (${e.version})`),this.events.emit(Hi.REGISTERED,e.id,e)}async initializePlugins(e){this.logger.debug("Initializing plugins..."),this.initializedPluginIds=[];let t=await this.dependencyResolver.resolveInitializationOrder(async(n)=>{await this.initializePlugin(n,e)});this.logger.debug(`Initialized ${t.initialized.size} of ${this.plugins.size} plugins`)}async registerInterfaceChannels(e,t){let n=this.shell;if(!n)throw Error("Cannot register interface channels: Shell not set. Call setShell() first.");for(let r of e)try{await r.registerChannelsForExecution?.(n,t),this.channelOnlyPlugins.push(r)}catch(o){this.logger.error(`Channel registration failed for interface ${r.id}: ${he(o)}`)}}async initializePlugin(e,t){if(!this.shell)throw new Ji(e,"Cannot initialize plugin: Shell not set. Call setShell() first.");let n=this.shell;try{let r=await this.pluginLifecycle.initializePlugin(e,n,t);await this.capabilityRegistrar.registerCapabilities(n,e,r,{executionOnly:t?.executionOnly}),this.initializedPluginIds.push(e)}catch(r){throw await this.pluginLifecycle.failPluginInitialization(e,r),r}}async finalizePluginRegistrations(){this.logger.debug("Finalizing plugin registrations...");for(let n of this.initializedPluginIds)await this.pluginLifecycle.finalizePluginRegistration(n);if(!this.shell)throw Error("Cannot validate projections before the shell is set");let e=this.shell.getEntityRegistry(),t=this.projectionRegistry.validate(e.getAllEntityTypes().map((n)=>{let r=e.getEntityTypeConfig(n);return{type:n,projectionSource:r.projectionSource!==!1&&r.projectionSourceRole!=="excluded"}}));this.projectionGraph=t;for(let n of t.unknownSourceTypes)this.logger.warn("Projection declares entity source types no installed plugin registers",{projectionId:n.projectionId,types:n.types});this.logger.debug("Validated projection graph",{projections:t.projections.length,edges:t.edges.length})}getProjectionGraphSnapshot(){if(!this.projectionGraph)throw Error("Projection graph has not been finalized");return this.projectionGraph}getProjectionRulesSnapshot(){if(!this.projectionGraph)throw Error("Projection graph has not been finalized");return Object.freeze(this.projectionRegistry.listRules())}async readyPlugins(){this.logger.debug("Dispatching plugin ready hooks...");try{await A_(this.initializedPluginIds.map((e)=>()=>this.pluginLifecycle.readyPlugin(e)))}catch(e){for(let t of this.initializedPluginIds){let n=this.plugins.get(t);if(n?.status===pn.ERROR)await this.pluginLifecycle.failPluginInitialization(t,n.error??e)}throw e}}async startPluginDaemons(){this.logger.debug("Starting plugin daemons..."),await A_(this.initializedPluginIds.map((e)=>()=>this.pluginLifecycle.startPluginDaemons(e)))}getPlugin(e){return this.plugins.get(e)?.plugin}getPluginStatus(e){return this.plugins.get(e)?.status}hasPlugin(e){return this.plugins.has(e)}isPluginInitialized(e){return this.plugins.get(e)?.status===pn.INITIALIZED}getAllPluginIds(){return Array.from(this.plugins.keys())}getAllPlugins(){return new Map(this.plugins)}getFailedPlugins(){return Array.from(this.plugins.entries()).filter((e)=>e[1].status===pn.ERROR&&e[1].error!==void 0).map(([e,t])=>({id:e,error:t.error}))}getPluginPackageName(e){return this.plugins.get(e)?.plugin.packageName}async disablePlugin(e){await this.pluginLifecycle.disablePlugin(e)}async shutdownPlugins(){let e=new Set;for(let t of[...this.initializedPluginIds].reverse())await this.disablePlugin(t),e.add(t);for(let t of[...this.plugins.keys()].reverse())if(!e.has(t))await this.disablePlugin(t);for(let t of this.channelOnlyPlugins.splice(0).reverse())try{await t.shutdown?.()}catch(n){this.logger.error(`Shutdown failed for interface channels ${t.id}: ${he(n)}`)}}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}getEventEmitter(){return this.events}}class X6{definitions=new Map;register(e){this.definitions.set(e.type,e)}unregister(e){this.definitions.delete(e)}getDefinitions(){return Array.from(this.definitions.values())}async run(e){let t=this.definitions.get(e.type);if(!t)throw Error(`Unknown analytics report: ${e.type}. Available: ${Array.from(this.definitions.keys()).join(", ")}`);let n=t.minVisibility??"public";if(!Hr.hasPermission(e.permission,n))throw Error(`The ${t.type} report answers ${n} callers only`);let r=t.params.safeParse(e.params??{});if(!r.success){let s=r.error.issues.map((c)=>`${c.path.join(".")||"params"}: ${c.message}`).join("; ");throw Error(`Invalid params for ${t.type}: ${s}`)}let o=wr(e.permission),a=o==="public"?Mp(e.entityService,{publishedOnly:!0,visibilityScope:o}):e.entityService;return t.handler(r.data,{entityService:a,visibilityScope:o})}}function hDe(e){return e}function Qv(e){let t=e?.trim();if(!t)return"http://localhost:8080";let n=t.replace(/\/+$/,""),r=new URL(n);if(r.pathname!=="/"||r.search||r.hash)throw Error("OAuth issuer must be an origin without path, query, or hash");return r.origin}function yDe(e){let t=new URL(Qv(e)).hostname.toLowerCase();return t==="localhost"||t==="[::1]"||t==="::1"||t.startsWith("127.")}function e5(e,t){let r=e.headers.get("x-forwarded-proto")?.split(",")[0]?.trim(),o=e.headers.get("x-forwarded-host")??e.headers.get("host");if(o){let a=r??new URL(e.url).protocol.replace(":","");return Qv(`${a}://${o}`)}return Qv(t??new URL(e.url).origin)}function t5(e,t){return new Response(JSON.stringify({error:e}),{status:t,headers:{"Content-Type":"application/json; charset=utf-8","Cache-Control":"no-store"}})}function n5(e){let t=e.headers.get("origin");if(t===null)return!1;try{return t===e5(e)}catch{return!1}}function r5(e){return n5(e)?void 0:t5("Same-origin request required",403)}function bDe(e){let t=r5(e);if(t)return t;if(!e.headers.get("content-type")?.startsWith("application/json"))return t5("JSON request required",415);return}export{Ul as Ua,Zl as Va,Gl as Wa,En as Xa,Sc as Ya,uw as Za,dw as _a,wt as $a,O as ab,Kl as bb,J as cb,fs as db,ce as eb,Fn as fb,Yn as gb,cg as hb,xr as ib,Ct as jb,Xn as kb,Ia as lb,xc as mb,No as nb,at as ob,Xt as pb,xO as qb,dg as rb,$o as sb,Ue as tb,de as ub,$t as vb,Ot as wb,Dw as xb,Tr as yb,G as zb,Cg as Ab,ex as Bb,no as Cb,ro as Db,xM as Eb,Z5 as Fb,W5 as Gb,hi as Hb,hs as Ib,kn as Jb,bn as Kb,yi as Lb,Ea as Mb,It as Nb,Fi as Ob,TM as Pb,K5 as Qb,Q5 as Rb,Y5 as Sb,pp as Tb,ys as Ub,ux as Vb,Mg as Wb,mx as Xb,Ur as Yb,gx as Zb,mi as _b,zi as $b,bc as ac,wr as bc,us as cc,Or as dc,Dg as ec,zg as fc,nu as gc,ru as hc,Ng as ic,kLe as jc,ALe as kc,iu as lc,bi as mc,_n as nc,fp as oc,gp as pc,$g as qc,Zr as rc,UM as sc,Ec as tc,Ug as uc,Gg as vc,Tx as wc,Cx as xc,Hg as yc,Jg as zc,Ex as Ac,Kg as Bc,cu as Cc,Uo as Dc,lu as Ec,Cr as Fc,Yi as Gc,Lx as Hc,qx as Ic,K3 as Jc,Q3 as Kc,Wx as Lc,Vx as Mc,Qx as Nc,Go as Oc,uh as Pc,zD as Qc,ws as Rc,ND as Sc,T1e as Tc,$D as Uc,ph as Vc,W as Wc,Ho as Xc,_ as Yc,fe as Zc,P as _c,Ir as $c,UD as ad,Aa as bd,wi as cd,Gr as dd,Cp as ed,Ce as fd,Nn as gd,ot as hd,HD as id,JD as jd,st as kd,pu as ld,mu as md,Ts as nd,xj as od,kh as pd,vu as qd,CT as rd,IT as sd,jT as td,jh as ud,GT as vd,qh as wd,k0 as xd,P0 as yd,Fh as zd,JT as Ad,r7 as Bd,O0 as Cd,Zh as Dd,VT as Ed,M0 as Fd,Zi as Gd,NKe as Hd,$Ke as Id,BKe as Jd,LKe as Kd,QT as Ld,Wh as Md,YT as Nd,XT as Od,d7 as Pd,qKe as Qd,FKe as Rd,UKe as Sd,ZKe as Td,WKe as Ud,GKe as Vd,Gh as Wd,HKe as Xd,Ti as Yd,JKe as Zd,Dp as _d,D0 as $d,tC as ae,H_e as be,$I as ce,rC as de,ja as ee,fN as fe,n8e as ge,ZC as he,Hp as ie,iee as je,oee as ke,aee as le,see as me,RN as ne,Pu as oe,cee as pe,lee as qe,uee as re,Tu as se,_s as te,pee as ue,_N as ve,MN as we,gee as xe,cy as ye,zN as ze,yee as Ae,JC as Be,VC as Ce,F0 as De,Z0 as Ee,Jh as Fe,Q0 as Ge,pC as He,bC as Ie,ez as Je,Rr as Ke,Hc as Le,re as Me,yt as Ne,iI as Oe,sI as Pe,cI as Qe,na as Re,lI as Se,Xp as Te,uI as Ue,dI as Ve,pI as We,mI as Xe,xt as Ye,dy as Ze,py as _e,cXe as $e,lXe as af,$ee as bf,l$ as cf,dXe as df,Gee as ef,pXe as ff,mXe as gf,fXe as hf,gXe as if,hXe as jf,yXe as kf,bXe as lf,SXe as mf,vXe as nf,wXe as of,xXe as pf,Yee as qf,Xee as rf,CXe as sf,IXe as tf,EXe as uf,RXe as vf,kXe as wf,AXe as xf,PXe as yf,_Xe as zf,Ae as Af,Wn as Bf,Kc as Cf,$a as Df,my as Ef,fy as Ff,y$ as Gf,b$ as Hf,tte as If,gy as Jf,TI as Kf,rm as Lf,U$ as Mf,im as Nf,yy as Of,Qc as Pf,W$ as Qf,by as Rf,RI as Sf,G$ as Tf,Sy as Uf,kI as Vf,AI as Wf,yte as Xf,MI as Yf,vte as Zf,Cy as _f,J_e as $f,V_e as ag,K_e as bg,Y_e as cg,CQ as dg,X_e as eg,RQ as fg,PQ as gg,OQ as hg,Zu as ig,Yr as jg,Rv as kg,MQ as lg,a_ as mg,BQ as ng,Pf as og,LQ as pg,_f as qg,qQ as rg,mOe as sg,FQ as tg,UQ as ug,TOe as vg,WQ as wg,Wi as xg,lE as yg,CL as zg,Wne as Ag,Gne as Bg,Hne as Cg,Jne as Dg,ROe as Eg,kOe as Fg,AOe as Gg,c_ as Hg,Yo as Ig,Da as Jg,cX as Kg,OC as Lg,Tit as Mg,zre as Ng,VL as Og,Fy as Pg,qc as Qg,Ut as Rg,F7 as Sg,vC as Tg,KI as Ug,pX as Vg,vX as Wg,wX as Xg,xX as Yg,TX as Zg,CX as _g,IX as $g,EX as ah,RX as bh,AX as ch,PX as dh,_X as eh,OX as fh,MX as gh,DX as hh,jX as ih,zX as jh,NX as kh,az as lh,lz as mh,mz as nh,aE as oh,gz as ph,xre as qh,Cre as rh,Ire as sh,Ere as th,Pre as uh,XL as vh,yE as wh,dE as xh,Bre as yh,LL as zh,qL as Ah,UL as Bh,WL as Ch,nie as Dh,sie as Eh,cie as Fh,lie as Gh,pie as Hh,mie as Ih,fie as Jh,gie as Kh,$ie as Lh,Fie as Mh,Gie as Nh,Hie as Oh,Jie as Ph,Vie as Qh,Kie as Rh,Qie as Sh,eoe as Th,ib as Uh,qq as Vh,Fq as Wh,Uq as Xh,_E as Yh,OE as Zh,Gq as _h,Ope as $h,Vut as ai,Wme as bi,mk as ci,Ha as di,Hme as ei,Jme as fi,ef as gi,EA as hi,US as ii,RA as ji,ZS as ki,F2 as li,PCe as mi,kA as ni,Z2 as oi,OCe as pi,W2 as qi,MCe as ri,DCe as si,jCe as ti,jA as ui,NA as vi,BA as wi,LA as xi,qA as yi,FA as zi,_e as Ai,xn as Bi,bP as Ci,UPe as Di,BP as Ei,qP as Fi,T_e as Gi,gQ as Hi,hQ as Ii,Nd as Ji,El as Ki,Af as Li,Cv as Mi,Iv as Ni,bQ as Oi,L_e as Pi,q_e as Qi,F_e as Ri,U_e as Si,Z_e as Ti,G_e as Ui,Of as Vi,Mf as Wi,DOe as Xi,zOe as Yi,YOe as Zi,e6 as _i,n6 as $i,r6 as aj,i6 as bj,l6 as cj,d_ as dj,p_ as ej,m6 as fj,m_ as gj,Dv as hj,f6 as ij,jv as jj,f_ as kj,g6 as lj,h6 as mj,b6 as nj,zv as oj,S6 as pj,Nv as qj,w6 as rj,x6 as sj,h_ as tj,y_ as uj,C6 as vj,I6 as wj,Bv as xj,S_ as yj,Nf as zj,E6 as Aj,R6 as Bj,k6 as Cj,A6 as Dj,P6 as Ej,$Me as Fj,BMe as Gj,UMe as Hj,ZMe as Ij,WMe as Jj,GMe as Kj,qv as Lj,M6 as Mj,Fv as Nj,Uv as Oj,Zv as Pj,j6 as Qj,kl as Rj,Wv as Sj,Lf as Tj,z6 as Uj,x_ as Vj,$6 as Wj,F6 as Xj,YMe as Yj,nDe as Zj,aDe as _j,sDe as $j,Z6 as ak,cDe as bk,Ywt as ck,Kv as dk,X6 as ek,hDe as fk,Qv as gk,yDe as hk,e5 as ik,r5 as jk,bDe as kk};
|
|
418
418
|
|
|
419
|
-
//# debugId=
|
|
420
|
-
//# sourceMappingURL=index-
|
|
419
|
+
//# debugId=5893FD1F3792EA5664756E2164756E21
|
|
420
|
+
//# sourceMappingURL=index-q6pcp7gc.js.map
|