@songsid/agend 2.3.2-beta.4 → 2.3.2-beta.5

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 (156) hide show
  1. package/THIRD_PARTY_NOTICES.md +40 -0
  2. package/dist/antigravity-usage-scan.d.ts +58 -0
  3. package/dist/antigravity-usage-scan.js +257 -0
  4. package/dist/antigravity-usage-scan.js.map +1 -0
  5. package/dist/antigravity-usage-worker.d.ts +1 -0
  6. package/dist/antigravity-usage-worker.js +10 -0
  7. package/dist/antigravity-usage-worker.js.map +1 -0
  8. package/dist/backend/kiro-identity.d.ts +45 -0
  9. package/dist/backend/kiro-identity.js +74 -0
  10. package/dist/backend/kiro-identity.js.map +1 -1
  11. package/dist/backend/kiro.d.ts +15 -0
  12. package/dist/backend/kiro.js +42 -5
  13. package/dist/backend/kiro.js.map +1 -1
  14. package/dist/backend/types.d.ts +6 -0
  15. package/dist/backend/types.js.map +1 -1
  16. package/dist/backend-signin-guide.d.ts +1 -0
  17. package/dist/backend-signin-guide.js +9 -0
  18. package/dist/backend-signin-guide.js.map +1 -0
  19. package/dist/backend-signin-pending.d.ts +10 -0
  20. package/dist/backend-signin-pending.js +44 -0
  21. package/dist/backend-signin-pending.js.map +1 -0
  22. package/dist/browser-backend-signins.d.ts +56 -0
  23. package/dist/browser-backend-signins.js +189 -0
  24. package/dist/browser-backend-signins.js.map +1 -0
  25. package/dist/cache-ledger.d.ts +38 -2
  26. package/dist/cache-ledger.js +133 -8
  27. package/dist/cache-ledger.js.map +1 -1
  28. package/dist/cache-prices.d.ts +2 -1
  29. package/dist/cache-prices.js +5 -2
  30. package/dist/cache-prices.js.map +1 -1
  31. package/dist/cache-service.d.ts +68 -0
  32. package/dist/cache-service.js +355 -13
  33. package/dist/cache-service.js.map +1 -1
  34. package/dist/channel/mcp-tools.js +3 -1
  35. package/dist/channel/mcp-tools.js.map +1 -1
  36. package/dist/cli.js +21 -2
  37. package/dist/cli.js.map +1 -1
  38. package/dist/config.d.ts +19 -0
  39. package/dist/config.js +25 -0
  40. package/dist/config.js.map +1 -1
  41. package/dist/cpu-quota.d.ts +23 -0
  42. package/dist/cpu-quota.js +86 -0
  43. package/dist/cpu-quota.js.map +1 -0
  44. package/dist/daemon.js +6 -3
  45. package/dist/daemon.js.map +1 -1
  46. package/dist/fleet-manager.d.ts +35 -0
  47. package/dist/fleet-manager.js +233 -11
  48. package/dist/fleet-manager.js.map +1 -1
  49. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +5 -2
  50. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +14 -1
  51. package/dist/general-knowledge/skills/web-dashboard/SKILL.canvas-worker-off.md +6 -3
  52. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +6 -3
  53. package/dist/instance-lifecycle.d.ts +9 -0
  54. package/dist/instance-lifecycle.js +27 -1
  55. package/dist/instance-lifecycle.js.map +1 -1
  56. package/dist/kiro-db-reader.d.ts +5 -0
  57. package/dist/kiro-db-reader.js +18 -0
  58. package/dist/kiro-db-reader.js.map +1 -1
  59. package/dist/kiro-engine-status.d.ts +2 -0
  60. package/dist/kiro-engine-status.js +9 -0
  61. package/dist/kiro-engine-status.js.map +1 -1
  62. package/dist/kiro-migrate.d.ts +49 -0
  63. package/dist/kiro-migrate.js +105 -0
  64. package/dist/kiro-migrate.js.map +1 -0
  65. package/dist/kiro-transcript-lane.d.ts +2 -0
  66. package/dist/kiro-transcript-lane.js.map +1 -1
  67. package/dist/kiro-transcript-worker.js +1 -0
  68. package/dist/kiro-transcript-worker.js.map +1 -1
  69. package/dist/kiro-usage-run.d.ts +7 -0
  70. package/dist/kiro-usage-run.js +39 -0
  71. package/dist/kiro-usage-run.js.map +1 -0
  72. package/dist/kiro-usage-scan.d.ts +49 -0
  73. package/dist/kiro-usage-scan.js +223 -0
  74. package/dist/kiro-usage-scan.js.map +1 -0
  75. package/dist/kiro-usage-worker.d.ts +1 -0
  76. package/dist/kiro-usage-worker.js +10 -0
  77. package/dist/kiro-usage-worker.js.map +1 -0
  78. package/dist/kiro-usage.d.ts +58 -0
  79. package/dist/kiro-usage.js +310 -0
  80. package/dist/kiro-usage.js.map +1 -0
  81. package/dist/locale.js +70 -2
  82. package/dist/locale.js.map +1 -1
  83. package/dist/log-service.js +1 -1
  84. package/dist/log-service.js.map +1 -1
  85. package/dist/login-url.d.ts +4 -0
  86. package/dist/login-url.js +22 -0
  87. package/dist/login-url.js.map +1 -0
  88. package/dist/needs-you-hub.d.ts +2 -1
  89. package/dist/needs-you-hub.js +1 -1
  90. package/dist/needs-you-hub.js.map +1 -1
  91. package/dist/needs-you.d.ts +8 -2
  92. package/dist/needs-you.js +6 -0
  93. package/dist/needs-you.js.map +1 -1
  94. package/dist/opencode-usage-scan.d.ts +28 -0
  95. package/dist/opencode-usage-scan.js +92 -0
  96. package/dist/opencode-usage-scan.js.map +1 -0
  97. package/dist/opencode-usage-worker.d.ts +1 -0
  98. package/dist/opencode-usage-worker.js +10 -0
  99. package/dist/opencode-usage-worker.js.map +1 -0
  100. package/dist/outbound-handlers.js +22 -2
  101. package/dist/outbound-handlers.js.map +1 -1
  102. package/dist/outbound-schemas.d.ts +4 -0
  103. package/dist/outbound-schemas.js +4 -0
  104. package/dist/outbound-schemas.js.map +1 -1
  105. package/dist/quickstart-api.js +13 -2
  106. package/dist/quickstart-api.js.map +1 -1
  107. package/dist/quickstart.js +2 -1
  108. package/dist/quickstart.js.map +1 -1
  109. package/dist/setup-form.d.ts +1 -1
  110. package/dist/setup-form.js +7 -1
  111. package/dist/setup-form.js.map +1 -1
  112. package/dist/setup-host.d.ts +9 -0
  113. package/dist/setup-host.js +124 -5
  114. package/dist/setup-host.js.map +1 -1
  115. package/dist/setup-signin-assets.d.ts +2 -0
  116. package/dist/setup-signin-assets.js +6 -0
  117. package/dist/setup-signin-assets.js.map +1 -0
  118. package/dist/setup-wizard.js +2 -0
  119. package/dist/setup-wizard.js.map +1 -1
  120. package/dist/structured-signin-transport.d.ts +8 -0
  121. package/dist/structured-signin-transport.js +79 -0
  122. package/dist/structured-signin-transport.js.map +1 -0
  123. package/dist/structured-signin.d.ts +131 -0
  124. package/dist/structured-signin.js +388 -0
  125. package/dist/structured-signin.js.map +1 -0
  126. package/dist/tool-permissions.js +2 -0
  127. package/dist/tool-permissions.js.map +1 -1
  128. package/dist/topic-commands.js +4 -1
  129. package/dist/topic-commands.js.map +1 -1
  130. package/dist/transcript-sources.d.ts +26 -2
  131. package/dist/transcript-sources.js +87 -40
  132. package/dist/transcript-sources.js.map +1 -1
  133. package/dist/types.d.ts +3 -2
  134. package/dist/ui/backend-signin.js +63 -10
  135. package/dist/ui/fleet-usage.js +19 -15
  136. package/dist/ui/panel-log.js +2 -2
  137. package/dist/ui/panel-needs.js +4 -4
  138. package/dist/ui/shared/app-i18n.js +2 -2
  139. package/dist/ui/shared/app.css +1 -0
  140. package/dist/ui/structured-signin.js +115 -0
  141. package/dist/usage-report.d.ts +20 -0
  142. package/dist/usage-report.js +54 -17
  143. package/dist/usage-report.js.map +1 -1
  144. package/dist/usage-rollup.d.ts +9 -1
  145. package/dist/usage-rollup.js +20 -4
  146. package/dist/usage-rollup.js.map +1 -1
  147. package/dist/web-api.d.ts +1 -0
  148. package/dist/web-api.js +99 -0
  149. package/dist/web-api.js.map +1 -1
  150. package/dist/web-auth.js +1 -1
  151. package/dist/web-auth.js.map +1 -1
  152. package/dist/web-backend-login.d.ts +1 -7
  153. package/dist/web-backend-login.js +2 -24
  154. package/dist/web-backend-login.js.map +1 -1
  155. package/package.json +2 -1
  156. package/templates/windows-shortcuts.ps1 +7 -5
@@ -156,8 +156,11 @@ left untouched; the switch copies, never moves.
156
156
  - `conversation_carried_over: true` — the copy succeeded and the agent resumed
157
157
  the same conversation on the new account. The reply also carries
158
158
  `conversation_note`: relay it. It says the old copy is still there and
159
- warns that the next turn re-reads the full history from a cold cache — one
160
- slower, full-price turn on the new subscription.
159
+ notes that the switch does not by itself make the prompt cache cold: within
160
+ the same cache scope (organization, and workspace where the provider isolates
161
+ them) an unchanged model and prompt prefix are usually reused. The next turn
162
+ may rebuild it (one slower, full-price turn) when the scope, the model or the
163
+ profile's settings differ, or the cache has expired. Don't promise either.
161
164
 
162
165
  - `conversation_carried_over: false` + `carry_failed: "<reason>"` — the copy
163
166
  could not be made. Common reasons: no session id recorded, not enough free
@@ -51,10 +51,23 @@ The user has already been shown the plain notice in this topic. When they ask, e
51
51
 
52
52
  - Never start, restart, recreate or replace a stopped kiro instance to "try again". It will refuse the same way.
53
53
  - Never change `kiro_ui` or `backend` to get an instance running. A different engine starts a different
54
- conversation, and the move cannot be undone.
54
+ conversation, and the move cannot be undone. The one way an instance changes engine is the move below.
55
55
  - Never run `kiro-cli` yourself, and never delete or edit anything under `~/.kiro` or kiro's data directory.
56
56
  - Never reply to the `[system:kiro-incompat]` notice itself. It is information, not a request.
57
57
 
58
+ ## Moving an instance from classic to the TUI engine (#2598)
59
+
60
+ kiro-cli 3.0 drops the classic engine (`kiro_ui: legacy`), so classic instances are being moved to the TUI engine,
61
+ **one batch at a time and only with the user's OK for that batch**. The move is `migrate_kiro_instance` (a
62
+ coordinator-level tool; you do not have it). It carries the conversation: the instance's classic conversation is
63
+ resumed once under the TUI and becomes its own. A fleet admin confirms each move in this General topic: a
64
+ "Move it / Cancel" prompt. Explain it if asked; never press it on the user's behalf.
65
+
66
+ - After the move, `kiro_engine_status` shows `kiro_ui: tui` and `engine_floor: "tui"`.
67
+ - It is one-way. AgEnD refuses to launch a moved instance on classic again, because that would resume the frozen
68
+ classic copy and lose everything done since. A refusal that names the engine floor means someone set `kiro_ui`
69
+ back. The fix is to set it to `tui` again, never to remove the floor.
70
+
58
71
  ## One kiro agent per instance (#906)
59
72
 
60
73
  Since kiro-cli 2.21, each AgEnD kiro instance (tui / v2 engine) runs as its own kiro agent, holding only its own
@@ -377,11 +377,14 @@ coordinators and full-profile instances, and each other instance only its own ro
377
377
 
378
378
  **The usage report** (the `get_usage_report` tool, and Fleet → **Usage**, `/ui/fleet/usage`, #2122; the ◔ dialog's
379
379
  **By agent →** opens it). Per instance (or backend,
380
- model, credential profile, team): input, output, cache read and cache write tokens, requests, delivered messages,
380
+ model, credential profile, team): input, output, reasoning, cache read and cache write tokens, requests, delivered messages,
381
381
  and an amount, over today / 7d / month / all / custom days in the fleet's timezone. **Every amount is the
382
382
  API-equivalent at list price — not money spent** (subscriptions aren't billed per token): say "API-equivalent", never
383
- "spent". Measured for Claude Code and Codex. Marks to repeat in words:
384
- - `cache_write_not_reported`: Codex records no cache writes, so they are neither shown as 0 nor priced.
383
+ "spent". Measured for Claude Code, Codex, Grok, Muse, OpenCode and Antigravity; **estimated** for Kiro (it records no token counts). Marks to repeat in words:
384
+ - `cost_reported`: the model has no list price in AgEnD's table, so the amount is what the CLI (Grok, OpenCode's provider) reported.
385
+ - `estimated` (a row) / `includes_estimates` (the totals, with `amountEstimated`): Kiro's tokens are estimated from text
386
+ size, not measured — say "estimated" and give the estimated part apart.
387
+ - `cache_write_not_reported`: Codex and Muse record no cache writes, so they are neither shown as 0 nor priced.
385
388
  - `not_priced`: the tokens are shown, the amount isn't.
386
389
  - `source_unknown`: read before #2122, when which backend and profile read it was not recorded (backend and profile
387
390
  "unknown" — never today's).
@@ -392,11 +392,14 @@ coordinators and full-profile instances, and each other instance only its own ro
392
392
 
393
393
  **The usage report** (the `get_usage_report` tool, and Fleet → **Usage**, `/ui/fleet/usage`, #2122; the ◔ dialog's
394
394
  **By agent →** opens it). Per instance (or backend,
395
- model, credential profile, team): input, output, cache read and cache write tokens, requests, delivered messages,
395
+ model, credential profile, team): input, output, reasoning, cache read and cache write tokens, requests, delivered messages,
396
396
  and an amount, over today / 7d / month / all / custom days in the fleet's timezone. **Every amount is the
397
397
  API-equivalent at list price — not money spent** (subscriptions aren't billed per token): say "API-equivalent", never
398
- "spent". Measured for Claude Code and Codex. Marks to repeat in words:
399
- - `cache_write_not_reported`: Codex records no cache writes, so they are neither shown as 0 nor priced.
398
+ "spent". Measured for Claude Code, Codex, Grok, Muse, OpenCode and Antigravity; **estimated** for Kiro (it records no token counts). Marks to repeat in words:
399
+ - `cost_reported`: the model has no list price in AgEnD's table, so the amount is what the CLI (Grok, OpenCode's provider) reported.
400
+ - `estimated` (a row) / `includes_estimates` (the totals, with `amountEstimated`): Kiro's tokens are estimated from text
401
+ size, not measured — say "estimated" and give the estimated part apart.
402
+ - `cache_write_not_reported`: Codex and Muse record no cache writes, so they are neither shown as 0 nor priced.
400
403
  - `not_priced`: the tokens are shown, the amount isn't.
401
404
  - `source_unknown`: read before #2122, when which backend and profile read it was not recorded (backend and profile
402
405
  "unknown" — never today's).
@@ -443,6 +443,15 @@ export declare class InstanceLifecycle {
443
443
  * up, and the operator needs to know which conversation each instance is in.
444
444
  */
445
445
  attachLaunchWarningHandler(name: string, daemon: IncidentEventSource): void;
446
+ /**
447
+ * The daemon gave up resuming after repeated startup failures and started a
448
+ * fresh conversation (#737, #749). Without this the only trace was an error
449
+ * line in daemon.log. Attached before start, because the startup spawn is
450
+ * where it happens; and never suppressed for a planned restart, which is
451
+ * exactly when the user expects the conversation to carry on. A ClassicBot's
452
+ * channel is the end user's chat, so its notice goes to General only.
453
+ */
454
+ attachContextLostHandler(name: string, daemon: IncidentEventSource): void;
446
455
  /**
447
456
  * Daemon delivery events → the status reaction on the inbound message. The
448
457
  * emoji for each status comes from config (#1005); this only names it.
@@ -8,7 +8,7 @@ import { execFileSync } from "node:child_process";
8
8
  import { join, basename, dirname, resolve, sep as pathSep } from "node:path";
9
9
  import { access } from "node:fs/promises";
10
10
  import { getAgendHome, ensureWorkspaceGit } from "./paths.js";
11
- import { DEFAULT_INSTANCE_CONFIG, getEffectiveInstanceDefaults, getTmuxSession } from "./config.js";
11
+ import { DEFAULT_INSTANCE_CONFIG, getEffectiveInstanceDefaults, getTmuxSession, newInstanceKiroUi } from "./config.js";
12
12
  import { readStatuslineModel, uniqueInstanceName } from "./topic-commands.js";
13
13
  import { isModelCompatible } from "./backend/types.js";
14
14
  import { safeHandler } from "./safe-async.js";
@@ -555,6 +555,27 @@ export class InstanceLifecycle {
555
555
  this.ctx.notifyInstanceTopic(name, t("inst.backend_launch_warning", name, data.message));
556
556
  }, this.ctx.logger, `daemon.backend_launch_warning[${name}]`));
557
557
  }
558
+ /**
559
+ * The daemon gave up resuming after repeated startup failures and started a
560
+ * fresh conversation (#737, #749). Without this the only trace was an error
561
+ * line in daemon.log. Attached before start, because the startup spawn is
562
+ * where it happens; and never suppressed for a planned restart, which is
563
+ * exactly when the user expects the conversation to carry on. A ClassicBot's
564
+ * channel is the end user's chat, so its notice goes to General only.
565
+ */
566
+ attachContextLostHandler(name, daemon) {
567
+ daemon.on("context_lost", safeHandler((_name, reason, attempts) => {
568
+ this.ctx.eventLog?.insert(name, "context_lost", { reason, ...(attempts != null ? { attempts } : {}) });
569
+ this.ctx.logger.warn({ name, reason, attempts }, "Instance started a fresh conversation — previous context lost");
570
+ const tries = attempts != null ? String(attempts) : "?";
571
+ if (!this.ctx.isClassicInstance?.(name))
572
+ this.ctx.notifyInstanceTopic(name, t("inst.context_lost", name, tries));
573
+ const general = this.findGeneralInstance();
574
+ if (general && general !== name)
575
+ this.ctx.notifyInstanceTopic(general, t("inst.context_lost_general", name, tries));
576
+ this.ctx.webhookEmit("context_lost", name, { reason, ...(attempts != null ? { attempts } : {}) });
577
+ }, this.ctx.logger, `daemon.context_lost[${name}]`));
578
+ }
558
579
  /**
559
580
  * Daemon delivery events → the status reaction on the inbound message. The
560
581
  * emoji for each status comes from config (#1005); this only names it.
@@ -1365,6 +1386,7 @@ export class InstanceLifecycle {
1365
1386
  // warning synchronously inside Daemon.start, long before
1366
1387
  // attachIncidentHandlers runs (#984).
1367
1388
  this.attachLaunchWarningHandler(name, daemon);
1389
+ this.attachContextLostHandler(name, daemon);
1368
1390
  daemon.on("durable_delivery_deferred", (data) => {
1369
1391
  // A daemon without its outbox port cannot update the row directly. The
1370
1392
  // lifecycle owns the same-process store and records a bounded pre-write
@@ -2112,6 +2134,10 @@ export class InstanceLifecycle {
2112
2134
  && !isModelCompatible(instanceConfig.backend, instanceConfig.model)) {
2113
2135
  delete instanceConfig.model;
2114
2136
  }
2137
+ // #2598: a new kiro instance is written with the TUI engine, explicitly (an unset one is classic).
2138
+ const newKiroUi = newInstanceKiroUi(instanceConfig.backend, this.ctx.fleetConfig?.defaults);
2139
+ if (newKiroUi)
2140
+ instanceConfig.kiro_ui = newKiroUi;
2115
2141
  createdConfig = instanceConfig;
2116
2142
  const beforeCreate = structuredClone(this.ctx.fleetConfig);
2117
2143
  const persist = () => {