@tangle-network/agent-profile-materialize 0.26.0 → 0.26.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.
@@ -1,4 +1,4 @@
1
1
  import type { WorkspacePlan, WorkspacePlanApplication } from "./plan-types.js";
2
2
  export declare function bindConcurrentLaunch(plan: WorkspacePlan, application: WorkspacePlanApplication, revisionWorkspaceDir: string, options?: {
3
- readonly secretOpenCodeConfigDirectory?: boolean;
3
+ readonly secretOpenCodeRevision?: boolean;
4
4
  }): WorkspacePlanApplication["spawn"];
@@ -1,18 +1,22 @@
1
1
  import { join } from "node:path";
2
2
  /**
3
- * Paths OpenCode discovers relative to its native cwd: content-only resources,
4
- * skills, and its standard agent and command definitions (OpenCode reads
3
+ * Paths a secret OpenCode revision serves from its own immutable tree:
4
+ * read-only profile content under `reference/`, skills, and OpenCode's
5
+ * standard agent and command definitions (OpenCode reads
5
6
  * `.opencode/{agent,agents}/**\/*.md` and `.opencode/{command,commands}/**\/*.md`).
6
7
  */
7
- const SECRET_REVISION_NATIVE_PATH = /^(?:\.opencode\/skills\/|\.opencode\/(?:agents?|commands?)\/(?:[^./][^/]*\/)*[^./][^/]*\.md$)/u;
8
+ const SECRET_REVISION_NATIVE_PATH = /^(?:reference\/|\.opencode\/skills\/|\.opencode\/(?:agents?|commands?)\/(?:[^./][^/]*\/)*[^./][^/]*\.md$)/u;
8
9
  /**
9
- * A secret OpenCode revision binds its immutable, digest-attested .opencode
10
- * directory explicitly, so native agent, command and skill resources remain
11
- * visible without discovering mutable shared-workspace configuration. The binding stays limited to
12
- * OpenCode's standard paths, never an app's own directory.
10
+ * A secret OpenCode turn launches with its revision's `workspace` as cwd and
11
+ * that tree's `.opencode` as its explicit config directory (the sealed launch
12
+ * in sdk-provider-opencode). So skills, agents and commands load from the
13
+ * digest-attested revision, and a cwd-relative `reference/` path resolves to
14
+ * this revision's own read-only copy, never to the shared workspace that
15
+ * concurrent revisions share. The binding stays limited to these paths, never
16
+ * an app's own directory.
13
17
  */
14
18
  function ridesSecretRevision(plan, file, options) {
15
- return (options.secretOpenCodeConfigDirectory === true &&
19
+ return (options.secretOpenCodeRevision === true &&
16
20
  plan.harness === "opencode" &&
17
21
  (file.root ?? "workspace") === "workspace" &&
18
22
  SECRET_REVISION_NATIVE_PATH.test(file.relPath));
@@ -29,11 +29,10 @@ export async function prepareSecretConcurrentProfileRevision(input) {
29
29
  throw new Error(`Secret OpenCode reserves ${name} for its launch binding`);
30
30
  }
31
31
  }
32
+ // Workspace `reference/` files stay in this revision's read-only tree. The
33
+ // sealed launch runs from that tree, so a cwd-relative `reference/` path
34
+ // reads this revision's copy and nothing is written to the shared workspace.
32
35
  let plan = prepareExplicitOpenCodePlan(input.plan);
33
- if (plan.files.some((file) => (file.root ?? "workspace") === "workspace" &&
34
- file.relPath.startsWith("reference/"))) {
35
- throw new Error("Secret OpenCode cannot bind cwd-relative reference resources to a shared data workspace");
36
- }
37
36
  if (input.providerConfig) {
38
37
  plan = {
39
38
  ...plan,
@@ -80,7 +79,7 @@ export async function prepareSecretConcurrentProfileRevision(input) {
80
79
  .update(prepared.manifest.materializedDigest)
81
80
  .digest("hex");
82
81
  const directory = join(input.launchRoot, `revision-${identity}`);
83
- const bound = bindConcurrentLaunch(plan, prepared.application, join(directory, "workspace"), { secretOpenCodeConfigDirectory: true });
82
+ const bound = bindConcurrentLaunch(plan, prepared.application, join(directory, "workspace"), { secretOpenCodeRevision: true });
84
83
  const spawn = {
85
84
  ...bound,
86
85
  env: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-profile-materialize",
3
- "version": "0.26.0",
3
+ "version": "0.26.2",
4
4
  "description": "Materialize an AgentProfile into the native per-harness workspace files (the one shared materializer for cli-bridge, agent-container, and VB).",
5
5
  "type": "module",
6
6
  "repository": {
@@ -34,6 +34,10 @@
34
34
  "peerDependencies": {
35
35
  "@tangle-network/agent-interface": "^3.0.0 || ^4.0.0 || ^5.0.0"
36
36
  },
37
+ "tangleRelease": {
38
+ "sourceSha": "48d1261ddd76219c35be25a869689fbb120c5f31",
39
+ "mergedAt": "2026-10-19T00:38:28-06:00"
40
+ },
37
41
  "scripts": {
38
42
  "build": "tsc -p tsconfig.json",
39
43
  "check-types": "tsc --noEmit",
@@ -41,7 +45,7 @@
41
45
  "test": "pnpm run test:installed-peer && pnpm run test:current-peer",
42
46
  "test:installed-peer": "vitest run",
43
47
  "test:current-peer": "vitest run --config vitest.current-peer.config.ts",
44
- "test:root": "node ../../scripts/ci/vitest-as-root.mjs tests/concurrent-subagents.test.ts tests/secret-provider-revision.test.ts",
48
+ "test:root": "node ../../scripts/ci/vitest-as-root.mjs tests/concurrent-subagents.test.ts tests/secret-provider-revision.test.ts tests/secret-reference-resources.test.ts",
45
49
  "test:watch": "vitest"
46
50
  }
47
51
  }