kiokuko-dsh 0.1.45 → 0.1.46

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 (63) hide show
  1. package/PERMISSIONS.md +23 -6
  2. package/README.ja.md +6 -4
  3. package/README.ko.md +6 -4
  4. package/README.md +6 -4
  5. package/README.zh-CN.md +6 -4
  6. package/dist/client.cjs +22 -14
  7. package/dist/client.d.ts.map +1 -1
  8. package/dist/dsh/config.d.ts +2 -0
  9. package/dist/dsh/config.d.ts.map +1 -1
  10. package/dist/dsh/config.js +2 -0
  11. package/dist/dsh/config.js.map +1 -1
  12. package/dist/dsh/host-adapter.d.ts.map +1 -1
  13. package/dist/dsh/host-adapter.js +76 -54
  14. package/dist/dsh/host-adapter.js.map +1 -1
  15. package/dist/dsh/index.js +2 -2
  16. package/dist/dsh/index.js.map +1 -1
  17. package/dist/dsh/input-claim.d.ts +2 -0
  18. package/dist/dsh/input-claim.d.ts.map +1 -1
  19. package/dist/dsh/input-claim.js +8 -0
  20. package/dist/dsh/input-claim.js.map +1 -1
  21. package/dist/dsh/japanese-output-skill.d.ts +2 -0
  22. package/dist/dsh/japanese-output-skill.d.ts.map +1 -1
  23. package/dist/dsh/japanese-output-skill.js +6 -1
  24. package/dist/dsh/japanese-output-skill.js.map +1 -1
  25. package/dist/dsh/managed-file-deployment.d.ts +11 -0
  26. package/dist/dsh/managed-file-deployment.d.ts.map +1 -0
  27. package/dist/dsh/managed-file-deployment.js +73 -0
  28. package/dist/dsh/managed-file-deployment.js.map +1 -0
  29. package/dist/dsh/orca-host.d.ts.map +1 -1
  30. package/dist/dsh/orca-host.js +16 -5
  31. package/dist/dsh/orca-host.js.map +1 -1
  32. package/dist/dsh/orca-session-choice.d.ts +7 -2
  33. package/dist/dsh/orca-session-choice.d.ts.map +1 -1
  34. package/dist/dsh/orca-session-choice.js +14 -3
  35. package/dist/dsh/orca-session-choice.js.map +1 -1
  36. package/dist/dsh/setup.d.ts +23 -0
  37. package/dist/dsh/setup.d.ts.map +1 -0
  38. package/dist/dsh/setup.js +83 -0
  39. package/dist/dsh/setup.js.map +1 -0
  40. package/dist/dsh/standard-skill-deployment.d.ts +7 -3
  41. package/dist/dsh/standard-skill-deployment.d.ts.map +1 -1
  42. package/dist/dsh/standard-skill-deployment.js +17 -86
  43. package/dist/dsh/standard-skill-deployment.js.map +1 -1
  44. package/dist/dsh/standard-skill-integrity.js +1 -1
  45. package/dist/dsh/standard-skills.d.ts +8 -1
  46. package/dist/dsh/standard-skills.d.ts.map +1 -1
  47. package/dist/dsh/standard-skills.js +8 -1
  48. package/dist/dsh/standard-skills.js.map +1 -1
  49. package/docs/dsh-plugin.md +96 -29
  50. package/docs/orca-recording.md +30 -17
  51. package/dsh/cordis.patch.yml +2 -0
  52. package/package.json +6 -3
  53. package/scripts/setup-dsh.mjs +20 -0
  54. package/skills/japanese-translation-for-oss-models/SKILL.md +146 -586
  55. package/skills/kiokuko-enno-oduno/SKILL.md +37 -50
  56. package/skills/kiokuko-simple-work/SKILL.md +21 -66
  57. package/skills/kiokuko-single-purpose-functions/SKILL.md +20 -35
  58. package/skills/kiokuko-single-purpose-functions/references/review-checklist.md +1 -8
  59. package/skills/kiokuko-soul/SKILL.md +17 -51
  60. package/skills/kiokuko-ui-design-soul/SKILL.md +13 -28
  61. package/skills/kiokuko-ui-design-soul/references/ui-checklist.md +12 -10
  62. package/skills/memory-reasoning/SKILL.md +15 -32
  63. package/skills/veteran-programmer-skill/SKILL.md +64 -0
package/PERMISSIONS.md CHANGED
@@ -10,13 +10,24 @@ Kiokuko operation.
10
10
  repository metadata.
11
11
  - Writes the configured Kiokuko database and pre-migration backups, including
12
12
  DSH leases, receipts, retrieval state, and embedding state.
13
- - On enabled plugin load, synchronizes the six bundled standard Skills and their
13
+ - Stores the first native input batch of each governed turn in that database
14
+ for recovery before model or tool execution. This is an input-message copy,
15
+ not a backup of the workspace or whole session. Later step inputs do not
16
+ replace it. Storage failure cannot veto the native turn; observed model or
17
+ tool execution prevents automatic input replay.
18
+ - On enabled plugin load, synchronizes all eight bundled Skills and their
14
19
  references to `~/.agents/skills/` before registering the DSH surfaces. Creates
15
20
  missing files and atomically replaces files carrying their exact Kiokuko
16
21
  management marker. Leaves unrelated files untouched and refuses unmanaged
17
22
  collisions, symbolic links, and unsafe parent directories. A synchronization
18
23
  failure warns that deployed copies may be stale; the bundled DSH provider
19
24
  remains available. Interrupted synchronization resumes on the next load.
25
+ - On enabled plugin load, replaces only the existing Kiokuko managed block in
26
+ the startup directory’s `AGENTS.md` with the DSH host-owned contract. Preserves
27
+ instructions outside the markers; absent or unmanaged files stay untouched.
28
+ Refuses linked files or ambiguous markers. The bundled `scripts/setup-dsh.mjs`
29
+ provides the same repair for an explicit workspace and a read-only `--check`.
30
+ It does not scan parent/global instruction files or other session workspaces.
20
31
  - On plugin load, enumerates stored DSH session IDs and validates each history.
21
32
  When DSH rejects a v3 history containing legacy Kiokuko informational
22
33
  events, reads that exact native session file and marks the five supported
@@ -73,8 +84,8 @@ After `pnpm dsh plugin --profile web update kiokuko-dsh --latest`, reload the DS
73
84
  plugin or restart DSH. The newly loaded package synchronizes the standard Skills
74
85
  before the first conversation; npm installation itself does not write them.
75
86
  Other agents that cache `~/.agents/skills/` must reload their Skill catalog.
76
- `natural-japanese-output` remains a separate bundled DSH Skill and is not part
77
- of the six managed directories.
87
+ `natural-japanese-output` is deployed under `japanese-translation-for-oss-models/`,
88
+ matching its bundled directory; its public Skill name remains unchanged.
78
89
 
79
90
  ## Failure boundaries
80
91
 
@@ -97,9 +108,15 @@ run.
97
108
  ## Orca recordings
98
109
 
99
110
  `orca.enabled` defaults to `true`, including in the installed bundle configuration.
100
- This enables the feature; a native question asks whether to record each session.
101
- Only affirmative choices or `/kioku-orca start` authorize capture. Choices are
102
- saved in SQLite; skip/cancel or unavailable UI continues without recording.
111
+ This enables the feature, and configuration also approves it: each interactive
112
+ session is recorded without a question, and delegated or managed child sessions
113
+ follow the same default without ever being asked. `orca.askOnStart: true`
114
+ restores the per-session question instead, and child sessions then need an
115
+ explicit `/kioku-orca start`. Default recording, an affirmative answer or
116
+ `/kioku-orca start` authorize capture. Choices are
117
+ saved in SQLite and outrank the default, so a saved refusal keeps that session
118
+ unrecorded; with `askOnStart: true`, skip/cancel or unavailable UI continues
119
+ without recording.
103
120
  Set it to `false` and reload to disable the feature. The runtime dependencies
104
121
  `@orcareplay/core`, `@orcareplay/schema`, and `@orcareplay/viewer` with range `>=0.2.1`
105
122
  are installed automatically by npm/pnpm with this package. No extra installer,
package/README.ja.md CHANGED
@@ -27,10 +27,10 @@ pnpm dsh web
27
27
  起動後は普通に依頼を入力します。Kiokuko 専用の setup 操作は不要です。
28
28
  GitHub・ローカルからの導入は [プラグインガイド](docs/dsh-plugin.md) を参照してください。
29
29
 
30
- OrcaReplay の機能設定は自動導入され、**手動設定は不要**です。チャットの最初に詳細ログを「記録する/記録しない」を選びます。
31
- 「記録する」を選ぶと、その後のモデル応答やツール実行結果を作業プロジェクトの `.orca/runs/` に保存します。選択はセッションごとに保持され、スキップ・取消時は記録せず続行します。
30
+ OrcaReplay の機能設定は自動導入され、**手動設定は不要**です。各チャットは確認なしで詳細ログを記録します。
31
+ 記録すると、モデル応答やツール実行結果が作業プロジェクトの `.orca/runs/` に保存されます。判断はセッションごとに保持されるため、`/kioku-orca stop` したチャットは記録されないままです。毎回確認したい場合は `orca.askOnStart: true` を設定します。
32
32
 
33
- - `/kioku-orca start`: 手動で記録を開始、または停止後に再開します。最初に「記録する」を選んだ場合は実行不要です。過去の動作は記録されません。
33
+ - `/kioku-orca start`: 手動で記録を開始、または停止後に再開します。そのチャットを停止していなければ実行不要です。過去の動作は記録されません。
34
34
  - `/kioku-orca status`: 記録状態・保存先・次の操作を短く表示します。診断用の詳細情報は `/kioku-orca status --json` で確認できます。
35
35
 
36
36
  `/kioku-orca stop` でログを確定後、`list` で run ID を確認し、`show <run ID>` で内容を表示、`export <run ID>` で HTML を出力できます(いずれも `/kioku-orca` に続けて入力)。
@@ -47,7 +47,9 @@ pnpm dsh plugin --profile web update kiokuko-dsh --latest
47
47
  pnpm dsh web
48
48
  ```
49
49
 
50
- 起動時に、標準6 Skillと参照ファイルを `~/.agents/skills/` へ同期します。不足分を作成し、管理対象の旧版を更新します。非管理ファイルは上書きしません。他のエージェントではSkillカタログの再読み込みが必要です。
50
+ 起動時に、日本語出力を含む全8 Skillと参照ファイルを `~/.agents/skills/` へ同期します。不足分を作成し、管理対象の旧版を更新します。非管理ファイルは上書きしません。他のエージェントではSkillカタログの再読み込みが必要です。
51
+
52
+ 起動時には、起動ディレクトリの `AGENTS.md` にある既存の Kiokuko 管理ブロックも更新し、その外側の指示は保持します。パッケージ更新後は DSH を再起動してください。別の作業ディレクトリや配備コピーの確認・修復は[セットアップ手順](docs/dsh-plugin.md#what-setup-updates-and-when)を参照してください。`kiokuko use` は DSH のセットアップコマンドではありません。
51
53
 
52
54
  Orca の 0.3.0 などが公開された後、Orca 関連の依存を更新する場合:
53
55
 
package/README.ko.md CHANGED
@@ -22,10 +22,10 @@ pnpm dsh web
22
22
  시작 후 평소처럼 작업을 입력하면 됩니다. Kiokuko 전용 setup 작업은 필요하지 않습니다.
23
23
  GitHub 및 로컬 설치 방법은 [플러그인 안내](docs/dsh-plugin.md)를 참고하세요.
24
24
 
25
- OrcaReplay 기능은 자동으로 설정되며 **수동 설정이 필요 없습니다**. 채팅 시작 상세 로그를 기록할지 선택합니다.
26
- 기록을 선택하면 이후 모델 응답과 도구 실행 결과가 세션 작업 공간의 `.orca/runs/`에 저장됩니다. 선택은 세션별로 유지되며, 건너뛰거나 취소하면 기록 없이 채팅을 계속합니다.
25
+ OrcaReplay 기능은 자동으로 설정되며 **수동 설정이 필요 없습니다**. 채팅은 확인 없이 상세 로그를 기록합니다.
26
+ 기록하면 이후 모델 응답과 도구 실행 결과가 세션 작업 공간의 `.orca/runs/`에 저장됩니다. 결정은 세션별로 유지되므로 `/kioku-orca stop`한 채팅은 기록하지 않은 상태로 남습니다. 채팅 시작 시 확인하려면 `orca.askOnStart: true`를 설정하세요.
27
27
 
28
- - `/kioku-orca start`: 기록을 수동으로 시작하거나 중지 후 다시 시작합니다. 시작 기록을 선택했다면 실행할 필요가 없습니다. 과거 동작은 기록되지 않습니다.
28
+ - `/kioku-orca start`: 기록을 수동으로 시작하거나 중지 후 다시 시작합니다. 해당 채팅을 중지하지 않았다면 실행할 필요가 없습니다. 과거 동작은 기록되지 않습니다.
29
29
  - `/kioku-orca status`: 기록 상태, 저장 위치와 다음 동작을 간단히 표시합니다. 진단용 상세 정보는 `/kioku-orca status --json`으로 확인할 수 있습니다.
30
30
 
31
31
  `/kioku-orca stop`으로 로그를 확정한 뒤 `list`로 run ID를 확인하고, `show <run ID>`로 내용을 보거나 `export <run ID>`로 HTML을 내보낼 수 있습니다(모두 `/kioku-orca` 뒤에 입력).
@@ -40,7 +40,9 @@ pnpm dsh plugin --profile web update kiokuko-dsh --latest
40
40
  pnpm dsh web
41
41
  ```
42
42
 
43
- 시작 시 번들 표준 Skill 6개와 참조 파일을 `~/.agents/skills/`에 동기화합니다. 누락된 파일을 만들고 관리 대상 복사본을 업데이트하며, 비관리 파일은 덮어쓰지 않습니다. 다른 에이전트에서는 Skill 카탈로그를 다시 로드해야 합니다.
43
+ 시작 시 일본어 출력 Skill 포함한 번들 Skill 8개와 참조 파일을 `~/.agents/skills/`에 동기화합니다. 누락된 파일을 만들고 관리 대상 복사본을 업데이트하며, 비관리 파일은 덮어쓰지 않습니다. 다른 에이전트에서는 Skill 카탈로그를 다시 로드해야 합니다.
44
+
45
+ 시작 시 시작 디렉터리의 `AGENTS.md`에 있는 기존 Kiokuko 관리 블록도 갱신하며, 블록 밖의 지침은 보존합니다. 패키지 업데이트 후 DSH를 다시 시작하세요. 다른 작업 디렉터리나 오래된 복사본의 확인 및 복구는 [설정 절차](docs/dsh-plugin.md#what-setup-updates-and-when)를 참고하세요. `kiokuko use`는 DSH 설정 명령이 아닙니다.
44
46
 
45
47
  Orca 0.3.0 등 새 버전이 공개된 후 Orca 관련 의존 패키지를 업데이트하려면:
46
48
 
package/README.md CHANGED
@@ -28,10 +28,10 @@ If you use a globally installed `dsh` CLI, omit `pnpm` from the commands.
28
28
  Enter your task normally; no Kiokuko setup command is needed.
29
29
  For GitHub/local installation, see the [plugin guide](docs/dsh-plugin.md).
30
30
 
31
- OrcaReplay is configured automatically; **no manual setup is required**. At the start of a chat, choose whether to record detailed logs.
32
- Choosing to record saves subsequent model responses and tool results to `.orca/runs/` in the session workspace. The choice is remembered per session; skipped or cancelled questions continue without recording.
31
+ OrcaReplay is configured automatically; **no manual setup is required**. Every chat records detailed logs without asking.
32
+ Recording saves model responses and tool results to `.orca/runs/` in the session workspace. A decision is remembered per session, so `/kioku-orca stop` keeps that chat unrecorded; set `orca.askOnStart: true` to ask at the start of each chat instead.
33
33
 
34
- - `/kioku-orca start`: start recording manually or resume after stopping. Not needed if you chose to record at the start; past activity is not captured.
34
+ - `/kioku-orca start`: start recording manually or resume after stopping. Not needed unless this chat was stopped earlier; past activity is not captured.
35
35
  - `/kioku-orca status`: briefly show the recording state, storage location, and next action. Use `/kioku-orca status --json` for diagnostic details.
36
36
 
37
37
  Use `/kioku-orca stop` to finalize the log, `list` to find its run ID, `show <run ID>` to inspect it, and `export <run ID>` to create HTML (all under `/kioku-orca`).
@@ -46,7 +46,9 @@ pnpm dsh plugin --profile web update kiokuko-dsh --latest
46
46
  pnpm dsh web
47
47
  ```
48
48
 
49
- At startup, the six bundled standard Skills and their references are synchronized to `~/.agents/skills/`. Missing files are created and managed copies are updated; unmanaged files are preserved. Other agents must reload their Skill catalog.
49
+ At startup, all eight bundled Skills (including Japanese output) and their references are synchronized to `~/.agents/skills/`. Missing files are created and managed copies are updated; unmanaged files are preserved. Other agents must reload their Skill catalog.
50
+
51
+ Startup also refreshes an existing Kiokuko managed block in the startup directory’s `AGENTS.md`, preserving your other instructions. Restart DSH after updating the package. See [setup and verification](docs/dsh-plugin.md#what-setup-updates-and-when) for another workspace or stale copies; `kiokuko use` is not the DSH setup command.
50
52
 
51
53
  To update Orca dependencies after a release such as 0.3.0:
52
54
 
package/README.zh-CN.md CHANGED
@@ -22,10 +22,10 @@ pnpm dsh web
22
22
  启动后直接输入任务,无需额外的 Kiokuko setup 操作。
23
23
  GitHub 和本地安装方式见[插件指南](docs/dsh-plugin.md)。
24
24
 
25
- OrcaReplay 的功能配置会自动安装,**无需手动设置**。聊天开始时,可选择是否记录详细日志。
26
- 选择记录后,后续模型回复和工具执行结果将保存到会话工作目录的 `.orca/runs/`。选择按会话保存;跳过或取消时,不记录并继续聊天。
25
+ OrcaReplay 的功能配置会自动安装,**无需手动设置**。每次聊天都会在无需确认的情况下记录详细日志。
26
+ 记录后,后续模型回复和工具执行结果将保存到会话工作目录的 `.orca/runs/`。决定按会话保存,因此执行过 `/kioku-orca stop` 的聊天保持不记录。若想在聊天开始时确认,请设置 `orca.askOnStart: true`。
27
27
 
28
- - `/kioku-orca start`:手动开始记录,或在停止后重新开始。如果开始时已选择记录,则无需执行。不会补录过去的活动。
28
+ - `/kioku-orca start`:手动开始记录,或在停止后重新开始。若该聊天未被停止,则无需执行。不会补录过去的活动。
29
29
  - `/kioku-orca status`:简要显示记录状态、保存位置和下一步操作。诊断详情可用 `/kioku-orca status --json` 查看。
30
30
 
31
31
  用 `/kioku-orca stop` 完成日志记录后,用 `list` 查看 run ID、`show <run ID>` 查看内容、`export <run ID>` 导出 HTML(均在 `/kioku-orca` 后输入)。
@@ -40,7 +40,9 @@ pnpm dsh plugin --profile web update kiokuko-dsh --latest
40
40
  pnpm dsh web
41
41
  ```
42
42
 
43
- 启动时会将内置的6个标准 Skill 及其引用文件同步到 `~/.agents/skills/`,创建缺失文件并更新受管理的副本,不覆盖非受管理文件。其他代理需要重新加载 Skill 目录。
43
+ 启动时会将包括日语输出在内的全部8个内置 Skill 及其引用文件同步到 `~/.agents/skills/`,创建缺失文件并更新受管理的副本,不覆盖非受管理文件。其他代理需要重新加载 Skill 目录。
44
+
45
+ 启动时也会更新启动目录中 `AGENTS.md` 的现有 Kiokuko 管理块,保留块外的指令。更新包后请重启 DSH。其他工作目录或旧副本的检查与修复请参阅[设置步骤](docs/dsh-plugin.md#what-setup-updates-and-when)。`kiokuko use` 不是 DSH 的设置命令。
44
46
 
45
47
  Orca 发布 0.3.0 等新版本后,更新 Orca 相关依赖:
46
48
 
package/dist/client.cjs CHANGED
@@ -322,16 +322,8 @@ window.__ModuleLoader__.load({
322
322
  ] });
323
323
  }
324
324
  const intakeDrafts = new WeakMap();
325
- /**
326
- * Small intake questions this plugin renders as a numbered option card. The identity
327
- * pair is matched exactly: another plugin's question that happens to share one
328
- * half falls through to the native composer. `supported` keeps the option count
329
- * inside the 1-9 range the number-key shortcut can address.
330
- */
331
- const INTAKE_QUESTIONS = [
332
- { id: 'taskType', header: 'Kiokuko · 作業の選択' },
333
- { id: 'kioku-orca-recording', header: 'OrcaReplay · 詳細ログ' },
334
- ];
325
+ /** Option count a single number key addresses: the range the shortcut card covers. */
326
+ const DIGIT_ADDRESSABLE_OPTIONS = 9;
335
327
  const ENNO_SELECTION_QUESTIONS = [
336
328
  'enno-execution-mode', 'enno-model-source', 'enno-template', 'enno-template-provider',
337
329
  'enno-template-unavailable', 'enno-bind-provider', 'enno-model-review', 'enno-catalog-retry',
@@ -351,19 +343,31 @@ window.__ModuleLoader__.load({
351
343
  return 'value';
352
344
  return 'choice';
353
345
  }
346
+ /**
347
+ * Decide whether this plugin's numbered card owns a native question carrier.
348
+ *
349
+ * The card claims every single-select question carrying one to nine options,
350
+ * whoever asked it — Kiokuko's own intake, an Enno or Deep selection, another
351
+ * plugin, or a question the model composed in chat — so a number-key plus Enter
352
+ * shortcut is never missing from a question this composer shows. Longer catalogs
353
+ * are claimed only by the Enno and Deep selection questions, whose typed search
354
+ * and value flows own their own addressing. Multi-select batches, optionless
355
+ * prompts, and multi-question batches have no single number per answer and stay
356
+ * with the native composer.
357
+ */
354
358
  function isSupportedQuestion(question) {
355
359
  if (question === undefined || question.multiSelect === true)
356
360
  return false;
357
361
  const options = question.options?.length ?? 0;
358
362
  if (options < 1)
359
363
  return false;
364
+ if (options <= DIGIT_ADDRESSABLE_OPTIONS)
365
+ return true;
360
366
  if (question.header === '実行方式とモデル' && (ENNO_SELECTION_QUESTIONS.includes(question.id) || isEnnoSearchQuestion(question)))
361
367
  return true;
362
368
  if (question.header === 'Deep planning' && DEEP_SELECTION_QUESTIONS.includes(question.id))
363
369
  return true;
364
- if (options > 9)
365
- return false;
366
- return INTAKE_QUESTIONS.some(kind => kind.id === question.id && kind.header === question.header);
370
+ return false;
367
371
  }
368
372
  function intakePending(props) {
369
373
  const pending = props.pendingInteraction;
@@ -372,7 +376,11 @@ window.__ModuleLoader__.load({
372
376
  && typeof pending.answer === 'function' && typeof pending.cancel === 'function'
373
377
  ? pending : null;
374
378
  }
375
- /** Native pending carrier, plugin-only presentation. Other DSH questions remain untouched. */
379
+ /**
380
+ * Native pending carrier, plugin-only presentation. The card answers through the
381
+ * carrier's own protocol, so claiming a question does not change what the asker
382
+ * receives — only how the option can be chosen.
383
+ */
376
384
  function IntakeQuestion(props) {
377
385
  const pending = props.matched;
378
386
  return jsx(IntakeQuestionCard, { key: pending.key, pending });
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAKA,UAAU,wBAAwB;IAChC,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;QAAE,cAAc,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,CAAC,CAAA;IAC7G,QAAQ,EAAE;QAAE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAA;CACxC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,Q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,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,GAAG,OAAO,CAAA;CACtI;AA0ED,+EAA+E;AAC/E,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,UAAU,GAAG,WAAW,CAAC,CAqBjH;AAuHD,eAAO,MAAM,MAAM,gDAAiD,CAAA;AAsVpE,mEAAmE;AACnE,wBAAgB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAgCjD"}
@@ -3,6 +3,7 @@ export { MemoryEvolutionConfig };
3
3
  import { z } from 'zod';
4
4
  export declare const OrcaConfig: z.ZodObject<{
5
5
  enabled: z.ZodDefault<z.ZodBoolean>;
6
+ askOnStart: z.ZodDefault<z.ZodBoolean>;
6
7
  storage: z.ZodDefault<z.ZodEnum<{
7
8
  project: "project";
8
9
  "data-dir": "data-dir";
@@ -82,6 +83,7 @@ export declare const Config: z.ZodObject<{
82
83
  }, z.core.$strict>>>;
83
84
  orca: z.ZodPrefault<z.ZodObject<{
84
85
  enabled: z.ZodDefault<z.ZodBoolean>;
86
+ askOnStart: z.ZodDefault<z.ZodBoolean>;
85
87
  storage: z.ZodDefault<z.ZodEnum<{
86
88
  project: "project";
87
89
  "data-dir": "data-dir";
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/dsh/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AACnD,eAAO,MAAM,gBAAgB;;kBAA6D,CAAA;AAC1F,eAAO,MAAM,kBAAkB;;;;;kBAAyG,CAAA;AACxI,mEAAmE;AACnE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjB,CAAA;AACF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAA"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/dsh/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAKvB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBrB,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAA;AACnD,eAAO,MAAM,gBAAgB;;kBAA6D,CAAA;AAC1F,eAAO,MAAM,kBAAkB;;;;;kBAAyG,CAAA;AACxI,mEAAmE;AACnE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjB,CAAA;AACF,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAA"}
@@ -6,6 +6,8 @@ import { DeepThinkerConfigSchema } from '../deep-thinker/core/contracts.js';
6
6
  const limit = (value) => z.number().int().positive().max(Number.MAX_SAFE_INTEGER).default(value);
7
7
  export const OrcaConfig = z.object({
8
8
  enabled: z.boolean().default(true),
9
+ /** `false` records every interactive session without a per-session question; `true` asks first. */
10
+ askOnStart: z.boolean().default(false),
9
11
  storage: z.enum(['project', 'data-dir']).default('project'),
10
12
  includeAuxiliary: z.boolean().default(false),
11
13
  capture: z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/dsh/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AACxE,OAAO,EAAE,qBAAqB,EAAE,CAAA;AAChC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAE3E,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AACxG,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC3D,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;QAC7D,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;KACtC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;IACf,sBAAsB,EAAE,KAAK,CAAC,SAAS,CAAC;IACxC,mBAAmB,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U,CAAC,CAAA;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAA;IACrC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,eAAe,CAAA;IACvC,oEAAoE;IACpE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,0EAA0E;IAC1E,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAA;CACpC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CACtC;AAoED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAWvE;AAOD,wBAAgB,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAU/E;AAsBD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAKrE;AAED,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,EAAE,cAAc,GAAG,OAAO,CAU/F;AAiGD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE,qBAA0B,GAAG,cAAc,CAspEtG;AAsBD,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
@@ -47,7 +47,7 @@ import { checkpointDshMemory } from '../memory/scoped-memory.js';
47
47
  import { LedgerStore } from '../ledger/store.js';
48
48
  import { ENNO_APPLICABLE_TASK_TYPES } from '../enno-oduno/types.js';
49
49
  import { commitExpectedFailure, ennoReceiptOperation, enqueueUnsubmittedTurn, isExpectedTurnFailure, phaseForOperation, prepareTurnIntent, readPendingOutbox, readTurnSeal, markOutboxObservedInTransaction, appliedTurnOutcome, replacePendingOutboxMessageInTransaction, supersedeBoundaryJobsAtOrBeforeRevisionInTransaction, supersedeOutboxAtOrBeforeRevisionInTransaction, } from './turn-process.js';
50
- import { backupInputClaimInTransaction, markClaimProgressInTransaction, settleInputClaimInTransaction, takeRecoverableInputClaimInTransaction, unexecutedRunInput, } from './input-claim.js';
50
+ import { backupInputClaimInTransaction, readInputClaim, markClaimProgressInTransaction, settleInputClaimInTransaction, takeRecoverableInputClaimInTransaction, unexecutedRunInput, } from './input-claim.js';
51
51
  import { DshSessionLogMirror } from './session-log-mirror.js';
52
52
  import { abortable, DshBoundaryWorker } from './boundary-worker.js';
53
53
  import { DshSessionLogExportService } from './session-log-export.js';
@@ -447,6 +447,32 @@ export function createDshHostAdapter(ctx, options = {}) {
447
447
  const continuedTurns = new Map();
448
448
  const resumedTurns = new Map();
449
449
  const inMemoryClaims = new Map();
450
+ const captureInitialInput = async (sessionId, turn, messages) => {
451
+ const key = `${sessionId}\u0000${turn}`;
452
+ let initial = inMemoryClaims.get(key);
453
+ if (!initial) {
454
+ if (messages.length === 0)
455
+ return;
456
+ initial = { messages: Object.freeze([...messages]), providerStarted: false, sideEffectStarted: false, recovered: false };
457
+ inMemoryClaims.set(key, initial);
458
+ }
459
+ // Inbox claims are step-local. Preserve the first turn input and monotonic
460
+ // execution flags across assembly, pre-step, steering, and plugin reload.
461
+ const snapshot = initial;
462
+ try {
463
+ const stored = await runtime.withDatabase(database => withImmediateTransaction(database, () => (readInputClaim(database, sessionId, turn) ?? backupInputClaimInTransaction(database, {
464
+ dshSessionId: sessionId, nativeTurn: turn, messages: snapshot.messages,
465
+ }))));
466
+ snapshot.messages = stored.messages;
467
+ snapshot.providerStarted ||= stored.providerStarted;
468
+ snapshot.sideEffectStarted ||= stored.sideEffectStarted;
469
+ snapshot.recovered ||= stored.recoveryCount !== 0 || (stored.status !== 'claimed' && stored.status !== 'recoverable');
470
+ }
471
+ catch {
472
+ // Auxiliary persistence cannot veto native assembly or admission. The
473
+ // original process-local snapshot still covers a pre-provider failure.
474
+ }
475
+ };
450
476
  let retireSupersededRun;
451
477
  let resumeExistingRun;
452
478
  const identityKey = (agentId, sessionId) => dshPonytailOwnerKey(agentId, sessionId);
@@ -767,27 +793,8 @@ export function createDshHostAdapter(ctx, options = {}) {
767
793
  return downstream;
768
794
  if (event.nativeAgent && selectionBlocked.has(event.nativeAgent))
769
795
  return { kind: 'reject' };
770
- const claimKey = `${event.sessionId}\u0000${event.turn}`;
771
796
  const nativeMessages = Object.freeze([...(event.nativeMessages ?? [])]);
772
- inMemoryClaims.set(claimKey, {
773
- messages: nativeMessages,
774
- providerStarted: false,
775
- sideEffectStarted: false,
776
- recovered: false,
777
- });
778
- try {
779
- await runtime.withDatabase((database) => withImmediateTransaction(database, () => {
780
- backupInputClaimInTransaction(database, {
781
- dshSessionId: event.sessionId,
782
- nativeTurn: event.turn,
783
- messages: nativeMessages,
784
- });
785
- }));
786
- }
787
- catch {
788
- // The in-memory copy still protects a pre-provider failure in this
789
- // process. Durable backup failure cannot veto the native decision.
790
- }
797
+ await captureInitialInput(event.sessionId, event.turn, nativeMessages);
791
798
  const humanPresent = nativeMessages.some(isHumanMessage) || downstream.messages.some(isHumanMessage);
792
799
  const seenContinuations = new Set();
793
800
  let nativeDecision = {
@@ -1162,9 +1169,7 @@ export function createDshHostAdapter(ctx, options = {}) {
1162
1169
  // DSH claims input before assembly. Persist it before showing any UI so
1163
1170
  // cancellation and restart cannot lose a prompt before the native log append.
1164
1171
  if (agent.session && messages.length) {
1165
- await runtime.withDatabase(db => withImmediateTransaction(db, () => backupInputClaimInTransaction(db, {
1166
- dshSessionId: agent.session.id, nativeTurn: turn, messages,
1167
- })));
1172
+ await captureInitialInput(agent.session.id, turn, messages);
1168
1173
  }
1169
1174
  try {
1170
1175
  const event = await mapPreStep({ agent, messages, turn, step: 0, signal });
@@ -2189,11 +2194,29 @@ export function createDshHostAdapter(ctx, options = {}) {
2189
2194
  });
2190
2195
  });
2191
2196
  const sessionEventDisposer = ctx.on('session/event', (session, event) => {
2197
+ const item = currentSession(session.id);
2198
+ const data = objectRecord(event.data);
2199
+ const eventTurn = typeof data?.turn === 'number' && Number.isSafeInteger(data.turn) ? data.turn : item?.turn;
2200
+ const ownsTurn = item !== undefined && !item.closed && eventTurn === item.turn && typeof event.type === 'string';
2201
+ const claimKey = `${session.id}\u0000${eventTurn}`;
2202
+ const fallback = ownsTurn ? inMemoryClaims.get(claimKey) : undefined;
2203
+ const providerStarted = event.type === 'request/header' || event.type === 'request/context'
2204
+ || event.type === 'assistant/chunk' || event.type === 'assistant/message';
2205
+ const sideEffectStarted = event.type === 'tool/call';
2206
+ // Observe execution synchronously, before the mirror can yield or fail.
2207
+ // A later step/end callback must never see an earlier execution as unstarted.
2208
+ if (fallback) {
2209
+ fallback.providerStarted ||= providerStarted;
2210
+ fallback.sideEffectStarted ||= sideEffectStarted;
2211
+ }
2192
2212
  // This observer is deliberately fire-and-contain. DSH persistence and the
2193
2213
  // model turn must never depend on Kiokuko claim bookkeeping.
2194
2214
  void (async () => {
2195
2215
  if (typeof event.type === 'string' && typeof event.seq === 'number') {
2196
- await sessionMirror.observe(session.id, event);
2216
+ try {
2217
+ await sessionMirror.observe(session.id, event);
2218
+ }
2219
+ catch { /* claim bookkeeping remains independent */ }
2197
2220
  const continuationId = eventContinuationId(event.data);
2198
2221
  if (continuationId !== undefined) {
2199
2222
  try {
@@ -2207,26 +2230,8 @@ export function createDshHostAdapter(ctx, options = {}) {
2207
2230
  }
2208
2231
  }
2209
2232
  }
2210
- const item = currentSession(session.id);
2211
- if (item === undefined || item.closed || typeof event.type !== 'string')
2212
- return;
2213
- const data = objectRecord(event.data);
2214
- const eventTurn = typeof data?.turn === 'number' && Number.isSafeInteger(data.turn)
2215
- ? data.turn
2216
- : item.turn;
2217
- if (eventTurn !== item.turn)
2233
+ if (!ownsTurn || item === undefined)
2218
2234
  return;
2219
- const claimKey = `${item.sessionId}\u0000${item.turn}`;
2220
- const fallback = inMemoryClaims.get(claimKey);
2221
- const providerStarted = event.type === 'request/header'
2222
- || event.type === 'request/context'
2223
- || event.type === 'assistant/chunk'
2224
- || event.type === 'assistant/message';
2225
- const sideEffectStarted = event.type === 'tool/call';
2226
- if (fallback !== undefined) {
2227
- fallback.providerStarted ||= providerStarted;
2228
- fallback.sideEffectStarted ||= sideEffectStarted;
2229
- }
2230
2235
  if (providerStarted || sideEffectStarted) {
2231
2236
  try {
2232
2237
  await runtime.withDatabase((database) => withImmediateTransaction(database, () => {
@@ -2247,13 +2252,23 @@ export function createDshHostAdapter(ctx, options = {}) {
2247
2252
  const reason = objectRecord(data?.reason);
2248
2253
  const turnEndedWithError = reason?.kind === 'error';
2249
2254
  let durableRecoverable = false;
2255
+ let durableUnavailable = true;
2250
2256
  try {
2251
- const settled = await runtime.withDatabase((database) => withImmediateTransaction(database, () => (settleInputClaimInTransaction(database, {
2252
- dshSessionId: item.sessionId,
2253
- nativeTurn: item.turn,
2254
- turnEndedWithError,
2255
- }))));
2257
+ const settled = await runtime.withDatabase((database) => withImmediateTransaction(database, () => {
2258
+ // Earlier observer writes may still be pending. Persist all execution
2259
+ // already observed locally before deciding whether replay is safe.
2260
+ markClaimProgressInTransaction(database, {
2261
+ dshSessionId: item.sessionId, nativeTurn: item.turn,
2262
+ providerStarted: fallback?.providerStarted === true, sideEffectStarted: fallback?.sideEffectStarted === true,
2263
+ });
2264
+ return settleInputClaimInTransaction(database, {
2265
+ dshSessionId: item.sessionId,
2266
+ nativeTurn: item.turn,
2267
+ turnEndedWithError,
2268
+ });
2269
+ }));
2256
2270
  durableRecoverable = settled?.status === 'recoverable';
2271
+ durableUnavailable = settled === undefined;
2257
2272
  }
2258
2273
  catch {
2259
2274
  // Fall through to the process-local decision.
@@ -2264,8 +2279,14 @@ export function createDshHostAdapter(ctx, options = {}) {
2264
2279
  && !fallback.sideEffectStarted
2265
2280
  && !fallback.recovered;
2266
2281
  const steer = item.nativeAgent?.steer;
2267
- if ((durableRecoverable || locallyRecoverable) && steer !== undefined) {
2282
+ const recoveryAllowed = (fallback === undefined || locallyRecoverable)
2283
+ && (durableRecoverable || durableUnavailable && locallyRecoverable);
2284
+ if (recoveryAllowed && steer !== undefined) {
2268
2285
  let messages;
2286
+ // Reserve locally before awaiting the durable consumer; duplicate end
2287
+ // notifications cannot enqueue the same input again.
2288
+ if (fallback)
2289
+ fallback.recovered = true;
2269
2290
  if (durableRecoverable) {
2270
2291
  try {
2271
2292
  const claim = await runtime.withDatabase((database) => withImmediateTransaction(database, () => (takeRecoverableInputClaimInTransaction(database, item.sessionId, item.turn))));
@@ -2273,17 +2294,18 @@ export function createDshHostAdapter(ctx, options = {}) {
2273
2294
  }
2274
2295
  catch {
2275
2296
  // Use the exact in-memory batch if the durable consumer failed.
2297
+ messages = fallback?.messages;
2276
2298
  }
2277
2299
  }
2278
- messages ??= fallback?.messages;
2300
+ else {
2301
+ messages = fallback?.messages;
2302
+ }
2279
2303
  if (messages !== undefined && messages.length > 0) {
2280
- if (fallback !== undefined)
2281
- fallback.recovered = true;
2282
2304
  for (const message of messages)
2283
2305
  steer(message);
2284
2306
  }
2285
2307
  }
2286
- if (!turnEndedWithError || (!durableRecoverable && !locallyRecoverable))
2308
+ if (!turnEndedWithError || !recoveryAllowed)
2287
2309
  inMemoryClaims.delete(claimKey);
2288
2310
  if (reason?.kind === 'completed' && item.prepared.ennoOduno.applicable && !executionSupport.paused(item.sessionId)) {
2289
2311
  await runtime.withDatabase(database => {