@songsid/agend 2.3.5 → 2.3.6-beta.1

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 (214) hide show
  1. package/README.md +11 -1
  2. package/README.zh-TW.md +11 -1
  3. package/dist/agent-cli-instructions.md +15 -9
  4. package/dist/agent-cli.js +47 -20
  5. package/dist/agent-cli.js.map +1 -1
  6. package/dist/agent-endpoint.js +23 -8
  7. package/dist/agent-endpoint.js.map +1 -1
  8. package/dist/agent-list-output.d.ts +23 -0
  9. package/dist/agent-list-output.js +53 -0
  10. package/dist/agent-list-output.js.map +1 -0
  11. package/dist/agent-whats-new.js +10 -7
  12. package/dist/agent-whats-new.js.map +1 -1
  13. package/dist/auth-api.js +3 -1
  14. package/dist/auth-api.js.map +1 -1
  15. package/dist/backend/agy-onboarding.d.ts +14 -0
  16. package/dist/backend/agy-onboarding.js +114 -0
  17. package/dist/backend/agy-onboarding.js.map +1 -0
  18. package/dist/backend/antigravity.js +3 -0
  19. package/dist/backend/antigravity.js.map +1 -1
  20. package/dist/backend/claude-code.d.ts +8 -0
  21. package/dist/backend/claude-code.js +11 -4
  22. package/dist/backend/claude-code.js.map +1 -1
  23. package/dist/backend/codex.d.ts +7 -14
  24. package/dist/backend/codex.js +32 -32
  25. package/dist/backend/codex.js.map +1 -1
  26. package/dist/backend/grok-mcp.d.ts +5 -0
  27. package/dist/backend/grok-mcp.js +221 -0
  28. package/dist/backend/grok-mcp.js.map +1 -0
  29. package/dist/backend/grok.d.ts +19 -10
  30. package/dist/backend/grok.js +117 -83
  31. package/dist/backend/grok.js.map +1 -1
  32. package/dist/backend/types.d.ts +16 -1
  33. package/dist/backend/types.js.map +1 -1
  34. package/dist/channel/mcp-tools.js +10 -10
  35. package/dist/channel/mcp-tools.js.map +1 -1
  36. package/dist/claude-model-observation.d.ts +71 -0
  37. package/dist/claude-model-observation.js +169 -0
  38. package/dist/claude-model-observation.js.map +1 -0
  39. package/dist/cli.js +62 -12
  40. package/dist/cli.js.map +1 -1
  41. package/dist/codex-pane-ownership.d.ts +13 -0
  42. package/dist/codex-pane-ownership.js +192 -0
  43. package/dist/codex-pane-ownership.js.map +1 -0
  44. package/dist/config-validator.js +19 -0
  45. package/dist/config-validator.js.map +1 -1
  46. package/dist/cross-instance-envelope.d.ts +4 -1
  47. package/dist/cross-instance-envelope.js +12 -7
  48. package/dist/cross-instance-envelope.js.map +1 -1
  49. package/dist/daemon.d.ts +26 -2
  50. package/dist/daemon.js +344 -49
  51. package/dist/daemon.js.map +1 -1
  52. package/dist/decision-list.d.ts +5 -4
  53. package/dist/decision-list.js +22 -8
  54. package/dist/decision-list.js.map +1 -1
  55. package/dist/delivery-consumed-watch.d.ts +24 -0
  56. package/dist/delivery-consumed-watch.js +21 -10
  57. package/dist/delivery-consumed-watch.js.map +1 -1
  58. package/dist/delivery-outbox.d.ts +9 -1
  59. package/dist/delivery-outbox.js +16 -0
  60. package/dist/delivery-outbox.js.map +1 -1
  61. package/dist/delivery-reconciliation.d.ts +1 -1
  62. package/dist/delivery-reconciliation.js +1 -1
  63. package/dist/dispatcher-liveness.d.ts +172 -0
  64. package/dist/dispatcher-liveness.js +238 -0
  65. package/dist/dispatcher-liveness.js.map +1 -0
  66. package/dist/fleet-manager.d.ts +30 -2
  67. package/dist/fleet-manager.js +195 -22
  68. package/dist/fleet-manager.js.map +1 -1
  69. package/dist/general-knowledge/skills/concepts/SKILL.md +43 -4
  70. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +17 -2
  71. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +18 -8
  72. package/dist/general-knowledge/skills/fleet-health/SKILL.md +15 -0
  73. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
  74. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  75. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +63 -17
  76. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  77. package/dist/grok-delivery-proof.d.ts +24 -0
  78. package/dist/grok-delivery-proof.js +124 -0
  79. package/dist/grok-delivery-proof.js.map +1 -0
  80. package/dist/human-delivery-receipts.d.ts +4 -2
  81. package/dist/human-delivery-receipts.js +20 -13
  82. package/dist/human-delivery-receipts.js.map +1 -1
  83. package/dist/inbound-presentation.d.ts +28 -0
  84. package/dist/inbound-presentation.js +48 -0
  85. package/dist/inbound-presentation.js.map +1 -0
  86. package/dist/install-user-systemd.d.ts +20 -0
  87. package/dist/install-user-systemd.js +55 -0
  88. package/dist/install-user-systemd.js.map +1 -0
  89. package/dist/instance-config-impact.js +2 -0
  90. package/dist/instance-config-impact.js.map +1 -1
  91. package/dist/instance-lifecycle.d.ts +2 -0
  92. package/dist/instance-lifecycle.js +3 -0
  93. package/dist/instance-lifecycle.js.map +1 -1
  94. package/dist/instructions.d.ts +10 -2
  95. package/dist/instructions.js +32 -7
  96. package/dist/instructions.js.map +1 -1
  97. package/dist/linux-launchers.d.ts +88 -0
  98. package/dist/linux-launchers.js +296 -0
  99. package/dist/linux-launchers.js.map +1 -0
  100. package/dist/locale.js +174 -8
  101. package/dist/locale.js.map +1 -1
  102. package/dist/log-steps.d.ts +13 -0
  103. package/dist/log-steps.js +85 -40
  104. package/dist/log-steps.js.map +1 -1
  105. package/dist/needs-you-hub.js +8 -4
  106. package/dist/needs-you-hub.js.map +1 -1
  107. package/dist/needs-you.d.ts +7 -2
  108. package/dist/needs-you.js +5 -9
  109. package/dist/needs-you.js.map +1 -1
  110. package/dist/office-share-page.js +1 -1
  111. package/dist/office-share-page.js.map +1 -1
  112. package/dist/outbound-handlers.d.ts +1 -0
  113. package/dist/outbound-handlers.js +25 -19
  114. package/dist/outbound-handlers.js.map +1 -1
  115. package/dist/outbound-schemas.d.ts +20 -0
  116. package/dist/outbound-schemas.js +24 -4
  117. package/dist/outbound-schemas.js.map +1 -1
  118. package/dist/queued-handoffs.d.ts +3 -1
  119. package/dist/queued-handoffs.js +1 -1
  120. package/dist/queued-handoffs.js.map +1 -1
  121. package/dist/scheduler/db.d.ts +3 -0
  122. package/dist/scheduler/db.js +4 -0
  123. package/dist/scheduler/db.js.map +1 -1
  124. package/dist/scheduler/task-board.d.ts +1 -0
  125. package/dist/scheduler/task-board.js +10 -1
  126. package/dist/scheduler/task-board.js.map +1 -1
  127. package/dist/scheduler/task-liveness.d.ts +34 -0
  128. package/dist/scheduler/task-liveness.js +49 -0
  129. package/dist/scheduler/task-liveness.js.map +1 -0
  130. package/dist/selection-card.d.ts +4 -3
  131. package/dist/selection-card.js +2 -1
  132. package/dist/selection-card.js.map +1 -1
  133. package/dist/service-installer.js +11 -2
  134. package/dist/service-installer.js.map +1 -1
  135. package/dist/settings-change.d.ts +2 -0
  136. package/dist/settings-change.js +43 -29
  137. package/dist/settings-change.js.map +1 -1
  138. package/dist/settings-confirmation.d.ts +4 -0
  139. package/dist/settings-confirmation.js +5 -1
  140. package/dist/settings-confirmation.js.map +1 -1
  141. package/dist/settings-http-confirmation.js +2 -1
  142. package/dist/settings-http-confirmation.js.map +1 -1
  143. package/dist/settings-summary.d.ts +24 -0
  144. package/dist/settings-summary.js +42 -0
  145. package/dist/settings-summary.js.map +1 -0
  146. package/dist/task-board-tool.d.ts +0 -12
  147. package/dist/task-board-tool.js +52 -4
  148. package/dist/task-board-tool.js.map +1 -1
  149. package/dist/tool-receipt-output.d.ts +151 -0
  150. package/dist/tool-receipt-output.js +50 -0
  151. package/dist/tool-receipt-output.js.map +1 -0
  152. package/dist/topic-commands.js +2 -1
  153. package/dist/topic-commands.js.map +1 -1
  154. package/dist/transcript-delta-reader.d.ts +9 -1
  155. package/dist/transcript-delta-reader.js +37 -8
  156. package/dist/transcript-delta-reader.js.map +1 -1
  157. package/dist/transcript-monitor.d.ts +5 -1
  158. package/dist/transcript-monitor.js +66 -4
  159. package/dist/transcript-monitor.js.map +1 -1
  160. package/dist/transcript-sources.d.ts +2 -0
  161. package/dist/transcript-sources.js +2 -0
  162. package/dist/transcript-sources.js.map +1 -1
  163. package/dist/types.d.ts +10 -0
  164. package/dist/ui/chat-quote.js +12 -17
  165. package/dist/ui/chat-render.js +11 -2
  166. package/dist/ui/chat-strings.js +4 -4
  167. package/dist/ui/fleet-canvas.js +5 -2
  168. package/dist/ui/fleet-office-card.js +4 -2
  169. package/dist/ui/fleet-org.js +2 -0
  170. package/dist/ui/panel-chat.js +28 -6
  171. package/dist/ui/panel-details.js +6 -1
  172. package/dist/ui/panel-log.js +4 -2
  173. package/dist/ui/panel-needs.js +2 -0
  174. package/dist/ui/panel-settings.js +29 -1
  175. package/dist/ui/settings-registry.js +4 -0
  176. package/dist/ui/settings-strings.js +14 -0
  177. package/dist/ui/shared/app-i18n.js +2 -2
  178. package/dist/ui/shared/app-needs.js +3 -0
  179. package/dist/ui/shared/app-shell.js +48 -3
  180. package/dist/ui/shared/app.css +2 -0
  181. package/dist/ui/shared/chat-work-bar.css +12 -0
  182. package/dist/ui/shared/model-observation.js +16 -0
  183. package/dist/ui/shared/usage-dialog.js +2 -1
  184. package/dist/ui/shared/view-strings.js +2 -0
  185. package/dist/update-dispatch.d.ts +62 -0
  186. package/dist/update-dispatch.js +69 -2
  187. package/dist/update-dispatch.js.map +1 -1
  188. package/dist/usage/agent-output.d.ts +144 -0
  189. package/dist/usage/agent-output.js +76 -0
  190. package/dist/usage/agent-output.js.map +1 -0
  191. package/dist/usage/i18n-keys.d.ts +1 -1
  192. package/dist/usage/i18n-keys.js +1 -1
  193. package/dist/usage/i18n-keys.js.map +1 -1
  194. package/dist/usage/i18n.d.ts +1 -1
  195. package/dist/usage/i18n.js +2 -1
  196. package/dist/usage/i18n.js.map +1 -1
  197. package/dist/usage/providers.d.ts +4 -1
  198. package/dist/usage/providers.js +22 -11
  199. package/dist/usage/providers.js.map +1 -1
  200. package/dist/usage/usage-api.d.ts +1 -1
  201. package/dist/usage/usage-api.js +4 -4
  202. package/dist/usage/usage-api.js.map +1 -1
  203. package/dist/web-api.d.ts +1 -0
  204. package/dist/web-api.js +2 -1
  205. package/dist/web-api.js.map +1 -1
  206. package/dist/windows-shortcuts.d.ts +29 -5
  207. package/dist/windows-shortcuts.js +52 -9
  208. package/dist/windows-shortcuts.js.map +1 -1
  209. package/dist/workflow-templates/default.md +2 -2
  210. package/launcher/agend-install.cjs +7 -1
  211. package/package.json +1 -1
  212. package/templates/icons/agend-restart.ico +0 -0
  213. package/templates/icons/agend.ico +0 -0
  214. package/templates/windows-shortcuts.ps1 +45 -12
@@ -26,6 +26,13 @@ export declare function interopState(host: ShortcutsHost): "on" | "off" | "unkno
26
26
  export declare function findPowershell(host: ShortcutsHost): string | null;
27
27
  /** The installer's shortcut code: the template below its header (which ends at the first blank line). */
28
28
  export declare function sharedShortcutsPs(templateText?: string): string;
29
+ /** M-2885: the shortcut icons this package ships (templates/icons, built by scripts/build-shortcut-icons.py). */
30
+ export declare const SHORTCUT_ICON_NAMES: readonly ["agend.ico", "agend-restart.ico"];
31
+ export type ShortcutIcons = Partial<Record<(typeof SHORTCUT_ICON_NAMES)[number], Buffer>>;
32
+ /** The icons as the package has them; one that can't be read is left out (that shortcut keeps whatever icon it has). */
33
+ export declare function packageShortcutIcons(dir?: string): ShortcutIcons;
34
+ /** `$icons` for Install-AgendShortcuts: base64 literals only (no quoting needed), or `$null` when there are none. */
35
+ export declare function iconsLiteral(icons?: ShortcutIcons): string;
29
36
  /** The target install.json named when the person was asked (and said yes to replacing). */
30
37
  export interface ShortcutsTarget {
31
38
  distro: string;
@@ -37,10 +44,21 @@ export interface ShortcutsTarget {
37
44
  * without asking, the leader 2026-10-20) — unless it is exactly the one the person was shown and said yes to
38
45
  * (`confirmedOver`), read again right before writing: changed while they answered, it stops again (#2279 review).
39
46
  */
40
- export declare function buildShortcutsScript(shared: string, distro: string, user: string, confirmedOver?: ShortcutsTarget): string;
47
+ export declare function buildShortcutsScript(shared: string, distro: string, user: string, confirmedOver?: ShortcutsTarget, icons?: ShortcutIcons): string;
41
48
  /** -EncodedCommand takes UTF-16LE in base64: no quoting, and the Chinese names arrive intact. */
42
49
  export declare function encodePowershell(script: string): string;
43
- export declare function powershellArgs(script: string): string[];
50
+ /**
51
+ * M-2885: what -EncodedCommand carries — only this loader. The script itself (the shared code, then the icons) arrives on
52
+ * standard input, read WHOLE and run at the top level as ONE script block (never line by line). Windows' command line
53
+ * holds 32,767 characters; the script with its icons is far longer.
54
+ * Standard input carries base64 of the script's UTF-8 bytes — ASCII only, which no console code page can alter, whatever
55
+ * Windows PowerShell 5.1 does with redirected input. (The "AgEnD ???" first seen on a real Windows was not this: it was
56
+ * WScript.Shell saving through the ANSI code page — see New-AgendShortcut.)
57
+ */
58
+ export declare const STDIN_LOADER = "$ErrorActionPreference = 'Stop'; $r = New-Object IO.StreamReader([Console]::OpenStandardInput(), [Text.Encoding]::ASCII); $b = $r.ReadToEnd(); $r.Dispose(); $s = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b.Trim())); . ([ScriptBlock]::Create($s))";
59
+ /** What goes on the loader's standard input: the script, as base64 of its UTF-8 bytes (see STDIN_LOADER). */
60
+ export declare function stdinPayload(script: string): string;
61
+ export declare function powershellArgs(): string[];
44
62
  export interface RunResult {
45
63
  status: number | null;
46
64
  stdout: string;
@@ -52,7 +70,10 @@ export interface ShortcutsDeps {
52
70
  user: string;
53
71
  dataDir: string;
54
72
  shared: () => string;
55
- run: (command: string, args: string[]) => RunResult;
73
+ /** `input`: written to the program's standard input (the script as stdinPayload gives it, M-2885). */
74
+ run: (command: string, args: string[], input: string) => RunResult;
75
+ /** The icons to put on the shortcuts (M-2885). */
76
+ icons?: () => ShortcutIcons;
56
77
  writeMarker: (path: string, content: string) => void;
57
78
  log: (line: string) => void;
58
79
  now: () => Date;
@@ -74,5 +95,8 @@ export declare function shortcutsHintOnce(o: {
74
95
  tty: boolean;
75
96
  write: (path: string, content: string) => void;
76
97
  }): string | null;
77
- /** After `agend update`: print the one-time line, if it is due (#1853). */
78
- export declare function printUpdateShortcutsHint(dataDir: string): void;
98
+ /**
99
+ * After an install or `agend update`: print the one-time line, if it is due — the Windows shortcuts in WSL (#1853), the
100
+ * launchers on a Linux desktop (M-2885).
101
+ */
102
+ export declare function printUpdateShortcutsHint(dataDir: string): Promise<void>;
@@ -69,13 +69,31 @@ export function sharedShortcutsPs(templateText) {
69
69
  return text.slice(text.indexOf("\n\n") + 2);
70
70
  }
71
71
  const psQuote = (value) => `'${value.replace(/'/g, "''")}'`;
72
+ /** M-2885: the shortcut icons this package ships (templates/icons, built by scripts/build-shortcut-icons.py). */
73
+ export const SHORTCUT_ICON_NAMES = ["agend.ico", "agend-restart.ico"];
74
+ /** The icons as the package has them; one that can't be read is left out (that shortcut keeps whatever icon it has). */
75
+ export function packageShortcutIcons(dir = join(dirname(fileURLToPath(import.meta.url)), "..", "templates", "icons")) {
76
+ const icons = {};
77
+ for (const name of SHORTCUT_ICON_NAMES) {
78
+ try {
79
+ icons[name] = readFileSync(join(dir, name));
80
+ }
81
+ catch { /* left out */ }
82
+ }
83
+ return icons;
84
+ }
85
+ /** `$icons` for Install-AgendShortcuts: base64 literals only (no quoting needed), or `$null` when there are none. */
86
+ export function iconsLiteral(icons = {}) {
87
+ const entries = SHORTCUT_ICON_NAMES.filter(name => icons[name]?.length).map(name => `'${name}' = [Convert]::FromBase64String('${icons[name].toString("base64")}')`);
88
+ return entries.length ? `@{ ${entries.join("; ")} }` : "$null";
89
+ }
72
90
  /**
73
91
  * The whole script Windows PowerShell runs: the shared code, then both shortcuts for this Linux and user. An
74
92
  * install.json that names another Linux or user stops it first, changing nothing (the shortcuts are never repointed
75
93
  * without asking, the leader 2026-10-20) — unless it is exactly the one the person was shown and said yes to
76
94
  * (`confirmedOver`), read again right before writing: changed while they answered, it stops again (#2279 review).
77
95
  */
78
- export function buildShortcutsScript(shared, distro, user, confirmedOver) {
96
+ export function buildShortcutsScript(shared, distro, user, confirmedOver, icons = {}) {
79
97
  const seen = confirmedOver ? `@{ Distro = ${psQuote(confirmedOver.distro)}; User = ${psQuote(confirmedOver.user)} }` : "$null";
80
98
  return [
81
99
  "$ErrorActionPreference = 'Stop'",
@@ -86,7 +104,7 @@ export function buildShortcutsScript(shared, distro, user, confirmedOver) {
86
104
  ` $other = Get-InstallRecordConflict ${psQuote(distro)} ${psQuote(user)}`,
87
105
  " Write-Output ('AGEND_RECORD_OTHER=' + $other.Distro + '|' + $other.User); exit 0",
88
106
  "}",
89
- `$made = @(Install-AgendShortcuts ${psQuote(distro)} ${psQuote(user)})`,
107
+ `$made = @(Install-AgendShortcuts ${psQuote(distro)} ${psQuote(user)} ${iconsLiteral(icons)})`,
90
108
  "Write-Output ('AGEND_SHORTCUTS_MADE=' + $made.Count)",
91
109
  "",
92
110
  ].join("\n");
@@ -95,8 +113,21 @@ export function buildShortcutsScript(shared, distro, user, confirmedOver) {
95
113
  export function encodePowershell(script) {
96
114
  return Buffer.from(script, "utf16le").toString("base64");
97
115
  }
98
- export function powershellArgs(script) {
99
- return ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encodePowershell(script)];
116
+ /**
117
+ * M-2885: what -EncodedCommand carries — only this loader. The script itself (the shared code, then the icons) arrives on
118
+ * standard input, read WHOLE and run at the top level as ONE script block (never line by line). Windows' command line
119
+ * holds 32,767 characters; the script with its icons is far longer.
120
+ * Standard input carries base64 of the script's UTF-8 bytes — ASCII only, which no console code page can alter, whatever
121
+ * Windows PowerShell 5.1 does with redirected input. (The "AgEnD ???" first seen on a real Windows was not this: it was
122
+ * WScript.Shell saving through the ANSI code page — see New-AgendShortcut.)
123
+ */
124
+ export const STDIN_LOADER = "$ErrorActionPreference = 'Stop'; $r = New-Object IO.StreamReader([Console]::OpenStandardInput(), [Text.Encoding]::ASCII); $b = $r.ReadToEnd(); $r.Dispose(); $s = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($b.Trim())); . ([ScriptBlock]::Create($s))";
125
+ /** What goes on the loader's standard input: the script, as base64 of its UTF-8 bytes (see STDIN_LOADER). */
126
+ export function stdinPayload(script) {
127
+ return Buffer.from(script, "utf8").toString("base64");
128
+ }
129
+ export function powershellArgs() {
130
+ return ["-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-EncodedCommand", encodePowershell(STDIN_LOADER)];
100
131
  }
101
132
  /** `agend shortcuts`. Resolves to the exit code. */
102
133
  export async function runShortcuts(deps) {
@@ -115,7 +146,8 @@ export async function runShortcuts(deps) {
115
146
  return 1;
116
147
  }
117
148
  deps.log(t("shortcuts.making", distro, deps.user));
118
- let result = deps.run(powershell, powershellArgs(buildShortcutsScript(deps.shared(), distro, deps.user)));
149
+ const icons = deps.icons?.() ?? {};
150
+ let result = deps.run(powershell, powershellArgs(), stdinPayload(buildShortcutsScript(deps.shared(), distro, deps.user, undefined, icons)));
119
151
  const other = OTHER_LINE.exec(result.stdout ?? "");
120
152
  if (other) {
121
153
  // The shortcuts (and install.json) point at another Linux or user: say so, and switch only on an explicit y.
@@ -125,7 +157,7 @@ export async function runShortcuts(deps) {
125
157
  deps.log(t(yes === null ? "shortcuts.kept_no_tty" : "shortcuts.kept", otherDistro, otherUser));
126
158
  return 1;
127
159
  }
128
- result = deps.run(powershell, powershellArgs(buildShortcutsScript(deps.shared(), distro, deps.user, { distro: otherDistro, user: otherUser })));
160
+ result = deps.run(powershell, powershellArgs(), stdinPayload(buildShortcutsScript(deps.shared(), distro, deps.user, { distro: otherDistro, user: otherUser }, icons)));
129
161
  // Changed while the person answered: what they agreed to replace is no longer there — nothing is written.
130
162
  const again = OTHER_LINE.exec(result.stdout ?? "");
131
163
  if (again) {
@@ -157,6 +189,7 @@ export function realShortcutsDeps(dataDir, user, run) {
157
189
  return {
158
190
  host: realHost(), user, dataDir, run,
159
191
  shared: () => sharedShortcutsPs(),
192
+ icons: () => packageShortcutIcons(),
160
193
  writeMarker: (path, content) => { mkdirSync(dirname(path), { recursive: true, mode: 0o700 }); writeFileSync(path, content); },
161
194
  log: line => console.log(line),
162
195
  now: () => new Date(),
@@ -194,9 +227,19 @@ export function shortcutsHintOnce(o) {
194
227
  }
195
228
  return t("shortcuts.hint");
196
229
  }
197
- /** After `agend update`: print the one-time line, if it is due (#1853). */
198
- export function printUpdateShortcutsHint(dataDir) {
199
- const line = shortcutsHintOnce({ host: realHost(), dataDir, tty: !!process.stdout.isTTY, write: (path, content) => writeFileSync(path, content, { flag: "wx" }) });
230
+ /**
231
+ * After an install or `agend update`: print the one-time line, if it is due — the Windows shortcuts in WSL (#1853), the
232
+ * launchers on a Linux desktop (M-2885).
233
+ */
234
+ export async function printUpdateShortcutsHint(dataDir) {
235
+ const host = realHost();
236
+ const write = (path, content) => writeFileSync(path, content, { flag: "wx" });
237
+ const tty = !!process.stdout.isTTY;
238
+ let line = shortcutsHintOnce({ host, dataDir, tty, write });
239
+ if (!line) {
240
+ const { launchersHintOnce } = await import("./linux-launchers.js");
241
+ line = launchersHintOnce({ env: host.env, platform: process.platform, wsl: detectWsl(host).wsl, dataDir, tty, exists: host.exists, write });
242
+ }
200
243
  if (line)
201
244
  console.log(` ${line}\n`);
202
245
  }
@@ -1 +1 @@
1
- {"version":3,"file":"windows-shortcuts.js","sourceRoot":"","sources":["../src/windows-shortcuts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,aAAa,CAAC;AAEhC,8FAA8F;AAC9F,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AACpD,mDAAmD;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAC9D,MAAM,SAAS,GAAG,kCAAkC,CAAC;AACrD,yGAAyG;AACzG,MAAM,UAAU,GAAG,mDAAm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AAsB,CAAC,CAAC;QACnE,IAAI,GAAG,iBAAiB,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,GAAG,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9I,CAAC;IACD,IAAI,IAAI;QAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC;AACvC,CAAC"}
@@ -12,7 +12,7 @@
12
12
 
13
13
  ## Shared Decisions
14
14
 
15
- - Run `list_decisions` after restart to reload fleet-wide decisions: it lists titles; read the full text only of the ones you need (`list_decisions { id }`).
15
+ - Run `list_decisions` after restart to reload fleet-wide decisions: it lists paged titles; follow every `next_cursor` page with the same filters, then read the full text of relevant rules with `list_decisions { id, detail: true }`.
16
16
  - Use `post_decision` to share architectural choices that affect other instances.
17
17
 
18
18
  ## Progress Tracking
@@ -20,7 +20,7 @@
20
20
  Use the **Task Board** (`task` tool) for multi-step work:
21
21
  - Break work into discrete tasks with clear deliverables
22
22
  - Update status as you progress (open → claimed → done; or blocked / cancelled)
23
- - A card that waits for confirmation goes to `review` when you finish it: the person confirms the cards they handed out; a card you handed out, you confirm (`done`, or back to `claimed` with what is missing). One nobody else confirms (your own) goes straight to `done`. Sent back, it is yours again: `task get` shows why, `task mine` lists your work after a reset
23
+ - A card that waits for confirmation goes to `review` when you finish it: the person confirms the cards they handed out; a card you handed out, you confirm (`done`, or back to `claimed` with what is missing). One nobody else confirms (your own) goes straight to `done`. Sent back, it is yours again: `task get` with `detail: true` shows why, `task mine` lists your work after a reset
24
24
  - One board card in progress at a time: finish it, or block it with the question, before starting the next
25
25
  - A `[Task board]` notice is news on your cards (assigned, sent back, answered, ready to start, a question on a card you handed out, one waiting for your confirmation): read and act on the card with the `task` tool; it needs no chat reply or acknowledgment
26
26
  - Other instances can check your task board for status instead of asking
@@ -726,6 +726,11 @@ function main(argv, injected) {
726
726
  pruneStale(prefix, deps).forEach(function (n) { log(" ↺ " + n); });
727
727
  var previous = isAgendPackage(path.join(root, "@songsid", "agend"));
728
728
  var bin = path.join(prefix, "bin", "agend");
729
+ // M-2885: the one-time line about desktop shortcuts (WSL) or launchers (a Linux desktop), said by the agend just
730
+ // installed and only in a terminal — on every successful end. Its outcome never changes this install's.
731
+ var sayShortcutsHint = function () {
732
+ try { deps.run(bin, ["shortcuts", "--hint"], { inherit: true, env: withoutUpdateNpmBounds(deps.env) }); } catch (e) { /* a hint never fails an install */ }
733
+ };
729
734
  // #2420: on a host with a service, what an update whose new service does not come up goes back to.
730
735
  var svc = serviceOf(serviceKind(deps), deps);
731
736
  if (svc && previous) {
@@ -772,7 +777,7 @@ function main(argv, injected) {
772
777
  // A fresh install (no fleet set up, not an upgrade): the next step is the setup wizard.
773
778
  var kind = serviceKind(deps);
774
779
  var configured = fs.existsSync(path.join(home, "fleet.yaml")) || fs.existsSync(path.join(home, "fleet.pid"));
775
- if (!configured && !upgrade && !kind) { log(" Next: run `agend quickstart` to set up AgEnD."); return 0; }
780
+ if (!configured && !upgrade && !kind) { log(" Next: run `agend quickstart` to set up AgEnD."); sayShortcutsHint(); return 0; }
776
781
  // The service stays under the manager it has (`agend restart` picks the same one: system unit, else user unit or
777
782
  // launchd job): the new release's `agend install --no-activate` refreshes that definition without starting anything
778
783
  // (a legacy system unit is refreshed in place — never a second, user unit), then the fleet moves onto the new release:
@@ -845,6 +850,7 @@ function main(argv, injected) {
845
850
  var notUp = launchdReady(svc, home, deps);
846
851
  if (notUp) return rollBack(restarted ? "stopping" : "starting", "the launchd job did not come up on v" + version + ": " + notUp, "run `agend restart`");
847
852
  }
853
+ sayShortcutsHint();
848
854
  return 0;
849
855
  } finally {
850
856
  // Spent (put back), or not needed: only a rollback that could not finish keeps its copy, says where, and marks it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@songsid/agend",
3
- "version": "2.3.5",
3
+ "version": "2.3.6-beta.1",
4
4
  "description": "Multi-agent fleet daemon — run coding CLIs (Claude, Muse, Codex, OpenCode) from Discord or Telegram",
5
5
  "type": "module",
6
6
  "bin": {
Binary file
@@ -104,7 +104,7 @@ function Invoke-AgendInWsl([string]$distro, [string]$user, [string]$command) {
104
104
  }
105
105
  function Invoke-RestartAgend([string]$distro, [string]$user, [switch]$Wait, [int]$SettleSeconds = 3) {
106
106
  Write-Host ""
107
- $answer = Read-Host " 確定要重啟 AgEnD 嗎?所有 agent 會重新啟動,正在進行的工作會中斷。(y/N)"
107
+ $answer = Read-Host " 確定要重啟 AgEnD 嗎?所有 Agent 會重新啟動,正在進行的工作會中斷。(y/N)"
108
108
  if (([string]$answer) -notmatch '^\s*[yY]\s*$') {
109
109
  Write-Host " 沒有重啟。"
110
110
  if ($Wait) { $null = Read-Host "按 Enter 關閉" }
@@ -167,26 +167,59 @@ function Get-ShortcutCommand([string]$file) {
167
167
  if ($wt) { return @{ Target = $wt.Source; Arguments = '-w new "{0}" {1}' -f $ps, ($a -replace ';', '\;') } }
168
168
  return @{ Target = $ps; Arguments = $a }
169
169
  }
170
- function New-AgendShortcut([string]$name, [string]$scriptName, [string]$scriptText, [string]$description) {
170
+ function Save-AgendIcon([string]$name, $bytes) {
171
+ if (-not $bytes) { return $null }
172
+ try {
173
+ New-Item -ItemType Directory -Path (Get-AgendShortcutDir) -Force | Out-Null
174
+ $path = Join-Path (Get-AgendShortcutDir) $name
175
+ [IO.File]::WriteAllBytes($path, [byte[]]$bytes)
176
+ return $path
177
+ } catch { return $null }
178
+ }
179
+ function New-AgendShortcut([string]$name, [string]$scriptName, [string]$scriptText, [string]$description, [string]$icon = '') {
171
180
  $dir = Get-AgendShortcutDir
172
181
  New-Item -ItemType Directory -Path $dir -Force | Out-Null
173
182
  $file = Join-Path $dir $scriptName
174
183
  [IO.File]::WriteAllText($file, $scriptText, (New-Object System.Text.UTF8Encoding $true))
175
184
  $lnk = Join-Path ([Environment]::GetFolderPath('Desktop')) ($name + '.lnk')
176
- $shell = New-Object -ComObject WScript.Shell
177
- $sc = $shell.CreateShortcut($lnk)
178
- $cmd = Get-ShortcutCommand $file
179
- $sc.TargetPath = $cmd.Target
180
- $sc.Arguments = $cmd.Arguments
181
- $sc.Description = $description
182
- $sc.Save()
185
+ $staged = $lnk + '.agend-new'
186
+ # WScript.Shell saves a shortcut through the system ANSI code page: on a Windows whose system language has no 儀表板
187
+ # (English, Japanese...) Save() on the Chinese name fails. So it is saved under an ASCII name here, then put in place
188
+ # by .NET (Unicode). Leftovers of a run that died midway are ours by name, and only those are removed.
189
+ Get-ChildItem -LiteralPath $dir -Filter 'shortcut-*.tmp.lnk' -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
190
+ if ([IO.File]::Exists($staged)) { [IO.File]::Delete($staged) }
191
+ $tmp = Join-Path $dir ('shortcut-' + [guid]::NewGuid().ToString('N') + '.tmp.lnk')
192
+ try {
193
+ $shell = New-Object -ComObject WScript.Shell
194
+ $sc = $shell.CreateShortcut($tmp)
195
+ $cmd = Get-ShortcutCommand $file
196
+ $sc.TargetPath = $cmd.Target
197
+ $sc.Arguments = $cmd.Arguments
198
+ $sc.Description = $description
199
+ if ($icon) { $sc.IconLocation = $icon + ',0' }
200
+ $sc.Save()
201
+ # Beside the old one first (same folder, same volume), then swapped in: if that fails, the old shortcut stays.
202
+ [IO.File]::Copy($tmp, $staged, $true)
203
+ if (-not [IO.File]::Exists($lnk)) { [IO.File]::Move($staged, $lnk) }
204
+ else {
205
+ try { [IO.File]::Replace($staged, $lnk, [NullString]::Value) }
206
+ catch {
207
+ # ReplaceFile can fail after the old one is gone (ERROR_UNABLE_TO_MOVE_REPLACEMENT): then the new one goes in.
208
+ if ((-not [IO.File]::Exists($lnk)) -and [IO.File]::Exists($staged)) { [IO.File]::Move($staged, $lnk) } else { throw }
209
+ }
210
+ }
211
+ } finally {
212
+ foreach ($left in @($tmp, $staged)) { try { if ([IO.File]::Exists($left)) { [IO.File]::Delete($left) } } catch { } }
213
+ }
183
214
  return $lnk
184
215
  }
185
- function Install-AgendShortcuts([string]$distro, [string]$user) {
216
+ function Install-AgendShortcuts([string]$distro, [string]$user, $icons = $null) {
186
217
  if (-not $script:OnWindows) { return @() }
187
218
  $made = @()
188
- try { $made += New-AgendShortcut 'AgEnD 儀表板' 'open-dashboard.ps1' (Get-DashboardOpenerScript $distro $user) 'AgEnD 網頁儀表板(自動帶入登入碼)' } catch { }
189
- try { $made += New-AgendShortcut 'AgEnD 重新啟動' 'restart-agend.ps1' (Get-RestartScript $distro $user) '重新啟動 AgEnD(會先詢問)' } catch { }
219
+ $dashIcon = ''; $restartIcon = ''
220
+ if ($icons) { $dashIcon = [string](Save-AgendIcon 'agend.ico' $icons['agend.ico']); $restartIcon = [string](Save-AgendIcon 'agend-restart.ico' $icons['agend-restart.ico']) }
221
+ try { $made += New-AgendShortcut 'AgEnD 儀表板' 'open-dashboard.ps1' (Get-DashboardOpenerScript $distro $user) 'AgEnD 網頁儀表板(自動帶入登入碼)' $dashIcon } catch { }
222
+ try { $made += New-AgendShortcut 'AgEnD 重新啟動' 'restart-agend.ps1' (Get-RestartScript $distro $user) '重新啟動 AgEnD(會先詢問)' $restartIcon } catch { }
190
223
  try {
191
224
  New-Item -ItemType Directory -Path (Get-AgendShortcutDir) -Force | Out-Null
192
225
  $record = @{ distro = $distro; user = $user } | ConvertTo-Json -Compress