@dot-skill/workspace 0.4.2 → 0.5.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.md +45 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +17 -3
- package/package.json +20 -5
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# `@dot-skill/workspace`
|
|
2
|
+
|
|
3
|
+
Local working tree for authoring `.skill` packages — sections, stage, compile, checkpoint, and mint.
|
|
4
|
+
|
|
5
|
+
Git-like layout under `.skill/`. Agents propose sections; humans stage and approve; compile produces a continuity draft or a release package.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @dot-skill/workspace
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Typically used via [`skillerr`](https://www.npmjs.com/package/skillerr) (`skill init`, `propose`, `checkpoint`, `compile`, `load`).
|
|
14
|
+
|
|
15
|
+
## Layout
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
.skill/
|
|
19
|
+
config.json
|
|
20
|
+
sections/*.json
|
|
21
|
+
index.json # staged ids
|
|
22
|
+
HEAD.json
|
|
23
|
+
objects/*.skill
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Concept | Command (CLI) |
|
|
27
|
+
|---------|----------------|
|
|
28
|
+
| init | `skill init` |
|
|
29
|
+
| propose | `skill propose` (agent + `SKILL_HOST`) |
|
|
30
|
+
| stage | `skill add` |
|
|
31
|
+
| status | `skill status` |
|
|
32
|
+
| handoff | `skill checkpoint` |
|
|
33
|
+
| release | `skill compile --approve --mint` |
|
|
34
|
+
| resume | `skill load` |
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- [`@dot-skill/core`](https://www.npmjs.com/package/@dot-skill/core) — compile / mint
|
|
39
|
+
- [`skillerr`](https://www.npmjs.com/package/skillerr) — public install / user-facing CLI
|
|
40
|
+
|
|
41
|
+
Docs: [WORKSPACE.md](https://github.com/dot-skill/dot-skill/blob/main/docs/WORKSPACE.md) · [CONTINUITY.md](https://github.com/dot-skill/dot-skill/blob/main/docs/CONTINUITY.md)
|
|
42
|
+
|
|
43
|
+
## License
|
|
44
|
+
|
|
45
|
+
MIT
|
package/dist/index.d.ts
CHANGED
|
@@ -103,6 +103,8 @@ export interface CompileWorkspaceOptions {
|
|
|
103
103
|
mint?: boolean;
|
|
104
104
|
profile?: SkillCompileProfile;
|
|
105
105
|
host?: string;
|
|
106
|
+
agent_runtime?: string;
|
|
107
|
+
agent_version?: string;
|
|
106
108
|
generation_usage?: GenerationUsage;
|
|
107
109
|
input_tokens?: number;
|
|
108
110
|
output_tokens?: number;
|
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* objects/<id>.skill # continuity drafts / release packages
|
|
11
11
|
*/
|
|
12
12
|
import { mkdir, readFile, writeFile, readdir, unlink } from "node:fs/promises";
|
|
13
|
-
import { existsSync } from "node:fs";
|
|
13
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
14
14
|
import { join, resolve } from "node:path";
|
|
15
15
|
import { createHash, randomUUID } from "node:crypto";
|
|
16
16
|
import { isValidAgentHost, PROTOCOL_VERSION } from "@dot-skill/protocol";
|
|
@@ -22,7 +22,8 @@ function id(prefix) {
|
|
|
22
22
|
export function requireAgentHost(host) {
|
|
23
23
|
const h = host ?? process.env.SKILL_HOST;
|
|
24
24
|
if (!isValidAgentHost(h)) {
|
|
25
|
-
throw new Error("AI agent provenance required. Set SKILL_HOST=cursor|ollama|lmstudio|llama-cpp|custom-agent|…
|
|
25
|
+
throw new Error("AI agent provenance required. Set SKILL_HOST=cursor|ollama|lmstudio|llama-cpp|custom-agent|… " +
|
|
26
|
+
"(not human/cli/shell/manual). Env alone never yields verified_issuer trust.");
|
|
26
27
|
}
|
|
27
28
|
return h;
|
|
28
29
|
}
|
|
@@ -286,6 +287,14 @@ async function toSkillSource(root, staged, title, profile, usage, hostOverride)
|
|
|
286
287
|
source_protocol_version: PROTOCOL_VERSION,
|
|
287
288
|
};
|
|
288
289
|
}
|
|
290
|
+
function loadWorkspaceIdentity() {
|
|
291
|
+
const metadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
292
|
+
if (typeof metadata.name !== "string" || typeof metadata.version !== "string") {
|
|
293
|
+
throw new Error("Invalid @dot-skill/workspace package metadata");
|
|
294
|
+
}
|
|
295
|
+
return { name: metadata.name, version: metadata.version };
|
|
296
|
+
}
|
|
297
|
+
const WORKSPACE_IDENTITY = loadWorkspaceIdentity();
|
|
289
298
|
/**
|
|
290
299
|
* Continuity checkpoint — partial OK, privacy-scrubbed handoff draft.
|
|
291
300
|
*/
|
|
@@ -350,6 +359,10 @@ export async function compileWorkspace(root, opts = {}) {
|
|
|
350
359
|
if (profile !== "release") {
|
|
351
360
|
throw new Error("Mint only allowed with --profile release (not continuity drafts).");
|
|
352
361
|
}
|
|
362
|
+
const agentRuntime = process.env.SKILL_AGENT_RUNTIME ?? opts.agent_runtime ?? WORKSPACE_IDENTITY.name;
|
|
363
|
+
const agentVersion = process.env.SKILL_AGENT_VERSION ??
|
|
364
|
+
opts.agent_version ??
|
|
365
|
+
(agentRuntime === WORKSPACE_IDENTITY.name ? WORKSPACE_IDENTITY.version : "unknown");
|
|
353
366
|
const sealed = mintSkillPackage(compiled.files, {
|
|
354
367
|
host: requireAgentHost(opts.host),
|
|
355
368
|
provider: process.env.SKILL_PROVIDER,
|
|
@@ -359,7 +372,8 @@ export async function compileWorkspace(root, opts = {}) {
|
|
|
359
372
|
? redactSecrets(process.env.SKILL_ENDPOINT)
|
|
360
373
|
: undefined,
|
|
361
374
|
actors: [process.env.SKILL_ACTOR ?? "human"],
|
|
362
|
-
agent_runtime:
|
|
375
|
+
agent_runtime: agentRuntime,
|
|
376
|
+
agent_version: agentVersion,
|
|
363
377
|
});
|
|
364
378
|
bytes = sealed.packageBytes;
|
|
365
379
|
compiled = { ...compiled, files: sealed.files, packageBytes: sealed.packageBytes };
|
package/package.json
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dot-skill/workspace",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Local workspace for sections, stage, compile, checkpoint, and mint",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Bharat Dudeja",
|
|
8
8
|
"url": "https://github.com/bharatdudeja13-cmd"
|
|
9
9
|
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"skill",
|
|
12
|
+
"dot-skill",
|
|
13
|
+
".skill",
|
|
14
|
+
"ai-agents",
|
|
15
|
+
"agent-skills",
|
|
16
|
+
"workspace",
|
|
17
|
+
"continuity"
|
|
18
|
+
],
|
|
10
19
|
"type": "module",
|
|
11
20
|
"main": "./dist/index.js",
|
|
12
21
|
"types": "./dist/index.d.ts",
|
|
@@ -18,6 +27,10 @@
|
|
|
18
27
|
"url": "https://github.com/dot-skill/dot-skill.git",
|
|
19
28
|
"directory": "packages/workspace"
|
|
20
29
|
},
|
|
30
|
+
"homepage": "https://github.com/dot-skill/dot-skill#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/dot-skill/dot-skill/issues"
|
|
33
|
+
},
|
|
21
34
|
"exports": {
|
|
22
35
|
".": {
|
|
23
36
|
"types": "./dist/index.d.ts",
|
|
@@ -25,15 +38,17 @@
|
|
|
25
38
|
}
|
|
26
39
|
},
|
|
27
40
|
"files": [
|
|
28
|
-
"dist"
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
29
44
|
],
|
|
30
45
|
"scripts": {
|
|
31
46
|
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
32
47
|
"prepack": "npm run build"
|
|
33
48
|
},
|
|
34
49
|
"dependencies": {
|
|
35
|
-
"@dot-skill/core": "^0.
|
|
36
|
-
"@dot-skill/protocol": "^0.
|
|
50
|
+
"@dot-skill/core": "^0.5.0",
|
|
51
|
+
"@dot-skill/protocol": "^0.5.0"
|
|
37
52
|
},
|
|
38
53
|
"devDependencies": {
|
|
39
54
|
"@types/node": "^22.15.21",
|