@trydreamstate/cli 1.2.0 → 1.3.0

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 (77) hide show
  1. package/README.md +11 -1
  2. package/agent-plugin/.agents/plugins/marketplace.json +20 -0
  3. package/agent-plugin/.claude-plugin/marketplace.json +16 -0
  4. package/agent-plugin/.grok-plugin/marketplace.json +16 -0
  5. package/agent-plugin/plugins/dreamstate/.claude-plugin/plugin.json +21 -0
  6. package/agent-plugin/plugins/dreamstate/.codex-plugin/plugin.json +41 -0
  7. package/agent-plugin/plugins/dreamstate/.mcp.json +8 -0
  8. package/agent-plugin/plugins/dreamstate/skills/crm/SKILL.md +75 -0
  9. package/agent-plugin/plugins/dreamstate/skills/diagnostics/SKILL.md +72 -0
  10. package/agent-plugin/plugins/dreamstate/skills/dreamstate/SKILL.md +16 -0
  11. package/agent-plugin/plugins/dreamstate/skills/first-win/SKILL.md +57 -0
  12. package/agent-plugin/plugins/dreamstate/skills/inbox-replies/SKILL.md +61 -0
  13. package/agent-plugin/plugins/dreamstate/skills/knowledge/SKILL.md +48 -0
  14. package/agent-plugin/plugins/dreamstate/skills/linkedin-posts/SKILL.md +79 -0
  15. package/agent-plugin/plugins/dreamstate/skills/linkedin-warm-signals/SKILL.md +65 -0
  16. package/agent-plugin/plugins/dreamstate/skills/list-building/SKILL.md +105 -0
  17. package/agent-plugin/plugins/dreamstate/skills/list-building/column-authoring.md +37 -0
  18. package/agent-plugin/plugins/dreamstate/skills/list-building/readback.md +15 -0
  19. package/agent-plugin/plugins/dreamstate/skills/list-building/sourcing.md +31 -0
  20. package/agent-plugin/plugins/dreamstate/skills/outreach/SKILL.md +77 -0
  21. package/agent-plugin/plugins/dreamstate/skills/outreach/channels.md +5 -0
  22. package/agent-plugin/plugins/dreamstate/skills/outreach/deliverability-and-caps.md +17 -0
  23. package/agent-plugin/plugins/dreamstate/skills/outreach/enrollment.md +17 -0
  24. package/agent-plugin/plugins/dreamstate/skills/outreach/message-copy.md +41 -0
  25. package/agent-plugin/plugins/dreamstate/skills/outreach/replies.md +5 -0
  26. package/agent-plugin/plugins/dreamstate/skills/outreach/steps-and-timing.md +13 -0
  27. package/agent-plugin/plugins/dreamstate/skills/outreach/stop-and-suppression.md +7 -0
  28. package/agent-plugin/plugins/dreamstate/skills/plays/SKILL.md +81 -0
  29. package/agent-plugin/plugins/dreamstate/skills/reddit-posts/SKILL.md +65 -0
  30. package/agent-plugin/plugins/dreamstate/skills/skill-authoring/SKILL.md +65 -0
  31. package/agent-plugin/plugins/dreamstate/skills/social/SKILL.md +69 -0
  32. package/agent-plugin/plugins/dreamstate/skills/visibility/SKILL.md +60 -0
  33. package/agent-plugin/plugins/dreamstate/skills/visibility/probes.md +15 -0
  34. package/agent-plugin/plugins/dreamstate/skills/visibility/query-sets.md +17 -0
  35. package/agent-plugin/plugins/dreamstate/skills/visibility/search-evidence.md +15 -0
  36. package/agent-plugin/plugins/dreamstate/skills/visibility/technical.md +16 -0
  37. package/agent-plugin/plugins/dreamstate/skills/workflows/SKILL.md +43 -0
  38. package/agent-plugin/plugins/dreamstate/skills/workflows/durable-runs.md +19 -0
  39. package/agent-plugin/plugins/dreamstate/skills/workflows/graph-authoring.md +9 -0
  40. package/agent-plugin/plugins/dreamstate/skills/workflows/lifecycle-and-enrollment.md +11 -0
  41. package/agent-plugin/plugins/dreamstate/skills/workflows/live-replies.md +5 -0
  42. package/agent-plugin/plugins/dreamstate/skills/workflows/recipe-routing.md +5 -0
  43. package/agent-plugin/plugins/dreamstate/skills/worksheet-tidy/SKILL.md +61 -0
  44. package/agent-plugin/plugins/dreamstate/skills/writing/SKILL.md +84 -0
  45. package/agent-plugin/plugins/dreamstate/skills/writing/briefs.md +35 -0
  46. package/agent-plugin/plugins/dreamstate/skills/writing/drafting.md +39 -0
  47. package/agent-plugin/plugins/dreamstate/skills/writing/publishing.md +74 -0
  48. package/agent-plugin/plugins/dreamstate/skills/writing/revision-and-voice.md +31 -0
  49. package/agent-plugin/plugins/dreamstate/skills/x-posts/SKILL.md +73 -0
  50. package/dist/client.d.ts +3 -1
  51. package/dist/client.d.ts.map +1 -1
  52. package/dist/client.js +126 -41
  53. package/dist/commands/sequences.d.ts +1 -1
  54. package/dist/commands/sequences.d.ts.map +1 -1
  55. package/dist/commands/sequences.js +3 -3
  56. package/dist/commands/shared.d.ts +2 -1
  57. package/dist/commands/shared.d.ts.map +1 -1
  58. package/dist/commands/shared.js +98 -20
  59. package/dist/commands/workflows.d.ts +1 -1
  60. package/dist/commands/workflows.d.ts.map +1 -1
  61. package/dist/commands/workflows.js +9 -9
  62. package/dist/config.d.ts +10 -0
  63. package/dist/config.d.ts.map +1 -1
  64. package/dist/config.js +95 -2
  65. package/dist/index.d.ts +51 -1
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +421 -67
  68. package/dist/pluginInstaller.d.ts +22 -0
  69. package/dist/pluginInstaller.d.ts.map +1 -0
  70. package/dist/pluginInstaller.js +122 -0
  71. package/dist/runWait.d.ts +9 -0
  72. package/dist/runWait.d.ts.map +1 -0
  73. package/dist/runWait.js +76 -0
  74. package/dist/skillInstaller.d.ts +1 -0
  75. package/dist/skillInstaller.d.ts.map +1 -1
  76. package/dist/skillInstaller.js +18 -0
  77. package/package.json +3 -2
@@ -36,6 +36,7 @@ export interface PackVerbSpec {
36
36
  json?: boolean;
37
37
  document?: boolean;
38
38
  number?: boolean;
39
+ required?: boolean;
39
40
  }>;
40
41
  mutating: boolean;
41
42
  }
@@ -48,6 +49,6 @@ export declare function buildPackParser(pack: 'sequences' | 'workflows', kind: '
48
49
  */
49
50
  export declare function packScaffold(kind: 'sequence' | 'workflow', name: string): Record<string, unknown>;
50
51
  export declare function runPackInit(kind: 'sequence' | 'workflow', command: CliCommand, stdout: NodeJS.WritableStream): void;
51
- export declare function runPackCommand(client: DreamstateClient, command: CliCommand, stdout: NodeJS.WritableStream): Promise<void>;
52
+ export declare function runPackCommand(client: DreamstateClient, command: CliCommand, stdout: NodeJS.WritableStream, sleep?: (milliseconds: number) => Promise<void>): Promise<void>;
52
53
  export declare function renderPackUsage(pack: string, specs: PackVerbSpec[]): string;
53
54
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAKlD,OAAO,EAA6B,KAAK,UAAU,EAAiC,MAAM,UAAU,CAAC;AAMrG,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IACpD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IAClE;;;;;;;OAOG;IACH;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,QAAQ,GAAC,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IACzH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAsBD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAC,WAAW,EAAE,IAAI,EAAE,UAAU,GAAC,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAC/F,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAU,CAsGhC;AAGD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM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,CAAC;CACnB;AAsBD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,WAAW,GAAC,WAAW,EAAE,IAAI,EAAE,UAAU,GAAC,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAC/F,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,UAAU,CAmHhC;AAGD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BjG;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,UAAU,GAAG,UAAU,EAC7B,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,IAAI,CAuBN;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,KAAK,GAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAiF,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhQ;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,CAM3E"}
@@ -12,6 +12,7 @@ const node_util_1 = require("node:util");
12
12
  // audit:canonical-cutover:clean treats importing them as a release blocker.
13
13
  const index_1 = require("../index");
14
14
  const node_fs_1 = require("node:fs");
15
+ const runWait_1 = require("../runWait");
15
16
  const MODES = ['dry_run', 'live', 'smoke_test'];
16
17
  function parseObject(raw, flag) {
17
18
  try {
@@ -47,7 +48,7 @@ function buildPackParser(pack, kind, specs, usage) {
47
48
  const options = {
48
49
  mode: { type: 'string' }, 'dry-run': { type: 'boolean' }, live: { type: 'boolean' }, 'agent-session-id': { type: 'string' },
49
50
  'idempotency-key': { type: 'string' }, 'max-credits': { type: 'string' }, params: { type: 'string' },
50
- 'json-output': { type: 'boolean' }, open: { type: 'boolean' }, help: { type: 'boolean', short: 'h' },
51
+ 'wait-timeout': { type: 'string' }, 'no-wait': { type: 'boolean' }, 'json-output': { type: 'boolean' }, open: { type: 'boolean' }, help: { type: 'boolean', short: 'h' },
51
52
  };
52
53
  // A verb that takes a JSON document on a flag also takes it from a file, so a
53
54
  // whole authored document can be linted or imported straight off disk instead of
@@ -63,7 +64,14 @@ function buildPackParser(pack, kind, specs, usage) {
63
64
  options.file = { type: 'string' };
64
65
  for (const [flag, definition] of Object.entries(spec.flags ?? {}))
65
66
  options[flag] = { type: definition.type };
66
- const { values, positionals } = (0, node_util_1.parseArgs)({ args: argv.slice(1), options, allowPositionals: true, strict: true });
67
+ let values;
68
+ let positionals;
69
+ try {
70
+ ({ values, positionals } = (0, node_util_1.parseArgs)({ args: argv.slice(1), options, allowPositionals: true, strict: true }));
71
+ }
72
+ catch (error) {
73
+ throw new index_1.CliUsageError(`${error instanceof Error ? error.message : 'Invalid arguments.'}\n${usage}`);
74
+ }
67
75
  const mode = values.mode;
68
76
  const dryRun = values['dry-run'];
69
77
  const live = values.live;
@@ -71,8 +79,13 @@ function buildPackParser(pack, kind, specs, usage) {
71
79
  const idempotencyKey = values['idempotency-key'];
72
80
  const rawParams = values.params;
73
81
  const rawMaxCredits = values['max-credits'];
82
+ const rawWaitTimeout = values['wait-timeout'];
74
83
  if (values.help)
75
- throw new index_1.CliUsageError(usage);
84
+ return { command: 'pack_help', usage, ...(values['json-output'] ? { jsonOutput: true } : {}) };
85
+ for (const [flag, definition] of Object.entries(spec.flags ?? {})) {
86
+ if (definition.required && values[flag] === undefined)
87
+ throw new index_1.CliUsageError(`--${flag} is required for ${pack} ${spec.verb}.\n${usage}`);
88
+ }
76
89
  const positional = spec.positional ?? [];
77
90
  // A document supplied inline or from a file is authored, not saved, so there is no
78
91
  // id to name yet. lint and its kin accept a hypothetical document, which is the
@@ -147,12 +160,16 @@ function buildPackParser(pack, kind, specs, usage) {
147
160
  const maxCredits = rawMaxCredits === undefined ? undefined : Number(rawMaxCredits);
148
161
  if (maxCredits !== undefined && (!Number.isFinite(maxCredits) || maxCredits < 0))
149
162
  throw new index_1.CliUsageError('--max-credits must be a non-negative number');
163
+ const waitTimeout = rawWaitTimeout === undefined ? 120 : Number(rawWaitTimeout);
164
+ if (!Number.isFinite(waitTimeout) || waitTimeout < 0)
165
+ throw new index_1.CliUsageError('--wait-timeout must be a non-negative number');
150
166
  return {
151
167
  command: 'pack', pack, verb: spec.verb, capabilityId: spec.capabilityId, input,
152
168
  ...(explicitMode ? { mode: explicitMode } : spec.mutating ? { mode: 'dry_run' } : {}),
153
169
  ...(agentSessionId ? { agentSessionId } : {}),
154
170
  ...(idempotencyKey ? { idempotencyKey } : {}),
155
171
  ...(maxCredits === undefined ? {} : { maxCredits }), ...(values['json-output'] ? { jsonOutput: true } : {}),
172
+ waitTimeout, ...(values['no-wait'] ? { noWait: true } : {}),
156
173
  ...(values.open ? { open: true } : {}),
157
174
  };
158
175
  };
@@ -177,19 +194,23 @@ function packScaffold(kind, name) {
177
194
  steps: [
178
195
  {
179
196
  id: 'step_1',
180
- kind: 'linkedin',
181
- channel: 'linkedin',
182
- // send_dm, not send_connection_request. compose refuses the latter on purpose:
183
- // a send_dm carrying note_template sends the invitation and then body_template
184
- // once it is accepted, so one step covers both. A scaffold naming the refused
185
- // step lints clean and then fails at create, which is the same trap as before.
186
- action: 'send_dm',
187
- note_template: 'Hi {{first_name}}, would love to connect.',
188
- body_template: 'Thanks for connecting, {{first_name}}.',
197
+ kind: 'email',
198
+ channel: 'email',
199
+ action: 'send_email',
200
+ subject_template: 'Quick question, {{first_name}}',
201
+ body_template: 'Hi {{first_name}},\n\nWould this be useful to you?',
189
202
  },
190
203
  ],
191
204
  }
192
- : { kind: 'workflow', name, nodes: [], edges: [] };
205
+ : {
206
+ kind: 'workflow',
207
+ name,
208
+ nodes: [
209
+ { id: 'trigger-root', type: 'trigger', position: { x: 0, y: 0 }, data: { kind: 'trigger', subtype: 'table', config: {} } },
210
+ { id: 'action-example', type: 'action', position: { x: 0, y: 160 }, data: { kind: 'action', subtype: 'send_connection_request_to_contact', config: {} } },
211
+ ],
212
+ edges: [{ id: 'edge-trigger-action', source: 'trigger-root', target: 'action-example' }],
213
+ };
193
214
  }
194
215
  function runPackInit(kind, command, stdout) {
195
216
  if (command.command !== 'pack')
@@ -216,20 +237,51 @@ function runPackInit(kind, command, stdout) {
216
237
  },
217
238
  }, null, command.jsonOutput ? 0 : 2)}\n`);
218
239
  }
219
- async function runPackCommand(client, command, stdout) {
240
+ async function runPackCommand(client, command, stdout, sleep = (milliseconds) => new Promise((resolve) => setTimeout(resolve, milliseconds))) {
220
241
  if (command.command !== 'pack')
221
242
  throw new index_1.CliUsageError('Pack command required.');
222
243
  // Every run needs a tool_turn_token from tools_get, exactly as the generic
223
244
  // tools run path does. Without it the server refuses capability_not_fetched,
224
245
  // which made every pack verb unusable even though its capability id was right.
225
- const { toolTurnToken } = require('../index');
226
- const turnToken = toolTurnToken(await client.getTool(command.capabilityId));
227
- const result = await client.runCapability(command.capabilityId, {
246
+ const { toolTurnToken, capabilityIdempotencyKey } = require('../index');
247
+ if (command.verb === 'activate' && command.input.max_credits === undefined) {
248
+ throw new index_1.CliUsageError('workflows activate requires --max-credits <n>.');
249
+ }
250
+ if (command.verb === 'publish' || command.verb === 'activate') {
251
+ const workflowId = command.input.workflow_id;
252
+ if (typeof workflowId !== 'string')
253
+ throw new index_1.CliUsageError(`workflows ${command.verb} requires <id>.`);
254
+ const readFetched = await client.getTool('workflow.automations.get');
255
+ const current = await client.runCapability('workflow.automations.get', {
256
+ params: { kind: 'workflow', automation_id: workflowId },
257
+ tool_turn_token: toolTurnToken(readFetched),
258
+ }, capabilityIdempotencyKey(readFetched));
259
+ const workflow = workflowFromGet(current);
260
+ if (command.verb === 'publish') {
261
+ command.input.expected_draft_version_id ??= nullableString(workflow.latest_draft_version_id, 'latest_draft_version_id');
262
+ command.input.expected_active_version_id ??= nullableString(workflow.active_version_id, 'active_version_id');
263
+ }
264
+ else {
265
+ command.input.expected_version_id ??= requiredString(workflow.active_version_id, 'active_version_id');
266
+ }
267
+ }
268
+ const fetched = await client.getTool(command.capabilityId);
269
+ const turnToken = toolTurnToken(fetched);
270
+ let result = await client.runCapability(command.capabilityId, {
228
271
  params: command.input, tool_turn_token: turnToken, ...(command.mode ? { mode: command.mode } : {}),
229
272
  ...(command.agentSessionId ? { agent_session_id: command.agentSessionId } : {}),
230
273
  ...(command.maxCredits === undefined ? {} : { max_credits: command.maxCredits }),
231
- }, command.idempotencyKey);
232
- stdout.write(`${JSON.stringify(result, null, command.jsonOutput ? 0 : 2)}\n`);
274
+ }, capabilityIdempotencyKey(fetched, command.idempotencyKey));
275
+ if (!command.noWait && !(0, runWait_1.columnRunReturnsRunId)(command.capabilityId)) {
276
+ const waited = await (0, runWait_1.waitForRun)(client, result, command.waitTimeout, sleep);
277
+ result = waited.value;
278
+ if (waited.timedOut)
279
+ process.exitCode = runWait_1.RUN_WAIT_TIMEOUT_EXIT_CODE;
280
+ }
281
+ const output = command.mode === 'dry_run' && result && typeof result === 'object' && !Array.isArray(result)
282
+ ? { ...result, meta: { ...(result.meta ?? {}), dry_run: true, note: 'dry_run: true, rerun with --live to apply' } }
283
+ : result;
284
+ stdout.write(`${JSON.stringify(output, null, command.jsonOutput ? 0 : 2)}\n`);
233
285
  if (!command.jsonOutput) {
234
286
  const root = result && typeof result === 'object' ? result : {};
235
287
  const webUrl = root.web_url ?? root.data?.web_url;
@@ -245,5 +297,31 @@ async function runPackCommand(client, command, stdout) {
245
297
  }
246
298
  }
247
299
  function renderPackUsage(pack, specs) {
248
- return `Usage: dreamstate ${pack} <verb> [args] [flags]\n\nVerbs:\n${specs.map((spec) => ` ${spec.verb.padEnd(18)} ${spec.summary}`).join('\n')}`;
300
+ return `Usage: dreamstate ${pack} <verb> [args] [flags]\nRequired positionals use <name:field>. Optional positionals use [name:field]. Flags list target input fields. Run responses wait by default, use --wait-timeout <seconds> (default 120) or --no-wait.\n\nVerbs:\n${specs.map((spec) => {
301
+ const positionals = (spec.positional ?? []).map(({ name, into, optional }) => `${optional ? '[' : '<'}${name}:${into}${optional ? ']' : '>'}`).join(' ');
302
+ const flags = Object.entries(spec.flags ?? {}).map(([flag, definition]) => `--${flag} <${definition.into}>${definition.required ? ' (required)' : ''}`).join(' ');
303
+ return ` ${spec.verb.padEnd(18)} ${[positionals, flags].filter(Boolean).join(' ')}\n${' '.repeat(20)}${spec.summary} Capability: ${spec.capabilityId}`;
304
+ }).join('\n')}`;
305
+ }
306
+ function workflowFromGet(value) {
307
+ const root = value && typeof value === 'object' && !Array.isArray(value) ? value : {};
308
+ const data = root.data && typeof root.data === 'object' && !Array.isArray(root.data) ? root.data : {};
309
+ // The canonical door returns { data: { run: { steps: [{ outputs }] } } };
310
+ // outputs holds latest_draft_version_id and active_version_id.
311
+ const run = data.run && typeof data.run === 'object' ? data.run : null;
312
+ const outputs = run?.steps?.[0]?.outputs;
313
+ const workflow = outputs ?? data;
314
+ if (!workflow || typeof workflow !== 'object' || Array.isArray(workflow))
315
+ throw new index_1.CliUsageError('workflow get returned no workflow version data.');
316
+ return workflow;
317
+ }
318
+ function nullableString(value, name) {
319
+ if (value === null || typeof value === 'string')
320
+ return value;
321
+ throw new index_1.CliUsageError(`workflow get returned no ${name}.`);
322
+ }
323
+ function requiredString(value, name) {
324
+ if (typeof value === 'string' && value)
325
+ return value;
326
+ throw new index_1.CliUsageError(`workflow get returned no ${name}; publish workflow before activation.`);
249
327
  }
@@ -3,5 +3,5 @@ import type { CliCommand } from '../index';
3
3
  export declare const WORKFLOW_VERBS: PackVerbSpec[];
4
4
  export declare const WORKFLOWS_USAGE: string;
5
5
  export declare const parseWorkflowsCommand: (argv: string[]) => CliCommand;
6
- export declare function runWorkflowsCommand(client: Parameters<typeof runPackCommand>[0], command: CliCommand, stdout: NodeJS.WritableStream): Promise<void>;
6
+ export declare function runWorkflowsCommand(client: Parameters<typeof runPackCommand>[0], command: CliCommand, stdout: NodeJS.WritableStream, sleep?: Parameters<typeof runPackCommand>[3]): Promise<void>;
7
7
  //# sourceMappingURL=workflows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/commands/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEd,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,eAAO,MAAM,cAAc,EAAE,YAAY,EA8BxC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAqD,CAAC;AACpF,eAAO,MAAM,qBAAqB,gCAA4E,CAAC;AAC/G,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EAC5C,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,cAAc,GAC5B,OAAO,CAAC,IAAI,CAAC,CAMf"}
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/commands/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEd,KAAK,YAAY,EAClB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS3C,eAAO,MAAM,cAAc,EAAE,YAAY,EA8BxC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,MAAqD,CAAC;AACpF,eAAO,MAAM,qBAAqB,gCAA4E,CAAC;AAC/G,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EAC5C,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,GAC3C,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -27,14 +27,14 @@ exports.WORKFLOW_VERBS = [
27
27
  { verb: 'node-remove', capabilityId: 'workflow.automations.node_remove', summary: 'Remove workflow node.', positional: id, flags: { ...workflowVersion, 'node-id': { type: 'string', into: 'node_id' } }, mutating: true },
28
28
  { verb: 'node-move', capabilityId: 'workflow.automations.node_move', summary: 'Move workflow node.', positional: id, flags: { ...workflowVersion, 'node-id': { type: 'string', into: 'node_id' }, 'after-node-id': { type: 'string', into: 'after_node_id' }, branch: { type: 'string', into: 'branch' } }, mutating: true },
29
29
  { verb: 'field-options', capabilityId: 'workflow.automations.field_options', summary: 'Resolve workflow node field options.', flags: { 'node-kind': { type: 'string', into: 'node_kind' }, subtype: { type: 'string', into: 'subtype' }, 'automation-id': { type: 'string', into: 'automation_id' }, 'node-id': { type: 'string', into: 'node_id' }, 'field-key': { type: 'string', into: 'field_key' }, 'field-keys': { type: 'string', into: 'field_keys', json: true }, query: { type: 'string', into: 'query' }, limit: { type: 'string', into: 'limit' }, cursor: { type: 'string', into: 'cursor' }, 'field-context': { type: 'string', into: 'field_context', json: true } }, mutating: false },
30
- { verb: 'draft-save', capabilityId: 'workflow.workflows.draft_save', summary: 'Save workflow draft.', positional: id, flags: { graph: { type: 'string', into: 'graph', json: true, document: true }, 'expected-latest-draft-version-id': { type: 'string', into: 'expected_latest_draft_version_id' } }, mutating: true },
31
- { verb: 'publish', capabilityId: 'workflow.workflows.draft_publish', summary: 'Publish workflow draft.', positional: id, flags: { 'expected-draft-version-id': { type: 'string', into: 'expected_draft_version_id' }, 'expected-active-version-id': { type: 'string', into: 'expected_active_version_id' } }, mutating: true },
32
- { verb: 'activate', capabilityId: 'workflow.workflows.activate', summary: 'Activate workflow.', positional: id, flags: { 'expected-version-id': { type: 'string', into: 'expected_version_id' }, 'delivery-binding': { type: 'string', into: 'delivery_binding', json: true } }, mutating: true },
33
- { verb: 'deactivate', capabilityId: 'workflow.workflows.deactivate', summary: 'Deactivate workflow.', positional: id, mutating: true },
34
- { verb: 'enroll', capabilityId: 'workflow.workflows.enroll_selection', summary: 'Enroll selection in workflow.', positional: id, flags: { selection: { type: 'string', into: 'selection', json: true } }, mutating: true },
30
+ { verb: 'draft-save', capabilityId: 'workflow.workflows.draft_save', summary: 'Save workflow draft.', positional: workflowId, flags: { graph: { type: 'string', into: 'graph', json: true, document: true }, 'expected-latest-draft-version-id': { type: 'string', into: 'expected_latest_draft_version_id' } }, mutating: true },
31
+ { verb: 'publish', capabilityId: 'workflow.workflows.draft_publish', summary: 'Publish workflow draft.', positional: workflowId, flags: { 'expected-draft-version-id': { type: 'string', into: 'expected_draft_version_id' }, 'expected-active-version-id': { type: 'string', into: 'expected_active_version_id' } }, mutating: true },
32
+ { verb: 'activate', capabilityId: 'workflow.workflows.activate', summary: 'Activate workflow.', positional: workflowId, flags: { 'expected-version-id': { type: 'string', into: 'expected_version_id' }, 'max-credits': { type: 'string', into: 'max_credits', number: true, required: true }, 'delivery-binding': { type: 'string', into: 'delivery_binding', json: true } }, mutating: true },
33
+ { verb: 'deactivate', capabilityId: 'workflow.workflows.deactivate', summary: 'Deactivate workflow.', positional: workflowId, mutating: true },
34
+ { verb: 'enroll', capabilityId: 'workflow.workflows.enroll_selection', summary: 'Enroll saved worksheet selection in workflow.', positional: workflowId, flags: { 'workbook-id': { type: 'string', into: 'workbook_id' }, 'worksheet-id': { type: 'string', into: 'worksheet_id' }, 'saved-view-id': { type: 'string', into: 'saved_view_id' }, 'selection-snapshot-id': { type: 'string', into: 'selection_snapshot_id' }, 'trigger-node-id': { type: 'string', into: 'trigger_node_id' }, 'audience-filter': { type: 'string', into: 'audience_filter', json: true }, 'enrollment-priority': { type: 'string', into: 'enrollment_priority', json: true }, 'enrollment-sort': { type: 'string', into: 'enrollment_sort', json: true }, 'max-live-sends': { type: 'string', into: 'max_live_sends', number: true } }, mutating: true },
35
35
  { verb: 'runs', capabilityId: 'workflow.workflows.runs_list', summary: 'List workflow runs.', positional: workflowId, flags: { workflow: { type: 'string', into: 'workflow_id' }, limit: { type: 'string', into: 'limit' } }, mutating: false },
36
- { verb: 'run', capabilityId: 'workflow.workflows.run_trace_get', summary: 'Get workflow run trace.', positional: id, flags: { 'subject-id': { type: 'string', into: 'subject_id' } }, mutating: false },
37
- { verb: 'retry', capabilityId: 'workflow.workflows.run_retry', summary: 'Retry failed workflow run event.', positional: id, flags: { 'subject-id': { type: 'string', into: 'subject_id' }, 'failed-event-id': { type: 'string', into: 'failed_event_id' }, 'failed-node-id': { type: 'string', into: 'failed_node_id' } }, mutating: true },
36
+ { verb: 'run', capabilityId: 'workflow.workflows.run_trace_get', summary: 'Get workflow run trace.', positional: workflowId, flags: { 'subject-id': { type: 'string', into: 'subject_id' } }, mutating: false },
37
+ { verb: 'retry', capabilityId: 'workflow.workflows.run_retry', summary: 'Retry failed workflow run event.', positional: workflowId, flags: { 'subject-id': { type: 'string', into: 'subject_id' }, 'failed-event-id': { type: 'string', into: 'failed_event_id' }, 'failed-node-id': { type: 'string', into: 'failed_node_id' } }, mutating: true },
38
38
  { verb: 'duplicate', capabilityId: 'workflow.automations.duplicate', summary: 'Duplicate workflow.', positional: id, flags: { ...workflowVersion, name: { type: 'string', into: 'name' } }, mutating: true },
39
39
  { verb: 'archive', capabilityId: 'workflow.automations.archive', summary: 'Archive workflow.', positional: id, flags: { ...workflowVersion, reason: { type: 'string', into: 'reason' } }, mutating: true },
40
40
  { verb: 'export', capabilityId: 'workflow.automations.export', summary: 'Export workflow.', positional: id, mutating: false },
@@ -42,10 +42,10 @@ exports.WORKFLOW_VERBS = [
42
42
  ];
43
43
  exports.WORKFLOWS_USAGE = (0, shared_1.renderPackUsage)('workflows', exports.WORKFLOW_VERBS);
44
44
  exports.parseWorkflowsCommand = (0, shared_1.buildPackParser)('workflows', 'workflow', exports.WORKFLOW_VERBS, exports.WORKFLOWS_USAGE);
45
- async function runWorkflowsCommand(client, command, stdout) {
45
+ async function runWorkflowsCommand(client, command, stdout, sleep) {
46
46
  if (command.command === 'pack' && command.verb === 'init') {
47
47
  (0, shared_1.runPackInit)('workflow', command, stdout);
48
48
  return;
49
49
  }
50
- await (0, shared_1.runPackCommand)(client, command, stdout);
50
+ await (0, shared_1.runPackCommand)(client, command, stdout, sleep);
51
51
  }
package/dist/config.d.ts CHANGED
@@ -25,6 +25,15 @@ export interface StoredCredentials {
25
25
  token: string;
26
26
  workspace: string | null;
27
27
  }
28
+ export interface CredentialProfile extends StoredCredentials {
29
+ name: string;
30
+ }
31
+ export declare function validateProfileName(name: string): string;
32
+ export declare function currentCredentialProfile(path?: string, environment?: NodeJS.ProcessEnv): Promise<string | null>;
33
+ export declare function useCredentialProfile(name: string, path?: string): Promise<void>;
34
+ export declare function selectedCredentialsPath(path: string, environment?: NodeJS.ProcessEnv): Promise<string>;
35
+ export declare function listCredentialProfiles(path?: string): Promise<CredentialProfile[]>;
36
+ export declare function removeCredentialProfile(name: string, path?: string): Promise<boolean>;
28
37
  /**
29
38
  * The file is JSON `{token, workspace}`. Files written by 1.0.x hold one bare
30
39
  * token line; they keep working so an upgrade never logs anyone out.
@@ -35,4 +44,5 @@ export declare function resolveApiKey(environment?: NodeJS.ProcessEnv, path?: st
35
44
  export declare function resolveWorkspace(flag: string | undefined, environment?: NodeJS.ProcessEnv, path?: string): Promise<string | undefined>;
36
45
  export declare function readApiKeyFile(path: string): Promise<string>;
37
46
  export declare function storeApiKey(apiKey: string, path?: string, workspace?: string | null): Promise<string>;
47
+ export declare function storeCredentialProfile(name: string, apiKey: string, path?: string, workspace?: string | null): Promise<string>;
38
48
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAIA,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,qBAAqB;gBAEtB,OAAO,SAA8C;CAIlE;AAED,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,qBAAqB;gBAEtB,OA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C,MAAM,CAAC,CAIrJ"}
package/dist/config.js CHANGED
@@ -4,11 +4,18 @@ exports.API_KEY_PREFIXES = exports.ApiKeyFileError = exports.MissingApiKeyError
4
4
  exports.credentialsPath = credentialsPath;
5
5
  exports.resolveApiBaseUrl = resolveApiBaseUrl;
6
6
  exports.isDreamstateToken = isDreamstateToken;
7
+ exports.validateProfileName = validateProfileName;
8
+ exports.currentCredentialProfile = currentCredentialProfile;
9
+ exports.useCredentialProfile = useCredentialProfile;
10
+ exports.selectedCredentialsPath = selectedCredentialsPath;
11
+ exports.listCredentialProfiles = listCredentialProfiles;
12
+ exports.removeCredentialProfile = removeCredentialProfile;
7
13
  exports.readStoredCredentials = readStoredCredentials;
8
14
  exports.resolveApiKey = resolveApiKey;
9
15
  exports.resolveWorkspace = resolveWorkspace;
10
16
  exports.readApiKeyFile = readApiKeyFile;
11
17
  exports.storeApiKey = storeApiKey;
18
+ exports.storeCredentialProfile = storeCredentialProfile;
12
19
  const promises_1 = require("node:fs/promises");
13
20
  const node_os_1 = require("node:os");
14
21
  const node_path_1 = require("node:path");
@@ -103,6 +110,85 @@ exports.API_KEY_PREFIXES = ['ds_user_', 'ds_live_'];
103
110
  function isDreamstateToken(value) {
104
111
  return exports.API_KEY_PREFIXES.some((prefix) => value.startsWith(prefix) && value.length > prefix.length);
105
112
  }
113
+ const PROFILE_NAME = /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,63}$/;
114
+ function validateProfileName(name) {
115
+ const normalized = name.trim();
116
+ if (!PROFILE_NAME.test(normalized))
117
+ throw new ApiKeyFileError('Profile names must use letters, numbers, hyphens, or underscores.');
118
+ return normalized;
119
+ }
120
+ function profileDirectory(path) {
121
+ return (0, node_path_1.join)(path, '..', 'profiles');
122
+ }
123
+ function profilePath(path, name) {
124
+ return (0, node_path_1.join)(profileDirectory(path), validateProfileName(name));
125
+ }
126
+ function currentProfilePath(path) {
127
+ return (0, node_path_1.join)(path, '..', 'current-profile');
128
+ }
129
+ async function currentCredentialProfile(path = credentialsPath(), environment = process.env) {
130
+ const fromEnvironment = environment.DREAMSTATE_PROFILE?.trim();
131
+ if (fromEnvironment)
132
+ return validateProfileName(fromEnvironment);
133
+ try {
134
+ const name = (await (0, promises_1.readFile)(currentProfilePath(path), 'utf8')).trim();
135
+ return name ? validateProfileName(name) : null;
136
+ }
137
+ catch (error) {
138
+ if (['ENOENT', 'ENOTDIR'].includes(error.code ?? ''))
139
+ return null;
140
+ throw error;
141
+ }
142
+ }
143
+ async function useCredentialProfile(name, path = credentialsPath()) {
144
+ const normalized = validateProfileName(name);
145
+ if (!await readStoredCredentials(profilePath(path, normalized))) {
146
+ throw new ApiKeyFileError(`Profile not found: ${normalized}. Run dreamstate login --profile ${normalized} --token <key> first.`);
147
+ }
148
+ const directory = (0, node_path_1.join)(path, '..');
149
+ await (0, promises_1.mkdir)(directory, { recursive: true, mode: 0o700 });
150
+ await (0, promises_1.writeFile)(currentProfilePath(path), `${normalized}\n`, { encoding: 'utf8', mode: 0o600 });
151
+ await (0, promises_1.chmod)(currentProfilePath(path), 0o600);
152
+ }
153
+ async function selectedCredentialsPath(path, environment = process.env) {
154
+ const profile = await currentCredentialProfile(path, environment);
155
+ return profile ? profilePath(path, profile) : path;
156
+ }
157
+ async function listCredentialProfiles(path = credentialsPath()) {
158
+ let names;
159
+ try {
160
+ names = await (0, promises_1.readdir)(profileDirectory(path));
161
+ }
162
+ catch (error) {
163
+ if (['ENOENT', 'ENOTDIR'].includes(error.code ?? ''))
164
+ return [];
165
+ throw error;
166
+ }
167
+ const profiles = await Promise.all(names.sort().map(async (name) => {
168
+ try {
169
+ const stored = await readStoredCredentials(profilePath(path, name));
170
+ return stored ? { name, ...stored } : null;
171
+ }
172
+ catch {
173
+ return null;
174
+ }
175
+ }));
176
+ return profiles.filter((profile) => profile !== null);
177
+ }
178
+ async function removeCredentialProfile(name, path = credentialsPath()) {
179
+ const normalized = validateProfileName(name);
180
+ try {
181
+ await (0, promises_1.unlink)(profilePath(path, normalized));
182
+ if (await currentCredentialProfile(path) === normalized)
183
+ await (0, promises_1.unlink)(currentProfilePath(path)).catch(() => undefined);
184
+ return true;
185
+ }
186
+ catch (error) {
187
+ if (error.code === 'ENOENT')
188
+ return false;
189
+ throw error;
190
+ }
191
+ }
106
192
  /**
107
193
  * The file is JSON `{token, workspace}`. Files written by 1.0.x hold one bare
108
194
  * token line; they keep working so an upgrade never logs anyone out.
@@ -138,7 +224,8 @@ async function resolveApiKey(environment = process.env, path) {
138
224
  const environmentKey = environment.DREAMSTATE_API_KEY?.trim();
139
225
  if (environmentKey)
140
226
  return environmentKey;
141
- const stored = await readStoredCredentials(path ?? credentialsPath(undefined, environment));
227
+ const credentials = await selectedCredentialsPath(path ?? credentialsPath(undefined, environment), environment);
228
+ const stored = await readStoredCredentials(credentials);
142
229
  if (stored)
143
230
  return stored.token;
144
231
  throw new MissingApiKeyError();
@@ -151,7 +238,8 @@ async function resolveWorkspace(flag, environment = process.env, path) {
151
238
  const fromEnvironment = environment.DREAMSTATE_WORKSPACE?.trim();
152
239
  if (fromEnvironment)
153
240
  return fromEnvironment;
154
- return (await readStoredCredentials(path ?? credentialsPath(undefined, environment)))?.workspace ?? undefined;
241
+ const credentials = await selectedCredentialsPath(path ?? credentialsPath(undefined, environment), environment);
242
+ return (await readStoredCredentials(credentials))?.workspace ?? undefined;
155
243
  }
156
244
  async function readApiKeyFile(path) {
157
245
  let file;
@@ -183,3 +271,8 @@ async function storeApiKey(apiKey, path = credentialsPath(), workspace = null) {
183
271
  await (0, promises_1.chmod)(path, 0o600);
184
272
  return path;
185
273
  }
274
+ async function storeCredentialProfile(name, apiKey, path = credentialsPath(), workspace = null) {
275
+ const target = profilePath(path, name);
276
+ await storeApiKey(apiKey, target, workspace);
277
+ return target;
278
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { type PluginAgent, type RunAgentCommand } from './pluginInstaller';
2
3
  import { type SkillInstallAgent } from './skillInstaller';
3
4
  export type CanonicalApiCapabilityId = string;
4
5
  export declare const CLI_EXIT: {
@@ -16,16 +17,47 @@ export declare const CLI_EXIT: {
16
17
  };
17
18
  export type CliCommand = {
18
19
  command: 'help';
20
+ } | {
21
+ command: 'pack_help';
22
+ usage: string;
23
+ jsonOutput?: boolean;
19
24
  } | {
20
25
  command: 'version';
21
26
  } | {
22
27
  command: 'login';
23
28
  apiKeyFile?: string;
24
29
  token?: string;
30
+ profile?: string;
31
+ noSkills?: boolean;
25
32
  jsonOutput?: boolean;
26
33
  } | {
27
34
  command: 'logout';
28
35
  jsonOutput?: boolean;
36
+ } | {
37
+ command: 'status';
38
+ jsonOutput?: boolean;
39
+ } | {
40
+ command: 'install';
41
+ agents: PluginAgent[];
42
+ jsonOutput?: boolean;
43
+ } | {
44
+ command: 'profiles_list';
45
+ jsonOutput?: boolean;
46
+ } | {
47
+ command: 'profiles_use';
48
+ name: string;
49
+ jsonOutput?: boolean;
50
+ } | {
51
+ command: 'profiles_current';
52
+ jsonOutput?: boolean;
53
+ } | {
54
+ command: 'profiles_remove';
55
+ name: string;
56
+ jsonOutput?: boolean;
57
+ } | {
58
+ command: 'profiles_env';
59
+ name: string;
60
+ jsonOutput?: boolean;
29
61
  } | {
30
62
  command: 'whoami';
31
63
  jsonOutput?: boolean;
@@ -90,6 +122,8 @@ export type CliCommand = {
90
122
  body: Record<string, unknown>;
91
123
  turnToken?: string;
92
124
  idempotencyKey?: string;
125
+ waitTimeout: number;
126
+ noWait?: boolean;
93
127
  open?: boolean;
94
128
  jsonOutput?: boolean;
95
129
  } | {
@@ -105,6 +139,8 @@ export type CliCommand = {
105
139
  jsonOutput?: boolean;
106
140
  open?: boolean;
107
141
  maxCredits?: number;
142
+ waitTimeout: number;
143
+ noWait?: boolean;
108
144
  } | {
109
145
  command: 'tables_import';
110
146
  tableId: string;
@@ -112,6 +148,8 @@ export type CliCommand = {
112
148
  format?: 'csv' | 'json' | 'jsonl' | 'xlsx';
113
149
  preview?: boolean;
114
150
  upsertKey?: string;
151
+ rowKind?: 'person' | 'company';
152
+ keepUnmappedColumns?: boolean;
115
153
  background: boolean;
116
154
  jsonOutput?: boolean;
117
155
  } | {
@@ -137,7 +175,9 @@ export type CliCommand = {
137
175
  } | {
138
176
  command: 'runs_cancel';
139
177
  runId: string;
140
- body: Record<string, unknown>;
178
+ body?: Record<string, unknown>;
179
+ stateVersion?: number;
180
+ reason?: string;
141
181
  idempotencyKey?: string;
142
182
  jsonOutput?: boolean;
143
183
  };
@@ -155,12 +195,22 @@ export interface CliRuntime {
155
195
  deviceState?: string;
156
196
  sleep?: (milliseconds: number) => Promise<void>;
157
197
  homeDirectory?: string;
198
+ runAgentCommand?: RunAgentCommand;
158
199
  }
159
200
  export declare class CliUsageError extends Error {
160
201
  constructor(message: string);
161
202
  }
162
203
  export declare function parseCliArgs(argv: string[]): CliCommand;
163
204
  export declare function toolTurnToken(value: unknown): string;
205
+ export declare function omitsToolTurnForInlineTableRead(capabilityId: string): boolean;
206
+ /**
207
+ * Header value, or null when the request must not carry Idempotency-Key.
208
+ * Any key forces a read onto the durable run path (isInlineReadEligible).
209
+ * Send one only for an explicit key, or when the tools get contract says
210
+ * mutates or idempotency_required. Missing flags omit the key: a read whose
211
+ * contract does not set mutates must not be treated as a write.
212
+ */
213
+ export declare function capabilityIdempotencyKey(fetched: unknown, explicit?: string): string | null;
164
214
  export declare function refusalEnvelope(error: unknown, exitCode: number): Record<string, unknown>;
165
215
  type SpawnLike = (command: string, args: readonly string[], options: {
166
216
  detached: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAwBA,OAAO,EAA8F,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACtJ,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE9C,eAAO,MAAM,QAAQ;;;;;;;;;;;;CAA4J,CAAC;AA2ClL,MAAM,MAAM,UAAU,GAClB;IAAE,OAAO,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