@miraland-labs/conduit-bridge 0.16.8 → 0.16.10
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/execution-class.js +14 -2
- package/dist/normative-refs.js +33 -3
- package/package.json +1 -1
package/dist/execution-class.js
CHANGED
|
@@ -141,7 +141,7 @@ export function projectCursor(executionClass, input) {
|
|
|
141
141
|
if (grants.includes("test_run")) {
|
|
142
142
|
allow.push(...verificationCommands.filter(isBoundedVerificationCommand).map((command) => `Shell(${command})`));
|
|
143
143
|
}
|
|
144
|
-
if (executionClass === "mutate_repo") {
|
|
144
|
+
if (executionClass === "mutate_repo" && !input.diagnosis) {
|
|
145
145
|
if (grants.includes("branch_create"))
|
|
146
146
|
allow.push(...branchCreateCommands.map((command) => `Shell(${command})`));
|
|
147
147
|
if (grants.includes("pr_create"))
|
|
@@ -169,6 +169,19 @@ export function projectClaude(executionClass, input) {
|
|
|
169
169
|
if (executionClass === "observe" || executionClass === "observe_network") {
|
|
170
170
|
return { allowedTools: ["Read", "Glob", "Grep", ...fetchTools], disallowedTools, acceptEdits: false };
|
|
171
171
|
}
|
|
172
|
+
// Diagnosis is read-only whatever class the assignment was stamped with — the same
|
|
173
|
+
// class-independent rule Cursor, Codex, and Grok already enforce on the flag itself.
|
|
174
|
+
if (input.diagnosis) {
|
|
175
|
+
return {
|
|
176
|
+
allowedTools: [
|
|
177
|
+
"Read", "Glob", "Grep",
|
|
178
|
+
...verificationCommands.filter(isBoundedVerificationCommand).map((command) => `Bash(${command}:*)`),
|
|
179
|
+
...fetchTools,
|
|
180
|
+
],
|
|
181
|
+
disallowedTools,
|
|
182
|
+
acceptEdits: false,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
172
185
|
if (executionClass === "publish_artifact") {
|
|
173
186
|
return {
|
|
174
187
|
allowedTools: ["Read", "Glob", "Grep", "Edit", "Write", "Bash", ...fetchTools],
|
|
@@ -180,7 +193,6 @@ export function projectClaude(executionClass, input) {
|
|
|
180
193
|
return {
|
|
181
194
|
allowedTools: [
|
|
182
195
|
"Read",
|
|
183
|
-
...(input.diagnosis ? ["Glob", "Grep"] : []),
|
|
184
196
|
...verificationCommands.filter(isBoundedVerificationCommand).map((command) => `Bash(${command}:*)`),
|
|
185
197
|
...fetchTools,
|
|
186
198
|
],
|
package/dist/normative-refs.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Cached under {sourceWorkspace}/.conduit/normative-cache/ so sibling-repo specs are
|
|
5
5
|
* fetched once per machine checkout, not once per attempt.
|
|
6
6
|
*/
|
|
7
|
-
import { access, cp, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
7
|
+
import { access, cp, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
8
8
|
import { constants } from "node:fs";
|
|
9
9
|
import { dirname, join, relative } from "node:path";
|
|
10
10
|
import { execFile } from "node:child_process";
|
|
@@ -15,7 +15,7 @@ const execFileAsync = promisify(execFile);
|
|
|
15
15
|
export const normativeRefSchema = z.object({
|
|
16
16
|
label: z.string().trim().min(1).max(120),
|
|
17
17
|
repository: z.string().trim().min(3).max(500),
|
|
18
|
-
paths: z.array(z.string().trim().min(1).max(500)).
|
|
18
|
+
paths: z.array(z.string().trim().min(1).max(500)).max(20),
|
|
19
19
|
revision: z.string().trim().min(1).max(120).optional(),
|
|
20
20
|
markers: z.array(z.string().trim().min(1).max(500)).max(20).optional(),
|
|
21
21
|
});
|
|
@@ -131,6 +131,32 @@ async function ensureRepoCache(sourceWorkspace, ref) {
|
|
|
131
131
|
await writeFile(marker, `${revision}\n`, "utf8");
|
|
132
132
|
return { dir, revision };
|
|
133
133
|
}
|
|
134
|
+
const CONTRACT_SURFACE = [
|
|
135
|
+
"README.md", "README", "README.rst", "README.txt",
|
|
136
|
+
"docs", "openapi.yaml", "openapi.yml", "openapi.json",
|
|
137
|
+
"CONTRACT.md", "NORMATIVE.md", "SPEC.md",
|
|
138
|
+
];
|
|
139
|
+
/** Bounded files/dirs Bridge copies when the pin names a repo but not paths. */
|
|
140
|
+
export async function discoverNormativePaths(cacheRepo) {
|
|
141
|
+
const found = [];
|
|
142
|
+
for (const name of CONTRACT_SURFACE) {
|
|
143
|
+
if (await pathExists(join(cacheRepo, name)))
|
|
144
|
+
found.push(name);
|
|
145
|
+
}
|
|
146
|
+
if (found.length)
|
|
147
|
+
return found.slice(0, 20);
|
|
148
|
+
const entries = await readdir(cacheRepo, { withFileTypes: true }).catch(() => []);
|
|
149
|
+
for (const entry of entries) {
|
|
150
|
+
if (!entry.isFile() || entry.name.startsWith("."))
|
|
151
|
+
continue;
|
|
152
|
+
if (!/\.(md|markdown)$/i.test(entry.name))
|
|
153
|
+
continue;
|
|
154
|
+
found.push(entry.name);
|
|
155
|
+
if (found.length >= 20)
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
return found;
|
|
159
|
+
}
|
|
134
160
|
async function copyNormativePath(cacheRepo, attemptWorkspace, label, path) {
|
|
135
161
|
validateNormativePath(path);
|
|
136
162
|
const src = join(cacheRepo, path);
|
|
@@ -148,8 +174,12 @@ export async function materializeNormativeRefs(input) {
|
|
|
148
174
|
const materialized = [];
|
|
149
175
|
for (const ref of input.refs) {
|
|
150
176
|
const { dir, revision } = await ensureRepoCache(input.sourceWorkspace, ref);
|
|
177
|
+
const paths = ref.paths.length ? ref.paths : await discoverNormativePaths(dir);
|
|
178
|
+
if (!paths.length) {
|
|
179
|
+
throw new Error(`${NORMATIVE_REF_PREFIX}: no published-contract files found in ${fingerprint(ref.repository)}`);
|
|
180
|
+
}
|
|
151
181
|
const workspace_paths = [];
|
|
152
|
-
for (const path of
|
|
182
|
+
for (const path of paths) {
|
|
153
183
|
workspace_paths.push(await copyNormativePath(dir, input.attemptWorkspace, ref.label, path));
|
|
154
184
|
}
|
|
155
185
|
materialized.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miraland-labs/conduit-bridge",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.10",
|
|
4
4
|
"description": "Conduit Bridge CLI — join, connect, disconnect, multi-driver lanes, and run Claude Code / Codex / Cursor / OpenCode / Pi / Kiro / Antigravity / Grok Build agents for a Conduit organization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|