@geminixiang/mikan 1.0.0-beta.63 → 1.0.0-beta.64
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/CHANGELOG.md +10 -0
- package/dist/adapters/web/admin/portal.d.ts.map +1 -1
- package/dist/adapters/web/admin/portal.js +0 -2
- package/dist/adapters/web/admin/portal.js.map +1 -1
- package/dist/cli/boot.js +1 -1
- package/dist/cli/boot.js.map +1 -1
- package/dist/cli/office.d.ts.map +1 -1
- package/dist/cli/office.js +33 -1
- package/dist/cli/office.js.map +1 -1
- package/dist/config.d.ts +18 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +81 -20
- package/dist/config.js.map +1 -1
- package/dist/office/projection.d.ts.map +1 -1
- package/dist/office/projection.js +1 -8
- package/dist/office/projection.js.map +1 -1
- package/dist/office/types.d.ts +0 -6
- package/dist/office/types.d.ts.map +1 -1
- package/dist/office/types.js.map +1 -1
- package/dist/types.d.ts +0 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../src/office/projection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAe,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AAMjC,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC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yB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,wCAAwC,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,KAAa;IAClD,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,yBAAyB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,6CAA6C,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { lstatSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { atomicWritePrivateFile, ensureDirExists } from \"../file-guards.js\";\nimport { loadLegacyFullOverride, loadOfficeVisibilityOverride } from \"../config.js\";\nimport { listRegisteredOffices, type Office } from \"./index.js\";\nimport * as log from \"../log.js\";\nimport type { ContainerMount, WorkspaceVisibility } from \"../types.js\";\nimport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nexport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nconst CHANNEL_KIND_FILE = \"channel-kind\";\nconst reportedLegacyFull = new Set<string>();\nconst CHANNEL_KINDS: readonly PlatformChannelKind[] = [\n \"public_channel\",\n \"private_channel\",\n \"im\",\n \"external\",\n];\n\n/**\n * Record the platform's own channel kind for this conversation, as observed\n * by the adapter at message intake. Stored under the host-only office state\n * dir (never the sandbox-mounted workspace), so sandboxed code cannot\n * promote its own conversation into the shared pool. Written only on change;\n * the value is a snapshot as of the last message, which is exactly the\n * freshness the projection needs — a conversation that never speaks again\n * never needs a fresher value.\n */\nexport function recordPlatformChannelKind(office: Office, kind: PlatformChannelKind): void {\n if (readPlatformChannelKind(office) === kind) return;\n ensureDirExists(office.stateDir);\n atomicWritePrivateFile(join(office.stateDir, CHANNEL_KIND_FILE), kind + \"\\n\");\n}\n\n/** The recorded platform channel kind, or undefined when never observed. */\nexport function readPlatformChannelKind(office: Office): PlatformChannelKind | undefined {\n const path = join(office.stateDir, CHANNEL_KIND_FILE);\n let raw: string;\n try {\n raw = readFileSync(path, \"utf-8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n log.logWarning(\n \"Could not read platform channel kind; treating the office as private\",\n `${path}: ${err instanceof Error ? err.message : String(err)}`,\n );\n return undefined;\n }\n const value = raw.trim();\n return (CHANNEL_KINDS as readonly string[]).includes(value)\n ? (value as PlatformChannelKind)\n : undefined;\n}\n\n/** Where an office's visibility came from; shown to operators instead of raw values. */\nexport interface OfficeVisibilityDecision {\n visibility: WorkspaceVisibility;\n source: \"platform\" | \"override\" | \"unknown\";\n}\n\n/**\n * One dimension, derived from the platform (ADR 0008): public channels are\n * public; private channels, DMs, group DMs, and externally shared\n * conversations are private; an unknown kind fails closed to private. An\n * operator may narrow a public conversation to private, never the reverse.\n * Legacy door-policy settings are not consulted.\n */\nexport function resolveOfficeVisibility(office: Office): OfficeVisibilityDecision {\n if (loadOfficeVisibilityOverride(office) === \"private\") {\n return { visibility: \"private\", source: \"override\" };\n }\n const kind = readPlatformChannelKind(office);\n if (kind === undefined) return { visibility: \"private\", source: \"unknown\" };\n return { visibility: kind === \"public_channel\" ? \"public\" : \"private\", source: \"platform\" };\n}\n\n/**\n * Every public office other than `self`, as read-only mounts under\n * `/workspace/public/<key>`. Bind mounts rather than a symlink directory:\n * symlinks would resolve against the container's own filesystem, where host\n * paths do not exist. A public channel appearing or changing visibility\n * changes the mount signature, so affected containers rebuild on their next\n * message with contents preserved.\n */\nfunction publicOfficeMounts(self: Office): ContainerMount[] {\n const { workspace } = self;\n const mounts: ContainerMount[] = [];\n for (const record of listRegisteredOffices(workspace.stateDir)) {\n const other = workspace.office(record);\n if (other.key === self.key || !exists(other.dir)) continue;\n if (resolveOfficeVisibility(other).visibility !== \"public\") continue;\n mounts.push({ source: other.dir, target: `/workspace/public/${other.key}`, readOnly: true });\n }\n return mounts.toSorted((a, b) => a.target.localeCompare(b.target));\n}\n\n/**\n * The single policy seam for a managed office. It both materializes the\n * host-side roots and authorizes the prompt sources that describe them.\n * Every office gets the same shape (ADR 0008): its own directory read-write,\n * every other public office read-only under /workspace/public, and the\n * workspace-global knowledge read-write for public offices or read-only for\n * private ones. No layout mounts the workspace root.\n */\nexport function resolveWorkspaceProjection(office: Office): WorkspaceProjection {\n const { workspace } = office;\n const decision = resolveOfficeVisibility(office);\n const readOnlyKnowledge = decision.visibility === \"private\";\n\n assertDirectory(workspace.root, \"Host workspace root\");\n office.ensure();\n ensureRegularFile(workspace.memoryPath, \"Workspace memory\");\n ensureDirectoryRoot(workspace.skillsDir, \"Workspace skills\");\n const ro = { readOnly: true as const };\n const legacyFull = loadLegacyFullOverride(office);\n if (legacyFull && !reportedLegacyFull.has(office.key)) {\n reportedLegacyFull.add(office.key);\n log.logWarning(\n `Office ${office.key} still declares the retired \"full\" door policy`,\n `visibility is now ${decision.visibility} (${decision.source}); other offices are reachable only through /workspace/public`,\n );\n }\n\n return {\n ...decision,\n legacyFull,\n mounts: [\n { source: office.dir, target: `/workspace/${office.key}` },\n {\n source: workspace.memoryPath,\n target: \"/workspace/MEMORY.md\",\n ...(readOnlyKnowledge ? ro : {}),\n },\n {\n source: workspace.skillsDir,\n target: \"/workspace/skills\",\n ...(readOnlyKnowledge ? ro : {}),\n },\n ...publicOfficeMounts(office),\n ],\n promptSources: {\n conversationDir: office.dir,\n conversationMemoryPath: office.memoryPath,\n conversationSkillsDir: office.skillsDir,\n globalMemoryPath: workspace.memoryPath,\n globalSkillsDir: workspace.skillsDir,\n ...(readOnlyKnowledge ? { globalKnowledgeReadOnly: true } : {}),\n },\n };\n}\n\nfunction ensureDirectoryRoot(path: string, label: string): void {\n if (!exists(path)) {\n mkdirSync(path, { recursive: true, mode: 0o700 });\n return;\n }\n assertDirectory(path, label);\n}\n\nfunction ensureRegularFile(path: string, label: string): void {\n if (!exists(path)) {\n ensureDirExists(dirname(path));\n writeFileSync(path, \"\", { mode: 0o600, flag: \"wx\" });\n return;\n }\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isFile()) {\n throw new Error(`${label} must be a regular non-symlink file: ${path}`);\n }\n}\n\nfunction assertDirectory(path: string, label: string): void {\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isDirectory()) {\n throw new Error(`${label} must be a regular non-symlink directory: ${path}`);\n }\n}\n\nfunction exists(path: string): boolean {\n try {\n lstatSync(path);\n return true;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return false;\n throw err;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"projection.js","sourceRoot":"","sources":["../../src/office/projection.ts"],"names":[],"mappings":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C,GAAG,KAAK,yBAAyB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,wCAAwC,IAAI,EAAE,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,IAAY,EAAE,KAAa;IAClD,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,yBAAyB,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,6CAA6C,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAK,GAA6B,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QACnE,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { lstatSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { atomicWritePrivateFile, ensureDirExists } from \"../file-guards.js\";\nimport { loadOfficeVisibilityOverride } from \"../config.js\";\nimport { listRegisteredOffices, type Office } from \"./index.js\";\nimport * as log from \"../log.js\";\nimport type { ContainerMount, WorkspaceVisibility } from \"../types.js\";\nimport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nexport type { PlatformChannelKind, WorkspaceProjection } from \"./types.js\";\n\nconst CHANNEL_KIND_FILE = \"channel-kind\";\nconst CHANNEL_KINDS: readonly PlatformChannelKind[] = [\n \"public_channel\",\n \"private_channel\",\n \"im\",\n \"external\",\n];\n\n/**\n * Record the platform's own channel kind for this conversation, as observed\n * by the adapter at message intake. Stored under the host-only office state\n * dir (never the sandbox-mounted workspace), so sandboxed code cannot\n * promote its own conversation into the shared pool. Written only on change;\n * the value is a snapshot as of the last message, which is exactly the\n * freshness the projection needs — a conversation that never speaks again\n * never needs a fresher value.\n */\nexport function recordPlatformChannelKind(office: Office, kind: PlatformChannelKind): void {\n if (readPlatformChannelKind(office) === kind) return;\n ensureDirExists(office.stateDir);\n atomicWritePrivateFile(join(office.stateDir, CHANNEL_KIND_FILE), kind + \"\\n\");\n}\n\n/** The recorded platform channel kind, or undefined when never observed. */\nexport function readPlatformChannelKind(office: Office): PlatformChannelKind | undefined {\n const path = join(office.stateDir, CHANNEL_KIND_FILE);\n let raw: string;\n try {\n raw = readFileSync(path, \"utf-8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return undefined;\n log.logWarning(\n \"Could not read platform channel kind; treating the office as private\",\n `${path}: ${err instanceof Error ? err.message : String(err)}`,\n );\n return undefined;\n }\n const value = raw.trim();\n return (CHANNEL_KINDS as readonly string[]).includes(value)\n ? (value as PlatformChannelKind)\n : undefined;\n}\n\n/** Where an office's visibility came from; shown to operators instead of raw values. */\nexport interface OfficeVisibilityDecision {\n visibility: WorkspaceVisibility;\n source: \"platform\" | \"override\" | \"unknown\";\n}\n\n/**\n * One dimension, derived from the platform (ADR 0008): public channels are\n * public; private channels, DMs, group DMs, and externally shared\n * conversations are private; an unknown kind fails closed to private. An\n * operator may narrow a public conversation to private, never the reverse.\n * Legacy door-policy settings are not consulted.\n */\nexport function resolveOfficeVisibility(office: Office): OfficeVisibilityDecision {\n if (loadOfficeVisibilityOverride(office) === \"private\") {\n return { visibility: \"private\", source: \"override\" };\n }\n const kind = readPlatformChannelKind(office);\n if (kind === undefined) return { visibility: \"private\", source: \"unknown\" };\n return { visibility: kind === \"public_channel\" ? \"public\" : \"private\", source: \"platform\" };\n}\n\n/**\n * Every public office other than `self`, as read-only mounts under\n * `/workspace/public/<key>`. Bind mounts rather than a symlink directory:\n * symlinks would resolve against the container's own filesystem, where host\n * paths do not exist. A public channel appearing or changing visibility\n * changes the mount signature, so affected containers rebuild on their next\n * message with contents preserved.\n */\nfunction publicOfficeMounts(self: Office): ContainerMount[] {\n const { workspace } = self;\n const mounts: ContainerMount[] = [];\n for (const record of listRegisteredOffices(workspace.stateDir)) {\n const other = workspace.office(record);\n if (other.key === self.key || !exists(other.dir)) continue;\n if (resolveOfficeVisibility(other).visibility !== \"public\") continue;\n mounts.push({ source: other.dir, target: `/workspace/public/${other.key}`, readOnly: true });\n }\n return mounts.toSorted((a, b) => a.target.localeCompare(b.target));\n}\n\n/**\n * The single policy seam for a managed office. It both materializes the\n * host-side roots and authorizes the prompt sources that describe them.\n * Every office gets the same shape (ADR 0008): its own directory read-write,\n * every other public office read-only under /workspace/public, and the\n * workspace-global knowledge read-write for public offices or read-only for\n * private ones. No layout mounts the workspace root.\n */\nexport function resolveWorkspaceProjection(office: Office): WorkspaceProjection {\n const { workspace } = office;\n const decision = resolveOfficeVisibility(office);\n const readOnlyKnowledge = decision.visibility === \"private\";\n\n assertDirectory(workspace.root, \"Host workspace root\");\n office.ensure();\n ensureRegularFile(workspace.memoryPath, \"Workspace memory\");\n ensureDirectoryRoot(workspace.skillsDir, \"Workspace skills\");\n const ro = { readOnly: true as const };\n return {\n ...decision,\n mounts: [\n { source: office.dir, target: `/workspace/${office.key}` },\n {\n source: workspace.memoryPath,\n target: \"/workspace/MEMORY.md\",\n ...(readOnlyKnowledge ? ro : {}),\n },\n {\n source: workspace.skillsDir,\n target: \"/workspace/skills\",\n ...(readOnlyKnowledge ? ro : {}),\n },\n ...publicOfficeMounts(office),\n ],\n promptSources: {\n conversationDir: office.dir,\n conversationMemoryPath: office.memoryPath,\n conversationSkillsDir: office.skillsDir,\n globalMemoryPath: workspace.memoryPath,\n globalSkillsDir: workspace.skillsDir,\n ...(readOnlyKnowledge ? { globalKnowledgeReadOnly: true } : {}),\n },\n };\n}\n\nfunction ensureDirectoryRoot(path: string, label: string): void {\n if (!exists(path)) {\n mkdirSync(path, { recursive: true, mode: 0o700 });\n return;\n }\n assertDirectory(path, label);\n}\n\nfunction ensureRegularFile(path: string, label: string): void {\n if (!exists(path)) {\n ensureDirExists(dirname(path));\n writeFileSync(path, \"\", { mode: 0o600, flag: \"wx\" });\n return;\n }\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isFile()) {\n throw new Error(`${label} must be a regular non-symlink file: ${path}`);\n }\n}\n\nfunction assertDirectory(path: string, label: string): void {\n let stats;\n try {\n stats = lstatSync(path);\n } catch (err) {\n throw new Error(`${label} cannot be inspected: ${path}`, { cause: err });\n }\n if (stats.isSymbolicLink() || !stats.isDirectory()) {\n throw new Error(`${label} must be a regular non-symlink directory: ${path}`);\n }\n}\n\nfunction exists(path: string): boolean {\n try {\n lstatSync(path);\n return true;\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code === \"ENOENT\") return false;\n throw err;\n }\n}\n"]}
|
package/dist/office/types.d.ts
CHANGED
|
@@ -106,12 +106,6 @@ export interface WorkspaceProjection {
|
|
|
106
106
|
visibility: WorkspaceVisibility;
|
|
107
107
|
/** Where the visibility came from, for operator display. */
|
|
108
108
|
source: "platform" | "override" | "unknown";
|
|
109
|
-
/**
|
|
110
|
-
* The office still declares the retired `full` door policy. Observation
|
|
111
|
-
* only: it no longer widens mounts, but cross-office access is logged so
|
|
112
|
-
* the migration can be verified before the setting is dropped (ADR 0008).
|
|
113
|
-
*/
|
|
114
|
-
legacyFull: boolean;
|
|
115
109
|
mounts: ContainerMount[];
|
|
116
110
|
promptSources: WorkspacePromptSources;
|
|
117
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/office/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEjG,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,uEAAuE;IACvE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,wEAAwE;IACxE,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,iEAAiE;IACjE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,yEAAyE;IACzE,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gFAAgF;IAChF,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,kDAAkD;IAClD,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,gFAAgF;IAChF,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,0DAA0D;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iDAAiD;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,gFAAgF;IAChF,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC5C;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,M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GAAG,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,2DAA2D;IAC3D,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yDAAyD;IACzD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4CAA4C;IAC5C,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B;;;;;OAKG;IACH,MAAM,IAAI,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,IAAI,GAAG,UAAU,CAAC;AAE3F,UAAU,sBAAsB;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,mFAAmF;IACnF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,mBAAmB,CAAC;IAChC,4DAA4D;IAC5D,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAC;IAC5C,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,aAAa,EAAE,sBAAsB,CAAC;CACvC"}
|
package/dist/office/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/office/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContainerMount, OfficeAddress, OfficeKey, WorkspaceVisibility } from \"../types.js\";\n\nexport interface OfficeMigrationRunSummary {\n /** Raw ids whose directories moved to the office-key layout this run. */\n migrated: string[];\n /** Raw ids whose interrupted moves were completed from the journal. */\n recovered: string[];\n /** Raw ids that still need an explicit owner (`mikan office claim`). */\n unowned: string[];\n /** Raw ids whose records are failed and need operator repair. */\n failed: string[];\n /** Raw ids whose conversation vault directories moved to office keys. */\n vaultKeysMigrated: string[];\n /** Raw ids whose legacy and office-key vault dirs both exist (manual merge). */\n vaultConflicts: string[];\n /** Raw ids whose host state directories moved. */\n stateDirsMigrated: string[];\n /** Raw ids whose legacy and office-key state dirs both exist (manual merge). */\n stateDirConflicts: string[];\n}\n\n/**\n * One mikan deployment's agent world on the host: the workspace root, the\n * workspace-global surfaces, and the factory for per-conversation offices.\n * Constructed once per process (`createWorkspace`); everything downstream\n * receives the value instead of re-deriving paths from root strings.\n */\nexport interface Workspace {\n /** Host workspace root directory. */\n readonly root: string;\n /**\n * Host-only state root (settings, credentials, and office records).\n * Not part of the Workspace projection; carried here so offices can\n * derive their state dirs and the registry knows where its journal lives.\n */\n readonly stateDir: string;\n /** Workspace-global memory file: `<root>/MEMORY.md`. */\n readonly memoryPath: string;\n /** Workspace-global skills directory: `<root>/skills`. */\n readonly skillsDir: string;\n /** Subagent profile patches: `<root>/agents`. */\n readonly agentsDir: string;\n /** Workspace-root entries that are shared infrastructure, never office dirs. */\n readonly reservedNames: ReadonlySet<string>;\n /**\n * The Conversation office for an address. Values are memoized per address,\n * so repeated calls on hot paths cost one map lookup, not a hash.\n */\n office(address: OfficeAddress): Office;\n}\n\n/**\n * One Conversation office: canonical identity plus the office's host-side\n * directory layout. A frozen value — every field is precomputed at\n * construction. Fields exist only for paths that more than one module needs;\n * single-consumer subpaths stay `join(office.dir, …)` at their call site.\n */\nexport interface Office {\n /** Canonical identity: platform plus raw platform conversation id. */\n readonly address: OfficeAddress;\n /**\n * The office key — the collision-resistant directory segment, identical on\n * the host and inside sandbox runtimes, and the conversation vault key.\n */\n readonly key: OfficeKey;\n /** The office working directory: `<workspace root>/<key>`. */\n readonly dir: string;\n /** Conversation memory file: `<dir>/MEMORY.md`. */\n readonly memoryPath: string;\n /** Conversation skills directory: `<dir>/skills`. */\n readonly skillsDir: string;\n /** Persisted chat-session files: `<dir>/sessions`. */\n readonly sessionsDir: string;\n /** Downloaded message attachments: `<dir>/attachments`. */\n readonly attachmentsDir: string;\n /** Human-readable message history: `<dir>/log.jsonl`. */\n readonly logPath: string;\n /** Host-only per-office state: `<state dir>/conversations/<key>`. */\n readonly stateDir: string;\n /** The workspace this office belongs to. */\n readonly workspace: Workspace;\n /**\n * Materialize the office working directory: record the office in the\n * registry, then create the directory. Idempotent and safe on hot\n * per-message paths — recording is cached, the mkdir is a guarded check.\n * Returns `dir`.\n */\n ensure(): string;\n}\n\n/**\n * The conversation's platform-native channel kind, using the platform's own\n * vocabulary (Slack conversation types), not a mikan-invented one. Recorded\n * at message intake and used to derive the workspace projection when no\n * explicit workspace setting exists: public channels share workspace memory\n * read-write, private channels read it without writing back, DMs and\n * externally shared channels stay isolated.\n */\nexport type PlatformChannelKind = \"public_channel\" | \"private_channel\" | \"im\" | \"external\";\n\ninterface WorkspacePromptSources {\n conversationDir: string;\n conversationMemoryPath: string;\n conversationSkillsDir: string;\n globalMemoryPath: string;\n globalSkillsDir: string;\n /** True for private offices: global MEMORY.md and skills are mounted read-only. */\n globalKnowledgeReadOnly?: boolean;\n}\n\nexport interface WorkspaceProjection {\n visibility: WorkspaceVisibility;\n /** Where the visibility came from, for operator display. */\n source: \"platform\" | \"override\" | \"unknown\";\n
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/office/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContainerMount, OfficeAddress, OfficeKey, WorkspaceVisibility } from \"../types.js\";\n\nexport interface OfficeMigrationRunSummary {\n /** Raw ids whose directories moved to the office-key layout this run. */\n migrated: string[];\n /** Raw ids whose interrupted moves were completed from the journal. */\n recovered: string[];\n /** Raw ids that still need an explicit owner (`mikan office claim`). */\n unowned: string[];\n /** Raw ids whose records are failed and need operator repair. */\n failed: string[];\n /** Raw ids whose conversation vault directories moved to office keys. */\n vaultKeysMigrated: string[];\n /** Raw ids whose legacy and office-key vault dirs both exist (manual merge). */\n vaultConflicts: string[];\n /** Raw ids whose host state directories moved. */\n stateDirsMigrated: string[];\n /** Raw ids whose legacy and office-key state dirs both exist (manual merge). */\n stateDirConflicts: string[];\n}\n\n/**\n * One mikan deployment's agent world on the host: the workspace root, the\n * workspace-global surfaces, and the factory for per-conversation offices.\n * Constructed once per process (`createWorkspace`); everything downstream\n * receives the value instead of re-deriving paths from root strings.\n */\nexport interface Workspace {\n /** Host workspace root directory. */\n readonly root: string;\n /**\n * Host-only state root (settings, credentials, and office records).\n * Not part of the Workspace projection; carried here so offices can\n * derive their state dirs and the registry knows where its journal lives.\n */\n readonly stateDir: string;\n /** Workspace-global memory file: `<root>/MEMORY.md`. */\n readonly memoryPath: string;\n /** Workspace-global skills directory: `<root>/skills`. */\n readonly skillsDir: string;\n /** Subagent profile patches: `<root>/agents`. */\n readonly agentsDir: string;\n /** Workspace-root entries that are shared infrastructure, never office dirs. */\n readonly reservedNames: ReadonlySet<string>;\n /**\n * The Conversation office for an address. Values are memoized per address,\n * so repeated calls on hot paths cost one map lookup, not a hash.\n */\n office(address: OfficeAddress): Office;\n}\n\n/**\n * One Conversation office: canonical identity plus the office's host-side\n * directory layout. A frozen value — every field is precomputed at\n * construction. Fields exist only for paths that more than one module needs;\n * single-consumer subpaths stay `join(office.dir, …)` at their call site.\n */\nexport interface Office {\n /** Canonical identity: platform plus raw platform conversation id. */\n readonly address: OfficeAddress;\n /**\n * The office key — the collision-resistant directory segment, identical on\n * the host and inside sandbox runtimes, and the conversation vault key.\n */\n readonly key: OfficeKey;\n /** The office working directory: `<workspace root>/<key>`. */\n readonly dir: string;\n /** Conversation memory file: `<dir>/MEMORY.md`. */\n readonly memoryPath: string;\n /** Conversation skills directory: `<dir>/skills`. */\n readonly skillsDir: string;\n /** Persisted chat-session files: `<dir>/sessions`. */\n readonly sessionsDir: string;\n /** Downloaded message attachments: `<dir>/attachments`. */\n readonly attachmentsDir: string;\n /** Human-readable message history: `<dir>/log.jsonl`. */\n readonly logPath: string;\n /** Host-only per-office state: `<state dir>/conversations/<key>`. */\n readonly stateDir: string;\n /** The workspace this office belongs to. */\n readonly workspace: Workspace;\n /**\n * Materialize the office working directory: record the office in the\n * registry, then create the directory. Idempotent and safe on hot\n * per-message paths — recording is cached, the mkdir is a guarded check.\n * Returns `dir`.\n */\n ensure(): string;\n}\n\n/**\n * The conversation's platform-native channel kind, using the platform's own\n * vocabulary (Slack conversation types), not a mikan-invented one. Recorded\n * at message intake and used to derive the workspace projection when no\n * explicit workspace setting exists: public channels share workspace memory\n * read-write, private channels read it without writing back, DMs and\n * externally shared channels stay isolated.\n */\nexport type PlatformChannelKind = \"public_channel\" | \"private_channel\" | \"im\" | \"external\";\n\ninterface WorkspacePromptSources {\n conversationDir: string;\n conversationMemoryPath: string;\n conversationSkillsDir: string;\n globalMemoryPath: string;\n globalSkillsDir: string;\n /** True for private offices: global MEMORY.md and skills are mounted read-only. */\n globalKnowledgeReadOnly?: boolean;\n}\n\nexport interface WorkspaceProjection {\n visibility: WorkspaceVisibility;\n /** Where the visibility came from, for operator display. */\n source: \"platform\" | \"override\" | \"unknown\";\n mounts: ContainerMount[];\n promptSources: WorkspacePromptSources;\n}\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -354,12 +354,6 @@ export interface PiAgentWrapper {
|
|
|
354
354
|
* write shared knowledge; private ones are visible only to themselves.
|
|
355
355
|
*/
|
|
356
356
|
export type WorkspaceVisibility = "public" | "private";
|
|
357
|
-
/** Retired door-policy fields, still parsed so legacy files load and `full` can be reported. */
|
|
358
|
-
interface WorkspaceSettings {
|
|
359
|
-
doorPolicy?: "isolated" | "trusted";
|
|
360
|
-
layout?: "conversation" | "shared-support" | "full";
|
|
361
|
-
visibility?: WorkspaceVisibility;
|
|
362
|
-
}
|
|
363
357
|
export interface SandboxSettings {
|
|
364
358
|
cpus?: string;
|
|
365
359
|
memory?: string;
|
|
@@ -367,12 +361,6 @@ export interface SandboxSettings {
|
|
|
367
361
|
cpus?: string;
|
|
368
362
|
memory?: string;
|
|
369
363
|
};
|
|
370
|
-
/** Legacy image-specific workspace setting; new installations use workspace. */
|
|
371
|
-
image?: {
|
|
372
|
-
workspaceMount?: "private" | "full";
|
|
373
|
-
};
|
|
374
|
-
/** Backend-neutral office data policy and layout. */
|
|
375
|
-
workspace?: WorkspaceSettings;
|
|
376
364
|
defaultSharedVault?: string;
|
|
377
365
|
}
|
|
378
366
|
export interface AgentConfig {
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAA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AAM,WAAW,CAAC;AAatC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport type { SubagentRunStatus } from \"./harness/types.js\";\nimport type { SessionViewTokenStoreLike } from \"./adapters/commands/types.js\";\nimport type { MikanModels } from \"./harness/models.js\";\nimport type { McpServerConfig } from \"./harness/types.js\";\nimport type { EventScheduleSink } from \"./events/index.js\";\nimport type { Office } from \"./office/types.js\";\nimport type { DockerContainerManager } from \"./sandbox/provisioner.js\";\nimport type { SandboxConfig } from \"./sandbox/types.js\";\nimport type { ResolvedSessionScope } from \"./sessions/types.js\";\nimport type { PlatformToolPackFactory } from \"./harness/tools/types.js\";\nimport type { VaultManager } from \"./vault/types.js\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\n/** Canonical platform-plus-raw identifier for one conversation office. */\nexport interface OfficeAddress {\n readonly platform: PlatformName;\n readonly conversationId: string;\n}\n\n/** Stable, filesystem-safe identity derived from an OfficeAddress. */\nexport type OfficeKey = string & { readonly __brand: \"OfficeKey\" };\n\nexport type OfficeMigrationStatus = \"needs-owner\" | \"prepared\" | \"moving\" | \"committed\" | \"failed\";\n\nexport interface OfficeMigrationRecord {\n readonly rawConversationId: string;\n readonly sourceDir: string;\n readonly workspaceRoot: string;\n readonly ownerPlatform?: PlatformName;\n readonly targetDir?: string;\n readonly status: OfficeMigrationStatus;\n readonly error?: string;\n readonly updatedAt: string;\n}\n\n/**\n * Directory entry for one conversation office. The workspace dir name stops\n * carrying the raw platform id once the ADR 0005 layout migration lands, so\n * the registry is the durable raw-id ↔ office mapping used for enumeration.\n */\nexport interface OfficeRecord {\n readonly platform: PlatformName;\n readonly conversationId: string;\n readonly recordedAt: string;\n}\n\nexport interface OfficeRegistryState {\n readonly version: 1;\n readonly enabledPlatforms: readonly PlatformName[];\n readonly offices: readonly OfficeRecord[];\n readonly migrations: readonly OfficeMigrationRecord[];\n}\n\nexport interface OfficeMigrationPreparation {\n readonly rawConversationId: string;\n readonly sourceDir: string;\n readonly workspaceRoot: string;\n readonly ownerPlatform?: PlatformName;\n}\n\n/**\n * Who can drive conversations on a platform — gates ambient credential policy.\n *\n * - `membership`: only invited workspace/server members (Slack/Discord/Telegram).\n * Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.\n * - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public\n * issues/PRs). Ambient shared vault must not apply; use host-side platform\n * identity or an explicitly provisioned vault.\n */\nexport type PlatformTrustModel = \"membership\" | \"open-trigger\";\n\nexport interface ConversationMessage {\n id: string;\n /** Canonical identity of the conversation office. */\n address: OfficeAddress;\n /** @deprecated Use address.conversationId except at platform I/O seams. */\n conversationId?: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\n/**\n * Derived from the run status rather than restated, so a new terminal status\n * in the harness reaches the dashboard instead of silently rendering as a\n * status the marker tables never learned about.\n */\nexport type SubagentProgressStatus = SubagentRunStatus | \"pending\" | \"running\" | \"skipped\";\n\nexport interface SubagentProgressNode {\n id: string;\n label: string;\n status: SubagentProgressStatus;\n /** Profile the node ran under; the first thing to check when a run is ungrounded. */\n profile?: string;\n turns?: number;\n toolCalls?: number;\n toolCallCounts?: Record<string, number>;\n tokens?: number;\n costUsd?: number;\n durationMs?: number;\n /**\n * What the node is doing right now, for running nodes only.\n *\n * Without it a node reports nothing between \"started\" and \"finished\", so a\n * step that legitimately takes minutes is indistinguishable from a hang —\n * and when it does finish, there is no record of how it got there.\n */\n activity?: string;\n reason?: string;\n cleanupPending?: boolean;\n}\n\nexport interface SubagentProgressSnapshot {\n mode: \"single\" | \"parallel\" | \"dag\";\n nodes: SubagentProgressNode[];\n}\n\nexport interface TaskStatus {\n sessionKey: string;\n threadTs: string;\n acknowledgement: string;\n status:\n | \"running\"\n | \"stopping\"\n | \"completed\"\n | \"aborted\"\n | \"failed\"\n | \"declined\"\n | \"queued\"\n | \"unknown\";\n currentTool?: string;\n observedAt: string;\n endedAt?: string;\n}\n\nexport interface ConversationResponder {\n /** Admit independent work; returns its platform session reference, never waits for completion. */\n startTask?(message: string, task: string): Promise<string>;\n /** Post a fresh delivery notification after the final task response. */\n notifyCompletion?(): Promise<void>;\n /** Read-only task observations, scoped to the current conversation. */\n getTaskStatus?(sessionKey?: string): Promise<TaskStatus[]>;\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n /**\n * Override only to convert the subagent dashboard for a pipeline that is\n * not response-source Markdown (Telegram HTML). Absent, the harness composes\n * the Markdown dashboard — optionally followed by the final answer — through\n * `replaceResponse`.\n */\n replaceSubagentProgress?(progress: SubagentProgressSnapshot, finalText?: string): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n /** Stable platform workspace/team identity when the adapter has one. */\n workspaceId?: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n /**\n * Trust boundary for ambient credentials and host-side MCP capabilities.\n * Built-in product paths normalize omission to `membership`; open-trigger\n * platforms set this explicitly so policy does not key off platform names.\n */\n trustModel?: PlatformTrustModel;\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Canonical identity created by the platform adapter at intake. */\n address: OfficeAddress;\n /** @deprecated Raw platform identifier; valid only at adapter I/O seams. */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n /** Stop accepting new platform events and wait for intake already in flight. */\n stop(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n /**\n * Upload a host-side file into a conversation. Optional so adapters adopt\n * it incrementally; callers must handle its absence. Existing adapter\n * implementations (Slack/Discord/Telegram) already match this shape.\n */\n uploadFile?(channel: string, filePath: string, title?: string): Promise<void>;\n /**\n * Post into a platform thread. Optional so adapters adopt it incrementally;\n * callers must handle its absence.\n */\n postInThread?(channel: string, threadTs: string, text: string): Promise<string>;\n /**\n * Open (or resolve) the direct-message conversation with a user, returning\n * its conversation id — usable with `postMessage`. Optional capability.\n */\n openDirectConversation?(userId: string): Promise<string>;\n /**\n * Fetch recent messages from a conversation, oldest first. Optional\n * capability; adapters may cap `limit` below what the caller asks for.\n */\n fetchHistory?(\n channel: string,\n options?: PlatformHistoryOptions,\n ): Promise<PlatformHistoryMessage[]>;\n /** List the platform workspace's active users. Optional capability. */\n listUsers?(): Promise<PlatformUserInfo[]>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/** Filters for a platform conversation-history fetch. */\nexport interface PlatformHistoryOptions {\n /** Only messages strictly newer than this platform message id/timestamp. */\n oldest?: string;\n /** Maximum number of messages to return (adapters may cap this lower). */\n limit?: number;\n /**\n * Read the replies inside this thread instead of the conversation's\n * top-level messages. The thread parent itself is not returned — the result\n * is the replies to it. Adapters without threads ignore this.\n */\n threadTs?: string;\n}\n\n/** One platform message returned by a history fetch. */\nexport interface PlatformHistoryMessage {\n ts: string;\n threadTs?: string;\n userId?: string;\n userName?: string;\n text: string;\n isBot: boolean;\n}\n\n/** One platform user returned by a workspace user listing. */\nexport interface PlatformUserInfo {\n id: string;\n userName: string;\n displayName: string;\n isBot: boolean;\n}\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n /** Canonical identity for the office handling this turn. */\n address: OfficeAddress;\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n /** The office this run belongs to; two platforms may share a raw id. */\n address: OfficeAddress;\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n stopping?: boolean;\n}\n\nexport interface HandleNewCommandOptions {\n sessionKey: string;\n conversationId: string;\n bot: MessagingBot;\n message: ConversationMessage;\n}\n\n/**\n * Runtime state is addressed by an office plus that office's platform session\n * reference. The session key alone is a platform value and is not unique\n * across platforms, so every session-scoped call carries its `OfficeAddress`.\n */\nexport interface MessagingEventHandler {\n isRunning(address: OfficeAddress, sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(\n address: OfficeAddress,\n sessionKey: string,\n bot: MessagingBot,\n replyThreadTs?: string,\n ): Promise<void>;\n /** Returns false when idle; accepted controls bypass the normal run queue. */\n steer?(message: ConversationMessage): Promise<boolean>;\n forceStop(address: OfficeAddress, sessionKey: string): void;\n handleNewCommand(options: HandleNewCommandOptions): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n steer?(message: ConversationMessage): Promise<boolean>;\n syncChatHistory(currentMessageId?: string): Promise<void>;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n dispose(): Promise<void>;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\n/**\n * Office visibility (ADR 0008): public offices may be read by every office and\n * write shared knowledge; private ones are visible only to themselves.\n */\nexport type WorkspaceVisibility = \"public\" | \"private\";\n\n/** Retired door-policy fields, still parsed so legacy files load and `full` can be reported. */\ninterface WorkspaceSettings {\n doorPolicy?: \"isolated\" | \"trusted\";\n layout?: \"conversation\" | \"shared-support\" | \"full\";\n visibility?: WorkspaceVisibility;\n}\n\nexport interface SandboxSettings {\n cpus?: string;\n memory?: string;\n boost?: { cpus?: string; memory?: string };\n /** Legacy image-specific workspace setting; new installations use workspace. */\n image?: { workspaceMount?: \"private\" | \"full\" };\n /** Backend-neutral office data policy and layout. */\n workspace?: WorkspaceSettings;\n defaultSharedVault?: string;\n}\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandbox?: SandboxSettings;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n /**\n * MCP servers available to this scope, keyed by server name. Global and\n * conversation entries merge per key (conversation wins); an entry with\n * `disabled: true` turns off the inherited server. `open-connector` is\n * filled in from the deployment default when undeclared. See `src/harness`.\n */\n mcpServers?: Record<string, McpServerConfig>;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n /** Canonical office identity used by vault and execution policy. */\n address: OfficeAddress;\n userId: string;\n /** From MessagingInfo.trustModel; vault policy uses this, not platform name. */\n trustModel?: PlatformTrustModel;\n}\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal shell (src/adapters/web/portal-shell.ts) ────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\n/** Rewrites one Docker bind spec (`src:dst[:ro]`) during layout migration. */\nexport type ContainerBindTranslator = (bindSpec: string) => string;\n\nexport interface ContainerMount {\n source: string;\n target: string;\n /**\n * Mount without write access. Used for shared content an isolated runtime\n * may read but must not modify. Absent means read-write.\n */\n readOnly?: boolean;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface SandboxResourceController {\n boost(key: string): Promise<SandboxLimitStatus>;\n setLimits(key: string, limits: ResourceLimits): Promise<SandboxLimitStatus>;\n getLimitStatus(key: string): SandboxLimitStatus;\n getDefaultLimits(): ResourceLimits | undefined;\n getBoostLimits(): ResourceLimits | undefined;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\nexport interface ExecutionPlan {\n credentialKey: string;\n resourceKey: string;\n sandboxConfig: SandboxConfig;\n env?: Record<string, string>;\n mounts: ContainerMount[];\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\n// ── shared implementation contracts ─────────────────────────────────────────\n\ninterface EnvVarSpec {\n name: string;\n required?: boolean;\n secret?: boolean;\n deploy?: boolean;\n doc: string;\n}\n\n/** The onboarding wizard's LLM answer, applied to the settings template. */\nexport interface OnboardLlmChoice {\n provider: string;\n model: string;\n}\n\nexport interface EnvGroup {\n key: string;\n title: string;\n kind: \"platform\" | \"feature\";\n vars: EnvVarSpec[];\n anyOf?: readonly string[];\n doc?: string;\n}\n\nexport interface RunnerCacheControl {\n switchConversationModel(address: OfficeAddress, provider: string, model: string): boolean;\n /** Clear the office's cached runner for a non-model settings change; false while busy. */\n refreshConversationEnvironment(address: OfficeAddress): boolean;\n}\n\nexport interface GlobalRunnerCacheControl {\n refreshAllConversations(): { busy: OfficeAddress[] };\n}\n\nexport type SettingsApplyResult =\n | { ok: true; runtimeSwitched: boolean | null }\n | { ok: false; reason: \"busy\" };\n\nexport interface CreateRunnerOptions {\n sandboxConfig: SandboxConfig;\n sessionKey: string;\n /** The Conversation office this runner serves; identity and layout derive from it. */\n office: Office;\n /**\n * Fixed trust boundary for this office. It is not part of runner cache\n * identity; changing it requires runner replacement, not another cache entry.\n */\n trustModel: PlatformTrustModel;\n /** Platform workspace/team identity used by host-side integration provisioning. */\n platformWorkspaceId?: string;\n /** Deployment default for the `open-connector` MCP entry; settings may override it. */\n openConnector?: McpServerConfig;\n /** Scheduler notified by the office event store after each admitted mutation. */\n eventScheduler?: EventScheduleSink;\n sessionScope: ResolvedSessionScope;\n /** Cancels construction during process shutdown; acquired resources still roll back before rejection. */\n signal?: AbortSignal;\n vaultManager?: VaultManager;\n provisioner?: DockerContainerManager;\n resourceController?: SandboxResourceController;\n sessionView?: {\n tokenStore: SessionViewTokenStoreLike;\n portalBaseUrl?: string;\n };\n platformToolPackFactories?: readonly PlatformToolPackFactory[];\n models?: MikanModels;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAatC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { execFile } from \"node:child_process\";\nimport { promisify } from \"node:util\";\nimport type { SubagentRunStatus } from \"./harness/types.js\";\nimport type { SessionViewTokenStoreLike } from \"./adapters/commands/types.js\";\nimport type { MikanModels } from \"./harness/models.js\";\nimport type { McpServerConfig } from \"./harness/types.js\";\nimport type { EventScheduleSink } from \"./events/index.js\";\nimport type { Office } from \"./office/types.js\";\nimport type { DockerContainerManager } from \"./sandbox/provisioner.js\";\nimport type { SandboxConfig } from \"./sandbox/types.js\";\nimport type { ResolvedSessionScope } from \"./sessions/types.js\";\nimport type { PlatformToolPackFactory } from \"./harness/tools/types.js\";\nimport type { VaultManager } from \"./vault/types.js\";\n\nconst execFileAsync = promisify(execFile);\ntype ExecFileAsync = typeof execFileAsync;\n\n// ── adapter ───────────────────────────────────────────────────────────────────\n\nexport type ConversationKind = \"direct\" | \"shared\";\n\nexport type PlatformName = \"slack\" | \"discord\" | \"telegram\" | \"github\";\n\n/** Canonical platform-plus-raw identifier for one conversation office. */\nexport interface OfficeAddress {\n readonly platform: PlatformName;\n readonly conversationId: string;\n}\n\n/** Stable, filesystem-safe identity derived from an OfficeAddress. */\nexport type OfficeKey = string & { readonly __brand: \"OfficeKey\" };\n\nexport type OfficeMigrationStatus = \"needs-owner\" | \"prepared\" | \"moving\" | \"committed\" | \"failed\";\n\nexport interface OfficeMigrationRecord {\n readonly rawConversationId: string;\n readonly sourceDir: string;\n readonly workspaceRoot: string;\n readonly ownerPlatform?: PlatformName;\n readonly targetDir?: string;\n readonly status: OfficeMigrationStatus;\n readonly error?: string;\n readonly updatedAt: string;\n}\n\n/**\n * Directory entry for one conversation office. The workspace dir name stops\n * carrying the raw platform id once the ADR 0005 layout migration lands, so\n * the registry is the durable raw-id ↔ office mapping used for enumeration.\n */\nexport interface OfficeRecord {\n readonly platform: PlatformName;\n readonly conversationId: string;\n readonly recordedAt: string;\n}\n\nexport interface OfficeRegistryState {\n readonly version: 1;\n readonly enabledPlatforms: readonly PlatformName[];\n readonly offices: readonly OfficeRecord[];\n readonly migrations: readonly OfficeMigrationRecord[];\n}\n\nexport interface OfficeMigrationPreparation {\n readonly rawConversationId: string;\n readonly sourceDir: string;\n readonly workspaceRoot: string;\n readonly ownerPlatform?: PlatformName;\n}\n\n/**\n * Who can drive conversations on a platform — gates ambient credential policy.\n *\n * - `membership`: only invited workspace/server members (Slack/Discord/Telegram).\n * Safe to copy `sandbox.defaultSharedVault` into new conversation vaults.\n * - `open-trigger`: broader trigger surface (e.g. GitHub repo writers on public\n * issues/PRs). Ambient shared vault must not apply; use host-side platform\n * identity or an explicitly provisioned vault.\n */\nexport type PlatformTrustModel = \"membership\" | \"open-trigger\";\n\nexport interface ConversationMessage {\n id: string;\n /** Canonical identity of the conversation office. */\n address: OfficeAddress;\n /** @deprecated Use address.conversationId except at platform I/O seams. */\n conversationId?: string;\n sessionKey: string;\n conversationKind: ConversationKind;\n userId: string;\n userName?: string;\n text: string;\n attachments?: { name: string; localPath: string }[];\n threadTs?: string;\n}\n\nexport interface ChatToolResult {\n toolName: string;\n label?: string;\n args?: Record<string, unknown>;\n result: string;\n isError: boolean;\n durationMs: number;\n}\n\n/**\n * Derived from the run status rather than restated, so a new terminal status\n * in the harness reaches the dashboard instead of silently rendering as a\n * status the marker tables never learned about.\n */\nexport type SubagentProgressStatus = SubagentRunStatus | \"pending\" | \"running\" | \"skipped\";\n\nexport interface SubagentProgressNode {\n id: string;\n label: string;\n status: SubagentProgressStatus;\n /** Profile the node ran under; the first thing to check when a run is ungrounded. */\n profile?: string;\n turns?: number;\n toolCalls?: number;\n toolCallCounts?: Record<string, number>;\n tokens?: number;\n costUsd?: number;\n durationMs?: number;\n /**\n * What the node is doing right now, for running nodes only.\n *\n * Without it a node reports nothing between \"started\" and \"finished\", so a\n * step that legitimately takes minutes is indistinguishable from a hang —\n * and when it does finish, there is no record of how it got there.\n */\n activity?: string;\n reason?: string;\n cleanupPending?: boolean;\n}\n\nexport interface SubagentProgressSnapshot {\n mode: \"single\" | \"parallel\" | \"dag\";\n nodes: SubagentProgressNode[];\n}\n\nexport interface TaskStatus {\n sessionKey: string;\n threadTs: string;\n acknowledgement: string;\n status:\n | \"running\"\n | \"stopping\"\n | \"completed\"\n | \"aborted\"\n | \"failed\"\n | \"declined\"\n | \"queued\"\n | \"unknown\";\n currentTool?: string;\n observedAt: string;\n endedAt?: string;\n}\n\nexport interface ConversationResponder {\n /** Admit independent work; returns its platform session reference, never waits for completion. */\n startTask?(message: string, task: string): Promise<string>;\n /** Post a fresh delivery notification after the final task response. */\n notifyCompletion?(): Promise<void>;\n /** Read-only task observations, scoped to the current conversation. */\n getTaskStatus?(sessionKey?: string): Promise<TaskStatus[]>;\n respond(text: string): Promise<void>;\n appendResponseDelta?(delta: string): Promise<void>;\n finishResponse?(finalText?: string): Promise<void>;\n replaceResponse(text: string, options?: { createOverflowLink?: () => string }): Promise<void>;\n /**\n * Override only to convert the subagent dashboard for a pipeline that is\n * not response-source Markdown (Telegram HTML). Absent, the harness composes\n * the Markdown dashboard — optionally followed by the final answer — through\n * `replaceResponse`.\n */\n replaceSubagentProgress?(progress: SubagentProgressSnapshot, finalText?: string): Promise<void>;\n respondDiagnostic(text: string, options?: { style?: \"muted\" | \"error\" }): Promise<void>;\n respondToolResult(result: ChatToolResult): Promise<void>;\n setTyping(isTyping: boolean): Promise<void>;\n setWorking(working: boolean): Promise<void>;\n uploadFile(filePath: string, title?: string): Promise<void>;\n /**\n * React to the message that triggered this run with an emoji short name\n * (no colons). Optional: platforms/contexts without reaction support omit\n * it, and callers must handle its absence.\n */\n react?(emoji: string): Promise<void>;\n deleteResponse(): Promise<void>;\n}\n\nexport interface MessagingInfo {\n name: string;\n /** Stable platform workspace/team identity when the adapter has one. */\n workspaceId?: string;\n formattingGuide: string;\n channels: { id: string; name: string }[];\n users: { id: string; userName: string; displayName: string }[];\n /**\n * Trust boundary for ambient credentials and host-side MCP capabilities.\n * Built-in product paths normalize omission to `membership`; open-trigger\n * platforms set this explicitly so policy does not key off platform names.\n */\n trustModel?: PlatformTrustModel;\n diagnostics?: {\n showUsageSummary?: boolean;\n };\n}\n\n/**\n * A platform-agnostic event (message/mention) that triggers the agent.\n */\nexport interface ConversationEvent {\n type: string;\n /** Canonical identity created by the platform adapter at intake. */\n address: OfficeAddress;\n /** @deprecated Raw platform identifier; valid only at adapter I/O seams. */\n conversationId: string;\n /** Optional alternate conversation identity used for vault routing. */\n vaultConversationId?: string;\n /** Cross-platform conversation shape: direct message vs shared space */\n conversationKind: ConversationKind;\n /** Message timestamp or ID as string */\n ts: string;\n /** Parent message ID for threaded replies (optional) */\n thread_ts?: string;\n /** User ID */\n user: string;\n /** Message text (already stripped of bot mentions) */\n text: string;\n /** Downloaded attachments */\n attachments?: { name: string; localPath: string }[];\n /** Platform-computed session key; overrides default conversationId:thread_ts computation */\n sessionKey?: string;\n}\n\n/**\n * Minimum interface that every platform bot must implement,\n * used by the central handler in main.ts and by EventsWatcher.\n */\nexport interface MessagingBot {\n start(): Promise<void>;\n /** Stop accepting new platform events and wait for intake already in flight. */\n stop(): Promise<void>;\n postMessage(channel: string, text: string): Promise<string>;\n updateMessage(channel: string, ts: string, text: string): Promise<void>;\n /**\n * Add an emoji reaction to a message. `emoji` is a platform-agnostic short\n * name without colons (e.g. \"eyes\", \"white_check_mark\"). Optional so\n * adapters adopt it incrementally; callers must handle its absence.\n */\n addReaction?(channel: string, messageTs: string, emoji: string): Promise<void>;\n /**\n * Upload a host-side file into a conversation. Optional so adapters adopt\n * it incrementally; callers must handle its absence. Existing adapter\n * implementations (Slack/Discord/Telegram) already match this shape.\n */\n uploadFile?(channel: string, filePath: string, title?: string): Promise<void>;\n /**\n * Post into a platform thread. Optional so adapters adopt it incrementally;\n * callers must handle its absence.\n */\n postInThread?(channel: string, threadTs: string, text: string): Promise<string>;\n /**\n * Open (or resolve) the direct-message conversation with a user, returning\n * its conversation id — usable with `postMessage`. Optional capability.\n */\n openDirectConversation?(userId: string): Promise<string>;\n /**\n * Fetch recent messages from a conversation, oldest first. Optional\n * capability; adapters may cap `limit` below what the caller asks for.\n */\n fetchHistory?(\n channel: string,\n options?: PlatformHistoryOptions,\n ): Promise<PlatformHistoryMessage[]>;\n /** List the platform workspace's active users. Optional capability. */\n listUsers?(): Promise<PlatformUserInfo[]>;\n enqueueEvent(event: ConversationEvent): boolean;\n getMessagingInfo(): MessagingInfo;\n postPrivate?(conversationId: string, userId: string, text: string): Promise<void>;\n postPrivateDiagnostic?(\n conversationId: string,\n userId: string,\n text: string,\n options?: { style?: \"muted\" | \"error\" },\n ): Promise<void>;\n}\n\n/** Filters for a platform conversation-history fetch. */\nexport interface PlatformHistoryOptions {\n /** Only messages strictly newer than this platform message id/timestamp. */\n oldest?: string;\n /** Maximum number of messages to return (adapters may cap this lower). */\n limit?: number;\n /**\n * Read the replies inside this thread instead of the conversation's\n * top-level messages. The thread parent itself is not returned — the result\n * is the replies to it. Adapters without threads ignore this.\n */\n threadTs?: string;\n}\n\n/** One platform message returned by a history fetch. */\nexport interface PlatformHistoryMessage {\n ts: string;\n threadTs?: string;\n userId?: string;\n userName?: string;\n text: string;\n isBot: boolean;\n}\n\n/** One platform user returned by a workspace user listing. */\nexport interface PlatformUserInfo {\n id: string;\n userName: string;\n displayName: string;\n isBot: boolean;\n}\n\n/** Normalized platform data and reply hook for one event. */\nexport interface ConversationContext {\n /** Canonical identity for the office handling this turn. */\n address: OfficeAddress;\n message: ConversationMessage;\n responder: ConversationResponder;\n platform: MessagingInfo;\n}\n\nexport interface RunningSession {\n /** The office this run belongs to; two platforms may share a raw id. */\n address: OfficeAddress;\n sessionKey: string;\n startedAt: number;\n lastActivityAt?: number;\n currentTool?: string;\n stopping?: boolean;\n}\n\nexport interface HandleNewCommandOptions {\n sessionKey: string;\n conversationId: string;\n bot: MessagingBot;\n message: ConversationMessage;\n}\n\n/**\n * Runtime state is addressed by an office plus that office's platform session\n * reference. The session key alone is a platform value and is not unique\n * across platforms, so every session-scoped call carries its `OfficeAddress`.\n */\nexport interface MessagingEventHandler {\n isRunning(address: OfficeAddress, sessionKey: string): boolean;\n getRunningSessions(): RunningSession[];\n handleEvent(\n event: ConversationEvent,\n bot: MessagingBot,\n context: ConversationContext,\n ): Promise<void>;\n handleStop(\n address: OfficeAddress,\n sessionKey: string,\n bot: MessagingBot,\n replyThreadTs?: string,\n ): Promise<void>;\n /** Returns false when idle; accepted controls bypass the normal run queue. */\n steer?(message: ConversationMessage): Promise<boolean>;\n forceStop(address: OfficeAddress, sessionKey: string): void;\n handleNewCommand(options: HandleNewCommandOptions): Promise<void>;\n}\n\n// ── agent ─────────────────────────────────────────────────────────────────────\n\nexport interface PiAgentWrapper {\n steer?(message: ConversationMessage): Promise<boolean>;\n syncChatHistory(currentMessageId?: string): Promise<void>;\n run(\n message: ConversationMessage,\n responder: ConversationResponder,\n platform: MessagingInfo,\n ): Promise<{ stopReason: string; errorMessage?: string }>;\n abort(): void;\n getCurrentStep(): { toolName?: string; label?: string } | undefined;\n dispose(): Promise<void>;\n}\n\n// ── config ────────────────────────────────────────────────────────────────────\n\n/**\n * Office visibility (ADR 0008): public offices may be read by every office and\n * write shared knowledge; private ones are visible only to themselves.\n */\nexport type WorkspaceVisibility = \"public\" | \"private\";\n\nexport interface SandboxSettings {\n cpus?: string;\n memory?: string;\n boost?: { cpus?: string; memory?: string };\n defaultSharedVault?: string;\n}\n\nexport interface AgentConfig {\n provider: string;\n model: string;\n thinkingLevel: ThinkingLevel;\n sentryDsn?: string;\n sandbox?: SandboxSettings;\n slack?: {\n replyMode?: \"top-level\" | \"thread\";\n };\n /**\n * MCP servers available to this scope, keyed by server name. Global and\n * conversation entries merge per key (conversation wins); an entry with\n * `disabled: true` turns off the inherited server. `open-connector` is\n * filled in from the deployment default when undeclared. See `src/harness`.\n */\n mcpServers?: Record<string, McpServerConfig>;\n}\n\n// ── context ───────────────────────────────────────────────────────────────────\n\n/**\n * Platform conversation history entry from log.jsonl.\n */\nexport interface ConversationLogMessage {\n date?: string;\n ts?: string;\n threadTs?: string;\n user?: string;\n userName?: string;\n text?: string;\n isMessagingBot?: boolean;\n}\n\n// ── execution-resolver ────────────────────────────────────────────────────────\n\nexport interface ActorContext {\n /** Canonical office identity used by vault and execution policy. */\n address: OfficeAddress;\n userId: string;\n /** From MessagingInfo.trustModel; vault policy uses this, not platform name. */\n trustModel?: PlatformTrustModel;\n}\n\n// ── log ───────────────────────────────────────────────────────────────────────\n\nexport interface LogContext {\n conversationId: string;\n userName?: string;\n conversationName?: string;\n sessionId?: string;\n}\n\n// ── portal shell (src/adapters/web/portal-shell.ts) ────────────────────────────────────\n\ntype PortalView = \"admin\" | \"session\" | \"vault\";\n\nexport interface PortalShellOptions {\n activeView: PortalView;\n pageTitle: string;\n identity?: {\n primary: string;\n secondary?: string;\n };\n conversationSwitcher?: {\n currentId: string;\n options?: Array<{ id: string; label: string; running?: boolean }>;\n };\n navLinks?: Partial<Record<PortalView, string>>;\n body: string;\n extraStyles?: string;\n inlineScript?: string;\n extraHead?: string;\n bodyAttributes?: Record<string, string>;\n}\n\n// ── provisioner ───────────────────────────────────────────────────────────────\n\n/** Rewrites one Docker bind spec (`src:dst[:ro]`) during layout migration. */\nexport type ContainerBindTranslator = (bindSpec: string) => string;\n\nexport interface ContainerMount {\n source: string;\n target: string;\n /**\n * Mount without write access. Used for shared content an isolated runtime\n * may read but must not modify. Absent means read-write.\n */\n readOnly?: boolean;\n}\n\nexport interface ResourceLimits {\n cpus?: string;\n memory?: string;\n}\n\nexport interface SandboxLimitStatus {\n limits?: ResourceLimits;\n boosted: boolean;\n}\n\nexport interface SandboxResourceController {\n boost(key: string): Promise<SandboxLimitStatus>;\n setLimits(key: string, limits: ResourceLimits): Promise<SandboxLimitStatus>;\n getLimitStatus(key: string): SandboxLimitStatus;\n getDefaultLimits(): ResourceLimits | undefined;\n getBoostLimits(): ResourceLimits | undefined;\n}\n\nexport interface ProvisionOptions {\n containerName?: string;\n mounts?: ContainerMount[];\n conversationId?: string;\n}\n\nexport interface DockerContainerManagerOptions {\n limits?: ResourceLimits;\n boostLimits?: ResourceLimits;\n execFileImpl?: ExecFileAsync;\n}\n\nexport interface ExecutionPlan {\n credentialKey: string;\n resourceKey: string;\n sandboxConfig: SandboxConfig;\n env?: Record<string, string>;\n mounts: ContainerMount[];\n}\n\n// ── store ─────────────────────────────────────────────────────────────────────\n\nexport interface Attachment {\n original: string;\n localPath: string;\n}\n\n// ── shared implementation contracts ─────────────────────────────────────────\n\ninterface EnvVarSpec {\n name: string;\n required?: boolean;\n secret?: boolean;\n deploy?: boolean;\n doc: string;\n}\n\n/** The onboarding wizard's LLM answer, applied to the settings template. */\nexport interface OnboardLlmChoice {\n provider: string;\n model: string;\n}\n\nexport interface EnvGroup {\n key: string;\n title: string;\n kind: \"platform\" | \"feature\";\n vars: EnvVarSpec[];\n anyOf?: readonly string[];\n doc?: string;\n}\n\nexport interface RunnerCacheControl {\n switchConversationModel(address: OfficeAddress, provider: string, model: string): boolean;\n /** Clear the office's cached runner for a non-model settings change; false while busy. */\n refreshConversationEnvironment(address: OfficeAddress): boolean;\n}\n\nexport interface GlobalRunnerCacheControl {\n refreshAllConversations(): { busy: OfficeAddress[] };\n}\n\nexport type SettingsApplyResult =\n | { ok: true; runtimeSwitched: boolean | null }\n | { ok: false; reason: \"busy\" };\n\nexport interface CreateRunnerOptions {\n sandboxConfig: SandboxConfig;\n sessionKey: string;\n /** The Conversation office this runner serves; identity and layout derive from it. */\n office: Office;\n /**\n * Fixed trust boundary for this office. It is not part of runner cache\n * identity; changing it requires runner replacement, not another cache entry.\n */\n trustModel: PlatformTrustModel;\n /** Platform workspace/team identity used by host-side integration provisioning. */\n platformWorkspaceId?: string;\n /** Deployment default for the `open-connector` MCP entry; settings may override it. */\n openConnector?: McpServerConfig;\n /** Scheduler notified by the office event store after each admitted mutation. */\n eventScheduler?: EventScheduleSink;\n sessionScope: ResolvedSessionScope;\n /** Cancels construction during process shutdown; acquired resources still roll back before rejection. */\n signal?: AbortSignal;\n vaultManager?: VaultManager;\n provisioner?: DockerContainerManager;\n resourceController?: SandboxResourceController;\n sessionView?: {\n tokenStore: SessionViewTokenStoreLike;\n portalBaseUrl?: string;\n };\n platformToolPackFactories?: readonly PlatformToolPackFactory[];\n models?: MikanModels;\n}\n"]}
|