@dot-skill/workspace 0.4.2 → 0.4.3

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/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";
@@ -286,6 +286,14 @@ async function toSkillSource(root, staged, title, profile, usage, hostOverride)
286
286
  source_protocol_version: PROTOCOL_VERSION,
287
287
  };
288
288
  }
289
+ function loadWorkspaceIdentity() {
290
+ const metadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
291
+ if (typeof metadata.name !== "string" || typeof metadata.version !== "string") {
292
+ throw new Error("Invalid @dot-skill/workspace package metadata");
293
+ }
294
+ return { name: metadata.name, version: metadata.version };
295
+ }
296
+ const WORKSPACE_IDENTITY = loadWorkspaceIdentity();
289
297
  /**
290
298
  * Continuity checkpoint — partial OK, privacy-scrubbed handoff draft.
291
299
  */
@@ -350,6 +358,10 @@ export async function compileWorkspace(root, opts = {}) {
350
358
  if (profile !== "release") {
351
359
  throw new Error("Mint only allowed with --profile release (not continuity drafts).");
352
360
  }
361
+ const agentRuntime = process.env.SKILL_AGENT_RUNTIME ?? opts.agent_runtime ?? WORKSPACE_IDENTITY.name;
362
+ const agentVersion = process.env.SKILL_AGENT_VERSION ??
363
+ opts.agent_version ??
364
+ (agentRuntime === WORKSPACE_IDENTITY.name ? WORKSPACE_IDENTITY.version : "unknown");
353
365
  const sealed = mintSkillPackage(compiled.files, {
354
366
  host: requireAgentHost(opts.host),
355
367
  provider: process.env.SKILL_PROVIDER,
@@ -359,7 +371,8 @@ export async function compileWorkspace(root, opts = {}) {
359
371
  ? redactSecrets(process.env.SKILL_ENDPOINT)
360
372
  : undefined,
361
373
  actors: [process.env.SKILL_ACTOR ?? "human"],
362
- agent_runtime: process.env.SKILL_AGENT_RUNTIME ?? "@dot-skill/cli",
374
+ agent_runtime: agentRuntime,
375
+ agent_version: agentVersion,
363
376
  });
364
377
  bytes = sealed.packageBytes;
365
378
  compiled = { ...compiled, files: sealed.files, packageBytes: sealed.packageBytes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dot-skill/workspace",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Git-like local .skill workspace — sections, stage, compile, checkpoint, mint",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -32,8 +32,8 @@
32
32
  "prepack": "npm run build"
33
33
  },
34
34
  "dependencies": {
35
- "@dot-skill/core": "^0.4.2",
36
- "@dot-skill/protocol": "^0.4.2"
35
+ "@dot-skill/core": "^0.4.3",
36
+ "@dot-skill/protocol": "^0.4.3"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^22.15.21",