@seawork/cli 1.0.4 → 1.0.10-rc.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 (85) hide show
  1. package/dist/cli.d.ts.map +1 -1
  2. package/dist/cli.js +12 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/agent/inspect.d.ts +46 -3
  5. package/dist/commands/agent/inspect.d.ts.map +1 -1
  6. package/dist/commands/agent/inspect.js +3 -3
  7. package/dist/commands/agent/inspect.js.map +1 -1
  8. package/dist/commands/agent/ls.d.ts +3 -0
  9. package/dist/commands/agent/ls.d.ts.map +1 -1
  10. package/dist/commands/agent/ls.js +1 -1
  11. package/dist/commands/agent/ls.js.map +1 -1
  12. package/dist/commands/daemon/status.d.ts.map +1 -1
  13. package/dist/commands/daemon/status.js +0 -1
  14. package/dist/commands/daemon/status.js.map +1 -1
  15. package/dist/commands/doctor.d.ts +10 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +107 -0
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/provider/index.js +1 -1
  20. package/dist/commands/provider/index.js.map +1 -1
  21. package/dist/commands/remote/attach.d.ts +32 -0
  22. package/dist/commands/remote/attach.d.ts.map +1 -0
  23. package/dist/commands/remote/attach.js +102 -0
  24. package/dist/commands/remote/attach.js.map +1 -0
  25. package/dist/commands/remote/index.d.ts +3 -0
  26. package/dist/commands/remote/index.d.ts.map +1 -0
  27. package/dist/commands/remote/index.js +16 -0
  28. package/dist/commands/remote/index.js.map +1 -0
  29. package/dist/commands/remote/inspect.d.ts +10 -0
  30. package/dist/commands/remote/inspect.d.ts.map +1 -0
  31. package/dist/commands/remote/inspect.js +43 -0
  32. package/dist/commands/remote/inspect.js.map +1 -0
  33. package/dist/commands/remote/logs.d.ts +9 -0
  34. package/dist/commands/remote/logs.d.ts.map +1 -0
  35. package/dist/commands/remote/logs.js +55 -0
  36. package/dist/commands/remote/logs.js.map +1 -0
  37. package/dist/commands/remote/ls.d.ts +11 -0
  38. package/dist/commands/remote/ls.d.ts.map +1 -0
  39. package/dist/commands/remote/ls.js +44 -0
  40. package/dist/commands/remote/ls.js.map +1 -0
  41. package/dist/commands/remote/status.d.ts +14 -0
  42. package/dist/commands/remote/status.d.ts.map +1 -0
  43. package/dist/commands/remote/status.js +65 -0
  44. package/dist/commands/remote/status.js.map +1 -0
  45. package/dist/commands/sac/3d.d.ts +5 -0
  46. package/dist/commands/sac/3d.d.ts.map +1 -0
  47. package/dist/commands/sac/3d.js +49 -0
  48. package/dist/commands/sac/3d.js.map +1 -0
  49. package/dist/commands/sac/audio.d.ts +5 -0
  50. package/dist/commands/sac/audio.d.ts.map +1 -0
  51. package/dist/commands/sac/audio.js +36 -0
  52. package/dist/commands/sac/audio.js.map +1 -0
  53. package/dist/commands/sac/common.d.ts +23 -0
  54. package/dist/commands/sac/common.d.ts.map +1 -0
  55. package/dist/commands/sac/common.js +117 -0
  56. package/dist/commands/sac/common.js.map +1 -0
  57. package/dist/commands/sac/image.d.ts +5 -0
  58. package/dist/commands/sac/image.d.ts.map +1 -0
  59. package/dist/commands/sac/image.js +55 -0
  60. package/dist/commands/sac/image.js.map +1 -0
  61. package/dist/commands/sac/index.d.ts +3 -0
  62. package/dist/commands/sac/index.d.ts.map +1 -0
  63. package/dist/commands/sac/index.js +26 -0
  64. package/dist/commands/sac/index.js.map +1 -0
  65. package/dist/commands/sac/models.d.ts +10 -0
  66. package/dist/commands/sac/models.d.ts.map +1 -0
  67. package/dist/commands/sac/models.js +57 -0
  68. package/dist/commands/sac/models.js.map +1 -0
  69. package/dist/commands/sac/task.d.ts +14 -0
  70. package/dist/commands/sac/task.d.ts.map +1 -0
  71. package/dist/commands/sac/task.js +56 -0
  72. package/dist/commands/sac/task.js.map +1 -0
  73. package/dist/commands/sac/video.d.ts +5 -0
  74. package/dist/commands/sac/video.d.ts.map +1 -0
  75. package/dist/commands/sac/video.js +101 -0
  76. package/dist/commands/sac/video.js.map +1 -0
  77. package/dist/commands/sessions/index.d.ts +3 -0
  78. package/dist/commands/sessions/index.d.ts.map +1 -0
  79. package/dist/commands/sessions/index.js +10 -0
  80. package/dist/commands/sessions/index.js.map +1 -0
  81. package/dist/commands/sessions/ls.d.ts +21 -0
  82. package/dist/commands/sessions/ls.d.ts.map +1 -0
  83. package/dist/commands/sessions/ls.js +109 -0
  84. package/dist/commands/sessions/ls.js.map +1 -0
  85. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attach.js","sourceRoot":"","sources":["../../../src/commands/remote/attach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,YAAY,GAEb,MAAM,iBAAiB,CAAC;AACzB,OAAO,SAAS,MAAM,IAAI,CAAC;AAC3B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAcjC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAC9D,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,MAAM,OAAO,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IACpD,CA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K,EAAE;KAC8B,CAAC,CAAC;IAE/D,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACrC,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACjE,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,KAAK,CAAC,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;IACvF,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function createRemoteCommand(): Command;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/remote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,mBAAmB,IAAI,OAAO,CAkB7C"}
@@ -0,0 +1,16 @@
1
+ import { Command } from "commander";
2
+ import { withOutput } from "../../output/index.js";
3
+ import { addJsonOption } from "../../utils/command-options.js";
4
+ import { addRemoteInspectOptions, runRemoteInspectCommand } from "./inspect.js";
5
+ import { addRemoteLogsOptions, runRemoteLogsCommand } from "./logs.js";
6
+ import { addRemoteLsOptions, runRemoteLsCommand } from "./ls.js";
7
+ import { addRemoteStatusOptions, runRemoteStatusCommand } from "./status.js";
8
+ export function createRemoteCommand() {
9
+ const remote = new Command("remote").description("Attach to a remote daemon via relay for read-only debugging");
10
+ addJsonOption(addRemoteLsOptions(remote.command("ls"))).action(withOutput(runRemoteLsCommand));
11
+ addRemoteLogsOptions(remote.command("logs")).action(runRemoteLogsCommand);
12
+ addJsonOption(addRemoteStatusOptions(remote.command("status"))).action(withOutput(runRemoteStatusCommand));
13
+ addJsonOption(addRemoteInspectOptions(remote.command("inspect"))).action(withOutput(runRemoteInspectCommand));
14
+ return remote;
15
+ }
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/remote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE7E,MAAM,UAAU,mBAAmB;IACjC,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,WAAW,CAC9C,6DAA6D,CAC9D,CAAC;IAEF,aAAa,CAAC,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAE/F,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAE1E,aAAa,CAAC,sBAAsB,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CACpE,UAAU,CAAC,sBAAsB,CAAC,CACnC,CAAC;IAEF,aAAa,CAAC,uBAAuB,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CACtE,UAAU,CAAC,uBAAuB,CAAC,CACpC,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, ListResult } from "../../output/index.js";
3
+ import { type InspectRow } from "../agent/inspect.js";
4
+ export declare function addRemoteInspectOptions(cmd: Command): Command;
5
+ export interface RemoteInspectOptions extends CommandOptions {
6
+ offer?: string;
7
+ }
8
+ export type RemoteInspectResult = ListResult<InspectRow>;
9
+ export declare function runRemoteInspectCommand(agentIdArg: string, options: RemoteInspectOptions, _command: Command): Promise<RemoteInspectResult>;
10
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/commands/remote/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAgB,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAEL,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AAG7B,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAK7D;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC;AAEzD,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,mBAAmB,CAAC,CAoB9B"}
@@ -0,0 +1,43 @@
1
+ import { createInspectSchema, toInspectData, toInspectRows, } from "../agent/inspect.js";
2
+ import { attachRemote } from "./attach.js";
3
+ export function addRemoteInspectOptions(cmd) {
4
+ return cmd
5
+ .description("Inspect an agent on a remote daemon via relay")
6
+ .argument("<id>", "Agent ID (or prefix)")
7
+ .option("--offer <url>", "Pairing offer URL (or set SEAWORK_REMOTE_OFFER)");
8
+ }
9
+ export async function runRemoteInspectCommand(agentIdArg, options, _command) {
10
+ if (!agentIdArg?.trim()) {
11
+ const error = { code: "MISSING_AGENT_ID", message: "Agent ID is required" };
12
+ throw error;
13
+ }
14
+ const { client } = await attachRemoteOrThrow(options);
15
+ try {
16
+ const result = await client.fetchAgent(agentIdArg);
17
+ if (!result) {
18
+ const error = {
19
+ code: "AGENT_NOT_FOUND",
20
+ message: `Agent not found: ${agentIdArg}`,
21
+ };
22
+ throw error;
23
+ }
24
+ const data = toInspectData(result.agent);
25
+ return { type: "list", data: toInspectRows(data), schema: createInspectSchema(data) };
26
+ }
27
+ finally {
28
+ await client.close().catch(() => { });
29
+ }
30
+ }
31
+ async function attachRemoteOrThrow(options) {
32
+ try {
33
+ return await attachRemote({ offer: options.offer });
34
+ }
35
+ catch (err) {
36
+ const error = {
37
+ code: "REMOTE_ATTACH_FAILED",
38
+ message: err instanceof Error ? err.message : String(err),
39
+ };
40
+ throw error;
41
+ }
42
+ }
43
+ //# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../src/commands/remote/inspect.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EAEnB,aAAa,EACb,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,C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,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAiB;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions } from "../../output/index.js";
3
+ export declare function addRemoteLogsOptions(cmd: Command): Command;
4
+ export interface RemoteLogsOptions extends CommandOptions {
5
+ offer?: string;
6
+ tail?: string;
7
+ }
8
+ export declare function runRemoteLogsCommand(id: string, options: RemoteLogsOptions, _command: Command): Promise<void>;
9
+ //# sourceMappingURL=logs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/commands/remote/logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAM1D;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAQD,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,iBAAiB,EAC1B,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,IAAI,CAAC,CAoCf"}
@@ -0,0 +1,55 @@
1
+ import { fetchAgentTimelineItems, formatAgentActivityTranscript } from "../agent/logs.js";
2
+ import { attachRemote } from "./attach.js";
3
+ export function addRemoteLogsOptions(cmd) {
4
+ return cmd
5
+ .description("View timeline of an agent on a remote daemon via relay")
6
+ .argument("<id>", "Agent ID (or prefix)")
7
+ .option("--tail <n>", "Show last n entries")
8
+ .option("--offer <url>", "Pairing offer URL (or set SEAWORK_REMOTE_OFFER)");
9
+ }
10
+ function parseTail(raw) {
11
+ if (raw === undefined)
12
+ return undefined;
13
+ const n = Number.parseInt(raw, 10);
14
+ return Number.isNaN(n) || n < 0 ? undefined : n;
15
+ }
16
+ export async function runRemoteLogsCommand(id, options, _command) {
17
+ if (!id) {
18
+ console.error("Error: Agent ID required");
19
+ process.exit(1);
20
+ }
21
+ if (options.tail !== undefined && parseTail(options.tail) === undefined) {
22
+ console.error(`Error: Invalid --tail value: ${options.tail}`);
23
+ process.exit(1);
24
+ }
25
+ let client;
26
+ try {
27
+ ({ client } = await attachRemote({ offer: options.offer }));
28
+ }
29
+ catch (err) {
30
+ console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
31
+ process.exit(1);
32
+ }
33
+ try {
34
+ const fetchResult = await client.fetchAgent(id);
35
+ if (!fetchResult) {
36
+ console.error(`Error: No agent found matching: ${id}`);
37
+ await client.close();
38
+ process.exit(1);
39
+ }
40
+ const resolvedId = fetchResult.agent.id;
41
+ const items = await fetchAgentTimelineItems(client, resolvedId);
42
+ const tailCount = parseTail(options.tail);
43
+ if (tailCount === 0)
44
+ return;
45
+ console.log(formatAgentActivityTranscript(items, tailCount));
46
+ }
47
+ catch (err) {
48
+ console.error(`Error: Failed to get logs: ${err instanceof Error ? err.message : String(err)}`);
49
+ process.exit(1);
50
+ }
51
+ finally {
52
+ await client.close().catch(() => { });
53
+ }
54
+ }
55
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/commands/remote/logs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,6BAA6B,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE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command } from "commander";
2
+ import type { CommandOptions, ListResult } from "../../output/index.js";
3
+ import { type AgentListItem } from "../agent/ls.js";
4
+ export declare function addRemoteLsOptions(cmd: Command): Command;
5
+ export interface RemoteLsOptions extends CommandOptions {
6
+ offer?: string;
7
+ all?: boolean;
8
+ }
9
+ export type RemoteLsResult = ListResult<AgentListItem>;
10
+ export declare function runRemoteLsCommand(options: RemoteLsOptions, _command: Command): Promise<RemoteLsResult>;
11
+ //# sourceMappingURL=ls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../src/commands/remote/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAgB,cAAc,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACtF,OAAO,EAAiB,KAAK,aAAa,EAAc,MAAM,gBAAgB,CAAC;AAG/E,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKxD;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;AAEvD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,cAAc,CAAC,CAoBzB"}
@@ -0,0 +1,44 @@
1
+ import { agentLsSchema, toListItem } from "../agent/ls.js";
2
+ import { attachRemote } from "./attach.js";
3
+ export function addRemoteLsOptions(cmd) {
4
+ return cmd
5
+ .description("List agents on a remote daemon via relay")
6
+ .option("-a, --all", "Include archived agents")
7
+ .option("--offer <url>", "Pairing offer URL (or set SEAWORK_REMOTE_OFFER)");
8
+ }
9
+ export async function runRemoteLsCommand(options, _command) {
10
+ const { client } = await attachRemoteOrThrow(options);
11
+ try {
12
+ const payload = await client.fetchAgents({
13
+ filter: options.all ? { includeArchived: true } : undefined,
14
+ });
15
+ let agents = payload.entries.map((e) => e.agent);
16
+ if (!options.all) {
17
+ agents = agents.filter((a) => !a.archivedAt);
18
+ }
19
+ const statusOrder = { running: 0, idle: 1 };
20
+ agents.sort((a, b) => {
21
+ const d = (statusOrder[a.status] ?? 999) - (statusOrder[b.status] ?? 999);
22
+ if (d !== 0)
23
+ return d;
24
+ return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
25
+ });
26
+ return { type: "list", data: agents.map(toListItem), schema: agentLsSchema };
27
+ }
28
+ finally {
29
+ await client.close().catch(() => { });
30
+ }
31
+ }
32
+ async function attachRemoteOrThrow(options) {
33
+ try {
34
+ return await attachRemote({ offer: options.offer });
35
+ }
36
+ catch (err) {
37
+ const error = {
38
+ code: "REMOTE_ATTACH_FAILED",
39
+ message: err instanceof Error ? err.message : String(err),
40
+ };
41
+ throw error;
42
+ }
43
+ }
44
+ //# sourceMappingURL=ls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/commands/remote/ls.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAsB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,kBAAkB,CAAC,GAAY;IAC7C,OAAO,GAAG;SACP,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,WAAW,EAAE,yBAAyB,CAAC;SAC9C,MAAM,CAAC,eAAe,EAAE,iDAAiD,CAAC,CAAC;AAChF,CAAC;AASD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAwB,EACxB,QAAiB;IAEjB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAmB,CAAC,OAAO,CAAC,CAAC;IACtD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,MAAM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AED,KAAK,UAAU,mBAAmB,CAAC,OAAwB;IACzD,IAAI,CAAC;QACH,OAAO,MAAM,YAAY,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAiB;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SAC1D,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Command } from "commander";
2
+ import type { CommandOptions, ListResult } from "../../output/index.js";
3
+ export declare function addRemoteStatusOptions(cmd: Command): Command;
4
+ export interface RemoteStatusOptions extends CommandOptions {
5
+ offer?: string;
6
+ }
7
+ interface StatusRow {
8
+ key: string;
9
+ value: string;
10
+ }
11
+ export type RemoteStatusResult = ListResult<StatusRow>;
12
+ export declare function runRemoteStatusCommand(options: RemoteStatusOptions, _command: Command): Promise<RemoteStatusResult>;
13
+ export {};
14
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/remote/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAgB,cAAc,EAAE,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AAGpG,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAI5D;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,UAAU,SAAS;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAwBD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC;AAEvD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,mBAAmB,EAC5B,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAqC7B"}
@@ -0,0 +1,65 @@
1
+ import { attachRemote } from "./attach.js";
2
+ export function addRemoteStatusOptions(cmd) {
3
+ return cmd
4
+ .description("Show status of a remote daemon via relay")
5
+ .option("--offer <url>", "Pairing offer URL (or set SEAWORK_REMOTE_OFFER)");
6
+ }
7
+ function createRemoteStatusSchema(status) {
8
+ return {
9
+ idField: "key",
10
+ columns: [
11
+ { header: "KEY", field: "key" },
12
+ { header: "VALUE", field: "value" },
13
+ ],
14
+ serialize: () => status,
15
+ };
16
+ }
17
+ function toRows(status) {
18
+ return [
19
+ { key: "Server ID", value: status.serverId },
20
+ { key: "Relay", value: status.relayEndpoint },
21
+ { key: "Daemon Version", value: status.daemonVersion ?? "-" },
22
+ { key: "Agents (total)", value: String(status.agents.total) },
23
+ { key: "Agents (running)", value: String(status.agents.running) },
24
+ { key: "Agents (idle)", value: String(status.agents.idle) },
25
+ ];
26
+ }
27
+ export async function runRemoteStatusCommand(options, _command) {
28
+ let client;
29
+ let offer;
30
+ try {
31
+ ({ client, offer } = await attachRemote({ offer: options.offer }));
32
+ }
33
+ catch (err) {
34
+ const error = {
35
+ code: "REMOTE_ATTACH_FAILED",
36
+ message: err instanceof Error ? err.message : String(err),
37
+ };
38
+ throw error;
39
+ }
40
+ try {
41
+ const version = client.getLastServerInfoMessage()?.version ?? null;
42
+ const payload = await client.fetchAgents({ filter: { includeArchived: true } });
43
+ const agents = payload.entries.map((e) => e.agent);
44
+ const running = agents.filter((a) => a.status === "running").length;
45
+ const idle = agents.filter((a) => a.status === "idle").length;
46
+ const status = {
47
+ serverId: offer.serverId,
48
+ relayEndpoint: offer.relay.endpoint,
49
+ daemonVersion: version,
50
+ agents: { total: agents.length, running, idle },
51
+ };
52
+ return { type: "list", data: toRows(status), schema: createRemoteStatusSchema(status) };
53
+ }
54
+ catch (err) {
55
+ const error = {
56
+ code: "REMOTE_STATUS_FAILED",
57
+ message: `Failed to get remote status: ${err instanceof Error ? err.message : String(err)}`,
58
+ };
59
+ throw error;
60
+ }
61
+ finally {
62
+ await client.close().catch(() => { });
63
+ }
64
+ }
65
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/remote/status.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,OAAO,GAAG;SACP,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,eAAe,EAAE,iDAAiD,CAAC,CAAC;AAChF,CAAC;AAkBD,SAAS,wBAAwB,CAAC,MAAoB;IACpD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,OAAO,EAAE;YACP,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;YAC/B,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;SACpC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,MAAoB;IAClC,OAAO;QACL,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE;QAC5C,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE;QAC7C,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,IAAI,GAAG,EAAE;QAC7D,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;QAC7D,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM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AAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;QAE9D,MAAM,MAAM,GAAiB;YAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ;YACnC,aAAa,EAAE,OAAO;YACtB,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE;SAChD,CAAC;QAEF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1F,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAiB;YAC1B,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EAAE,gCAAgC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SAC5F,CAAC;QACF,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "commander";
2
+ import { type SacCommandOptions } from "./common.js";
3
+ export declare function add3dOptions(cmd: Command): Command;
4
+ export declare function run3dCommand(options: SacCommandOptions): Promise<void>;
5
+ //# sourceMappingURL=3d.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3d.d.ts","sourceRoot":"","sources":["../../../src/commands/sac/3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAA6D,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA0ChH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGlD;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE5E"}
@@ -0,0 +1,49 @@
1
+ import { generate3d } from "@seawork/server/sac";
2
+ import { addSacOptions, runGenerationCommand } from "./common.js";
3
+ const THREE_D_OPTIONS = [
4
+ { flag: "--prompt <text>", description: "3D prompt (required for prompt-driven models)" },
5
+ { flag: "--model <model>", description: "Model ID. Run with --list-models to see all options." },
6
+ { flag: "--list-models", description: "List all available 3D models grouped by provider", type: "boolean" },
7
+ { flag: "--provider <name>", description: "Filter --list-models output by provider name" },
8
+ { flag: "--image-url <url>", description: "Input image URL" },
9
+ { flag: "--image-urls <url>", description: "Repeatable input image URL", type: "array" },
10
+ { flag: "--image-base64 <data>", description: "Base64 input image for Tencent 3D models" },
11
+ { flag: "--multi-view-image <spec>", description: "Repeatable multi-view image input", type: "array" },
12
+ { flag: "--result-format <fmt>", description: "Tencent 3D output format: OBJ, GLB, STL, USDZ, FBX, MP4" },
13
+ { flag: "--enable-pbr", description: "Enable PBR material generation for Tencent 3D models", type: "boolean" },
14
+ { flag: "--face-count <n>", description: "Tencent Hunyuan 3D Pro face count", type: "number" },
15
+ { flag: "--generate-type <type>", description: "Tencent Hunyuan 3D Pro style" },
16
+ { flag: "--polygon-type <type>", description: "Tencent Hunyuan 3D Pro polygon type" },
17
+ { flag: "--model-version <ver>", description: "Tripo3D model version" },
18
+ { flag: "--model-seed <n>", description: "Tripo3D model seed", type: "number" },
19
+ { flag: "--face-limit <n>", description: "Tripo3D face limit", type: "number" },
20
+ { flag: "--texture <0|1>", description: "Tripo3D texture toggle: 1 enable, 0 disable", type: "number" },
21
+ { flag: "--pbr <0|1>", description: "Tripo3D PBR material toggle: 1 enable, 0 disable", type: "number" },
22
+ { flag: "--texture-seed <n>", description: "Tripo3D texture seed", type: "number" },
23
+ { flag: "--texture-alignment <mode>", description: "Tripo3D texture alignment: original_image or geometry" },
24
+ { flag: "--texture-quality <mode>", description: "Tripo3D texture quality: standard or detailed" },
25
+ { flag: "--auto-size <0|1>", description: "Tripo3D auto-size toggle: 1 enable, 0 disable", type: "number" },
26
+ { flag: "--style <style>", description: "Tripo3D style preset when supported" },
27
+ { flag: "--orientation <dir>", description: "Tripo3D orientation when supported" },
28
+ { flag: "--quad <0|1>", description: "Tripo3D quad-mesh toggle: 1 enable, 0 disable", type: "number" },
29
+ { flag: "--compress <mode>", description: "Tripo3D compression mode" },
30
+ { flag: "--smart-low-poly <0|1>", description: "Tripo3D smart low poly toggle: 1 enable, 0 disable", type: "number" },
31
+ { flag: "--generate-parts <0|1>", description: "Tripo3D parts generation toggle: 1 enable, 0 disable", type: "number" },
32
+ { flag: "--geometry-quality <mode>", description: "Tripo3D geometry quality: standard or detailed" },
33
+ { flag: "--out-dir <dir>", description: "Download generated files to this directory" },
34
+ { flag: "--out-prefix <prefix>", description: "Filename prefix for downloads (default: model)" },
35
+ { flag: "--async", description: "Return task ID immediately without polling", type: "boolean" },
36
+ { flag: "--timeout <seconds>", description: "Request timeout in seconds", type: "number" },
37
+ { flag: "-q, --quiet", description: "Suppress spinners and info messages", type: "boolean" },
38
+ { flag: "--verbose", description: "Print HTTP request/response details", type: "boolean" },
39
+ { flag: "--dry-run", description: "Show request body without executing", type: "boolean" },
40
+ { flag: "--output <format>", description: "Output format: json or text" },
41
+ ];
42
+ export function add3dOptions(cmd) {
43
+ cmd.description("Generate 3D assets via SeaArt AI");
44
+ return addSacOptions(cmd, THREE_D_OPTIONS);
45
+ }
46
+ export async function run3dCommand(options) {
47
+ await runGenerationCommand("3d", generate3d, options);
48
+ }
49
+ //# sourceMappingURL=3d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"3d.js","sourceRoot":"","sources":["../../../src/commands/sac/3d.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EA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,4CAA4C,EAAE,IAAI,EAAE,SAAS,EAAE;IAC/F,EAAE,IAAI,EAAE,qBAAqB,EAAE,WAAW,EAAE,4BAA4B,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC1F,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,qCAAqC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC5F,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,qCAAqC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1F,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,qCAAqC,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1F,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,6BAA6B,EAAE;CAC1E,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,GAAY;IACvC,GAAG,CAAC,WAAW,CAAC,kCAAkC,CAAC,CAAC;IACpD,OAAO,aAAa,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;AAC7C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,OAA0B;IAC3D,MAAM,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Command } from "commander";
2
+ import { type SacCommandOptions } from "./common.js";
3
+ export declare function addAudioOptions(cmd: Command): Command;
4
+ export declare function runAudioCommand(options: SacCommandOptions): Promise<void>;
5
+ //# sourceMappingURL=audio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../src/commands/sac/audio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAA6D,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AA6BhH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGrD;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/E"}
@@ -0,0 +1,36 @@
1
+ import { generateAudio } from "@seawork/server/sac";
2
+ import { addSacOptions, runGenerationCommand } from "./common.js";
3
+ const AUDIO_OPTIONS = [
4
+ { flag: "--prompt <text>", description: "Audio / music description (required for prompt-driven models)" },
5
+ { flag: "--model <model>", description: "Model ID. Run with --list-models to see all options." },
6
+ { flag: "--list-models", description: "List all available audio models grouped by provider", type: "boolean" },
7
+ { flag: "--provider <name>", description: "Filter --list-models output by provider name" },
8
+ { flag: "--lyrics <text>", description: "Song lyrics (mureka_song_generator, required)" },
9
+ { flag: "--mureka-model <model>", description: "Mureka model variant (auto/mureka-7.5/mureka-9 etc.)" },
10
+ { flag: "-n, --n <count>", description: "Number of outputs (mureka)", type: "number" },
11
+ { flag: "--reference-id <id>", description: "Reference music ID (mureka)" },
12
+ { flag: "--vocal-id <id>", description: "Vocal ID (mureka)" },
13
+ { flag: "--melody-id <id>", description: "Melody ID (mureka)" },
14
+ { flag: "--video-url <url>", description: "Input video URL when supported" },
15
+ { flag: "--video-id <id>", description: "Input video task or asset ID when supported" },
16
+ { flag: "--sound-effect-prompt <text>", description: "Sound effect prompt when supported" },
17
+ { flag: "--bgm-prompt <text>", description: "Background music prompt when supported" },
18
+ { flag: "--asmr-mode", description: "Enable ASMR mode when supported", type: "boolean" },
19
+ { flag: "--external-task-id <id>", description: "External task ID when supported by the upstream provider" },
20
+ { flag: "--out-dir <dir>", description: "Download generated files to this directory" },
21
+ { flag: "--out-prefix <prefix>", description: "Filename prefix for downloads (default: audio)" },
22
+ { flag: "--async", description: "Return task ID immediately without polling", type: "boolean" },
23
+ { flag: "--timeout <seconds>", description: "Request timeout in seconds", type: "number" },
24
+ { flag: "-q, --quiet", description: "Suppress spinners and info messages", type: "boolean" },
25
+ { flag: "--verbose", description: "Print HTTP request/response details", type: "boolean" },
26
+ { flag: "--dry-run", description: "Show request body without executing", type: "boolean" },
27
+ { flag: "--output <format>", description: "Output format: json or text" },
28
+ ];
29
+ export function addAudioOptions(cmd) {
30
+ cmd.description("Generate audio and music via SeaArt AI");
31
+ return addSacOptions(cmd, AUDIO_OPTIONS);
32
+ }
33
+ export async function runAudioCommand(options) {
34
+ await runGenerationCommand("audio", generateAudio, options);
35
+ }
36
+ //# sourceMappingURL=audio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audio.js","sourceRoot":"","sources":["../../../src/commands/sac/audio.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAgD,MAAM,aAAa,CAAC;AAEhH,MAAM,aAAa,GAAsB;IACvC,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,+DAA+D,EAAE;IACzG,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,sDAAsD,EAAE;IAChG,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,qDAAqD,EAAE,IAAI,EAAE,SAAS,EAAE;IAC9G,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,8CAA8C,EAAE;IAC1F,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,+CAA+C,EAAE;IACzF,EAAE,IAAI,EAAE,wBAAwB,EAAE,WAAW,EAAE,sDAAsD,EAAE;IACvG,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,4BAA4B,EAAE,IAAI,EAAE,QAAQ,EAAE;IACtF,EAAE,IAAI,EAAE,qBAAqB,EAAE,WAAW,EAAE,6BAA6B,EAAE;IAC3E,EAAE,IAAI,EAAE,iBAAiB,EAAE,WAAW,EAAE,mBAAmB,EAAE;IAC7D,EAAE,IAAI,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE;IAC/D,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,gCAAgC,EAAE;IAC5E,EAAE,IAAI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,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { Command } from "commander";
2
+ import { generateAudio, generate3d, generateImage, generateVideo, type ModelCategory } from "@seawork/server/sac";
3
+ export interface SacCliOptionDef {
4
+ flag: string;
5
+ description: string;
6
+ type?: "boolean" | "number" | "array";
7
+ }
8
+ type GenerationRunner = typeof generateImage | typeof generateVideo | typeof generateAudio | typeof generate3d;
9
+ export interface SacCommandOptions extends Record<string, unknown> {
10
+ timeout?: number;
11
+ quiet?: boolean;
12
+ verbose?: boolean;
13
+ dryRun?: boolean;
14
+ output?: string;
15
+ async?: boolean;
16
+ listModels?: boolean;
17
+ provider?: string;
18
+ }
19
+ export declare function addSacOptions(cmd: Command, defs: SacCliOptionDef[]): Command;
20
+ export declare function renderCategoryModelList(category: ModelCategory, options: SacCommandOptions): void;
21
+ export declare function runGenerationCommand(category: ModelCategory, runner: GenerationRunner, options: SacCommandOptions): Promise<void>;
22
+ export {};
23
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/commands/sac/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAGL,aAAa,EACb,UAAU,EACV,aAAa,EACb,aAAa,EAQb,KAAK,aAAa,EAEnB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;CACvC;AAED,KAAK,gBAAgB,GAAG,OAAO,aAAa,GAAG,OAAO,aAAa,GAAG,OAAO,aAAa,GAAG,OAAO,UAAU,CAAC;AAE/G,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAUD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,OAAO,CAqB5E;AAoCD,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,iBAAiB,GACzB,IAAI,CAoBN;AA+BD,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAqBf"}
@@ -0,0 +1,117 @@
1
+ import { detectOutputFormat, formatOutput, getSACApiKey, getSACBaseUrl, modelsByProvider, requireSACApiKey, SACError, } from "@seawork/server/sac";
2
+ function numberParser(value) {
3
+ return Number(value);
4
+ }
5
+ function arrayParser(value, previous = []) {
6
+ return [...previous, value];
7
+ }
8
+ export function addSacOptions(cmd, defs) {
9
+ for (const def of defs) {
10
+ if (def.type === "boolean") {
11
+ cmd.option(def.flag, def.description);
12
+ continue;
13
+ }
14
+ if (def.type === "number") {
15
+ cmd.option(def.flag, def.description, numberParser);
16
+ continue;
17
+ }
18
+ if (def.type === "array") {
19
+ cmd.option(def.flag, def.description, arrayParser);
20
+ continue;
21
+ }
22
+ cmd.option(def.flag, def.description);
23
+ }
24
+ return cmd;
25
+ }
26
+ function buildConfig(options, requireAuth) {
27
+ const apiKey = requireAuth ? requireSACApiKey() : getSACApiKey();
28
+ return {
29
+ apiKey,
30
+ multimodalBaseUrl: getSACBaseUrl(),
31
+ timeout: options.timeout ?? 300,
32
+ verbose: options.verbose ?? false,
33
+ quiet: options.quiet ?? false,
34
+ dryRun: options.dryRun ?? false,
35
+ async: options.async ?? false,
36
+ };
37
+ }
38
+ function buildFlags(options) {
39
+ return {
40
+ ...options,
41
+ quiet: options.quiet ?? false,
42
+ verbose: options.verbose ?? false,
43
+ dryRun: options.dryRun ?? false,
44
+ async: options.async ?? false,
45
+ };
46
+ }
47
+ function buildProviderModelsList(category, filterProvider) {
48
+ const byProvider = modelsByProvider(category);
49
+ const providers = [];
50
+ for (const [provider, models] of byProvider) {
51
+ if (filterProvider && provider !== filterProvider)
52
+ continue;
53
+ providers.push({ provider, models });
54
+ }
55
+ return providers;
56
+ }
57
+ export function renderCategoryModelList(category, options) {
58
+ const format = detectOutputFormat(options.output);
59
+ const providers = buildProviderModelsList(category, typeof options.provider === "string" ? options.provider : undefined);
60
+ if (format === "json") {
61
+ console.log(formatOutput({ category, providers }, format));
62
+ return;
63
+ }
64
+ if (providers.length === 0) {
65
+ console.log(`No ${category} models found.`);
66
+ return;
67
+ }
68
+ for (const entry of providers) {
69
+ process.stdout.write(`\n[${entry.provider}]\n`);
70
+ for (const model of entry.models) {
71
+ process.stdout.write(` ${model}\n`);
72
+ }
73
+ }
74
+ }
75
+ function renderGenerationResult(format, options, result) {
76
+ if (result.request) {
77
+ console.log(formatOutput({ request: result.request }, format));
78
+ return;
79
+ }
80
+ if (result.raw) {
81
+ console.log(formatOutput(result.raw, format));
82
+ return;
83
+ }
84
+ if (options.quiet && format === "text" && result.urls) {
85
+ console.log(result.urls.join("\n"));
86
+ return;
87
+ }
88
+ const output = {
89
+ ...(result.taskId ? { task_id: result.taskId } : {}),
90
+ ...(result.status ? { status: result.status } : {}),
91
+ ...(result.urls ? { urls: result.urls } : {}),
92
+ ...(result.saved ? { saved: result.saved } : {}),
93
+ };
94
+ console.log(formatOutput(output, format));
95
+ }
96
+ export async function runGenerationCommand(category, runner, options) {
97
+ const format = detectOutputFormat(options.output);
98
+ try {
99
+ if (options.listModels) {
100
+ renderCategoryModelList(category, options);
101
+ return;
102
+ }
103
+ const requireAuth = !(options.dryRun ?? false);
104
+ const config = buildConfig(options, requireAuth);
105
+ const flags = buildFlags(options);
106
+ const result = await runner({ config, flags, apiKey: config.apiKey });
107
+ renderGenerationResult(format, options, result);
108
+ }
109
+ catch (err) {
110
+ if (err instanceof SACError) {
111
+ console.error(formatOutput(err.toJSON(), format));
112
+ process.exit(err.exitCode);
113
+ }
114
+ throw err;
115
+ }
116
+ }
117
+ //# sourceMappingURL=common.js.map