@try-works/dsh-righthand 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cordis.patch.yml +1 -1
- package/lib/index.d.ts +8 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -4
- package/lib/index.js.map +1 -1
- package/lib/skills.d.ts +23 -0
- package/lib/skills.d.ts.map +1 -0
- package/lib/skills.js +37 -0
- package/lib/skills.js.map +1 -0
- package/package.json +4 -2
- package/skills/dsh-righthand/SKILL.md +47 -0
- package/src/index.ts +9 -4
- package/src/skills.ts +47 -0
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ partial patch (persisted by the harness settings provider).
|
|
|
64
64
|
The store family needs `ctx.storageDomain`, which the web profile provides
|
|
65
65
|
(`storage` + `storage-json` + `storage-domain` rows). In a profile without
|
|
66
66
|
it — e.g. the headless bundle — the store tools stay dormant and the other
|
|
67
|
-
|
|
67
|
+
seven tools still register; the plugin never fails the boot.
|
|
68
68
|
|
|
69
69
|
## Development
|
|
70
70
|
|
package/cordis.patch.yml
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# guard-tools tools/pre-execute policy needs tools
|
|
9
9
|
#
|
|
10
10
|
# A profile without `storageDomain` (e.g. headless) simply gets the other
|
|
11
|
-
#
|
|
11
|
+
# seven tools; the store family stays dormant instead of failing the boot.
|
|
12
12
|
- insert:
|
|
13
13
|
- id: dsh-righthand
|
|
14
14
|
name: '@try-works/dsh-righthand'
|
package/lib/index.d.ts
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
* the harness's own services (storageDomain, credentials, settings,
|
|
6
6
|
* subprocess, jobs, tools), not hand-rolled primitives.
|
|
7
7
|
*
|
|
8
|
-
* The package's plugin entry (name/inject/apply) mounts the
|
|
9
|
-
*
|
|
8
|
+
* The package's plugin entry (name/inject/apply) mounts the tool families
|
|
9
|
+
* and the packaged skill as child fibers; each child waits on its own
|
|
10
|
+
* services, so a
|
|
10
11
|
* profile without `storageDomain` (e.g. headless) simply gets the other
|
|
11
|
-
*
|
|
12
|
+
* seven tools instead of failing the boot.
|
|
12
13
|
*
|
|
13
14
|
* Modules (each individually mountable via `export * as ...`):
|
|
14
15
|
* - store-tools: rh_store_put/get/delete/list over ctx.storageDomain
|
|
15
16
|
* - secrets-tools: rh_credential_describe/set/unset + rh_settings_get/set
|
|
16
17
|
* - exec-tools: rh_run / rh_run_bg over ctx.subprocess + ctx.jobs
|
|
17
18
|
* - guard-tools: tools/pre-execute policy (config.rules)
|
|
19
|
+
* - skills: the packaged dsh-righthand skill (ctx.skills)
|
|
18
20
|
*
|
|
19
21
|
* @module @try-works/dsh-righthand
|
|
20
22
|
*/
|
|
@@ -23,6 +25,7 @@ import * as storeTools from './store-tools.ts';
|
|
|
23
25
|
import * as secretsTools from './secrets-tools.ts';
|
|
24
26
|
import * as execTools from './exec-tools.ts';
|
|
25
27
|
import * as guardTools from './guard-tools.ts';
|
|
28
|
+
import * as righthandSkills from './skills.ts';
|
|
26
29
|
import type { GuardRule } from './guard-tools.ts';
|
|
27
30
|
export declare const name = "dsh-righthand";
|
|
28
31
|
/** The combined plugin needs no services itself; each child waits on its own. */
|
|
@@ -39,6 +42,7 @@ export interface RighthandConfig {
|
|
|
39
42
|
* instead of failing the whole plugin.
|
|
40
43
|
*/
|
|
41
44
|
export declare function apply(ctx: Context, config?: RighthandConfig): void;
|
|
42
|
-
export { storeTools, secretsTools, execTools, guardTools };
|
|
45
|
+
export { storeTools, secretsTools, execTools, guardTools, righthandSkills };
|
|
46
|
+
export { SKILL_NAME, SKILL_DESCRIPTION, skillDirectory, skillBody } from './skills.ts';
|
|
43
47
|
export type { GuardRule } from './guard-tools.ts';
|
|
44
48
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,eAAe,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC,iFAAiF;AACjF,eAAO,MAAM,MAAM,EAAE,MAAM,EAAO,CAAA;AAElC,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,EAAE,CAAA;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,eAAoB,GAAG,IAAI,CAMtE;AAGD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACtF,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA"}
|
package/lib/index.js
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
* the harness's own services (storageDomain, credentials, settings,
|
|
6
6
|
* subprocess, jobs, tools), not hand-rolled primitives.
|
|
7
7
|
*
|
|
8
|
-
* The package's plugin entry (name/inject/apply) mounts the
|
|
9
|
-
*
|
|
8
|
+
* The package's plugin entry (name/inject/apply) mounts the tool families
|
|
9
|
+
* and the packaged skill as child fibers; each child waits on its own
|
|
10
|
+
* services, so a
|
|
10
11
|
* profile without `storageDomain` (e.g. headless) simply gets the other
|
|
11
|
-
*
|
|
12
|
+
* seven tools instead of failing the boot.
|
|
12
13
|
*
|
|
13
14
|
* Modules (each individually mountable via `export * as ...`):
|
|
14
15
|
* - store-tools: rh_store_put/get/delete/list over ctx.storageDomain
|
|
15
16
|
* - secrets-tools: rh_credential_describe/set/unset + rh_settings_get/set
|
|
16
17
|
* - exec-tools: rh_run / rh_run_bg over ctx.subprocess + ctx.jobs
|
|
17
18
|
* - guard-tools: tools/pre-execute policy (config.rules)
|
|
19
|
+
* - skills: the packaged dsh-righthand skill (ctx.skills)
|
|
18
20
|
*
|
|
19
21
|
* @module @try-works/dsh-righthand
|
|
20
22
|
*/
|
|
@@ -22,6 +24,7 @@ import * as storeTools from "./store-tools.js";
|
|
|
22
24
|
import * as secretsTools from "./secrets-tools.js";
|
|
23
25
|
import * as execTools from "./exec-tools.js";
|
|
24
26
|
import * as guardTools from "./guard-tools.js";
|
|
27
|
+
import * as righthandSkills from "./skills.js";
|
|
25
28
|
export const name = 'dsh-righthand';
|
|
26
29
|
/** The combined plugin needs no services itself; each child waits on its own. */
|
|
27
30
|
export const inject = [];
|
|
@@ -36,7 +39,9 @@ export function apply(ctx, config = {}) {
|
|
|
36
39
|
ctx.plugin(secretsTools);
|
|
37
40
|
ctx.plugin(execTools);
|
|
38
41
|
ctx.plugin(guardTools, { rules: config.rules ?? [] });
|
|
42
|
+
ctx.plugin(righthandSkills);
|
|
39
43
|
}
|
|
40
44
|
// Individual modules stay importable for selective mounting.
|
|
41
|
-
export { storeTools, secretsTools, execTools, guardTools };
|
|
45
|
+
export { storeTools, secretsTools, execTools, guardTools, righthandSkills };
|
|
46
|
+
export { SKILL_NAME, SKILL_DESCRIPTION, skillDirectory, skillBody } from "./skills.js";
|
|
42
47
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,iBAAiB,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,kBAAkB,CAAA;AAC9C,OAAO,KAAK,eAAe,MAAM,aAAa,CAAA;AAG9C,MAAM,CAAC,MAAM,IAAI,GAAG,eAAe,CAAA;AAEnC,iFAAiF;AACjF,MAAM,CAAC,MAAM,MAAM,GAAa,EAAE,CAAA;AAQlC;;;;;GAKG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,SAA0B,EAAE;IAC9D,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IACtB,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;IACxB,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACrB,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC,CAAA;IACrD,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC7B,CAAC;AAED,6DAA6D;AAC7D,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,CAAA;AAC3E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
|
package/lib/skills.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundled dsh-righthand skill registration.
|
|
3
|
+
*
|
|
4
|
+
* Lives at `skills/dsh-righthand/SKILL.md` and registers with a directory
|
|
5
|
+
* `resourceBase` pointing at the bundled copy, so any relative references
|
|
6
|
+
* inside the SKILL.md resolve against the package's own files (the
|
|
7
|
+
* dsh-plugin packaged-skill standard, same shape as dsh-anti-slop).
|
|
8
|
+
*
|
|
9
|
+
* @module @try-works/dsh-righthand/src/skills
|
|
10
|
+
*/
|
|
11
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
+
export declare const name = "righthand-skills";
|
|
13
|
+
export declare const inject: string[];
|
|
14
|
+
export declare const SKILL_NAME = "dsh-righthand";
|
|
15
|
+
/** Routing description shown by skill discovery (matches the SKILL.md frontmatter). */
|
|
16
|
+
export declare const SKILL_DESCRIPTION = "Use when a task needs the righthand toolkit \u2014 durable key-value storage (rh_store_*), credential and settings management (rh_credential_* / rh_settings_*), governed command execution (rh_run / rh_run_bg), or its tool guard policy. Covers tool reference, guard semantics, and service availability.";
|
|
17
|
+
/** The bundled skill directory (this module lives in the bundle at lib/skills.js). */
|
|
18
|
+
export declare function skillDirectory(): string;
|
|
19
|
+
/** The skill body: SKILL.md verbatim from the bundled skill directory. */
|
|
20
|
+
export declare function skillBody(): string;
|
|
21
|
+
/** Register the packaged skill. Returns the cordis effect disposer. */
|
|
22
|
+
export declare function apply(ctx: Context): void;
|
|
23
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAMlD,eAAO,MAAM,IAAI,qBAAqB,CAAA;AACtC,eAAO,MAAM,MAAM,UAAa,CAAA;AAEhC,eAAO,MAAM,UAAU,kBAAkB,CAAA;AAEzC,uFAAuF;AACvF,eAAO,MAAM,iBAAiB,kTAA6S,CAAA;AAE3U,sFAAsF;AACtF,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,0EAA0E;AAC1E,wBAAgB,SAAS,IAAI,MAAM,CAElC;AAED,uEAAuE;AACvE,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAQxC"}
|
package/lib/skills.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundled dsh-righthand skill registration.
|
|
3
|
+
*
|
|
4
|
+
* Lives at `skills/dsh-righthand/SKILL.md` and registers with a directory
|
|
5
|
+
* `resourceBase` pointing at the bundled copy, so any relative references
|
|
6
|
+
* inside the SKILL.md resolve against the package's own files (the
|
|
7
|
+
* dsh-plugin packaged-skill standard, same shape as dsh-anti-slop).
|
|
8
|
+
*
|
|
9
|
+
* @module @try-works/dsh-righthand/src/skills
|
|
10
|
+
*/
|
|
11
|
+
import { readFileSync } from 'node:fs';
|
|
12
|
+
import { dirname, join } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
export const name = 'righthand-skills';
|
|
15
|
+
export const inject = ['skills'];
|
|
16
|
+
export const SKILL_NAME = 'dsh-righthand';
|
|
17
|
+
/** Routing description shown by skill discovery (matches the SKILL.md frontmatter). */
|
|
18
|
+
export const SKILL_DESCRIPTION = 'Use when a task needs the righthand toolkit — durable key-value storage (rh_store_*), credential and settings management (rh_credential_* / rh_settings_*), governed command execution (rh_run / rh_run_bg), or its tool guard policy. Covers tool reference, guard semantics, and service availability.';
|
|
19
|
+
/** The bundled skill directory (this module lives in the bundle at lib/skills.js). */
|
|
20
|
+
export function skillDirectory() {
|
|
21
|
+
return join(dirname(fileURLToPath(import.meta.url)), '..', `skills/${SKILL_NAME}`);
|
|
22
|
+
}
|
|
23
|
+
/** The skill body: SKILL.md verbatim from the bundled skill directory. */
|
|
24
|
+
export function skillBody() {
|
|
25
|
+
return readFileSync(join(skillDirectory(), 'SKILL.md'), 'utf8');
|
|
26
|
+
}
|
|
27
|
+
/** Register the packaged skill. Returns the cordis effect disposer. */
|
|
28
|
+
export function apply(ctx) {
|
|
29
|
+
ctx.skills.register({
|
|
30
|
+
name: SKILL_NAME,
|
|
31
|
+
description: SKILL_DESCRIPTION,
|
|
32
|
+
source: 'bundled',
|
|
33
|
+
content: skillBody(),
|
|
34
|
+
resourceBase: { kind: 'directory', path: skillDirectory() },
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAItC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAA;AACtC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAA;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,eAAe,CAAA;AAEzC,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG,0SAA0S,CAAA;AAE3U,sFAAsF;AACtF,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,UAAU,EAAE,CAAC,CAAA;AACpF,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,CAAA;AACjE,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QAClB,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,iBAAiB;QAC9B,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,SAAS,EAAE;QACpB,YAAY,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE;KAC5D,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@try-works/dsh-righthand",
|
|
3
3
|
"description": "DeepSeek Harness plugin: DSH-native righthand tools — durable KV store, credential/settings management, governed exec, and a tool guard",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"@deepseek-ai/dsh-settings": "^0.1.0-rc.5",
|
|
29
29
|
"@deepseek-ai/dsh-subprocess": "^0.1.0-rc.5",
|
|
30
30
|
"@deepseek-ai/dsh-jobs": "^0.1.0-rc.5",
|
|
31
|
-
"@deepseek-ai/schemastery": "^3.18.1"
|
|
31
|
+
"@deepseek-ai/schemastery": "^3.18.1",
|
|
32
|
+
"@deepseek-ai/dsh-skill": "^0.1.0-rc.5"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@deepseek-ai/cordis": "file:D:/deepseek-harness/vendor/cordis",
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"files": [
|
|
73
74
|
"lib",
|
|
74
75
|
"src",
|
|
76
|
+
"skills",
|
|
75
77
|
"cordis.patch.yml",
|
|
76
78
|
"README.md",
|
|
77
79
|
"LICENSE"
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dsh-righthand
|
|
3
|
+
description: Use when a task needs the righthand toolkit — durable key-value storage (rh_store_*), credential and settings management (rh_credential_* / rh_settings_*), governed command execution (rh_run / rh_run_bg), or its tool guard policy. Covers tool reference, guard semantics, and service availability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# dsh-righthand
|
|
7
|
+
|
|
8
|
+
The righthand toolkit: DSH-native tools over the harness's own services. Use this skill as the **tool reference** when any `rh_*` tool applies.
|
|
9
|
+
|
|
10
|
+
## Tool families
|
|
11
|
+
|
|
12
|
+
| Family | Tools | Backing service | Use when |
|
|
13
|
+
|--------|-------|-----------------|----------|
|
|
14
|
+
| store | `rh_store_put` / `rh_store_get` / `rh_store_delete` / `rh_store_list` | `ctx.storageDomain` (domain KV) | The task needs durable state across turns: a catalog, counter, cache, or note. Prefer this over files for structured JSON records. |
|
|
15
|
+
| secrets | `rh_credential_describe` / `rh_credential_set` / `rh_credential_unset` | `ctx.credentials` | The task must check, store, or remove a credential reference (e.g. `CLOUDFLARE_API_TOKEN`). Values are written durably and **never echoed back**. |
|
|
16
|
+
| settings | `rh_settings_get` / `rh_settings_set` | `ctx.settings` (namespace `righthand`) | Reading or patching righthand settings (`accountId`, `defaultZone`, `defaultScriptPrefix`). |
|
|
17
|
+
| exec | `rh_run` / `rh_run_bg` | `ctx.subprocess` + `ctx.jobs` | Running one command (argv array, no shell interpretation). `rh_run` collects bounded output; `rh_run_bg` starts an owner-scoped background job and returns its id. |
|
|
18
|
+
| guard | (policy, not a tool) | `ctx.tools` `tools/pre-execute` | Configured via plugin config `rules`; gates tools by name prefix with `allow` / `deny` / `ask` modes. |
|
|
19
|
+
|
|
20
|
+
## Store semantics
|
|
21
|
+
|
|
22
|
+
- One domain `righthand_store`: a `rows` table (string key → JSON value + timestamp) and a global write counter.
|
|
23
|
+
- `rh_store_get` returns `{ found, key, value?, updatedAt? }` — `found: false` means the key is absent, not an error.
|
|
24
|
+
- Writes are durable (backend flush before commit) and serialized on one write chain; values must be JSON-serializable.
|
|
25
|
+
|
|
26
|
+
## Credential semantics
|
|
27
|
+
|
|
28
|
+
- `rh_credential_describe` reports `configured`, `source`, `writable` — never the value.
|
|
29
|
+
- `rh_credential_set` requires a non-empty value and returns only `{ ref, stored: true }`.
|
|
30
|
+
- References are POSIX env-var style names (uppercase, e.g. `CLOUDFLARE_API_TOKEN`).
|
|
31
|
+
|
|
32
|
+
## Settings namespace `righthand`
|
|
33
|
+
|
|
34
|
+
| Key | Default | Meaning |
|
|
35
|
+
|-----|---------|---------|
|
|
36
|
+
| `accountId` | `""` | Cloudflare account id used by righthand Cloudflare tools |
|
|
37
|
+
| `defaultScriptPrefix` | `"rh-"` | default name prefix for generated workers/scripts |
|
|
38
|
+
| `defaultZone` | `""` | default Cloudflare zone |
|
|
39
|
+
|
|
40
|
+
## Guard policy
|
|
41
|
+
|
|
42
|
+
Rules come from the plugin config (`rules: [{ toolPrefix, mode, ask? }]`). `deny` throws before dispatch; `ask` defers to the policy function (return true to allow); `allow` passes through. Tools matching no rule are unaffected.
|
|
43
|
+
|
|
44
|
+
## Service availability
|
|
45
|
+
|
|
46
|
+
- **web profile**: all twelve tools register (`storageDomain` is provided by the web app rows).
|
|
47
|
+
- **other profiles** (e.g. headless): the store family stays dormant; the other seven tools still register. The plugin never fails the boot.
|
package/src/index.ts
CHANGED
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
* the harness's own services (storageDomain, credentials, settings,
|
|
6
6
|
* subprocess, jobs, tools), not hand-rolled primitives.
|
|
7
7
|
*
|
|
8
|
-
* The package's plugin entry (name/inject/apply) mounts the
|
|
9
|
-
*
|
|
8
|
+
* The package's plugin entry (name/inject/apply) mounts the tool families
|
|
9
|
+
* and the packaged skill as child fibers; each child waits on its own
|
|
10
|
+
* services, so a
|
|
10
11
|
* profile without `storageDomain` (e.g. headless) simply gets the other
|
|
11
|
-
*
|
|
12
|
+
* seven tools instead of failing the boot.
|
|
12
13
|
*
|
|
13
14
|
* Modules (each individually mountable via `export * as ...`):
|
|
14
15
|
* - store-tools: rh_store_put/get/delete/list over ctx.storageDomain
|
|
15
16
|
* - secrets-tools: rh_credential_describe/set/unset + rh_settings_get/set
|
|
16
17
|
* - exec-tools: rh_run / rh_run_bg over ctx.subprocess + ctx.jobs
|
|
17
18
|
* - guard-tools: tools/pre-execute policy (config.rules)
|
|
19
|
+
* - skills: the packaged dsh-righthand skill (ctx.skills)
|
|
18
20
|
*
|
|
19
21
|
* @module @try-works/dsh-righthand
|
|
20
22
|
*/
|
|
@@ -24,6 +26,7 @@ import * as storeTools from './store-tools.ts'
|
|
|
24
26
|
import * as secretsTools from './secrets-tools.ts'
|
|
25
27
|
import * as execTools from './exec-tools.ts'
|
|
26
28
|
import * as guardTools from './guard-tools.ts'
|
|
29
|
+
import * as righthandSkills from './skills.ts'
|
|
27
30
|
import type { GuardRule } from './guard-tools.ts'
|
|
28
31
|
|
|
29
32
|
export const name = 'dsh-righthand'
|
|
@@ -48,9 +51,11 @@ export function apply(ctx: Context, config: RighthandConfig = {}): void {
|
|
|
48
51
|
ctx.plugin(secretsTools)
|
|
49
52
|
ctx.plugin(execTools)
|
|
50
53
|
ctx.plugin(guardTools, { rules: config.rules ?? [] })
|
|
54
|
+
ctx.plugin(righthandSkills)
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
// Individual modules stay importable for selective mounting.
|
|
54
|
-
export { storeTools, secretsTools, execTools, guardTools }
|
|
58
|
+
export { storeTools, secretsTools, execTools, guardTools, righthandSkills }
|
|
59
|
+
export { SKILL_NAME, SKILL_DESCRIPTION, skillDirectory, skillBody } from './skills.ts'
|
|
55
60
|
export type { GuardRule } from './guard-tools.ts'
|
|
56
61
|
|
package/src/skills.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The bundled dsh-righthand skill registration.
|
|
3
|
+
*
|
|
4
|
+
* Lives at `skills/dsh-righthand/SKILL.md` and registers with a directory
|
|
5
|
+
* `resourceBase` pointing at the bundled copy, so any relative references
|
|
6
|
+
* inside the SKILL.md resolve against the package's own files (the
|
|
7
|
+
* dsh-plugin packaged-skill standard, same shape as dsh-anti-slop).
|
|
8
|
+
*
|
|
9
|
+
* @module @try-works/dsh-righthand/src/skills
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { readFileSync } from 'node:fs'
|
|
13
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
14
|
+
// Type-only import activates the cordis Context augmentation for `ctx.skills`.
|
|
15
|
+
import type {} from '@deepseek-ai/dsh-skill'
|
|
16
|
+
import { dirname, join } from 'node:path'
|
|
17
|
+
import { fileURLToPath } from 'node:url'
|
|
18
|
+
|
|
19
|
+
export const name = 'righthand-skills'
|
|
20
|
+
export const inject = ['skills']
|
|
21
|
+
|
|
22
|
+
export const SKILL_NAME = 'dsh-righthand'
|
|
23
|
+
|
|
24
|
+
/** Routing description shown by skill discovery (matches the SKILL.md frontmatter). */
|
|
25
|
+
export const SKILL_DESCRIPTION = 'Use when a task needs the righthand toolkit — durable key-value storage (rh_store_*), credential and settings management (rh_credential_* / rh_settings_*), governed command execution (rh_run / rh_run_bg), or its tool guard policy. Covers tool reference, guard semantics, and service availability.'
|
|
26
|
+
|
|
27
|
+
/** The bundled skill directory (this module lives in the bundle at lib/skills.js). */
|
|
28
|
+
export function skillDirectory(): string {
|
|
29
|
+
return join(dirname(fileURLToPath(import.meta.url)), '..', `skills/${SKILL_NAME}`)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** The skill body: SKILL.md verbatim from the bundled skill directory. */
|
|
33
|
+
export function skillBody(): string {
|
|
34
|
+
return readFileSync(join(skillDirectory(), 'SKILL.md'), 'utf8')
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** Register the packaged skill. Returns the cordis effect disposer. */
|
|
38
|
+
export function apply(ctx: Context): void {
|
|
39
|
+
ctx.skills.register({
|
|
40
|
+
name: SKILL_NAME,
|
|
41
|
+
description: SKILL_DESCRIPTION,
|
|
42
|
+
source: 'bundled',
|
|
43
|
+
content: skillBody(),
|
|
44
|
+
resourceBase: { kind: 'directory', path: skillDirectory() },
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|