@gobing-ai/ts-ai-runner 0.8.4 → 0.8.5

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.
package/README.md CHANGED
@@ -333,7 +333,7 @@ const { args } = getAgentShim('omp').getPromptCommand({
333
333
  // args: ['-p', '', '--session-dir', '.spur/run/r1/...', '-r', 'abc123', '--mode', 'text']
334
334
  ```
335
335
 
336
- **Shim / capability matrix** (probed 2026-09-18; `verifiedAgainst` per row in `getAgentSessionCapability`):
336
+ **Shim / capability matrix** (probed 2026-09-18; `deepseek` re-probed 2026-11-26 on dsh 0.2.2-rc.1; `verifiedAgainst` per row in `getAgentSessionCapability`):
337
337
 
338
338
  | Agent | resumeById | sessionDir | sessionId resume flag | persistentStdin | structuredOutput |
339
339
  | ----- | ---------- | ---------- | --------------------- | --------------- | ---------------- |
@@ -347,7 +347,7 @@ const { args } = getAgentShim('omp').getPromptCommand({
347
347
  | opencode | ✗ (CLI `-s <id>` unwired) | ✗ | degrade → fresh `run` | ✗ | ✓ (`--format json`) |
348
348
  | openclaw | ✗ (CLI `--session-id` unwired) | ✗ | degrade → fresh `agent` | ✗ | ✓ (CLI `--json`; unwired) |
349
349
  | hermes | ✗ (unverified) | ✗ | degrade → fresh `chat` | ✗ | ✗ (unverified) |
350
- | deepseek | ✗ | ✗ | degrade → fresh headless one-shot | ✗ | ✗ |
350
+ | deepseek | ✓ (0.2.2-rc.1) | ✗ (ignored; the store is `$DSH_HOME`) | `--session-id <id>` | ✗ | ✓ (`--json`) |
351
351
  | fm | ✓ | ✓ | `--resume <file>` + `--save-transcript <file>` (file = `<sessionDir>/<sessionId>.json`) | ✗ (`fm chat` is interactive only) | ✗ (`--schema` needs a file; ts-decision-fm surface) |
352
352
 
353
353
  **Claude session discovery:** claude has no session-dir flag and does not accept a caller-chosen
@@ -506,7 +506,7 @@ Agent-specific behavior:
506
506
  | `openclaw` | `openclaw` | 2 | `openclaw health` | `agent --local -m` |
507
507
  | `hermes` | `hermes` | 1 | `hermes doctor` | `chat -q`, `--continue`, `-m` |
508
508
  | `grok` | `grok` | 1 | env/file (`XAI_API_KEY` or `~/.grok/auth.json`) | `-p`, `-c` (resume), `-m`, `--output-format plain\|json` (maps ai-runner `text` → `plain`) |
509
- | `deepseek` | `dsh` | 1 | env-only / `~/.dsh` (no status verb) | `--profile headless <task>`; session/model options degrade to a fresh one-shot (no flags at 0.1.5-rc.1) |
509
+ | `deepseek` | `dsh` | 1 | env-only / `~/.dsh` (no status verb) | `--profile headless`, `--json`, `--session-id <id>`, `--permission-mode workspace-write`, `--approval-policy never`, `--` then the task (0.2.2-rc.1); `continue`/`sessionDir`/`model` degrade to a fresh one-shot |
510
510
  | `fm` | `fm` | 1 | `fm available --model system` | `respond --no-stream`, `-m`, transcript session flags; **text-only** (no file/shell tools — excluded from `TIER1_PRIORITY` auto-selection) |
511
511
 
512
512
  This is the right layer for UI previews, audit logging, and custom launchers.
@@ -1 +1 @@
1
- {"version":3,"file":"shims.d.ts","sourceRoot":"","sources":["../../src/agents/shims.ts"],"names":[],"mappings":"AAIA,gEAAgE;AAChE,MAAM,MAAM,SAAS,GACf,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,IAAI,GACJ,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,QAAQ,GACR,KAAK,GACL,MAAM,GACN,UAAU,GACV,IAAI,CAAC;AAEX,0CAA0C;AAC1C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,mEAAmE;AACnE,MAAM,WAAW,WAAW;IACxB,4BAA4B;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC1B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IAC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AAC;AAU1E;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAQrE;AAED;mEACmE;AACnE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAMxD"}
@@ -310,10 +310,12 @@ const grokShim = {
310
310
  /**
311
311
  * DeepSeek coding agent (`dsh`, @deepseek-ai/dsh) — tier-1. Boot model is
312
312
  * `dsh --profile <name>`; the headless one-shot surface is the `headless`
313
- * profile: `dsh --profile headless "<task>"` streams reasoning to stderr and
314
- * prints the final assistant message to stdout. At 0.1.5-rc.1 the headless
315
- * app accepts only the positional task and `-h` — no resume/model/mode flags.
316
- * No auth subcommand; credentials resolve via env references / `~/.dsh`.
313
+ * profile. At 0.2.x headless the app accepts `--json` (NDJSON run events),
314
+ * `--session-id` resume, `--permission-mode`, `--approval-policy` and
315
+ * `--add-dir` (`dsh --profile headless --help`, verified on 0.2.2-rc.1).
316
+ * A run exits 0 only when it ends with a completed final `turn/end`, so the
317
+ * exit status alone carries the outcome and the shim parses no events.
318
+ * No auth subcommand; credentials resolve via env references / `$DSH_HOME`.
317
319
  */
318
320
  const dshShim = {
319
321
  name: 'deepseek',
@@ -322,11 +324,22 @@ const dshShim = {
322
324
  getHelpCommand: () => ({ command: 'dsh', args: ['--help'] }),
323
325
  getVersionCommand: () => ({ command: 'dsh', args: ['--version'] }),
324
326
  getPromptCommand: (options) => {
325
- // Always a fresh one-shot headless dispatch: sessionId/sessionDir/
326
- // continue/model degrade silently — the HEADLESS app takes only the
327
- // task + `-h`; no resume/model flags exist at dsh 0.1.5-rc.1.
328
- // mode/workspace/timeoutMs have no dsh flag — best-effort ignored.
329
- return { command: 'dsh', args: ['--profile', 'headless', options.input ?? ''] };
327
+ const args = ['--profile', 'headless'];
328
+ if ((options.mode ?? 'text') === 'json')
329
+ args.push('--json');
330
+ // ADR-047 R5: sessionId is the only session input that emits a flag. `continue`
331
+ // is never mapped — dsh has no last-session flag and guessing an id would break
332
+ // pinned-session precedence; `sessionDir` is ignored (the store is `$DSH_HOME`,
333
+ // an env var an argv-only shim cannot carry).
334
+ if (options.sessionId !== undefined)
335
+ args.push('--session-id', options.sessionId);
336
+ // Non-interactive fixed grant: dsh requires the permission preset (and the
337
+ // approval policy) on every dispatch, resume included. model/workspace/
338
+ // timeoutMs have no dsh flag — best-effort ignored.
339
+ args.push('--permission-mode', 'workspace-write', '--approval-policy', 'never');
340
+ // `--` pins the task as the positional, so a dash-leading prompt is never a flag.
341
+ args.push('--', options.input ?? '');
342
+ return { command: 'dsh', args };
330
343
  },
331
344
  getAuthCommand: () => null,
332
345
  };
@@ -507,14 +520,16 @@ const AGENT_SESSION_CAPABILITY = {
507
520
  verifiedAgainst: 'unverified (CLI not installed)',
508
521
  note: 'CLI absent at verification (2026-09-18) — conservative defaults; `chat --continue` resumes the last session only, no session-dir/stdin/structured-output flags documented',
509
522
  },
510
- // dsh headless has no resume/session flags — fresh-dispatch degrade.
523
+ // dsh 0.2.x headless: `--json` NDJSON events and `--session-id` resume exist; the
524
+ // session store is `$DSH_HOME` (no directory flag) and each run is one task per
525
+ // process (no persistent stdin). Resume needs the same cwd + repeated permission flags.
511
526
  deepseek: {
512
- supportsResumeById: false,
527
+ supportsResumeById: true,
513
528
  supportsSessionDir: false,
514
529
  supportsPersistentStdin: false,
515
- supportsStructuredOutput: false,
516
- verifiedAgainst: '0.1.5-rc.1',
517
- note: 'headless app takes only the task positional and -h at 0.1.5-rc.1 — no resume/session/mode flags; fresh-dispatch degrade',
530
+ supportsStructuredOutput: true,
531
+ verifiedAgainst: '0.2.2-rc.1',
532
+ note: 'sessionDir false: the session store is $DSH_HOME, an env var an argv-only shim cannot set; persistent stdin false: headless runs one task per process; resume requires the same cwd and repeats the permission flags',
518
533
  },
519
534
  fm: {
520
535
  supportsResumeById: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gobing-ai/ts-ai-runner",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "@gobing-ai/ts-ai-runner — Coding-agent shims, detection, doctor checks, and prompt execution.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -51,12 +51,12 @@
51
51
  "release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-ai-runner-v<version> && git push --tags' && exit 1"
52
52
  },
53
53
  "dependencies": {
54
- "@gobing-ai/ts-infra": "^0.8.4",
55
- "@gobing-ai/ts-runtime": "^0.8.4"
54
+ "@gobing-ai/ts-infra": "^0.8.5",
55
+ "@gobing-ai/ts-runtime": "^0.8.5"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/bun": "1.4.3",
59
- "@gobing-ai/ts-db": "^0.8.4"
59
+ "@gobing-ai/ts-db": "^0.8.5"
60
60
  },
61
61
  "publishConfig": {
62
62
  "access": "public"
@@ -416,10 +416,12 @@ const grokShim: AgentShim = {
416
416
  /**
417
417
  * DeepSeek coding agent (`dsh`, @deepseek-ai/dsh) — tier-1. Boot model is
418
418
  * `dsh --profile <name>`; the headless one-shot surface is the `headless`
419
- * profile: `dsh --profile headless "<task>"` streams reasoning to stderr and
420
- * prints the final assistant message to stdout. At 0.1.5-rc.1 the headless
421
- * app accepts only the positional task and `-h` — no resume/model/mode flags.
422
- * No auth subcommand; credentials resolve via env references / `~/.dsh`.
419
+ * profile. At 0.2.x headless the app accepts `--json` (NDJSON run events),
420
+ * `--session-id` resume, `--permission-mode`, `--approval-policy` and
421
+ * `--add-dir` (`dsh --profile headless --help`, verified on 0.2.2-rc.1).
422
+ * A run exits 0 only when it ends with a completed final `turn/end`, so the
423
+ * exit status alone carries the outcome and the shim parses no events.
424
+ * No auth subcommand; credentials resolve via env references / `$DSH_HOME`.
423
425
  */
424
426
  const dshShim: AgentShim = {
425
427
  name: 'deepseek',
@@ -428,11 +430,20 @@ const dshShim: AgentShim = {
428
430
  getHelpCommand: () => ({ command: 'dsh', args: ['--help'] }),
429
431
  getVersionCommand: () => ({ command: 'dsh', args: ['--version'] }),
430
432
  getPromptCommand: (options) => {
431
- // Always a fresh one-shot headless dispatch: sessionId/sessionDir/
432
- // continue/model degrade silently — the HEADLESS app takes only the
433
- // task + `-h`; no resume/model flags exist at dsh 0.1.5-rc.1.
434
- // mode/workspace/timeoutMs have no dsh flag — best-effort ignored.
435
- return { command: 'dsh', args: ['--profile', 'headless', options.input ?? ''] };
433
+ const args = ['--profile', 'headless'];
434
+ if ((options.mode ?? 'text') === 'json') args.push('--json');
435
+ // ADR-047 R5: sessionId is the only session input that emits a flag. `continue`
436
+ // is never mapped — dsh has no last-session flag and guessing an id would break
437
+ // pinned-session precedence; `sessionDir` is ignored (the store is `$DSH_HOME`,
438
+ // an env var an argv-only shim cannot carry).
439
+ if (options.sessionId !== undefined) args.push('--session-id', options.sessionId);
440
+ // Non-interactive fixed grant: dsh requires the permission preset (and the
441
+ // approval policy) on every dispatch, resume included. model/workspace/
442
+ // timeoutMs have no dsh flag — best-effort ignored.
443
+ args.push('--permission-mode', 'workspace-write', '--approval-policy', 'never');
444
+ // `--` pins the task as the positional, so a dash-leading prompt is never a flag.
445
+ args.push('--', options.input ?? '');
446
+ return { command: 'dsh', args };
436
447
  },
437
448
  getAuthCommand: () => null,
438
449
  };
@@ -630,14 +641,16 @@ const AGENT_SESSION_CAPABILITY: Readonly<Record<AgentName, AgentSessionCapabilit
630
641
  verifiedAgainst: 'unverified (CLI not installed)',
631
642
  note: 'CLI absent at verification (2026-09-18) — conservative defaults; `chat --continue` resumes the last session only, no session-dir/stdin/structured-output flags documented',
632
643
  },
633
- // dsh headless has no resume/session flags — fresh-dispatch degrade.
644
+ // dsh 0.2.x headless: `--json` NDJSON events and `--session-id` resume exist; the
645
+ // session store is `$DSH_HOME` (no directory flag) and each run is one task per
646
+ // process (no persistent stdin). Resume needs the same cwd + repeated permission flags.
634
647
  deepseek: {
635
- supportsResumeById: false,
648
+ supportsResumeById: true,
636
649
  supportsSessionDir: false,
637
650
  supportsPersistentStdin: false,
638
- supportsStructuredOutput: false,
639
- verifiedAgainst: '0.1.5-rc.1',
640
- note: 'headless app takes only the task positional and -h at 0.1.5-rc.1 — no resume/session/mode flags; fresh-dispatch degrade',
651
+ supportsStructuredOutput: true,
652
+ verifiedAgainst: '0.2.2-rc.1',
653
+ note: 'sessionDir false: the session store is $DSH_HOME, an env var an argv-only shim cannot set; persistent stdin false: headless runs one task per process; resume requires the same cwd and repeats the permission flags',
641
654
  },
642
655
  fm: {
643
656
  supportsResumeById: true,