@xrkseek/harness 0.5.5 → 0.5.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.
- package/node_modules/@xrkseek/code-runtime/dist/index.d.ts +4 -0
- package/node_modules/@xrkseek/code-runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/code-runtime/dist/index.js +61 -34
- package/node_modules/@xrkseek/code-runtime/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/context-fragments/README.md +34 -30
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts +5 -25
- package/node_modules/@xrkseek/context-fragments/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/context-fragments/dist/index.js +5 -41
- package/node_modules/@xrkseek/context-fragments/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js +18 -8
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts +3 -0
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js +27 -3
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/image-offload.d.ts +14 -1
- package/node_modules/@xrkseek/core-session/dist/image-offload.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/image-offload.js +33 -0
- package/node_modules/@xrkseek/core-session/dist/image-offload.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/index.js +22 -1
- package/node_modules/@xrkseek/core-session/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/safety/mistake.d.ts +2 -1
- package/node_modules/@xrkseek/core-session/dist/safety/mistake.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/safety/mistake.js +8 -4
- package/node_modules/@xrkseek/core-session/dist/safety/mistake.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.js +54 -0
- package/node_modules/@xrkseek/core-session/dist/sqlite-store.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/store.d.ts +7 -0
- package/node_modules/@xrkseek/core-session/dist/store.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts +2 -0
- package/node_modules/@xrkseek/core-tools/dist/definition.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/definition.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/pipeline.d.ts +1 -0
- package/node_modules/@xrkseek/core-tools/dist/pipeline.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/pipeline.js +59 -1
- package/node_modules/@xrkseek/core-tools/dist/pipeline.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/run-tool.d.ts +6 -0
- package/node_modules/@xrkseek/core-tools/dist/run-tool.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/run-tool.js +3 -0
- package/node_modules/@xrkseek/core-tools/dist/run-tool.js.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/types.d.ts +64 -1
- package/node_modules/@xrkseek/core-tools/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-tools/dist/types.js.map +1 -1
- package/node_modules/@xrkseek/llm/dist/index.d.ts +11 -0
- package/node_modules/@xrkseek/llm/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm/dist/index.js +16 -1
- package/node_modules/@xrkseek/llm/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-anthropic/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-anthropic/dist/index.js +5 -2
- package/node_modules/@xrkseek/llm-anthropic/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-gemini/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-gemini/dist/index.js +5 -2
- package/node_modules/@xrkseek/llm-gemini/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.js +39 -5
- package/node_modules/@xrkseek/llm-openai-compatible/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.js +5 -2
- package/node_modules/@xrkseek/llm-openai-responses/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +12 -5
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +25 -6
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js +2 -2
- package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/protocol/dist/tools.d.ts +2 -0
- package/node_modules/@xrkseek/protocol/dist/tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/approvals.d.ts +9 -2
- package/node_modules/@xrkseek/server-face/dist/approvals.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/approvals.js +8 -4
- package/node_modules/@xrkseek/server-face/dist/approvals.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/auto-review-approve.d.ts +24 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-approve.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-approve.js +43 -0
- package/node_modules/@xrkseek/server-face/dist/auto-review-approve.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/canvas-store.d.ts +10 -0
- package/node_modules/@xrkseek/server-face/dist/canvas-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/canvas-store.js +43 -6
- package/node_modules/@xrkseek/server-face/dist/canvas-store.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/canvas-tools.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/canvas-tools.js +6 -3
- package/node_modules/@xrkseek/server-face/dist/canvas-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/context.d.ts +12 -2
- package/node_modules/@xrkseek/server-face/dist/context.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +3 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts +14 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js +14 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +92 -17
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +5 -3
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +5 -3
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts +11 -0
- package/node_modules/@xrkseek/server-face/dist/model-catalog.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js +25 -3
- package/node_modules/@xrkseek/server-face/dist/model-catalog.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/permission-auto.d.ts +51 -0
- package/node_modules/@xrkseek/server-face/dist/permission-auto.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/permission-auto.js +106 -0
- package/node_modules/@xrkseek/server-face/dist/permission-auto.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/permissions.d.ts +38 -4
- package/node_modules/@xrkseek/server-face/dist/permissions.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/permissions.js +131 -24
- package/node_modules/@xrkseek/server-face/dist/permissions.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/install-defaults.d.ts +8 -0
- package/node_modules/@xrkseek/server-face/dist/projections/install-defaults.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/install-defaults.js +9 -3
- package/node_modules/@xrkseek/server-face/dist/projections/install-defaults.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.d.ts +22 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.js +18 -15
- package/node_modules/@xrkseek/server-face/dist/projections/units/auto-review.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.d.ts +4 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.js +8 -5
- package/node_modules/@xrkseek/server-face/dist/projections/units/permissions.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts +6 -0
- package/node_modules/@xrkseek/server-face/dist/runtime.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/runtime.js +39 -7
- package/node_modules/@xrkseek/server-face/dist/runtime.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +0 -2
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +7 -5
- package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +6 -9
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/slash.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/slash.js +20 -5
- package/node_modules/@xrkseek/server-face/dist/slash.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/types.d.ts +12 -0
- package/node_modules/@xrkseek/server-face/dist/types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js +85 -8
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +30 -3
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +87 -17
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts +2 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js +4 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/auto-review-bridge.d.ts +5 -0
- package/node_modules/@xrkseek/server-host/dist/auto-review-bridge.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/auto-review-bridge.js +3 -2
- package/node_modules/@xrkseek/server-host/dist/auto-review-bridge.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +6 -2
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +105 -16
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js +3 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-providers.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts +12 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/adapter-types.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.d.ts +168 -4
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.js +466 -13
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-classifier.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-history.d.ts +53 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-history.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-history.js +177 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-history.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.d.ts +45 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js +148 -10
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-http.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts +123 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.js +299 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/auto-review-tool-pre.js.map +1 -0
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts +5 -3
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js +4 -2
- package/node_modules/@xrkseek/server-http/dist/dsh-compat/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-prefs-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-prefs-store.js +3 -1
- package/node_modules/@xrkseek/server-http/dist/sidebar/sidebar-prefs-store.js.map +1 -1
- package/node_modules/@xrkseek/server-http/package.json +2 -0
- package/package.json +1 -1
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { DEFAULT_DEEPSEEK_MODELS } from "./settings-schemas.js";
|
|
2
2
|
import { mergeLayers, persistSettingsDocument } from "./settings-document.js";
|
|
3
3
|
import { listDeclaredPiAiProviders, piAiProviderProfile, providerHasUsableCredential, providerRouteServed, resolveProviderBinding, } from "./llm-provider-context.js";
|
|
4
|
+
/** Wire efforts for official DeepSeek chat (`thinking` / `reasoning_effort`). */
|
|
5
|
+
const DEEPSEEK_REASONING_EFFORTS = [
|
|
6
|
+
{ id: "off", name: "Off" },
|
|
7
|
+
{ id: "low", name: "Low" },
|
|
8
|
+
{ id: "high", name: "High" },
|
|
9
|
+
{ id: "max", name: "Max" },
|
|
10
|
+
];
|
|
11
|
+
const DEEPSEEK_REASONING_IDS = new Set(DEEPSEEK_REASONING_EFFORTS.map((effort) => effort.id));
|
|
4
12
|
function mergedNamespace(runtime, ns) {
|
|
5
13
|
const slot = runtime.settingsNamespaces.ensure(ns);
|
|
6
14
|
return mergeLayers(slot.base, slot.user);
|
|
@@ -43,18 +51,32 @@ function asModelRows(raw) {
|
|
|
43
51
|
}
|
|
44
52
|
return out;
|
|
45
53
|
}
|
|
54
|
+
/** Settings `llm-deepseek.reasoningEffort` when valid; else High. */
|
|
55
|
+
function deepseekReasoning(runtime) {
|
|
56
|
+
const merged = mergedNamespace(runtime, "llm-deepseek");
|
|
57
|
+
const raw = merged.reasoningEffort;
|
|
58
|
+
const defaultEffort = typeof raw === "string" && DEEPSEEK_REASONING_IDS.has(raw) ? raw : "high";
|
|
59
|
+
return {
|
|
60
|
+
efforts: DEEPSEEK_REASONING_EFFORTS.map((effort) => ({ ...effort })),
|
|
61
|
+
defaultEffort,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function withDeepseekReasoning(models, reasoning) {
|
|
65
|
+
return models.map((model) => model.reasoning === undefined ? { ...model, reasoning } : model);
|
|
66
|
+
}
|
|
46
67
|
function deepseekModels(runtime) {
|
|
47
68
|
const merged = mergedNamespace(runtime, "llm-deepseek");
|
|
69
|
+
const reasoning = deepseekReasoning(runtime);
|
|
48
70
|
const fromSettings = asModelRows(merged.models);
|
|
49
71
|
if (fromSettings.length > 0)
|
|
50
|
-
return fromSettings;
|
|
51
|
-
return DEFAULT_DEEPSEEK_MODELS.map((m) => ({
|
|
72
|
+
return withDeepseekReasoning(fromSettings, reasoning);
|
|
73
|
+
return withDeepseekReasoning(DEFAULT_DEEPSEEK_MODELS.map((m) => ({
|
|
52
74
|
id: m.id,
|
|
53
75
|
name: m.name,
|
|
54
76
|
...(m.description ? { description: m.description } : {}),
|
|
55
77
|
...(m.contextWindow ? { contextWindow: m.contextWindow } : {}),
|
|
56
78
|
...(m.inputModalities ? { inputModalities: m.inputModalities } : {}),
|
|
57
|
-
}));
|
|
79
|
+
})), reasoning);
|
|
58
80
|
}
|
|
59
81
|
function piAiProviderModels(runtime, brandId) {
|
|
60
82
|
const profile = piAiProviderProfile(runtime, brandId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-catalog.js","sourceRoot":"","sources":["../src/model-catalog.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAuBnC,SAAS,eAAe,CACtB,OAAoB,EACpB,EAAU;IAEV,MAAM,IAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnD,OAAO,WAAW,CAChB,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,IAAI,CACV,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,GAAY;IAC/B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,KAAK,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ;YAAE,SAAS;QAC9C,MAAM,EAAE,GAAG,MAAM,CAAE,GAAwB,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7D,IAAI,CAAC,EAAE;YAAE,SAAS;QAClB,MAAM,OAAO,GAAI,GAA0B,CAAC,IAAI,CAAC;QACjD,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,C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"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH `registerAuto` — Auto (Guardian) is not a configured table entry; it
|
|
3
|
+
* appears in the current-session catalog only while an integration is live.
|
|
4
|
+
*
|
|
5
|
+
* Dispose closes admission, optionally migrates live Auto sessions, aborts
|
|
6
|
+
* in-flight reviews, drains them, then withdraws the catalog (DSH auto-review
|
|
7
|
+
* lifecycle).
|
|
8
|
+
*/
|
|
9
|
+
/** Synchronous admission gate run before selecting or restoring Auto. */
|
|
10
|
+
export type FacePermissionAutoAdmit = () => void;
|
|
11
|
+
/** Live registration surface for in-flight review cancellation. */
|
|
12
|
+
export interface FacePermissionAutoLifecycle {
|
|
13
|
+
readonly signal: AbortSignal;
|
|
14
|
+
/** Whether new Auto selections / reviews are still accepted. */
|
|
15
|
+
isAccepting(): boolean;
|
|
16
|
+
/** Track a review so dispose can drain it after abort. */
|
|
17
|
+
track(work: Promise<unknown>): void;
|
|
18
|
+
}
|
|
19
|
+
export interface FacePermissionAutoGate {
|
|
20
|
+
/**
|
|
21
|
+
* Publish Auto for the integration lifetime (DSH `registerAuto`).
|
|
22
|
+
* @param admit - synchronous gate run before live Auto selection or restore.
|
|
23
|
+
* @param options.migrateAway - move live Auto sessions off Auto before
|
|
24
|
+
* withdrawing the catalog (typically → `danger-full-access`).
|
|
25
|
+
* @returns disposer that closes admission, migrates, aborts reviews, drains,
|
|
26
|
+
* then removes Auto from the catalog.
|
|
27
|
+
*/
|
|
28
|
+
registerAuto(admit: FacePermissionAutoAdmit, options?: {
|
|
29
|
+
readonly migrateAway?: () => void;
|
|
30
|
+
}): () => void;
|
|
31
|
+
/** Whether Guardian/auto-review has published Auto. */
|
|
32
|
+
isLive(): boolean;
|
|
33
|
+
/** Whether the live integration still accepts Auto selection / restore. */
|
|
34
|
+
isAccepting(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Run the live admit hook (before `/permission auto` or restore).
|
|
37
|
+
* @throws when Auto is not live, closing, or when admit rejects.
|
|
38
|
+
*/
|
|
39
|
+
admit(): void;
|
|
40
|
+
/** Base presets, then `auto` while live. */
|
|
41
|
+
catalogNames(): readonly string[];
|
|
42
|
+
/** Listen for catalog attach/detach (republish permissions projection). */
|
|
43
|
+
onCatalogChange(listener: () => void): () => void;
|
|
44
|
+
/** Abort/track face while Auto is published; undefined when withdrawn. */
|
|
45
|
+
lifecycle(): FacePermissionAutoLifecycle | undefined;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Process-local Auto catalog gate. One admit at a time (DSH rejects duplicates).
|
|
49
|
+
*/
|
|
50
|
+
export declare function createFacePermissionAutoGate(): FacePermissionAutoGate;
|
|
51
|
+
//# sourceMappingURL=permission-auto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-auto.d.ts","sourceRoot":"","sources":["../src/permission-auto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,yEAAyE;AACzE,MAAM,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC;AAEjD,mEAAmE;AACnE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,gEAAgE;IAChE,WAAW,IAAI,OAAO,CAAC;IACvB,0DAA0D;IAC1D,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,YAAY,CACV,KAAK,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;KACnC,GACA,MAAM,IAAI,CAAC;IACd,uDAAuD;IACvD,MAAM,IAAI,OAAO,CAAC;IAClB,2EAA2E;IAC3E,WAAW,IAAI,OAAO,CAAC;IACvB;;;OAGG;IACH,KAAK,IAAI,IAAI,CAAC;IACd,4CAA4C;IAC5C,YAAY,IAAI,SAAS,MAAM,EAAE,CAAC;IAClC,2EAA2E;IAC3E,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAClD,0EAA0E;IAC1E,SAAS,IAAI,2BAA2B,GAAG,SAAS,CAAC;CACtD;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,sBAAsB,CAmGrE"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DSH `registerAuto` — Auto (Guardian) is not a configured table entry; it
|
|
3
|
+
* appears in the current-session catalog only while an integration is live.
|
|
4
|
+
*
|
|
5
|
+
* Dispose closes admission, optionally migrates live Auto sessions, aborts
|
|
6
|
+
* in-flight reviews, drains them, then withdraws the catalog (DSH auto-review
|
|
7
|
+
* lifecycle).
|
|
8
|
+
*/
|
|
9
|
+
import { AUTO_PERMISSION_PRESET, FACE_PERMISSION_PRESETS, } from "./face-schema.js";
|
|
10
|
+
/**
|
|
11
|
+
* Process-local Auto catalog gate. One admit at a time (DSH rejects duplicates).
|
|
12
|
+
*/
|
|
13
|
+
export function createFacePermissionAutoGate() {
|
|
14
|
+
let autoAdmit;
|
|
15
|
+
let migrateAway;
|
|
16
|
+
let accepting = false;
|
|
17
|
+
let lifecycleAbort;
|
|
18
|
+
const active = new Set();
|
|
19
|
+
const listeners = new Set();
|
|
20
|
+
const emit = () => {
|
|
21
|
+
for (const listener of listeners) {
|
|
22
|
+
try {
|
|
23
|
+
listener();
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
/* catalog listeners must not break Host */
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const lifecycleFace = () => {
|
|
31
|
+
if (lifecycleAbort === undefined)
|
|
32
|
+
return undefined;
|
|
33
|
+
const signal = lifecycleAbort.signal;
|
|
34
|
+
return {
|
|
35
|
+
signal,
|
|
36
|
+
isAccepting: () => accepting,
|
|
37
|
+
track(work) {
|
|
38
|
+
active.add(work);
|
|
39
|
+
void work.finally(() => {
|
|
40
|
+
active.delete(work);
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
registerAuto(admit, options) {
|
|
47
|
+
if (autoAdmit !== undefined) {
|
|
48
|
+
throw new Error('permission: preset "auto" is already registered');
|
|
49
|
+
}
|
|
50
|
+
autoAdmit = admit;
|
|
51
|
+
migrateAway = options?.migrateAway;
|
|
52
|
+
accepting = true;
|
|
53
|
+
lifecycleAbort = new AbortController();
|
|
54
|
+
emit();
|
|
55
|
+
return () => {
|
|
56
|
+
if (autoAdmit !== admit)
|
|
57
|
+
return;
|
|
58
|
+
// DSH: close admission first so migration observers cannot re-select Auto.
|
|
59
|
+
accepting = false;
|
|
60
|
+
try {
|
|
61
|
+
migrateAway?.();
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
const abort = lifecycleAbort;
|
|
65
|
+
lifecycleAbort = undefined;
|
|
66
|
+
migrateAway = undefined;
|
|
67
|
+
abort?.abort(new Error("auto-review integration disposed"));
|
|
68
|
+
// Drain without blocking Host close; reviews observe abort via signal.
|
|
69
|
+
void Promise.allSettled([...active]).then(() => {
|
|
70
|
+
active.clear();
|
|
71
|
+
});
|
|
72
|
+
autoAdmit = undefined;
|
|
73
|
+
emit();
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
isLive() {
|
|
78
|
+
return autoAdmit !== undefined;
|
|
79
|
+
},
|
|
80
|
+
isAccepting() {
|
|
81
|
+
return accepting && autoAdmit !== undefined;
|
|
82
|
+
},
|
|
83
|
+
admit() {
|
|
84
|
+
if (autoAdmit === undefined) {
|
|
85
|
+
throw new Error('permission: preset "auto" is not available (Guardian integration not mounted)');
|
|
86
|
+
}
|
|
87
|
+
if (!accepting) {
|
|
88
|
+
throw new Error("auto-review: integration is closing");
|
|
89
|
+
}
|
|
90
|
+
autoAdmit();
|
|
91
|
+
},
|
|
92
|
+
catalogNames() {
|
|
93
|
+
return autoAdmit === undefined
|
|
94
|
+
? FACE_PERMISSION_PRESETS
|
|
95
|
+
: [...FACE_PERMISSION_PRESETS, AUTO_PERMISSION_PRESET];
|
|
96
|
+
},
|
|
97
|
+
onCatalogChange(listener) {
|
|
98
|
+
listeners.add(listener);
|
|
99
|
+
return () => {
|
|
100
|
+
listeners.delete(listener);
|
|
101
|
+
};
|
|
102
|
+
},
|
|
103
|
+
lifecycle: lifecycleFace,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=permission-auto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permission-auto.js","sourceRoot":"","sources":["../src/permission-auto.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AA8C1B;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,IAAI,SAA8C,CAAC;IACnD,IAAI,WAAqC,CAAC;IAC1C,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,IAAI,cAA2C,CAAC;IAChD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC3C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;IAExC,MAAM,IAAI,GAAG,GAAS,EAAE;QACtB,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC;gBACH,QAAQ,EAAE,CAAC;YACb,CAAC;YAAC,MAAM,CAAC;gBACP,2CAA2C;YAC7C,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,GAA4C,EAAE;QAClE,IAAI,cAAc,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACnD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC;QACrC,OAAO;YACL,MAAM;YACN,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS;YAC5B,KAAK,CAAC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C,CAAC;QAED,WAAW;YACT,OAAO,SAAS,IAAI,SAAS,KAAK,SAAS,CAAC;QAC9C,CAAC;QAED,KAAK;YACH,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;gBAC5B,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;YACJ,CAAC;YACD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;YACzD,CAAC;YACD,SAAS,EAAE,CAAC;QACd,CAAC;QAED,YAAY;YACV,OAAO,SAAS,KAAK,SAAS;gBAC5B,CAAC,CAAC,uBAAuB;gBACzB,CAAC,CAAC,CAAC,GAAG,uBAAuB,EAAE,sBAAsB,CAAC,CAAC;QAC3D,CAAC;QAED,eAAe,CAAC,QAAQ;YACtB,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxB,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC,CAAC;QACJ,CAAC;QAED,SAAS,EAAE,aAAa;KACzB,CAAC;AACJ,CAAC"}
|
|
@@ -5,14 +5,28 @@
|
|
|
5
5
|
import { type SessionStore } from "@xrkseek/core-session";
|
|
6
6
|
import { type ApprovalPolicy, type PermissionKnobState, type SandboxMode, type SessionEvent } from "@xrkseek/protocol";
|
|
7
7
|
import { type FacePermissionPreset } from "./face-schema.js";
|
|
8
|
+
import type { FacePermissionAutoGate } from "./permission-auto.js";
|
|
8
9
|
import type { FaceRuntime } from "./context.js";
|
|
9
10
|
export declare const CUSTOM_PERMISSION_PRESET: "custom";
|
|
11
|
+
/** @deprecated Prefer {@link AUTO_PERMISSION_PRESET}; DSH alias. */
|
|
12
|
+
export declare const AUTO_PRESET: "auto";
|
|
10
13
|
export interface PermissionPresetSpec {
|
|
11
14
|
readonly sandbox: SandboxMode;
|
|
12
15
|
readonly approval: ApprovalPolicy;
|
|
13
16
|
readonly name: string;
|
|
14
17
|
readonly description: string;
|
|
15
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Fixed execution bundle for Auto (DSH `AUTO_PRESET_SPEC`): full sandbox with
|
|
21
|
+
* `ask` so reviewer denials still surface to the user.
|
|
22
|
+
*/
|
|
23
|
+
export declare const AUTO_PRESET_SPEC: PermissionPresetSpec;
|
|
24
|
+
/**
|
|
25
|
+
* User-facing permission line for `/status` and Status chrome (Codex
|
|
26
|
+
* `Workspace (Approve for me)` class — Auto is a whole preset here).
|
|
27
|
+
* Machine id stays `auto` on the snapshot; only the display string is remapped.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatPermissionStatusLabel(permission: string): string;
|
|
16
30
|
export interface PermissionSelectOption {
|
|
17
31
|
readonly value: string;
|
|
18
32
|
readonly name: string;
|
|
@@ -24,21 +38,40 @@ export interface PermissionSelect {
|
|
|
24
38
|
}
|
|
25
39
|
/** Same table ids as settings `permission.defaultPreset`. */
|
|
26
40
|
export declare const FACE_PERMISSION_TABLE: Readonly<Record<FacePermissionPreset, PermissionPresetSpec>>;
|
|
41
|
+
/** Resolve a configured table entry or the live Auto bundle. */
|
|
42
|
+
export declare function resolvePermissionPresetSpec(name: string, autoLive: boolean): PermissionPresetSpec | undefined;
|
|
27
43
|
/**
|
|
28
44
|
* Derive select currentValue from folded knobs + composition defaults.
|
|
29
45
|
* Defaults match a coding harness (workspace-write + ask).
|
|
46
|
+
* `auto` appears in options only while Guardian `registerAuto` is live.
|
|
30
47
|
*/
|
|
31
48
|
export declare function derivePermissionSelect(state: PermissionKnobState, defaults?: {
|
|
32
49
|
readonly sandbox?: SandboxMode;
|
|
33
50
|
readonly approval?: ApprovalPolicy;
|
|
51
|
+
}, options?: {
|
|
52
|
+
readonly autoLive?: boolean;
|
|
53
|
+
}): PermissionSelect;
|
|
54
|
+
export declare function permissionSelectFromEvents(events: readonly SessionEvent[], options?: {
|
|
55
|
+
readonly autoLive?: boolean;
|
|
34
56
|
}): PermissionSelect;
|
|
35
|
-
export declare function permissionSelectFromEvents(events: readonly SessionEvent[]): PermissionSelect;
|
|
36
57
|
export declare function defaultPermissionPreset(runtime: FaceRuntime): FacePermissionPreset;
|
|
37
58
|
/** Pin durable knobs on a fresh session (settings defaultPreset). */
|
|
38
|
-
export declare function pinInitialPermission(store: SessionStore, sessionId: string, preset: FacePermissionPreset
|
|
59
|
+
export declare function pinInitialPermission(store: SessionStore, sessionId: string, preset: FacePermissionPreset, options?: {
|
|
60
|
+
readonly autoGate?: FacePermissionAutoGate;
|
|
61
|
+
}): void;
|
|
62
|
+
/**
|
|
63
|
+
* Move every live Auto session to Full access (DSH dispose migrateAway).
|
|
64
|
+
* Called while Auto is still catalog-live but admission is already closed.
|
|
65
|
+
*/
|
|
66
|
+
export declare function migrateAutoSessionsToFullAccess(store: SessionStore, autoGate: FacePermissionAutoGate, options?: {
|
|
67
|
+
readonly hasPtyActivity?: () => boolean;
|
|
68
|
+
}): void;
|
|
39
69
|
/**
|
|
40
|
-
* Switch preset:
|
|
41
|
-
*
|
|
70
|
+
* Switch preset: record identity when the derived current value changes, then
|
|
71
|
+
* write each changed knob. Auto and Full access share `danger-full-access`
|
|
72
|
+
* sandbox — the switch still appends `permission/preset` and only the
|
|
73
|
+
* differing `approval/policy` (DSH shared-bundle switch). Selecting the
|
|
74
|
+
* effective preset again appends nothing (Auto admission still runs).
|
|
42
75
|
*
|
|
43
76
|
* Optional `hasPtyActivity` fences sandbox mode changes while **Agent**
|
|
44
77
|
* `terminal_*` PTY sessions are open or spawning (CV DSH terminal-bash
|
|
@@ -47,6 +80,7 @@ export declare function pinInitialPermission(store: SessionStore, sessionId: str
|
|
|
47
80
|
*/
|
|
48
81
|
export declare function applyPermissionPreset(store: SessionStore, sessionId: string, name: string, options?: {
|
|
49
82
|
readonly hasPtyActivity?: () => boolean;
|
|
83
|
+
readonly autoGate?: FacePermissionAutoGate;
|
|
50
84
|
}): {
|
|
51
85
|
readonly ok: true;
|
|
52
86
|
readonly changed: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,eAAO,MAAM,wBAAwB,EAAG,QAAiB,CAAC;AAE1D,oEAAoE;AACpE,eAAO,MAAM,WAAW,QAAyB,CAAC;AAElD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,oBAO9B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAMtE;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,MAA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B,+BAA+B,CAC7C,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,sBAAsB,EAChC,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAA;CAAE,GACpD,IAAI,CAcN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CAC5C,GAEC;IAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAChD;IAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAiEnD;AAED;;;;GAIG;AACH,wBAAsB,gCAAgC,CACpD,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,OAAO,EACrB,SAAS,EAAE,OAAO,GACjB,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
|
|
@@ -4,8 +4,33 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { readSessionEvents } from "@xrkseek/core-session";
|
|
6
6
|
import { foldPermissionKnobs, } from "@xrkseek/protocol";
|
|
7
|
-
import { FACE_PERMISSION_PRESETS, isFacePermissionPreset, } from "./face-schema.js";
|
|
7
|
+
import { AUTO_PERMISSION_PRESET, FACE_PERMISSION_PRESETS, isFacePermissionPreset, } from "./face-schema.js";
|
|
8
8
|
export const CUSTOM_PERMISSION_PRESET = "custom";
|
|
9
|
+
/** @deprecated Prefer {@link AUTO_PERMISSION_PRESET}; DSH alias. */
|
|
10
|
+
export const AUTO_PRESET = AUTO_PERMISSION_PRESET;
|
|
11
|
+
/**
|
|
12
|
+
* Fixed execution bundle for Auto (DSH `AUTO_PRESET_SPEC`): full sandbox with
|
|
13
|
+
* `ask` so reviewer denials still surface to the user.
|
|
14
|
+
*/
|
|
15
|
+
export const AUTO_PRESET_SPEC = {
|
|
16
|
+
sandbox: "danger-full-access",
|
|
17
|
+
approval: "ask",
|
|
18
|
+
// DSH product name; Codex status/permission chrome says "Approve for me".
|
|
19
|
+
name: "Auto review",
|
|
20
|
+
description: "Full sandbox access with per-call Auto Review; denials still ask the user.",
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* User-facing permission line for `/status` and Status chrome (Codex
|
|
24
|
+
* `Workspace (Approve for me)` class — Auto is a whole preset here).
|
|
25
|
+
* Machine id stays `auto` on the snapshot; only the display string is remapped.
|
|
26
|
+
*/
|
|
27
|
+
export function formatPermissionStatusLabel(permission) {
|
|
28
|
+
if (permission === AUTO_PERMISSION_PRESET) {
|
|
29
|
+
// Codex "Approve for me" + DSH Auto review; explicit no-sandbox / per-call.
|
|
30
|
+
return "Auto review (Approve for me) · no sandbox · per-call review";
|
|
31
|
+
}
|
|
32
|
+
return permission;
|
|
33
|
+
}
|
|
9
34
|
/** Same table ids as settings `permission.defaultPreset`. */
|
|
10
35
|
export const FACE_PERMISSION_TABLE = {
|
|
11
36
|
"read-only": {
|
|
@@ -27,6 +52,14 @@ export const FACE_PERMISSION_TABLE = {
|
|
|
27
52
|
description: "No approval prompts; shell is not sandboxed. File tools still cannot leave the workspace root.",
|
|
28
53
|
},
|
|
29
54
|
};
|
|
55
|
+
/** Resolve a configured table entry or the live Auto bundle. */
|
|
56
|
+
export function resolvePermissionPresetSpec(name, autoLive) {
|
|
57
|
+
if (isFacePermissionPreset(name))
|
|
58
|
+
return FACE_PERMISSION_TABLE[name];
|
|
59
|
+
if (name === AUTO_PERMISSION_PRESET && autoLive)
|
|
60
|
+
return AUTO_PRESET_SPEC;
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
30
63
|
function optionOf(name) {
|
|
31
64
|
if (name === CUSTOM_PERMISSION_PRESET) {
|
|
32
65
|
return {
|
|
@@ -35,6 +68,13 @@ function optionOf(name) {
|
|
|
35
68
|
description: "Current sandbox and approval settings do not match a preset.",
|
|
36
69
|
};
|
|
37
70
|
}
|
|
71
|
+
if (name === AUTO_PERMISSION_PRESET) {
|
|
72
|
+
return {
|
|
73
|
+
value: AUTO_PERMISSION_PRESET,
|
|
74
|
+
name: AUTO_PRESET_SPEC.name,
|
|
75
|
+
description: AUTO_PRESET_SPEC.description,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
38
78
|
const spec = FACE_PERMISSION_TABLE[name];
|
|
39
79
|
if (!spec) {
|
|
40
80
|
throw new Error(`permission: unknown preset "${name}"`);
|
|
@@ -51,15 +91,26 @@ function matches(spec, sandbox, approval) {
|
|
|
51
91
|
/**
|
|
52
92
|
* Derive select currentValue from folded knobs + composition defaults.
|
|
53
93
|
* Defaults match a coding harness (workspace-write + ask).
|
|
94
|
+
* `auto` appears in options only while Guardian `registerAuto` is live.
|
|
54
95
|
*/
|
|
55
|
-
export function derivePermissionSelect(state, defaults = {}) {
|
|
96
|
+
export function derivePermissionSelect(state, defaults = {}, options = {}) {
|
|
97
|
+
const autoLive = options.autoLive === true;
|
|
56
98
|
const sandbox = state.sandbox ?? defaults.sandbox ?? "workspace-write";
|
|
57
99
|
const approval = state.approval ?? defaults.approval ?? "ask";
|
|
58
100
|
let currentValue = CUSTOM_PERMISSION_PRESET;
|
|
59
101
|
if (state.preset !== null) {
|
|
60
|
-
const spec =
|
|
102
|
+
const spec = resolvePermissionPresetSpec(state.preset, autoLive);
|
|
61
103
|
if (spec && matches(spec, sandbox, approval))
|
|
62
104
|
currentValue = state.preset;
|
|
105
|
+
// DSH: a stored Auto identity also matches `never` (delegated child pins
|
|
106
|
+
// reviewer denials as final) while sandbox stays danger-full-access.
|
|
107
|
+
if (currentValue === CUSTOM_PERMISSION_PRESET &&
|
|
108
|
+
state.preset === AUTO_PERMISSION_PRESET &&
|
|
109
|
+
autoLive &&
|
|
110
|
+
AUTO_PRESET_SPEC.sandbox === sandbox &&
|
|
111
|
+
approval === "never") {
|
|
112
|
+
currentValue = AUTO_PERMISSION_PRESET;
|
|
113
|
+
}
|
|
63
114
|
}
|
|
64
115
|
if (currentValue === CUSTOM_PERMISSION_PRESET) {
|
|
65
116
|
for (const name of FACE_PERMISSION_PRESETS) {
|
|
@@ -68,10 +119,18 @@ export function derivePermissionSelect(state, defaults = {}) {
|
|
|
68
119
|
break;
|
|
69
120
|
}
|
|
70
121
|
}
|
|
122
|
+
if (currentValue === CUSTOM_PERMISSION_PRESET &&
|
|
123
|
+
autoLive &&
|
|
124
|
+
matches(AUTO_PRESET_SPEC, sandbox, approval)) {
|
|
125
|
+
currentValue = AUTO_PERMISSION_PRESET;
|
|
126
|
+
}
|
|
71
127
|
}
|
|
128
|
+
const catalog = autoLive
|
|
129
|
+
? [...FACE_PERMISSION_PRESETS, AUTO_PERMISSION_PRESET]
|
|
130
|
+
: [...FACE_PERMISSION_PRESETS];
|
|
72
131
|
return {
|
|
73
132
|
options: [
|
|
74
|
-
...
|
|
133
|
+
...catalog.map((n) => optionOf(n)),
|
|
75
134
|
...(currentValue === CUSTOM_PERMISSION_PRESET
|
|
76
135
|
? [optionOf(CUSTOM_PERMISSION_PRESET)]
|
|
77
136
|
: []),
|
|
@@ -79,8 +138,8 @@ export function derivePermissionSelect(state, defaults = {}) {
|
|
|
79
138
|
currentValue,
|
|
80
139
|
};
|
|
81
140
|
}
|
|
82
|
-
export function permissionSelectFromEvents(events) {
|
|
83
|
-
return derivePermissionSelect(foldPermissionKnobs(events));
|
|
141
|
+
export function permissionSelectFromEvents(events, options = {}) {
|
|
142
|
+
return derivePermissionSelect(foldPermissionKnobs(events), {}, options);
|
|
84
143
|
}
|
|
85
144
|
export function defaultPermissionPreset(runtime) {
|
|
86
145
|
const viewed = runtime.settingsNamespaces.view("permission", { defaultPreset: "workspace-write" });
|
|
@@ -96,8 +155,18 @@ function hasAnyKnob(events) {
|
|
|
96
155
|
e.type === "approval/policy");
|
|
97
156
|
}
|
|
98
157
|
/** Pin durable knobs on a fresh session (settings defaultPreset). */
|
|
99
|
-
export function pinInitialPermission(store, sessionId, preset) {
|
|
158
|
+
export function pinInitialPermission(store, sessionId, preset, options) {
|
|
100
159
|
const events = readSessionEvents(store, sessionId);
|
|
160
|
+
const knobs = foldPermissionKnobs(events);
|
|
161
|
+
// DSH: a stored Auto identity requires the live integration + admission
|
|
162
|
+
// before the session may publish; never rewrite the seed.
|
|
163
|
+
if (knobs.preset === AUTO_PERMISSION_PRESET) {
|
|
164
|
+
if (options?.autoGate?.isLive() !== true) {
|
|
165
|
+
throw new Error('permission: cannot restore preset "auto" without its active integration');
|
|
166
|
+
}
|
|
167
|
+
options.autoGate.admit();
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
101
170
|
if (hasAnyKnob(events))
|
|
102
171
|
return;
|
|
103
172
|
const spec = FACE_PERMISSION_TABLE[preset];
|
|
@@ -119,8 +188,28 @@ export function pinInitialPermission(store, sessionId, preset) {
|
|
|
119
188
|
});
|
|
120
189
|
}
|
|
121
190
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
191
|
+
* Move every live Auto session to Full access (DSH dispose migrateAway).
|
|
192
|
+
* Called while Auto is still catalog-live but admission is already closed.
|
|
193
|
+
*/
|
|
194
|
+
export function migrateAutoSessionsToFullAccess(store, autoGate, options) {
|
|
195
|
+
for (const sessionId of store.list()) {
|
|
196
|
+
const current = permissionSelectFromEvents(readSessionEvents(store, sessionId), { autoLive: true }).currentValue;
|
|
197
|
+
if (current !== AUTO_PERMISSION_PRESET)
|
|
198
|
+
continue;
|
|
199
|
+
applyPermissionPreset(store, sessionId, "danger-full-access", {
|
|
200
|
+
autoGate,
|
|
201
|
+
...(options?.hasPtyActivity
|
|
202
|
+
? { hasPtyActivity: options.hasPtyActivity }
|
|
203
|
+
: {}),
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Switch preset: record identity when the derived current value changes, then
|
|
209
|
+
* write each changed knob. Auto and Full access share `danger-full-access`
|
|
210
|
+
* sandbox — the switch still appends `permission/preset` and only the
|
|
211
|
+
* differing `approval/policy` (DSH shared-bundle switch). Selecting the
|
|
212
|
+
* effective preset again appends nothing (Auto admission still runs).
|
|
124
213
|
*
|
|
125
214
|
* Optional `hasPtyActivity` fences sandbox mode changes while **Agent**
|
|
126
215
|
* `terminal_*` PTY sessions are open or spawning (CV DSH terminal-bash
|
|
@@ -128,51 +217,68 @@ export function pinInitialPermission(store, sessionId, preset) {
|
|
|
128
217
|
* Sidebar user terminals are independent and must not be reported here.
|
|
129
218
|
*/
|
|
130
219
|
export function applyPermissionPreset(store, sessionId, name, options) {
|
|
131
|
-
|
|
220
|
+
const autoLive = options?.autoGate?.isLive() === true;
|
|
221
|
+
const catalog = options?.autoGate?.catalogNames() ?? FACE_PERMISSION_PRESETS;
|
|
222
|
+
const spec = resolvePermissionPresetSpec(name, autoLive);
|
|
223
|
+
if (!spec) {
|
|
132
224
|
return {
|
|
133
225
|
ok: false,
|
|
134
|
-
message: `unknown preset "${name}" (available: ${
|
|
226
|
+
message: `unknown preset "${name}" (available: ${catalog.join(", ")})`,
|
|
135
227
|
};
|
|
136
228
|
}
|
|
229
|
+
if (name === AUTO_PERMISSION_PRESET) {
|
|
230
|
+
try {
|
|
231
|
+
options?.autoGate?.admit();
|
|
232
|
+
}
|
|
233
|
+
catch (err) {
|
|
234
|
+
return {
|
|
235
|
+
ok: false,
|
|
236
|
+
message: err instanceof Error ? err.message : String(err),
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
}
|
|
137
240
|
const events = readSessionEvents(store, sessionId);
|
|
138
|
-
const current = permissionSelectFromEvents(events).currentValue;
|
|
139
|
-
if (current === name)
|
|
140
|
-
return { ok: true, changed: false };
|
|
141
|
-
const spec = FACE_PERMISSION_TABLE[name];
|
|
241
|
+
const current = permissionSelectFromEvents(events, { autoLive }).currentValue;
|
|
142
242
|
const knobs = foldPermissionKnobs(events);
|
|
143
|
-
|
|
144
|
-
|
|
243
|
+
// Effective knobs (composition defaults) — same basis as derivePermissionSelect.
|
|
244
|
+
const effectiveSandbox = knobs.sandbox ?? FACE_PERMISSION_TABLE["workspace-write"].sandbox;
|
|
245
|
+
const effectiveApproval = knobs.approval ?? "ask";
|
|
246
|
+
if (effectiveSandbox !== spec.sandbox &&
|
|
145
247
|
options?.hasPtyActivity?.() === true) {
|
|
146
|
-
// Keep wording aligned with `sandboxModeChangeBlockedMessage` in exec-pty
|
|
147
|
-
// (Face must not depend on node-pty / exec-pty for this leaf).
|
|
148
248
|
return {
|
|
149
249
|
ok: false,
|
|
150
|
-
message: `cannot change sandbox mode from "${
|
|
250
|
+
message: `cannot change sandbox mode from "${effectiveSandbox}" to "${spec.sandbox}" while Agent terminal_* sessions are open or being created; wait for creation to settle and close them first`,
|
|
151
251
|
};
|
|
152
252
|
}
|
|
253
|
+
// DSH: identity tracks derived current, not the raw last preset event — so
|
|
254
|
+
// Auto↔Full (shared sandbox) still records the new selection.
|
|
255
|
+
let changed = false;
|
|
153
256
|
const ts = now();
|
|
154
|
-
if (
|
|
257
|
+
if (current !== name) {
|
|
155
258
|
store.append(sessionId, {
|
|
156
259
|
type: "permission/preset",
|
|
157
260
|
ts,
|
|
158
261
|
preset: name,
|
|
159
262
|
});
|
|
263
|
+
changed = true;
|
|
160
264
|
}
|
|
161
|
-
if (
|
|
265
|
+
if (effectiveSandbox !== spec.sandbox) {
|
|
162
266
|
store.append(sessionId, {
|
|
163
267
|
type: "sandbox/mode",
|
|
164
268
|
ts: ts + 1,
|
|
165
269
|
mode: spec.sandbox,
|
|
166
270
|
});
|
|
271
|
+
changed = true;
|
|
167
272
|
}
|
|
168
|
-
if (
|
|
273
|
+
if (effectiveApproval !== spec.approval) {
|
|
169
274
|
store.append(sessionId, {
|
|
170
275
|
type: "approval/policy",
|
|
171
276
|
ts: ts + 2,
|
|
172
277
|
policy: spec.approval,
|
|
173
278
|
});
|
|
279
|
+
changed = true;
|
|
174
280
|
}
|
|
175
|
-
return { ok: true, changed
|
|
281
|
+
return { ok: true, changed };
|
|
176
282
|
}
|
|
177
283
|
/**
|
|
178
284
|
* Settings `permission.defaultPreset` is `applies: live`. Push the new default
|
|
@@ -201,6 +307,7 @@ export async function applyLivePermissionDefaultPreset(runtime, previousUser, ne
|
|
|
201
307
|
...(runtime.hasPtyActivity
|
|
202
308
|
? { hasPtyActivity: () => runtime.hasPtyActivity() }
|
|
203
309
|
: {}),
|
|
310
|
+
autoGate: runtime.permissionAuto,
|
|
204
311
|
});
|
|
205
312
|
if (applied.ok && applied.changed) {
|
|
206
313
|
await runtime.invalidateAgent?.(sessionId);
|