@tangle-network/agent-profile-materialize 0.22.2 → 0.22.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.
@@ -1,4 +1,22 @@
1
1
  import { join } from "node:path";
2
+ /**
3
+ * Paths OpenCode discovers relative to its native cwd: content-only resources,
4
+ * skills, and its standard agent and command definitions (OpenCode reads
5
+ * `.opencode/{agent,agents}/**\/*.md` and `.opencode/{command,commands}/**\/*.md`).
6
+ */
7
+ const SECRET_REVISION_NATIVE_PATH = /^(?:reference\/|\.opencode\/skills\/|\.opencode\/(?:agents?|commands?)\/(?:[^./][^/]*\/)*[^./][^/]*\.md$)/u;
8
+ /**
9
+ * A secret OpenCode revision runs OpenCode from its immutable, digest-attested
10
+ * revision tree, so a file at one of OpenCode's own discovery paths is visible
11
+ * there without a shared-workspace write. The binding stays limited to
12
+ * OpenCode's standard paths, never an app's own directory.
13
+ */
14
+ function ridesSecretRevision(plan, file, options) {
15
+ return (options.secretOpenCodeRevisionCwd === true &&
16
+ plan.harness === "opencode" &&
17
+ (file.root ?? "workspace") === "workspace" &&
18
+ SECRET_REVISION_NATIVE_PATH.test(file.relPath));
19
+ }
2
20
  export function bindConcurrentLaunch(plan, application, revisionWorkspaceDir, options = {}) {
3
21
  if (plan.requires?.length) {
4
22
  throw new Error(`Concurrent ${plan.harness} profile needs a native extension that this launcher cannot attest`);
@@ -67,17 +85,9 @@ export function bindConcurrentLaunch(plan, application, revisionWorkspaceDir, op
67
85
  }
68
86
  }
69
87
  for (const file of plan.files) {
88
+ if (ridesSecretRevision(plan, file, options))
89
+ continue;
70
90
  if (file.source !== "generated") {
71
- if (options.secretOpenCodeRevisionCwd &&
72
- plan.harness === "opencode" &&
73
- (file.root ?? "workspace") === "workspace" &&
74
- (file.relPath.startsWith("reference/") ||
75
- file.relPath.startsWith(".opencode/skills/"))) {
76
- // The secret launcher uses this immutable revision tree as native cwd.
77
- // These content-only resources are therefore visible without writing
78
- // into the shared workspace or changing native authority config.
79
- continue;
80
- }
81
91
  throw new Error(`Concurrent ${plan.harness} profile resource ${file.relPath} needs a shared-workspace collision-safe copy`);
82
92
  }
83
93
  if ((file.root ?? "workspace") !== "workspace" ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-profile-materialize",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "Materialize an AgentProfile into the native per-harness workspace files (the one shared materializer for cli-bridge, agent-dev-container, and VB).",
5
5
  "type": "module",
6
6
  "repository": {
@@ -41,6 +41,7 @@
41
41
  "test": "pnpm run test:installed-peer && pnpm run test:current-peer",
42
42
  "test:installed-peer": "vitest run",
43
43
  "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",
44
45
  "test:watch": "vitest"
45
46
  }
46
47
  }