odai-dsh-agent 0.1.0 → 0.2.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.
- package/LICENSE +21 -21
- package/README.md +134 -132
- package/bin/odai-dsh-agent.mjs +108 -106
- package/package.json +69 -69
- package/preset/odai/agent.cordis.yml +260 -260
- package/preset/odai/preset.yml +3 -3
- package/preset/odai/runtime/compaction-config.mjs +388 -357
- package/preset/odai/runtime/governance.mjs +121 -121
- package/preset/odai/runtime/human-safety-continuity-store.mjs +254 -0
- package/preset/odai/runtime/human-safety-continuity.mjs +259 -0
- package/preset/odai/runtime/human-safety.mjs +50 -0
- package/preset/odai/runtime/index.mjs +1977 -1486
- package/preset/odai/runtime/model-route.mjs +80 -0
- package/preset/odai/runtime/output-config.mjs +304 -304
- package/preset/odai/runtime/research-packet.mjs +150 -150
- package/preset/odai/runtime/responsibility-gap.mjs +101 -0
- package/preset/odai/runtime/role-overlays.mjs +27 -27
- package/preset/odai/runtime/route-card.mjs +152 -125
- package/preset/odai/runtime/router.mjs +651 -516
- package/preset/odai/runtime/routing-config.mjs +436 -400
- package/preset/odai/runtime/routing-context.mjs +321 -209
- package/preset/odai/runtime/semantic-memory-store.mjs +452 -452
- package/preset/odai/runtime/semantic-memory.mjs +842 -840
- package/preset/odai/runtime/session-compat.mjs +389 -389
- package/preset/odai/runtime/skill-bundle.mjs +318 -318
- package/preset/odai/runtime/skill-evolution.mjs +1413 -1413
- package/preset/odai/skills/odai/SKILL.md +68 -66
- package/preset/odai/skills/odai/agents/openai.yaml +4 -4
- package/preset/odai/skills/odai/assets/claude-agents/agent.md +11 -11
- package/preset/odai/skills/odai/assets/codex-agents/config.toml +11 -11
- package/preset/odai/skills/odai/assets/codex-agents/role.toml +5 -5
- package/preset/odai/skills/odai/assets/copilot-agents/agent.md +13 -13
- package/preset/odai/skills/odai/assets/hooks-policy.example.json +24 -24
- package/preset/odai/skills/odai/assets/routing-roles/controller.md +15 -15
- package/preset/odai/skills/odai/assets/routing-roles/executor.md +11 -11
- package/preset/odai/skills/odai/assets/routing-roles/frontend.md +7 -7
- package/preset/odai/skills/odai/assets/routing-roles/planner.md +29 -29
- package/preset/odai/skills/odai/assets/routing-roles/researcher.md +6 -6
- package/preset/odai/skills/odai/assets/routing-roles/reviewer.md +11 -11
- package/preset/odai/skills/odai/assets/task-state.md +14 -14
- package/preset/odai/skills/odai/manifest.json +36 -35
- package/preset/odai/skills/odai/references/craft.md +54 -54
- package/preset/odai/skills/odai/references/dao.md +30 -30
- package/preset/odai/skills/odai/references/human-safety.md +91 -0
- package/preset/odai/skills/odai/references/leverage.md +53 -51
- package/preset/odai/skills/odai/references/planning.md +82 -82
- package/preset/odai/skills/odai/references/support.md +36 -36
- package/preset/odai/skills/odai/references/verification.md +23 -23
- package/preset/odai/skills/odai/scripts/build-hooks.mjs +273 -273
- package/preset/odai/skills/odai/scripts/build-routing.mjs +274 -274
- package/preset/odai/skills/odai/scripts/install-routing.mjs +397 -397
- package/preset/odai/skills/odai/scripts/odai-hook.mjs +457 -457
- package/preset/odai/skills/odai/scripts/run-role.mjs +336 -336
- package/preset/odai/skills/odai/scripts/run-routing.mjs +1154 -1154
- package/preset/odai/skills/odai/scripts/verify-routing.mjs +103 -103
- package/scripts/verify-agent-load.mjs +257 -246
- package/src/installer.mjs +382 -329
package/bin/odai-dsh-agent.mjs
CHANGED
|
@@ -1,106 +1,108 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { readDshVersion } from "../src/dsh-version.mjs";
|
|
4
|
-
import {
|
|
5
|
-
inspectAgentInstallation,
|
|
6
|
-
installAgentPreset,
|
|
7
|
-
|
|
8
|
-
uninstallAgentPreset,
|
|
9
|
-
} from "../src/installer.mjs";
|
|
10
|
-
|
|
11
|
-
const HELP = `Usage: odai-dsh-agent <command> [options]
|
|
12
|
-
|
|
13
|
-
Commands:
|
|
14
|
-
install Install or update the managed Odai preset
|
|
15
|
-
status Inspect the managed Odai preset
|
|
16
|
-
uninstall Remove the preset when its managed files are unchanged
|
|
17
|
-
|
|
18
|
-
Options:
|
|
19
|
-
--dsh-home <path> Override DSH_HOME
|
|
20
|
-
--json Print JSON
|
|
21
|
-
--yes Confirm DSH is stopped; active-process verification still applies
|
|
22
|
-
-h, --help Show this help
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
const args = parseArgs(process.argv.slice(2));
|
|
27
|
-
if (args.help) {
|
|
28
|
-
process.stdout.write(HELP);
|
|
29
|
-
} else if (args.command === "install") {
|
|
30
|
-
assertDshVersion();
|
|
31
|
-
print(await installAgentPreset({
|
|
32
|
-
dshHome: args.dshHome,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
process.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
else if (arg === "--
|
|
73
|
-
else if (
|
|
74
|
-
else
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { readDshVersion } from "../src/dsh-version.mjs";
|
|
4
|
+
import {
|
|
5
|
+
inspectAgentInstallation,
|
|
6
|
+
installAgentPreset,
|
|
7
|
+
SUPPORTED_DSH_VERSIONS,
|
|
8
|
+
uninstallAgentPreset,
|
|
9
|
+
} from "../src/installer.mjs";
|
|
10
|
+
|
|
11
|
+
const HELP = `Usage: odai-dsh-agent <command> [options]
|
|
12
|
+
|
|
13
|
+
Commands:
|
|
14
|
+
install Install or update the managed Odai preset
|
|
15
|
+
status Inspect the managed Odai preset
|
|
16
|
+
uninstall Remove the preset when its managed files are unchanged
|
|
17
|
+
|
|
18
|
+
Options:
|
|
19
|
+
--dsh-home <path> Override DSH_HOME
|
|
20
|
+
--json Print JSON
|
|
21
|
+
--yes Confirm DSH is stopped; active-process verification still applies
|
|
22
|
+
-h, --help Show this help
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
try {
|
|
26
|
+
const args = parseArgs(process.argv.slice(2));
|
|
27
|
+
if (args.help) {
|
|
28
|
+
process.stdout.write(HELP);
|
|
29
|
+
} else if (args.command === "install") {
|
|
30
|
+
const dshVersion = assertDshVersion();
|
|
31
|
+
print(await installAgentPreset({
|
|
32
|
+
dshHome: args.dshHome,
|
|
33
|
+
dshVersion,
|
|
34
|
+
confirmDshStopped: args.yes,
|
|
35
|
+
}), args.json);
|
|
36
|
+
} else if (args.command === "status") {
|
|
37
|
+
const result = await inspectAgentInstallation({ dshHome: args.dshHome });
|
|
38
|
+
print(result, args.json);
|
|
39
|
+
if (result.status === "drifted") process.exitCode = 2;
|
|
40
|
+
} else if (args.command === "uninstall") {
|
|
41
|
+
print(await uninstallAgentPreset({
|
|
42
|
+
dshHome: args.dshHome,
|
|
43
|
+
confirmDshStopped: args.yes,
|
|
44
|
+
}), args.json);
|
|
45
|
+
} else {
|
|
46
|
+
throw new Error("a command is required\n\n" + HELP);
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
process.stderr.write(`odai-dsh-agent: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function assertDshVersion() {
|
|
54
|
+
const dsh = process.env.DSH_BIN ?? "dsh";
|
|
55
|
+
let actual;
|
|
56
|
+
try {
|
|
57
|
+
actual = readDshVersion({ dsh });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
throw new Error(`cannot run ${dsh} -V; install one of ${SUPPORTED_DSH_VERSIONS.join(", ")} before installing the preset`);
|
|
60
|
+
}
|
|
61
|
+
if (!SUPPORTED_DSH_VERSIONS.includes(actual)) {
|
|
62
|
+
throw new Error(`unsupported DSH version ${actual || "<empty>"}; expected one of ${SUPPORTED_DSH_VERSIONS.join(", ")}`);
|
|
63
|
+
}
|
|
64
|
+
return actual;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function parseArgs(argv) {
|
|
68
|
+
const parsed = { command: undefined, dshHome: undefined, json: false, yes: false, help: false };
|
|
69
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
70
|
+
const arg = argv[index];
|
|
71
|
+
if (arg === "-h" || arg === "--help") parsed.help = true;
|
|
72
|
+
else if (arg === "--json") parsed.json = true;
|
|
73
|
+
else if (arg === "--yes") parsed.yes = true;
|
|
74
|
+
else if (arg === "--dsh-home") parsed.dshHome = argv[++index];
|
|
75
|
+
else if (!parsed.command && ["install", "status", "uninstall"].includes(arg)) parsed.command = arg;
|
|
76
|
+
else throw new Error(`unknown argument: ${arg}`);
|
|
77
|
+
}
|
|
78
|
+
if (parsed.dshHome !== undefined && (typeof parsed.dshHome !== "string" || parsed.dshHome.trim() === "")) {
|
|
79
|
+
throw new Error("--dsh-home requires a non-empty path");
|
|
80
|
+
}
|
|
81
|
+
return parsed;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function print(result, json) {
|
|
85
|
+
if (json) {
|
|
86
|
+
process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (result.status) {
|
|
90
|
+
process.stdout.write(`${result.status}: ${result.target}\n`);
|
|
91
|
+
for (const issue of result.issues ?? []) process.stdout.write(`- ${issue}\n`);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
process.stdout.write(`${result.operation}: ${result.target}\n`);
|
|
95
|
+
if (result.sessionCompatibility?.repairedEvents > 0) {
|
|
96
|
+
process.stdout.write(`session compatibility: made ${result.sessionCompatibility.repairedEvents} legacy Odai event(s) ignorable in ${result.sessionCompatibility.repairedArtifacts} session artifact(s)\n`);
|
|
97
|
+
}
|
|
98
|
+
if (result.sessionCompatibility?.backupPaths?.length > 0) {
|
|
99
|
+
process.stdout.write(`session compatibility: retained ${result.sessionCompatibility.backupPaths.length} verified backup artifact(s)\n`);
|
|
100
|
+
}
|
|
101
|
+
for (const path of result.sessionCompatibility?.tornArtifacts ?? []) {
|
|
102
|
+
process.stdout.write(`session compatibility warning: preserved DSH-recoverable torn tail: ${path}\n`);
|
|
103
|
+
}
|
|
104
|
+
for (const failure of result.sessionCompatibility?.failures ?? []) {
|
|
105
|
+
process.stdout.write(`session compatibility warning: ${failure.path}: ${failure.error}\n`);
|
|
106
|
+
}
|
|
107
|
+
if (result.security) process.stdout.write(`security: ${result.security}\n`);
|
|
108
|
+
}
|
package/package.json
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "odai-dsh-agent",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "完整继承 DSH 标准模式 全部能力的 Odai Agent preset。主要用于治理、规划、测试、验证 等,可当成默认总控使用。",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/orziz/odai.git",
|
|
9
|
-
"directory": "dsh/agent"
|
|
10
|
-
},
|
|
11
|
-
"homepage": "https://github.com/orziz/odai#readme",
|
|
12
|
-
"bugs": {
|
|
13
|
-
"url": "https://github.com/orziz/odai/issues"
|
|
14
|
-
},
|
|
15
|
-
"type": "module",
|
|
16
|
-
"main": "./src/installer.mjs",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": "./src/installer.mjs",
|
|
19
|
-
"./package.json": "./package.json"
|
|
20
|
-
},
|
|
21
|
-
"bin": {
|
|
22
|
-
"odai-dsh-agent": "./bin/odai-dsh-agent.mjs"
|
|
23
|
-
},
|
|
24
|
-
"publishConfig": {
|
|
25
|
-
"registry": "https://registry.npmjs.org/",
|
|
26
|
-
"access": "public"
|
|
27
|
-
},
|
|
28
|
-
"files": [
|
|
29
|
-
"bin",
|
|
30
|
-
"src",
|
|
31
|
-
"scripts/verify-agent-load.mjs",
|
|
32
|
-
"preset",
|
|
33
|
-
"README.md",
|
|
34
|
-
"LICENSE"
|
|
35
|
-
],
|
|
36
|
-
"scripts": {
|
|
37
|
-
"check": "find bin src scripts tests -name '*.mjs' -print0 | xargs -0 -n1 node --check",
|
|
38
|
-
"prepare:artifact": "node ../../scripts/package-odai-artifact.mjs prepare --skill-root preset/odai/skills --runtime-root preset/odai/runtime",
|
|
39
|
-
"clean:artifact": "node ../../scripts/package-odai-artifact.mjs clean --skill-root preset/odai/skills --runtime-root preset/odai/runtime",
|
|
40
|
-
"prepare": "npm run prepare:artifact",
|
|
41
|
-
"verify:version": "node ../../scripts/verify-dsh-package-versions.mjs",
|
|
42
|
-
"prepack": "npm run verify:version && node ../../scripts/validate-odai-skill.mjs",
|
|
43
|
-
"postpack": "npm run clean:artifact",
|
|
44
|
-
"pack:dry-run": "node ../../scripts/run-package-pack.mjs --clean preset/odai/runtime --clean preset/odai/skills -- --dry-run",
|
|
45
|
-
"test": "npm run verify:version && node --test ./tests/*.test.mjs",
|
|
46
|
-
"verify:dsh": "node ./scripts/verify-agent-load.mjs"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"yaml": "^2.8.1"
|
|
50
|
-
},
|
|
51
|
-
"peerDependencies": {
|
|
52
|
-
"@deepseek-ai/dsh": "0.1.0-rc.6"
|
|
53
|
-
},
|
|
54
|
-
"peerDependenciesMeta": {
|
|
55
|
-
"@deepseek-ai/dsh": {
|
|
56
|
-
"optional": true
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"engines": {
|
|
60
|
-
"node": ">=22.15.0"
|
|
61
|
-
},
|
|
62
|
-
"keywords": [
|
|
63
|
-
"agent",
|
|
64
|
-
"deepseek-harness",
|
|
65
|
-
"dsh",
|
|
66
|
-
"odai",
|
|
67
|
-
"preset"
|
|
68
|
-
]
|
|
69
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "odai-dsh-agent",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "完整继承 DSH 标准模式 全部能力的 Odai Agent preset。主要用于治理、规划、测试、验证 等,可当成默认总控使用。",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/orziz/odai.git",
|
|
9
|
+
"directory": "dsh/agent"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/orziz/odai#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/orziz/odai/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./src/installer.mjs",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": "./src/installer.mjs",
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"odai-dsh-agent": "./bin/odai-dsh-agent.mjs"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"registry": "https://registry.npmjs.org/",
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"bin",
|
|
30
|
+
"src",
|
|
31
|
+
"scripts/verify-agent-load.mjs",
|
|
32
|
+
"preset",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"check": "find bin src scripts tests -name '*.mjs' -print0 | xargs -0 -n1 node --check",
|
|
38
|
+
"prepare:artifact": "node ../../scripts/package-odai-artifact.mjs prepare --skill-root preset/odai/skills --runtime-root preset/odai/runtime",
|
|
39
|
+
"clean:artifact": "node ../../scripts/package-odai-artifact.mjs clean --skill-root preset/odai/skills --runtime-root preset/odai/runtime",
|
|
40
|
+
"prepare": "npm run prepare:artifact",
|
|
41
|
+
"verify:version": "node ../../scripts/verify-dsh-package-versions.mjs",
|
|
42
|
+
"prepack": "npm run verify:version && node ../../scripts/validate-odai-skill.mjs",
|
|
43
|
+
"postpack": "npm run clean:artifact",
|
|
44
|
+
"pack:dry-run": "node ../../scripts/run-package-pack.mjs --clean preset/odai/runtime --clean preset/odai/skills -- --dry-run",
|
|
45
|
+
"test": "npm run verify:version && node --test ./tests/*.test.mjs",
|
|
46
|
+
"verify:dsh": "node ./scripts/verify-agent-load.mjs"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"yaml": "^2.8.1"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"@deepseek-ai/dsh": "0.1.0-rc.6 || 0.1.0-rc.7"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"@deepseek-ai/dsh": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=22.15.0"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"agent",
|
|
64
|
+
"deepseek-harness",
|
|
65
|
+
"dsh",
|
|
66
|
+
"odai",
|
|
67
|
+
"preset"
|
|
68
|
+
]
|
|
69
|
+
}
|