@kelloggt/dsh-program-agents 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ export declare function registerBundledSkill(ctx: Context): void;
@@ -0,0 +1,45 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { fileURLToPath } from 'node:url';
3
+ import { BUNDLED_SKILL_RANK } from '@deepseek-ai/dsh-skill';
4
+ import { parse as parseYaml } from 'yaml';
5
+ import { object } from './validation.js';
6
+ const name = 'program-agents';
7
+ // Both src/host and dist/host sit two levels below the package root. The
8
+ // bundled host entries keep this same layout, including after npm installation.
9
+ const directory = new URL('../../skills/program-agents/', import.meta.url);
10
+ const path = fileURLToPath(new URL('SKILL.md', directory));
11
+ const resourceBase = { kind: 'directory', path: fileURLToPath(directory) };
12
+ async function definition() {
13
+ const raw = await readFile(path, 'utf8');
14
+ const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(raw);
15
+ if (!match)
16
+ throw new Error(`Missing skill frontmatter: ${path}`);
17
+ const metadata = object(parseYaml(match[1]));
18
+ if (metadata.name !== name || typeof metadata.description !== 'string' || !metadata.description.trim()) {
19
+ throw new Error(`Invalid bundled skill name or description: ${path}`);
20
+ }
21
+ for (const key of ['disable-model-invocation', 'user-invocable']) {
22
+ if (metadata[key] !== undefined && typeof metadata[key] !== 'boolean')
23
+ throw new Error(`Invalid ${key} in ${path}`);
24
+ }
25
+ return {
26
+ name, description: metadata.description, path, resourceBase, metadata,
27
+ provider: name, source: 'bundled', content: match[2],
28
+ invocation: {
29
+ modelInvocable: metadata['disable-model-invocation'] !== true,
30
+ userInvocable: metadata['user-invocable'] !== false,
31
+ },
32
+ };
33
+ }
34
+ const provider = {
35
+ name,
36
+ async list() {
37
+ const { content: _content, ...skill } = await definition();
38
+ return [{ ...skill, rank: BUNDLED_SKILL_RANK, locator: path }];
39
+ },
40
+ get: () => definition(),
41
+ };
42
+ export function registerBundledSkill(ctx) {
43
+ ctx.skills.registerProvider(() => provider);
44
+ }
45
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/host/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,kBAAkB,EAA4C,MAAM,wBAAwB,CAAC;AACtG,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,IAAI,GAAG,gBAAgB,CAAC;AAC9B,yEAAyE;AACzE,gFAAgF;AAChF,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,8BAA8B,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3E,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC;AAC3D,MAAM,YAAY,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,EAAW,CAAC;AAEpF,KAAK,UAAU,UAAU;IACvB,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,kDAAkD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3E,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,IAAI,EAAE,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC;IAC9C,IAAI,QAAQ,CAAC,IAAI,KAAK,I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,CAAC,CAAC;AAC9C,CAAC"}
@@ -4,7 +4,9 @@ Current UI/runtime: see `composer-strip.md` for program_register, command/watch
4
4
 
5
5
  ## Status
6
6
 
7
- Local experimental source package, not published. Targets DSH0.2.1-rc.2, Cordis4.0.5. Node22.18+ with erasable TS or precompiled JS. Build with pnpm (lockfile committed). No automatic mutation of a user's profiles, credentials, model settings or running server.
7
+ Published npm package `@kelloggt/dsh-program-agents`. Install with `dsh plugin --profile web add @kelloggt/dsh-program-agents`; the bundle enables the host and browser contribution. Version 0.1.1 adds automatic skill discovery through DSH's native provider registry. Targets DSH0.2.1-rc.2, Cordis4.0.5. Node22.18+ with erasable TS or precompiled JS. Build source checkouts with pnpm (lockfile committed).
8
+
9
+ The bundled skill is loaded from the installed package, including its frontmatter and resource directory. Registration follows the optional `skills` service lifecycle, so the program tools still load in profiles without skill support. Unloading the plugin removes its provider. Project and user skill overrides retain DSH's normal precedence; an old copied skill must be removed if you want to follow the packaged version. Registration writes no files into a user's skill directories.
8
10
 
9
11
  ## Host and web contribution
10
12
 
@@ -26,7 +26,7 @@ It should contain `dist/host/index.js`, `dist/client.js`, the SDK and runtime ex
26
26
 
27
27
  The publishing dry run skips Git checks so it can preview uncommitted work. The actual publishing command keeps pnpm's normal Git checks enabled.
28
28
 
29
- Test the archive in a disposable DSH profile before publishing. Installing it with `dsh plugin --profile web add /absolute/path/to/the/archive.tgz` enables the plugin through its bundle patch. Install the skill as described in the README.
29
+ Test the archive in a disposable DSH profile before publishing. Installing it with `dsh plugin --profile web add /absolute/path/to/the/archive.tgz` enables the plugin through its bundle patch and registers the bundled skill automatically. Check that `program-agents` is available without copying it into a user skill directory.
30
30
 
31
31
  ## Publish the verified archive
32
32
 
@@ -38,7 +38,7 @@ pnpm whoami --registry=https://registry.npmjs.org/
38
38
  pnpm release:publish
39
39
  ```
40
40
 
41
- The username check should print `kelloggt` for this personal scope. Follow any authentication prompts from npm. Publishing uses the existing archive without rebuilding it. After the first release succeeds, remove the pending-release wording from the README and make npm installation the default. For future releases, update the package version and run `pnpm release:pack` again; the scripts select the matching archive automatically.
41
+ The username check should print `kelloggt` for this personal scope. Follow any authentication prompts from npm. Publishing uses the existing archive without rebuilding it. For future releases, update the package version and run `pnpm release:pack` again; the scripts select the matching archive automatically.
42
42
 
43
43
  If publishing fails with **E403: Two-factor authentication or granular access token with bypass 2fa enabled is required**, check your account's 2FA settings. After enabling 2FA, run `pnpm release:login` again and retry `pnpm release:publish` in an interactive terminal. The authentication error does not require rebuilding the archive. If your configured method uses an authenticator code, you can pass it directly with `pnpm release:publish --otp=YOUR_CURRENT_CODE`; the release script forwards that option to pnpm.
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kelloggt/dsh-program-agents",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Supervised TypeScript/JavaScript programs for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -75,6 +75,7 @@
75
75
  "@deepseek-ai/schemastery": "3.18.5",
76
76
  "@modelcontextprotocol/core": "2.2.0",
77
77
  "ajv": "^8.20.0",
78
+ "yaml": "2.9.1",
78
79
  "zod": "^4.6.7"
79
80
  },
80
81
  "peerDependencies": {
@@ -83,6 +84,7 @@
83
84
  "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
84
85
  "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
85
86
  "@deepseek-ai/dsh-session": "0.2.1-rc.2",
87
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
86
88
  "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
87
89
  "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2"
88
90
  },
@@ -92,6 +94,7 @@
92
94
  "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.2",
93
95
  "@deepseek-ai/dsh-llm": "0.2.1-rc.2",
94
96
  "@deepseek-ai/dsh-session": "0.2.1-rc.2",
97
+ "@deepseek-ai/dsh-skill": "0.2.1-rc.2",
95
98
  "@deepseek-ai/dsh-tools": "0.2.1-rc.2",
96
99
  "@deepseek-ai/dsh-typert-protocol": "0.2.1-rc.2",
97
100
  "@types/node": "^22.18.0",