odai-dsh-agent 0.2.5 → 0.2.6

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 (166) hide show
  1. package/README.md +3 -3
  2. package/build/bin/odai-dsh-agent.d.mts +3 -0
  3. package/build/bin/odai-dsh-agent.d.mts.map +1 -0
  4. package/build/bin/odai-dsh-agent.mjs +114 -0
  5. package/build/bin/odai-dsh-agent.mjs.map +1 -0
  6. package/build/src/dsh-version.d.mts +16 -0
  7. package/build/src/dsh-version.d.mts.map +1 -0
  8. package/build/src/dsh-version.mjs +20 -0
  9. package/build/src/dsh-version.mjs.map +1 -0
  10. package/build/src/installer.d.mts +46 -0
  11. package/build/src/installer.d.mts.map +1 -0
  12. package/build/src/installer.mjs +397 -0
  13. package/build/src/installer.mjs.map +1 -0
  14. package/package.json +13 -12
  15. package/preset/odai/runtime/compaction-config.d.mts +66 -0
  16. package/preset/odai/runtime/compaction-config.d.mts.map +1 -0
  17. package/preset/odai/runtime/compaction-config.mjs +320 -342
  18. package/preset/odai/runtime/compaction-config.mjs.map +1 -0
  19. package/preset/odai/runtime/compaction-runtime.d.mts +68 -0
  20. package/preset/odai/runtime/compaction-runtime.d.mts.map +1 -0
  21. package/preset/odai/runtime/compaction-runtime.mjs +157 -0
  22. package/preset/odai/runtime/compaction-runtime.mjs.map +1 -0
  23. package/preset/odai/runtime/context-activation.d.mts +31 -0
  24. package/preset/odai/runtime/context-activation.d.mts.map +1 -0
  25. package/preset/odai/runtime/context-activation.mjs +55 -49
  26. package/preset/odai/runtime/context-activation.mjs.map +1 -0
  27. package/preset/odai/runtime/context-capability.d.mts +16 -0
  28. package/preset/odai/runtime/context-capability.d.mts.map +1 -0
  29. package/preset/odai/runtime/context-capability.mjs +79 -74
  30. package/preset/odai/runtime/context-capability.mjs.map +1 -0
  31. package/preset/odai/runtime/governance.d.mts +30 -0
  32. package/preset/odai/runtime/governance.d.mts.map +1 -0
  33. package/preset/odai/runtime/governance.mjs +126 -113
  34. package/preset/odai/runtime/governance.mjs.map +1 -0
  35. package/preset/odai/runtime/human-care.d.mts +13 -0
  36. package/preset/odai/runtime/human-care.d.mts.map +1 -0
  37. package/preset/odai/runtime/human-care.mjs +45 -42
  38. package/preset/odai/runtime/human-care.mjs.map +1 -0
  39. package/preset/odai/runtime/human-safety-continuity-store.d.mts +43 -0
  40. package/preset/odai/runtime/human-safety-continuity-store.d.mts.map +1 -0
  41. package/preset/odai/runtime/human-safety-continuity-store.mjs +193 -215
  42. package/preset/odai/runtime/human-safety-continuity-store.mjs.map +1 -0
  43. package/preset/odai/runtime/human-safety-continuity.d.mts +27 -0
  44. package/preset/odai/runtime/human-safety-continuity.d.mts.map +1 -0
  45. package/preset/odai/runtime/human-safety-continuity.mjs +205 -216
  46. package/preset/odai/runtime/human-safety-continuity.mjs.map +1 -0
  47. package/preset/odai/runtime/human-safety.d.mts +14 -0
  48. package/preset/odai/runtime/human-safety.d.mts.map +1 -0
  49. package/preset/odai/runtime/human-safety.mjs +50 -47
  50. package/preset/odai/runtime/human-safety.mjs.map +1 -0
  51. package/preset/odai/runtime/index.d.mts +8 -0
  52. package/preset/odai/runtime/index.d.mts.map +1 -0
  53. package/preset/odai/runtime/index.mjs +161 -2473
  54. package/preset/odai/runtime/index.mjs.map +1 -0
  55. package/preset/odai/runtime/lifecycle-runtime.d.mts +83 -0
  56. package/preset/odai/runtime/lifecycle-runtime.d.mts.map +1 -0
  57. package/preset/odai/runtime/lifecycle-runtime.mjs +1081 -0
  58. package/preset/odai/runtime/lifecycle-runtime.mjs.map +1 -0
  59. package/preset/odai/runtime/model-route.d.mts +22 -0
  60. package/preset/odai/runtime/model-route.d.mts.map +1 -0
  61. package/preset/odai/runtime/model-route.mjs +68 -60
  62. package/preset/odai/runtime/model-route.mjs.map +1 -0
  63. package/preset/odai/runtime/output-config.d.mts +54 -0
  64. package/preset/odai/runtime/output-config.d.mts.map +1 -0
  65. package/preset/odai/runtime/output-config.mjs +289 -315
  66. package/preset/odai/runtime/output-config.mjs.map +1 -0
  67. package/preset/odai/runtime/output-policy-state.d.mts +3 -0
  68. package/preset/odai/runtime/output-policy-state.d.mts.map +1 -0
  69. package/preset/odai/runtime/output-policy-state.mjs +41 -29
  70. package/preset/odai/runtime/output-policy-state.mjs.map +1 -0
  71. package/preset/odai/runtime/prompt-runtime.d.mts +55 -0
  72. package/preset/odai/runtime/prompt-runtime.d.mts.map +1 -0
  73. package/preset/odai/runtime/prompt-runtime.mjs +303 -0
  74. package/preset/odai/runtime/prompt-runtime.mjs.map +1 -0
  75. package/preset/odai/runtime/research-packet.d.mts +30 -0
  76. package/preset/odai/runtime/research-packet.d.mts.map +1 -0
  77. package/preset/odai/runtime/research-packet.mjs +116 -117
  78. package/preset/odai/runtime/research-packet.mjs.map +1 -0
  79. package/preset/odai/runtime/responsibility-gap.d.mts +26 -0
  80. package/preset/odai/runtime/responsibility-gap.d.mts.map +1 -0
  81. package/preset/odai/runtime/responsibility-gap.mjs +91 -85
  82. package/preset/odai/runtime/responsibility-gap.mjs.map +1 -0
  83. package/preset/odai/runtime/responsibility-scope.d.mts +69 -0
  84. package/preset/odai/runtime/responsibility-scope.d.mts.map +1 -0
  85. package/preset/odai/runtime/responsibility-scope.mjs +199 -171
  86. package/preset/odai/runtime/responsibility-scope.mjs.map +1 -0
  87. package/preset/odai/runtime/role-overlays.d.mts +5 -0
  88. package/preset/odai/runtime/role-overlays.d.mts.map +1 -0
  89. package/preset/odai/runtime/role-overlays.mjs +14 -13
  90. package/preset/odai/runtime/role-overlays.mjs.map +1 -0
  91. package/preset/odai/runtime/route-card.d.mts +42 -0
  92. package/preset/odai/runtime/route-card.d.mts.map +1 -0
  93. package/preset/odai/runtime/route-card.mjs +158 -146
  94. package/preset/odai/runtime/route-card.mjs.map +1 -0
  95. package/preset/odai/runtime/router.d.mts +79 -0
  96. package/preset/odai/runtime/router.d.mts.map +1 -0
  97. package/preset/odai/runtime/router.mjs +491 -559
  98. package/preset/odai/runtime/router.mjs.map +1 -0
  99. package/preset/odai/runtime/routing-config.d.mts +76 -0
  100. package/preset/odai/runtime/routing-config.d.mts.map +1 -0
  101. package/preset/odai/runtime/routing-config.mjs +373 -438
  102. package/preset/odai/runtime/routing-config.mjs.map +1 -0
  103. package/preset/odai/runtime/routing-context.d.mts +47 -0
  104. package/preset/odai/runtime/routing-context.d.mts.map +1 -0
  105. package/preset/odai/runtime/routing-context.mjs +238 -273
  106. package/preset/odai/runtime/routing-context.mjs.map +1 -0
  107. package/preset/odai/runtime/runtime-config.d.mts +24 -0
  108. package/preset/odai/runtime/runtime-config.d.mts.map +1 -0
  109. package/preset/odai/runtime/runtime-config.mjs +181 -0
  110. package/preset/odai/runtime/runtime-config.mjs.map +1 -0
  111. package/preset/odai/runtime/runtime-support.d.mts +91 -0
  112. package/preset/odai/runtime/runtime-support.d.mts.map +1 -0
  113. package/preset/odai/runtime/runtime-support.mjs +371 -0
  114. package/preset/odai/runtime/runtime-support.mjs.map +1 -0
  115. package/preset/odai/runtime/runtime-types.d.mts +235 -0
  116. package/preset/odai/runtime/runtime-types.d.mts.map +1 -0
  117. package/preset/odai/runtime/runtime-types.mjs +4 -0
  118. package/preset/odai/runtime/runtime-types.mjs.map +1 -0
  119. package/preset/odai/runtime/semantic-memory-store.d.mts +110 -0
  120. package/preset/odai/runtime/semantic-memory-store.d.mts.map +1 -0
  121. package/preset/odai/runtime/semantic-memory-store.mjs +271 -385
  122. package/preset/odai/runtime/semantic-memory-store.mjs.map +1 -0
  123. package/preset/odai/runtime/semantic-memory.d.mts +88 -0
  124. package/preset/odai/runtime/semantic-memory.d.mts.map +1 -0
  125. package/preset/odai/runtime/semantic-memory.mjs +790 -750
  126. package/preset/odai/runtime/semantic-memory.mjs.map +1 -0
  127. package/preset/odai/runtime/session-compat.d.mts +31 -0
  128. package/preset/odai/runtime/session-compat.d.mts.map +1 -0
  129. package/preset/odai/runtime/session-compat.mjs +301 -328
  130. package/preset/odai/runtime/session-compat.mjs.map +1 -0
  131. package/preset/odai/runtime/session-evidence.d.mts +25 -0
  132. package/preset/odai/runtime/session-evidence.d.mts.map +1 -0
  133. package/preset/odai/runtime/session-evidence.mjs +309 -287
  134. package/preset/odai/runtime/session-evidence.mjs.map +1 -0
  135. package/preset/odai/runtime/skill-bundle.d.mts +53 -0
  136. package/preset/odai/runtime/skill-bundle.d.mts.map +1 -0
  137. package/preset/odai/runtime/skill-bundle.mjs +286 -276
  138. package/preset/odai/runtime/skill-bundle.mjs.map +1 -0
  139. package/preset/odai/runtime/skill-evolution.d.mts +112 -0
  140. package/preset/odai/runtime/skill-evolution.d.mts.map +1 -0
  141. package/preset/odai/runtime/skill-evolution.mjs +1287 -1261
  142. package/preset/odai/runtime/skill-evolution.mjs.map +1 -0
  143. package/preset/odai/runtime/skill-selection-state.d.mts +5 -0
  144. package/preset/odai/runtime/skill-selection-state.d.mts.map +1 -0
  145. package/preset/odai/runtime/skill-selection-state.mjs +59 -43
  146. package/preset/odai/runtime/skill-selection-state.mjs.map +1 -0
  147. package/preset/odai/runtime/skill-selector.d.mts +28 -0
  148. package/preset/odai/runtime/skill-selector.d.mts.map +1 -0
  149. package/preset/odai/runtime/skill-selector.mjs +100 -109
  150. package/preset/odai/runtime/skill-selector.mjs.map +1 -0
  151. package/preset/odai/runtime/skill-source-config.d.mts +32 -0
  152. package/preset/odai/runtime/skill-source-config.d.mts.map +1 -0
  153. package/preset/odai/runtime/skill-source-config.mjs +200 -210
  154. package/preset/odai/runtime/skill-source-config.mjs.map +1 -0
  155. package/preset/odai/runtime/store-lock.d.mts +2 -0
  156. package/preset/odai/runtime/store-lock.d.mts.map +1 -0
  157. package/preset/odai/runtime/store-lock.mjs +92 -87
  158. package/preset/odai/runtime/store-lock.mjs.map +1 -0
  159. package/preset/odai/runtime/tool-runtime.d.mts +43 -0
  160. package/preset/odai/runtime/tool-runtime.d.mts.map +1 -0
  161. package/preset/odai/runtime/tool-runtime.mjs +221 -0
  162. package/preset/odai/runtime/tool-runtime.mjs.map +1 -0
  163. package/bin/odai-dsh-agent.mjs +0 -108
  164. package/scripts/verify-agent-load.mjs +0 -260
  165. package/src/dsh-version.mjs +0 -24
  166. package/src/installer.mjs +0 -385
package/README.md CHANGED
@@ -13,7 +13,7 @@ $DSH_HOME/.agent-presets/odai/
13
13
  .odai-agent.json
14
14
  ```
15
15
 
16
- The source composition preserves every capability row and setting from the `standard` agent surface in `@deepseek-ai/dsh@0.1.0-rc.8`, then adds the scoped Odai runtime in default `auto` mode. For rc.7, the installer restores that release's optional-provider wording before hashing and publishing the managed preset; rc.6 is no longer supported as of `0.2.5`. Release verification compares each rendered composition against its exact DSH Standard source; a missing, added, reordered, or changed Standard row fails the probe. Host-owned persistence, sandbox, approval, registries, and base controller selection remain in the selected DSH profile. Ordinary requests stay on that controller. Responsibility words are optional signals rather than commands: evidence-grounded task-state gaps route at any step, identical gaps are consumed once, and an identical planner/controller model remains inline without another model call. An original request that already authorizes implementation automatically continues from a frozen planner card to executor; plan-only, new-task, expanded-scope, and unknown authorization cannot do so. Reviewer children require a current hash-addressed evidence packet whose diff and latest successful test are newer than the last write. An incomplete packet keeps the current controller route so it can gather project-available evidence without claiming independent acceptance or terminating the authorized task. Every route is resolved before provider I/O; deterministic invalid persisted mappings are backed up and exact-match removed, while recoverable provider failures preserve them. Frontend route failure becomes an explicit local controller fallback without a routed receipt. `execute` remains an explicit comparison mode and `observe` changes no model or child while retaining fail-closed high-impact protection. Configured compaction streams are buffered so partial failed output cannot contaminate the inherited-route retry or replace original history.
16
+ The source composition preserves every capability row and setting from the `standard` agent surface in `@deepseek-ai/dsh@0.1.1-rc.1`, then adds the scoped Odai runtime in default `auto` mode. The rc.1 Standard composition is byte-identical to rc.8; for rc.7, the installer restores that release's optional-provider wording before hashing and publishing the managed preset; rc.6 is no longer supported as of `0.2.6`. Release verification compares each rendered composition against its exact DSH Standard source; a missing, added, reordered, or changed Standard row fails the probe. Host-owned persistence, sandbox, approval, registries, and base controller selection remain in the selected DSH profile. Ordinary requests stay on that controller. Responsibility words are optional signals rather than commands: evidence-grounded task-state gaps route at any step, identical gaps are consumed once, and an identical planner/controller model remains inline without another model call. An original request that already authorizes implementation automatically continues from a frozen planner card to executor; plan-only, new-task, expanded-scope, and unknown authorization cannot do so. Reviewer children require a current hash-addressed evidence packet whose diff and latest successful test are newer than the last write. An incomplete packet keeps the current controller route so it can gather project-available evidence without claiming independent acceptance or terminating the authorized task. Every route is resolved before provider I/O; deterministic invalid persisted mappings are backed up and exact-match removed, while recoverable provider failures preserve them. Frontend route failure becomes an explicit local controller fallback without a routed receipt. `execute` remains an explicit comparison mode and `observe` changes no model or child while retaining fail-closed high-impact protection. Configured compaction streams are buffered so partial failed output cannot contaminate the inherited-route retry or replace original history.
17
17
 
18
18
  The preset includes the same local long-term semantic memory runtime as the Plugin. Default `auto` mode performs no hidden model call: it automatically captures only high-confidence durable statements from the direct-human message authenticated by the latest open-turn session event, keeps ambiguous or conflicting candidates inert, and recalls only bounded active global/project records as untrusted historical context. Matching direct intent, or the compact capability gateway on a later step, exposes the controller-only `odai_memory` tool for inspection, search, confirmation, correction, physical forgetting, exact-phrase clearing, and `auto`/`off` mode changes. Recognized secrets, contact identifiers, health/crisis content, temporary instructions, hypotheses, quotes, and code are rejected; the current user and project authority always override memory. State lives at `$DSH_HOME/odai/memory/store.json`, outside `.agent-presets`, so install, update, and uninstall preserve it. An invalid or symlinked store fails closed. The matcher is not a replacement for protecting the underlying DSH session history from sensitive input.
19
19
 
@@ -31,7 +31,7 @@ With DSH already installed, run the single Agent package command below. The pack
31
31
  npx odai-dsh-agent install
32
32
  ```
33
33
 
34
- The installer checks `dsh -V` and currently accepts exactly `0.1.0-rc.7` or `0.1.0-rc.8`; `0.2.5` rejects rc.6. It records the detected version in the managed manifest and renders that release's exact Standard composition; any other developer-preview version fails closed.
34
+ The installer checks `dsh -V` and currently accepts exactly `0.1.0-rc.7` or `0.1.1-rc.1`; `0.2.6` rejects rc.6 and rc.8. It records the detected version in the managed manifest and renders that release's exact Standard composition; any other developer-preview version fails closed.
35
35
 
36
36
  `DSH_HOME` is honored. An explicit location can be supplied without changing the environment:
37
37
 
@@ -41,7 +41,7 @@ npx odai-dsh-agent install --dsh-home /path/to/dsh-home
41
41
 
42
42
  Open a new DSH session and select `Odai` from the Agent preset picker. Existing sessions retain the preset they were composed with.
43
43
 
44
- In supported DSH rc.7 and rc.8 releases, the one-shot `--profile headless` driver creates a global agent directly and neither mounts nor accepts a session Agent preset. Automated Agent runs must create a Web session with `agentPreset: odai`; use the profile-wide Plugin for one-shot headless tasks.
44
+ In supported DSH rc.7 and 0.1.1-rc.1 releases, the one-shot `--profile headless` driver creates a global agent directly and neither mounts nor accepts a session Agent preset. Automated Agent runs must create a Web session with `agentPreset: odai`; use the profile-wide Plugin for one-shot headless tasks.
45
45
 
46
46
  The installer copies through a mode-tightened staging directory and atomically publishes the preset. Updates verify every previously managed file first, refuse to overwrite local edits, and always change the composition generation key so new sessions in a running DSH process do not reuse stale runtime code. If install or update finds recognized historical Odai audit records, it refuses to change the preset until every DSH process is stopped and the command is rerun with `--yes`. The confirmed migration adds DSH's official `ignorable: true` envelope marker, covers both plaintext and concatenated-frame Zstandard session artifacts, verifies each replacement, and retains a content-addressed backup without deleting messages or evidence. Confirmation alone is insufficient: migration also refuses when local process inspection fails or finds any active DSH process. Keep DSH stopped until the installer exits because historical runtimes do not participate in a migration lock. An unknown unmarked `odai/*` type blocks the operation instead of being assumed safe to ignore.
47
47
 
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=odai-dsh-agent.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odai-dsh-agent.d.mts","sourceRoot":"","sources":["../../bin/odai-dsh-agent.mts"],"names":[],"mappings":""}
@@ -0,0 +1,114 @@
1
+ #!/usr/bin/env node
2
+ import { readDshVersion } from "../src/dsh-version.mjs";
3
+ import { inspectAgentInstallation, installAgentPreset, SUPPORTED_DSH_VERSIONS, uninstallAgentPreset, } from "../src/installer.mjs";
4
+ const HELP = `Usage: odai-dsh-agent <command> [options]
5
+
6
+ Commands:
7
+ install Install or update the managed Odai preset
8
+ status Inspect the managed Odai preset
9
+ uninstall Remove the preset when its managed files are unchanged
10
+
11
+ Options:
12
+ --dsh-home <path> Override DSH_HOME
13
+ --json Print JSON
14
+ --yes Confirm DSH is stopped; active-process verification still applies
15
+ -h, --help Show this help
16
+ `;
17
+ try {
18
+ const args = parseArgs(process.argv.slice(2));
19
+ if (args.help) {
20
+ process.stdout.write(HELP);
21
+ }
22
+ else if (args.command === "install") {
23
+ const dshVersion = assertDshVersion();
24
+ print(await installAgentPreset({
25
+ dshHome: args.dshHome,
26
+ dshVersion,
27
+ confirmDshStopped: args.yes,
28
+ }), args.json);
29
+ }
30
+ else if (args.command === "status") {
31
+ const result = await inspectAgentInstallation({ dshHome: args.dshHome });
32
+ print(result, args.json);
33
+ if (result.status === "drifted")
34
+ process.exitCode = 2;
35
+ }
36
+ else if (args.command === "uninstall") {
37
+ print(await uninstallAgentPreset({
38
+ dshHome: args.dshHome,
39
+ confirmDshStopped: args.yes,
40
+ }), args.json);
41
+ }
42
+ else {
43
+ throw new Error("a command is required\n\n" + HELP);
44
+ }
45
+ }
46
+ catch (error) {
47
+ process.stderr.write(`odai-dsh-agent: ${error instanceof Error ? error.message : String(error)}\n`);
48
+ process.exitCode = 1;
49
+ }
50
+ function assertDshVersion() {
51
+ const dsh = process.env.DSH_BIN ?? "dsh";
52
+ let actual;
53
+ try {
54
+ actual = readDshVersion({ dsh });
55
+ }
56
+ catch (error) {
57
+ throw new Error(`cannot run ${dsh} -V; install one of ${SUPPORTED_DSH_VERSIONS.join(", ")} before installing the preset`);
58
+ }
59
+ if (!SUPPORTED_DSH_VERSIONS.includes(actual)) {
60
+ throw new Error(`unsupported DSH version ${actual || "<empty>"}; expected one of ${SUPPORTED_DSH_VERSIONS.join(", ")}`);
61
+ }
62
+ return actual;
63
+ }
64
+ function parseArgs(argv) {
65
+ const parsed = { json: false, yes: false, help: false };
66
+ for (let index = 0; index < argv.length; index += 1) {
67
+ const arg = argv[index];
68
+ if (arg === "-h" || arg === "--help")
69
+ parsed.help = true;
70
+ else if (arg === "--json")
71
+ parsed.json = true;
72
+ else if (arg === "--yes")
73
+ parsed.yes = true;
74
+ else if (arg === "--dsh-home")
75
+ parsed.dshHome = argv[++index];
76
+ else if (!parsed.command && (arg === "install" || arg === "status" || arg === "uninstall"))
77
+ parsed.command = arg;
78
+ else
79
+ throw new Error(`unknown argument: ${arg}`);
80
+ }
81
+ if (parsed.dshHome !== undefined && parsed.dshHome.trim() === "") {
82
+ throw new Error("--dsh-home requires a non-empty path");
83
+ }
84
+ return parsed;
85
+ }
86
+ function print(result, json) {
87
+ if (json) {
88
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
89
+ return;
90
+ }
91
+ if (result.status) {
92
+ process.stdout.write(`${result.status}: ${result.target}\n`);
93
+ for (const issue of result.issues ?? [])
94
+ process.stdout.write(`- ${issue}\n`);
95
+ return;
96
+ }
97
+ process.stdout.write(`${result.operation}: ${result.target}\n`);
98
+ const compatibility = result.sessionCompatibility;
99
+ if ((compatibility?.repairedEvents ?? 0) > 0) {
100
+ process.stdout.write(`session compatibility: made ${compatibility?.repairedEvents ?? 0} legacy Odai event(s) ignorable in ${compatibility?.repairedArtifacts ?? 0} session artifact(s)\n`);
101
+ }
102
+ if ((compatibility?.backupPaths?.length ?? 0) > 0) {
103
+ process.stdout.write(`session compatibility: retained ${compatibility?.backupPaths.length ?? 0} verified backup artifact(s)\n`);
104
+ }
105
+ for (const path of compatibility?.tornArtifacts ?? []) {
106
+ process.stdout.write(`session compatibility warning: preserved DSH-recoverable torn tail: ${path}\n`);
107
+ }
108
+ for (const failure of compatibility?.failures ?? []) {
109
+ process.stdout.write(`session compatibility warning: ${failure.path}: ${failure.error}\n`);
110
+ }
111
+ if (result.security)
112
+ process.stdout.write(`security: ${result.security}\n`);
113
+ }
114
+ //# sourceMappingURL=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OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;AAC9E,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ChildProcess, ExecFileSyncOptionsWithStringEncoding, SpawnOptions } from "node:child_process";
2
+ type VersionExecutor = (command: string, args: string[], options: ExecFileSyncOptionsWithStringEncoding) => string;
3
+ type SpawnExecutor<TResult> = (command: string, args: readonly string[], options: SpawnOptions) => TResult;
4
+ export interface ReadDshVersionOptions {
5
+ dsh?: string;
6
+ platform?: NodeJS.Platform;
7
+ execute?: VersionExecutor;
8
+ }
9
+ export interface SpawnDshDependencies<TResult = ChildProcess> {
10
+ platform?: NodeJS.Platform;
11
+ execute?: SpawnExecutor<TResult>;
12
+ }
13
+ export declare function readDshVersion({ dsh, platform, execute, }?: ReadDshVersionOptions): string;
14
+ export declare function spawnDsh<TResult = ChildProcess>(command: string, args: readonly string[], options?: SpawnOptions, dependencies?: SpawnDshDependencies<TResult>): TResult;
15
+ export {};
16
+ //# sourceMappingURL=dsh-version.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsh-version.d.mts","sourceRoot":"","sources":["../../src/dsh-version.mts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,YAAY,EACZ,qCAAqC,EACrC,YAAY,EACb,MAAM,oBAAoB,CAAC;AAE5B,KAAK,eAAe,GAAG,CACrB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE,qCAAqC,KAC3C,MAAM,CAAC;AAEZ,KAAK,aAAa,CAAC,OAAO,IAAI,CAC5B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE,YAAY,KAClB,OAAO,CAAC;AAEb,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB,CAAC,OAAO,GAAG,YAAY;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAClC;AAED,wBAAgB,cAAc,CAAC,EAC7B,GAAkC,EAClC,QAA2B,EAC3B,OAAsB,GACvB,GAAE,qBAA0B,GAAG,MAAM,CAGrC;AAED,wBAAgB,QAAQ,CAAC,OAAO,GAAG,YAAY,EAC7C,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,YAAiB,EAC1B,YAAY,GAAE,oBAAoB,CAAC,OAAO,CAAM,GAC/C,OAAO,CAMT"}
@@ -0,0 +1,20 @@
1
+ import { execFileSync, spawn } from "node:child_process";
2
+ export function readDshVersion({ dsh = process.env.DSH_BIN ?? "dsh", platform = process.platform, execute = execFileSync, } = {}) {
3
+ const options = { encoding: "utf8" };
4
+ return execute(normalizeDshCommand(dsh, platform), ["-V"], dshProcessOptions(options, platform)).trim();
5
+ }
6
+ export function spawnDsh(command, args, options = {}, dependencies = {}) {
7
+ const platform = dependencies.platform ?? process.platform;
8
+ const command_ = normalizeDshCommand(command, platform);
9
+ const options_ = dshProcessOptions(options, platform);
10
+ if (dependencies.execute)
11
+ return dependencies.execute(command_, args, options_);
12
+ return spawn(command_, args, options_);
13
+ }
14
+ function normalizeDshCommand(command, platform) {
15
+ return platform === "win32" && command === "dsh" ? "dsh.cmd" : command;
16
+ }
17
+ function dshProcessOptions(options, platform) {
18
+ return platform === "win32" ? { ...options, shell: true } : options;
19
+ }
20
+ //# sourceMappingURL=dsh-version.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dsh-version.mjs","sourceRoot":"","sources":["../../src/dsh-version.mts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAA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I,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACtE,CAAC"}
@@ -0,0 +1,46 @@
1
+ import type { SessionCompatOptions, SessionCompatResult } from "../../runtime/build/session-compat.mjs";
2
+ export interface AgentInstallerOptions {
3
+ presetId?: string;
4
+ dshHome?: string;
5
+ sourceRoot?: string;
6
+ dshVersion?: string;
7
+ confirmDshStopped?: boolean;
8
+ processScanner?: SessionCompatOptions["processScanner"];
9
+ }
10
+ export declare const DEFAULT_PRESET_ID = "odai";
11
+ export declare const MANIFEST_FILE = ".odai-agent.json";
12
+ export declare const SUPPORTED_DSH_VERSIONS: readonly string[];
13
+ export declare const SUPPORTED_DSH_VERSION = "0.1.1-rc.1";
14
+ export declare function renderAgentCompositionForDsh(composition: string, dshVersion?: string): string;
15
+ export declare function resolveDshHome(configured?: string, env?: NodeJS.ProcessEnv): string;
16
+ export declare function inspectAgentInstallation(options?: AgentInstallerOptions): Promise<Readonly<{
17
+ status: "absent" | "installed" | "drifted";
18
+ issues: string[];
19
+ version?: string;
20
+ dshVersion?: string;
21
+ dshHome: string;
22
+ presetId: string;
23
+ target: string;
24
+ }>>;
25
+ export declare function installAgentPreset(options?: AgentInstallerOptions): Promise<Readonly<{
26
+ operation: "installed" | "updated";
27
+ dshHome: string;
28
+ presetId: string;
29
+ target: string;
30
+ version: string;
31
+ dshVersion: string;
32
+ trust: "user";
33
+ security: "DSH user presets have the same privileges as shell access; install only reviewed preset code.";
34
+ sessionCompatibility: SessionCompatResult;
35
+ }>>;
36
+ export declare function uninstallAgentPreset(options?: AgentInstallerOptions): Promise<Readonly<{
37
+ operation: "absent";
38
+ target: string;
39
+ presetId: string;
40
+ }> | Readonly<{
41
+ operation: "uninstalled";
42
+ target: string;
43
+ presetId: string;
44
+ sessionCompatibility: SessionCompatResult;
45
+ }>>;
46
+ //# sourceMappingURL=installer.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installer.d.mts","sourceRoot":"","sources":["../../src/installer.mts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACV,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,wCAAwC,CAAC;AAQhD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;CACzD;AAgCD,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,aAAa,qBAAqB,CAAC;AAqBhD,eAAO,MAAM,sBAAsB,mBAElC,CAAC;AAgBF,eAAO,MAAM,qBAAqB,eAAqB,CAAC;AAwBxD,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,SAAwB,GAAG,MAAM,CAkB5G;AAED,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAShG;AAED,wBAAsB,wBAAwB,CAAC,OAAO,GAAE,qBAA0B;YAnHxE,QAAQ,GAAG,WAAW,GAAG,SAAS;YAClC,MAAM,EAAE;cACN,MAAM;iBACH,MAAM;;;;IAsHpB;AAED,wBAAsB,kBAAkB,CAAC,OAAO,GAAE,qBAA0B;;;;;;;;;;IAsF3E;AAED,wBAAsB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B;;;;;;;;;IAyB7E"}