@songsid/agend 2.3.5-alpha.13 → 2.3.5-alpha.14

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 (39) hide show
  1. package/dist/agent-export.d.ts +74 -0
  2. package/dist/agent-export.js +362 -0
  3. package/dist/agent-export.js.map +1 -0
  4. package/dist/build-provenance.json +1 -1
  5. package/dist/cli.js +27 -12
  6. package/dist/cli.js.map +1 -1
  7. package/dist/fleet-manager.d.ts +7 -0
  8. package/dist/fleet-manager.js +20 -1
  9. package/dist/fleet-manager.js.map +1 -1
  10. package/dist/hub/join/local.d.ts +1 -0
  11. package/dist/hub/join/local.js +8 -3
  12. package/dist/hub/join/local.js.map +1 -1
  13. package/dist/install-user-systemd.d.ts +20 -0
  14. package/dist/install-user-systemd.js +55 -0
  15. package/dist/install-user-systemd.js.map +1 -0
  16. package/dist/linux-launchers.d.ts +88 -0
  17. package/dist/linux-launchers.js +296 -0
  18. package/dist/linux-launchers.js.map +1 -0
  19. package/dist/locale.js +85 -2
  20. package/dist/locale.js.map +1 -1
  21. package/dist/service-installer.js +11 -2
  22. package/dist/service-installer.js.map +1 -1
  23. package/dist/ui/agent-export-dialog.js +169 -0
  24. package/dist/ui/agent-export-strings.js +81 -0
  25. package/dist/ui/settings-dialogs.js +3 -1
  26. package/dist/update-dispatch.d.ts +12 -0
  27. package/dist/update-dispatch.js +11 -0
  28. package/dist/update-dispatch.js.map +1 -1
  29. package/dist/web-api.d.ts +2 -0
  30. package/dist/web-api.js +49 -0
  31. package/dist/web-api.js.map +1 -1
  32. package/dist/windows-shortcuts.d.ts +29 -5
  33. package/dist/windows-shortcuts.js +52 -9
  34. package/dist/windows-shortcuts.js.map +1 -1
  35. package/launcher/agend-install.cjs +7 -1
  36. package/package.json +1 -1
  37. package/templates/icons/agend-restart.ico +0 -0
  38. package/templates/icons/agend.ico +0 -0
  39. package/templates/windows-shortcuts.ps1 +45 -12
@@ -0,0 +1,74 @@
1
+ import type { InstanceConfig } from "./types.js";
2
+ export declare const AGENT_EXPORT_VERSION = 1;
3
+ /**
4
+ * The most an agent's `systemPrompt` ("Agent instructions") may hold, in characters: the editor's limit
5
+ * (ui/agent-instructions-field.js INSTRUCTIONS_MAX_CHARS; tests/agent-export-163.test.ts keeps the two equal).
6
+ */
7
+ export declare const AGENT_INSTRUCTIONS_MAX_CHARS = 24000;
8
+ /** The largest file `parseAgentExport` reads, in characters (the instructions alone may take 24,000). */
9
+ export declare const AGENT_EXPORT_MAX_CHARS = 200000;
10
+ /** What an export can carry, as the checkboxes of the export dialog. */
11
+ export declare const EXPORT_GROUPS: readonly ["identity", "systemPrompt", "runtime", "behavior"];
12
+ export type ExportGroup = (typeof EXPORT_GROUPS)[number];
13
+ /** Why a field of a file is not loaded (the page words each code). */
14
+ export type SkipReason = "machine" | "binding" | "account" | "permission" | "command" | "emoji" | "notice" | "fleetOnly" | "name" | "runtimeSwitch" | "fileRef" | "unknown" | "badValue" | "tooLong";
15
+ export interface Skipped {
16
+ path: string;
17
+ reason: SkipReason;
18
+ }
19
+ export interface SecretFinding {
20
+ field: string;
21
+ line: number;
22
+ kind: string;
23
+ }
24
+ /** Where a text looks like it holds a secret: the field, the line and the kind — never the secret itself. */
25
+ export declare function scanForSecrets(field: string, text: string): SecretFinding[];
26
+ export interface BuildResult {
27
+ /** The file, or null when something in it looks like a secret (nothing is offered to copy or download). */
28
+ text: string | null;
29
+ findings: SecretFinding[];
30
+ /** What the file holds, by group (the page's preview of "what will be in it"). */
31
+ groups: ExportGroup[];
32
+ /** True when none of the chosen settings is saved on this agent: the file would hold nothing. */
33
+ empty: boolean;
34
+ /** A chosen setting this agent has but the file does not carry, and why (the dialog says so beside the preview). */
35
+ omitted: Array<{
36
+ field: "systemPrompt";
37
+ reason: "fileRef" | "tooLong";
38
+ }>;
39
+ }
40
+ /** Only what this agent itself sets (a field that follows the fleet's defaults is not written). */
41
+ export declare function buildAgentExport(role: string, inst: Partial<InstanceConfig>, include: readonly string[]): BuildResult;
42
+ /** What a file fills into the form: only the values that passed every check, under the form's own names. */
43
+ export interface FillValues {
44
+ description?: string;
45
+ tags?: string[];
46
+ systemPrompt?: string;
47
+ model?: string;
48
+ model_failover?: string;
49
+ tool_set?: string;
50
+ lightweight?: boolean;
51
+ hang_detector?: number;
52
+ tool_progress?: string;
53
+ reply_completion_guard?: boolean;
54
+ log_level?: string;
55
+ auto_pause_after?: number;
56
+ agent_mode?: string;
57
+ cross_instance_visibility?: string;
58
+ board_cards_at_once?: number;
59
+ resume_interrupted_work?: boolean;
60
+ }
61
+ export type FillKey = keyof FillValues;
62
+ export type ParseResult = {
63
+ ok: true;
64
+ role?: string;
65
+ fill: FillValues;
66
+ skipped: Skipped[];
67
+ libraryUsed: boolean;
68
+ extraFailover: boolean;
69
+ } | {
70
+ ok: false;
71
+ error: "empty" | "too_large" | "invalid_yaml" | "not_export" | "unsupported_version" | "wrong_kind";
72
+ };
73
+ /** Read a file: the allow-listed values that are fine, and for every other field why it was left out. */
74
+ export declare function parseAgentExport(input: unknown): ParseResult;
@@ -0,0 +1,362 @@
1
+ /**
2
+ * AGEND-163: an agent's portable settings as one YAML file (`<role>.agend-agent.yaml`, `agend_export: 1`), and the way back.
3
+ *
4
+ * Allow-list only: a field is written, or read, because it is named here — never because it is not excluded. Accounts,
5
+ * keys, channel ids, folders, machine ids, permissions, commands and status emojis are not in the allow-list, so they
6
+ * are neither exported nor loaded; a file that carries them (a hand edit) has them skipped with the reason.
7
+ *
8
+ * Both directions are pure functions of their input: nothing here reads or writes fleet.yaml, so loading a file only
9
+ * fills the form — the person still presses Apply and goes through the usual confirmations.
10
+ */
11
+ import { parseDocument, stringify } from "yaml";
12
+ import { systemPromptParts } from "./prompt-file-ref.js";
13
+ export const AGENT_EXPORT_VERSION = 1;
14
+ /**
15
+ * The most an agent's `systemPrompt` ("Agent instructions") may hold, in characters: the editor's limit
16
+ * (ui/agent-instructions-field.js INSTRUCTIONS_MAX_CHARS; tests/agent-export-163.test.ts keeps the two equal).
17
+ */
18
+ export const AGENT_INSTRUCTIONS_MAX_CHARS = 24_000;
19
+ /** The largest file `parseAgentExport` reads, in characters (the instructions alone may take 24,000). */
20
+ export const AGENT_EXPORT_MAX_CHARS = 200_000;
21
+ const DESCRIPTION_MAX = 2_000;
22
+ const TAG_MAX_CHARS = 64;
23
+ const TAGS_MAX = 50;
24
+ const MODEL_MAX_CHARS = 200;
25
+ const ROLE_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
26
+ const MODEL_RE = /^[A-Za-z0-9][A-Za-z0-9._:/@+[\]-]*$/;
27
+ /** What an export can carry, as the checkboxes of the export dialog. */
28
+ export const EXPORT_GROUPS = ["identity", "systemPrompt", "runtime", "behavior"];
29
+ const TOOL_SETS = ["worker", "coordinator", "standard", "minimal", "full"];
30
+ const TOOL_PROGRESS = ["off", "standard", "verbose"];
31
+ const LOG_LEVELS = ["trace", "debug", "info", "warn", "error"];
32
+ const AGENT_MODES = ["mcp", "cli"];
33
+ const VISIBILITY = ["full", "summary", "hidden"];
34
+ /** The fields a file may name that are on purpose not loaded, and why. A name not here and not allowed is "unknown". */
35
+ const EXCLUDED = {
36
+ display_name: "name",
37
+ working_directory: "machine", runtime: "machine", machine_id: "machine", worktree_source: "machine",
38
+ channel_id: "binding", topic_id: "binding", general_topic: "binding",
39
+ backend_options: "account", credential_profile: "account",
40
+ dashboard: "permission", office_access: "permission", office_pack_access: "permission", skipPermissions: "permission",
41
+ pre_task_command: "command",
42
+ status_emojis: "emoji",
43
+ quota_notice: "notice",
44
+ workflow: "fleetOnly", cost_guard: "fleetOnly", restart_policy: "fleetOnly", profile: "fleetOnly", mcp_proxy_reply: "permission",
45
+ };
46
+ const excludedReason = (key) => (key.startsWith("native_") ? "machine" : Object.hasOwn(EXCLUDED, key) ? EXCLUDED[key] : "unknown");
47
+ // ── The secret scan ────────────────────────────────────────────────────
48
+ const SECRET_PATTERNS = [
49
+ ["private_key", /-----BEGIN [A-Z ]*PRIVATE KEY-----/],
50
+ ["api_key", /\b(?:sk-[A-Za-z0-9_-]{16,}|[sr]k_(?:live|test)_[A-Za-z0-9]{16,}|hf_[A-Za-z0-9]{30,}|gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|glpat-[A-Za-z0-9_-]{16,}|xox[baprs]-[A-Za-z0-9-]{10,}|xapp-\d-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|ASIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{30,}|npm_[A-Za-z0-9]{30,}|ya29\.[A-Za-z0-9._-]{20,})/],
51
+ ["bot_token", /\b\d{7,12}:[A-Za-z0-9_-]{30,}\b/],
52
+ // A Discord bot token has no label of its own: <base64 id>.<timestamp>.<hmac>. This fleet's own credential, so the shape most likely to be pasted.
53
+ ["discord_token", /\b[MNO][A-Za-z0-9_-]{23,27}\.[A-Za-z0-9_-]{6}\.[A-Za-z0-9_-]{27,}/],
54
+ ["webhook", /\b(?:discord(?:app)?\.com\/api\/(?:v\d+\/)?webhooks\/\d+\/[A-Za-z0-9_-]{20,}|hooks\.slack\.com\/services\/T[A-Za-z0-9]+\/B[A-Za-z0-9]+\/[A-Za-z0-9]{16,})/i],
55
+ ["jwt", /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/],
56
+ ["bearer", /\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]{20,}/],
57
+ ["assignment", /\b[\w.-]{0,40}(?:api[_-]?key|secret|token|passwd|password|credential)[\w.-]{0,20}["']?\s*[:=]\s*["']?(?![<{$]|your|xxx|changeme|example)[A-Za-z0-9/+_.~=-]{16,}/i],
58
+ ["url_password", /\b[a-z][a-z0-9+.-]*:\/\/[^\s:/@]+:[^\s@/]{3,}@/i],
59
+ ];
60
+ /** Where a text looks like it holds a secret: the field, the line and the kind — never the secret itself. */
61
+ export function scanForSecrets(field, text) {
62
+ const found = [];
63
+ text.split(/\r?\n/).forEach((line, i) => {
64
+ // A very long line is read in overlapping pieces, so the patterns' cost stays small however long a line is.
65
+ for (let at = 0; at === 0 || at < line.length; at += 3000) {
66
+ const piece = line.slice(at, at + 4000);
67
+ const hit = SECRET_PATTERNS.find(([, re]) => re.test(piece));
68
+ if (hit) {
69
+ found.push({ field, line: i + 1, kind: hit[0] });
70
+ break;
71
+ }
72
+ }
73
+ });
74
+ return found;
75
+ }
76
+ const own = (o, k) => Object.prototype.hasOwnProperty.call(o, k);
77
+ /** Only what this agent itself sets (a field that follows the fleet's defaults is not written). */
78
+ export function buildAgentExport(role, inst, include) {
79
+ const want = new Set(include.filter((g) => EXPORT_GROUPS.includes(g)));
80
+ const agent = {};
81
+ const behavior = {};
82
+ const findings = [];
83
+ const omitted = [];
84
+ const text = (v) => (typeof v === "string" && v.trim() !== "" ? v : undefined);
85
+ if (want.has("identity")) {
86
+ const d = text(inst.description);
87
+ if (d) {
88
+ agent.description = d;
89
+ findings.push(...scanForSecrets("description", d));
90
+ }
91
+ if (Array.isArray(inst.tags) && inst.tags.length) {
92
+ agent.tags = inst.tags.filter((x) => typeof x === "string");
93
+ findings.push(...scanForSecrets("tags", agent.tags.join("\n")));
94
+ }
95
+ }
96
+ if (want.has("systemPrompt")) {
97
+ // Agent instructions: an inline text only. A `file:` part (prompt-file-ref.ts systemPromptParts, the rule the editor and the
98
+ // daemon both use) names a file on the exporter's computer, which means nothing elsewhere: the whole value is left out.
99
+ const s = text(inst.systemPrompt);
100
+ // A text longer than the editor's limit would be written but then refused on load (`tooLong`), so it is left out here and said so.
101
+ if (s && systemPromptParts(s).some((part) => part.startsWith("file:")))
102
+ omitted.push({ field: "systemPrompt", reason: "fileRef" });
103
+ else if (s && s.length > AGENT_INSTRUCTIONS_MAX_CHARS)
104
+ omitted.push({ field: "systemPrompt", reason: "tooLong" });
105
+ else if (s) {
106
+ agent.systemPrompt = s.replace(/\s+$/, "");
107
+ findings.push(...scanForSecrets("systemPrompt", s));
108
+ }
109
+ }
110
+ if (want.has("runtime")) {
111
+ if (text(inst.backend))
112
+ agent.backend = inst.backend;
113
+ if (text(inst.model))
114
+ agent.model = inst.model;
115
+ if (Array.isArray(inst.model_failover) && inst.model_failover.length)
116
+ agent.model_failover = inst.model_failover;
117
+ if (text(inst.tool_set))
118
+ agent.tool_set = inst.tool_set;
119
+ if (typeof inst.lightweight === "boolean")
120
+ agent.lightweight = inst.lightweight;
121
+ }
122
+ if (want.has("behavior")) {
123
+ const hang = inst.hang_detector;
124
+ if (hang && typeof hang === "object" && typeof hang.timeout_minutes === "number")
125
+ behavior.hang_detector = { timeout_minutes: hang.timeout_minutes };
126
+ for (const key of ["tool_progress", "reply_completion_guard", "log_level", "auto_pause_after", "agent_mode", "cross_instance_visibility", "board_cards_at_once", "resume_interrupted_work"]) {
127
+ if (own(inst, key) && inst[key] !== undefined && inst[key] !== null)
128
+ behavior[key] = inst[key];
129
+ }
130
+ }
131
+ const empty = !Object.keys(agent).length && !Object.keys(behavior).length;
132
+ if (findings.length)
133
+ return { text: null, findings, groups: [...want], empty, omitted };
134
+ const doc = { agend_export: AGENT_EXPORT_VERSION, kind: "agent" };
135
+ if (ROLE_RE.test(role))
136
+ doc.role = role;
137
+ doc.agent = agent;
138
+ if (Object.keys(behavior).length)
139
+ doc.behavior = behavior;
140
+ doc.library = { skills: [], mcp: [] };
141
+ return { text: stringify(doc, { lineWidth: 0, blockQuote: "literal" }), findings: [], groups: [...want], empty, omitted };
142
+ }
143
+ const isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
144
+ const str = (v, max) => (typeof v === "string" && v.length <= max ? v : null);
145
+ const num = (v, min, max = 100_000) => (typeof v === "number" && Number.isFinite(v) && v >= min && v <= max ? v : null);
146
+ /** Read a file: the allow-listed values that are fine, and for every other field why it was left out. */
147
+ export function parseAgentExport(input) {
148
+ if (typeof input !== "string" || input.trim() === "")
149
+ return { ok: false, error: "empty" };
150
+ if (input.length > AGENT_EXPORT_MAX_CHARS)
151
+ return { ok: false, error: "too_large" };
152
+ // YAML 1.2 core schema, no aliases (nothing to expand), duplicate keys refused: plain data in, nothing else.
153
+ const doc = parseDocument(input, { version: "1.2", schema: "core", uniqueKeys: true, prettyErrors: false });
154
+ if (doc.errors.length)
155
+ return { ok: false, error: "invalid_yaml" };
156
+ let root;
157
+ try {
158
+ root = doc.toJS({ maxAliasCount: 0 });
159
+ }
160
+ catch {
161
+ return { ok: false, error: "invalid_yaml" };
162
+ }
163
+ if (!isObj(root) || !own(root, "agend_export"))
164
+ return { ok: false, error: "not_export" };
165
+ if (root.agend_export !== AGENT_EXPORT_VERSION)
166
+ return { ok: false, error: "unsupported_version" };
167
+ if (own(root, "kind") && root.kind !== "agent")
168
+ return { ok: false, error: "wrong_kind" };
169
+ const fill = {};
170
+ const skipped = [];
171
+ const skip = (path, reason) => { skipped.push({ path, reason }); };
172
+ let role;
173
+ let libraryUsed = false;
174
+ let extraFailover = false;
175
+ for (const key of Object.keys(root)) {
176
+ if (key === "agend_export" || key === "kind")
177
+ continue;
178
+ if (key === "role") {
179
+ if (typeof root.role === "string" && ROLE_RE.test(root.role))
180
+ role = root.role;
181
+ else
182
+ skip("role", "badValue");
183
+ continue;
184
+ }
185
+ if (key === "agent") {
186
+ if (isObj(root.agent))
187
+ readAgent(root.agent);
188
+ else
189
+ skip("agent", "badValue");
190
+ continue;
191
+ }
192
+ if (key === "behavior") {
193
+ if (isObj(root.behavior))
194
+ readBehavior(root.behavior);
195
+ else
196
+ skip("behavior", "badValue");
197
+ continue;
198
+ }
199
+ if (key === "library") {
200
+ readLibrary(root.library);
201
+ continue;
202
+ }
203
+ skip(key, "unknown");
204
+ }
205
+ function readAgent(a) {
206
+ for (const key of Object.keys(a)) {
207
+ const path = `agent.${key}`, v = a[key];
208
+ switch (key) {
209
+ case "description": {
210
+ const s = str(v, DESCRIPTION_MAX);
211
+ if (s === null)
212
+ skip(path, typeof v === "string" ? "tooLong" : "badValue");
213
+ else if (s.trim())
214
+ fill.description = s;
215
+ break;
216
+ }
217
+ case "tags": {
218
+ if (!Array.isArray(v) || v.length > TAGS_MAX || v.some((x) => typeof x !== "string" || !x.trim() || x.length > TAG_MAX_CHARS))
219
+ skip(path, "badValue");
220
+ else
221
+ fill.tags = [...new Set(v.map((x) => x.trim()))];
222
+ break;
223
+ }
224
+ case "systemPrompt": {
225
+ const s = str(v, AGENT_INSTRUCTIONS_MAX_CHARS);
226
+ if (s === null)
227
+ skip(path, typeof v === "string" ? "tooLong" : "badValue");
228
+ // A `file:` part would make the daemon read a path on the computer that loads this file: never filled from a file.
229
+ else if (systemPromptParts(s).some((part) => part.startsWith("file:")))
230
+ skip(path, "fileRef");
231
+ else if (s.trim())
232
+ fill.systemPrompt = s;
233
+ break;
234
+ }
235
+ case "backend":
236
+ skip(path, "runtimeSwitch");
237
+ break;
238
+ case "model": {
239
+ const s = str(v, MODEL_MAX_CHARS);
240
+ if (s === null || !MODEL_RE.test(s))
241
+ skip(path, "badValue");
242
+ else
243
+ fill.model = s;
244
+ break;
245
+ }
246
+ case "model_failover": {
247
+ if (!Array.isArray(v) || !v.length || v.some((x) => typeof x !== "string" || x.length > MODEL_MAX_CHARS || !MODEL_RE.test(x)))
248
+ skip(path, "badValue");
249
+ else {
250
+ fill.model_failover = v[0];
251
+ extraFailover = v.length > 1;
252
+ }
253
+ break;
254
+ }
255
+ case "tool_set":
256
+ if (typeof v === "string" && TOOL_SETS.includes(v))
257
+ fill.tool_set = v;
258
+ else
259
+ skip(path, "badValue");
260
+ break;
261
+ case "lightweight":
262
+ if (typeof v === "boolean")
263
+ fill.lightweight = v;
264
+ else
265
+ skip(path, "badValue");
266
+ break;
267
+ default: skip(path, excludedReason(key));
268
+ }
269
+ }
270
+ }
271
+ function readBehavior(b) {
272
+ for (const key of Object.keys(b)) {
273
+ const path = `behavior.${key}`, v = b[key];
274
+ switch (key) {
275
+ case "hang_detector": {
276
+ const m = isObj(v) ? num(v.timeout_minutes, 1) : null;
277
+ if (m === null)
278
+ skip(path, "badValue");
279
+ else
280
+ fill.hang_detector = m;
281
+ if (isObj(v))
282
+ for (const k of Object.keys(v))
283
+ if (k !== "timeout_minutes")
284
+ skip(`${path}.${k}`, "unknown");
285
+ break;
286
+ }
287
+ case "tool_progress":
288
+ if (typeof v === "string" && TOOL_PROGRESS.includes(v))
289
+ fill.tool_progress = v;
290
+ else
291
+ skip(path, "badValue");
292
+ break;
293
+ case "reply_completion_guard":
294
+ if (typeof v === "boolean")
295
+ fill.reply_completion_guard = v;
296
+ else
297
+ skip(path, "badValue");
298
+ break;
299
+ case "log_level":
300
+ if (typeof v === "string" && LOG_LEVELS.includes(v))
301
+ fill.log_level = v;
302
+ else
303
+ skip(path, "badValue");
304
+ break;
305
+ case "auto_pause_after": {
306
+ const n = num(v, 0);
307
+ if (n === null)
308
+ skip(path, "badValue");
309
+ else
310
+ fill.auto_pause_after = n;
311
+ break;
312
+ }
313
+ case "agent_mode":
314
+ if (typeof v === "string" && AGENT_MODES.includes(v))
315
+ fill.agent_mode = v;
316
+ else
317
+ skip(path, "badValue");
318
+ break;
319
+ case "cross_instance_visibility":
320
+ if (typeof v === "string" && VISIBILITY.includes(v))
321
+ fill.cross_instance_visibility = v;
322
+ else
323
+ skip(path, "badValue");
324
+ break;
325
+ case "board_cards_at_once":
326
+ if (typeof v === "number" && Number.isInteger(v) && v >= 1 && v <= 1000)
327
+ fill.board_cards_at_once = v;
328
+ else
329
+ skip(path, "badValue");
330
+ break;
331
+ case "resume_interrupted_work":
332
+ if (typeof v === "boolean")
333
+ fill.resume_interrupted_work = v;
334
+ else
335
+ skip(path, "badValue");
336
+ break;
337
+ default: skip(path, excludedReason(key));
338
+ }
339
+ }
340
+ }
341
+ function readLibrary(lib) {
342
+ if (lib === undefined || lib === null)
343
+ return;
344
+ if (!isObj(lib)) {
345
+ skip("library", "badValue");
346
+ return;
347
+ }
348
+ for (const key of Object.keys(lib)) {
349
+ if (key !== "skills" && key !== "mcp") {
350
+ skip(`library.${key}`, "unknown");
351
+ continue;
352
+ }
353
+ const list = lib[key];
354
+ if (!Array.isArray(list))
355
+ skip(`library.${key}`, "badValue");
356
+ else if (list.length)
357
+ libraryUsed = true;
358
+ }
359
+ }
360
+ return { ok: true, ...(role ? { role } : {}), fill, skipped, libraryUsed, extraFailover };
361
+ }
362
+ //# sourceMappingURL=agent-export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-export.js","sourceRoot":"","sources":["../src/agent-export.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AACtC;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;AACnD,yGAAyG;AACzG,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAE9C,MAAM,eAAe,GAAG,KAAK,CAAC;AAC9B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,OAAO,GAAG,mCAAmC,CAAC;AACpD,MAAM,QAAQ,GAAG,qCAAqC,CAAC;AAEvD,wEAAwE;AACxE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAG1F,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAC3E,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;AACrD,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAC/D,MAAM,WAAW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C,CAAC;gBAAC,SAAS;YAAC,CAAC;YACvF,MAAM,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;YACtB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;gBAAE,IAAI,CAAC,WAAW,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;iBACxD,IAAI,IAAI,CAAC,MAAM;gBAAE,WAAW,GAAG,IAAI,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAC5F,CAAC"}
@@ -1 +1 @@
1
- {"format":1,"commit":"1066a85a2c48cae18e700b207adba1cdb450cf5a","ref":"v2.3.5-alpha.13","channel":"release","modified":false,"from":"git"}
1
+ {"format":1,"commit":"9c98307c938b77d8eaaebf5bcd3f20c5c27dce6f","ref":"v2.3.5-alpha.14","channel":"release","modified":false,"from":"git"}
package/dist/cli.js CHANGED
@@ -2027,13 +2027,9 @@ program
2027
2027
  }
2028
2028
  catch (err) {
2029
2029
  console.error(t("install.start_failed", err.message));
2030
- const plat = detectPlatform();
2031
- if (plat === "macos") {
2032
- console.error(`Run manually: launchctl load ${svcPath}`);
2033
- }
2034
- else {
2035
- console.error("Run manually: systemctl --user daemon-reload && systemctl --user enable --now com.agend.fleet");
2036
- }
2030
+ const { installActivationHints } = await import("./install-user-systemd.js");
2031
+ for (const line of installActivationHints(err, detectPlatform(), svcPath))
2032
+ console.error(line);
2037
2033
  process.exitCode = 1;
2038
2034
  }
2039
2035
  }
@@ -2043,14 +2039,33 @@ program
2043
2039
  });
2044
2040
  program
2045
2041
  .command("shortcuts")
2046
- .description("WSL: create or update the Windows desktop shortcuts (the dashboard and restart)")
2047
- .action(async () => {
2042
+ .description("Create or update the desktop shortcuts (the dashboard and restart): on Windows from WSL, or on a Linux desktop")
2043
+ .addOption(new Option("--hint", "print the one-time line about them, if it is due (the installer runs this)").hideHelp())
2044
+ .action(async (opts) => {
2048
2045
  // #1853: for an install that predates the installer's shortcuts, or that is only ever updated with `agend update`.
2049
- const { runShortcuts, realShortcutsDeps } = await import("./windows-shortcuts.js");
2046
+ const { runShortcuts, realShortcutsDeps, detectWsl, realHost, printUpdateShortcutsHint } = await import("./windows-shortcuts.js");
2047
+ // M-2885: the installer's last step (launcher/agend-install.cjs) — a hint never fails an install.
2048
+ if (opts.hint) {
2049
+ await printUpdateShortcutsHint(DATA_DIR).catch(() => { });
2050
+ return;
2051
+ }
2050
2052
  const { spawnSync } = await import("node:child_process");
2053
+ // M-2885: a Linux desktop (not WSL) gets XDG launchers instead.
2054
+ if (process.platform === "linux" && !detectWsl(realHost()).wsl) {
2055
+ const { runLinuxLaunchers, realLinuxHost, packageIcons } = await import("./linux-launchers.js");
2056
+ process.exitCode = await runLinuxLaunchers({
2057
+ host: realLinuxHost((command, args) => {
2058
+ const r = spawnSync(command, args, { encoding: "utf-8", timeout: 15_000, stdio: ["ignore", "pipe", "ignore"] });
2059
+ return { status: r.status, stdout: r.stdout ?? "" };
2060
+ }),
2061
+ dataDir: DATA_DIR, icons: () => packageIcons(), log: line => console.log(line), now: () => new Date(),
2062
+ });
2063
+ return;
2064
+ }
2051
2065
  const { userInfo } = await import("node:os");
2052
- process.exitCode = await runShortcuts(realShortcutsDeps(DATA_DIR, userInfo().username, (command, args) => {
2053
- const r = spawnSync(command, args, { encoding: "utf-8", timeout: 120_000, stdio: ["ignore", "pipe", "pipe"] });
2066
+ process.exitCode = await runShortcuts(realShortcutsDeps(DATA_DIR, userInfo().username, (command, args, input) => {
2067
+ // M-2885: the script (with the icons) goes in on standard input; -EncodedCommand carries only the loader.
2068
+ const r = spawnSync(command, args, { encoding: "utf-8", timeout: 120_000, input, stdio: ["pipe", "pipe", "pipe"] });
2054
2069
  return { status: r.status, stdout: r.stdout ?? "", stderr: r.stderr ?? "", error: r.error };
2055
2070
  }));
2056
2071
  });