@songsid/agend 2.3.4-beta.8 → 2.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/THIRD_PARTY_NOTICES.md +37 -0
  2. package/dist/agent-cli-instructions.md +1 -1
  3. package/dist/agent-credentials.d.ts +24 -0
  4. package/dist/agent-credentials.js +66 -0
  5. package/dist/agent-credentials.js.map +1 -0
  6. package/dist/agent-endpoint.d.ts +3 -1
  7. package/dist/agent-endpoint.js +13 -0
  8. package/dist/agent-endpoint.js.map +1 -1
  9. package/dist/auth-api.js +5 -0
  10. package/dist/auth-api.js.map +1 -1
  11. package/dist/authority/session-authorizations.d.ts +28 -4
  12. package/dist/authority/session-authorizations.js +63 -17
  13. package/dist/authority/session-authorizations.js.map +1 -1
  14. package/dist/backend/antigravity.js +3 -1
  15. package/dist/backend/antigravity.js.map +1 -1
  16. package/dist/backend/codex-footer-hints.d.ts +4 -0
  17. package/dist/backend/codex-footer-hints.js +27 -0
  18. package/dist/backend/codex-footer-hints.js.map +1 -0
  19. package/dist/backend/codex-metadata.d.ts +14 -0
  20. package/dist/backend/codex-metadata.js +45 -0
  21. package/dist/backend/codex-metadata.js.map +1 -1
  22. package/dist/backend/codex-speed.d.ts +14 -0
  23. package/dist/backend/codex-speed.js +35 -0
  24. package/dist/backend/codex-speed.js.map +1 -0
  25. package/dist/backend/codex.js +17 -5
  26. package/dist/backend/codex.js.map +1 -1
  27. package/dist/backend/kiro.js +11 -1
  28. package/dist/backend/kiro.js.map +1 -1
  29. package/dist/backend/muse.js +5 -3
  30. package/dist/backend/muse.js.map +1 -1
  31. package/dist/cache-ledger.d.ts +95 -0
  32. package/dist/cache-ledger.js +276 -4
  33. package/dist/cache-ledger.js.map +1 -1
  34. package/dist/cache-service.d.ts +5 -0
  35. package/dist/cache-service.js +16 -4
  36. package/dist/cache-service.js.map +1 -1
  37. package/dist/channel/adapters/discord.js +11 -3
  38. package/dist/channel/adapters/discord.js.map +1 -1
  39. package/dist/channel/adapters/telegram.d.ts +51 -0
  40. package/dist/channel/adapters/telegram.js +235 -17
  41. package/dist/channel/adapters/telegram.js.map +1 -1
  42. package/dist/channel/mcp-tools.js +1 -1
  43. package/dist/channel/mcp-tools.js.map +1 -1
  44. package/dist/channel/types.d.ts +2 -0
  45. package/dist/config-validator.js +5 -0
  46. package/dist/config-validator.js.map +1 -1
  47. package/dist/cross-instance-notice.d.ts +10 -0
  48. package/dist/cross-instance-notice.js +67 -5
  49. package/dist/cross-instance-notice.js.map +1 -1
  50. package/dist/daemon.d.ts +3 -0
  51. package/dist/daemon.js +11 -4
  52. package/dist/daemon.js.map +1 -1
  53. package/dist/export-import.d.ts +7 -0
  54. package/dist/export-import.js +44 -10
  55. package/dist/export-import.js.map +1 -1
  56. package/dist/fleet-context.d.ts +2 -0
  57. package/dist/fleet-manager.d.ts +93 -4
  58. package/dist/fleet-manager.js +451 -39
  59. package/dist/fleet-manager.js.map +1 -1
  60. package/dist/general-knowledge/skills/concepts/SKILL.md +3 -0
  61. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
  62. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -1
  63. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +7 -2
  64. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  65. package/dist/instance-config-impact.js +2 -0
  66. package/dist/instance-config-impact.js.map +1 -1
  67. package/dist/instance-lifecycle.d.ts +6 -2
  68. package/dist/instance-lifecycle.js +11 -6
  69. package/dist/instance-lifecycle.js.map +1 -1
  70. package/dist/instance-topic-delete.d.ts +77 -0
  71. package/dist/instance-topic-delete.js +123 -0
  72. package/dist/instance-topic-delete.js.map +1 -0
  73. package/dist/instructions.d.ts +1 -1
  74. package/dist/instructions.js +1 -1
  75. package/dist/instructions.js.map +1 -1
  76. package/dist/locale.js +33 -1
  77. package/dist/locale.js.map +1 -1
  78. package/dist/log-service.d.ts +28 -0
  79. package/dist/log-service.js +29 -0
  80. package/dist/log-service.js.map +1 -1
  81. package/dist/log-steps.d.ts +4 -3
  82. package/dist/log-steps.js +32 -7
  83. package/dist/log-steps.js.map +1 -1
  84. package/dist/logger.d.ts +12 -0
  85. package/dist/logger.js +43 -1
  86. package/dist/logger.js.map +1 -1
  87. package/dist/missed-offline.d.ts +25 -0
  88. package/dist/missed-offline.js +79 -0
  89. package/dist/missed-offline.js.map +1 -0
  90. package/dist/needs-you-hub.d.ts +6 -1
  91. package/dist/needs-you-hub.js +30 -7
  92. package/dist/needs-you-hub.js.map +1 -1
  93. package/dist/needs-you.d.ts +16 -2
  94. package/dist/needs-you.js +9 -1
  95. package/dist/needs-you.js.map +1 -1
  96. package/dist/outbound-handlers.js +3 -3
  97. package/dist/outbound-handlers.js.map +1 -1
  98. package/dist/outbound-schemas.js +5 -2
  99. package/dist/outbound-schemas.js.map +1 -1
  100. package/dist/scheduler/db.d.ts +2 -1
  101. package/dist/scheduler/db.js +23 -9
  102. package/dist/scheduler/db.js.map +1 -1
  103. package/dist/settings-api.d.ts +13 -0
  104. package/dist/settings-api.js +22 -1
  105. package/dist/settings-api.js.map +1 -1
  106. package/dist/settings-change.js +16 -1
  107. package/dist/settings-change.js.map +1 -1
  108. package/dist/settings-instance-patch.js +27 -0
  109. package/dist/settings-instance-patch.js.map +1 -1
  110. package/dist/tool-progress.d.ts +2 -0
  111. package/dist/tool-progress.js +19 -3
  112. package/dist/tool-progress.js.map +1 -1
  113. package/dist/topic-commands.js +4 -0
  114. package/dist/topic-commands.js.map +1 -1
  115. package/dist/ui/chat-md-strings.js +9 -0
  116. package/dist/ui/chat-strings.js +2 -2
  117. package/dist/ui/chat-thread.js +53 -3
  118. package/dist/ui/fleet-usage.js +90 -27
  119. package/dist/ui/panel-chat.js +5 -2
  120. package/dist/ui/panel-needs.js +13 -5
  121. package/dist/ui/preview-panel.js +78 -2
  122. package/dist/ui/settings-codex-copy.js +19 -0
  123. package/dist/ui/settings-dialogs.js +8 -0
  124. package/dist/ui/settings-model.js +16 -2
  125. package/dist/ui/settings-strings.js +2 -2
  126. package/dist/ui/shared/app-i18n.js +2 -2
  127. package/dist/ui/shared/app.css +19 -0
  128. package/dist/ui/shared/panel-view.js +77 -4
  129. package/dist/ui/shared/usage-dialog.js +18 -1
  130. package/dist/ui/shared/view-history.css +17 -0
  131. package/dist/ui/shared/view-history.js +438 -0
  132. package/dist/ui/shared/view-strings.js +16 -0
  133. package/dist/usage/capacity.d.ts +69 -0
  134. package/dist/usage/capacity.js +119 -0
  135. package/dist/usage/capacity.js.map +1 -0
  136. package/dist/usage/i18n-keys.d.ts +1 -1
  137. package/dist/usage/i18n-keys.js +3 -0
  138. package/dist/usage/i18n-keys.js.map +1 -1
  139. package/dist/usage/profile-timeline.d.ts +16 -0
  140. package/dist/usage/profile-timeline.js +58 -0
  141. package/dist/usage/profile-timeline.js.map +1 -0
  142. package/dist/usage/quota-history.d.ts +43 -0
  143. package/dist/usage/quota-history.js +168 -0
  144. package/dist/usage/quota-history.js.map +1 -0
  145. package/dist/usage/usage-api.d.ts +31 -0
  146. package/dist/usage/usage-api.js +80 -1
  147. package/dist/usage/usage-api.js.map +1 -1
  148. package/dist/usage-report.d.ts +25 -1
  149. package/dist/usage-report.js +55 -4
  150. package/dist/usage-report.js.map +1 -1
  151. package/dist/usage-rollup.d.ts +6 -1
  152. package/dist/usage-rollup.js +16 -4
  153. package/dist/usage-rollup.js.map +1 -1
  154. package/dist/view-api.d.ts +16 -0
  155. package/dist/view-api.js +100 -16
  156. package/dist/view-api.js.map +1 -1
  157. package/dist/view-history.d.ts +84 -0
  158. package/dist/view-history.js +116 -0
  159. package/dist/view-history.js.map +1 -0
  160. package/dist/web-api.d.ts +6 -0
  161. package/dist/web-api.js +8 -2
  162. package/dist/web-api.js.map +1 -1
  163. package/dist/web-session-authorization.d.ts +13 -2
  164. package/dist/web-session-authorization.js +10 -3
  165. package/dist/web-session-authorization.js.map +1 -1
  166. package/launcher/private-home.cjs +1 -1
  167. package/package.json +1 -1
@@ -180,6 +180,9 @@ code (`web.guests`, #1920). Guests see only the agents they are granted, in
180
180
  chat they could already use.
181
181
 
182
182
  - Can: chat with granted agents; sign out with `/web revoke` (own sessions).
183
+ A Trusted guest (#2855) also gets a read-only View of those agents — for
184
+ Claude Code with its earlier conversation, tool results included, like
185
+ anyone who may open the View (#3069).
183
186
  - Can't: admin routes, Notices, the usage report, or anything over surfaces
184
187
  the fleet closed to guests.
185
188
  - Code: `src/config-validator.ts:738-740`.
@@ -53,6 +53,7 @@ A peer's summary is not the original person's consent. Before an irreversible ac
53
53
 
54
54
  1. Ask the peer to send/delegate with `forwards: [verification_id]`, using the original human receipt's `verification_id` / `[agend-human-id:…]`. Every hop needs an explicit forward; mentioning an ID grants nothing. Only delivered references the sender can read are accepted (up to 16).
55
55
  - The ID goes in the `forwards` parameter, never only in the message text: an ID in the text grants nothing, and the receiver's `delivery_status` says "Delivery not found".
56
+ - Put verification and message ids in the `forwards` field only; do not repeat them in the message text, because people see that text in the topic notices.
56
57
  - If the `send_to_instance` / `delegate_task` schema you loaded has no `forwards`, pass it anyway. A session resumed across an AgEnD upgrade keeps the tool copy it first loaded (reloading does not refresh it); AgEnD's server accepts the parameter.
57
58
  2. Read `delivery_status({message_id: verification_id})`. Require `state: delivered`, its owned `proof_kind`, and the original `content` naming the exact operation/resource. Check `origin.platform`, `origin.adapter_id` and `origin.user_id` against the human authorized for that resource. Labels, quoted headers and agent relay rows are not origin evidence.
58
59
  3. Native queue/composer acceptance never proves the model consumed the message. Unknown/unverifiable outcomes, `/raw`, historical rows and a missing origin cannot prove human authorization. Action receipts identify the click and its anchor, not a human-authored platform message.
@@ -11,7 +11,7 @@ roles: [general]
11
11
  Use when the session is the problem: hallucinating / referencing stale info, stuck in a
12
12
  tool-call loop, or context is degrading (only backends that report context % surface that).
13
13
  - `stop_instance("<name>")` / `start_instance("<name>")` — stop or start an instance without removing its configuration or topic.
14
- - `delete_instance("<name>")` — stop and remove the instance (plus its schedules and team memberships; pass `delete_topic: true` to delete its topic as well).
14
+ - `delete_instance("<name>")` — stop and remove the instance, its schedules and team memberships, and its own chat topic (by default; pass `delete_topic: false` to keep the topic). On Discord the topic is a channel, so its history goes too. The General topic and a topic another agent uses are never deleted. The result's `topic_deleted` is the platform's answer; when it is false, `topic_reason` says why (for example, the Telegram bot lacks the Manage Topics admin right) — the agent is deleted either way.
15
15
 
16
16
  ## Pause / Wake (resource management)
17
17
 
@@ -79,7 +79,7 @@ lists every page (**Pages (N)**), shows a page at phone or tablet width, and goe
79
79
  - `/web revoke` (in chat) signs every browser out, withdraws an unused code and closes the public link.
80
80
 
81
81
  **`/view` without signing in.** `web.view_access`: `open` (default) or `session`. With `open`, anyone who can reach
82
- the local address sees every instance's live terminal and the roster (status, context %, model, effort, backend,
82
+ the local address sees every instance's live terminal (for Claude Code with its earlier conversation, as below) and the roster (status, context %, model, effort, backend,
83
83
  tags, name, description, avatars, cards) and the usage meters — read only; editing says "Sign in to edit". Over a
84
84
  public link `/view` always needs sign-in.
85
85
 
@@ -101,7 +101,7 @@ They can chat there unless `web.guests.chat` is false, run only the commands the
101
101
  agent's channel (on the web: `/ctx`, `/steer`, `/btw`, `/cancel`; anything else is refused), open the usage panel, and the
102
102
  agent sees them as `via web (guest)`. A guest's app has no Fleet, Settings or Needs you. Each person is **Chat** (the
103
103
  default) or **Trusted** (#2855, `level: trusted` on the grant; Chat → Trusted waits for a fleet admin): a Trusted guest
104
- also gets a read-only **View** of those agents (no typing; 2 reads a second, 2 agents at once) and **search** of the chat
104
+ also gets a read-only **View** of those agents (no typing; 2 reads a second, 2 agents at once; for Claude Code with its earlier conversation) and **search** of the chat
105
105
  messages it can already see (6 a minute, 20 results; no messages between agents, tasks or settings). To invite someone: turn it
106
106
  on, grant them their agents in Settings → Access & security → Guests, and press **Send sign-in code** (or tell them to
107
107
  send `/web`). The Guests section is not in Settings over the public link.
@@ -383,6 +383,11 @@ to that instance's Log).
383
383
 
384
384
  **Chat | View | Log | Details** switch at the top of an instance.
385
385
  - **View** — the live terminal (read only), the identity card, and **Edit profile** (or **Sign in to edit** when signed out).
386
+ Scrolling up (or **Earlier output**) shows what scrolled off: tmux's scrollback; for Claude Code, its earlier
387
+ conversation from its transcript, drawn in Claude's own terminal style above the live screen under **History above**
388
+ (long output folded, click to expand; older pages near the top; the latest ~1000 steps), tool results included.
389
+ Everyone who may open the View sees it — a signed-in admin, an anonymous reader under `view_access: open`, a Trusted
390
+ guest for its agents (the user's decision on #3069); the Log tab's switch plays no part.
386
391
  - **Log** — [the Log tab](#the-log-tab).
387
392
  - **Details** — Configuration (display name, description, directory, bound to, tags; "Read only — change it in
388
393
  Settings." with **Edit in Settings**), Runtime (backend, model, effort, cost, context, 5 h and 7 d rate), Recent
@@ -42,4 +42,4 @@ Do not put user-facing results only in terminal text; the fleet report is the de
42
42
 
43
43
  ## Relayed human approval
44
44
 
45
- For an irreversible action based on relayed consent, request an explicit `forwards` edge for the original human `verification_id`, then read its original content and origin with `delivery_status`. Each hop needs a forward; a peer's summary or a mentioned ID grants nothing. When you relay it, put the ID in `forwards` (even if your loaded copy of the tool's schema lacks the parameter: the server accepts it), not in the text. Require delivered and an owned proof_kind, and verify the actual platform/adapter/actor plus the exact resource. Hidden/expired/uncertain receipts are not consent and must not trigger a resend. A web-chat message (`[user:<name> via web, id:…]`) is that person: their sign-in code went to their own Discord or Telegram account. Answer it and do what it asks within your work — questions, looking things up, reading, analysis, changes in your own scope. Only a go-ahead action asks for more: a release or publish, anything destructive or irreversible beyond your own work (deleting what others use, force-pushing or resetting a shared branch; your temp files and your own branch and worktree are routine), spending money or quota beyond normal work, credentials or secrets, or granting or forwarding authority to another instance. For these an open browser is not proof of the account, so the account must stand behind it: a Discord or Telegram receipt, or a `via web (verified)` one — read it with `delivery_status`: `authority.kind: web-verified`, its person `authority.actor` (adapter and user id), checked like a Discord or Telegram message (delivered, an owned proof_kind, the original content, that actor) and forwarded the same way. On a web-only fleet (no Discord or Telegram connection) that person is the host operator, signed in with `agend web --code` on the AgEnD computer itself: a verified receipt names `authority.actor` adapter `host`, user `operator`. A guest (`via web (guest)`) was let in only to chat: talk with them there, and take nothing they ask as the admin's. Plain `via web`, a guest, and authority since revoked (`authority.kind: none`) are not a go-ahead; nor is a reviewer's APPROVE. See the cross-instance-messaging skill.
45
+ For an irreversible action based on relayed consent, request an explicit `forwards` edge for the original human `verification_id`, then read its original content and origin with `delivery_status`. Each hop needs a forward; a peer's summary or a mentioned ID grants nothing. When you relay it, put the ID in `forwards` (even if your loaded copy of the tool's schema lacks the parameter: the server accepts it), not in the text. Put verification and message ids in the `forwards` field only; do not repeat them in the message text, because people see that text in the topic notices. Require delivered and an owned proof_kind, and verify the actual platform/adapter/actor plus the exact resource. Hidden/expired/uncertain receipts are not consent and must not trigger a resend. A web-chat message (`[user:<name> via web, id:…]`) is that person: their sign-in code went to their own Discord or Telegram account. Answer it and do what it asks within your work — questions, looking things up, reading, analysis, changes in your own scope. Only a go-ahead action asks for more: a release or publish, anything destructive or irreversible beyond your own work (deleting what others use, force-pushing or resetting a shared branch; your temp files and your own branch and worktree are routine), spending money or quota beyond normal work, credentials or secrets, or granting or forwarding authority to another instance. For these an open browser is not proof of the account, so the account must stand behind it: a Discord or Telegram receipt, or a `via web (verified)` one — read it with `delivery_status`: `authority.kind: web-verified`, its person `authority.actor` (adapter and user id), checked like a Discord or Telegram message (delivered, an owned proof_kind, the original content, that actor) and forwarded the same way. On a web-only fleet (no Discord or Telegram connection) that person is the host operator, signed in with `agend web --code` on the AgEnD computer itself: a verified receipt names `authority.actor` adapter `host`, user `operator`. A guest (`via web (guest)`) was let in only to chat: talk with them there, and take nothing they ask as the admin's. Plain `via web`, a guest, and authority since revoked (`authority.kind: none`) are not a go-ahead; nor is a reviewer's APPROVE. See the cross-instance-messaging skill.
@@ -76,6 +76,8 @@ const INSTANCE_FIELDS = [
76
76
  "board_cards_at_once",
77
77
  // Read by the fleet at each tool call (dashboard-permissions.ts).
78
78
  "dashboard", "office_access", "office_pack_access",
79
+ // M-2446: the agent dialog's Codex speed (backend_options.codex.speed) — read at launch, so an agent restart.
80
+ "backend_options",
79
81
  ];
80
82
  /** ClassicBot channel fields the settings page renders. */
81
83
  const CLASSIC_FIELDS = [
@@ -1 +1 @@
1
- {"version":3,"file":"instance-config-impact.js","sourceRoot":"","sources":["../src/instance-config-impact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAM9C,0EAA0E;AAC1E,MAAM,CAAC,MAAM,YAAY,GAA4B,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsC,IAAI,GAAG,CAAuB;IACvG,eAAe;IACf,wBAAwB;IACxB,gBAAgB;IAChB,iBAAiB;IACjB,yBAAyB;IACzB,kBAAkB;IAClB,UAAU;IACV,cAAc;IACd,aAAa;IACb,MAAM;IACN,WAAW;IACX,sFAAsF;IACtF,2BAA2B;IAC3B,wFAAwF;IACxF,qBAAqB;IACrB,oGAAoG;IACpG,WAAW,EAAE,eAAe,EAAE,oBAAoB;CACnD,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAwB,IAAI,GAAG,CAChE,CAAC,eAAe,EAAE,wBAAwB,EAAE,gBAAgB,CAAW;KACrE,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,wBAAwB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CACpD,CAAC;AAEF;;;GAGG;AACH,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC;IAC9D,UAAU;IACV,YAAY;IACZ,eAAe;CAChB,CAAC,CAAC;AAEH,wDAAwD;AACxD,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,mBAAmB;IACtE,yBAAyB,EAAE,kBAAkB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kBAAkB,CAAC,GAAG,CAAC,CAAC;QACpD,OAAO,CAAC,oBAAoB,GAAG,EAAE,CAAC,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC;AAC1C,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { SettingsExecution } from "./settings-transaction.js";
2
2
  import type { InstanceConfig, FleetConfig } from "./types.js";
3
+ import type { TopicDeleteOutcome } from "./instance-topic-delete.js";
3
4
  import { RoutingEngine } from "./routing-engine.js";
4
5
  import type { Logger } from "./logger.js";
5
6
  import type { IpcClient } from "./channel/ipc-bridge.js";
@@ -57,6 +58,7 @@ export declare function getUnsafeInstanceDaemonPidReason(pid: number, dataDir: s
57
58
  * FleetManager implements this.
58
59
  */
59
60
  export interface LifecycleContext {
61
+ readonly agentCredentials?: Pick<import("./agent-credentials.js").AgentCredentials, "issue" | "invalidate">;
60
62
  readonly fleetConfig: FleetConfig | null;
61
63
  readonly logger: Logger;
62
64
  readonly dataDir: string;
@@ -93,8 +95,10 @@ export interface LifecycleContext {
93
95
  createForumTopic(topicName: string, adapterId?: string): Promise<number | string>;
94
96
  /** #2910: no Discord or Telegram connection at all — a new agent gets no topic (it is reached from the dashboard). */
95
97
  isWebOnlyFleet?(): boolean;
96
- /** adapterId selects the world, mirroring createForumTopic (rollback must delete where it created). */
97
- deleteForumTopic(topicId: number | string, adapterId?: string): Promise<void>;
98
+ /** delete_instance: the removal, then (unless `deleteTopic` is false) the agent's own topic, through its own bot. */
99
+ removeInstanceAndTopic(name: string, authorization: ExplicitInstanceRemoval, opts: {
100
+ deleteTopic: boolean;
101
+ }): Promise<TopicDeleteOutcome>;
98
102
  /**
99
103
  * A bound delete for the world `adapterId` selects, captured by the caller
100
104
  * BEFORE awaiting createForumTopic. Rollback must use exactly this — never
@@ -1385,6 +1385,7 @@ export class InstanceLifecycle {
1385
1385
  }
1386
1386
  /** Invalidate every start/wake already running for `name` (they will not publish). */
1387
1387
  invalidate(name) {
1388
+ this.ctx.agentCredentials?.invalidate(name);
1388
1389
  this.lifecycleEpochs.set(name, this.epochOf(name) + 1);
1389
1390
  }
1390
1391
  /** Whether `transition` is `name`'s transition and is the one running now. */
@@ -1512,6 +1513,11 @@ export class InstanceLifecycle {
1512
1513
  return;
1513
1514
  this.ctx.setKiroCompatibilityHold?.(name, message);
1514
1515
  });
1516
+ daemon.setAgentCredentialIssuer?.(token => {
1517
+ if (this.epochOf(name) !== epoch)
1518
+ throw new SupersededStartError(name);
1519
+ this.ctx.agentCredentials?.issue(name, token);
1520
+ });
1515
1521
  daemon.setDeliveryOutboxPort(this.ctx.deliveryOutbox ?? undefined);
1516
1522
  daemon.setWorkLeaseCheck(() => this.hasWorkLease(name));
1517
1523
  if (seedNow)
@@ -2367,7 +2373,8 @@ export class InstanceLifecycle {
2367
2373
  /** Handle delete_instance tool call from a daemon. */
2368
2374
  async handleDelete(args, respond) {
2369
2375
  const instanceName = args.name;
2370
- const deleteTopic = args.delete_topic ?? false;
2376
+ // The user's decision (beta.9): deleting an agent deletes its topic, unless `delete_topic: false` keeps it.
2377
+ const deleteTopic = args.delete_topic ?? true;
2371
2378
  const instanceConfig = this.ctx.fleetConfig?.instances[instanceName];
2372
2379
  if (!instanceConfig) {
2373
2380
  respond(null, `Instance not found: ${instanceName}`);
@@ -2377,11 +2384,9 @@ export class InstanceLifecycle {
2377
2384
  respond(null, "Cannot delete the General instance");
2378
2385
  return;
2379
2386
  }
2380
- if (deleteTopic && instanceConfig.topic_id) {
2381
- await this.ctx.deleteForumTopic(instanceConfig.topic_id);
2382
- }
2383
- await this.ctx.removeInstance(instanceName, authorizeExplicitInstanceRemoval("delete-instance-tool"));
2384
- respond({ success: true, name: instanceName, topic_deleted: deleteTopic });
2387
+ // topic_deleted is the platform's answer, never the request; when the topic stays, topic_reason says why.
2388
+ const topic = await this.ctx.removeInstanceAndTopic(instanceName, authorizeExplicitInstanceRemoval("delete-instance-tool"), { deleteTopic });
2389
+ respond({ success: true, name: instanceName, topic_deleted: topic.deleted, ...(topic.deleted ? {} : { topic_reason: topic.reason }) });
2385
2390
  }
2386
2391
  has(name) {
2387
2392
  return this.daemons.has(name);