dsh-interconnect 0.11.20 → 0.11.22

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.
@@ -1,15 +1,10 @@
1
1
  // src/skill-interconnect/index.ts
2
2
  import { readFile } from "node:fs/promises";
3
- import { fileURLToPath } from "node:url";
4
3
  import {
5
4
  BUNDLED_SKILL_RANK
6
5
  } from "@deepseek-ai/dsh-skill";
7
6
  var PROVIDER_NAME = "dsh-interconnect";
8
7
  var SKILL_BODY_URL = new URL("../../assets/dsh-interconnect.md", import.meta.url);
9
- var RESOURCE_BASE = {
10
- kind: "directory",
11
- path: fileURLToPath(new URL("../../assets/", import.meta.url))
12
- };
13
8
  var INVOCATION = { modelInvocable: true, userInvocable: true };
14
9
  var DESCRIPTION = "Use the dsh-interconnect tools to exchange messages between DSH sessions, instances, and machines: list live sessions on a known peer instance, send messages, reply to the last sender, and probe liveness. Use whenever you need to message another DSH agent, coordinate across sessions, or respond to an incoming interconnect handoff.";
15
10
  var CANDIDATE = {
@@ -18,7 +13,6 @@ var CANDIDATE = {
18
13
  invocation: INVOCATION,
19
14
  provider: PROVIDER_NAME,
20
15
  source: "bundled",
21
- resourceBase: RESOURCE_BASE,
22
16
  rank: BUNDLED_SKILL_RANK,
23
17
  locator: SKILL_BODY_URL
24
18
  };
@@ -32,7 +26,6 @@ var provider = {
32
26
  invocation: CANDIDATE.invocation,
33
27
  provider: CANDIDATE.provider,
34
28
  source: CANDIDATE.source,
35
- resourceBase: RESOURCE_BASE,
36
29
  content: await readFile(SKILL_BODY_URL, "utf8")
37
30
  };
38
31
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/skill-interconnect/index.ts"],
4
- "sourcesContent": ["/**\n * Companion skill for the dsh-interconnect tools: tells the model how to use\n * `interconnect_list`, `interconnect_ping`, `interconnect_send`, and\n * `interconnect_reply`, including the automatic sender-identity injection.\n *\n * This is a thin skill provider, intentionally separate from\n * `tool-interconnect`: the service and tools remain usable without the skill,\n * and the profile layer that enables cross-instance handoff mounts this row\n * with them. It injects the `interconnect` service so the skill only appears\n * when the transport it describes is actually present.\n * @module @deepseek-ai/dsh-experimental-skill-interconnect\n */\n\nimport { readFile } from 'node:fs/promises'\nimport { fileURLToPath } from 'node:url'\nimport { Context } from '@deepseek-ai/cordis'\nimport {\n BUNDLED_SKILL_RANK,\n type SkillCandidate,\n type SkillDefinition,\n type SkillProvider,\n} from '@deepseek-ai/dsh-skill'\n// Activates the `Context.interconnect` merge declared by the interconnect service plugin.\nimport type {} from '../interconnect/index.ts'\n\nconst PROVIDER_NAME = 'dsh-interconnect'\nconst SKILL_BODY_URL = new URL('../../assets/dsh-interconnect.md', import.meta.url)\nconst RESOURCE_BASE = {\n kind: 'directory',\n path: fileURLToPath(new URL('../../assets/', import.meta.url)),\n} as const\nconst INVOCATION = { modelInvocable: true, userInvocable: true } as const\nconst DESCRIPTION = 'Use the dsh-interconnect tools to exchange messages between DSH sessions, instances, and machines: list live sessions on a known peer instance, send messages, reply to the last sender, and probe liveness. Use whenever you need to message another DSH agent, coordinate across sessions, or respond to an incoming interconnect handoff.'\n/* jscpd:ignore-start -- the bundled-skill provider shape is the same required boilerplate as skill-badge. */\nconst CANDIDATE: SkillCandidate = {\n name: 'dsh-interconnect',\n description: DESCRIPTION,\n invocation: INVOCATION,\n provider: PROVIDER_NAME,\n source: 'bundled',\n resourceBase: RESOURCE_BASE,\n rank: BUNDLED_SKILL_RANK,\n locator: SKILL_BODY_URL,\n}\n\nconst provider: SkillProvider = {\n name: PROVIDER_NAME,\n list: () => Promise.resolve([CANDIDATE]),\n async get(_candidate): Promise<SkillDefinition> {\n return {\n name: CANDIDATE.name,\n description: CANDIDATE.description,\n invocation: CANDIDATE.invocation,\n provider: CANDIDATE.provider,\n source: CANDIDATE.source,\n resourceBase: RESOURCE_BASE,\n content: await readFile(SKILL_BODY_URL, 'utf8'),\n }\n },\n}\n/* jscpd:ignore-end */\n\n/** Cordis plugin name. */\nexport const name = 'skill-interconnect'\n/** Services required by the companion provider. */\nexport const inject = ['skills', 'interconnect']\n\n/** Register the bundled `dsh-interconnect` skill on `ctx.skills`. */\nexport function apply(ctx: Context): void {\n ctx.skills.registerProvider(() => provider)\n}\n"],
5
- "mappings": ";AAaA,SAAS,gBAAgB;AACzB,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,OAIK;AAIP,IAAM,gBAAgB;AACtB,IAAM,iBAAiB,IAAI,IAAI,oCAAoC,YAAY,GAAG;AAClF,IAAM,gBAAgB;AAAA,EACpB,MAAM;AAAA,EACN,MAAM,cAAc,IAAI,IAAI,iBAAiB,YAAY,GAAG,CAAC;AAC/D;AACA,IAAM,aAAa,EAAE,gBAAgB,MAAM,eAAe,KAAK;AAC/D,IAAM,cAAc;AAEpB,IAAM,YAA4B;AAAA,EAChC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,MAAM;AAAA,EACN,SAAS;AACX;AAEA,IAAM,WAA0B;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM,MAAM,QAAQ,QAAQ,CAAC,SAAS,CAAC;AAAA,EACvC,MAAM,IAAI,YAAsC;AAC9C,WAAO;AAAA,MACL,MAAM,UAAU;AAAA,MAChB,aAAa,UAAU;AAAA,MACvB,YAAY,UAAU;AAAA,MACtB,UAAU,UAAU;AAAA,MACpB,QAAQ,UAAU;AAAA,MAClB,cAAc;AAAA,MACd,SAAS,MAAM,SAAS,gBAAgB,MAAM;AAAA,IAChD;AAAA,EACF;AACF;AAIO,IAAM,OAAO;AAEb,IAAM,SAAS,CAAC,UAAU,cAAc;AAGxC,SAAS,MAAM,KAAoB;AACxC,MAAI,OAAO,iBAAiB,MAAM,QAAQ;AAC5C;",
4
+ "sourcesContent": ["/**\n * Companion skill for the dsh-interconnect tools: tells the model how to use\n * `interconnect_list`, `interconnect_ping`, `interconnect_send`, and\n * `interconnect_reply`, including the automatic sender-identity injection.\n *\n * This is a thin skill provider, intentionally separate from\n * `tool-interconnect`: the service and tools remain usable without the skill,\n * and the profile layer that enables cross-instance handoff mounts this row\n * with them. It injects the `interconnect` service so the skill only appears\n * when the transport it describes is actually present.\n * @module @deepseek-ai/dsh-experimental-skill-interconnect\n */\n\nimport { readFile } from 'node:fs/promises'\nimport { Context } from '@deepseek-ai/cordis'\nimport {\n BUNDLED_SKILL_RANK,\n type SkillCandidate,\n type SkillDefinition,\n type SkillProvider,\n} from '@deepseek-ai/dsh-skill'\n// Activates the `Context.interconnect` merge declared by the interconnect service plugin.\nimport type {} from '../interconnect/index.ts'\n\nconst PROVIDER_NAME = 'dsh-interconnect'\nconst SKILL_BODY_URL = new URL('../../assets/dsh-interconnect.md', import.meta.url)\nconst INVOCATION = { modelInvocable: true, userInvocable: true } as const\nconst DESCRIPTION = 'Use the dsh-interconnect tools to exchange messages between DSH sessions, instances, and machines: list live sessions on a known peer instance, send messages, reply to the last sender, and probe liveness. Use whenever you need to message another DSH agent, coordinate across sessions, or respond to an incoming interconnect handoff.'\n/* jscpd:ignore-start -- the bundled-skill provider shape is the same required boilerplate as skill-badge. */\n// Unlike skill-badge, this candidate carries no `resourceBase`: `assets/` holds\n// only the body already inlined as `<skill_instructions>`, and a directory base\n// renders this installation's absolute path into model-visible text, which a\n// recorded session cannot replay elsewhere.\nconst CANDIDATE: SkillCandidate = {\n name: 'dsh-interconnect',\n description: DESCRIPTION,\n invocation: INVOCATION,\n provider: PROVIDER_NAME,\n source: 'bundled',\n rank: BUNDLED_SKILL_RANK,\n locator: SKILL_BODY_URL,\n}\n\nconst provider: SkillProvider = {\n name: PROVIDER_NAME,\n list: () => Promise.resolve([CANDIDATE]),\n async get(_candidate): Promise<SkillDefinition> {\n return {\n name: CANDIDATE.name,\n description: CANDIDATE.description,\n invocation: CANDIDATE.invocation,\n provider: CANDIDATE.provider,\n source: CANDIDATE.source,\n content: await readFile(SKILL_BODY_URL, 'utf8'),\n }\n },\n}\n/* jscpd:ignore-end */\n\n/** Cordis plugin name. */\nexport const name = 'skill-interconnect'\n/** Services required by the companion provider. */\nexport const inject = ['skills', 'interconnect']\n\n/** Register the bundled `dsh-interconnect` skill on `ctx.skills`. */\nexport function apply(ctx: Context): void {\n ctx.skills.registerProvider(() => provider)\n}\n"],
5
+ "mappings": ";AAaA,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,OAIK;AAIP,IAAM,gBAAgB;AACtB,IAAM,iBAAiB,IAAI,IAAI,oCAAoC,YAAY,GAAG;AAClF,IAAM,aAAa,EAAE,gBAAgB,MAAM,eAAe,KAAK;AAC/D,IAAM,cAAc;AAMpB,IAAM,YAA4B;AAAA,EAChC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEA,IAAM,WAA0B;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM,MAAM,QAAQ,QAAQ,CAAC,SAAS,CAAC;AAAA,EACvC,MAAM,IAAI,YAAsC;AAC9C,WAAO;AAAA,MACL,MAAM,UAAU;AAAA,MAChB,aAAa,UAAU;AAAA,MACvB,YAAY,UAAU;AAAA,MACtB,UAAU,UAAU;AAAA,MACpB,QAAQ,UAAU;AAAA,MAClB,SAAS,MAAM,SAAS,gBAAgB,MAAM;AAAA,IAChD;AAAA,EACF;AACF;AAIO,IAAM,OAAO;AAEb,IAAM,SAAS,CAAC,UAAU,cAAc;AAGxC,SAAS,MAAM,KAAoB;AACxC,MAAI,OAAO,iBAAiB,MAAM,QAAQ;AAC5C;",
6
6
  "names": []
7
7
  }
@@ -836,6 +836,8 @@ function assertNever(value) {
836
836
  var INTERCONNECT_TOKEN_REF = "DSH_INTERCONNECT_TOKEN";
837
837
  var PLUGIN_SOURCE = "dsh-interconnect";
838
838
  var MAX_LINK_FRAME_BYTES = 1024 * 1024;
839
+ var DEFAULT_INSTANCE_ID = "dsh";
840
+ var DEFAULT_REQUEST_TIMEOUT_MS = 1e4;
839
841
  var LINK_HANDSHAKE_TIMEOUT_MS = 1e4;
840
842
  var LINK_CHANNEL = "/interconnect/link";
841
843
  var MAX_INSTANCE_ID_CHARS = 256;
@@ -931,8 +933,8 @@ var linkFrameSchema = Schema.union([
931
933
  var InterconnectService = class extends Service {
932
934
  static inject = ["agents", "credentials"];
933
935
  static Config = Schema.object({
934
- instanceId: Schema.string().max(MAX_INSTANCE_ID_CHARS).default("dsh"),
935
- requestTimeoutMs: Schema.natural().max(6e4).default(1e4),
936
+ instanceId: Schema.string().max(MAX_INSTANCE_ID_CHARS).default(DEFAULT_INSTANCE_ID),
937
+ requestTimeoutMs: Schema.natural().max(6e4).default(DEFAULT_REQUEST_TIMEOUT_MS),
936
938
  peers: Schema.dict(Schema.string()).default({}),
937
939
  delivery: Schema.union([Schema.const("followup"), Schema.const("steer"), Schema.const("inject")]).default("followup"),
938
940
  allowResume: Schema.boolean().default(true)
@@ -961,8 +963,8 @@ var InterconnectService = class extends Service {
961
963
  disposed = false;
962
964
  constructor(ctx, config) {
963
965
  super(ctx, "interconnect");
964
- this.instanceId = config.instanceId;
965
- this.requestTimeoutMs = config.requestTimeoutMs;
966
+ this.instanceId = config.instanceId ?? DEFAULT_INSTANCE_ID;
967
+ this.requestTimeoutMs = config.requestTimeoutMs ?? DEFAULT_REQUEST_TIMEOUT_MS;
966
968
  this.delivery = config.delivery ?? "followup";
967
969
  this.allowResume = config.allowResume ?? true;
968
970
  for (const origin of Object.values(config.peers ?? {})) {