agents-can-communicate 0.5.0 → 0.5.1
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/node_modules/@agents-can-communicate/adapter-claude-code/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-codex/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-codex/src/permission-ownership.mjs +19 -2
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/gemini-extension.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-grok/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-kimi/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-sdk/package.json +1 -1
- package/node_modules/@agents-can-communicate/cli/package.json +1 -1
- package/node_modules/@agents-can-communicate/core/package.json +1 -1
- package/node_modules/@agents-can-communicate/delivery-router/package.json +1 -1
- package/node_modules/@agents-can-communicate/hook-runner/package.json +1 -1
- package/node_modules/@agents-can-communicate/installer/package.json +1 -1
- package/node_modules/@agents-can-communicate/mcp-server/package.json +1 -1
- package/node_modules/@agents-can-communicate/protocol/package.json +1 -1
- package/node_modules/@agents-can-communicate/storage-filesystem/package.json +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,19 @@ const marker = (source, prefix) => source.startsWith(prefix) ? source.slice(pref
|
|
|
11
11
|
// Permission selection, proxy and network grants form one ownership unit. If
|
|
12
12
|
// any component changes, none can be removed independently: enabled networking
|
|
13
13
|
// without its proxy has a different security meaning to Codex.
|
|
14
|
+
//
|
|
15
|
+
// A block records the table it was written inside, but that table only carries
|
|
16
|
+
// meaning for a block whose first declaration is a bare assignment: such an
|
|
17
|
+
// assignment belongs to whatever table precedes it, so a moved block would
|
|
18
|
+
// silently mean something else. A block that opens with its own header states
|
|
19
|
+
// its full path and is unaffected by what sits above it.
|
|
20
|
+
//
|
|
21
|
+
// The distinction is not theoretical. ACC appends the profile block at end of
|
|
22
|
+
// file and then tells the user to trust ACC's hooks in Codex - and Codex writes
|
|
23
|
+
// those trust entries as new `hooks.state` tables above the block. Comparing
|
|
24
|
+
// the enclosing table unconditionally turned ACC's own documented setup step
|
|
25
|
+
// into `customized`: doctor then reported working permissions as unverified,
|
|
26
|
+
// install refused to repair them, and uninstall would not remove them.
|
|
14
27
|
export function inspectPermissions(source) {
|
|
15
28
|
const blocks = [];
|
|
16
29
|
let open = null, metadata = null;
|
|
@@ -21,7 +34,8 @@ export function inspectPermissions(source) {
|
|
|
21
34
|
if (open || !/^[a-z]+$/.test(start) || blocks.some(block => block.id === start)) {
|
|
22
35
|
unsafe("duplicate or nested native permission marker");
|
|
23
36
|
}
|
|
24
|
-
open = { id: start, start: entry.start, table: entry.table, contentStart: entry.end
|
|
37
|
+
open = { id: start, start: entry.start, table: entry.table, contentStart: entry.end,
|
|
38
|
+
opens: null };
|
|
25
39
|
} else if (comment.startsWith(META)) {
|
|
26
40
|
if (!open || open.id !== "selection" || metadata !== null || entry.start !== open.contentStart) {
|
|
27
41
|
unsafe("misplaced permission metadata");
|
|
@@ -29,6 +43,8 @@ export function inspectPermissions(source) {
|
|
|
29
43
|
try { metadata = JSON.parse(comment.slice(META.length)); }
|
|
30
44
|
catch { unsafe("invalid permission metadata"); }
|
|
31
45
|
open.contentStart = entry.end;
|
|
46
|
+
} else if (open && entry.code && open.opens === null) {
|
|
47
|
+
open.opens = entry.header ? "table" : "assignment";
|
|
32
48
|
} else if (end !== null) {
|
|
33
49
|
if (!open || open.id !== end) unsafe("unmatched native permission marker");
|
|
34
50
|
blocks.push({ ...open, end: entry.end, body: source.slice(open.contentStart, entry.start) });
|
|
@@ -45,7 +61,8 @@ export function inspectPermissions(source) {
|
|
|
45
61
|
if (!record || Object.keys(record).sort().join() !== "before,hash,id,table"
|
|
46
62
|
|| typeof record.before !== "string" || record.hash !== hash(block.body, record)
|
|
47
63
|
|| (block.id === "selection" && block.table.length !== 0)
|
|
48
|
-
||
|
|
64
|
+
|| (block.opens === "assignment"
|
|
65
|
+
&& JSON.stringify(block.table) !== JSON.stringify(record.table))) {
|
|
49
66
|
return { source, state: "customized" };
|
|
50
67
|
}
|
|
51
68
|
}
|