@lmzhen/dsh-evolution-core 0.49.0 → 0.51.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/lib/authority-plugin.js +2 -1
- package/lib/citations-CZKTUGQF.js +198 -0
- package/lib/composition/index.js +3 -3
- package/lib/{composition-Cqjbho0t.js → composition-CtNbVHq3.js} +1 -1
- package/lib/connection-DAJy7Xjm.js +28 -0
- package/lib/{ensure-CAjLGd9f.js → ensure-BLmEW0Ju.js} +25 -7
- package/lib/errors.js +2 -0
- package/lib/extract-plan-D6o__2Kf.js +271 -0
- package/lib/extract.js +240 -0
- package/lib/http-routes.js +27 -7
- package/lib/index.js +100 -811
- package/lib/{numeric-D8js3sqC.js → limits-C9jfvxBl.js} +1 -43
- package/lib/{mutation-authority-l57R626O.js → mutation-authority-DQfpXs1O.js} +2 -54
- package/lib/numeric-Dc53KQoe.js +43 -0
- package/lib/platform/index.js +4 -3
- package/lib/platform-DyHnHUmQ.js +251 -0
- package/lib/policy.js +3 -2
- package/lib/quality-DpAS0rd9.js +554 -0
- package/lib/restrictor.js +1 -1
- package/lib/result.js +33 -0
- package/lib/runtime/plugin.js +97 -43
- package/lib/{session-projection-DSXnUNZG.js → session-projection-ByNxQi9O.js} +2 -198
- package/lib/skill-health-BQCM4N8z.js +1419 -0
- package/lib/{skill-history-CxrDE3Rb.js → skill-history-CZp8vhyL.js} +46 -2
- package/lib/skills.js +140 -20
- package/lib/state-store-Jpa-iYIZ.js +54 -0
- package/lib/subagent/index.js +214 -176
- package/lib/{tools-DzcNFex2.js → tools-BrUswg8v.js} +3 -1
- package/lib/types/composition/ensure.js +21 -7
- package/lib/types/composition/preset-ids.d.ts +2 -1
- package/lib/types/composition/preset-ids.js +7 -1
- package/lib/types/events.d.ts +3 -0
- package/lib/types/extract-plan.d.ts +2 -0
- package/lib/types/extract.d.ts +12 -0
- package/lib/types/extract.js +12 -0
- package/lib/types/http-routes.js +32 -9
- package/lib/types/index.d.ts +0 -3
- package/lib/types/index.js +0 -3
- package/lib/types/opt-in.js +4 -3
- package/lib/types/params.js +2 -1
- package/lib/types/platform/agents.d.ts +32 -0
- package/lib/types/platform/agents.js +26 -0
- package/lib/types/platform/commands.d.ts +14 -0
- package/lib/types/platform/commands.js +9 -0
- package/lib/types/platform/connection.d.ts +26 -0
- package/lib/types/platform/connection.js +27 -0
- package/lib/types/platform/index.d.ts +26 -0
- package/lib/types/platform/index.js +13 -0
- package/lib/types/platform/llm.d.ts +3 -1
- package/lib/types/platform/llm.js +1 -0
- package/lib/types/platform/platformView.d.ts +21 -0
- package/lib/types/platform/platformView.js +29 -0
- package/lib/types/platform/profileContext.d.ts +16 -0
- package/lib/types/platform/profileContext.js +14 -0
- package/lib/types/platform/sessionQuery.d.ts +14 -0
- package/lib/types/platform/sessionQuery.js +9 -0
- package/lib/types/platform/settings.d.ts +22 -0
- package/lib/types/platform/settings.js +14 -0
- package/lib/types/platform/skills.d.ts +16 -0
- package/lib/types/platform/skills.js +9 -0
- package/lib/types/platform/storageDomain.d.ts +13 -0
- package/lib/types/platform/storageDomain.js +9 -0
- package/lib/types/platform/subagents.d.ts +25 -0
- package/lib/types/platform/subagents.js +17 -0
- package/lib/types/platform/systemPrompt.d.ts +16 -0
- package/lib/types/platform/systemPrompt.js +13 -0
- package/lib/types/platform/tools.d.ts +4 -0
- package/lib/types/platform/tools.js +2 -0
- package/lib/types/platform/userQuestions.d.ts +33 -0
- package/lib/types/platform/userQuestions.js +9 -0
- package/lib/types/platform/workingDirectory.d.ts +14 -0
- package/lib/types/platform/workingDirectory.js +9 -0
- package/lib/types/platform-line.generated.d.ts +5 -5
- package/lib/types/platform-line.generated.js +5 -5
- package/lib/types/platform-services.js +4 -0
- package/lib/types/prompts.d.ts +9 -8
- package/lib/types/prompts.js +20 -1
- package/lib/types/result.d.ts +35 -0
- package/lib/types/result.js +25 -0
- package/lib/types/review-context.d.ts +8 -0
- package/lib/types/review-context.js +11 -0
- package/lib/types/run-registry.d.ts +2 -1
- package/lib/types/run-registry.js +37 -7
- package/lib/types/runtime/llm.d.ts +2 -2
- package/lib/types/runtime/llm.js +5 -8
- package/lib/types/runtime/platform.d.ts +37 -4
- package/lib/types/runtime/platform.js +40 -5
- package/lib/types/runtime/projections.d.ts +9 -4
- package/lib/types/runtime/projections.js +64 -28
- package/lib/types/section-selection.js +5 -0
- package/lib/types/skill-history.d.ts +29 -3
- package/lib/types/skill-history.js +30 -0
- package/lib/types/skill-store.d.ts +32 -4
- package/lib/types/skill-store.js +109 -15
- package/lib/types/subagent/channel.d.ts +1 -3
- package/lib/types/subagent/channel.js +2 -332
- package/lib/types/subagent/index.d.ts +2 -0
- package/lib/types/subagent/index.js +2 -0
- package/lib/types/subagent/kernel.d.ts +4 -0
- package/lib/types/subagent/kernel.js +234 -0
- package/lib/types/subagent/readiness.js +5 -7
- package/lib/types/subagent/run.d.ts +53 -0
- package/lib/types/subagent/run.js +125 -0
- package/lib/types/subagent/types.d.ts +3 -3
- package/lib/types/write-gates.js +11 -1
- package/lib/usage-B5a90TKv.js +1257 -0
- package/lib/write.js +1 -1
- package/package.json +37 -25
- package/lib/platform-Cc9cNt5j.js +0 -111
- package/lib/skill-health-DP8z9TPf.js +0 -2923
package/lib/write.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as contentHash } from "./mutations-DQXddSJd.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as writeUnitReceipt, A as pruneTreeChangeUnits, B as UNIT_STORAGE_SCHEMA_VERSION, F as assertUnitJournalTransition, G as unitEvidencePath, H as readUnitIndex, I as readUnitJournal, J as unitSnapshotPath, K as unitIndexPath, L as unitJournalPath, M as unitSnapshotPort, N as UNIT_JOURNAL_PHASES, P as UNIT_JOURNAL_SCHEMA_VERSION, Q as writeUnitEvidence, R as unitJournalPhaseRank, U as readUnitReceipt, V as readUnitEvidence, W as readUnitSnapshot, X as unitStorageKey, Y as unitSnapshotsDir, Z as upsertUnitIndex, et as writeUnitSnapshot, it as WriteKernel, j as unitJournalPort, nt as fileMutationLock, p as entryTarget, q as unitReceiptPath, rt as validateMutationRequest, tt as MutationUnit, z as writeUnitJournal } from "./skill-history-CZp8vhyL.js";
|
|
3
3
|
//#region lib/types/unit-undo.js
|
|
4
4
|
/**
|
|
5
5
|
* Cross-skill unit undo executor.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-core",
|
|
3
3
|
"description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.51.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -59,6 +59,18 @@
|
|
|
59
59
|
"types": "./lib/types/contract.d.ts",
|
|
60
60
|
"default": "./lib/contract.js"
|
|
61
61
|
},
|
|
62
|
+
"./result": {
|
|
63
|
+
"types": "./lib/types/result.d.ts",
|
|
64
|
+
"default": "./lib/result.js"
|
|
65
|
+
},
|
|
66
|
+
"./errors": {
|
|
67
|
+
"types": "./lib/types/errors.d.ts",
|
|
68
|
+
"default": "./lib/errors.js"
|
|
69
|
+
},
|
|
70
|
+
"./extract": {
|
|
71
|
+
"types": "./lib/types/extract.d.ts",
|
|
72
|
+
"default": "./lib/extract.js"
|
|
73
|
+
},
|
|
62
74
|
"./io-registry": {
|
|
63
75
|
"types": "./lib/types/io-registry.d.ts",
|
|
64
76
|
"default": "./lib/io-registry.js"
|
|
@@ -86,7 +98,7 @@
|
|
|
86
98
|
],
|
|
87
99
|
"license": "MIT",
|
|
88
100
|
"dependencies": {
|
|
89
|
-
"@deepseek-ai/dsh-atomic-write": "^0.2.2-rc.
|
|
101
|
+
"@deepseek-ai/dsh-atomic-write": "^0.2.2-rc.3",
|
|
90
102
|
"js-yaml": "^4.1.0",
|
|
91
103
|
"yaml": "^2.4.2",
|
|
92
104
|
"zod": "^4.4.3",
|
|
@@ -94,35 +106,35 @@
|
|
|
94
106
|
},
|
|
95
107
|
"peerDependencies": {
|
|
96
108
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
97
|
-
"@deepseek-ai/dsh-scope": "^0.2.2-rc.
|
|
98
|
-
"@deepseek-ai/dsh-session": "^0.2.2-rc.
|
|
99
|
-
"@deepseek-ai/dsh-skill": "^0.2.2-rc.
|
|
100
|
-
"@deepseek-ai/dsh-session-projection": "^0.2.2-rc.
|
|
101
|
-
"@deepseek-ai/dsh-agent": "^0.2.2-rc.
|
|
102
|
-
"@deepseek-ai/dsh-subagent": "^0.2.2-rc.
|
|
103
|
-
"@deepseek-ai/dsh-tools": "^0.2.2-rc.
|
|
104
|
-
"@deepseek-ai/dsh-commands": "^0.2.2-rc.
|
|
105
|
-
"@deepseek-ai/dsh-llm": "^0.2.2-rc.
|
|
106
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.
|
|
107
|
-
"@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.
|
|
109
|
+
"@deepseek-ai/dsh-scope": "^0.2.2-rc.3",
|
|
110
|
+
"@deepseek-ai/dsh-session": "^0.2.2-rc.3",
|
|
111
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.3",
|
|
112
|
+
"@deepseek-ai/dsh-session-projection": "^0.2.2-rc.3",
|
|
113
|
+
"@deepseek-ai/dsh-agent": "^0.2.2-rc.3",
|
|
114
|
+
"@deepseek-ai/dsh-subagent": "^0.2.2-rc.3",
|
|
115
|
+
"@deepseek-ai/dsh-tools": "^0.2.2-rc.3",
|
|
116
|
+
"@deepseek-ai/dsh-commands": "^0.2.2-rc.3",
|
|
117
|
+
"@deepseek-ai/dsh-llm": "^0.2.2-rc.3",
|
|
118
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.3",
|
|
119
|
+
"@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.3"
|
|
108
120
|
},
|
|
109
121
|
"devDependencies": {
|
|
110
122
|
"@deepseek-ai/cordis": "^4.0.5",
|
|
111
|
-
"@deepseek-ai/dsh-scope": "^0.2.2-rc.
|
|
112
|
-
"@deepseek-ai/dsh-session": "^0.2.2-rc.
|
|
113
|
-
"@deepseek-ai/dsh-skill": "^0.2.2-rc.
|
|
114
|
-
"@deepseek-ai/dsh-session-projection": "^0.2.2-rc.
|
|
115
|
-
"@deepseek-ai/dsh-agent": "^0.2.2-rc.
|
|
116
|
-
"@deepseek-ai/dsh-subagent": "^0.2.2-rc.
|
|
117
|
-
"@deepseek-ai/dsh-tools": "^0.2.2-rc.
|
|
123
|
+
"@deepseek-ai/dsh-scope": "^0.2.2-rc.3",
|
|
124
|
+
"@deepseek-ai/dsh-session": "^0.2.2-rc.3",
|
|
125
|
+
"@deepseek-ai/dsh-skill": "^0.2.2-rc.3",
|
|
126
|
+
"@deepseek-ai/dsh-session-projection": "^0.2.2-rc.3",
|
|
127
|
+
"@deepseek-ai/dsh-agent": "^0.2.2-rc.3",
|
|
128
|
+
"@deepseek-ai/dsh-subagent": "^0.2.2-rc.3",
|
|
129
|
+
"@deepseek-ai/dsh-tools": "^0.2.2-rc.3",
|
|
118
130
|
"@types/js-yaml": "^4.0.9",
|
|
119
131
|
"js-yaml": "^4.1.0",
|
|
120
|
-
"@deepseek-ai/dsh-commands": "^0.2.2-rc.
|
|
121
|
-
"@deepseek-ai/dsh-llm": "^0.2.2-rc.
|
|
122
|
-
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.
|
|
123
|
-
"@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.
|
|
132
|
+
"@deepseek-ai/dsh-commands": "^0.2.2-rc.3",
|
|
133
|
+
"@deepseek-ai/dsh-llm": "^0.2.2-rc.3",
|
|
134
|
+
"@deepseek-ai/dsh-system-prompt": "^0.2.2-rc.3",
|
|
135
|
+
"@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.3"
|
|
124
136
|
},
|
|
125
137
|
"engines": {
|
|
126
|
-
"dsh": ">=0.2.2-rc.
|
|
138
|
+
"dsh": ">=0.2.2-rc.3 <0.2.3-0"
|
|
127
139
|
}
|
|
128
140
|
}
|
package/lib/platform-Cc9cNt5j.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
2
|
-
import { scopeOf } from "@deepseek-ai/dsh-scope";
|
|
3
|
-
import { DomainError, defineDomain, domainTable } from "@deepseek-ai/dsh-storage-domain";
|
|
4
|
-
import { escapeText } from "@deepseek-ai/dsh-skill";
|
|
5
|
-
import { BlockAssembler, createToolResultMessage, createUserMessage } from "@deepseek-ai/dsh-llm";
|
|
6
|
-
import { SessionId } from "@deepseek-ai/dsh-session";
|
|
7
|
-
//#region lib/types/platform/projections.js
|
|
8
|
-
const isHandle = (value) => value !== null && typeof value === "object" && typeof value.stateOf === "function" && typeof value.dispose === "function";
|
|
9
|
-
/** Resolve the projection port; undefined means the host has no projection registry. */
|
|
10
|
-
function projectionPort(ctx) {
|
|
11
|
-
const registry = ctx.get("sessionProjections");
|
|
12
|
-
if (registry === void 0) return void 0;
|
|
13
|
-
let shape = "unrecognised";
|
|
14
|
-
let reason = "sessionProjections.register has not answered yet";
|
|
15
|
-
return {
|
|
16
|
-
get shape() {
|
|
17
|
-
return shape;
|
|
18
|
-
},
|
|
19
|
-
get reason() {
|
|
20
|
-
return shape === "unrecognised" ? reason : void 0;
|
|
21
|
-
},
|
|
22
|
-
async register(definition) {
|
|
23
|
-
const resolved = await registry.register(definition);
|
|
24
|
-
if (isHandle(resolved)) {
|
|
25
|
-
shape = "handle";
|
|
26
|
-
reason = void 0;
|
|
27
|
-
return {
|
|
28
|
-
stateOf: (session) => resolved.stateOf(session),
|
|
29
|
-
dispose: () => resolved.dispose()
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
shape = "unrecognised";
|
|
33
|
-
reason = "sessionProjections.register returned " + (resolved === null ? "null" : typeof resolved) + " without a projection handle";
|
|
34
|
-
return {
|
|
35
|
-
stateOf: () => void 0,
|
|
36
|
-
dispose: async () => {}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region lib/types/platform/llm.js
|
|
43
|
-
/** Typed auxiliary-LLM failure; callers may map these without parsing messages. */
|
|
44
|
-
var EvolutionLlmError = class extends Error {
|
|
45
|
-
kind;
|
|
46
|
-
constructor(kind, message, cause) {
|
|
47
|
-
super(message);
|
|
48
|
-
this.name = "EvolutionLlmError";
|
|
49
|
-
this.kind = kind;
|
|
50
|
-
if (cause !== void 0) this.cause = cause;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
function toOptions(request) {
|
|
54
|
-
return {
|
|
55
|
-
provider: request.provider,
|
|
56
|
-
model: request.model,
|
|
57
|
-
messages: request.messages,
|
|
58
|
-
...request.maxTokens === void 0 ? {} : { maxTokens: request.maxTokens },
|
|
59
|
-
...request.temperature === void 0 ? {} : { temperature: request.temperature },
|
|
60
|
-
...request.signal === void 0 ? {} : { signal: request.signal },
|
|
61
|
-
purpose: request.purpose
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/** Resolve the LLM port; undefined means the host has no llm service. */
|
|
65
|
-
function llmPort(ctx) {
|
|
66
|
-
const llm = ctx.get("llm");
|
|
67
|
-
if (llm === void 0) return void 0;
|
|
68
|
-
const port = {
|
|
69
|
-
async *stream(request) {
|
|
70
|
-
const options = toOptions(request);
|
|
71
|
-
if (llm.stream === void 0) throw new EvolutionLlmError("transport", "llm service has no stream()");
|
|
72
|
-
yield* llm.stream(options);
|
|
73
|
-
},
|
|
74
|
-
async completeText(request) {
|
|
75
|
-
let text = "";
|
|
76
|
-
for await (const chunk of port.stream(request)) {
|
|
77
|
-
const frame = chunk;
|
|
78
|
-
if (frame.type === "text-delta" || frame.type === "text") text += typeof frame.text === "string" ? frame.text : "";
|
|
79
|
-
if (frame.type === "finish" && frame.reason?.kind === "error") {
|
|
80
|
-
const message = frame.reason.failure?.message;
|
|
81
|
-
throw new EvolutionLlmError("transport", "model call failed: " + (typeof message === "string" ? message : "unknown"));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return text;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
return port;
|
|
88
|
-
}
|
|
89
|
-
/** Resolve the model route: agent-owned selection first, deployment default second. */
|
|
90
|
-
function modelRoute(ctx, agent, session) {
|
|
91
|
-
const owned = agent?.model?.current?.();
|
|
92
|
-
if (owned !== void 0) return {
|
|
93
|
-
provider: owned.provider,
|
|
94
|
-
model: owned.model
|
|
95
|
-
};
|
|
96
|
-
if (session !== void 0) {
|
|
97
|
-
const value = ctx.get("sessionProjections")?.snapshot?.(session, ["modelSelection"])?.values?.modelSelection;
|
|
98
|
-
const chosen = value?.next ?? value?.lastUsed;
|
|
99
|
-
if (chosen !== void 0 && chosen !== null) return {
|
|
100
|
-
provider: chosen.provider,
|
|
101
|
-
model: chosen.model
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
const fallback = ctx.get("agentDefaultModel")?.currentSelection?.();
|
|
105
|
-
return fallback === void 0 ? void 0 : {
|
|
106
|
-
provider: fallback.provider,
|
|
107
|
-
model: fallback.model
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
//#endregion
|
|
111
|
-
export { createUserMessage as a, domainTable as c, EvolutionLlmError as d, llmPort as f, createToolResultMessage as i, escapeText as l, projectionPort as m, DomainError as n, defineDomain as o, modelRoute as p, SessionId as r, defineTool as s, BlockAssembler as t, scopeOf as u };
|