@geminixiang/mikan 1.0.0-beta.64 → 1.0.0-beta.65

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.
Files changed (226) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/dist/adapters/commands/auto-reply.d.ts.map +1 -1
  4. package/dist/adapters/commands/auto-reply.js +1 -1
  5. package/dist/adapters/commands/auto-reply.js.map +1 -1
  6. package/dist/adapters/commands/model.js +2 -2
  7. package/dist/adapters/commands/model.js.map +1 -1
  8. package/dist/adapters/commands/new.js +1 -1
  9. package/dist/adapters/commands/new.js.map +1 -1
  10. package/dist/adapters/commands/sandbox.js +2 -2
  11. package/dist/adapters/commands/sandbox.js.map +1 -1
  12. package/dist/adapters/commands/types.d.ts +1 -1
  13. package/dist/adapters/commands/types.d.ts.map +1 -1
  14. package/dist/adapters/commands/types.js.map +1 -1
  15. package/dist/adapters/commands/utils.d.ts +1 -1
  16. package/dist/adapters/commands/utils.d.ts.map +1 -1
  17. package/dist/adapters/commands/utils.js.map +1 -1
  18. package/dist/adapters/discord/bot.d.ts +2 -2
  19. package/dist/adapters/discord/bot.d.ts.map +1 -1
  20. package/dist/adapters/discord/bot.js +7 -6
  21. package/dist/adapters/discord/bot.js.map +1 -1
  22. package/dist/adapters/discord/context.d.ts +1 -1
  23. package/dist/adapters/discord/context.d.ts.map +1 -1
  24. package/dist/adapters/discord/context.js +2 -1
  25. package/dist/adapters/discord/context.js.map +1 -1
  26. package/dist/adapters/discord/types.d.ts +1 -1
  27. package/dist/adapters/discord/types.d.ts.map +1 -1
  28. package/dist/adapters/discord/types.js.map +1 -1
  29. package/dist/adapters/github/bot.d.ts +2 -2
  30. package/dist/adapters/github/bot.d.ts.map +1 -1
  31. package/dist/adapters/github/bot.js +1 -1
  32. package/dist/adapters/github/bot.js.map +1 -1
  33. package/dist/adapters/github/context.d.ts +1 -1
  34. package/dist/adapters/github/context.d.ts.map +1 -1
  35. package/dist/adapters/github/context.js +1 -1
  36. package/dist/adapters/github/context.js.map +1 -1
  37. package/dist/adapters/github/types.d.ts +1 -1
  38. package/dist/adapters/github/types.d.ts.map +1 -1
  39. package/dist/adapters/github/types.js.map +1 -1
  40. package/dist/{adapter.d.ts → adapters/index.d.ts} +3 -3
  41. package/dist/adapters/index.d.ts.map +1 -0
  42. package/dist/{adapter.js → adapters/index.js} +2 -2
  43. package/dist/adapters/index.js.map +1 -0
  44. package/dist/adapters/intake.d.ts +1 -1
  45. package/dist/adapters/intake.d.ts.map +1 -1
  46. package/dist/adapters/intake.js +1 -1
  47. package/dist/adapters/intake.js.map +1 -1
  48. package/dist/{platform-messages.d.ts → adapters/messages.d.ts} +2 -2
  49. package/dist/adapters/messages.d.ts.map +1 -0
  50. package/dist/{platform-messages.js → adapters/messages.js} +1 -1
  51. package/dist/adapters/messages.js.map +1 -0
  52. package/dist/adapters/progressive-renderer.d.ts +1 -1
  53. package/dist/adapters/progressive-renderer.d.ts.map +1 -1
  54. package/dist/adapters/progressive-renderer.js.map +1 -1
  55. package/dist/adapters/shared.d.ts +3 -1
  56. package/dist/adapters/shared.d.ts.map +1 -1
  57. package/dist/adapters/shared.js +25 -0
  58. package/dist/adapters/shared.js.map +1 -1
  59. package/dist/adapters/slack/bot.d.ts +4 -3
  60. package/dist/adapters/slack/bot.d.ts.map +1 -1
  61. package/dist/adapters/slack/bot.js +9 -6
  62. package/dist/adapters/slack/bot.js.map +1 -1
  63. package/dist/adapters/slack/context.d.ts +1 -1
  64. package/dist/adapters/slack/context.d.ts.map +1 -1
  65. package/dist/adapters/slack/context.js +1 -1
  66. package/dist/adapters/slack/context.js.map +1 -1
  67. package/dist/adapters/slack/persona.d.ts +15 -0
  68. package/dist/adapters/slack/persona.d.ts.map +1 -0
  69. package/dist/adapters/slack/persona.js +22 -0
  70. package/dist/adapters/slack/persona.js.map +1 -0
  71. package/dist/adapters/slack/response-lifecycle.d.ts +1 -1
  72. package/dist/adapters/slack/response-lifecycle.d.ts.map +1 -1
  73. package/dist/adapters/slack/response-lifecycle.js +21 -0
  74. package/dist/adapters/slack/response-lifecycle.js.map +1 -1
  75. package/dist/adapters/slack/types.d.ts +1 -1
  76. package/dist/adapters/slack/types.d.ts.map +1 -1
  77. package/dist/adapters/slack/types.js.map +1 -1
  78. package/dist/adapters/telegram/bot.d.ts +2 -2
  79. package/dist/adapters/telegram/bot.d.ts.map +1 -1
  80. package/dist/adapters/telegram/bot.js +6 -6
  81. package/dist/adapters/telegram/bot.js.map +1 -1
  82. package/dist/adapters/telegram/context.d.ts +1 -1
  83. package/dist/adapters/telegram/context.d.ts.map +1 -1
  84. package/dist/adapters/telegram/context.js +2 -1
  85. package/dist/adapters/telegram/context.js.map +1 -1
  86. package/dist/adapters/telegram/types.d.ts +1 -1
  87. package/dist/adapters/telegram/types.d.ts.map +1 -1
  88. package/dist/adapters/telegram/types.js.map +1 -1
  89. package/dist/adapters/types.d.ts +1 -1
  90. package/dist/adapters/types.d.ts.map +1 -1
  91. package/dist/adapters/types.js.map +1 -1
  92. package/dist/adapters/web/admin/portal.d.ts +2 -2
  93. package/dist/adapters/web/admin/portal.d.ts.map +1 -1
  94. package/dist/adapters/web/admin/portal.js +26 -16
  95. package/dist/adapters/web/admin/portal.js.map +1 -1
  96. package/dist/adapters/web/admin/types.d.ts +1 -1
  97. package/dist/adapters/web/admin/types.d.ts.map +1 -1
  98. package/dist/adapters/web/admin/types.js.map +1 -1
  99. package/dist/adapters/web/login/portal.d.ts +1 -1
  100. package/dist/adapters/web/login/portal.d.ts.map +1 -1
  101. package/dist/adapters/web/login/portal.js +2 -2
  102. package/dist/adapters/web/login/portal.js.map +1 -1
  103. package/dist/adapters/web/login/types.d.ts +1 -1
  104. package/dist/adapters/web/login/types.d.ts.map +1 -1
  105. package/dist/adapters/web/login/types.js.map +1 -1
  106. package/dist/adapters/web/portal-shell.js +2 -2
  107. package/dist/adapters/web/portal-shell.js.map +1 -1
  108. package/dist/adapters/web/server.d.ts +1 -1
  109. package/dist/adapters/web/server.d.ts.map +1 -1
  110. package/dist/adapters/web/server.js +1 -1
  111. package/dist/adapters/web/server.js.map +1 -1
  112. package/dist/adapters/web/session-view/portal.js +1 -1
  113. package/dist/adapters/web/session-view/portal.js.map +1 -1
  114. package/dist/adapters/web/session-view/types.d.ts +3 -3
  115. package/dist/adapters/web/session-view/types.d.ts.map +1 -1
  116. package/dist/adapters/web/session-view/types.js.map +1 -1
  117. package/dist/cli/office.js +1 -1
  118. package/dist/cli/office.js.map +1 -1
  119. package/dist/cli/onboard.js +2 -2
  120. package/dist/cli/onboard.js.map +1 -1
  121. package/dist/cli/process-lifecycle.d.ts.map +1 -0
  122. package/dist/cli/process-lifecycle.js.map +1 -0
  123. package/dist/dream/index.js +1 -1
  124. package/dist/dream/index.js.map +1 -1
  125. package/dist/dream/types.d.ts +1 -1
  126. package/dist/dream/types.d.ts.map +1 -1
  127. package/dist/dream/types.js.map +1 -1
  128. package/dist/env-manifest.d.ts +6 -0
  129. package/dist/env-manifest.d.ts.map +1 -1
  130. package/dist/env-manifest.js +11 -0
  131. package/dist/env-manifest.js.map +1 -1
  132. package/dist/events/scheduler.d.ts +1 -1
  133. package/dist/events/scheduler.d.ts.map +1 -1
  134. package/dist/events/scheduler.js +1 -1
  135. package/dist/events/scheduler.js.map +1 -1
  136. package/dist/file-guards.d.ts +8 -0
  137. package/dist/file-guards.d.ts.map +1 -1
  138. package/dist/file-guards.js +31 -0
  139. package/dist/file-guards.js.map +1 -1
  140. package/dist/harness/execution-resolver.js +1 -1
  141. package/dist/harness/execution-resolver.js.map +1 -1
  142. package/dist/harness/open-connector.js +1 -1
  143. package/dist/harness/open-connector.js.map +1 -1
  144. package/dist/harness/presenter.d.ts +2 -2
  145. package/dist/harness/presenter.d.ts.map +1 -1
  146. package/dist/harness/presenter.js +26 -0
  147. package/dist/harness/presenter.js.map +1 -1
  148. package/dist/harness/prompt.d.ts +1 -1
  149. package/dist/harness/prompt.d.ts.map +1 -1
  150. package/dist/harness/prompt.js +1 -0
  151. package/dist/harness/prompt.js.map +1 -1
  152. package/dist/harness/runner.js +1 -1
  153. package/dist/harness/runner.js.map +1 -1
  154. package/dist/harness/subagent-profiles.d.ts.map +1 -1
  155. package/dist/harness/subagent-profiles.js +14 -14
  156. package/dist/harness/subagent-profiles.js.map +1 -1
  157. package/dist/harness/tools/event.d.ts +1 -1
  158. package/dist/harness/tools/event.d.ts.map +1 -1
  159. package/dist/harness/tools/event.js.map +1 -1
  160. package/dist/harness/tools/index.d.ts +1 -1
  161. package/dist/harness/tools/index.d.ts.map +1 -1
  162. package/dist/harness/tools/index.js.map +1 -1
  163. package/dist/harness/tools/task.d.ts +1 -1
  164. package/dist/harness/tools/task.d.ts.map +1 -1
  165. package/dist/harness/tools/task.js.map +1 -1
  166. package/dist/harness/types.d.ts +2 -2
  167. package/dist/harness/types.d.ts.map +1 -1
  168. package/dist/harness/types.js.map +1 -1
  169. package/dist/index.d.ts +2 -2
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.js +1 -1
  172. package/dist/index.js.map +1 -1
  173. package/dist/main.js +4 -2
  174. package/dist/main.js.map +1 -1
  175. package/dist/observability/instrument.js +1 -1
  176. package/dist/observability/instrument.js.map +1 -1
  177. package/dist/office/projection.d.ts +8 -5
  178. package/dist/office/projection.d.ts.map +1 -1
  179. package/dist/office/projection.js +14 -6
  180. package/dist/office/projection.js.map +1 -1
  181. package/dist/office/types.d.ts +4 -1
  182. package/dist/office/types.d.ts.map +1 -1
  183. package/dist/office/types.js.map +1 -1
  184. package/dist/runtime/conversation-runtime.js +1 -1
  185. package/dist/runtime/conversation-runtime.js.map +1 -1
  186. package/dist/runtime/session-lifecycle.d.ts +1 -1
  187. package/dist/runtime/session-lifecycle.d.ts.map +1 -1
  188. package/dist/runtime/session-lifecycle.js.map +1 -1
  189. package/dist/runtime/types.d.ts +1 -1
  190. package/dist/runtime/types.d.ts.map +1 -1
  191. package/dist/runtime/types.js.map +1 -1
  192. package/dist/sessions/session-key.d.ts +1 -1
  193. package/dist/sessions/session-key.d.ts.map +1 -1
  194. package/dist/sessions/session-key.js.map +1 -1
  195. package/dist/sessions/types.d.ts +1 -1
  196. package/dist/sessions/types.d.ts.map +1 -1
  197. package/dist/sessions/types.js.map +1 -1
  198. package/dist/{settings-mutation.d.ts → settings/apply.d.ts} +4 -4
  199. package/dist/settings/apply.d.ts.map +1 -0
  200. package/dist/{settings-mutation.js → settings/apply.js} +2 -2
  201. package/dist/settings/apply.js.map +1 -0
  202. package/dist/settings/index.d.ts +118 -0
  203. package/dist/settings/index.d.ts.map +1 -0
  204. package/dist/{config.js → settings/index.js} +9 -127
  205. package/dist/settings/index.js.map +1 -0
  206. package/dist/settings/migrate.d.ts +21 -0
  207. package/dist/settings/migrate.d.ts.map +1 -0
  208. package/dist/settings/migrate.js +86 -0
  209. package/dist/settings/migrate.js.map +1 -0
  210. package/dist/types.d.ts +7 -0
  211. package/dist/types.d.ts.map +1 -1
  212. package/dist/types.js.map +1 -1
  213. package/package.json +2 -2
  214. package/dist/adapter.d.ts.map +0 -1
  215. package/dist/adapter.js.map +0 -1
  216. package/dist/config.d.ts +0 -92
  217. package/dist/config.d.ts.map +0 -1
  218. package/dist/config.js.map +0 -1
  219. package/dist/platform-messages.d.ts.map +0 -1
  220. package/dist/platform-messages.js.map +0 -1
  221. package/dist/process-lifecycle.d.ts.map +0 -1
  222. package/dist/process-lifecycle.js.map +0 -1
  223. package/dist/settings-mutation.d.ts.map +0 -1
  224. package/dist/settings-mutation.js.map +0 -1
  225. /package/dist/{process-lifecycle.d.ts → cli/process-lifecycle.d.ts} +0 -0
  226. /package/dist/{process-lifecycle.js → cli/process-lifecycle.js} +0 -0
@@ -0,0 +1,21 @@
1
+ import { type Workspace } from "../office/index.js";
2
+ import type { OfficeKey } from "../types.js";
3
+ export interface DoorPolicyMigrationReport {
4
+ /** Retired keys removed from the global settings file. */
5
+ global: string[];
6
+ conversations: {
7
+ key: OfficeKey;
8
+ removed: string[];
9
+ visibility?: "private";
10
+ }[];
11
+ skipped: {
12
+ key: OfficeKey | "global";
13
+ reason: string;
14
+ }[];
15
+ }
16
+ /**
17
+ * One-time removal of the retired door-policy settings from the global file
18
+ * and every registered office (ADR 0008). Run with the daemon stopped.
19
+ */
20
+ export declare function migrateLegacyDoorPolicy(workspace: Workspace): DoorPolicyMigrationReport;
21
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/settings/migrate.ts"],"names":[],"mappings":"AAOA,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS7C,MAAM,WAAW,yBAAyB;IACxC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,EAAE;QAAE,GAAG,EAAE,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,SAAS,CAAA;KAAE,EAAE,CAAC;IAC/E,OAAO,EAAE;QAAE,GAAG,EAAE,SAAS,GAAG,QAAQ,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1D;AA8CD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,yBAAyB,CA4BvF"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * One-time settings migrations run by `mikan office …` with the daemon
3
+ * stopped. Runtime code never imports this file.
4
+ */
5
+ import { existsSync } from "node:fs";
6
+ import { join } from "node:path";
7
+ import { atomicWritePrivateFile } from "../file-guards.js";
8
+ import { listRegisteredOffices } from "../office/index.js";
9
+ import { compactSettingsConfig, hasDefinedValue, loadSettingsFile, } from "./index.js";
10
+ const RETIRED_KEYS = {
11
+ image: "sandbox.image.workspaceMount",
12
+ workspace: "sandbox.workspace",
13
+ };
14
+ /**
15
+ * Strip the retired door-policy keys from one settings file. Returns the
16
+ * removed key paths, or an empty list when nothing had to change (the file is
17
+ * then left byte-for-byte alone, which also preserves `{}` migration markers).
18
+ * The only value carried forward is an explicit shared-support `private`
19
+ * visibility, which maps onto `office.visibility` (ADR 0008). Every other
20
+ * retired combination — `full`, `isolated`, legacy `private` — is dropped
21
+ * without deriving a grant.
22
+ */
23
+ function stripRetiredDoorPolicy(settingsPath, allowVisibilityCarry) {
24
+ const existing = loadSettingsFile(settingsPath);
25
+ if (!existing?.sandbox)
26
+ return { removed: [] };
27
+ const { image, workspace, ...sandboxRest } = existing.sandbox;
28
+ const removed = [];
29
+ if (image?.workspaceMount !== undefined)
30
+ removed.push(RETIRED_KEYS.image);
31
+ if (workspace !== undefined)
32
+ removed.push(RETIRED_KEYS.workspace);
33
+ if (removed.length === 0)
34
+ return { removed };
35
+ const carry = allowVisibilityCarry &&
36
+ workspace?.doorPolicy === "trusted" &&
37
+ workspace.layout !== "full" &&
38
+ workspace.visibility === "private";
39
+ const { workspaceMount: _mount, ...imageRest } = image ?? {};
40
+ const sandbox = {
41
+ ...sandboxRest,
42
+ ...(hasDefinedValue(imageRest) ? { image: imageRest } : {}),
43
+ };
44
+ const next = {
45
+ ...existing,
46
+ sandbox,
47
+ ...(carry ? { office: { ...existing.office, visibility: "private" } } : {}),
48
+ };
49
+ atomicWritePrivateFile(settingsPath, JSON.stringify(compactSettingsConfig(next), null, 2));
50
+ return { removed, ...(carry ? { visibility: "private" } : {}) };
51
+ }
52
+ /**
53
+ * One-time removal of the retired door-policy settings from the global file
54
+ * and every registered office (ADR 0008). Run with the daemon stopped.
55
+ */
56
+ export function migrateLegacyDoorPolicy(workspace) {
57
+ const report = { global: [], conversations: [], skipped: [] };
58
+ try {
59
+ report.global = stripRetiredDoorPolicy(join(workspace.stateDir, "settings.json"), false).removed;
60
+ }
61
+ catch (error) {
62
+ report.skipped.push({
63
+ key: "global",
64
+ reason: error instanceof Error ? error.message : String(error),
65
+ });
66
+ }
67
+ for (const record of listRegisteredOffices(workspace.stateDir)) {
68
+ const office = workspace.office(record);
69
+ const settingsPath = join(office.stateDir, "settings.json");
70
+ if (!existsSync(settingsPath))
71
+ continue;
72
+ try {
73
+ const result = stripRetiredDoorPolicy(settingsPath, true);
74
+ if (result.removed.length > 0)
75
+ report.conversations.push({ key: office.key, ...result });
76
+ }
77
+ catch (error) {
78
+ report.skipped.push({
79
+ key: office.key,
80
+ reason: error instanceof Error ? error.message : String(error),
81
+ });
82
+ }
83
+ }
84
+ return report;
85
+ }
86
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../src/settings/migrate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAkB,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EACL,qBAAqB,EACrB,eAAe,EACf,gBAAgB,GAGjB,MAAM,YAAY,CAAC;AASpB,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,8BAA8B;IACrC,SAAS,EAAE,mBAAmB;CACtB,CAAC;AAEX;;;;;;;;GAQG;AACH,SAAS,sBAAsB,CAC7B,YAAoB,EACpB,oBAA6B;IAE7B,MAAM,QAAQ,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ,EAAE,OAAO;QAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IAC/C,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;IAC9D,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,KAAK,EAAE,cAAc,KAAK,SAAS;QAAE,OAAO,CAAC,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aAC/D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * One-time settings migrations run by `mikan office …` with the daemon\n * stopped. Runtime code never imports this file.\n */\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { atomicWritePrivateFile } from \"../file-guards.js\";\nimport { listRegisteredOffices, type Workspace } from \"../office/index.js\";\nimport type { OfficeKey } from \"../types.js\";\nimport {\n compactSettingsConfig,\n hasDefinedValue,\n loadSettingsFile,\n type SandboxFileSettings,\n type SettingsFileConfig,\n} from \"./index.js\";\n\nexport interface DoorPolicyMigrationReport {\n /** Retired keys removed from the global settings file. */\n global: string[];\n conversations: { key: OfficeKey; removed: string[]; visibility?: \"private\" }[];\n skipped: { key: OfficeKey | \"global\"; reason: string }[];\n}\n\nconst RETIRED_KEYS = {\n image: \"sandbox.image.workspaceMount\",\n workspace: \"sandbox.workspace\",\n} as const;\n\n/**\n * Strip the retired door-policy keys from one settings file. Returns the\n * removed key paths, or an empty list when nothing had to change (the file is\n * then left byte-for-byte alone, which also preserves `{}` migration markers).\n * The only value carried forward is an explicit shared-support `private`\n * visibility, which maps onto `office.visibility` (ADR 0008). Every other\n * retired combination — `full`, `isolated`, legacy `private` — is dropped\n * without deriving a grant.\n */\nfunction stripRetiredDoorPolicy(\n settingsPath: string,\n allowVisibilityCarry: boolean,\n): { removed: string[]; visibility?: \"private\" } {\n const existing = loadSettingsFile(settingsPath);\n if (!existing?.sandbox) return { removed: [] };\n const { image, workspace, ...sandboxRest } = existing.sandbox;\n const removed: string[] = [];\n if (image?.workspaceMount !== undefined) removed.push(RETIRED_KEYS.image);\n if (workspace !== undefined) removed.push(RETIRED_KEYS.workspace);\n if (removed.length === 0) return { removed };\n const carry =\n allowVisibilityCarry &&\n workspace?.doorPolicy === \"trusted\" &&\n workspace.layout !== \"full\" &&\n workspace.visibility === \"private\";\n const { workspaceMount: _mount, ...imageRest } = image ?? {};\n const sandbox: SandboxFileSettings = {\n ...sandboxRest,\n ...(hasDefinedValue(imageRest) ? { image: imageRest } : {}),\n };\n const next: SettingsFileConfig = {\n ...existing,\n sandbox,\n ...(carry ? { office: { ...existing.office, visibility: \"private\" as const } } : {}),\n };\n atomicWritePrivateFile(settingsPath, JSON.stringify(compactSettingsConfig(next), null, 2));\n return { removed, ...(carry ? { visibility: \"private\" as const } : {}) };\n}\n\n/**\n * One-time removal of the retired door-policy settings from the global file\n * and every registered office (ADR 0008). Run with the daemon stopped.\n */\nexport function migrateLegacyDoorPolicy(workspace: Workspace): DoorPolicyMigrationReport {\n const report: DoorPolicyMigrationReport = { global: [], conversations: [], skipped: [] };\n try {\n report.global = stripRetiredDoorPolicy(\n join(workspace.stateDir, \"settings.json\"),\n false,\n ).removed;\n } catch (error) {\n report.skipped.push({\n key: \"global\",\n reason: error instanceof Error ? error.message : String(error),\n });\n }\n for (const record of listRegisteredOffices(workspace.stateDir)) {\n const office = workspace.office(record);\n const settingsPath = join(office.stateDir, \"settings.json\");\n if (!existsSync(settingsPath)) continue;\n try {\n const result = stripRetiredDoorPolicy(settingsPath, true);\n if (result.removed.length > 0) report.conversations.push({ key: office.key, ...result });\n } catch (error) {\n report.skipped.push({\n key: office.key,\n reason: error instanceof Error ? error.message : String(error),\n });\n }\n }\n return report;\n}\n"]}
package/dist/types.d.ts CHANGED
@@ -154,6 +154,13 @@ export interface ConversationResponder {
154
154
  * `replaceResponse`.
155
155
  */
156
156
  replaceSubagentProgress?(progress: SubagentProgressSnapshot, finalText?: string): Promise<void>;
157
+ /**
158
+ * Spike: post the final answer as a fresh message under the identity of the
159
+ * subagent profile that produced it, instead of appending it to the
160
+ * in-progress message. Absent, or when the run does not resolve to exactly
161
+ * one completed subagent profile, the harness keeps the single-message path.
162
+ */
163
+ respondAsRole?(profile: string, text: string): Promise<void>;
157
164
  respondDiagnostic(text: string, options?: {
158
165
  style?: "muted" | "error";
159
166
  }): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file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AAW,CAAC;IACrB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,WAAW,CAAC,EAAE;QACZ,UAAU,EAAE,yBAAyB,CAAC;QACtC,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,yBAAyB,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;IAC/D,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
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"]}
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 /**\n * Spike: post the final answer as a fresh message under the identity of the\n * subagent profile that produced it, instead of appending it to the\n * in-progress message. Absent, or when the run does not resolve to exactly\n * one completed subagent profile, the harness keeps the single-message path.\n */\n respondAsRole?(profile: string, text: 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"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@geminixiang/mikan",
3
- "version": "1.0.0-beta.64",
4
- "description": "Multi-platform AI coding agent for Slack, Telegram, Discord, and GitHub",
3
+ "version": "1.0.0-beta.65",
4
+ "description": "Self-hosted AI coding agent for organizations: every Slack channel and DM gets its own sandboxed workspace, credentials, and memory.",
5
5
  "keywords": [
6
6
  "agent",
7
7
  "ai",
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,SAAS,EACT,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,wBAAwB,GACzB,MAAM,YAAY,CAAC;AAEpB,UAAU,yBAAyB;IACjC,QAAQ,EAAE,YAAY,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAYD,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACrC,CAAC,SAAS,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EAC/D,KAAK,EAAE,CAAC,GAAG,yBAAyB,GAAG,CAAC,GAAG,iBAAiB,CAG7D;AAED,6EAA6E;AAC7E,wBAAgB,yBAAyB,CACvC,CAAC,SAAS,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,gBAAgB,CAAC,EACjE,KAAK,EAAE,CAAC,GAAG,yBAAyB,GAAG,CAAC,GAAG,mBAAmB,CAG/D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmCpE,SAAS,0BAA0B,CAAC,KAAgC;IAClE,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC1E,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,KAAK,CACb,qCAAqC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,QAAQ,EAAE,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,8EAA8E;AAC9E,MAAM,UAAU,uBAAuB,CAErC,KAAoC;IACpC,MAAM,OAAO,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;AACvE,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,yBAAyB,CAEvC,KAAoC;IACpC,MAAM,OAAO,GAAG,0BAA0B,CAAC,KAAK,CAAC,CAAC;IAClD,OAAO,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC;AACvE,CAAC","sourcesContent":["import { createOfficeAddress, sameOffice } from \"./office/index.js\";\nimport type {\n ConversationEvent,\n ConversationMessage,\n OfficeAddress,\n PlatformName,\n} from \"./types.js\";\n\nexport type {\n MessagingBot,\n ConversationContext,\n ConversationEvent,\n MessagingEventHandler,\n HandleNewCommandOptions,\n ConversationMessage,\n ConversationResponder,\n ChatToolResult,\n ConversationKind,\n MessagingInfo,\n OfficeAddress,\n OfficeKey,\n PlatformHistoryMessage,\n PlatformHistoryOptions,\n PlatformName,\n PlatformUserInfo,\n RunningSession,\n SubagentProgressSnapshot,\n} from \"./types.js\";\n\ninterface ConversationIdentityInput {\n platform: PlatformName;\n conversationId: string;\n address?: OfficeAddress;\n}\n\nfunction resolveConversationAddress(input: ConversationIdentityInput): OfficeAddress {\n const address = createOfficeAddress(input.platform, input.conversationId);\n if (input.address && !sameOffice(address, input.address)) {\n throw new Error(\n `Conversation address mismatch for ${JSON.stringify(input.conversationId)} on ${input.platform}`,\n );\n }\n return address;\n}\n\n/** Normalize platform intake into one authoritative conversation identity. */\nexport function createConversationEvent<\n T extends Omit<ConversationEvent, \"address\" | \"conversationId\">,\n>(input: T & ConversationIdentityInput): T & ConversationEvent {\n const address = resolveConversationAddress(input);\n return { ...input, address, conversationId: address.conversationId };\n}\n\n/** Normalize a platform response context into one authoritative identity. */\nexport function createConversationMessage<\n T extends Omit<ConversationMessage, \"address\" | \"conversationId\">,\n>(input: T & ConversationIdentityInput): T & ConversationMessage {\n const address = resolveConversationAddress(input);\n return { ...input, address, conversationId: address.conversationId };\n}\n"]}
package/dist/config.d.ts DELETED
@@ -1,92 +0,0 @@
1
- export declare class MissingGlobalSettingsError extends Error {
2
- readonly settingsPath: string;
3
- constructor(settingsPath: string);
4
- }
5
- export type { AgentConfig, SandboxSettings } from "./types.js";
6
- import type { AgentConfig, OfficeKey } from "./types.js";
7
- import type { McpServerConfig } from "./harness/types.js";
8
- import type { OnboardLlmChoice } from "./types.js";
9
- import { type Office, type Workspace } from "./office/index.js";
10
- export declare function loadGlobalSettings(): AgentConfig;
11
- /**
12
- * Host-authoritative location of a conversation's settings file:
13
- * `<office state dir>/settings.json`. The Office value names both the
14
- * state-dir key and the legacy pre-host-migration location (its workspace
15
- * dir) — the key is never inferred from a directory basename.
16
- *
17
- * Conversation settings used to live at `<conversationDir>/settings.json`,
18
- * but conversation dirs are bind-mounted read-write into sandbox containers
19
- * in image mode — code inside the sandbox could edit its own settings.json
20
- * and flip `sandbox.image.workspaceMount` to "full", remounting the entire
21
- * workspace into its container (cross-conversation access). Settings are an
22
- * administrator surface, so they live under the host-only state dir.
23
- *
24
- * Migration: on first access per conversation, a legacy
25
- * `<conversationDir>/settings.json` is moved here. The new file's existence
26
- * (an empty `{}` is written when there is nothing to migrate) is the
27
- * migration marker — a legacy file (re)appearing later, e.g. planted from
28
- * inside the sandbox, is never read again.
29
- */
30
- export declare function conversationSettingsPath(office: Office): string;
31
- export declare function slackConversationAutoReplyEnabled(office: Office): boolean;
32
- export declare function setSlackConversationAutoReply(office: Office, enabled: boolean): void;
33
- export declare function resolveConversationSettings(office: Office): AgentConfig;
34
- /**
35
- * True when `child` is `parent` or a path inside it. Purely lexical (no
36
- * symlink resolution) — used for configuration sanity checks, not as the
37
- * final security boundary.
38
- */
39
- export declare function isPathInside(child: string, parent: string): boolean;
40
- /**
41
- * The state dir (settings, office records, vaults) must never live inside
42
- * the working dir: conversation opt-in "full" mode mounts the entire working
43
- * dir read-write into sandbox containers, which would expose host-authoritative
44
- * state and credentials. Fatal under sandboxed modes; host mode has no mounts,
45
- * so only warn about the bad hygiene.
46
- */
47
- export declare function assertStateDirOutsideWorkspace(stateDir: string, workingDir: string, sandboxType: string): void;
48
- export declare function resolveSentryDsn(): string | undefined;
49
- export declare function createGlobalSettingsFile(stateDir: string, llm?: OnboardLlmChoice): string;
50
- /**
51
- * Externally-visible base URL of the link/OAuth server, e.g.
52
- * `https://mikan.example.com` (no trailing slash). Read from `LINK_URL` or
53
- * `MIKAN_LINK_URL`, the same env var the bot uses to build credential onboarding links.
54
- */
55
- export declare function resolveLinkBaseUrl(): string | undefined;
56
- export declare function updateGlobalSettings(patch: Partial<AgentConfig>): void;
57
- export declare function updateConversationSettings(office: Office, patch: Partial<AgentConfig>): void;
58
- /**
59
- * The two scope-level MCP server maps, unmerged: the portal edits each scope's
60
- * own file, so it needs the raw per-scope values, not the effective merge
61
- * (`resolveConversationSettings` owns that).
62
- */
63
- export declare function loadScopeMcpServers(office: Office): {
64
- global: Record<string, McpServerConfig>;
65
- conversation: Record<string, McpServerConfig>;
66
- };
67
- /**
68
- * The conversation's own visibility override, or null when it follows the
69
- * platform. Only "private" can be stored: an operator may narrow a public
70
- * channel, never widen a private one (see ADR 0008).
71
- */
72
- export declare function loadOfficeVisibilityOverride(office: Office): "private" | null;
73
- export declare function setOfficeVisibilityOverride(office: Office, visibility: "private" | null): void;
74
- export interface DoorPolicyMigrationReport {
75
- /** Retired keys removed from the global settings file. */
76
- global: string[];
77
- conversations: {
78
- key: OfficeKey;
79
- removed: string[];
80
- visibility?: "private";
81
- }[];
82
- skipped: {
83
- key: OfficeKey | "global";
84
- reason: string;
85
- }[];
86
- }
87
- /**
88
- * One-time removal of the retired door-policy settings from the global file
89
- * and every registered office (ADR 0008). Run with the daemon stopped.
90
- */
91
- export declare function migrateLegacyDoorPolicy(workspace: Workspace): DoorPolicyMigrationReport;
92
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,qBAAa,0BAA2B,SAAQ,KAAK;aACvB,YAAY,EAAE,MAAM;IAAhD,YAA4B,YAAY,EAAE,MAAM,EAG/C;CACF;AAED,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAmB,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAyB,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAsOvF,wBAAgB,kBAAkB,IAAI,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,CAAC;IACZ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;YAClB,GAAG,EAAE,QAAQ;YACb,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;SAC/D,CAAC,CAAC;IACL,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,qBAAqB,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC/D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;QAC5D,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,SAAS;QACxC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,sBAAsB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YAC1D,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;gBAAE,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;QAC3F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;gBAClB,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,MAAM,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAC/D,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport { Type, type Static } from \"@sinclair/typebox\";\nimport { existsSync, lstatSync, readFileSync, renameSync, rmSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { effectiveStateDir } from \"./cli/arg-grammar.js\";\nimport { readEnv } from \"./env-manifest.js\";\nimport { ensureDirExists, readJsonSchemaFileIfExists } from \"./file-guards.js\";\nimport { atomicWritePrivateFile } from \"./file-guards.js\";\nimport * as log from \"./log.js\";\n\nexport class MissingGlobalSettingsError extends Error {\n constructor(public readonly settingsPath: string) {\n super(`Missing global settings file at ${settingsPath}`);\n this.name = \"MissingGlobalSettingsError\";\n }\n}\n\nexport type { AgentConfig, SandboxSettings } from \"./types.js\";\nimport type { AgentConfig, OfficeKey, SandboxSettings } from \"./types.js\";\nimport type { McpServerConfig } from \"./harness/types.js\";\nimport type { OnboardLlmChoice } from \"./types.js\";\nimport { listRegisteredOffices, type Office, type Workspace } from \"./office/index.js\";\n\nconst ONBOARD_SETTINGS: SettingsFileConfig = {\n llm: {\n provider: \"anthropic\",\n model: \"claude-sonnet-4-6\",\n thinkingLevel: \"off\",\n },\n slack: {\n replyMode: \"top-level\",\n },\n sandbox: {\n cpus: \"0.5\",\n memory: \"1g\",\n boost: {\n cpus: \"2\",\n memory: \"4g\",\n },\n // Office visibility is not a setting here: it follows the platform\n // conversation type (see office/projection resolveOfficeVisibility).\n defaultSharedVault: \"\",\n },\n};\n\nconst SettingsFileSchema = Type.Object({\n llm: Type.Optional(\n Type.Object({\n provider: Type.Optional(Type.String()),\n model: Type.Optional(Type.String()),\n thinkingLevel: Type.Optional(\n Type.Union([\n Type.Literal(\"off\"),\n Type.Literal(\"minimal\"),\n Type.Literal(\"low\"),\n Type.Literal(\"medium\"),\n Type.Literal(\"high\"),\n Type.Literal(\"xhigh\"),\n Type.Literal(\"max\"),\n ]),\n ),\n }),\n ),\n sentry: Type.Optional(\n Type.Object({\n dsn: Type.Optional(Type.String()),\n }),\n ),\n slack: Type.Optional(\n Type.Object({\n replyMode: Type.Optional(Type.Union([Type.Literal(\"top-level\"), Type.Literal(\"thread\")])),\n }),\n ),\n /**\n * Conversation-only office policy. `visibility: \"private\"` marks a\n * platform-public conversation as private; nothing can widen visibility\n * beyond what the platform grants, so \"public\" is never stored here.\n */\n office: Type.Optional(\n Type.Object({\n visibility: Type.Optional(Type.Literal(\"private\")),\n }),\n ),\n sandbox: Type.Optional(\n Type.Object({\n cpus: Type.Optional(Type.String()),\n memory: Type.Optional(Type.String()),\n boost: Type.Optional(\n Type.Object({\n cpus: Type.Optional(Type.String()),\n memory: Type.Optional(Type.String()),\n }),\n ),\n /**\n * Retired door-policy keys (ADR 0008). Still accepted so existing files\n * load, never copied into AgentConfig, and removed by\n * `mikan office migrate-door-policy`.\n */\n image: Type.Optional(\n Type.Object({\n workspaceMount: Type.Optional(\n Type.Union([Type.Literal(\"private\"), Type.Literal(\"full\")]),\n ),\n }),\n ),\n workspace: Type.Optional(\n Type.Object({\n doorPolicy: Type.Optional(\n Type.Union([Type.Literal(\"isolated\"), Type.Literal(\"trusted\")]),\n ),\n layout: Type.Optional(\n Type.Union([\n Type.Literal(\"conversation\"),\n Type.Literal(\"shared-support\"),\n Type.Literal(\"full\"),\n ]),\n ),\n visibility: Type.Optional(Type.Union([Type.Literal(\"public\"), Type.Literal(\"private\")])),\n }),\n ),\n defaultSharedVault: Type.Optional(Type.String()),\n }),\n ),\n /**\n * MCP servers, keyed by name. Merged per key across scopes: a conversation\n * entry overrides (or, with `disabled: true`, turns off) the same-name\n * global entry; other global entries stay available. `open-connector` is an\n * ordinary entry that the host fills in from `OPENCONNECTOR_ENDPOINT` when\n * neither scope declares it (see `src/harness/open-connector.ts`).\n */\n mcpServers: Type.Optional(\n Type.Record(\n Type.String(),\n Type.Object({\n command: Type.Optional(Type.String()),\n args: Type.Optional(Type.Array(Type.String())),\n env: Type.Optional(Type.Record(Type.String(), Type.String())),\n url: Type.Optional(Type.String()),\n headers: Type.Optional(Type.Record(Type.String(), Type.String())),\n disabled: Type.Optional(Type.Boolean()),\n }),\n ),\n ),\n});\n\ntype SettingsFileConfig = Static<typeof SettingsFileSchema>;\ntype SandboxFileSettings = NonNullable<SettingsFileConfig[\"sandbox\"]>;\n\nfunction loadSettingsFile(settingsPath: string): SettingsFileConfig | undefined {\n return readJsonSchemaFileIfExists(settingsPath, SettingsFileSchema, (detail) =>\n detail === \"unexpected JSON shape\"\n ? `Malformed settings file at ${settingsPath}: expected a JSON object at the top level`\n : `Malformed settings file at ${settingsPath}: ${detail}`,\n );\n}\n\nfunction normalizeSettingsConfig(config: SettingsFileConfig): Partial<AgentConfig> {\n return {\n ...(config.llm?.provider !== undefined ? { provider: config.llm.provider } : {}),\n ...(config.llm?.model !== undefined ? { model: config.llm.model } : {}),\n ...(config.llm?.thinkingLevel !== undefined ? { thinkingLevel: config.llm.thinkingLevel } : {}),\n ...(config.sentry?.dsn !== undefined ? { sentryDsn: config.sentry.dsn } : {}),\n ...(config.sandbox !== undefined ? { sandbox: normalizeSandboxSettings(config.sandbox) } : {}),\n ...(config.slack !== undefined ? { slack: config.slack } : {}),\n ...(config.mcpServers !== undefined ? { mcpServers: config.mcpServers } : {}),\n };\n}\n\n/**\n * File shape → in-memory shape for the sandbox group. An empty or\n * whitespace-only `defaultSharedVault` means \"no default\" and is dropped;\n * non-empty values are trimmed. Everything else passes through as-is.\n */\nfunction normalizeSandboxSettings(sandbox: SandboxFileSettings): SandboxSettings {\n const defaultSharedVault = sandbox.defaultSharedVault?.trim();\n // Retired `image.workspaceMount` and `workspace` are dropped here: office\n // visibility comes from the platform (ADR 0008), never from these keys.\n return {\n ...(sandbox.cpus !== undefined ? { cpus: sandbox.cpus } : {}),\n ...(sandbox.memory !== undefined ? { memory: sandbox.memory } : {}),\n ...(sandbox.boost !== undefined ? { boost: sandbox.boost } : {}),\n ...(defaultSharedVault ? { defaultSharedVault } : {}),\n };\n}\n\n/**\n * Merge two sandbox settings groups. The merge invariant is LEAF-LEVEL:\n * an override that only sets `sandbox.memory` keeps the base `sandbox.cpus`,\n * and an override that only sets `boost.memory` keeps the base `boost.cpus`\n * (same for `image`). This mirrors how the fields merged when they were\n * flat top-level keys; a group-level spread would silently drop base leaves.\n */\nfunction mergeSandboxSettings(\n base: SandboxSettings | undefined,\n override: SandboxSettings | undefined,\n): SandboxSettings | undefined {\n if (!base) return override;\n if (!override) return base;\n return {\n ...base,\n ...override,\n ...(base.boost || override.boost ? { boost: { ...base.boost, ...override.boost } } : {}),\n };\n}\n\nfunction getSettingsPath(): string {\n return join(effectiveStateDir(), \"settings.json\");\n}\n\nfunction requireGlobalSettings(): SettingsFileConfig {\n const settingsPath = getSettingsPath();\n const config = loadSettingsFile(settingsPath);\n if (!config) {\n throw new MissingGlobalSettingsError(settingsPath);\n }\n return config;\n}\n\nfunction requireString(value: string | undefined, path: string): string {\n if (!value) {\n throw new Error(\n `Missing required global setting: ${path}. Run \\`mikan --onboard\\` to create settings.json.`,\n );\n }\n return value;\n}\n\nfunction toAgentConfig(fromFile: Partial<AgentConfig>): AgentConfig {\n const provider = requireString(fromFile.provider, \"llm.provider\");\n const model = requireString(fromFile.model, \"llm.model\");\n const thinkingLevel = requireString(fromFile.thinkingLevel, \"llm.thinkingLevel\") as ThinkingLevel;\n const sentryDsn = sentryDsnFrom(fromFile.sentryDsn);\n const sandbox = fromFile.sandbox;\n const slack = fromFile.slack;\n const mcpServers = fromFile.mcpServers;\n\n return {\n provider,\n model,\n thinkingLevel,\n sentryDsn,\n sandbox,\n slack,\n mcpServers,\n };\n}\n\nfunction loadRawGlobalSettings(): Partial<AgentConfig> {\n return normalizeSettingsConfig(requireGlobalSettings());\n}\n\nexport function loadGlobalSettings(): AgentConfig {\n return toAgentConfig(loadRawGlobalSettings());\n}\n\n/**\n * Host-authoritative location of a conversation's settings file:\n * `<office state dir>/settings.json`. The Office value names both the\n * state-dir key and the legacy pre-host-migration location (its workspace\n * dir) — the key is never inferred from a directory basename.\n *\n * Conversation settings used to live at `<conversationDir>/settings.json`,\n * but conversation dirs are bind-mounted read-write into sandbox containers\n * in image mode — code inside the sandbox could edit its own settings.json\n * and flip `sandbox.image.workspaceMount` to \"full\", remounting the entire\n * workspace into its container (cross-conversation access). Settings are an\n * administrator surface, so they live under the host-only state dir.\n *\n * Migration: on first access per conversation, a legacy\n * `<conversationDir>/settings.json` is moved here. The new file's existence\n * (an empty `{}` is written when there is nothing to migrate) is the\n * migration marker — a legacy file (re)appearing later, e.g. planted from\n * inside the sandbox, is never read again.\n */\nexport function conversationSettingsPath(office: Office): string {\n const hostPath = join(office.stateDir, \"settings.json\");\n if (existsSync(hostPath)) {\n assertSettingsFile(hostPath, \"Host conversation settings\");\n return hostPath;\n }\n\n ensureDirExists(dirname(hostPath));\n const legacyPath = join(office.dir, \"settings.json\");\n let content = \"{}\\n\";\n let migrated = false;\n if (existsSync(legacyPath)) {\n assertSettingsFile(legacyPath, \"Legacy conversation settings\");\n content = readFileSync(legacyPath, \"utf-8\");\n // Validate before moving the file. A malformed legacy file must fail\n // closed and remain available for an operator to repair.\n loadSettingsFile(legacyPath);\n migrated = true;\n }\n atomicWritePrivateFile(hostPath, content);\n if (migrated) {\n try {\n rmSync(legacyPath);\n } catch (err) {\n log.logWarning(`Could not remove legacy conversation settings: ${legacyPath}`, String(err));\n }\n log.logInfo(`Migrated conversation settings to host-only path: ${hostPath}`);\n }\n return hostPath;\n}\n\nfunction assertSettingsFile(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.isFile()) {\n throw new Error(`${label} must be a regular non-symlink file: ${path}`);\n }\n}\n\nconst AUTO_REPLY_FILE = \"auto-reply\";\nconst AUTO_REPLY_DISABLED_FILE = \"auto-reply.disabled\";\n\nexport function slackConversationAutoReplyEnabled(office: Office): boolean {\n return existsSync(join(office.dir, AUTO_REPLY_FILE));\n}\n\nexport function setSlackConversationAutoReply(office: Office, enabled: boolean): void {\n ensureDirExists(office.dir);\n const enabledPath = join(office.dir, AUTO_REPLY_FILE);\n const disabledPath = join(office.dir, AUTO_REPLY_DISABLED_FILE);\n const targetPath = enabled ? enabledPath : disabledPath;\n const otherPath = enabled ? disabledPath : enabledPath;\n\n if (existsSync(otherPath)) {\n renameSync(otherPath, targetPath);\n return;\n }\n if (enabled && !existsSync(targetPath)) {\n atomicWritePrivateFile(targetPath, \"\");\n }\n}\n\nexport function resolveConversationSettings(office: Office): AgentConfig {\n const globalConfig = loadRawGlobalSettings();\n const conversationConfig = normalizeSettingsConfig(\n loadSettingsFile(conversationSettingsPath(office)) ?? {},\n );\n // MCP servers merge per key: a conversation redefines or disables individual\n // servers without losing the rest of the global set.\n const mcpServers = { ...globalConfig.mcpServers, ...conversationConfig.mcpServers };\n // The sandbox group merges at the leaf level (see mergeSandboxSettings):\n // a conversation that only sets sandbox.memory keeps the global sandbox.cpus.\n const sandbox = mergeSandboxSettings(globalConfig.sandbox, conversationConfig.sandbox);\n return toAgentConfig({\n ...globalConfig,\n ...conversationConfig,\n ...(sandbox ? { sandbox } : {}),\n ...(Object.keys(mcpServers).length > 0 ? { mcpServers } : {}),\n });\n}\n\n/**\n * True when `child` is `parent` or a path inside it. Purely lexical (no\n * symlink resolution) — used for configuration sanity checks, not as the\n * final security boundary.\n */\nexport function isPathInside(child: string, parent: string): boolean {\n const parentPath = resolve(parent);\n const childPath = resolve(child);\n return childPath === parentPath || childPath.startsWith(parentPath + \"/\");\n}\n\n/**\n * The state dir (settings, office records, vaults) must never live inside\n * the working dir: conversation opt-in \"full\" mode mounts the entire working\n * dir read-write into sandbox containers, which would expose host-authoritative\n * state and credentials. Fatal under sandboxed modes; host mode has no mounts,\n * so only warn about the bad hygiene.\n */\nexport function assertStateDirOutsideWorkspace(\n stateDir: string,\n workingDir: string,\n sandboxType: string,\n): void {\n if (!isPathInside(stateDir, workingDir)) return;\n const message =\n `--state-dir (${stateDir}) must not be inside the working directory (${workingDir}): ` +\n `sandbox containers mount the working directory, and a mounted state dir ` +\n `would expose settings, office records, vaults, and credentials to sandboxed code.`;\n if (sandboxType === \"host\") {\n log.logWarning(\"Insecure state dir location\", message);\n return;\n }\n throw new Error(message);\n}\n\n/** Settings-file DSN wins over SENTRY_DSN env — the rule lives only here. */\nfunction sentryDsnFrom(fromFile: string | undefined): string | undefined {\n return fromFile || readEnv(\"SENTRY_DSN\");\n}\n\nexport function resolveSentryDsn(): string | undefined {\n const fromFile = normalizeSettingsConfig(loadSettingsFile(getSettingsPath()) ?? {});\n return sentryDsnFrom(fromFile.sentryDsn);\n}\n\nexport function createGlobalSettingsFile(stateDir: string, llm?: OnboardLlmChoice): string {\n const settingsPath = join(stateDir, \"settings.json\");\n if (existsSync(settingsPath)) {\n throw new Error(`Global settings already exists at ${settingsPath}`);\n }\n ensureDirExists(stateDir);\n const settings: SettingsFileConfig = llm\n ? {\n ...ONBOARD_SETTINGS,\n llm: {\n ...ONBOARD_SETTINGS.llm,\n provider: llm.provider,\n model: llm.model,\n },\n }\n : ONBOARD_SETTINGS;\n atomicWritePrivateFile(settingsPath, JSON.stringify(settings, null, 2));\n return settingsPath;\n}\n\n/**\n * Externally-visible base URL of the link/OAuth server, e.g.\n * `https://mikan.example.com` (no trailing slash). Read from `LINK_URL` or\n * `MIKAN_LINK_URL`, the same env var the bot uses to build credential onboarding links.\n */\nexport function resolveLinkBaseUrl(): string | undefined {\n const raw = readEnv(\"LINK_URL\");\n if (!raw) return undefined;\n return raw.replace(/\\/+$/, \"\");\n}\n\nfunction hasDefinedValue(values: Record<string, unknown> | undefined): boolean {\n return values !== undefined && Object.values(values).some((value) => value !== undefined);\n}\n\nfunction compactSettingsConfig(config: SettingsFileConfig): SettingsFileConfig {\n return {\n ...(hasDefinedValue(config.llm) ? { llm: config.llm } : {}),\n ...(hasDefinedValue(config.sentry) ? { sentry: config.sentry } : {}),\n ...(hasDefinedValue(config.sandbox) ? { sandbox: config.sandbox } : {}),\n ...(hasDefinedValue(config.slack) ? { slack: config.slack } : {}),\n ...(hasDefinedValue(config.office) ? { office: config.office } : {}),\n // An empty map means \"all servers removed\".\n ...(config.mcpServers !== undefined ? { mcpServers: config.mcpServers } : {}),\n };\n}\n\nfunction patchSettingsConfig(\n existing: SettingsFileConfig,\n config: Partial<AgentConfig>,\n): SettingsFileConfig {\n const patched: SettingsFileConfig = {\n ...existing,\n llm: {\n ...existing.llm,\n ...(config.provider !== undefined ? { provider: config.provider } : {}),\n ...(config.model !== undefined ? { model: config.model } : {}),\n ...(config.thinkingLevel !== undefined ? { thinkingLevel: config.thinkingLevel } : {}),\n },\n sentry: {\n ...existing.sentry,\n ...(config.sentryDsn !== undefined ? { dsn: config.sentryDsn } : {}),\n },\n // Leaf-level merge: a patch that only sets sandbox.boost.memory keeps the\n // existing boost.cpus (and every other existing leaf). compactSettingsConfig\n // drops the group entirely when it ends up with no defined values.\n sandbox: mergeSandboxSettings(existing.sandbox, config.sandbox) ?? {},\n slack: {\n ...existing.slack,\n ...config.slack,\n },\n // Office visibility has its own writer (setOfficeVisibilityOverride); the\n // generic patch must not drop it.\n ...(existing.office !== undefined ? { office: existing.office } : {}),\n // The portal edits the full MCP map, and\n // a merge would make removing a server impossible.\n ...(config.mcpServers !== undefined ? { mcpServers: config.mcpServers } : {}),\n };\n return compactSettingsConfig(patched);\n}\n\nfunction loadSettingsFileForUpdate(\n settingsPath: string,\n defaultSettings: SettingsFileConfig,\n): SettingsFileConfig {\n if (!existsSync(settingsPath)) return defaultSettings;\n try {\n return loadSettingsFile(settingsPath) ?? {};\n } catch (err) {\n const detail = err instanceof Error ? err.message : String(err);\n const message = detail.startsWith(\"Malformed settings file\")\n ? detail.replace(\"Malformed settings file\", \"Refusing to overwrite malformed settings file\")\n : detail;\n throw new Error(message, { cause: err });\n }\n}\n\nfunction updateSettingsFile(\n settingsPath: string,\n patch: Partial<AgentConfig>,\n defaultSettings: SettingsFileConfig,\n): void {\n const existing = loadSettingsFileForUpdate(settingsPath, defaultSettings);\n ensureDirExists(dirname(settingsPath));\n atomicWritePrivateFile(\n settingsPath,\n JSON.stringify(patchSettingsConfig(existing, patch), null, 2),\n );\n}\n\nexport function updateGlobalSettings(patch: Partial<AgentConfig>): void {\n updateSettingsFile(getSettingsPath(), patch, ONBOARD_SETTINGS);\n}\n\nexport function updateConversationSettings(office: Office, patch: Partial<AgentConfig>): void {\n updateSettingsFile(conversationSettingsPath(office), patch, {});\n}\n\n/**\n * The two scope-level MCP server maps, unmerged: the portal edits each scope's\n * own file, so it needs the raw per-scope values, not the effective merge\n * (`resolveConversationSettings` owns that).\n */\nexport function loadScopeMcpServers(office: Office): {\n global: Record<string, McpServerConfig>;\n conversation: Record<string, McpServerConfig>;\n} {\n return {\n global: loadRawGlobalSettings().mcpServers ?? {},\n conversation: loadSettingsFile(conversationSettingsPath(office))?.mcpServers ?? {},\n };\n}\n\n/**\n * The conversation's own visibility override, or null when it follows the\n * platform. Only \"private\" can be stored: an operator may narrow a public\n * channel, never widen a private one (see ADR 0008).\n */\nexport function loadOfficeVisibilityOverride(office: Office): \"private\" | null {\n return loadSettingsFile(conversationSettingsPath(office))?.office?.visibility ?? null;\n}\n\nexport function setOfficeVisibilityOverride(office: Office, visibility: \"private\" | null): void {\n const settingsPath = conversationSettingsPath(office);\n const existing = loadSettingsFileForUpdate(settingsPath, {});\n const { office: _previous, ...rest } = existing;\n ensureDirExists(dirname(settingsPath));\n atomicWritePrivateFile(\n settingsPath,\n JSON.stringify(\n compactSettingsConfig({ ...rest, ...(visibility ? { office: { visibility } } : {}) }),\n null,\n 2,\n ),\n );\n}\n\nexport interface DoorPolicyMigrationReport {\n /** Retired keys removed from the global settings file. */\n global: string[];\n conversations: { key: OfficeKey; removed: string[]; visibility?: \"private\" }[];\n skipped: { key: OfficeKey | \"global\"; reason: string }[];\n}\n\nconst RETIRED_KEYS = {\n image: \"sandbox.image.workspaceMount\",\n workspace: \"sandbox.workspace\",\n} as const;\n\n/**\n * Strip the retired door-policy keys from one settings file. Returns the\n * removed key paths, or an empty list when nothing had to change (the file is\n * then left byte-for-byte alone, which also preserves `{}` migration markers).\n * The only value carried forward is an explicit shared-support `private`\n * visibility, which maps onto `office.visibility` (ADR 0008). Every other\n * retired combination — `full`, `isolated`, legacy `private` — is dropped\n * without deriving a grant.\n */\nfunction stripRetiredDoorPolicy(\n settingsPath: string,\n allowVisibilityCarry: boolean,\n): { removed: string[]; visibility?: \"private\" } {\n const existing = loadSettingsFile(settingsPath);\n if (!existing?.sandbox) return { removed: [] };\n const { image, workspace, ...sandboxRest } = existing.sandbox;\n const removed: string[] = [];\n if (image?.workspaceMount !== undefined) removed.push(RETIRED_KEYS.image);\n if (workspace !== undefined) removed.push(RETIRED_KEYS.workspace);\n if (removed.length === 0) return { removed };\n const carry =\n allowVisibilityCarry &&\n workspace?.doorPolicy === \"trusted\" &&\n workspace.layout !== \"full\" &&\n workspace.visibility === \"private\";\n const { workspaceMount: _mount, ...imageRest } = image ?? {};\n const sandbox: SandboxFileSettings = {\n ...sandboxRest,\n ...(hasDefinedValue(imageRest) ? { image: imageRest } : {}),\n };\n const next: SettingsFileConfig = {\n ...existing,\n sandbox,\n ...(carry ? { office: { ...existing.office, visibility: \"private\" as const } } : {}),\n };\n atomicWritePrivateFile(settingsPath, JSON.stringify(compactSettingsConfig(next), null, 2));\n return { removed, ...(carry ? { visibility: \"private\" as const } : {}) };\n}\n\n/**\n * One-time removal of the retired door-policy settings from the global file\n * and every registered office (ADR 0008). Run with the daemon stopped.\n */\nexport function migrateLegacyDoorPolicy(workspace: Workspace): DoorPolicyMigrationReport {\n const report: DoorPolicyMigrationReport = { global: [], conversations: [], skipped: [] };\n try {\n report.global = stripRetiredDoorPolicy(\n join(workspace.stateDir, \"settings.json\"),\n false,\n ).removed;\n } catch (error) {\n report.skipped.push({\n key: \"global\",\n reason: error instanceof Error ? error.message : String(error),\n });\n }\n for (const record of listRegisteredOffices(workspace.stateDir)) {\n const office = workspace.office(record);\n const settingsPath = join(office.stateDir, \"settings.json\");\n if (!existsSync(settingsPath)) continue;\n try {\n const result = stripRetiredDoorPolicy(settingsPath, true);\n if (result.removed.length > 0) report.conversations.push({ key: office.key, ...result });\n } catch (error) {\n report.skipped.push({\n key: office.key,\n reason: error instanceof Error ? error.message : String(error),\n });\n }\n }\n return report;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-messages.d.ts","sourceRoot":"","sources":["../src/platform-messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAEhE,eAAO,MAAM,YAAY,UAAU,CAAC;AAEpC,KAAK,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAoB5D,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAEnE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAE7D;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAE5D;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAK/D;AAED,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,QAAQ,CAAA;CAAE,GAC7B,MAAM,CAMR;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAErF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"platform-messages.js","sourceRoot":"","sources":["../src/platform-messages.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC;AAIpC,SAAS,mBAAmB,CAAC,MAAsB;IACjD,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC;IAC9C,IAAI,kBAAkB,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC;IACxE,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,SA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YAAY,EAAE,GAAG,MAAM,SAAS,OAAO,aAAa,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAsB,EAAE,UAAkB;IAC3E,OAAO,YAAY,CAAC,mBAAmB,CAAC,MAAM,CAAC,EAAE,oBAAoB,UAAU,GAAG,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import type { MessagingBot, MessagingInfo } from \"./adapter.js\";\n\nexport const PRODUCT_NAME = \"mikan\";\n\ntype PlatformSource = MessagingBot | MessagingInfo | string;\n\nfunction resolvePlatformName(source: PlatformSource): string {\n if (typeof source === \"string\") return source;\n if (\"getMessagingInfo\" in source) return source.getMessagingInfo().name;\n return source.name;\n}\n\nfunction supportsHtmlFormatting(platformName: string): boolean {\n return platformName === \"telegram\";\n}\n\nfunction formatItalic(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? text : `_${text}_`;\n}\n\nfunction formatCode(platformName: string, text: string): string {\n return supportsHtmlFormatting(platformName) ? `<code>${text}</code>` : `\\`${text}\\``;\n}\n\nexport function formatNothingRunning(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Nothing running.\");\n}\n\nexport function formatStopping(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopping…\");\n}\n\nexport function formatStopped(source: PlatformSource): string {\n return formatItalic(resolvePlatformName(source), \"Stopped.\");\n}\n\nexport function formatRestarting(source: PlatformSource): string {\n return formatItalic(\n resolvePlatformName(source),\n \"Restarting for an update; this reply was interrupted. Please send your message again.\",\n );\n}\n\nexport function formatAlreadyWorking(\n source: PlatformSource,\n stopCommand: string,\n options?: { scope?: \"thread\" },\n): string {\n const platformName = resolvePlatformName(source);\n const command = formatCode(platformName, stopCommand);\n const prefix =\n options?.scope === \"thread\" ? \"Already working in this thread.\" : \"Already working.\";\n return formatItalic(platformName, `${prefix} Send ${command} to cancel.`);\n}\n\nexport function formatForceStopped(source: PlatformSource, actorLabel: string): string {\n return formatItalic(resolvePlatformName(source), `Force stopped by ${actorLabel}.`);\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-lifecycle.d.ts","sourceRoot":"","sources":["../src/process-lifecycle.ts"],"names":[],"mappings":"AAAA,UAAU,sBAAsB;IAC9B,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,qBAAqB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACrC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAaD,mFAAmF;AACnF,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,EAAE,GAC3D,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,sBAAsB,GAC9B,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAqC3C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"process-lifecycle.js","sourceRoot":"","sources":["../src/process-lifecycle.ts"],"names":[],"mappings":"AAQA,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,6FAA6F;AAC7F,SAAS,eAAe,CAAC,KAAY;IACnC,IAAI,CAAC,CAAC,KAAK,YAAY,cAAc,CAAC;QAAE,OAAO,KAAK,CAAC,OAAO,CAAC;IAC7D,MAAM,KAAK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AG,CAAC,KAAK,IAAI,EAAE;YACrB,IAAI,QAAQ,GAAG,CAAC,CAAC;YACjB,IAAI,CAAC;gBACH,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;YACvB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;gBAC/B,QAAQ,GAAG,CAAC,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;gBACnE,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAChC,CAAC;YAED,IAAI,CAAC;gBACH,IAAI,CAAC,CAAC,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAC,EAAE,CAAC;oBAC7C,QAAQ,GAAG,CAAC,CAAC;oBACb,OAAO,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;gBACnD,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,QAAQ,GAAG,CAAC,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;YACxE,CAAC;YAED,IAAI,CAAC,MAAM;gBAAE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC,CAAC,EAAE,CAAC;QACL,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["interface ProcessShutdownOptions {\n stop: () => Promise<void>;\n shutdownObservability: () => Promise<boolean>;\n captureError: (error: Error) => void;\n warn: (message: string, details?: string) => void;\n exit: (code: number) => void;\n}\n\nfunction asError(error: unknown): Error {\n return error instanceof Error ? error : new Error(String(error));\n}\n\n/** Flatten AggregateError trees so the log names every failed step, not just the wrapper. */\nfunction describeFailure(error: Error): string {\n if (!(error instanceof AggregateError)) return error.message;\n const inner = error.errors.map((entry) => describeFailure(asError(entry)));\n return `${error.message}: ${inner.join(\"; \")}`;\n}\n\n/** Run every shutdown phase in order without letting one failure skip the rest. */\nexport async function runShutdownSteps(\n steps: readonly { name: string; run: () => Promise<void> }[],\n): Promise<void> {\n const failures: Error[] = [];\n for (const step of steps) {\n try {\n await step.run();\n } catch (error) {\n const failure = asError(error);\n failures.push(new Error(`${step.name}: ${failure.message}`, { cause: failure }));\n }\n }\n if (failures.length > 0) throw new AggregateError(failures, \"Graceful shutdown failed\");\n}\n\n/**\n * Owns process-signal shutdown policy: one graceful attempt, then a forced\n * non-zero exit when another signal says the operator no longer wants to wait.\n */\nexport function createProcessShutdownHandler(\n options: ProcessShutdownOptions,\n): (signal: NodeJS.Signals) => Promise<void> {\n let shutdown: Promise<void> | undefined;\n let forced = false;\n\n return function handleSignal(signal: NodeJS.Signals): Promise<void> {\n if (shutdown) {\n forced = true;\n options.warn(`Received ${signal} during shutdown; forcing exit`);\n options.exit(1);\n return Promise.resolve();\n }\n\n shutdown = (async () => {\n let exitCode = 0;\n try {\n await options.stop();\n } catch (error) {\n const failure = asError(error);\n exitCode = 1;\n options.warn(\"Graceful shutdown failed\", describeFailure(failure));\n options.captureError(failure);\n }\n\n try {\n if (!(await options.shutdownObservability())) {\n exitCode = 1;\n options.warn(\"Observability shutdown timed out\");\n }\n } catch (error) {\n exitCode = 1;\n options.warn(\"Observability shutdown failed\", asError(error).message);\n }\n\n if (!forced) options.exit(exitCode);\n })();\n return shutdown;\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings-mutation.d.ts","sourceRoot":"","sources":["../src/settings-mutation.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAcpG,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAC1B,mBAAmB,CAYrB;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,wBAAwB,GAAG,SAAS,EAC7C,KAAK,EAAE,OAAO,CAAC,WAAW,CAAC,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,kBAAkB,EAAE,aAAa,EAAE,CAAA;CAAE,CAKnD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,kBAAkB,GAAG,SAAS,EACvC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,SAAS,GAAG,IAAI,GAC3B,mBAAmB,CAMrB"}