@dsmm/dsmm 0.2.2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -42
- package/cordis.patch.yml +1 -0
- package/docs/agent-presets.md +26 -14
- package/docs/compatibility.md +20 -79
- package/docs/deferred-native-approval-risk.md +8 -12
- package/docs/design.md +25 -254
- package/docs/lsp.md +2 -2
- package/docs/migration-from-ocmm.md +38 -51
- package/docs/model-routing.md +21 -21
- package/docs/native-permissions.md +17 -7
- package/docs/profiles.md +13 -9
- package/docs/releasing.md +34 -240
- package/docs/roadmap.md +23 -254
- package/docs/runtime-recovery.md +29 -91
- package/docs/safety-guards.md +19 -16
- package/docs/settings-status.md +23 -11
- package/docs/skill-sync.md +17 -17
- package/docs/web-fetch-fakeip.md +82 -0
- package/lib/child-capture.d.ts +16 -2
- package/lib/child-capture.js +29 -10
- package/lib/client/ChildrenPanel.d.ts +1 -4
- package/lib/client/ChildrenPanel.js +4 -16
- package/lib/client/DeploymentFields.d.ts +28 -0
- package/lib/client/DeploymentFields.js +68 -0
- package/lib/client/DeploymentPage.d.ts +17 -5
- package/lib/client/DeploymentPage.js +79 -112
- package/lib/client/NativeCommandEntries.d.ts +17 -0
- package/lib/client/NativeCommandEntries.js +68 -0
- package/lib/client/PermissionsPanel.d.ts +1 -1
- package/lib/client/PermissionsPanel.js +8 -8
- package/lib/client/ProfilesSection.js +7 -5
- package/lib/client/RoleToolView-data.d.ts +35 -0
- package/lib/client/RoleToolView-data.js +52 -0
- package/lib/client/RoleToolView-locales.d.ts +36 -0
- package/lib/client/RoleToolView-locales.js +20 -0
- package/lib/client/RoleToolView.d.ts +10 -0
- package/lib/client/RoleToolView.js +47 -0
- package/lib/client/SessionProfiles.js +39 -15
- package/lib/client/children-controller.d.ts +2 -8
- package/lib/client/children-controller.js +1 -26
- package/lib/client/children-locales.d.ts +26 -51
- package/lib/client/children-locales.js +8 -12
- package/lib/client/configuration-display.d.ts +5 -0
- package/lib/client/configuration-display.js +11 -0
- package/lib/client/controller.d.ts +1 -0
- package/lib/client/controller.js +20 -13
- package/lib/client/deployment-controller.d.ts +13 -1
- package/lib/client/deployment-controller.js +85 -25
- package/lib/client/deployment-data.d.ts +1 -0
- package/lib/client/deployment-data.js +4 -1
- package/lib/client/deployment-locales.d.ts +43 -0
- package/lib/client/deployment-locales.js +35 -9
- package/lib/client/deployment-modules.d.ts +9 -0
- package/lib/client/deployment-modules.js +24 -0
- package/lib/client/deployment-workspace.d.ts +48 -0
- package/lib/client/deployment-workspace.js +123 -0
- package/lib/client/index.js +11 -74
- package/lib/client/locales.d.ts +7 -0
- package/lib/client/locales.js +12 -6
- package/lib/client/permission-controller.d.ts +1 -0
- package/lib/client/permission-controller.js +3 -2
- package/lib/client/permission-locales.d.ts +25 -0
- package/lib/client/permission-locales.js +24 -4
- package/lib/client/session-labels.js +4 -3
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +9 -8
- package/lib/client.js +2716 -2364
- package/lib/commands.js +2 -0
- package/lib/config-file-store.d.ts +3 -0
- package/lib/config-file-store.js +4 -2
- package/lib/config-revision.d.ts +5 -0
- package/lib/config-revision.js +11 -0
- package/lib/core-permission-authority.js +11 -41
- package/lib/deployment-config.d.ts +9 -2
- package/lib/deployment-config.js +35 -8
- package/lib/deployment-permission-rules.js +19 -7
- package/lib/dsh-types.d.ts +1 -1
- package/lib/host-llm-startup.js +3 -3
- package/lib/host-llm.d.ts +9 -3
- package/lib/host-llm.js +48 -8
- package/lib/index.d.ts +17 -21
- package/lib/index.js +131 -430
- package/lib/lifetime.d.ts +4 -0
- package/lib/lifetime.js +22 -0
- package/lib/live-pi-ai-owner.d.ts +1 -0
- package/lib/live-pi-ai-owner.js +8 -4
- package/lib/mode.d.ts +3 -2
- package/lib/mode.js +28 -41
- package/lib/model-routing.d.ts +2 -8
- package/lib/model-routing.js +59 -175
- package/lib/native-admission.d.ts +56 -0
- package/lib/native-admission.js +313 -0
- package/lib/native-pi-ai-wire.d.ts +3 -1
- package/lib/native-pi-ai-wire.js +47 -13
- package/lib/permission-control.d.ts +0 -3
- package/lib/permission-rpc.js +3 -3
- package/lib/preset-registry.js +3 -2
- package/lib/preset-skills.d.ts +3 -12
- package/lib/preset-skills.js +28 -58
- package/lib/profile-diagnostics.d.ts +1 -1
- package/lib/profile-diagnostics.js +2 -2
- package/lib/profile-remote.js +61 -22
- package/lib/profile-rpc.d.ts +4 -3
- package/lib/profile-rpc.js +39 -41
- package/lib/profile-runtime.d.ts +31 -74
- package/lib/profile-runtime.js +224 -639
- package/lib/profile-store.d.ts +18 -6
- package/lib/profile-store.js +106 -64
- package/lib/profile-types.d.ts +18 -4
- package/lib/profiles.d.ts +3 -1
- package/lib/profiles.js +9 -7
- package/lib/prompt-content.d.ts +1 -0
- package/lib/prompt-content.js +4 -1
- package/lib/prompts.d.ts +2 -12
- package/lib/prompts.js +11 -66
- package/lib/role-control-remote.d.ts +1 -4
- package/lib/role-control-remote.js +8 -36
- package/lib/role-control-rpc.d.ts +10 -36
- package/lib/role-control-rpc.js +112 -265
- package/lib/role-control-types.d.ts +3 -26
- package/lib/role-control-types.js +3 -4
- package/lib/role-identity.d.ts +5 -0
- package/lib/role-identity.js +10 -0
- package/lib/role-invocation.d.ts +2 -2
- package/lib/role-llm-runtime.js +5 -11
- package/lib/role-policy.d.ts +19 -53
- package/lib/role-policy.js +136 -525
- package/lib/role-providers.d.ts +5 -8
- package/lib/role-providers.js +20 -126
- package/lib/role-routing.d.ts +1 -3
- package/lib/role-routing.js +24 -34
- package/lib/role-subagents.d.ts +5 -14
- package/lib/role-subagents.js +149 -97
- package/lib/runtime-integration.d.ts +5 -109
- package/lib/runtime-integration.js +11 -779
- package/lib/session-metadata.d.ts +13 -12
- package/lib/session-metadata.js +6 -31
- package/lib/session-scope.js +6 -2
- package/lib/settings.d.ts +5 -18
- package/lib/settings.js +19 -43
- package/lib/state.d.ts +3 -2
- package/lib/state.js +26 -10
- package/lib/status.d.ts +1 -9
- package/lib/status.js +3 -55
- package/lib/web-fetch-address-policy.d.ts +24 -0
- package/lib/web-fetch-address-policy.js +189 -0
- package/lib/web-fetch-fakeip.d.ts +25 -0
- package/lib/web-fetch-fakeip.js +107 -0
- package/package.json +133 -113
- package/docs/research/deepseek-v4-pro.md +0 -74
- package/docs/research/oh-dsh.md +0 -96
- package/lib/child-admission.d.ts +0 -42
- package/lib/child-admission.js +0 -162
- package/lib/delivery-authority.d.ts +0 -68
- package/lib/delivery-authority.js +0 -260
- package/lib/legacy-child-policy.d.ts +0 -51
- package/lib/legacy-child-policy.js +0 -123
- package/lib/legacy-read-composition.d.ts +0 -20
- package/lib/legacy-read-composition.js +0 -144
- package/lib/legacy-read-contracts.d.ts +0 -157
- package/lib/legacy-read-contracts.js +0 -39
- package/lib/legacy-read-host.d.ts +0 -19
- package/lib/legacy-read-host.js +0 -67
- package/lib/legacy-read-integration.d.ts +0 -121
- package/lib/legacy-read-integration.js +0 -522
- package/lib/legacy-read-proxy.d.ts +0 -26
- package/lib/legacy-read-proxy.js +0 -237
- package/lib/native-child-evidence.d.ts +0 -42
- package/lib/native-child-evidence.js +0 -133
- package/lib/role-runs.d.ts +0 -135
- package/lib/role-runs.js +0 -304
- package/lib/session-persistence.d.ts +0 -35
- package/lib/session-persistence.js +0 -304
- package/lib/subagent-runtime.d.ts +0 -45
- package/lib/subagent-runtime.js +0 -131
- package/prompts/deepseek-flash.md +0 -11
- package/prompts/deepseek-v4-pro.md +0 -14
- package/scripts/cold-profile-composition.mjs +0 -329
- package/scripts/cold-profile-sources.mjs +0 -238
- package/scripts/migrate-cold-profile.mjs +0 -315
- package/scripts/repair-session-log.mjs +0 -476
- package/scripts/session-repair-native-verifier.mjs +0 -367
package/lib/role-llm-runtime.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { LlmError } from "@deepseek-ai/dsh-llm";
|
|
2
|
-
import { requiresDsmmCallAdmission, snapshotDsmmCall } from "./host-llm.js";
|
|
2
|
+
import { captureDsmmEffortSource, requiresDsmmCallAdmission, snapshotDsmmCall } from "./host-llm.js";
|
|
3
3
|
import { resolvedModelParameterPolicy } from "./model-parameter-policy.js";
|
|
4
4
|
import { modelRouteFromCall, projectModelRouteParameters } from "./role-llm.js";
|
|
5
|
-
import { capturedRoleInvocation } from "./role-invocation.js";
|
|
6
|
-
import { latestNativeModelSelection } from "./role-routing.js";
|
|
7
|
-
import { resolveSelectedAgentPreset } from "./session-scope.js";
|
|
8
5
|
/** Connect the cold Host LLM owner to the existing exact Agent/role admission authority. */
|
|
9
6
|
export function createDsmmRoleLlmOwner(ctx, providers) {
|
|
10
7
|
const nativeFallback = async (frame, proposal) => {
|
|
@@ -32,20 +29,17 @@ export function createDsmmRoleLlmOwner(ctx, providers) {
|
|
|
32
29
|
if (original !== admission.admission)
|
|
33
30
|
throw new Error("LLM policy does not own the exact admission");
|
|
34
31
|
const policy = resolvedModelParameterPolicy(original);
|
|
35
|
-
const
|
|
36
|
-
const effortSource = latestNativeModelSelection(agent) !== undefined
|
|
37
|
-
|| frame.agent.session.header.origin !== "subagent" && !resolveSelectedAgentPreset(agent.session)?.startsWith("dsmm-")
|
|
38
|
-
? "native" : invocation?.effortSource ?? (invocation?.routeSource === "inherited" ? "native" : "dsmm-config");
|
|
32
|
+
const effortSource = captureDsmmEffortSource(frame.agent);
|
|
39
33
|
const config = snapshotDsmmCall(projectModelRouteParameters(modelRouteFromCall(proposal), effortSource, policy.mode !== "native-defaults"));
|
|
40
34
|
admission.assertCurrent();
|
|
41
35
|
if (policy.mode !== "passthrough") {
|
|
42
|
-
return { kind: "stock", admission, config };
|
|
36
|
+
return { kind: "stock", admission, config, effortSource };
|
|
43
37
|
}
|
|
44
38
|
if (!requiresDsmmCallAdmission(config, providers)) {
|
|
45
39
|
try {
|
|
46
40
|
await ctx.get("llm").resolveCallConfig(config, frame.signal);
|
|
47
41
|
admission.assertCurrent();
|
|
48
|
-
return { kind: "stock", admission, config };
|
|
42
|
+
return { kind: "stock", admission, config, effortSource };
|
|
49
43
|
}
|
|
50
44
|
catch (error) {
|
|
51
45
|
if (!(error instanceof LlmError) || error.code !== "UNSUPPORTED_OPTION"
|
|
@@ -55,7 +49,7 @@ export function createDsmmRoleLlmOwner(ctx, providers) {
|
|
|
55
49
|
}
|
|
56
50
|
const generation = providers.generation(config.provider);
|
|
57
51
|
admission.assertCurrent();
|
|
58
|
-
return { kind: "dsmm", admission, config, generation };
|
|
52
|
+
return { kind: "dsmm", admission, config, generation, effortSource };
|
|
59
53
|
},
|
|
60
54
|
};
|
|
61
55
|
}
|
package/lib/role-policy.d.ts
CHANGED
|
@@ -3,10 +3,6 @@ import type { DshAgent, DshContext } from "./dsh-types.js";
|
|
|
3
3
|
export { allowedRoleChildren } from "./roles.js";
|
|
4
4
|
import type { DsmmRoleId } from "./roles.js";
|
|
5
5
|
import type { DsmmProfileAdmission, DsmmSettings, DsmmSettingsGetter } from "./settings.js";
|
|
6
|
-
import type { ChildAdmissionCompletion, ChildRoleAdmissionCandidate, ParentAdmissionTicket } from "./child-admission-contract.js";
|
|
7
|
-
import type { ChildAdmissionEvidence, PreparedChildAdmission } from "./child-capture.js";
|
|
8
|
-
import type { LegacyCapabilityCollaborators } from "./legacy-child-policy.js";
|
|
9
|
-
export { createConservativeLegacyAdmission as conservativeLegacyAdmission } from "./legacy-child-policy.js";
|
|
10
6
|
import type { ResolvedRoleInvocation } from "./role-invocation.js";
|
|
11
7
|
import type { DeepworkModeController } from "./state.js";
|
|
12
8
|
export interface DsmmRoleIdentity {
|
|
@@ -18,75 +14,45 @@ export interface DsmmRoleIdentity {
|
|
|
18
14
|
readonly toolFilter?: ToolRestriction;
|
|
19
15
|
}
|
|
20
16
|
export declare const READONLY_ROLE_DENIED_TOOLS: readonly ["write", "edit", "bash", "pwsh"];
|
|
21
|
-
export declare function inheritToolFilter(parent?: ToolRestriction, requested?: ToolRestriction): ToolRestriction | undefined;
|
|
22
|
-
export declare function resolveAdmittedDsmmRole(agent: DshAgent, settings: DsmmSettings, active: boolean): DsmmRoleId | undefined;
|
|
23
17
|
export declare function roleToolName(role: DsmmRoleId): string;
|
|
24
18
|
export declare function roleFromToolName(name: string): DsmmRoleId | undefined;
|
|
25
19
|
export declare function readonlyRoleTool(name: string, settings: DsmmSettings): boolean;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
epoch: string;
|
|
30
|
-
toolFilter?: ToolRestriction;
|
|
31
|
-
maxDepth?: number;
|
|
32
|
-
admittedChild?(agent: DshAgent): void;
|
|
33
|
-
}
|
|
34
|
-
export interface RoleAdmissionCollaborators {
|
|
35
|
-
resolveOriginalEvidence(ticket: ParentAdmissionTicket, childId: string, signal: AbortSignal): Promise<ChildAdmissionEvidence>;
|
|
36
|
-
nativeSubstrate: DsmmSettings;
|
|
37
|
-
revokeParent(agent: DshAgent, reason: string): void;
|
|
38
|
-
/** Shared C2b native-capability audit; this does not grant parent tool permissions. */
|
|
39
|
-
classifyLegacyTool?: LegacyCapabilityCollaborators["classifyTool"];
|
|
40
|
-
}
|
|
41
|
-
/** Identity admission only: native services retain every run, inbox and retry lifecycle. */
|
|
20
|
+
export declare function inheritToolFilter(parent?: ToolRestriction, requested?: ToolRestriction): ToolRestriction | undefined;
|
|
21
|
+
export declare function resolveAdmittedDsmmRole(agent: DshAgent, settings: DsmmSettings, active: boolean): DsmmRoleId | undefined;
|
|
22
|
+
/** Role and exact-call restrictions; no child creation or execution owner. */
|
|
42
23
|
export declare class DsmmRolePolicy {
|
|
43
24
|
private readonly ctx;
|
|
44
25
|
private readonly getSettings;
|
|
45
26
|
private readonly mode;
|
|
46
|
-
private readonly calls;
|
|
47
27
|
private readonly executions;
|
|
48
28
|
private readonly toolCalls;
|
|
49
|
-
private readonly providers;
|
|
50
|
-
private readonly continuableCreations;
|
|
51
|
-
private readonly preparedInvocations;
|
|
52
|
-
private readonly preparedCaptures;
|
|
53
|
-
private collaborators?;
|
|
54
29
|
constructor(ctx: DshContext, getSettings: DsmmSettingsGetter, mode: DeepworkModeController);
|
|
55
|
-
captureProvider(provider: object): void;
|
|
56
|
-
ownsProvider(provider: object): boolean;
|
|
57
|
-
revokeResidency(agent: DshAgent): void;
|
|
58
|
-
configureAdmission(collaborators: RoleAdmissionCollaborators): ChildAdmissionCompletion;
|
|
59
|
-
validateRootRole(agent: DshAgent, admission: DsmmProfileAdmission): void;
|
|
60
|
-
recordContinuableCreation(childId: string, parent: DshAgent, role: DsmmRoleId, invocation: ResolvedRoleInvocation | undefined, expectedEpoch: string, signal: AbortSignal): void;
|
|
61
|
-
prepareChildAdmission(agent: DshAgent, parent: DshAgent, ticket: ParentAdmissionTicket, signal: AbortSignal): Promise<PreparedChildAdmission>;
|
|
62
|
-
/** Used at A's single awaited completion point; old original epochs remain valid facts. */
|
|
63
|
-
validatePreparedRole(agent: DshAgent, parent: DshAgent, candidate: ChildRoleAdmissionCandidate): void;
|
|
64
|
-
assertChildDelivery(ticket: ParentAdmissionTicket, childId: string, raw: ChildAdmissionEvidence): void;
|
|
65
|
-
private readOnly;
|
|
66
30
|
private agents;
|
|
67
31
|
assertLive(agent: DshAgent): void;
|
|
68
|
-
private
|
|
69
|
-
|
|
70
|
-
|
|
32
|
+
private selected;
|
|
33
|
+
validateRootRole(agent: DshAgent, admission: DsmmProfileAdmission): void;
|
|
34
|
+
bindChild(agent: DshAgent, parent: DshAgent, admission: DsmmProfileAdmission, invocation: ResolvedRoleInvocation, maximum: number | undefined, toolFilter: ToolRestriction): void;
|
|
35
|
+
release(agent: DshAgent): void;
|
|
71
36
|
assertModuleAdmission(agent: DshAgent): void;
|
|
72
37
|
identity(agent: DshAgent): DsmmRoleIdentity;
|
|
73
|
-
targets(agent: DshAgent): readonly DsmmRoleId[];
|
|
74
|
-
assertDelegation(parent: DshAgent, role: DsmmRoleId): DelegationIdentity;
|
|
75
|
-
duringDelegation<T>(parent: DshAgent, role: DsmmRoleId, operation: () => T, toolFilter?: ToolRestriction, maxDepth?: number, admittedChild?: (agent: DshAgent) => void): T;
|
|
76
|
-
prepareContinuable(parent: DshAgent, role: DsmmRoleId, signal: AbortSignal): DelegationIdentity;
|
|
77
38
|
admit(agent: DshAgent): DsmmRoleIdentity;
|
|
78
|
-
private
|
|
79
|
-
|
|
80
|
-
|
|
39
|
+
private readOnly;
|
|
40
|
+
targets(agent: DshAgent): readonly DsmmRoleId[];
|
|
41
|
+
assertDelegation(parent: DshAgent, role: DsmmRoleId): {
|
|
42
|
+
parent: DshAgent;
|
|
43
|
+
role: "dsmm-orchestrator" | "dsmm-planner" | "dsmm-plan-critic" | "dsmm-builder" | "dsmm-reviewer" | "dsmm-oracle" | "dsmm-oracle-2nd" | "dsmm-creative" | "dsmm-code-search" | "dsmm-doc-search" | "dsmm-clarifier" | "dsmm-media-reader" | "dsmm-frontend" | "dsmm-hard-reasoning" | "dsmm-research" | "dsmm-quick" | "dsmm-coding" | "dsmm-normal-task" | "dsmm-complex" | "dsmm-deep" | "dsmm-documenting" | "dsmm-cross-cutting";
|
|
44
|
+
epoch: string;
|
|
45
|
+
};
|
|
46
|
+
captureTools(agent: DshAgent, tools: ToolRuntime, names?: readonly string[], reset?: boolean): void;
|
|
81
47
|
toolBlacklistDenial(agent: DshAgent, name: string, execution?: Readonly<ToolExecution>): string | undefined;
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
captureToolExecution(execution: Readonly<ToolExecution>, _full: boolean): void;
|
|
49
|
+
/** Visible native names are a narrowing ceiling, never permission to execute a definition. */
|
|
50
|
+
private visibleToolCeiling;
|
|
51
|
+
delegationToolFilter(execution: Readonly<ToolExecution>): ToolRestriction;
|
|
84
52
|
assertToolExecution(execution: Readonly<ToolExecution>): void;
|
|
85
53
|
beforeToolDecision<T>(operation: () => T): T;
|
|
86
54
|
duringToolExecution<T>(execution: Readonly<ToolExecution>, operation: () => Promise<T>): Promise<T>;
|
|
87
55
|
toolDenial(agent: DshAgent, name: string, tools?: ToolRuntime, execution?: Readonly<ToolExecution>): string | undefined;
|
|
88
56
|
preToolDenial(agent: DshAgent, name: string, tools?: ToolRuntime, execution?: Readonly<ToolExecution>): string | undefined;
|
|
89
|
-
private permissionDenial;
|
|
90
|
-
installDrain(agent: DshAgent): void;
|
|
91
57
|
}
|
|
92
58
|
//# sourceMappingURL=role-policy.d.ts.map
|