dsh-run2skill 0.3.1 → 0.4.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/README.en.md CHANGED
@@ -14,9 +14,11 @@ Have you run into any of these situations?
14
14
 
15
15
  Run2Skill does not let an agent silently create permanent rules for itself. Every draft shows its source, intended scope, and complete content before you decide whether to save or discard it. Only an approved draft is written to DSH's native Skill directory.
16
16
 
17
- > The current stable release is [`0.3.1`](https://github.com/qkycir-123/dsh-run2skill/releases/tag/v0.3.1). It supports DSH Web `0.1.1-rc.2` only.
17
+ > The current stable release is [`0.4.0`](https://www.npmjs.com/package/dsh-run2skill/v/0.4.0). It supports DSH Web `0.1.2-rc.1` only.
18
18
 
19
- `0.3.1` adds low-noise learning status, **Synthesize this experience now**, revision requests that generate a new draft, and bounded preservation of important long-workflow evidence. An immediate request still waits for the agent to stop and for complete facts, then follows the existing lookup, review, and publication safety gates. Internal batch counters are not shown in the settings page.
19
+ `0.4.0` uses the Remote/API Gateway and browser-authentication contracts from DSH `0.1.2-rc.1`, and adapts its Session, Storage/Profile, Settings, and plugin-lifecycle changes. It supports only the retained built-in `standard` preset. Continue using `dsh-run2skill@0.3.1` with the older DSH `0.1.1-rc.2` line.
20
+
21
+ Low-noise learning status, **Synthesize this experience now**, revision requests that generate a new draft, and bounded preservation of important long-workflow evidence remain available. An immediate request still waits for the agent to stop and for complete facts, then follows the existing lookup, review, and publication safety gates. Internal batch counters are not shown in the settings page.
20
22
 
21
23
  ## See the complete flow
22
24
 
@@ -24,7 +26,7 @@ Run2Skill does not let an agent silently create permanent rules for itself. Ever
24
26
 
25
27
  1. **Find the draft** — Run2Skill only notifies you when action is required and places the draft under **Settings → Plugins → Run2Skill**.
26
28
  2. **Review its evidence and scope** — inspect the rationale, filtered conversation evidence, target scope, and the complete `SKILL.md` that would be written.
27
- 3. **Request a revision if needed** — leave one short instruction and Run2Skill generates a new complete draft; the old version is not published and the new one still needs review.
29
+ 3. **Request a revision if needed** — leave one short instruction and Run2Skill generates a new complete draft; the old version is not published and the new one still needs review.
28
30
  4. **Save only after approval** — successful results appear under Recent activity and remain ordinary native DSH Skills.
29
31
 
30
32
  <details>
@@ -40,10 +42,10 @@ Run2Skill does not let an agent silently create permanent rules for itself. Ever
40
42
 
41
43
  ## Install
42
44
 
43
- First confirm that you use DSH Web `0.1.1-rc.2`, install Node.js `^22.19.0 || >=24.0.0`, and make sure both `dsh` and `pnpm` are available in your terminal. Then run:
45
+ First confirm that you use DSH Web `0.1.2-rc.1`, install Node.js `^22.19.0 || >=24.0.0`, and make sure both `dsh` and `pnpm` are available in your terminal. Then run:
44
46
 
45
47
  ```bash
46
- dsh plugin --profile web add dsh-run2skill@0.3.1
48
+ dsh plugin --profile web add dsh-run2skill@0.4.0
47
49
  ```
48
50
 
49
51
  Restart DSH Web. Open **Settings → Plugins**; the plugin is loaded when the **Run2Skill** tab appears.
@@ -66,10 +68,10 @@ When something needs your attention, DSH shows one native notification. To revie
66
68
 
67
69
  1. Open **Settings → Plugins → Run2Skill**.
68
70
  2. Review the draft, its intended scope, evidence, and complete content.
69
- 3. Approve and save it, request a revision, discard it, or retry a failed save.
71
+ 3. Approve and save it, request a revision, discard it, or retry a failed save.
70
72
  4. After a successful save, it is an ordinary native DSH Skill and remains usable even if Run2Skill is later uninstalled.
71
73
 
72
- If a draft is not right, submit one revision request of at most 2,048 UTF-8 bytes. The Host uses the current complete draft to generate a new immutable version, records the parent/child relationship, and invalidates the old approval. You must inspect and approve the new version. This is not a free-form editor and does not bypass lookup, human review, or safe publication.
74
+ If a draft is not right, submit one revision request of at most 2,048 UTF-8 bytes. The Host uses the current complete draft to generate a new immutable version, records the parent/child relationship, and invalidates the old approval. You must inspect and approve the new version. This is not a free-form editor and does not bypass lookup, human review, or safe publication.
73
75
 
74
76
  Drafts can target the current project (`PROJECT`) or the current user (`USER`). The current release writes only to DSH's default Skill storage. If you replace or disable that storage, Run2Skill stops safely instead of guessing a path.
75
77
 
package/README.md CHANGED
@@ -16,9 +16,11 @@
16
16
 
17
17
  它不会让 Agent 偷偷给自己立规矩。每份技能草稿都可以先看来源、适用范围和完整内容,然后由你决定确认保存还是放弃草稿。只有确认后,它才会写入 DSH 的原生 Skill 目录。
18
18
 
19
- > 当前稳定版为 [`0.3.1`](https://github.com/qkycir-123/dsh-run2skill/releases/tag/v0.3.1)。目前仅支持 DSH Web `0.1.1-rc.2`。
19
+ > 当前稳定版为 [`0.4.0`](https://www.npmjs.com/package/dsh-run2skill/v/0.4.0)。目前仅支持 DSH Web `0.1.2-rc.1`。
20
20
 
21
- `0.3.1` 增加了低噪声整理状态、“立即整理本次经验”、按意见生成新版草稿,以及长工作流关键证据保留。“立即整理”仍会等待 Agent 停止运行和事实完整,并继续经过查重、审核与发布安全门;设置页不会展示内部批次计数。
21
+ `0.4.0` 改用 DSH `0.1.2-rc.1` 的 Remote/API Gateway 与浏览器认证契约,并适配 Session、Storage/Profile、Settings 和插件生命周期变化。它只支持 RC1 保留的内置 `standard` preset;使用旧 DSH `0.1.1-rc.2` 时请继续安装 `dsh-run2skill@0.3.1`。
22
+
23
+ 低噪声整理状态、“立即整理本次经验”、按意见生成新版草稿,以及长工作流关键证据保留继续保留。“立即整理”仍会等待 Agent 停止运行和事实完整,并继续经过查重、审核与发布安全门;设置页不会展示内部批次计数。
22
24
 
23
25
  ## 看一遍完整流程
24
26
 
@@ -26,7 +28,7 @@
26
28
 
27
29
  1. **发现技能草稿**:Run2Skill 只在有事项需要处理时提醒你,并把草稿放在 **设置 → 插件 → Run2Skill**。
28
30
  2. **核对来源与范围**:查看生成理由、经过过滤的对话证据、保存范围以及将要写入的完整 `SKILL.md`。
29
- 3. **不满意就要求修改**:写一条简短意见,Run2Skill 会生成新的完整草稿;旧版本不会直接发布,新版本仍需你审核。
31
+ 3. **不满意就要求修改**:写一条简短意见,Run2Skill 会生成新的完整草稿;旧版本不会直接发布,新版本仍需你审核。
30
32
  4. **确认后才保存**:成功结果会进入“最近活动”;保存下来的内容是普通的 DSH 原生 Skill。
31
33
 
32
34
  <details>
@@ -42,10 +44,10 @@
42
44
 
43
45
  ## 安装
44
46
 
45
- 先确认你使用 DSH Web `0.1.1-rc.2`,已经安装 Node.js `^22.19.0 || >=24.0.0`,并能在终端运行 `dsh` 和 `pnpm`。然后执行:
47
+ 先确认你使用 DSH Web `0.1.2-rc.1`,已经安装 Node.js `^22.19.0 || >=24.0.0`,并能在终端运行 `dsh` 和 `pnpm`。然后执行:
46
48
 
47
49
  ```bash
48
- dsh plugin --profile web add dsh-run2skill@0.3.1
50
+ dsh plugin --profile web add dsh-run2skill@0.4.0
49
51
  ```
50
52
 
51
53
  重启 DSH Web。打开 **Settings → Plugins**,看到 **run2skill** 卡片就说明插件已加载。
@@ -68,10 +70,10 @@ run2skill 会在每轮对话完成后只做低成本记录,不会每轮调用
68
70
 
69
71
  1. 打开 **Settings → Plugins → run2skill**。
70
72
  2. 在待处理列表中查看技能草稿、适用范围和内容差异。
71
- 3. 选择确认并保存、要求修改、放弃草稿,或在保存失败后重试。
73
+ 3. 选择确认并保存、要求修改、放弃草稿,或在保存失败后重试。
72
74
  4. 保存成功后,结果就是普通的 DSH 原生 Skill;即使以后卸载 run2skill,它仍然可以被 DSH 使用。
73
75
 
74
- 如果草稿不合适,可以先写一条不超过 2048 UTF-8 字节的修改意见。Host 会基于当前完整草稿生成新的不可变版本,保留父子版本关系并让旧批准失效;你必须重新查看并确认新版本。这个入口不是自由编辑器,也不会绕过查重、人工审核或安全发布。
76
+ 如果草稿不合适,可以先写一条不超过 2048 UTF-8 字节的修改意见。Host 会基于当前完整草稿生成新的不可变版本,保留父子版本关系并让旧批准失效;你必须重新查看并确认新版本。这个入口不是自由编辑器,也不会绕过查重、人工审核或安全发布。
75
77
 
76
78
  技能草稿可以保存到当前项目(`PROJECT`)或当前用户(`USER`)范围。当前版本只会写入 DSH 默认的 Skill 存储目录;如果你改过 Skill 的存储方式或关闭了默认目录,run2skill 会停止保存,不会猜测写入位置。
77
79
 
package/lib/client.js CHANGED
@@ -614,6 +614,7 @@ window.__ModuleLoader__.load({
614
614
  const integer = /^-?\d+$/;
615
615
  const number$1 = /^-?\d+(?:\.\d+)?$/;
616
616
  const boolean$1 = /^(?:true|false)$/i;
617
+ const _null$2 = /^null$/i;
617
618
  const lowercase = /^[^A-Z]*$/;
618
619
  const uppercase = /^[^a-z]*$/;
619
620
  //#endregion
@@ -1430,6 +1431,22 @@ window.__ModuleLoader__.load({
1430
1431
  return payload;
1431
1432
  };
1432
1433
  });
1434
+ const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
1435
+ $ZodType.init(inst, def);
1436
+ inst._zod.pattern = _null$2;
1437
+ inst._zod.values = /* @__PURE__ */ new Set([null]);
1438
+ inst._zod.parse = (payload, _ctx) => {
1439
+ const input = payload.value;
1440
+ if (input === null) return payload;
1441
+ payload.issues.push({
1442
+ expected: "null",
1443
+ code: "invalid_type",
1444
+ input,
1445
+ inst
1446
+ });
1447
+ return payload;
1448
+ };
1449
+ });
1433
1450
  const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
1434
1451
  $ZodType.init(inst, def);
1435
1452
  inst._zod.parse = (payload) => payload;
@@ -1929,6 +1946,115 @@ window.__ModuleLoader__.load({
1929
1946
  result.value = merged.data;
1930
1947
  return result;
1931
1948
  }
1949
+ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
1950
+ $ZodType.init(inst, def);
1951
+ inst._zod.parse = (payload, ctx) => {
1952
+ const input = payload.value;
1953
+ if (!isPlainObject(input)) {
1954
+ payload.issues.push({
1955
+ expected: "record",
1956
+ code: "invalid_type",
1957
+ input,
1958
+ inst
1959
+ });
1960
+ return payload;
1961
+ }
1962
+ const proms = [];
1963
+ const values = def.keyType._zod.values;
1964
+ if (values) {
1965
+ payload.value = {};
1966
+ const recordKeys = /* @__PURE__ */ new Set();
1967
+ for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1968
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
1969
+ const keyResult = def.keyType._zod.run({
1970
+ value: key,
1971
+ issues: []
1972
+ }, ctx);
1973
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
1974
+ if (keyResult.issues.length) {
1975
+ payload.issues.push({
1976
+ code: "invalid_key",
1977
+ origin: "record",
1978
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
1979
+ input: key,
1980
+ path: [key],
1981
+ inst
1982
+ });
1983
+ continue;
1984
+ }
1985
+ const outKey = keyResult.value;
1986
+ const result = def.valueType._zod.run({
1987
+ value: input[key],
1988
+ issues: []
1989
+ }, ctx);
1990
+ if (result instanceof Promise) proms.push(result.then((result) => {
1991
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1992
+ payload.value[outKey] = result.value;
1993
+ }));
1994
+ else {
1995
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1996
+ payload.value[outKey] = result.value;
1997
+ }
1998
+ }
1999
+ let unrecognized;
2000
+ for (const key in input) if (!recordKeys.has(key)) {
2001
+ unrecognized = unrecognized ?? [];
2002
+ unrecognized.push(key);
2003
+ }
2004
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
2005
+ code: "unrecognized_keys",
2006
+ input,
2007
+ inst,
2008
+ keys: unrecognized
2009
+ });
2010
+ } else {
2011
+ payload.value = {};
2012
+ for (const key of Reflect.ownKeys(input)) {
2013
+ if (key === "__proto__") continue;
2014
+ if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
2015
+ let keyResult = def.keyType._zod.run({
2016
+ value: key,
2017
+ issues: []
2018
+ }, ctx);
2019
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2020
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
2021
+ const retryResult = def.keyType._zod.run({
2022
+ value: Number(key),
2023
+ issues: []
2024
+ }, ctx);
2025
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2026
+ if (retryResult.issues.length === 0) keyResult = retryResult;
2027
+ }
2028
+ if (keyResult.issues.length) {
2029
+ if (def.mode === "loose") payload.value[key] = input[key];
2030
+ else payload.issues.push({
2031
+ code: "invalid_key",
2032
+ origin: "record",
2033
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2034
+ input: key,
2035
+ path: [key],
2036
+ inst
2037
+ });
2038
+ continue;
2039
+ }
2040
+ const result = def.valueType._zod.run({
2041
+ value: input[key],
2042
+ issues: []
2043
+ }, ctx);
2044
+ if (result instanceof Promise) proms.push(result.then((result) => {
2045
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2046
+ payload.value[keyResult.value] = result.value;
2047
+ }));
2048
+ else {
2049
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2050
+ payload.value[keyResult.value] = result.value;
2051
+ }
2052
+ }
2053
+ }
2054
+ if (proms.length) return Promise.all(proms).then(() => payload);
2055
+ return payload;
2056
+ };
2057
+ });
1932
2058
  const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
1933
2059
  $ZodType.init(inst, def);
1934
2060
  const values = getEnumValues(def.entries);
@@ -2167,6 +2293,21 @@ window.__ModuleLoader__.load({
2167
2293
  payload.value = Object.freeze(payload.value);
2168
2294
  return payload;
2169
2295
  }
2296
+ const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
2297
+ $ZodType.init(inst, def);
2298
+ defineLazy(inst._zod, "innerType", () => {
2299
+ const d = def;
2300
+ if (!d._cachedInner) d._cachedInner = def.getter();
2301
+ return d._cachedInner;
2302
+ });
2303
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
2304
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
2305
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? void 0);
2306
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? void 0);
2307
+ inst._zod.parse = (payload, ctx) => {
2308
+ return inst._zod.innerType._zod.run(payload, ctx);
2309
+ };
2310
+ });
2170
2311
  const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
2171
2312
  $ZodCheck.init(inst, def);
2172
2313
  $ZodType.init(inst, def);
@@ -2543,6 +2684,13 @@ window.__ModuleLoader__.load({
2543
2684
  });
2544
2685
  }
2545
2686
  // @__NO_SIDE_EFFECTS__
2687
+ function _null$1(Class, params) {
2688
+ return new Class({
2689
+ type: "null",
2690
+ ...normalizeParams(params)
2691
+ });
2692
+ }
2693
+ // @__NO_SIDE_EFFECTS__
2546
2694
  function _unknown(Class) {
2547
2695
  return new Class({ type: "unknown" });
2548
2696
  }
@@ -3095,6 +3243,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3095
3243
  const booleanProcessor = (_schema, _ctx, json, _params) => {
3096
3244
  json.type = "boolean";
3097
3245
  };
3246
+ const nullProcessor = (_schema, ctx, json, _params) => {
3247
+ if (ctx.target === "openapi-3.0") {
3248
+ json.type = "string";
3249
+ json.nullable = true;
3250
+ json.enum = [null];
3251
+ } else json.type = "null";
3252
+ };
3098
3253
  const neverProcessor = (_schema, _ctx, json, _params) => {
3099
3254
  json.not = {};
3100
3255
  };
@@ -3209,6 +3364,39 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3209
3364
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3210
3365
  json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3211
3366
  };
3367
+ const recordProcessor = (schema, ctx, _json, params) => {
3368
+ const json = _json;
3369
+ const def = schema._zod.def;
3370
+ json.type = "object";
3371
+ const keyType = def.keyType;
3372
+ const patterns = keyType._zod.bag?.patterns;
3373
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
3374
+ const valueSchema = process(def.valueType, ctx, {
3375
+ ...params,
3376
+ path: [
3377
+ ...params.path,
3378
+ "patternProperties",
3379
+ "*"
3380
+ ]
3381
+ });
3382
+ json.patternProperties = {};
3383
+ for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
3384
+ } else {
3385
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process(def.keyType, ctx, {
3386
+ ...params,
3387
+ path: [...params.path, "propertyNames"]
3388
+ });
3389
+ json.additionalProperties = process(def.valueType, ctx, {
3390
+ ...params,
3391
+ path: [...params.path, "additionalProperties"]
3392
+ });
3393
+ }
3394
+ const keyValues = keyType._zod.values;
3395
+ if (keyValues) {
3396
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
3397
+ if (validKeyValues.length > 0) json.required = validKeyValues;
3398
+ }
3399
+ };
3212
3400
  const nullableProcessor = (schema, ctx, json, params) => {
3213
3401
  const def = schema._zod.def;
3214
3402
  const inner = process(def.innerType, ctx, params);
@@ -3272,6 +3460,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3272
3460
  const seen = ctx.seen.get(schema);
3273
3461
  seen.ref = def.innerType;
3274
3462
  };
3463
+ const lazyProcessor = (schema, ctx, _json, params) => {
3464
+ const innerType = schema._zod.innerType;
3465
+ process(innerType, ctx, params);
3466
+ const seen = ctx.seen.get(schema);
3467
+ seen.ref = innerType;
3468
+ };
3275
3469
  //#endregion
3276
3470
  //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3277
3471
  const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
@@ -3753,6 +3947,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3753
3947
  function boolean(params) {
3754
3948
  return /* @__PURE__ */ _boolean(ZodBoolean, params);
3755
3949
  }
3950
+ const ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
3951
+ $ZodNull.init(inst, def);
3952
+ ZodType.init(inst, def);
3953
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
3954
+ });
3955
+ function _null(params) {
3956
+ return /* @__PURE__ */ _null$1(ZodNull, params);
3957
+ }
3756
3958
  const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
3757
3959
  $ZodUnknown.init(inst, def);
3758
3960
  ZodType.init(inst, def);
@@ -3904,6 +4106,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3904
4106
  right
3905
4107
  });
3906
4108
  }
4109
+ const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
4110
+ $ZodRecord.init(inst, def);
4111
+ ZodType.init(inst, def);
4112
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
4113
+ inst.keyType = def.keyType;
4114
+ inst.valueType = def.valueType;
4115
+ });
4116
+ function record(keyType, valueType, params) {
4117
+ if (!valueType || !valueType._zod) return new ZodRecord({
4118
+ type: "record",
4119
+ keyType: string(),
4120
+ valueType: keyType,
4121
+ ...normalizeParams(valueType)
4122
+ });
4123
+ return new ZodRecord({
4124
+ type: "record",
4125
+ keyType,
4126
+ valueType,
4127
+ ...normalizeParams(params)
4128
+ });
4129
+ }
3907
4130
  const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
3908
4131
  $ZodEnum.init(inst, def);
3909
4132
  ZodType.init(inst, def);
@@ -4113,6 +4336,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4113
4336
  innerType
4114
4337
  });
4115
4338
  }
4339
+ const ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
4340
+ $ZodLazy.init(inst, def);
4341
+ ZodType.init(inst, def);
4342
+ inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
4343
+ inst.unwrap = () => inst._zod.def.getter();
4344
+ });
4345
+ function lazy(getter) {
4346
+ return new ZodLazy({
4347
+ type: "lazy",
4348
+ getter
4349
+ });
4350
+ }
4116
4351
  const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
4117
4352
  $ZodCustom.init(inst, def);
4118
4353
  ZodType.init(inst, def);
@@ -4124,37 +4359,130 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4124
4359
  function superRefine(fn, params) {
4125
4360
  return /* @__PURE__ */ _superRefine(fn, params);
4126
4361
  }
4362
+ function json(params) {
4363
+ const jsonSchema = lazy(() => {
4364
+ return union([
4365
+ string(params),
4366
+ number(),
4367
+ boolean(),
4368
+ _null(),
4369
+ array(jsonSchema),
4370
+ record(string(), jsonSchema)
4371
+ ]);
4372
+ });
4373
+ return jsonSchema;
4374
+ }
4127
4375
  //#endregion
4128
- //#region src/domain/observe/observe-summary.ts
4129
- const safeCount = number().refine((value) => Number.isSafeInteger(value) && value >= 0, "Expected a non-negative safe integer");
4130
- const ObserveSummaryV1Schema = object({
4131
- apiVersion: literal(1),
4132
- status: _enum([
4133
- "READY",
4134
- "RECOVERING",
4135
- "DEGRADED",
4136
- "INCOMPATIBLE"
4137
- ]),
4138
- capturedCount: safeCount,
4139
- blockedCaptureCount: safeCount,
4140
- learning: object({
4141
- captured: safeCount,
4142
- analyzing: safeCount,
4143
- learned: safeCount,
4144
- needsAttention: safeCount
4145
- }).strict().optional(),
4146
- unsaved: object({
4147
- completeness: _enum(["KNOWN", "UNKNOWN"]),
4148
- knownCount: safeCount
4149
- }).strict(),
4150
- recoveryLag: boolean(),
4151
- lastRecoveryProgressAt: string().datetime({ offset: true }).optional(),
4152
- lastHealthCode: string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional()
4376
+ //#region src/adapters/dsh-remote/contract.ts
4377
+ const RUN2SKILL_QUERY_ENDPOINTS = [
4378
+ "observe-summary",
4379
+ "attention",
4380
+ "proposals/list",
4381
+ "summary",
4382
+ "proposals/get",
4383
+ "recent-activity/list",
4384
+ "learning/status",
4385
+ "learning/issues/list",
4386
+ "purge/preview",
4387
+ "purge/status"
4388
+ ];
4389
+ const RUN2SKILL_COMMAND_ENDPOINTS = [
4390
+ "proposals/approve",
4391
+ "proposals/reject",
4392
+ "proposals/retry",
4393
+ "proposals/refresh",
4394
+ "proposals/revise",
4395
+ "coverage/confirm-discard",
4396
+ "learning/request",
4397
+ "learning/issues/retry",
4398
+ "learning/issues/dismiss",
4399
+ "purge/confirm",
4400
+ "purge/retry"
4401
+ ];
4402
+ const queryEndpoints = new Set(RUN2SKILL_QUERY_ENDPOINTS);
4403
+ const commandEndpoints = new Set(RUN2SKILL_COMMAND_ENDPOINTS);
4404
+ function routeRun2skillEndpoint(endpoint) {
4405
+ if (queryEndpoints.has(endpoint)) return "query";
4406
+ if (commandEndpoints.has(endpoint)) return "command";
4407
+ throw new TypeError(`unknown run2skill endpoint: ${endpoint}`);
4408
+ }
4409
+ const jsonValue = json();
4410
+ const queryRequest = object({
4411
+ endpoint: _enum(RUN2SKILL_QUERY_ENDPOINTS),
4412
+ payload: jsonValue
4413
+ }).strict();
4414
+ const commandRequest = object({
4415
+ endpoint: _enum(RUN2SKILL_COMMAND_ENDPOINTS),
4416
+ payload: jsonValue
4153
4417
  }).strict();
4418
+ const rpcResult = discriminatedUnion("ok", [object({
4419
+ ok: literal(true),
4420
+ value: jsonValue
4421
+ }).strict(), object({
4422
+ ok: literal(false),
4423
+ error: object({
4424
+ code: string().min(1),
4425
+ message: string(),
4426
+ details: record(string(), jsonValue)
4427
+ }).strict()
4428
+ }).strict()]);
4429
+ function descriptor(method, requestSchema) {
4430
+ const value = {
4431
+ id: `dsh-run2skill#run2skill/${method}`,
4432
+ service: "run2skillRemote",
4433
+ namespace: "run2skill",
4434
+ method,
4435
+ invocation: { kind: "direct" },
4436
+ parameters: [{
4437
+ name: "request",
4438
+ wire: "request",
4439
+ source: "json",
4440
+ codec: {
4441
+ mode: "strict",
4442
+ typeSymbol: method === "query" ? "Run2skillQueryRequest" : "Run2skillCommandRequest",
4443
+ schema: requestSchema
4444
+ }
4445
+ }],
4446
+ cancellation: { parameter: "signal" },
4447
+ result: {
4448
+ mode: "strict",
4449
+ typeSymbol: "Run2skillRpcResult",
4450
+ schema: rpcResult
4451
+ }
4452
+ };
4453
+ return Object.freeze(value);
4454
+ }
4455
+ const RUN2SKILL_REMOTE_DESCRIPTORS = Object.freeze([descriptor("query", queryRequest), descriptor("command", commandRequest)]);
4456
+ const RUN2SKILL_REMOTE = Object.freeze({
4457
+ package: "dsh-run2skill",
4458
+ descriptors: RUN2SKILL_REMOTE_DESCRIPTORS
4459
+ });
4154
4460
  //#endregion
4155
- //#region src/adapters/dsh-connection/observe-summary-rpc.ts
4156
- const RUN2SKILL_RPC_CHANNEL = "/run2skill";
4157
- object({ apiVersion: literal(1) }).strict();
4461
+ //#region src/adapters/dsh-remote/client.ts
4462
+ function carrierFailure(error) {
4463
+ return {
4464
+ ok: false,
4465
+ error: {
4466
+ code: error.code,
4467
+ message: error.message,
4468
+ details: error.details
4469
+ }
4470
+ };
4471
+ }
4472
+ async function createRun2skillRemoteCaller(remote) {
4473
+ return {
4474
+ dispose: await remote.$mount(RUN2SKILL_REMOTE),
4475
+ async call(endpoint, payload, signal) {
4476
+ const route = routeRun2skillEndpoint(endpoint);
4477
+ const request = {
4478
+ endpoint,
4479
+ payload
4480
+ };
4481
+ const result = route === "query" ? await remote.run2skill.query(request, signal) : await remote.run2skill.command(request, signal);
4482
+ return result.ok ? result.value : carrierFailure(result.error);
4483
+ }
4484
+ };
4485
+ }
4158
4486
  //#endregion
4159
4487
  //#region src/client/dialog-focus.ts
4160
4488
  const focusableSelector = [
@@ -4219,50 +4547,50 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4219
4547
  }
4220
4548
  //#endregion
4221
4549
  //#region \0run2skill-css:run2skill-settings-page.module.css.mjs
4222
- const css = ".run2skill_page_WCb_nq{width:min(100%,1040px);color:var(--dsw-alias-label-primary);gap:24px;padding:16px 0 48px;display:grid}.run2skill_intro_WCb_nq,.run2skill_muted_WCb_nq{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.run2skill_section_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 2px var(--dsw-alias-border-l1);border-radius:16px;overflow:hidden}.run2skill_sectionHeader_WCb_nq{box-sizing:border-box;height:auto;min-height:56px;padding:14px 20px}.run2skill_sectionTitle_WCb_nq{font-size:15px}.run2skill_sectionBody_WCb_nq{gap:18px;padding:12px 24px 24px 56px;display:grid;container-type:inline-size}.run2skill_attentionGroup_WCb_nq{gap:16px;min-width:0;display:grid}.run2skill_empty_WCb_nq{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_WCb_nq,.run2skill_actions_WCb_nq,.run2skill_modeGroup_WCb_nq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_learningStatusRow_WCb_nq{justify-content:space-between;align-items:center;gap:16px;min-width:0;display:flex}.run2skill_learningStatusRow_WCb_nq>:first-child{overflow-wrap:anywhere;min-width:0}@container (width<=30rem){.run2skill_learningStatusRow_WCb_nq{flex-direction:column;align-items:stretch}.run2skill_learningStatusRow_WCb_nq .run2skill_actions_WCb_nq{flex-direction:column;align-items:stretch;width:100%}.run2skill_learningStatusRow_WCb_nq .run2skill_actions_WCb_nq>*{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;flex:none;width:100%;min-width:0;max-width:100%;height:auto}}.run2skill_attentionList_WCb_nq,.run2skill_proposalList_WCb_nq,.run2skill_activityList_WCb_nq{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.run2skill_activitySummary_WCb_nq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_WCb_nq{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_WCb_nq>:first-child{width:100%}.run2skill_proposalToolbarCompact_WCb_nq{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_WCb_nq>:first-child{width:auto}.run2skill_proposalLayout_WCb_nq{grid-template-columns:1fr;gap:12px;display:grid}.run2skill_proposalListButton_WCb_nq{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:10px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:auto;min-height:48px;padding:8px 12px}.run2skill_proposalListButton_WCb_nq[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 3px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_WCb_nq{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_WCb_nq{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;min-width:0;max-height:640px;padding:18px;overflow:auto}.run2skill_detail_WCb_nq>:first-child{margin-top:0}.run2skill_detailFacts_WCb_nq{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 16px;margin:0 0 20px;display:grid}.run2skill_detailFacts_WCb_nq dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_WCb_nq dd{overflow-wrap:anywhere;min-width:0;margin:0}.run2skill_detail_WCb_nq pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_WCb_nq{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_WCb_nq summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_WCb_nq[open] summary{margin-bottom:12px}.run2skill_status_WCb_nq{min-height:20px;margin:0;font-size:13px}.run2skill_revisionBox_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:12px;gap:8px;margin:18px 0;padding:14px;display:grid}.run2skill_revisionBox_WCb_nq label{font-size:14px;font-weight:600}.run2skill_revisionBox_WCb_nq textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;min-height:84px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;padding:10px 12px;line-height:1.5}.run2skill_revisionBox_WCb_nq textarea:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.run2skill_revisionBox_WCb_nq textarea:disabled{cursor:not-allowed;opacity:.65}.run2skill_revisionBox_WCb_nq>:last-child{justify-self:start}.run2skill_danger_WCb_nq{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_WCb_nq,.run2skill_rejectOverlay_WCb_nq{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_WCb_nq{z-index:999}.run2skill_rejectOverlay_WCb_nq{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_WCb_nq{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_WCb_nq{pointer-events:none;display:contents}.run2skill_queue_WCb_nq,.run2skill_legacyDetail_WCb_nq{min-width:0;overflow:auto}.run2skill_legacyHeader_WCb_nq{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_WCb_nq{margin:0;padding:0;list-style:none}.run2skill_rejectCard_WCb_nq{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_WCb_nq{white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;overflow:auto}.run2skill_previewFacts_WCb_nq{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_WCb_nq dt,.run2skill_previewFacts_WCb_nq dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_WCb_nq{grid-template-columns:minmax(240px,.8fr) minmax(0,1.6fr);gap:20px}}@container (width<=420px){.run2skill_proposalToolbar_WCb_nq,.run2skill_detailFacts_WCb_nq{grid-template-columns:1fr}.run2skill_proposalToolbar_WCb_nq>:last-child{justify-self:start}.run2skill_detailFacts_WCb_nq dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_WCb_nq{padding:8px 18px 20px}.run2skill_activityItem_WCb_nq{flex-direction:column;align-items:flex-start}}";
4550
+ const css = ".run2skill_page_7aqZFq{width:min(100%,1040px);color:var(--dsw-alias-label-primary);gap:24px;padding:16px 0 48px;display:grid}.run2skill_intro_7aqZFq,.run2skill_muted_7aqZFq{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.run2skill_section_7aqZFq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 2px var(--dsw-alias-border-l1);border-radius:16px;overflow:hidden}.run2skill_sectionHeader_7aqZFq{box-sizing:border-box;height:auto;min-height:56px;padding:14px 20px}.run2skill_sectionTitle_7aqZFq{font-size:15px}.run2skill_sectionBody_7aqZFq{gap:18px;padding:12px 24px 24px 56px;display:grid;container-type:inline-size}.run2skill_attentionGroup_7aqZFq{gap:16px;min-width:0;display:grid}.run2skill_empty_7aqZFq{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_7aqZFq,.run2skill_actions_7aqZFq,.run2skill_modeGroup_7aqZFq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_learningStatusRow_7aqZFq{justify-content:space-between;align-items:center;gap:16px;min-width:0;display:flex}.run2skill_learningStatusRow_7aqZFq>:first-child{overflow-wrap:anywhere;min-width:0}@container (width<=30rem){.run2skill_learningStatusRow_7aqZFq{flex-direction:column;align-items:stretch}.run2skill_learningStatusRow_7aqZFq .run2skill_actions_7aqZFq{flex-direction:column;align-items:stretch;width:100%}.run2skill_learningStatusRow_7aqZFq .run2skill_actions_7aqZFq>*{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;flex:none;width:100%;min-width:0;max-width:100%;height:auto}}.run2skill_attentionList_7aqZFq,.run2skill_proposalList_7aqZFq,.run2skill_activityList_7aqZFq{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_7aqZFq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.run2skill_activitySummary_7aqZFq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_7aqZFq{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_7aqZFq>:first-child{width:100%}.run2skill_proposalToolbarCompact_7aqZFq{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_7aqZFq>:first-child{width:auto}.run2skill_proposalLayout_7aqZFq{grid-template-columns:1fr;gap:12px;display:grid}.run2skill_proposalListButton_7aqZFq{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:10px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:auto;min-height:48px;padding:8px 12px}.run2skill_proposalListButton_7aqZFq[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 3px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_7aqZFq{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_7aqZFq{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_7aqZFq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;min-width:0;max-height:640px;padding:18px;overflow:auto}.run2skill_detail_7aqZFq>:first-child{margin-top:0}.run2skill_detailFacts_7aqZFq{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 16px;margin:0 0 20px;display:grid}.run2skill_detailFacts_7aqZFq dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_7aqZFq dd{overflow-wrap:anywhere;min-width:0;margin:0}.run2skill_detail_7aqZFq pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_7aqZFq{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_7aqZFq summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_7aqZFq[open] summary{margin-bottom:12px}.run2skill_status_7aqZFq{min-height:20px;margin:0;font-size:13px}.run2skill_revisionBox_7aqZFq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:12px;gap:8px;margin:18px 0;padding:14px;display:grid}.run2skill_revisionBox_7aqZFq label{font-size:14px;font-weight:600}.run2skill_revisionBox_7aqZFq textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;min-height:84px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;padding:10px 12px;line-height:1.5}.run2skill_revisionBox_7aqZFq textarea:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.run2skill_revisionBox_7aqZFq textarea:disabled{cursor:not-allowed;opacity:.65}.run2skill_revisionBox_7aqZFq>:last-child{justify-self:start}.run2skill_danger_7aqZFq{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_7aqZFq,.run2skill_rejectOverlay_7aqZFq{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_7aqZFq{z-index:999}.run2skill_rejectOverlay_7aqZFq{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_7aqZFq{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_7aqZFq{pointer-events:none;display:contents}.run2skill_queue_7aqZFq,.run2skill_legacyDetail_7aqZFq{min-width:0;overflow:auto}.run2skill_legacyHeader_7aqZFq{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_7aqZFq{margin:0;padding:0;list-style:none}.run2skill_rejectCard_7aqZFq{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_7aqZFq{white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;overflow:auto}.run2skill_previewFacts_7aqZFq{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_7aqZFq dt,.run2skill_previewFacts_7aqZFq dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_7aqZFq{grid-template-columns:minmax(240px,.8fr) minmax(0,1.6fr);gap:20px}}@container (width<=420px){.run2skill_proposalToolbar_7aqZFq,.run2skill_detailFacts_7aqZFq{grid-template-columns:1fr}.run2skill_proposalToolbar_7aqZFq>:last-child{justify-self:start}.run2skill_detailFacts_7aqZFq dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_7aqZFq{padding:8px 18px 20px}.run2skill_activityItem_7aqZFq{flex-direction:column;align-items:flex-start}}";
4223
4551
  if (typeof document !== "undefined") upsertRun2skillStyle(css);
4224
4552
  var _run2skill_css_run2skill_settings_page_module_css_default = {
4225
- "legacyHeader": "run2skill_legacyHeader_WCb_nq",
4226
- "proposalName": "run2skill_proposalName_WCb_nq",
4227
- "legacyDialog": "run2skill_legacyDialog_WCb_nq",
4228
- "status": "run2skill_status_WCb_nq",
4229
- "blocked": "run2skill_blocked_WCb_nq",
4230
- "attentionList": "run2skill_attentionList_WCb_nq",
4231
- "toolbar": "run2skill_toolbar_WCb_nq",
4232
- "rejectCard": "run2skill_rejectCard_WCb_nq",
4233
- "legacyDetail": "run2skill_legacyDetail_WCb_nq",
4234
- "intro": "run2skill_intro_WCb_nq",
4235
- "backdrop": "run2skill_backdrop_WCb_nq",
4236
- "sectionBody": "run2skill_sectionBody_WCb_nq",
4237
- "detail": "run2skill_detail_WCb_nq",
4238
- "activityItem": "run2skill_activityItem_WCb_nq",
4239
- "muted": "run2skill_muted_WCb_nq",
4240
- "attentionGroup": "run2skill_attentionGroup_WCb_nq",
4241
- "legacyList": "run2skill_legacyList_WCb_nq",
4242
- "detailFacts": "run2skill_detailFacts_WCb_nq",
4243
- "activitySummary": "run2skill_activitySummary_WCb_nq",
4244
- "danger": "run2skill_danger_WCb_nq",
4245
- "proposalList": "run2skill_proposalList_WCb_nq",
4246
- "section": "run2skill_section_WCb_nq",
4247
- "actions": "run2skill_actions_WCb_nq",
4248
- "sectionHeader": "run2skill_sectionHeader_WCb_nq",
4249
- "learningStatusRow": "run2skill_learningStatusRow_WCb_nq",
4250
- "revisionBox": "run2skill_revisionBox_WCb_nq",
4251
- "rejectOverlay": "run2skill_rejectOverlay_WCb_nq",
4252
- "queue": "run2skill_queue_WCb_nq",
4253
- "empty": "run2skill_empty_WCb_nq",
4254
- "activityList": "run2skill_activityList_WCb_nq",
4255
- "technicalDetails": "run2skill_technicalDetails_WCb_nq",
4256
- "sectionTitle": "run2skill_sectionTitle_WCb_nq",
4257
- "page": "run2skill_page_WCb_nq",
4258
- "proposalToolbarCompact": "run2skill_proposalToolbarCompact_WCb_nq",
4259
- "proposalToolbar": "run2skill_proposalToolbar_WCb_nq",
4260
- "proposalLayout": "run2skill_proposalLayout_WCb_nq",
4261
- "proposalListButton": "run2skill_proposalListButton_WCb_nq",
4262
- "modeGroup": "run2skill_modeGroup_WCb_nq",
4263
- "proposalMeta": "run2skill_proposalMeta_WCb_nq",
4264
- "textBlock": "run2skill_textBlock_WCb_nq",
4265
- "previewFacts": "run2skill_previewFacts_WCb_nq"
4553
+ "empty": "run2skill_empty_7aqZFq",
4554
+ "sectionHeader": "run2skill_sectionHeader_7aqZFq",
4555
+ "activityList": "run2skill_activityList_7aqZFq",
4556
+ "proposalLayout": "run2skill_proposalLayout_7aqZFq",
4557
+ "rejectCard": "run2skill_rejectCard_7aqZFq",
4558
+ "rejectOverlay": "run2skill_rejectOverlay_7aqZFq",
4559
+ "page": "run2skill_page_7aqZFq",
4560
+ "detailFacts": "run2skill_detailFacts_7aqZFq",
4561
+ "legacyHeader": "run2skill_legacyHeader_7aqZFq",
4562
+ "revisionBox": "run2skill_revisionBox_7aqZFq",
4563
+ "proposalToolbar": "run2skill_proposalToolbar_7aqZFq",
4564
+ "attentionGroup": "run2skill_attentionGroup_7aqZFq",
4565
+ "textBlock": "run2skill_textBlock_7aqZFq",
4566
+ "modeGroup": "run2skill_modeGroup_7aqZFq",
4567
+ "detail": "run2skill_detail_7aqZFq",
4568
+ "proposalList": "run2skill_proposalList_7aqZFq",
4569
+ "backdrop": "run2skill_backdrop_7aqZFq",
4570
+ "proposalToolbarCompact": "run2skill_proposalToolbarCompact_7aqZFq",
4571
+ "legacyDialog": "run2skill_legacyDialog_7aqZFq",
4572
+ "legacyDetail": "run2skill_legacyDetail_7aqZFq",
4573
+ "actions": "run2skill_actions_7aqZFq",
4574
+ "activitySummary": "run2skill_activitySummary_7aqZFq",
4575
+ "activityItem": "run2skill_activityItem_7aqZFq",
4576
+ "attentionList": "run2skill_attentionList_7aqZFq",
4577
+ "sectionBody": "run2skill_sectionBody_7aqZFq",
4578
+ "blocked": "run2skill_blocked_7aqZFq",
4579
+ "muted": "run2skill_muted_7aqZFq",
4580
+ "legacyList": "run2skill_legacyList_7aqZFq",
4581
+ "proposalName": "run2skill_proposalName_7aqZFq",
4582
+ "technicalDetails": "run2skill_technicalDetails_7aqZFq",
4583
+ "queue": "run2skill_queue_7aqZFq",
4584
+ "section": "run2skill_section_7aqZFq",
4585
+ "danger": "run2skill_danger_7aqZFq",
4586
+ "proposalMeta": "run2skill_proposalMeta_7aqZFq",
4587
+ "status": "run2skill_status_7aqZFq",
4588
+ "toolbar": "run2skill_toolbar_7aqZFq",
4589
+ "sectionTitle": "run2skill_sectionTitle_7aqZFq",
4590
+ "proposalListButton": "run2skill_proposalListButton_7aqZFq",
4591
+ "intro": "run2skill_intro_7aqZFq",
4592
+ "learningStatusRow": "run2skill_learningStatusRow_7aqZFq",
4593
+ "previewFacts": "run2skill_previewFacts_7aqZFq"
4266
4594
  };
4267
4595
  //#endregion
4268
4596
  //#region src/client/purge-settings.ts
@@ -4933,8 +5261,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4933
5261
  }), "自动学习"), (0, react.createElement)("p", null, "关闭后暂停普通自动学习;显式“保存为 Skill”仍会持久保存。已开始的分析继续使用启动时快照。"), (0, react.createElement)("p", null, "分析时沿用发起会话已经选择的模型。"), state.error === void 0 ? null : (0, react.createElement)("p", { role: "status" }, "设置已变化,请刷新后重试。"), (0, react.createElement)(PurgeSettingsSection, { controller: props.purgeController })) : null);
4934
5262
  }
4935
5263
  function applyAutomaticLearningSettingsClient(context) {
5264
+ return applyAutomaticLearningSettingsClientRemote(context);
5265
+ }
5266
+ async function applyAutomaticLearningSettingsClientRemote(context) {
5267
+ const mounted = await createRun2skillRemoteCaller(context.remote);
4936
5268
  const controller = new AutomaticLearningSettingsController(context.settingsScope.bind({ namespace: "run2skill" }));
4937
- const callPurge = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
5269
+ const callPurge = mounted.call;
4938
5270
  const purgeController = new PurgeSettingsController(callPurge, () => {
4939
5271
  return context.workspaces.list.getSnapshot().recentWorkspaceId;
4940
5272
  });
@@ -4951,6 +5283,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4951
5283
  purgeController
4952
5284
  })
4953
5285
  }, AutomaticLearningSettingsCard));
5286
+ return mounted.dispose;
4954
5287
  }
4955
5288
  //#endregion
4956
5289
  //#region src/client/proposal-inbox-wire.ts
@@ -7287,13 +7620,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7287
7620
  if (sessionId === void 0) return void 0;
7288
7621
  return context.workspaces.list.getSnapshot().items.find((workspace) => workspace.sessionIds?.includes(sessionId))?.workspaceId;
7289
7622
  }
7290
- function applyRun2skillClient(context) {
7623
+ async function applyRun2skillClient(context) {
7624
+ const mounted = await createRun2skillRemoteCaller(context.remote);
7291
7625
  const controller = new AutomaticLearningSettingsController(context.settingsScope.bind({ namespace: "run2skill" }));
7292
- const callReview = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
7293
- const callAttention = async (payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, "attention", payload, signal);
7294
- const callActivity = async (payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, "recent-activity/list", payload, signal);
7295
- const callLearningStatus = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
7296
- const callPurge = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
7626
+ const callReview = mounted.call;
7627
+ const callAttention = async (payload, signal) => await mounted.call("attention", payload, signal);
7628
+ const callActivity = async (payload, signal) => await mounted.call("recent-activity/list", payload, signal);
7629
+ const callLearningStatus = mounted.call;
7630
+ const callPurge = mounted.call;
7297
7631
  const purgeController = new PurgeSettingsController(callPurge, () => workspaceFor(context, currentSessionId(context)));
7298
7632
  context.effect(() => {
7299
7633
  const disposeStyle = acquireRun2skillStyle();
@@ -7332,8 +7666,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7332
7666
  callAttention: props.callAttention
7333
7667
  });
7334
7668
  }));
7669
+ return mounted.dispose;
7335
7670
  }
7336
7671
  //#endregion
7672
+ //#region src/domain/observe/observe-summary.ts
7673
+ const safeCount = number().refine((value) => Number.isSafeInteger(value) && value >= 0, "Expected a non-negative safe integer");
7674
+ const ObserveSummaryV1Schema = object({
7675
+ apiVersion: literal(1),
7676
+ status: _enum([
7677
+ "READY",
7678
+ "RECOVERING",
7679
+ "DEGRADED",
7680
+ "INCOMPATIBLE"
7681
+ ]),
7682
+ capturedCount: safeCount,
7683
+ blockedCaptureCount: safeCount,
7684
+ learning: object({
7685
+ captured: safeCount,
7686
+ analyzing: safeCount,
7687
+ learned: safeCount,
7688
+ needsAttention: safeCount
7689
+ }).strict().optional(),
7690
+ unsaved: object({
7691
+ completeness: _enum(["KNOWN", "UNKNOWN"]),
7692
+ knownCount: safeCount
7693
+ }).strict(),
7694
+ recoveryLag: boolean(),
7695
+ lastRecoveryProgressAt: string().datetime({ offset: true }).optional(),
7696
+ lastHealthCode: string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional()
7697
+ }).strict();
7698
+ //#endregion
7337
7699
  //#region src/client/observe-summary-poller.ts
7338
7700
  const OBSERVE_SUMMARY_POLL_INTERVAL_MS = 1e4;
7339
7701
  function browserEnvironment() {
@@ -7468,15 +7830,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7468
7830
  //#region src/client/index.ts
7469
7831
  const name = "run2skill-client";
7470
7832
  const inject = [
7471
- "connection",
7472
7833
  "slots",
7473
7834
  "workspaces",
7474
7835
  "sessions",
7475
7836
  "remote",
7476
7837
  "settingsScope"
7477
7838
  ];
7478
- function apply(context) {
7479
- applyRun2skillClient(context);
7839
+ async function apply(context) {
7840
+ return await applyRun2skillClient(context);
7480
7841
  }
7481
7842
  //#endregion
7482
7843
  exports.AttentionSettingsSummary = AttentionSettingsSummary;
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ //#region src/adapters/dsh-remote/contract.ts
3
+ const RUN2SKILL_QUERY_ENDPOINTS = [
4
+ "observe-summary",
5
+ "attention",
6
+ "proposals/list",
7
+ "summary",
8
+ "proposals/get",
9
+ "recent-activity/list",
10
+ "learning/status",
11
+ "learning/issues/list",
12
+ "purge/preview",
13
+ "purge/status"
14
+ ];
15
+ const RUN2SKILL_COMMAND_ENDPOINTS = [
16
+ "proposals/approve",
17
+ "proposals/reject",
18
+ "proposals/retry",
19
+ "proposals/refresh",
20
+ "proposals/revise",
21
+ "coverage/confirm-discard",
22
+ "learning/request",
23
+ "learning/issues/retry",
24
+ "learning/issues/dismiss",
25
+ "purge/confirm",
26
+ "purge/retry"
27
+ ];
28
+ const queryEndpoints = new Set(RUN2SKILL_QUERY_ENDPOINTS);
29
+ const commandEndpoints = new Set(RUN2SKILL_COMMAND_ENDPOINTS);
30
+ function routeRun2skillEndpoint(endpoint) {
31
+ if (queryEndpoints.has(endpoint)) return "query";
32
+ if (commandEndpoints.has(endpoint)) return "command";
33
+ throw new TypeError(`unknown run2skill endpoint: ${endpoint}`);
34
+ }
35
+ const jsonValue = z.json();
36
+ const queryRequest = z.object({
37
+ endpoint: z.enum(RUN2SKILL_QUERY_ENDPOINTS),
38
+ payload: jsonValue
39
+ }).strict();
40
+ const commandRequest = z.object({
41
+ endpoint: z.enum(RUN2SKILL_COMMAND_ENDPOINTS),
42
+ payload: jsonValue
43
+ }).strict();
44
+ const rpcResult = z.discriminatedUnion("ok", [z.object({
45
+ ok: z.literal(true),
46
+ value: jsonValue
47
+ }).strict(), z.object({
48
+ ok: z.literal(false),
49
+ error: z.object({
50
+ code: z.string().min(1),
51
+ message: z.string(),
52
+ details: z.record(z.string(), jsonValue)
53
+ }).strict()
54
+ }).strict()]);
55
+ function descriptor(method, requestSchema) {
56
+ const value = {
57
+ id: `dsh-run2skill#run2skill/${method}`,
58
+ service: "run2skillRemote",
59
+ namespace: "run2skill",
60
+ method,
61
+ invocation: { kind: "direct" },
62
+ parameters: [{
63
+ name: "request",
64
+ wire: "request",
65
+ source: "json",
66
+ codec: {
67
+ mode: "strict",
68
+ typeSymbol: method === "query" ? "Run2skillQueryRequest" : "Run2skillCommandRequest",
69
+ schema: requestSchema
70
+ }
71
+ }],
72
+ cancellation: { parameter: "signal" },
73
+ result: {
74
+ mode: "strict",
75
+ typeSymbol: "Run2skillRpcResult",
76
+ schema: rpcResult
77
+ }
78
+ };
79
+ return Object.freeze(value);
80
+ }
81
+ const RUN2SKILL_REMOTE_DESCRIPTORS = Object.freeze([descriptor("query", queryRequest), descriptor("command", commandRequest)]);
82
+ const RUN2SKILL_REMOTE = Object.freeze({
83
+ package: "dsh-run2skill",
84
+ descriptors: RUN2SKILL_REMOTE_DESCRIPTORS
85
+ });
86
+ //#endregion
87
+ export { RUN2SKILL_REMOTE_DESCRIPTORS as n, routeRun2skillEndpoint as r, RUN2SKILL_REMOTE as t };
package/lib/index.d.ts CHANGED
@@ -4855,28 +4855,6 @@ interface DshContextFileSystemTarget {
4855
4855
  readonly displayPath: string;
4856
4856
  }
4857
4857
  //#endregion
4858
- //#region src/adapters/dsh-connection/observe-summary-rpc.d.ts
4859
- type ObserveRpcError = {
4860
- readonly code: string;
4861
- readonly message: string;
4862
- readonly details: Record<string, unknown>;
4863
- };
4864
- type ObserveRpcResult<T> = {
4865
- readonly ok: true;
4866
- readonly value: T;
4867
- } | {
4868
- readonly ok: false;
4869
- readonly error: ObserveRpcError;
4870
- };
4871
- type ObserveSummaryRpcHandler = (endpoint: string, payload: unknown, signal: AbortSignal) => Promise<ObserveRpcResult<unknown>>;
4872
- interface ObserveSummaryHostConnection {
4873
- readonly rpc: {
4874
- handle(channel: string, handler: ObserveSummaryRpcHandler, options: {
4875
- readonly authority: 'loopback';
4876
- }): () => Promise<void>;
4877
- };
4878
- }
4879
- //#endregion
4880
4858
  //#region src/application/automatic-learning-policy.d.ts
4881
4859
  interface AutomaticLearningSnapshot {
4882
4860
  readonly automaticLearning: boolean;
@@ -5541,7 +5519,7 @@ interface StockAgentPresetObservationPort {
5541
5519
  }
5542
5520
  declare function resolvePinnedStockPresetConfiguration(presets: StockAgentPresetObservationPort, agent: {
5543
5521
  readonly ctx: object;
5544
- }, expectedDigests?: Readonly<Record<'standard' | 'code', readonly string[]>>): Promise<StockSkillRuntimeConfiguration | undefined>;
5522
+ }, expectedDigests?: Readonly<Record<'standard', readonly string[]>>): Promise<StockSkillRuntimeConfiguration | undefined>;
5545
5523
  /** Reads the exact stock filesystem fiber mounted for one Agent's joined generation. */
5546
5524
  declare function resolveStockSkillRuntimeConfiguration(mounts: StockPresetMountPort, agent: StockComposedAgentProjection): Promise<StockSkillRuntimeConfiguration | undefined>;
5547
5525
  //#endregion
@@ -5716,7 +5694,7 @@ declare class PublicationTargetSingleFlight {
5716
5694
  //#endregion
5717
5695
  //#region src/host/index.d.ts
5718
5696
  declare const name = "run2skill";
5719
- declare const inject: readonly ["agents", "sessions", "sessionPersistence", "storageDomain", "workspaceRegistry", "connection", "llm", "skills", "settings", "agentPresets", "fs"];
5697
+ declare const inject: readonly ["agents", "sessions", "sessionPersistence", "storageDomain", "workspaceRegistry", "llm", "skills", "settings", "agentPresets", "fs"];
5720
5698
  type Run2skillAgent = object & AgentScopeProjection & Parameters<typeof resolveStockSkillRuntimeConfiguration>[1];
5721
5699
  type Run2skillAgentPresets = Parameters<typeof resolvePinnedStockPresetConfiguration>[0] & {
5722
5700
  standingKeyFor(id?: string): Promise<object>;
@@ -5726,7 +5704,6 @@ interface Run2skillHostContext extends Run2skillStorageContext {
5726
5704
  readonly sessions: unknown;
5727
5705
  readonly sessionPersistence: SessionPersistencePort;
5728
5706
  readonly workspaceRegistry: DshWorkspaceRegistryPort;
5729
- readonly connection: ObserveSummaryHostConnection;
5730
5707
  readonly llm: DshLlmPort;
5731
5708
  readonly skills: DshSkillRegistryPort<LearningSkillView<Run2skillAgent>>;
5732
5709
  readonly settings: DshSettingsPort;
package/lib/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ import { r as routeRun2skillEndpoint } from "./contract-W_T3v8Fv.js";
1
2
  import { createHash, randomBytes, randomUUID } from "node:crypto";
2
3
  import { z } from "zod";
3
4
  import { basename, dirname, isAbsolute, join, normalize, posix, relative, resolve, sep, win32 } from "node:path";
5
+ import { RemoteError, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
4
6
  import { access, link, lstat, mkdir, open, opendir, readFile, readdir, realpath, rename, rmdir, stat, unlink } from "node:fs/promises";
5
7
  import { homedir } from "node:os";
6
8
  import z$1 from "@deepseek-ai/schemastery";
@@ -3637,9 +3639,6 @@ const ObserveSummaryV1Schema = z.object({
3637
3639
  lastRecoveryProgressAt: z.string().datetime({ offset: true }).optional(),
3638
3640
  lastHealthCode: z.string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional()
3639
3641
  }).strict();
3640
- //#endregion
3641
- //#region src/adapters/dsh-connection/observe-summary-rpc.ts
3642
- const RUN2SKILL_RPC_CHANNEL = "/run2skill";
3643
3642
  const ObserveSummaryRequestV1Schema = z.object({ apiVersion: z.literal(1) }).strict();
3644
3643
  function badRequest() {
3645
3644
  return {
@@ -3651,8 +3650,8 @@ function badRequest() {
3651
3650
  }
3652
3651
  };
3653
3652
  }
3654
- function registerObserveSummaryRpc(connection, readSummary, fallback) {
3655
- return connection.rpc.handle(RUN2SKILL_RPC_CHANNEL, async (endpoint, payload, signal) => {
3653
+ function createObserveSummaryRpcHandler(readSummary, fallback) {
3654
+ return async (endpoint, payload, signal) => {
3656
3655
  if (endpoint !== "observe-summary") return fallback === void 0 ? badRequest() : await fallback(endpoint, payload, signal);
3657
3656
  if (!ObserveSummaryRequestV1Schema.safeParse(payload).success) return badRequest();
3658
3657
  if (signal.aborted) return {
@@ -3678,9 +3677,35 @@ function registerObserveSummaryRpc(connection, readSummary, fallback) {
3678
3677
  }
3679
3678
  };
3680
3679
  }
3681
- }, { authority: "loopback" });
3680
+ };
3682
3681
  }
3683
3682
  //#endregion
3683
+ //#region src/adapters/dsh-remote/service.ts
3684
+ function assertRoute(endpoint, expected) {
3685
+ let actual;
3686
+ try {
3687
+ actual = routeRun2skillEndpoint(endpoint);
3688
+ } catch (cause) {
3689
+ throw new RemoteError("gateway/bad-request", `unknown run2skill endpoint: ${endpoint}`, {}, { cause });
3690
+ }
3691
+ if (actual !== expected) throw new RemoteError("gateway/bad-request", `run2skill endpoint ${endpoint} must use ${actual}`, {});
3692
+ }
3693
+ var Run2skillRemoteService = class extends TypertRemoteService {
3694
+ handler;
3695
+ constructor(ctx, handler) {
3696
+ super(ctx, "run2skillRemote", { namespace: "run2skill" });
3697
+ this.handler = handler;
3698
+ }
3699
+ async query(request, signal) {
3700
+ assertRoute(request.endpoint, "query");
3701
+ return await this.handler(request.endpoint, request.payload, signal);
3702
+ }
3703
+ async command(request, signal) {
3704
+ assertRoute(request.endpoint, "command");
3705
+ return await this.handler(request.endpoint, request.payload, signal);
3706
+ }
3707
+ };
3708
+ //#endregion
3684
3709
  //#region src/adapters/dsh-storage/global-store.ts
3685
3710
  var Run2skillGlobalStore = class Run2skillGlobalStore {
3686
3711
  domain;
@@ -15693,14 +15718,11 @@ var DshPublicationReadbackAdapter = class {
15693
15718
  };
15694
15719
  //#endregion
15695
15720
  //#region src/adapters/dsh-skills/stock-root-contract.ts
15696
- const STOCK_DSH_BASELINE_COMMIT = "b150a551b8d465e31e418e1b2eaf5e79bbb7d28e";
15721
+ const STOCK_DSH_BASELINE_COMMIT = "a66e4702047846cdaa10c66c9d3df3951f5ea70d";
15697
15722
  const STOCK_ROOT_CONTRACT_VERSION = ROOT_CONTRACT_VERSION_V2;
15698
15723
  const STOCK_ROOT_RESOLVER_VERSION = ROOT_RESOLVER_VERSION_V2;
15699
- const SUPPORTED_PRESETS = /* @__PURE__ */ new Set(["standard", "code"]);
15700
- const STOCK_PRESET_COMPOSITION_DIGESTS = Object.freeze({
15701
- standard: Object.freeze(["fa14feb98daef20b810fef30bb7239a89a786de3c45c602b37743f7100d9a5af"]),
15702
- code: Object.freeze(["bdecfe0b26a9d56a2ffcb79694fc123bc395247969e135c62945a1ec8fb92e87"])
15703
- });
15724
+ const SUPPORTED_PRESETS = /* @__PURE__ */ new Set(["standard"]);
15725
+ const STOCK_PRESET_COMPOSITION_DIGESTS = Object.freeze({ standard: Object.freeze(["f18dd942686aa71f43ffc4fd328a712f79af113fb67a35b54cb6de4fc3b84bda"]) });
15704
15726
  function contextUsesFileSystem(context) {
15705
15727
  if (!("get" in context) || typeof context.get !== "function") return false;
15706
15728
  try {
@@ -15713,7 +15735,7 @@ async function resolvePinnedStockPresetConfiguration(presets, agent, expectedDig
15713
15735
  return resolvePinnedStockPresetConfigurationById(presets, presets.composedPreset(agent.ctx), contextUsesFileSystem(agent.ctx), expectedDigests);
15714
15736
  }
15715
15737
  async function resolvePinnedStockPresetConfigurationById(presets, presetId, usesContextFileSystem, expectedDigests = STOCK_PRESET_COMPOSITION_DIGESTS) {
15716
- if (presetId !== "standard" && presetId !== "code") return void 0;
15738
+ if (presetId !== "standard") return void 0;
15717
15739
  try {
15718
15740
  const preset = await presets.resolve(presetId);
15719
15741
  if (preset.id !== presetId || preset.trust !== "system") return void 0;
@@ -16913,12 +16935,13 @@ var DshSessionActivityAdapter = class {
16913
16935
  }
16914
16936
  #sampleLive(sessionId, sessionLifecycleKey, durableEvents) {
16915
16937
  const live = this.#sessions.get(sessionId);
16916
- if (live !== void 0 && (lifecycleKey(live.header) !== sessionLifecycleKey || !sameSessionPrefix(live.events, durableEvents))) return void 0;
16938
+ const liveEvents = live?.snapshotEvents();
16939
+ if (live !== void 0 && (lifecycleKey(live.header) !== sessionLifecycleKey || liveEvents === void 0 || !sameSessionPrefix(liveEvents, durableEvents))) return void 0;
16917
16940
  const agent = this.#agents.get(sessionId);
16918
16941
  if (agent !== void 0 && (live === void 0 || agent.id !== sessionId || agent.session !== live || lifecycleKey(agent.session.header) !== sessionLifecycleKey || agent.status !== "idle" && agent.status !== "running" || typeof agent.whenIdle !== "function")) return void 0;
16919
16942
  return {
16920
16943
  live,
16921
- liveCoordinates: canonicalJson(eventCoordinates(live?.events ?? [])),
16944
+ liveCoordinates: canonicalJson(eventCoordinates(liveEvents ?? [])),
16922
16945
  agent,
16923
16946
  agentStatus: agent?.status ?? "absent"
16924
16947
  };
@@ -19449,7 +19472,7 @@ var DshV2RootManifestAdapter = class {
19449
19472
  }
19450
19473
  }
19451
19474
  async #rootManifest(cwd, configuration, budget, filesystem) {
19452
- if (configuration.profile !== "web" || configuration.presetId !== "standard" && configuration.presetId !== "code" || configuration.providerName.trim().length === 0 || configuration.usesContextFileSystem === true && filesystem === void 0) return void 0;
19475
+ if (configuration.profile !== "web" || configuration.presetId !== "standard" || configuration.providerName.trim().length === 0 || configuration.usesContextFileSystem === true && filesystem === void 0) return void 0;
19453
19476
  const home = this.#homeDirectory();
19454
19477
  const current = this.#currentEnvironment();
19455
19478
  if (configuration.configuredDshHome === void 0 && resolveDshHomeCompatible(void 0, current.DSH_HOME, home) !== resolveDshHomeCompatible(void 0, this.#initialEnvironment.DSH_HOME, home)) return void 0;
@@ -25357,7 +25380,6 @@ const inject = [
25357
25380
  "sessionPersistence",
25358
25381
  "storageDomain",
25359
25382
  "workspaceRegistry",
25360
- "connection",
25361
25383
  "llm",
25362
25384
  "skills",
25363
25385
  "settings",
@@ -26117,7 +26139,7 @@ async function apply(context) {
26117
26139
  runtimeAttention: (sessionId) => projectRuntimeAttention(notices, sessionId),
26118
26140
  learningActions: async (currentScope) => await (factory.currentV2Runtime?.attention.project(currentScope) ?? [])
26119
26141
  }, v2LearningRpc);
26120
- const v2Rpc = createV2RecentSkillActivityRpcHandler(() => factory.currentV2Domain, resolveCurrentWorkspace, createV2LearningStatusRpcHandler(() => factory.currentV2Domain, {
26142
+ new Run2skillRemoteService(context, createObserveSummaryRpcHandler(readSummary, createV2RecentSkillActivityRpcHandler(() => factory.currentV2Domain, resolveCurrentWorkspace, createV2LearningStatusRpcHandler(() => factory.currentV2Domain, {
26121
26143
  resolveSession: (lifecycleKey) => factory.currentV2Runtime?.learningStatusSession(lifecycleKey),
26122
26144
  resolveWorkspace: resolveCurrentWorkspace,
26123
26145
  requestSynthesis: async (lifecycleKey) => {
@@ -26125,8 +26147,7 @@ async function apply(context) {
26125
26147
  if (runtime === void 0) throw new Error("V2_RUNTIME_UNAVAILABLE");
26126
26148
  return await runtime.requestSynthesis(lifecycleKey);
26127
26149
  }
26128
- }, createPurgeRpcHandler(() => factory.currentV2Runtime?.purge, v2ProposalRpc, { runMutation: (operation) => mutationGate.run(operation) })));
26129
- const disposeRpc = registerObserveSummaryRpc(context.connection, readSummary, v2Rpc);
26150
+ }, createPurgeRpcHandler(() => factory.currentV2Runtime?.purge, v2ProposalRpc, { runMutation: (operation) => mutationGate.run(operation) })))));
26130
26151
  try {
26131
26152
  await lifecycle.start();
26132
26153
  } catch (error) {
@@ -26137,13 +26158,9 @@ async function apply(context) {
26137
26158
  accepting = false;
26138
26159
  stopWatchingSettings();
26139
26160
  try {
26140
- await disposeRpc();
26161
+ await lifecycle.dispose();
26141
26162
  } finally {
26142
- try {
26143
- await lifecycle.dispose();
26144
- } finally {
26145
- scopes.clear();
26146
- }
26163
+ scopes.clear();
26147
26164
  }
26148
26165
  };
26149
26166
  }
@@ -0,0 +1,25 @@
1
+ //#region src/adapters/dsh-remote/typert.d.ts
2
+ declare const TYPERT: Readonly<{
3
+ package: "dsh-run2skill";
4
+ face: "host";
5
+ schemas: never[];
6
+ invocations: readonly import("@deepseek-ai/dsh-typert-protocol").InvocationDescriptor[];
7
+ model: {
8
+ services: {
9
+ key: string;
10
+ exportName: string;
11
+ summary: string;
12
+ tags: never[];
13
+ members: {
14
+ kind: string;
15
+ name: string;
16
+ signature: string;
17
+ }[];
18
+ types: never[];
19
+ }[];
20
+ events: never[];
21
+ objects: never[];
22
+ };
23
+ }>;
24
+ //#endregion
25
+ export { TYPERT, TYPERT as default };
@@ -0,0 +1,30 @@
1
+ import { n as RUN2SKILL_REMOTE_DESCRIPTORS } from "./contract-W_T3v8Fv.js";
2
+ //#region src/adapters/dsh-remote/typert.ts
3
+ const TYPERT = Object.freeze({
4
+ package: "dsh-run2skill",
5
+ face: "host",
6
+ schemas: [],
7
+ invocations: RUN2SKILL_REMOTE_DESCRIPTORS,
8
+ model: {
9
+ services: [{
10
+ key: "run2skillRemote",
11
+ exportName: "Run2skillRemoteService",
12
+ summary: "Run2Skill read and mutation boundary for the DSH Web client.",
13
+ tags: [],
14
+ members: [{
15
+ kind: "method",
16
+ name: "query",
17
+ signature: "query(request: Run2skillQueryRequest, signal: AbortSignal): Promise<Run2skillRpcResult>"
18
+ }, {
19
+ kind: "method",
20
+ name: "command",
21
+ signature: "command(request: Run2skillCommandRequest, signal: AbortSignal): Promise<Run2skillRpcResult>"
22
+ }],
23
+ types: []
24
+ }],
25
+ events: [],
26
+ objects: []
27
+ }
28
+ });
29
+ //#endregion
30
+ export { TYPERT, TYPERT as default };
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import { RemoteResult, TypertRemoteContribution } from "@deepseek-ai/dsh-typert-protocol";
3
+ //#region src/adapters/dsh-connection/observe-summary-rpc.d.ts
4
+ type ObserveRpcError = {
5
+ readonly code: string;
6
+ readonly message: string;
7
+ readonly details: Record<string, unknown>;
8
+ };
9
+ type ObserveRpcResult<T> = {
10
+ readonly ok: true;
11
+ readonly value: T;
12
+ } | {
13
+ readonly ok: false;
14
+ readonly error: ObserveRpcError;
15
+ };
16
+ //#endregion
17
+ //#region src/adapters/dsh-remote/contract.d.ts
18
+ declare const RUN2SKILL_QUERY_ENDPOINTS: readonly ["observe-summary", "attention", "proposals/list", "summary", "proposals/get", "recent-activity/list", "learning/status", "learning/issues/list", "purge/preview", "purge/status"];
19
+ declare const RUN2SKILL_COMMAND_ENDPOINTS: readonly ["proposals/approve", "proposals/reject", "proposals/retry", "proposals/refresh", "proposals/revise", "coverage/confirm-discard", "learning/request", "learning/issues/retry", "learning/issues/dismiss", "purge/confirm", "purge/retry"];
20
+ type Run2skillQueryEndpoint = typeof RUN2SKILL_QUERY_ENDPOINTS[number];
21
+ type Run2skillCommandEndpoint = typeof RUN2SKILL_COMMAND_ENDPOINTS[number];
22
+ type Run2skillEndpoint = Run2skillQueryEndpoint | Run2skillCommandEndpoint;
23
+ declare const RUN2SKILL_REMOTE: TypertRemoteContribution;
24
+ interface Run2skillRemoteRequest<Endpoint extends Run2skillEndpoint = Run2skillEndpoint> {
25
+ readonly endpoint: Endpoint;
26
+ readonly payload: unknown;
27
+ }
28
+ interface Run2skillRemoteNamespace {
29
+ query(request: Run2skillRemoteRequest<Run2skillQueryEndpoint>, signal?: AbortSignal): Promise<RemoteResult<ObserveRpcResult<unknown>>>;
30
+ command(request: Run2skillRemoteRequest<Run2skillCommandEndpoint>, signal?: AbortSignal): Promise<RemoteResult<ObserveRpcResult<unknown>>>;
31
+ }
32
+ declare module '@deepseek-ai/dsh-typert-protocol' {
33
+ interface TypertRemoteNamespaceMap {
34
+ run2skill: Run2skillRemoteNamespace;
35
+ }
36
+ }
37
+ //#endregion
38
+ export { RUN2SKILL_REMOTE as TYPERT_REMOTE, RUN2SKILL_REMOTE as default };
@@ -0,0 +1,2 @@
1
+ import { t as RUN2SKILL_REMOTE } from "./contract-W_T3v8Fv.js";
2
+ export { RUN2SKILL_REMOTE as TYPERT_REMOTE, RUN2SKILL_REMOTE as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-run2skill",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Turn explicit DSH session experience into reviewable native Skills",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -34,6 +34,14 @@
34
34
  "./client": {
35
35
  "default": "./lib/client.js"
36
36
  },
37
+ "./typert": {
38
+ "types": "./lib/typert.host.d.ts",
39
+ "default": "./lib/typert.host.js"
40
+ },
41
+ "./remote": {
42
+ "types": "./lib/typert.remote-client.d.ts",
43
+ "default": "./lib/typert.remote-client.js"
44
+ },
37
45
  "./package.json": "./package.json"
38
46
  },
39
47
  "files": [
@@ -51,8 +59,6 @@
51
59
  "client": {
52
60
  "platform": "web",
53
61
  "inject": [
54
- "@deepseek-ai/dsh-client-connection",
55
- "@deepseek-ai/dsh-client-runtime",
56
62
  "@deepseek-ai/dsh-client-ui-primitives",
57
63
  "@deepseek-ai/dsh-client-ui-settings",
58
64
  "@deepseek-ai/dsh-client-ui-settings-plugins",
@@ -69,25 +75,28 @@
69
75
  "zod": "^4.4.3"
70
76
  },
71
77
  "peerDependencies": {
72
- "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
73
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2"
78
+ "@deepseek-ai/cordis": "4.0.2",
79
+ "@deepseek-ai/dsh-agent-presets": "0.1.2-rc.1",
80
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
81
+ "@deepseek-ai/dsh-typert-protocol": "0.1.2-rc.1"
74
82
  },
75
83
  "devDependencies": {
76
- "@deepseek-ai/dsh-agent": "0.1.1-rc.2",
77
- "@deepseek-ai/dsh-agent-presets": "0.1.1-rc.2",
78
- "@deepseek-ai/dsh-attachment": "0.1.1-rc.2",
79
- "@deepseek-ai/dsh-atomic-write": "0.1.1-rc.2",
80
- "@deepseek-ai/dsh-brand": "0.1.1-rc.2",
81
- "@deepseek-ai/dsh-client-ui-primitives": "0.1.1-rc.2",
82
- "@deepseek-ai/dsh-home-paths": "0.1.1-rc.2",
83
- "@deepseek-ai/dsh-invariants": "0.1.1-rc.2",
84
- "@deepseek-ai/dsh-llm": "0.1.1-rc.2",
85
- "@deepseek-ai/dsh-scope": "0.1.1-rc.2",
86
- "@deepseek-ai/dsh-session": "0.1.1-rc.2",
87
- "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
88
- "@deepseek-ai/dsh-system-prompt": "0.1.1-rc.2",
89
- "@deepseek-ai/dsh-timeout": "0.1.1-rc.2",
90
- "@deepseek-ai/dsh-typert-protocol": "0.1.1-rc.2",
84
+ "@deepseek-ai/cordis": "4.0.2",
85
+ "@deepseek-ai/dsh-agent": "0.1.2-rc.1",
86
+ "@deepseek-ai/dsh-agent-presets": "0.1.2-rc.1",
87
+ "@deepseek-ai/dsh-attachment": "0.1.2-rc.1",
88
+ "@deepseek-ai/dsh-atomic-write": "0.1.2-rc.1",
89
+ "@deepseek-ai/dsh-brand": "0.1.2-rc.1",
90
+ "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1",
91
+ "@deepseek-ai/dsh-home-paths": "0.1.2-rc.1",
92
+ "@deepseek-ai/dsh-invariants": "0.1.2-rc.1",
93
+ "@deepseek-ai/dsh-llm": "0.1.2-rc.1",
94
+ "@deepseek-ai/dsh-scope": "0.1.2-rc.1",
95
+ "@deepseek-ai/dsh-session": "0.1.2-rc.1",
96
+ "@deepseek-ai/dsh-settings": "0.1.2-rc.1",
97
+ "@deepseek-ai/dsh-system-prompt": "0.1.2-rc.1",
98
+ "@deepseek-ai/dsh-timeout": "0.1.2-rc.1",
99
+ "@deepseek-ai/dsh-typert-protocol": "0.1.2-rc.1",
91
100
  "@testing-library/react": "^16.3.2",
92
101
  "@types/node": "^22.20.0",
93
102
  "@types/react": "~18.3.1",
@@ -110,7 +119,7 @@
110
119
  "pack:check": "pnpm run build && pnpm pack --pack-destination .probe-work/package",
111
120
  "verify:candidate": "pnpm run build && pnpm run evaluate && node probes/crash-matrix/probe.mjs . && node probes/candidate/verify.mjs",
112
121
  "typecheck": "tsc --noEmit",
113
- "lint": "oxlint --deny-warnings src tests probes/candidate probes/support probes/install-lifecycle/release-upgrade-probe.mjs vitest.config.ts tsdown.config.ts",
122
+ "lint": "oxlint --deny-warnings src tests probes/candidate probes/support probes/dsh-rc1-profile probes/install-lifecycle/release-upgrade-probe.mjs vitest.config.ts tsdown.config.ts",
114
123
  "check": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run test:publication"
115
124
  }
116
125
  }