@trydreamstate/cli 1.3.6 → 1.3.8

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 (76) hide show
  1. package/README.md +1 -1
  2. package/agent-plugin/.claude-plugin/plugin.json +1 -1
  3. package/agent-plugin/.codex-plugin/plugin.json +1 -1
  4. package/agent-plugin/skills/crm/SKILL.md +2 -2
  5. package/agent-plugin/skills/diagnostics/SKILL.md +1 -1
  6. package/agent-plugin/skills/dreamstate/SKILL.md +4 -4
  7. package/agent-plugin/skills/facebook-posts/SKILL.md +46 -0
  8. package/agent-plugin/skills/first-win/SKILL.md +6 -6
  9. package/agent-plugin/skills/inbox-replies/SKILL.md +1 -1
  10. package/agent-plugin/skills/instagram-posts/SKILL.md +56 -0
  11. package/agent-plugin/skills/knowledge/SKILL.md +1 -1
  12. package/agent-plugin/skills/linkedin-posts/SKILL.md +1 -1
  13. package/agent-plugin/skills/linkedin-warm-signals/SKILL.md +1 -1
  14. package/agent-plugin/skills/list-building/SKILL.md +5 -2
  15. package/agent-plugin/skills/list-building/column-authoring.md +4 -0
  16. package/agent-plugin/skills/list-building/incoming-people.md +32 -0
  17. package/agent-plugin/skills/list-building/sourcing.md +8 -1
  18. package/agent-plugin/skills/outreach/SKILL.md +2 -1
  19. package/agent-plugin/skills/outreach/channels.md +3 -1
  20. package/agent-plugin/skills/outreach/enrollment.md +2 -0
  21. package/agent-plugin/skills/outreach/replies.md +2 -0
  22. package/agent-plugin/skills/outreach/steps-and-timing.md +5 -1
  23. package/agent-plugin/skills/plays/SKILL.md +1 -1
  24. package/agent-plugin/skills/reddit-posts/SKILL.md +1 -1
  25. package/agent-plugin/skills/skill-authoring/SKILL.md +6 -6
  26. package/agent-plugin/skills/social/SKILL.md +5 -1
  27. package/agent-plugin/skills/tiktok-posts/SKILL.md +51 -0
  28. package/agent-plugin/skills/visibility/SKILL.md +5 -1
  29. package/agent-plugin/skills/workflows/SKILL.md +3 -1
  30. package/agent-plugin/skills/workflows/lifecycle-and-enrollment.md +2 -0
  31. package/agent-plugin/skills/worksheet-tidy/SKILL.md +2 -2
  32. package/agent-plugin/skills/writing/SKILL.md +1 -1
  33. package/agent-plugin/skills/writing/publishing.md +1 -1
  34. package/agent-plugin/skills/writing/revision-and-voice.md +1 -1
  35. package/agent-plugin/skills/x-posts/SKILL.md +1 -1
  36. package/agent-plugin/skills/youtube-posts/SKILL.md +49 -0
  37. package/dist/agentGuidance.generated.json +4 -4
  38. package/dist/client.d.ts +6 -1
  39. package/dist/client.d.ts.map +1 -1
  40. package/dist/client.js +35 -11
  41. package/dist/commandTable.d.ts +2 -2
  42. package/dist/commandTable.d.ts.map +1 -1
  43. package/dist/commandTable.js +5 -2
  44. package/dist/commands/genericPack.d.ts +13 -0
  45. package/dist/commands/genericPack.d.ts.map +1 -0
  46. package/dist/commands/genericPack.js +31 -0
  47. package/dist/commands/knowledge.d.ts +2 -0
  48. package/dist/commands/knowledge.d.ts.map +1 -0
  49. package/dist/commands/knowledge.js +6 -0
  50. package/dist/commands/shared.d.ts +3 -1
  51. package/dist/commands/shared.d.ts.map +1 -1
  52. package/dist/commands/shared.js +14 -5
  53. package/dist/commands/tables.d.ts +2 -0
  54. package/dist/commands/tables.d.ts.map +1 -0
  55. package/dist/commands/tables.js +6 -0
  56. package/dist/commands/unibox.d.ts +2 -0
  57. package/dist/commands/unibox.d.ts.map +1 -0
  58. package/dist/commands/unibox.js +6 -0
  59. package/dist/gatedRun.d.ts.map +1 -1
  60. package/dist/gatedRun.js +145 -54
  61. package/dist/generated/packVerbs.generated.json +332 -4
  62. package/dist/index.d.ts +2 -1
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +31 -3
  65. package/dist/money.d.ts +2 -1
  66. package/dist/money.d.ts.map +1 -1
  67. package/dist/money.js +22 -5
  68. package/dist/runWait.d.ts +1 -1
  69. package/dist/runWait.d.ts.map +1 -1
  70. package/dist/runWait.js +37 -5
  71. package/dist/tablesImport.d.ts.map +1 -1
  72. package/dist/tablesImport.js +15 -1
  73. package/dist/turnCache.d.ts +5 -1
  74. package/dist/turnCache.d.ts.map +1 -1
  75. package/dist/turnCache.js +5 -3
  76. package/package.json +3 -2
@@ -46,6 +46,20 @@ const IDENTITY_PREFERENCE = {
46
46
  function record(value) {
47
47
  return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
48
48
  }
49
+ function durableRunSteps(run) {
50
+ const partialResults = record(run.partial_results);
51
+ const attachOutputs = (step) => {
52
+ const entry = record(step) ?? {};
53
+ const stepId = entry.step_id;
54
+ return entry.outputs === undefined && typeof stepId === 'string' && partialResults && stepId in partialResults
55
+ ? { ...entry, outputs: partialResults[stepId] }
56
+ : entry;
57
+ };
58
+ return [
59
+ ...(Array.isArray(run.completed) ? run.completed.map(attachOutputs) : []),
60
+ ...(Array.isArray(run.incomplete) ? run.incomplete.map(attachOutputs) : []),
61
+ ];
62
+ }
49
63
  const FAILED_STATUSES = new Set(['failed', 'cancelled', 'canceled', 'timed_out', 'rejected']);
50
64
  /**
51
65
  * The outputs of a capability run, whichever envelope nesting the door used. A
@@ -56,7 +70,7 @@ function capabilityOutputs(result) {
56
70
  const data = record(record(result)?.data);
57
71
  const run = record(data?.run);
58
72
  if (run) {
59
- const steps = Array.isArray(run.steps) ? run.steps : Array.isArray(run.completed) ? run.completed : [];
73
+ const steps = Array.isArray(run.steps) ? run.steps : durableRunSteps(run);
60
74
  const stepError = steps.map((step) => record(record(step)?.user_error)).find(Boolean) ?? record(run.user_error);
61
75
  if (typeof run.status === 'string' && FAILED_STATUSES.has(run.status)) {
62
76
  throw new client_1.CliError(typeof stepError?.message === 'string' ? stepError.message : `The run ${run.status}.`, typeof stepError?.code === 'string' ? stepError.code : 'run_failed', 0, { details: stepError ? { user_error: stepError } : undefined, retryable: false });
@@ -1,9 +1,11 @@
1
1
  export declare const TURN_REUSE_MS: number;
2
- /** The quote a dry run returned, and the exact input it priced. maximum_credits is absent on entries written before the field existed: treat that as unknown, not free. */
2
+ /** The quote a supported rehearsal returned, and the exact input it priced. maximum_credits is absent on entries written before the field existed: treat that as unknown, not free. rows and credits are the printed price; absent means not stated. */
3
3
  export type CachedQuote = {
4
4
  quote_hash: string;
5
5
  fingerprint: string;
6
6
  maximum_credits?: number | null;
7
+ rows?: number | null;
8
+ credits?: string | null;
7
9
  };
8
10
  type CacheWarning = (error: NodeJS.ErrnoException) => void;
9
11
  export declare function turnCachePath(credentialsPath: string): string;
@@ -16,6 +18,8 @@ export declare function reusableTurn(path: string, baseUrl: string, apiKey: stri
16
18
  token: string;
17
19
  quote_hash: string | null;
18
20
  maximum_credits: number | null;
21
+ rows?: number | null;
22
+ credits?: string | null;
19
23
  } | null>;
20
24
  export declare function rememberTurnToken(path: string, baseUrl: string, apiKey: string, capabilityId: string, token: string, now?: number, onWarning?: CacheWarning, quote?: CachedQuote): Promise<void>;
21
25
  export declare function forgetTurnToken(path: string, baseUrl: string, apiKey: string, capabilityId: string, onWarning?: CacheWarning): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"turnCache.d.ts","sourceRoot":"","sources":["../src/turnCache.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa,QAAa,CAAC;AAExC,2KAA2K;AAC3K,MAAM,MAAM,WAAW,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAGvG,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,KAAK,IAAI,CAAC;AAE3D,wBAAgB,aAAa,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE7D;AA2BD,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,SAAa,EAAE,SAAS,CAAC,EAAE,YAAY,GAC9G,OAA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IAAI,CAAC,CAMf"}
package/dist/turnCache.js CHANGED
@@ -9,12 +9,12 @@ exports.forgetTurnToken = forgetTurnToken;
9
9
  const node_crypto_1 = require("node:crypto");
10
10
  const promises_1 = require("node:fs/promises");
11
11
  const node_path_1 = require("node:path");
12
- // A paid capability's live call needs the quote_hash of a dry_run of the same
13
- // input, and the quote is bound to the dry run's tool_turn_token: only a live
12
+ // A quote-bound capability's live call needs the quote_hash of a supported rehearsal of
13
+ // the same input, and the quote is bound to the rehearsal's tool_turn_token: only a live
14
14
  // call carrying the SAME token and that quote_hash can spend. Each CLI
15
15
  // invocation is a new process, so fetching a fresh token per run made every paid
16
16
  // capability unrunnable from the CLI (2026-09-23: tables.table_sources.run
17
- // refused four times in a row). The cache therefore keeps the dry run's turn
17
+ // refused four times in a row). The cache therefore keeps the rehearsal's turn
18
18
  // token together with its quote_hash and a fingerprint of the exact input that
19
19
  // was priced, so a later `--live` of the same input can echo it and a changed
20
20
  // input never inherits a price it was not shown.
@@ -68,6 +68,8 @@ async function reusableTurn(path, baseUrl, apiKey, capabilityId, fingerprint, no
68
68
  token: entry.token,
69
69
  quote_hash: quote ? quote.quote_hash : null,
70
70
  maximum_credits: quote && typeof quote.maximum_credits === 'number' ? quote.maximum_credits : null,
71
+ ...(quote && quote.rows !== undefined ? { rows: quote.rows } : {}),
72
+ ...(quote && quote.credits !== undefined ? { credits: quote.credits } : {}),
71
73
  };
72
74
  }
73
75
  async function rememberTurnToken(path, baseUrl, apiKey, capabilityId, token, now = Date.now(), onWarning, quote) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trydreamstate/cli",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Live command-line client for the Dreamstate v1 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,7 +19,8 @@
19
19
  "README.md"
20
20
  ],
21
21
  "scripts": {
22
- "build": "node scripts/generate-pack-verbs.mjs --check && node scripts/generate-run-contract.mjs --check && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node scripts/build-agent-plugin.mjs",
22
+ "build": "node scripts/generate-pack-verbs.mjs --check && node scripts/generate-run-contract.mjs --check && node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && node scripts/build-agent-plugin.mjs && tsc",
23
+ "pretest": "npm run build --workspace=@dreamstate/types",
23
24
  "test": "node scripts/build-agent-plugin.mjs --check && npm run build && jest --config jest.config.cjs --runInBand",
24
25
  "type-check": "tsc --noEmit",
25
26
  "pack:check": "npm pack --dry-run",