@agimon-ai/doompi-ui 0.0.1-alpha.2 → 0.0.1-alpha.4
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/extensionName.cjs +1 -1
- package/dist/extensionName.cjs.map +1 -1
- package/dist/extensionName.d.cts +12 -1
- package/dist/extensionName.d.cts.map +1 -1
- package/dist/extensionName.d.mts +12 -1
- package/dist/extensionName.d.mts.map +1 -1
- package/dist/extensionName.mjs +1 -1
- package/dist/extensionName.mjs.map +1 -1
- package/dist/toolInventory.cjs +1 -1
- package/dist/toolInventory.cjs.map +1 -1
- package/dist/toolInventory.d.cts.map +1 -1
- package/dist/toolInventory.d.mts.map +1 -1
- package/dist/toolInventory.mjs +1 -1
- package/dist/toolInventory.mjs.map +1 -1
- package/package.json +3 -3
package/dist/extensionName.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_virtual/_rolldown/runtime.cjs");let t=require("node:path");t=e.__toESM(t,1);let n=require("node:fs");n=e.__toESM(n,1);const r=new Map
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_virtual/_rolldown/runtime.cjs");let t=require("node:path");t=e.__toESM(t,1);let n=require("node:fs");n=e.__toESM(n,1);const r=new Map,i=`__doompiExtensionToolSources__`;function a(){let e=globalThis,t=e[i];if(t)return t;let n=new Map;return e[i]=n,n}function o(e,t){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}function s(e,t){return new Proxy(e,{get(e,n){return n===`registerTool`?n=>{e.registerTool(n),a().set(n.name,t)}:o(e,n)}})}function c(e){return a().get(e)}function l(e){let r=e;for(;;){try{let e=JSON.parse(n.default.readFileSync(t.default.join(r,`package.json`),`utf8`));if(typeof e.name==`string`&&e.name.length>0)return e.name}catch{}let e=t.default.dirname(r);if(e===r)return;r=e}}function u(e){let n=r.get(e);if(n!==void 0)return n;let i=l(t.default.dirname(e)),a=i?i.split(`/`).pop()??i:t.default.basename(e,t.default.extname(e));return r.set(e,a),a}exports.extensionName=u,exports.extensionToolSource=c,exports.withExtensionSource=s;
|
|
2
2
|
//# sourceMappingURL=extensionName.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensionName.cjs","names":["fs","path"],"sources":["../src/extensionName.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and doom-pi launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\n\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/doompi-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensionName.cjs","names":["fs","path"],"sources":["../src/extensionName.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and doom-pi launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\nconst TOOL_SOURCE_REGISTRY_KEY = '__doompiExtensionToolSources__' as const;\n\ntype RegisteredTool = Parameters<ExtensionAPI['registerTool']>[0];\ntype RegistryHost = typeof globalThis & { [TOOL_SOURCE_REGISTRY_KEY]?: Map<string, string> };\n\n/** Shared through `globalThis` so compiled and separately loaded modules see one registry. */\nfunction toolSourceRegistry(): Map<string, string> {\n const host = globalThis as RegistryHost;\n const existing = host[TOOL_SOURCE_REGISTRY_KEY];\n if (existing) return existing;\n const registry = new Map<string, string>();\n host[TOOL_SOURCE_REGISTRY_KEY] = registry;\n return registry;\n}\n\nfunction boundValue(target: object, property: PropertyKey): unknown {\n const value = Reflect.get(target, property, target);\n return typeof value === 'function' ? value.bind(target) : value;\n}\n\n/**\n * Gives one composed extension a Pi API that remembers which tools it registers.\n *\n * Pi attributes every factory inside a compiled Doom bundle to the outer bundle.\n * The compiler still knows each original entry path, so it calls factories through\n * this boundary and preserves that identity before the information is lost.\n */\nexport function withExtensionSource(pi: ExtensionAPI, entryPath: string): ExtensionAPI {\n return new Proxy(pi, {\n get(target, property) {\n if (property !== 'registerTool') return boundValue(target, property);\n return (tool: RegisteredTool): void => {\n target.registerTool(tool);\n toolSourceRegistry().set(tool.name, entryPath);\n };\n },\n });\n}\n\n/** Original extension entry that registered a tool inside a composed bundle. */\nexport function extensionToolSource(toolName: string): string | undefined {\n return toolSourceRegistry().get(toolName);\n}\n\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/doompi-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n"],"mappings":"6MAcA,MAAM,EAAQ,IAAI,IACZ,EAA2B,iCAMjC,SAAS,GAA0C,CACjD,IAAM,EAAO,WACP,EAAW,EAAK,GACtB,GAAI,EAAU,OAAO,EACrB,IAAM,EAAW,IAAI,IAErB,MADA,GAAK,GAA4B,EAC1B,CACT,CAEA,SAAS,EAAW,EAAgB,EAAgC,CAClE,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAU,CAAM,EAClD,OAAO,OAAO,GAAU,WAAa,EAAM,KAAK,CAAM,EAAI,CAC5D,CASA,SAAgB,EAAoB,EAAkB,EAAiC,CACrF,OAAO,IAAI,MAAM,EAAI,CACnB,IAAI,EAAQ,EAAU,CAEpB,OADI,IAAa,eACT,GAA+B,CACrC,EAAO,aAAa,CAAI,EACxB,EAAmB,CAAC,CAAC,IAAI,EAAK,KAAM,CAAS,CAC/C,EAJwC,EAAW,EAAQ,CAAQ,CAKrE,CACF,CAAC,CACH,CAGA,SAAgB,EAAoB,EAAsC,CACxE,OAAO,EAAmB,CAAC,CAAC,IAAI,CAAQ,CAC1C,CAEA,SAAS,EAAY,EAAuC,CAC1D,IAAI,EAAU,EACd,OAAS,CACP,GAAI,CACF,IAAM,EAAW,KAAK,MAAMA,EAAAA,QAAG,aAAaC,EAAAA,QAAK,KAAK,EAAS,cAAc,EAAG,MAAM,CAAC,EACvF,GAAI,OAAO,EAAS,MAAS,UAAY,EAAS,KAAK,OAAS,EAAG,OAAO,EAAS,IACrF,MAAQ,CAER,CACA,IAAM,EAASA,EAAAA,QAAK,QAAQ,CAAO,EACnC,GAAI,IAAW,EAAS,OACxB,EAAU,CACZ,CACF,CAEA,SAAgB,EAAc,EAA2B,CACvD,IAAM,EAAS,EAAM,IAAI,CAAS,EAClC,GAAI,IAAW,IAAA,GAAW,OAAO,EACjC,IAAM,EAAO,EAAYA,EAAAA,QAAK,QAAQ,CAAS,CAAC,EAE1C,EAAW,EAAQ,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,EAAQA,EAAAA,QAAK,SAAS,EAAWA,EAAAA,QAAK,QAAQ,CAAS,CAAC,EAE1G,OADA,EAAM,IAAI,EAAW,CAAQ,EACtB,CACT"}
|
package/dist/extensionName.d.cts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
1
2
|
//#region src/extensionName.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Gives one composed extension a Pi API that remembers which tools it registers.
|
|
5
|
+
*
|
|
6
|
+
* Pi attributes every factory inside a compiled Doom bundle to the outer bundle.
|
|
7
|
+
* The compiler still knows each original entry path, so it calls factories through
|
|
8
|
+
* this boundary and preserves that identity before the information is lost.
|
|
9
|
+
*/
|
|
10
|
+
declare function withExtensionSource(pi: ExtensionAPI, entryPath: string): ExtensionAPI;
|
|
11
|
+
/** Original extension entry that registered a tool inside a composed bundle. */
|
|
12
|
+
declare function extensionToolSource(toolName: string): string | undefined;
|
|
2
13
|
declare function extensionName(entryPath: string): string;
|
|
3
14
|
//#endregion
|
|
4
|
-
export { extensionName };
|
|
15
|
+
export { extensionName, extensionToolSource, withExtensionSource };
|
|
5
16
|
//# sourceMappingURL=extensionName.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensionName.d.cts","names":[],"sources":["../src/extensionName.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"extensionName.d.cts","names":[],"sources":["../src/extensionName.ts"],"mappings":";;;;;;;;;iBA0CgB,oBAAoB,IAAI,cAAc,oBAAoB;;iBAa1D,oBAAoB;iBAmBpB,cAAc"}
|
package/dist/extensionName.d.mts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
1
2
|
//#region src/extensionName.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Gives one composed extension a Pi API that remembers which tools it registers.
|
|
5
|
+
*
|
|
6
|
+
* Pi attributes every factory inside a compiled Doom bundle to the outer bundle.
|
|
7
|
+
* The compiler still knows each original entry path, so it calls factories through
|
|
8
|
+
* this boundary and preserves that identity before the information is lost.
|
|
9
|
+
*/
|
|
10
|
+
declare function withExtensionSource(pi: ExtensionAPI, entryPath: string): ExtensionAPI;
|
|
11
|
+
/** Original extension entry that registered a tool inside a composed bundle. */
|
|
12
|
+
declare function extensionToolSource(toolName: string): string | undefined;
|
|
2
13
|
declare function extensionName(entryPath: string): string;
|
|
3
14
|
//#endregion
|
|
4
|
-
export { extensionName };
|
|
15
|
+
export { extensionName, extensionToolSource, withExtensionSource };
|
|
5
16
|
//# sourceMappingURL=extensionName.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensionName.d.mts","names":[],"sources":["../src/extensionName.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"extensionName.d.mts","names":[],"sources":["../src/extensionName.ts"],"mappings":";;;;;;;;;iBA0CgB,oBAAoB,IAAI,cAAc,oBAAoB;;iBAa1D,oBAAoB;iBAmBpB,cAAc"}
|
package/dist/extensionName.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from"node:path";import t from"node:fs";const n=new Map
|
|
1
|
+
import e from"node:path";import t from"node:fs";const n=new Map,r=`__doompiExtensionToolSources__`;function i(){let e=globalThis,t=e[r];if(t)return t;let n=new Map;return e[r]=n,n}function a(e,t){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}function o(e,t){return new Proxy(e,{get(e,n){return n===`registerTool`?n=>{e.registerTool(n),i().set(n.name,t)}:a(e,n)}})}function s(e){return i().get(e)}function c(n){let r=n;for(;;){try{let n=JSON.parse(t.readFileSync(e.join(r,`package.json`),`utf8`));if(typeof n.name==`string`&&n.name.length>0)return n.name}catch{}let n=e.dirname(r);if(n===r)return;r=n}}function l(t){let r=n.get(t);if(r!==void 0)return r;let i=c(e.dirname(t)),a=i?i.split(`/`).pop()??i:e.basename(t,e.extname(t));return n.set(t,a),a}export{l as extensionName,s as extensionToolSource,o as withExtensionSource};
|
|
2
2
|
//# sourceMappingURL=extensionName.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensionName.mjs","names":[],"sources":["../src/extensionName.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and doom-pi launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\n\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/doompi-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"extensionName.mjs","names":[],"sources":["../src/extensionName.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport type { ExtensionAPI } from '@earendil-works/pi-coding-agent';\n\n/**\n * Display name for an extension that Pi could not attribute to a package.\n *\n * Pi stamps every `--extension <path>` argument with the literal source `cli`,\n * and doom-pi launches all of its extensions that way, so the only surviving\n * identity is the entry path. The nearest `package.json` above it names the\n * package that registered the tools.\n */\n\n/** Results are stable for the life of a session, and every source hits the same few dirs. */\nconst cache = new Map<string, string>();\nconst TOOL_SOURCE_REGISTRY_KEY = '__doompiExtensionToolSources__' as const;\n\ntype RegisteredTool = Parameters<ExtensionAPI['registerTool']>[0];\ntype RegistryHost = typeof globalThis & { [TOOL_SOURCE_REGISTRY_KEY]?: Map<string, string> };\n\n/** Shared through `globalThis` so compiled and separately loaded modules see one registry. */\nfunction toolSourceRegistry(): Map<string, string> {\n const host = globalThis as RegistryHost;\n const existing = host[TOOL_SOURCE_REGISTRY_KEY];\n if (existing) return existing;\n const registry = new Map<string, string>();\n host[TOOL_SOURCE_REGISTRY_KEY] = registry;\n return registry;\n}\n\nfunction boundValue(target: object, property: PropertyKey): unknown {\n const value = Reflect.get(target, property, target);\n return typeof value === 'function' ? value.bind(target) : value;\n}\n\n/**\n * Gives one composed extension a Pi API that remembers which tools it registers.\n *\n * Pi attributes every factory inside a compiled Doom bundle to the outer bundle.\n * The compiler still knows each original entry path, so it calls factories through\n * this boundary and preserves that identity before the information is lost.\n */\nexport function withExtensionSource(pi: ExtensionAPI, entryPath: string): ExtensionAPI {\n return new Proxy(pi, {\n get(target, property) {\n if (property !== 'registerTool') return boundValue(target, property);\n return (tool: RegisteredTool): void => {\n target.registerTool(tool);\n toolSourceRegistry().set(tool.name, entryPath);\n };\n },\n });\n}\n\n/** Original extension entry that registered a tool inside a composed bundle. */\nexport function extensionToolSource(toolName: string): string | undefined {\n return toolSourceRegistry().get(toolName);\n}\n\nfunction packageName(directory: string): string | undefined {\n let current = directory;\n for (;;) {\n try {\n const manifest = JSON.parse(fs.readFileSync(path.join(current, 'package.json'), 'utf8')) as { name?: unknown };\n if (typeof manifest.name === 'string' && manifest.name.length > 0) return manifest.name;\n } catch {\n // No manifest here, or an unreadable one; keep walking up.\n }\n const parent = path.dirname(current);\n if (parent === current) return undefined;\n current = parent;\n }\n}\n\nexport function extensionName(entryPath: string): string {\n const cached = cache.get(entryPath);\n if (cached !== undefined) return cached;\n const name = packageName(path.dirname(entryPath));\n // `@agimon-ai/doompi-task` reads as `doom-task`; the scope is noise in a tree.\n const resolved = name ? (name.split('/').pop() ?? name) : path.basename(entryPath, path.extname(entryPath));\n cache.set(entryPath, resolved);\n return resolved;\n}\n"],"mappings":"gDAcA,MAAM,EAAQ,IAAI,IACZ,EAA2B,iCAMjC,SAAS,GAA0C,CACjD,IAAM,EAAO,WACP,EAAW,EAAK,GACtB,GAAI,EAAU,OAAO,EACrB,IAAM,EAAW,IAAI,IAErB,MADA,GAAK,GAA4B,EAC1B,CACT,CAEA,SAAS,EAAW,EAAgB,EAAgC,CAClE,IAAM,EAAQ,QAAQ,IAAI,EAAQ,EAAU,CAAM,EAClD,OAAO,OAAO,GAAU,WAAa,EAAM,KAAK,CAAM,EAAI,CAC5D,CASA,SAAgB,EAAoB,EAAkB,EAAiC,CACrF,OAAO,IAAI,MAAM,EAAI,CACnB,IAAI,EAAQ,EAAU,CAEpB,OADI,IAAa,eACT,GAA+B,CACrC,EAAO,aAAa,CAAI,EACxB,EAAmB,CAAC,CAAC,IAAI,EAAK,KAAM,CAAS,CAC/C,EAJwC,EAAW,EAAQ,CAAQ,CAKrE,CACF,CAAC,CACH,CAGA,SAAgB,EAAoB,EAAsC,CACxE,OAAO,EAAmB,CAAC,CAAC,IAAI,CAAQ,CAC1C,CAEA,SAAS,EAAY,EAAuC,CAC1D,IAAI,EAAU,EACd,OAAS,CACP,GAAI,CACF,IAAM,EAAW,KAAK,MAAM,EAAG,aAAa,EAAK,KAAK,EAAS,cAAc,EAAG,MAAM,CAAC,EACvF,GAAI,OAAO,EAAS,MAAS,UAAY,EAAS,KAAK,OAAS,EAAG,OAAO,EAAS,IACrF,MAAQ,CAER,CACA,IAAM,EAAS,EAAK,QAAQ,CAAO,EACnC,GAAI,IAAW,EAAS,OACxB,EAAU,CACZ,CACF,CAEA,SAAgB,EAAc,EAA2B,CACvD,IAAM,EAAS,EAAM,IAAI,CAAS,EAClC,GAAI,IAAW,IAAA,GAAW,OAAO,EACjC,IAAM,EAAO,EAAY,EAAK,QAAQ,CAAS,CAAC,EAE1C,EAAW,EAAQ,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAK,EAAQ,EAAK,SAAS,EAAW,EAAK,QAAQ,CAAS,CAAC,EAE1G,OADA,EAAM,IAAI,EAAW,CAAQ,EACtB,CACT"}
|
package/dist/toolInventory.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./extensionName.cjs"),t=`core`,n={core:`core`,mcp:`mcp`,extension:`
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./extensionName.cjs"),t=`core`,n={core:`core`,mcp:`mcp`,extension:`extension`},r={core:0,mcp:1,extension:2};function i(e){return e.state===`connected`?void 0:e.state.replace(/-/g,` `)}function a(e,t){return{name:e.name,...e.description?{description:e.description}:{},...e.parameters===void 0?{}:{parameters:e.parameters},...e.promptGuidelines?.length?{promptGuidelines:e.promptGuidelines}:{},active:t.has(e.name)}}function o(e,t){return e.name.localeCompare(t.name)}function s(e,t){return`${e} · ${n[t]}`}function c(e){let t=new Map;for(let n of e)for(let e of n.tools)t.set(e,n);return t}function l(n){let l=new Set(n.activeTools),u=n.mcpServers??[],d=c(u),f=[],p=new Map,m=new Map;for(let t of n.tools){let n=a(t,l),r=d.get(t.name);if(r){let e=p.get(r.name);e?e.push(n):p.set(r.name,[n]);continue}if(t.sourceInfo.source===`builtin`){f.push(n);continue}let i=e.extensionToolSource(t.name),o=i??t.sourceInfo.path,c=m.get(o);if(c)c.tools.push(n);else{let r=i!==void 0||t.sourceInfo.source===`cli`||t.sourceInfo.source===`local`||!t.sourceInfo.source?e.extensionName(o):t.sourceInfo.source;m.set(o,{label:s(r,`extension`),detail:o,tools:[n]})}}let h=[];f.length>0&&h.push({key:t,label:s(`pi`,t),kind:t,tools:f.sort(o)});for(let e of u){let t=p.get(e.name)??[],n=i(e);h.push({key:`mcp:${e.name}`,label:s(e.name,`mcp`),kind:`mcp`,...n?{status:n}:{},tools:t.sort(o)})}for(let[e,t]of m)h.push({key:e,label:t.label,kind:`extension`,detail:t.detail,tools:t.tools.sort(o)});return h.sort((e,t)=>r[e.kind]-r[t.kind]||e.label.localeCompare(t.label))}exports.buildToolSources=l;
|
|
2
2
|
//# sourceMappingURL=toolInventory.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolInventory.cjs","names":["extensionName"],"sources":["../src/toolInventory.ts"],"sourcesContent":["import type { McpServerSnapshot } from '@agimon-ai/doompi-extension-contracts/mcp-status';\nimport type { ToolInfo } from '@earendil-works/pi-coding-agent';\nimport { extensionName } from './extensionName.ts';\n\nexport type ToolSourceKind = 'core' | 'mcp' | 'extension';\n\nexport interface ToolEntry {\n name: string;\n description?: string;\n parameters?: unknown;\n promptGuidelines?: readonly string[];\n active: boolean;\n}\n\nexport interface ToolSource {\n key: string;\n label: string;\n kind: ToolSourceKind;\n /** Server state for MCP sources, e.g. `disabled`; absent for core and extensions. */\n status?: string;\n /** The registering file for extension sources. */\n detail?: string;\n tools: readonly ToolEntry[];\n}\n\n/** One server row of the MCP status snapshot. */\nexport type McpServerStatus = McpServerSnapshot;\n\nexport interface ToolInventoryInput {\n tools: readonly ToolInfo[];\n activeTools: readonly string[];\n /** Absent when the MCP adapter is not loaded or has not published yet. */\n mcpServers?: readonly McpServerStatus[];\n}\n\n/** Pi tags its own tools with this source; everything else came from an extension. */\nconst BUILTIN_SOURCE = 'builtin';\n/** Pi's
|
|
1
|
+
{"version":3,"file":"toolInventory.cjs","names":["extensionToolSource","extensionName"],"sources":["../src/toolInventory.ts"],"sourcesContent":["import type { McpServerSnapshot } from '@agimon-ai/doompi-extension-contracts/mcp-status';\nimport type { ToolInfo } from '@earendil-works/pi-coding-agent';\nimport { extensionName, extensionToolSource } from './extensionName.ts';\n\nexport type ToolSourceKind = 'core' | 'mcp' | 'extension';\n\nexport interface ToolEntry {\n name: string;\n description?: string;\n parameters?: unknown;\n promptGuidelines?: readonly string[];\n active: boolean;\n}\n\nexport interface ToolSource {\n key: string;\n label: string;\n kind: ToolSourceKind;\n /** Server state for MCP sources, e.g. `disabled`; absent for core and extensions. */\n status?: string;\n /** The registering file for extension sources. */\n detail?: string;\n tools: readonly ToolEntry[];\n}\n\n/** One server row of the MCP status snapshot. */\nexport type McpServerStatus = McpServerSnapshot;\n\nexport interface ToolInventoryInput {\n tools: readonly ToolInfo[];\n activeTools: readonly string[];\n /** Absent when the MCP adapter is not loaded or has not published yet. */\n mcpServers?: readonly McpServerStatus[];\n}\n\n/** Pi tags its own tools with this source; everything else came from an extension. */\nconst BUILTIN_SOURCE = 'builtin';\n/** Pi's structural tags for an extension path, neither of which is a package name. */\nconst CLI_SOURCE = 'cli';\nconst LOCAL_SOURCE = 'local';\nconst CORE_KEY = 'core';\nconst CORE_NAME = 'pi';\nconst MCP_KEY_PREFIX = 'mcp:';\n/** Labels read name first, then kind, because the name is what the eye scans for. */\nconst KIND_SUFFIX: Record<ToolSourceKind, string> = { core: 'core', mcp: 'mcp', extension: 'extension' };\nconst CONNECTED_STATUS = 'connected';\nconst KIND_ORDER: Record<ToolSourceKind, number> = { core: 0, mcp: 1, extension: 2 };\n\n/**\n * Server state worth reporting, which takes the place of the tool count.\n *\n * A connected server is the unremarkable case, so it keeps its count rather\n * than spending the column on a word that says nothing went wrong.\n */\nfunction displayStatus(server: McpServerStatus): string | undefined {\n return server.state === CONNECTED_STATUS ? undefined : server.state.replace(/-/g, ' ');\n}\n\nfunction toEntry(tool: ToolInfo, activeTools: ReadonlySet<string>): ToolEntry {\n return {\n name: tool.name,\n ...(tool.description ? { description: tool.description } : {}),\n ...(tool.parameters === undefined ? {} : { parameters: tool.parameters }),\n ...(tool.promptGuidelines?.length ? { promptGuidelines: tool.promptGuidelines } : {}),\n active: activeTools.has(tool.name),\n };\n}\n\nfunction byName(left: ToolEntry, right: ToolEntry): number {\n return left.name.localeCompare(right.name);\n}\n\nfunction sourceLabel(name: string, kind: ToolSourceKind): string {\n return `${name} · ${KIND_SUFFIX[kind]}`;\n}\n\n/**\n * Indexes each server's declared tool names.\n *\n * The snapshot names its tools outright, so attribution is a lookup rather than a\n * guess at the naming scheme. A tool the snapshot does not claim falls through to\n * the extension that registered it.\n */\nfunction serverByTool(servers: readonly McpServerStatus[]): Map<string, McpServerStatus> {\n const index = new Map<string, McpServerStatus>();\n for (const server of servers) {\n for (const toolName of server.tools) index.set(toolName, server);\n }\n return index;\n}\n\n/**\n * Groups the session's tools by where they came from: Pi itself, one group per\n * MCP server, then one per extension that registered a tool.\n *\n * Every MCP tool is registered by one extension, so `sourceInfo` cannot separate\n * servers; the status snapshot supplies the tool-to-server mapping instead.\n */\nexport function buildToolSources(input: ToolInventoryInput): readonly ToolSource[] {\n const activeTools = new Set(input.activeTools);\n const servers = input.mcpServers ?? [];\n const owningServer = serverByTool(servers);\n const core: ToolEntry[] = [];\n const mcpTools = new Map<string, ToolEntry[]>();\n const extensions = new Map<string, { label: string; detail: string; tools: ToolEntry[] }>();\n\n for (const tool of input.tools) {\n const entry = toEntry(tool, activeTools);\n const server = owningServer.get(tool.name);\n if (server) {\n const bucket = mcpTools.get(server.name);\n if (bucket) bucket.push(entry);\n else mcpTools.set(server.name, [entry]);\n continue;\n }\n if (tool.sourceInfo.source === BUILTIN_SOURCE) {\n core.push(entry);\n continue;\n }\n // A composed bundle has one Pi source path for every factory inside it. Doom's\n // compiler records the original entry at registration time so those extensions\n // remain separate here even though Pi can only see the outer bundle.\n const recordedPath = extensionToolSource(tool.name);\n const key = recordedPath ?? tool.sourceInfo.path;\n const group = extensions.get(key);\n if (group) group.tools.push(entry);\n else {\n const structuralSource =\n recordedPath !== undefined ||\n tool.sourceInfo.source === CLI_SOURCE ||\n tool.sourceInfo.source === LOCAL_SOURCE ||\n !tool.sourceInfo.source;\n const name = structuralSource ? extensionName(key) : tool.sourceInfo.source;\n extensions.set(key, { label: sourceLabel(name, 'extension'), detail: key, tools: [entry] });\n }\n }\n\n const sources: ToolSource[] = [];\n if (core.length > 0) {\n sources.push({ key: CORE_KEY, label: sourceLabel(CORE_NAME, CORE_KEY), kind: CORE_KEY, tools: core.sort(byName) });\n }\n for (const server of servers) {\n const tools = mcpTools.get(server.name) ?? [];\n const status = displayStatus(server);\n // Every configured server is listed, including one with no tools: attribution\n // is exact now, so an empty list is a fact about the server rather than a\n // failure to recognise its tool names.\n sources.push({\n key: `${MCP_KEY_PREFIX}${server.name}`,\n label: sourceLabel(server.name, 'mcp'),\n kind: 'mcp',\n ...(status ? { status } : {}),\n tools: tools.sort(byName),\n });\n }\n for (const [key, group] of extensions) {\n sources.push({\n key,\n label: group.label,\n kind: 'extension',\n detail: group.detail,\n tools: group.tools.sort(byName),\n });\n }\n\n return sources.sort(\n (left, right) => KIND_ORDER[left.kind] - KIND_ORDER[right.kind] || left.label.localeCompare(right.label),\n );\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolInventory.d.cts","names":[],"sources":["../src/toolInventory.ts"],"mappings":";;;KAIY;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA;EACA,gBAAgB;;;KAIN,kBAAkB;UAEb;EACf,gBAAgB;EAChB;;EAEA,sBAAsB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolInventory.d.cts","names":[],"sources":["../src/toolInventory.ts"],"mappings":";;;KAIY;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA;EACA,gBAAgB;;;KAIN,kBAAkB;UAEb;EACf,gBAAgB;EAChB;;EAEA,sBAAsB;;;;;;;;;iBAkER,iBAAiB,OAAO,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolInventory.d.mts","names":[],"sources":["../src/toolInventory.ts"],"mappings":";;;KAIY;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA;EACA,gBAAgB;;;KAIN,kBAAkB;UAEb;EACf,gBAAgB;EAChB;;EAEA,sBAAsB;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"toolInventory.d.mts","names":[],"sources":["../src/toolInventory.ts"],"mappings":";;;KAIY;UAEK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;;EAEA;EACA,gBAAgB;;;KAIN,kBAAkB;UAEb;EACf,gBAAgB;EAChB;;EAEA,sBAAsB;;;;;;;;;iBAkER,iBAAiB,OAAO,8BAA8B"}
|
package/dist/toolInventory.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{extensionName as e}from"./extensionName.mjs";const
|
|
1
|
+
import{extensionName as e,extensionToolSource as t}from"./extensionName.mjs";const n=`core`,r={core:`core`,mcp:`mcp`,extension:`extension`},i={core:0,mcp:1,extension:2};function a(e){return e.state===`connected`?void 0:e.state.replace(/-/g,` `)}function o(e,t){return{name:e.name,...e.description?{description:e.description}:{},...e.parameters===void 0?{}:{parameters:e.parameters},...e.promptGuidelines?.length?{promptGuidelines:e.promptGuidelines}:{},active:t.has(e.name)}}function s(e,t){return e.name.localeCompare(t.name)}function c(e,t){return`${e} · ${r[t]}`}function l(e){let t=new Map;for(let n of e)for(let e of n.tools)t.set(e,n);return t}function u(r){let u=new Set(r.activeTools),d=r.mcpServers??[],f=l(d),p=[],m=new Map,h=new Map;for(let n of r.tools){let r=o(n,u),i=f.get(n.name);if(i){let e=m.get(i.name);e?e.push(r):m.set(i.name,[r]);continue}if(n.sourceInfo.source===`builtin`){p.push(r);continue}let a=t(n.name),s=a??n.sourceInfo.path,l=h.get(s);if(l)l.tools.push(r);else{let t=a!==void 0||n.sourceInfo.source===`cli`||n.sourceInfo.source===`local`||!n.sourceInfo.source?e(s):n.sourceInfo.source;h.set(s,{label:c(t,`extension`),detail:s,tools:[r]})}}let g=[];p.length>0&&g.push({key:n,label:c(`pi`,n),kind:n,tools:p.sort(s)});for(let e of d){let t=m.get(e.name)??[],n=a(e);g.push({key:`mcp:${e.name}`,label:c(e.name,`mcp`),kind:`mcp`,...n?{status:n}:{},tools:t.sort(s)})}for(let[e,t]of h)g.push({key:e,label:t.label,kind:`extension`,detail:t.detail,tools:t.tools.sort(s)});return g.sort((e,t)=>i[e.kind]-i[t.kind]||e.label.localeCompare(t.label))}export{u as buildToolSources};
|
|
2
2
|
//# sourceMappingURL=toolInventory.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolInventory.mjs","names":[],"sources":["../src/toolInventory.ts"],"sourcesContent":["import type { McpServerSnapshot } from '@agimon-ai/doompi-extension-contracts/mcp-status';\nimport type { ToolInfo } from '@earendil-works/pi-coding-agent';\nimport { extensionName } from './extensionName.ts';\n\nexport type ToolSourceKind = 'core' | 'mcp' | 'extension';\n\nexport interface ToolEntry {\n name: string;\n description?: string;\n parameters?: unknown;\n promptGuidelines?: readonly string[];\n active: boolean;\n}\n\nexport interface ToolSource {\n key: string;\n label: string;\n kind: ToolSourceKind;\n /** Server state for MCP sources, e.g. `disabled`; absent for core and extensions. */\n status?: string;\n /** The registering file for extension sources. */\n detail?: string;\n tools: readonly ToolEntry[];\n}\n\n/** One server row of the MCP status snapshot. */\nexport type McpServerStatus = McpServerSnapshot;\n\nexport interface ToolInventoryInput {\n tools: readonly ToolInfo[];\n activeTools: readonly string[];\n /** Absent when the MCP adapter is not loaded or has not published yet. */\n mcpServers?: readonly McpServerStatus[];\n}\n\n/** Pi tags its own tools with this source; everything else came from an extension. */\nconst BUILTIN_SOURCE = 'builtin';\n/** Pi's
|
|
1
|
+
{"version":3,"file":"toolInventory.mjs","names":[],"sources":["../src/toolInventory.ts"],"sourcesContent":["import type { McpServerSnapshot } from '@agimon-ai/doompi-extension-contracts/mcp-status';\nimport type { ToolInfo } from '@earendil-works/pi-coding-agent';\nimport { extensionName, extensionToolSource } from './extensionName.ts';\n\nexport type ToolSourceKind = 'core' | 'mcp' | 'extension';\n\nexport interface ToolEntry {\n name: string;\n description?: string;\n parameters?: unknown;\n promptGuidelines?: readonly string[];\n active: boolean;\n}\n\nexport interface ToolSource {\n key: string;\n label: string;\n kind: ToolSourceKind;\n /** Server state for MCP sources, e.g. `disabled`; absent for core and extensions. */\n status?: string;\n /** The registering file for extension sources. */\n detail?: string;\n tools: readonly ToolEntry[];\n}\n\n/** One server row of the MCP status snapshot. */\nexport type McpServerStatus = McpServerSnapshot;\n\nexport interface ToolInventoryInput {\n tools: readonly ToolInfo[];\n activeTools: readonly string[];\n /** Absent when the MCP adapter is not loaded or has not published yet. */\n mcpServers?: readonly McpServerStatus[];\n}\n\n/** Pi tags its own tools with this source; everything else came from an extension. */\nconst BUILTIN_SOURCE = 'builtin';\n/** Pi's structural tags for an extension path, neither of which is a package name. */\nconst CLI_SOURCE = 'cli';\nconst LOCAL_SOURCE = 'local';\nconst CORE_KEY = 'core';\nconst CORE_NAME = 'pi';\nconst MCP_KEY_PREFIX = 'mcp:';\n/** Labels read name first, then kind, because the name is what the eye scans for. */\nconst KIND_SUFFIX: Record<ToolSourceKind, string> = { core: 'core', mcp: 'mcp', extension: 'extension' };\nconst CONNECTED_STATUS = 'connected';\nconst KIND_ORDER: Record<ToolSourceKind, number> = { core: 0, mcp: 1, extension: 2 };\n\n/**\n * Server state worth reporting, which takes the place of the tool count.\n *\n * A connected server is the unremarkable case, so it keeps its count rather\n * than spending the column on a word that says nothing went wrong.\n */\nfunction displayStatus(server: McpServerStatus): string | undefined {\n return server.state === CONNECTED_STATUS ? undefined : server.state.replace(/-/g, ' ');\n}\n\nfunction toEntry(tool: ToolInfo, activeTools: ReadonlySet<string>): ToolEntry {\n return {\n name: tool.name,\n ...(tool.description ? { description: tool.description } : {}),\n ...(tool.parameters === undefined ? {} : { parameters: tool.parameters }),\n ...(tool.promptGuidelines?.length ? { promptGuidelines: tool.promptGuidelines } : {}),\n active: activeTools.has(tool.name),\n };\n}\n\nfunction byName(left: ToolEntry, right: ToolEntry): number {\n return left.name.localeCompare(right.name);\n}\n\nfunction sourceLabel(name: string, kind: ToolSourceKind): string {\n return `${name} · ${KIND_SUFFIX[kind]}`;\n}\n\n/**\n * Indexes each server's declared tool names.\n *\n * The snapshot names its tools outright, so attribution is a lookup rather than a\n * guess at the naming scheme. A tool the snapshot does not claim falls through to\n * the extension that registered it.\n */\nfunction serverByTool(servers: readonly McpServerStatus[]): Map<string, McpServerStatus> {\n const index = new Map<string, McpServerStatus>();\n for (const server of servers) {\n for (const toolName of server.tools) index.set(toolName, server);\n }\n return index;\n}\n\n/**\n * Groups the session's tools by where they came from: Pi itself, one group per\n * MCP server, then one per extension that registered a tool.\n *\n * Every MCP tool is registered by one extension, so `sourceInfo` cannot separate\n * servers; the status snapshot supplies the tool-to-server mapping instead.\n */\nexport function buildToolSources(input: ToolInventoryInput): readonly ToolSource[] {\n const activeTools = new Set(input.activeTools);\n const servers = input.mcpServers ?? [];\n const owningServer = serverByTool(servers);\n const core: ToolEntry[] = [];\n const mcpTools = new Map<string, ToolEntry[]>();\n const extensions = new Map<string, { label: string; detail: string; tools: ToolEntry[] }>();\n\n for (const tool of input.tools) {\n const entry = toEntry(tool, activeTools);\n const server = owningServer.get(tool.name);\n if (server) {\n const bucket = mcpTools.get(server.name);\n if (bucket) bucket.push(entry);\n else mcpTools.set(server.name, [entry]);\n continue;\n }\n if (tool.sourceInfo.source === BUILTIN_SOURCE) {\n core.push(entry);\n continue;\n }\n // A composed bundle has one Pi source path for every factory inside it. Doom's\n // compiler records the original entry at registration time so those extensions\n // remain separate here even though Pi can only see the outer bundle.\n const recordedPath = extensionToolSource(tool.name);\n const key = recordedPath ?? tool.sourceInfo.path;\n const group = extensions.get(key);\n if (group) group.tools.push(entry);\n else {\n const structuralSource =\n recordedPath !== undefined ||\n tool.sourceInfo.source === CLI_SOURCE ||\n tool.sourceInfo.source === LOCAL_SOURCE ||\n !tool.sourceInfo.source;\n const name = structuralSource ? extensionName(key) : tool.sourceInfo.source;\n extensions.set(key, { label: sourceLabel(name, 'extension'), detail: key, tools: [entry] });\n }\n }\n\n const sources: ToolSource[] = [];\n if (core.length > 0) {\n sources.push({ key: CORE_KEY, label: sourceLabel(CORE_NAME, CORE_KEY), kind: CORE_KEY, tools: core.sort(byName) });\n }\n for (const server of servers) {\n const tools = mcpTools.get(server.name) ?? [];\n const status = displayStatus(server);\n // Every configured server is listed, including one with no tools: attribution\n // is exact now, so an empty list is a fact about the server rather than a\n // failure to recognise its tool names.\n sources.push({\n key: `${MCP_KEY_PREFIX}${server.name}`,\n label: sourceLabel(server.name, 'mcp'),\n kind: 'mcp',\n ...(status ? { status } : {}),\n tools: tools.sort(byName),\n });\n }\n for (const [key, group] of extensions) {\n sources.push({\n key,\n label: group.label,\n kind: 'extension',\n detail: group.detail,\n tools: group.tools.sort(byName),\n });\n }\n\n return sources.sort(\n (left, right) => KIND_ORDER[left.kind] - KIND_ORDER[right.kind] || left.label.localeCompare(right.label),\n );\n}\n"],"mappings":"6EAoCA,MAIM,EAAW,OAIX,EAA8C,CAAE,KAAM,OAAQ,IAAK,MAAO,UAAW,WAAY,EAEjG,EAA6C,CAAE,KAAM,EAAG,IAAK,EAAG,UAAW,CAAE,EAQnF,SAAS,EAAc,EAA6C,CAClE,OAAO,EAAO,QAAU,YAAmB,IAAA,GAAY,EAAO,MAAM,QAAQ,KAAM,GAAG,CACvF,CAEA,SAAS,EAAQ,EAAgB,EAA6C,CAC5E,MAAO,CACL,KAAM,EAAK,KACX,GAAI,EAAK,YAAc,CAAE,YAAa,EAAK,WAAY,EAAI,CAAC,EAC5D,GAAI,EAAK,aAAe,IAAA,GAAY,CAAC,EAAI,CAAE,WAAY,EAAK,UAAW,EACvE,GAAI,EAAK,kBAAkB,OAAS,CAAE,iBAAkB,EAAK,gBAAiB,EAAI,CAAC,EACnF,OAAQ,EAAY,IAAI,EAAK,IAAI,CACnC,CACF,CAEA,SAAS,EAAO,EAAiB,EAA0B,CACzD,OAAO,EAAK,KAAK,cAAc,EAAM,IAAI,CAC3C,CAEA,SAAS,EAAY,EAAc,EAA8B,CAC/D,MAAO,GAAG,EAAK,KAAK,EAAY,IAClC,CASA,SAAS,EAAa,EAAmE,CACvF,IAAM,EAAQ,IAAI,IAClB,IAAK,IAAM,KAAU,EACnB,IAAK,IAAM,KAAY,EAAO,MAAO,EAAM,IAAI,EAAU,CAAM,EAEjE,OAAO,CACT,CASA,SAAgB,EAAiB,EAAkD,CACjF,IAAM,EAAc,IAAI,IAAI,EAAM,WAAW,EACvC,EAAU,EAAM,YAAc,CAAC,EAC/B,EAAe,EAAa,CAAO,EACnC,EAAoB,CAAC,EACrB,EAAW,IAAI,IACf,EAAa,IAAI,IAEvB,IAAK,IAAM,KAAQ,EAAM,MAAO,CAC9B,IAAM,EAAQ,EAAQ,EAAM,CAAW,EACjC,EAAS,EAAa,IAAI,EAAK,IAAI,EACzC,GAAI,EAAQ,CACV,IAAM,EAAS,EAAS,IAAI,EAAO,IAAI,EACnC,EAAQ,EAAO,KAAK,CAAK,EACxB,EAAS,IAAI,EAAO,KAAM,CAAC,CAAK,CAAC,EACtC,QACF,CACA,GAAI,EAAK,WAAW,SAAW,UAAgB,CAC7C,EAAK,KAAK,CAAK,EACf,QACF,CAIA,IAAM,EAAe,EAAoB,EAAK,IAAI,EAC5C,EAAM,GAAgB,EAAK,WAAW,KACtC,EAAQ,EAAW,IAAI,CAAG,EAChC,GAAI,EAAO,EAAM,MAAM,KAAK,CAAK,MAC5B,CAMH,IAAM,EAJJ,IAAiB,IAAA,IACjB,EAAK,WAAW,SAAW,OAC3B,EAAK,WAAW,SAAW,SAC3B,CAAC,EAAK,WAAW,OACa,EAAc,CAAG,EAAI,EAAK,WAAW,OACrE,EAAW,IAAI,EAAK,CAAE,MAAO,EAAY,EAAM,WAAW,EAAG,OAAQ,EAAK,MAAO,CAAC,CAAK,CAAE,CAAC,CAC5F,CACF,CAEA,IAAM,EAAwB,CAAC,EAC3B,EAAK,OAAS,GAChB,EAAQ,KAAK,CAAE,IAAK,EAAU,MAAO,EAAY,KAAW,CAAQ,EAAG,KAAM,EAAU,MAAO,EAAK,KAAK,CAAM,CAAE,CAAC,EAEnH,IAAK,IAAM,KAAU,EAAS,CAC5B,IAAM,EAAQ,EAAS,IAAI,EAAO,IAAI,GAAK,CAAC,EACtC,EAAS,EAAc,CAAM,EAInC,EAAQ,KAAK,CACX,IAAK,OAAoB,EAAO,OAChC,MAAO,EAAY,EAAO,KAAM,KAAK,EACrC,KAAM,MACN,GAAI,EAAS,CAAE,QAAO,EAAI,CAAC,EAC3B,MAAO,EAAM,KAAK,CAAM,CAC1B,CAAC,CACH,CACA,IAAK,GAAM,CAAC,EAAK,KAAU,EACzB,EAAQ,KAAK,CACX,MACA,MAAO,EAAM,MACb,KAAM,YACN,OAAQ,EAAM,OACd,MAAO,EAAM,MAAM,KAAK,CAAM,CAChC,CAAC,EAGH,OAAO,EAAQ,MACZ,EAAM,IAAU,EAAW,EAAK,MAAQ,EAAW,EAAM,OAAS,EAAK,MAAM,cAAc,EAAM,KAAK,CACzG,CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/doompi-ui",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.4",
|
|
4
4
|
"description": "Doom-inspired interactive UI extension for Pi",
|
|
5
5
|
"homepage": "https://agimon.ai",
|
|
6
6
|
"license": "MIT",
|
|
@@ -137,8 +137,8 @@
|
|
|
137
137
|
},
|
|
138
138
|
"dependencies": {
|
|
139
139
|
"yaml": "2.9.0",
|
|
140
|
-
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.
|
|
141
|
-
"@agimon-ai/doompi-telemetry": "0.0.1-alpha.
|
|
140
|
+
"@agimon-ai/doompi-extension-contracts": "0.0.1-alpha.4",
|
|
141
|
+
"@agimon-ai/doompi-telemetry": "0.0.1-alpha.4"
|
|
142
142
|
},
|
|
143
143
|
"devDependencies": {
|
|
144
144
|
"@earendil-works/pi-coding-agent": "0.84.1",
|