agents-can-communicate 0.10.4 → 0.11.0
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/README.md +29 -21
- package/bin/acc-indicator.mjs +5 -0
- package/docs/CAPABILITIES.md +3 -0
- package/docs/CLI.md +34 -7
- package/docs/MCP.md +42 -2
- package/docs/PROTOCOL.md +19 -0
- package/docs/STATUS_INDICATOR.md +128 -0
- package/docs/WHY_ACC.md +14 -8
- package/node_modules/@agents-can-communicate/adapter-antigravity/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-antigravity/plugin/plugin.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-antigravity/plugin/skills/acc/SKILL.md +29 -5
- package/node_modules/@agents-can-communicate/adapter-antigravity/src/adapter.mjs +3 -0
- package/node_modules/@agents-can-communicate/adapter-antigravity/src/indicator-install.mjs +80 -0
- package/node_modules/@agents-can-communicate/adapter-antigravity/src/indicator-render.mjs +8 -0
- package/node_modules/@agents-can-communicate/adapter-antigravity/src/install.mjs +7 -4
- package/node_modules/@agents-can-communicate/adapter-claude-code/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-claude-code/plugin/hooks/indicator.mjs +67 -0
- package/node_modules/@agents-can-communicate/adapter-claude-code/plugin/skills/acc/SKILL.md +29 -5
- package/node_modules/@agents-can-communicate/adapter-claude-code/src/adapter.mjs +1 -0
- package/node_modules/@agents-can-communicate/adapter-claude-code/src/install.mjs +16 -5
- package/node_modules/@agents-can-communicate/adapter-codex/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-codex/plugin/skills/acc/SKILL.md +29 -5
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/gemini-extension.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/skills/acc/SKILL.md +29 -5
- 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-grok/plugin/skills/acc/SKILL.md +29 -5
- package/node_modules/@agents-can-communicate/adapter-grok/src/adapter.mjs +4 -0
- package/node_modules/@agents-can-communicate/adapter-grok/src/indicator-install.mjs +30 -0
- package/node_modules/@agents-can-communicate/adapter-grok/src/indicator.mjs +23 -0
- package/node_modules/@agents-can-communicate/adapter-grok/src/install.mjs +9 -5
- package/node_modules/@agents-can-communicate/adapter-kimi/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-kimi/plugin/skills/acc/SKILL.md +29 -5
- package/node_modules/@agents-can-communicate/adapter-kimi/src/adapter.mjs +4 -0
- package/node_modules/@agents-can-communicate/adapter-kimi/src/indicator-install.mjs +30 -0
- package/node_modules/@agents-can-communicate/adapter-kimi/src/indicator.mjs +17 -0
- package/node_modules/@agents-can-communicate/adapter-kimi/src/install.mjs +12 -6
- package/node_modules/@agents-can-communicate/adapter-sdk/package.json +1 -1
- package/node_modules/@agents-can-communicate/adapter-sdk/src/hook-shim.mjs +1 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/index.mjs +5 -1
- package/node_modules/@agents-can-communicate/adapter-sdk/src/indicator-command.mjs +14 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/indicator-text.mjs +13 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/offer-observation-order.mjs +12 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/offer-observation-writer.mjs +37 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/offer-observation.mjs +47 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/toml-indicator.mjs +141 -0
- package/node_modules/@agents-can-communicate/adapter-sdk/src/toml-scan.mjs +99 -0
- package/node_modules/@agents-can-communicate/cli/package.json +2 -1
- package/node_modules/@agents-can-communicate/cli/src/args.mjs +5 -3
- package/node_modules/@agents-can-communicate/cli/src/claim-command.mjs +64 -0
- package/node_modules/@agents-can-communicate/cli/src/help.mjs +15 -8
- package/node_modules/@agents-can-communicate/cli/src/index.mjs +1 -0
- package/node_modules/@agents-can-communicate/cli/src/indicator-command.mjs +65 -0
- package/node_modules/@agents-can-communicate/cli/src/indicator-previous-command.mjs +84 -0
- package/node_modules/@agents-can-communicate/cli/src/indicator-previous-windows.mjs +8 -0
- package/node_modules/@agents-can-communicate/cli/src/indicator.mjs +112 -0
- package/node_modules/@agents-can-communicate/cli/src/install-command.mjs +4 -0
- package/node_modules/@agents-can-communicate/cli/src/main.mjs +3 -53
- package/node_modules/@agents-can-communicate/cli/src/managed-runtime/entry.mjs +19 -0
- package/node_modules/@agents-can-communicate/cli/src/managed-runtime/launchers.mjs +5 -3
- package/node_modules/@agents-can-communicate/core/package.json +1 -1
- package/node_modules/@agents-can-communicate/core/src/claim-selectors.mjs +62 -0
- package/node_modules/@agents-can-communicate/core/src/claims.mjs +88 -81
- package/node_modules/@agents-can-communicate/delivery-router/package.json +1 -1
- package/node_modules/@agents-can-communicate/delivery-router/src/router.mjs +14 -5
- 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/installer/src/apply.mjs +3 -0
- package/node_modules/@agents-can-communicate/installer/src/ownership.mjs +2 -1
- package/node_modules/@agents-can-communicate/installer/src/plan.mjs +11 -2
- package/node_modules/@agents-can-communicate/mcp-server/package.json +1 -1
- package/node_modules/@agents-can-communicate/mcp-server/src/claim-tools.mjs +56 -0
- package/node_modules/@agents-can-communicate/mcp-server/src/input-validator.mjs +9 -0
- package/node_modules/@agents-can-communicate/mcp-server/src/server.mjs +7 -8
- package/node_modules/@agents-can-communicate/mcp-server/src/tools.mjs +27 -9
- package/node_modules/@agents-can-communicate/protocol/package.json +1 -1
- package/node_modules/@agents-can-communicate/protocol/src/index.mjs +1 -0
- package/node_modules/@agents-can-communicate/storage-filesystem/package.json +1 -1
- package/node_modules/@agents-can-communicate/storage-filesystem/src/index.mjs +1 -1
- package/node_modules/@agents-can-communicate/storage-filesystem/src/session-read.mjs +13 -0
- package/package.json +3 -1
|
@@ -5,7 +5,7 @@ import path from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
7
|
|
|
8
|
-
import { bakeSkillCommand, blankJson, defaultAntigravityRelay, isShellWord, mergeEnv, ownVersion,
|
|
8
|
+
import { bakeSkillCommand, blankJson, compareVersionOrder, versionOrder, defaultAntigravityRelay, isShellWord, mergeEnv, ownVersion,
|
|
9
9
|
removeIfEmpty, shellQuote, shortPath, stampPluginVersion, windowsHookCommand, writeCliShim,
|
|
10
10
|
writeForeignJson, writeHookShim, writeNodeShim }
|
|
11
11
|
from "@agents-can-communicate/adapter-sdk";
|
|
@@ -15,6 +15,7 @@ import { agySettingsPath, cliWrapperPath, ensureAllowRule, inspectAllowRule, ins
|
|
|
15
15
|
withdrawAllowRule } from "./allow-rule.mjs";
|
|
16
16
|
import { ensureDesktopRule, inspectDesktopRule, withdrawDesktopRule } from "./desktop-allow-rule.mjs";
|
|
17
17
|
import { relayShimName, relayStartCommand, runningRelays, stopRelays } from "./relays.mjs";
|
|
18
|
+
import { configureIndicator } from "./indicator-install.mjs";
|
|
18
19
|
|
|
19
20
|
const run = promisify(execFile);
|
|
20
21
|
|
|
@@ -425,8 +426,10 @@ export async function installAntigravity(context) {
|
|
|
425
426
|
const allow = await ensureAllowRule(context);
|
|
426
427
|
// Antigravity 2.0 keeps grants of its own, read only where it has run.
|
|
427
428
|
const desktop = await ensureDesktopRule(context);
|
|
429
|
+
const indicatorChanges = await configureIndicator(context, context.indicator === "on"
|
|
430
|
+
&& compareVersionOrder(versionOrder(context.clientVersion), versionOrder("1.0.6")) >= 0);
|
|
428
431
|
const changes = [shimDir(home), file, pluginInstallPath(home), vendorManifestPath(home),
|
|
429
|
-
...allow.changes, ...desktop.changes];
|
|
432
|
+
...allow.changes, ...desktop.changes, ...indicatorChanges];
|
|
430
433
|
|
|
431
434
|
const diagnostics = [...allow.diagnostics, ...desktop.diagnostics];
|
|
432
435
|
const needsAction = [...allow.needsAction, ...desktop.needsAction];
|
|
@@ -495,7 +498,7 @@ export async function installAntigravity(context) {
|
|
|
495
498
|
*/
|
|
496
499
|
export async function uninstallAntigravity(context) {
|
|
497
500
|
const { home, keep = [] } = context;
|
|
498
|
-
const changes =
|
|
501
|
+
const changes = await configureIndicator(context, false);
|
|
499
502
|
const diagnostics = [];
|
|
500
503
|
// Nothing may keep running once ACC is gone. A relay holds a live session
|
|
501
504
|
// endpoint in memory, so it is stopped here rather than left to find out.
|
|
@@ -744,7 +747,7 @@ export function planAntigravityInstall(context) {
|
|
|
744
747
|
// match: a wrapper path that needs quotes gets none.
|
|
745
748
|
const plugin = [{ path: pluginInstallPath(context.home), kind: "merge" },
|
|
746
749
|
{ path: vendorManifestPath(context.home), kind: "merge" },
|
|
747
|
-
...(isShellWord(cliWrapperPath(context.home, context.hostPlatform))
|
|
750
|
+
...(context.indicator === "on" || isShellWord(cliWrapperPath(context.home, context.hostPlatform))
|
|
748
751
|
? [{ path: agySettingsPath(context.home), kind: "merge" }] : [])];
|
|
749
752
|
if (locationChoice(context) !== null) {
|
|
750
753
|
return [shim, ...plugin,
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Interpreter and read-only entrypoint are baked by the installer. No prompts,
|
|
2
|
+
// transcript access, model turns, ACC writes or transport probes are needed.
|
|
3
|
+
const NODE = __ACC_NODE__;
|
|
4
|
+
const INDICATOR = __ACC_INDICATOR__;
|
|
5
|
+
|
|
6
|
+
let report = { label: "ACC …", health: "starting", detail: "Reading ACC state." };
|
|
7
|
+
let busy = false, sessionId = null, startedAt = 0, lastRead = 0, announced = null;
|
|
8
|
+
|
|
9
|
+
async function refresh($) {
|
|
10
|
+
if (busy) return;
|
|
11
|
+
const id = await $.session.id();
|
|
12
|
+
const now = await $.clock.now();
|
|
13
|
+
if (id !== sessionId) {
|
|
14
|
+
sessionId = id; startedAt = now; lastRead = 0; announced = null;
|
|
15
|
+
report = { label: "ACC …", health: "starting", detail: "Reading ACC state." };
|
|
16
|
+
}
|
|
17
|
+
if (now - lastRead < (now - startedAt < 5000 ? 1000 : 5000)) return;
|
|
18
|
+
lastRead = now; busy = true;
|
|
19
|
+
try {
|
|
20
|
+
const value = await $.process.run([NODE, INDICATOR, "--adapter", "claude_code",
|
|
21
|
+
"--native-session", id, "--json"], { timeoutMs: 1200 });
|
|
22
|
+
const next = JSON.parse(value.stdout);
|
|
23
|
+
if (await $.session.id() !== id) return;
|
|
24
|
+
if (next.reasonCode === "not_registered" && now - startedAt < 5000) {
|
|
25
|
+
report = { label: "ACC …", health: "starting",
|
|
26
|
+
detail: "Waiting up to five seconds for the session hooks to register ACC." };
|
|
27
|
+
} else report = next;
|
|
28
|
+
} catch {
|
|
29
|
+
report = { label: "ACC !", health: "problem", reasonCode: "indicator_unavailable",
|
|
30
|
+
detail: "The ACC indicator could not read this session's state.",
|
|
31
|
+
action: "Run acc install --adapter claude_code --indicator on, then /reload-plugins." };
|
|
32
|
+
} finally { busy = false; }
|
|
33
|
+
if (report.health === "problem" && report.reasonCode !== announced) {
|
|
34
|
+
await $.ui.log([report.detail, report.action, "Details: /acc-status"].filter(Boolean).join(" "));
|
|
35
|
+
announced = report.reasonCode;
|
|
36
|
+
} else if (report.health === "ready") announced = null;
|
|
37
|
+
$.ui.invalidate("ui.render");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function register(on) {
|
|
41
|
+
on("session.start", async ($, e, next) => {
|
|
42
|
+
$.clock.every(1000, async () => { await refresh($); });
|
|
43
|
+
await refresh($);
|
|
44
|
+
await $.command.register({ name: "acc-status", immediate: true,
|
|
45
|
+
description: "Explain this chat's ACC indicator and its next recovery step" });
|
|
46
|
+
return next(e);
|
|
47
|
+
});
|
|
48
|
+
on("command.run", { command: "acc-status" }, async ($) => {
|
|
49
|
+
lastRead = 0;
|
|
50
|
+
await refresh($);
|
|
51
|
+
return { text: [report.label, report.detail, report.action].filter(Boolean).join("\n") };
|
|
52
|
+
});
|
|
53
|
+
on("ui.render", { component: "SessionMode" }, async ($, e, next) => {
|
|
54
|
+
const { Box, Text } = $.ui.resolve(e);
|
|
55
|
+
const symbol = report.health === "ready" ? "●" : report.health === "problem" ? "!" : "…";
|
|
56
|
+
const color = report.health === "ready" ? "#2c7a39" : report.health === "problem" ? "warning" : "inactive";
|
|
57
|
+
const qualifier = ["turn", "inbox"].includes(report.reception) ? ` · ${report.reception}` : "";
|
|
58
|
+
// Native mode strings are all dimmed. Keep their rendering intact and put
|
|
59
|
+
// only ACC's glyph in its own non-dim Text. Match Antigravity's ready green
|
|
60
|
+
// exactly instead of allowing Claude's success theme color to desaturate it.
|
|
61
|
+
return Box({ flexDirection: "row", children: [await next(e),
|
|
62
|
+
Text({ color: "inactive", children: [" ACC "] }),
|
|
63
|
+
Text({ color, bold: true, dimColor: false, children: [symbol] }),
|
|
64
|
+
...(qualifier ? [Text({ color: "inactive", children: [qualifier] })] : []),
|
|
65
|
+
] });
|
|
66
|
+
});
|
|
67
|
+
}
|
|
@@ -57,19 +57,43 @@ Do this once, not every turn. Update it only when the scope or mode materially
|
|
|
57
57
|
changes. `--hint` is important: it lets ACC match your plan against a peer's
|
|
58
58
|
claim. Intent is awareness, not permission.
|
|
59
59
|
|
|
60
|
-
Before changing shared files, claim the smallest useful
|
|
60
|
+
Before changing shared files, claim the smallest useful resources in one operation:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
{{ACC}} claim --resource 'file:packages/core/**'
|
|
63
|
+
{{ACC}} claim --resource 'file:packages/core/**' \
|
|
64
|
+
--resource 'file:packages/protocol/**' --reason "porting the claim model"
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
Repeat `--resource` for an atomic batch, or supply it once for one claim.
|
|
68
|
+
Shared mode, enforcement, reason, and lease apply to every resource. Duplicate resources after
|
|
69
|
+
normalization are rejected. Exit 5 means a conflict: no claim is created or
|
|
70
|
+
renewed. Batch `details.conflicts` names blocked resources and their holders.
|
|
71
|
+
Narrow your scope, contact the owner, or ask the human. Repeating a successful
|
|
72
|
+
claim command renews your existing claims on those resources.
|
|
73
|
+
|
|
74
|
+
Release selected claims when useful:
|
|
68
75
|
|
|
69
76
|
```bash
|
|
70
|
-
{{ACC}} release --resource 'file:packages/core/**'
|
|
77
|
+
{{ACC}} release --resource 'file:packages/core/**' \
|
|
78
|
+
--resource 'file:packages/protocol/**'
|
|
71
79
|
```
|
|
72
80
|
|
|
81
|
+
Choose exactly one selector family: repeated `--resource`, repeated `--claim`,
|
|
82
|
+
or `--all`. Duplicate selectors after normalization are rejected. A missing or
|
|
83
|
+
foreign explicit target fails without releasing any claims. Repeating an explicit release after its targets were removed is an error.
|
|
84
|
+
Batch release accepts no force-release authority.
|
|
85
|
+
|
|
86
|
+
To release all your claims while keeping your session and intent open:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
{{ACC}} release --all
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This selects only your session's current claims in its workspace. An empty set
|
|
93
|
+
succeeds. Each retry selects the current set and can release newly acquired claims.
|
|
94
|
+
Use `work --clear` to clear intent, `ack` to acknowledge a message, and `finish`
|
|
95
|
+
to record a handoff and close your ACC presence.
|
|
96
|
+
|
|
73
97
|
## Communicate only when it changes another agent's work
|
|
74
98
|
|
|
75
99
|
Send a message for a dependency, conflict, direct question, decision, or
|
|
@@ -34,6 +34,7 @@ export function createClaudeCodeAdapter() {
|
|
|
34
34
|
return defineAdapter({
|
|
35
35
|
id: "claude_code",
|
|
36
36
|
displayName: "Claude Code",
|
|
37
|
+
statusIndicator: { minimumVersion: "2.1.287", reload: "run /reload-plugins in the open session" },
|
|
37
38
|
// The binary this client actually installs. Probed for a version to
|
|
38
39
|
// decide whether the client is on this machine, so it has to be the
|
|
39
40
|
// real command rather than the adapter id: `2.1.233 (Claude Code)`.
|
|
@@ -7,7 +7,7 @@ import path from "node:path";
|
|
|
7
7
|
import { AccError, EXIT } from "@agents-can-communicate/protocol";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
|
|
10
|
-
import { acccreatedFile, bakeSkillCommand, blankJson,
|
|
10
|
+
import { acccreatedFile, bakeSkillCommand, blankJson, defaultIndicator, compareVersionOrder, versionOrder,
|
|
11
11
|
mergeOwnedEntries, ownedEntries,
|
|
12
12
|
keepVersions, ownVersion, stampPluginVersion,
|
|
13
13
|
removeIfEmpty,
|
|
@@ -181,7 +181,7 @@ async function execFormHooks(file, node) {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
/** A plugin tree with the shim written and the skill's command baked in. */
|
|
184
|
-
async function layOutPlugin(target, { runner, node, cli, hostPlatform }) {
|
|
184
|
+
async function layOutPlugin(target, { runner, node, cli, hostPlatform, indicator, indicatorRunner, clientVersion }) {
|
|
185
185
|
await rm(target, { recursive: true, force: true });
|
|
186
186
|
await cp(bundle, target, { recursive: true });
|
|
187
187
|
// The skill ships with a placeholder where the command belongs: `acc` is not
|
|
@@ -194,6 +194,15 @@ async function layOutPlugin(target, { runner, node, cli, hostPlatform }) {
|
|
|
194
194
|
await writeHookShim({ dir: path.join(target, "hooks"), adapterId: "claude_code",
|
|
195
195
|
runner, node, platform: hostPlatform });
|
|
196
196
|
if (hostPlatform === "win32") await execFormHooks(path.join(target, "hooks", "hooks.json"), node);
|
|
197
|
+
if (indicator === "on" && compareVersionOrder(versionOrder(clientVersion), versionOrder("2.1.287")) >= 0) {
|
|
198
|
+
const hooksFile = path.join(target, "hooks", "hooks.json");
|
|
199
|
+
const hooks = await readJson(hooksFile, {});
|
|
200
|
+
await writeJson(hooksFile, { ...hooks, modules: ["./indicator.mjs"] });
|
|
201
|
+
const moduleFile = path.join(target, "hooks", "indicator.mjs");
|
|
202
|
+
const source = await readFile(moduleFile, "utf8");
|
|
203
|
+
await writeFile(moduleFile, source.replace("__ACC_NODE__", JSON.stringify(node))
|
|
204
|
+
.replace("__ACC_INDICATOR__", JSON.stringify(indicatorRunner ?? defaultIndicator())));
|
|
205
|
+
} else await rm(path.join(target, "hooks", "indicator.mjs"), { force: true });
|
|
197
206
|
// The copy the client reads says which ACC wrote it. The shipped manifest
|
|
198
207
|
// carries no version, so there is nothing in the repository to fall out of
|
|
199
208
|
// step - which is how every client came to report 0.1.6 while running 0.1.9.
|
|
@@ -202,7 +211,8 @@ async function layOutPlugin(target, { runner, node, cli, hostPlatform }) {
|
|
|
202
211
|
}
|
|
203
212
|
|
|
204
213
|
export async function installClaudePlugin({ configDir, runner, cli, keepPreviousVersion = null,
|
|
205
|
-
node = process.execPath, now = new Date(), hostPlatform = process.platform
|
|
214
|
+
node = process.execPath, now = new Date(), hostPlatform = process.platform,
|
|
215
|
+
indicator = "off", indicatorRunner, clientVersion }) {
|
|
206
216
|
// Everything this will merge into, read before a byte is written. A settings
|
|
207
217
|
// file that will not parse used to be discovered after the plugin tree was
|
|
208
218
|
// already on disk, and the install then failed with nineteen files left
|
|
@@ -219,12 +229,13 @@ export async function installClaudePlugin({ configDir, runner, cli, keepPrevious
|
|
|
219
229
|
const source = sourceDir(configDir);
|
|
220
230
|
const cached = cachePath(configDir, version);
|
|
221
231
|
|
|
222
|
-
|
|
232
|
+
const layout = { runner, node, cli, hostPlatform, indicator, indicatorRunner, clientVersion };
|
|
233
|
+
await layOutPlugin(source, layout);
|
|
223
234
|
await writeJson(marketplaceFile(configDir), marketplaceManifest());
|
|
224
235
|
// The copy the client runs from. Written here rather than asking the user to
|
|
225
236
|
// run `claude plugin install`, exactly as the Codex adapter does, because the
|
|
226
237
|
// command's only effect is this copy plus the two registry entries below.
|
|
227
|
-
await layOutPlugin(cached,
|
|
238
|
+
await layOutPlugin(cached, layout);
|
|
228
239
|
// The copy just written, plus the one an upgrade moved off. A client caches a
|
|
229
240
|
// plugin under its version, so every upgrade would otherwise leave the previous
|
|
230
241
|
// release's tree beside this one - invisible while the version never moved,
|
|
@@ -76,19 +76,43 @@ Do this once, not every turn. Update it only when the scope or mode materially
|
|
|
76
76
|
changes. `--hint` is important: it lets ACC match your plan against a peer's
|
|
77
77
|
claim. Intent is awareness, not permission.
|
|
78
78
|
|
|
79
|
-
Before changing shared files, claim the smallest useful
|
|
79
|
+
Before changing shared files, claim the smallest useful resources in one operation:
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
|
-
{{ACC}} claim --resource 'file:packages/core/**'
|
|
82
|
+
{{ACC}} claim --resource 'file:packages/core/**' \
|
|
83
|
+
--resource 'file:packages/protocol/**' --reason "porting the claim model"
|
|
83
84
|
```
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
Repeat `--resource` for an atomic batch, or supply it once for one claim.
|
|
87
|
+
Shared mode, enforcement, reason, and lease apply to every resource. Duplicate resources after
|
|
88
|
+
normalization are rejected. Exit 5 means a conflict: no claim is created or
|
|
89
|
+
renewed. Batch `details.conflicts` names blocked resources and their holders.
|
|
90
|
+
Narrow your scope, contact the owner, or ask the human. Repeating a successful
|
|
91
|
+
claim command renews your existing claims on those resources.
|
|
92
|
+
|
|
93
|
+
Release selected claims when useful:
|
|
87
94
|
|
|
88
95
|
```bash
|
|
89
|
-
{{ACC}} release --resource 'file:packages/core/**'
|
|
96
|
+
{{ACC}} release --resource 'file:packages/core/**' \
|
|
97
|
+
--resource 'file:packages/protocol/**'
|
|
90
98
|
```
|
|
91
99
|
|
|
100
|
+
Choose exactly one selector family: repeated `--resource`, repeated `--claim`,
|
|
101
|
+
or `--all`. Duplicate selectors after normalization are rejected. A missing or
|
|
102
|
+
foreign explicit target fails without releasing any claims. Repeating an explicit release after its targets were removed is an error.
|
|
103
|
+
Batch release accepts no force-release authority.
|
|
104
|
+
|
|
105
|
+
To release all your claims while keeping your session and intent open:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
{{ACC}} release --all
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This selects only your session's current claims in its workspace. An empty set
|
|
112
|
+
succeeds. Each retry selects the current set and can release newly acquired claims.
|
|
113
|
+
Use `work --clear` to clear intent, `ack` to acknowledge a message, and `finish`
|
|
114
|
+
to record a handoff and close your ACC presence.
|
|
115
|
+
|
|
92
116
|
## Communicate only when it changes another agent's work
|
|
93
117
|
|
|
94
118
|
Send a message for a dependency, conflict, direct question, decision, or
|
package/node_modules/@agents-can-communicate/adapter-gemini-cli/extension/skills/acc/SKILL.md
CHANGED
|
@@ -57,19 +57,43 @@ Do this once, not every turn. Update it only when the scope or mode materially
|
|
|
57
57
|
changes. `--hint` is important: it lets ACC match your plan against a peer's
|
|
58
58
|
claim. Intent is awareness, not permission.
|
|
59
59
|
|
|
60
|
-
Before changing shared files, claim the smallest useful
|
|
60
|
+
Before changing shared files, claim the smallest useful resources in one operation:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
{{ACC}} claim --resource 'file:packages/core/**'
|
|
63
|
+
{{ACC}} claim --resource 'file:packages/core/**' \
|
|
64
|
+
--resource 'file:packages/protocol/**' --reason "porting the claim model"
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
Repeat `--resource` for an atomic batch, or supply it once for one claim.
|
|
68
|
+
Shared mode, enforcement, reason, and lease apply to every resource. Duplicate resources after
|
|
69
|
+
normalization are rejected. Exit 5 means a conflict: no claim is created or
|
|
70
|
+
renewed. Batch `details.conflicts` names blocked resources and their holders.
|
|
71
|
+
Narrow your scope, contact the owner, or ask the human. Repeating a successful
|
|
72
|
+
claim command renews your existing claims on those resources.
|
|
73
|
+
|
|
74
|
+
Release selected claims when useful:
|
|
68
75
|
|
|
69
76
|
```bash
|
|
70
|
-
{{ACC}} release --resource 'file:packages/core/**'
|
|
77
|
+
{{ACC}} release --resource 'file:packages/core/**' \
|
|
78
|
+
--resource 'file:packages/protocol/**'
|
|
71
79
|
```
|
|
72
80
|
|
|
81
|
+
Choose exactly one selector family: repeated `--resource`, repeated `--claim`,
|
|
82
|
+
or `--all`. Duplicate selectors after normalization are rejected. A missing or
|
|
83
|
+
foreign explicit target fails without releasing any claims. Repeating an explicit release after its targets were removed is an error.
|
|
84
|
+
Batch release accepts no force-release authority.
|
|
85
|
+
|
|
86
|
+
To release all your claims while keeping your session and intent open:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
{{ACC}} release --all
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This selects only your session's current claims in its workspace. An empty set
|
|
93
|
+
succeeds. Each retry selects the current set and can release newly acquired claims.
|
|
94
|
+
Use `work --clear` to clear intent, `ack` to acknowledge a message, and `finish`
|
|
95
|
+
to record a handoff and close your ACC presence.
|
|
96
|
+
|
|
73
97
|
## Communicate only when it changes another agent's work
|
|
74
98
|
|
|
75
99
|
Send a message for a dependency, conflict, direct question, decision, or
|
|
@@ -73,19 +73,43 @@ Do this once, not every turn. Update it only when the scope or mode materially
|
|
|
73
73
|
changes. `--hint` is important: it lets ACC match your plan against a peer's
|
|
74
74
|
claim. Intent is awareness, not permission.
|
|
75
75
|
|
|
76
|
-
Before changing shared files, claim the smallest useful
|
|
76
|
+
Before changing shared files, claim the smallest useful resources in one operation:
|
|
77
77
|
|
|
78
78
|
```bash
|
|
79
|
-
{{ACC}} claim --resource 'file:packages/core/**'
|
|
79
|
+
{{ACC}} claim --resource 'file:packages/core/**' \
|
|
80
|
+
--resource 'file:packages/protocol/**' --reason "porting the claim model"
|
|
80
81
|
```
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
Repeat `--resource` for an atomic batch, or supply it once for one claim.
|
|
84
|
+
Shared mode, enforcement, reason, and lease apply to every resource. Duplicate resources after
|
|
85
|
+
normalization are rejected. Exit 5 means a conflict: no claim is created or
|
|
86
|
+
renewed. Batch `details.conflicts` names blocked resources and their holders.
|
|
87
|
+
Narrow your scope, contact the owner, or ask the human. Repeating a successful
|
|
88
|
+
claim command renews your existing claims on those resources.
|
|
89
|
+
|
|
90
|
+
Release selected claims when useful:
|
|
84
91
|
|
|
85
92
|
```bash
|
|
86
|
-
{{ACC}} release --resource 'file:packages/core/**'
|
|
93
|
+
{{ACC}} release --resource 'file:packages/core/**' \
|
|
94
|
+
--resource 'file:packages/protocol/**'
|
|
87
95
|
```
|
|
88
96
|
|
|
97
|
+
Choose exactly one selector family: repeated `--resource`, repeated `--claim`,
|
|
98
|
+
or `--all`. Duplicate selectors after normalization are rejected. A missing or
|
|
99
|
+
foreign explicit target fails without releasing any claims. Repeating an explicit release after its targets were removed is an error.
|
|
100
|
+
Batch release accepts no force-release authority.
|
|
101
|
+
|
|
102
|
+
To release all your claims while keeping your session and intent open:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
{{ACC}} release --all
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This selects only your session's current claims in its workspace. An empty set
|
|
109
|
+
succeeds. Each retry selects the current set and can release newly acquired claims.
|
|
110
|
+
Use `work --clear` to clear intent, `ack` to acknowledge a message, and `finish`
|
|
111
|
+
to record a handoff and close your ACC presence.
|
|
112
|
+
|
|
89
113
|
## Communicate only when it changes another agent's work
|
|
90
114
|
|
|
91
115
|
Send a message for a dependency, conflict, direct question, decision, or
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { preflightGrokIndicator } from "./indicator-install.mjs";
|
|
2
|
+
import { grokIndicator } from "./indicator.mjs";
|
|
1
3
|
import { defineAdapter, projectContext, projectContextResult }
|
|
2
4
|
from "@agents-can-communicate/adapter-sdk";
|
|
3
5
|
import certification from "../certification.json" with { type: "json" };
|
|
@@ -22,6 +24,7 @@ export const GROK_VERSION = "1.0.13";
|
|
|
22
24
|
export function createGrokAdapter() {
|
|
23
25
|
return defineAdapter({
|
|
24
26
|
id: "grok",
|
|
27
|
+
statusIndicator: grokIndicator,
|
|
25
28
|
displayName: "Grok",
|
|
26
29
|
// Native Mach-O at ~/.grok/bin/grok. `ps -o comm=` on 1.0.13 reports `grok`.
|
|
27
30
|
client: { command: "grok", certificationName: "grok", versionArgs: ["--version"] },
|
|
@@ -41,6 +44,7 @@ export function createGrokAdapter() {
|
|
|
41
44
|
planInstall: context => planGrokInstall(forClient(context)),
|
|
42
45
|
detect: context => detectGrok(forClient(context)),
|
|
43
46
|
install: context => installGrokHooks(forClient(context)),
|
|
47
|
+
preflightUninstall: context => preflightGrokIndicator(forClient(context)),
|
|
44
48
|
uninstall: context => uninstallGrokHooks(forClient(context)),
|
|
45
49
|
|
|
46
50
|
doctor: async context => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import {configureTomlIndicator,indicatorCommand,compareVersionOrder,versionOrder} from '@agents-can-communicate/adapter-sdk';
|
|
4
|
+
import {grokIndicator} from './indicator.mjs';
|
|
5
|
+
|
|
6
|
+
export const grokIndicatorPaths = context => {
|
|
7
|
+
const root=context.grokHome??path.join(context.home,'.grok');
|
|
8
|
+
return {file:path.join(root,'config.toml'),marker:path.join(context.dataHome??root,'acc','adapter-grok','indicator.json'),
|
|
9
|
+
shim:path.join(root,'hooks','acc-indicator.mjs')};
|
|
10
|
+
};
|
|
11
|
+
export async function configureGrokIndicator(context,enabled) {
|
|
12
|
+
const paths=grokIndicatorPaths(context);
|
|
13
|
+
|
|
14
|
+
if(enabled&&!supportsGrokIndicator(context))return [];
|
|
15
|
+
return configureTomlIndicator({...paths,table:['ui','status_line'],enabled,set:async()=>({type:'command',command:enabled?await indicatorCommand({context,adapterId:'grok',...paths,shell:'portable'}):''}),defaults:{refresh_interval:1}});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const preflightGrokIndicator = context => configureTomlIndicator({...grokIndicatorPaths(context),table:['ui','status_line'],enabled:false,dryRun:true});
|
|
19
|
+
|
|
20
|
+
function supportsGrokIndicator(context) {
|
|
21
|
+
return typeof context.clientVersion === "string"
|
|
22
|
+
&& compareVersionOrder(versionOrder(context.clientVersion), versionOrder(grokIndicator.minimumVersion)) >= 0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function planGrokIndicator(context) {
|
|
26
|
+
const paths = grokIndicatorPaths(context);
|
|
27
|
+
if (context.indicator === "on" ? !supportsGrokIndicator(context) : !existsSync(paths.marker)) return [];
|
|
28
|
+
return [{path: paths.file, kind: "merge"},
|
|
29
|
+
...(context.indicator === "on" && context.hostPlatform === "win32" ? [{path: paths.shim, kind: "tree"}] : [])];
|
|
30
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {indicatorGlyph,footerText} from '@agents-can-communicate/adapter-sdk';
|
|
2
|
+
|
|
3
|
+
export const grokIndicator = {
|
|
4
|
+
minimumVersion:'1.0.46', reload:'start a new Grok session',
|
|
5
|
+
nativeSessionId: payload=>payload.session_id,
|
|
6
|
+
renderText:indicatorGlyph,
|
|
7
|
+
composeText({payload={},indicator,previous='',settings={}}) {
|
|
8
|
+
const cwd=footerText(payload.workspace?.current_dir??payload.cwd).split(/[\\/]/).filter(Boolean).at(-1);
|
|
9
|
+
const percent=payload.context_window?.used_percentage;
|
|
10
|
+
const cost=payload.cost?.total_cost_usd;
|
|
11
|
+
const started=payload.turn?.started_at_ms;
|
|
12
|
+
const elapsed=Number.isFinite(started)?Date.now()-started:NaN;
|
|
13
|
+
const slots={cwd,model:footerText(payload.model?.display_name??payload.model?.id),
|
|
14
|
+
context:Number.isFinite(percent)?`${Math.round(percent)}% ctx`:'',
|
|
15
|
+
cost:Number.isFinite(cost)&&cost>=0.005?`$${cost.toFixed(2)}`:'',
|
|
16
|
+
'turn-timer':Number.isFinite(elapsed)&&elapsed>=1000?`${Math.floor(elapsed/1000)}s`:'',
|
|
17
|
+
'session-name':footerText(payload.session_name)};
|
|
18
|
+
const items=Array.isArray(settings.items)?settings.items:['cwd','model','context'];
|
|
19
|
+
const base=previous.trimEnd() || items.map(id=>slots[id]).filter(Boolean).join(' │ ');
|
|
20
|
+
const [first,...rest]=base.split(/\r?\n/);
|
|
21
|
+
return [[indicator,first].filter(Boolean).join(' │ '),...rest].join('\n');
|
|
22
|
+
},
|
|
23
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {configureGrokIndicator, planGrokIndicator} from "./indicator-install.mjs";
|
|
1
2
|
import { cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
@@ -64,9 +65,10 @@ const withShim = (wiring, shim, windowsNode = null) => ({
|
|
|
64
65
|
}))])),
|
|
65
66
|
});
|
|
66
67
|
|
|
67
|
-
export async function installGrokHooks({
|
|
68
|
-
hostPlatform = process.platform
|
|
68
|
+
export async function installGrokHooks(context) {
|
|
69
|
+
const {grokHome, home, runner, cli, node, hostPlatform = process.platform} = context;
|
|
69
70
|
const root = grokHome ?? grokHomeOf({ home, grokHome });
|
|
71
|
+
const indicatorChanges = await configureGrokIndicator(context, context.indicator === "on");
|
|
70
72
|
const template = await readJson(path.join(bundle, "hooks", "hooks.json"), { hooks: {} });
|
|
71
73
|
const shim = await writeHookShim({ dir: path.join(root, "hooks"), adapterId: "grok",
|
|
72
74
|
runner, node, name: SHIM_NAME, platform: hostPlatform });
|
|
@@ -80,12 +82,13 @@ export async function installGrokHooks({ grokHome, home, runner, cli, node,
|
|
|
80
82
|
|
|
81
83
|
await writeJson(hooksFile(root), withShim(template, shim,
|
|
82
84
|
hostPlatform === "win32" ? node ?? process.execPath : null));
|
|
83
|
-
return { ok: true, changes: [hooksFile(root), shim, skills], diagnostics: [] };
|
|
85
|
+
return { ok: true, changes: [hooksFile(root), shim, skills, ...indicatorChanges], diagnostics: [] };
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
export async function uninstallGrokHooks(
|
|
88
|
+
export async function uninstallGrokHooks(context) {
|
|
89
|
+
const {grokHome, home, keep = [], hostPlatform} = context;
|
|
87
90
|
const root = grokHome ?? grokHomeOf({ home, grokHome });
|
|
88
|
-
const changes =
|
|
91
|
+
const changes = await configureGrokIndicator(context, false);
|
|
89
92
|
for (const target of [hooksFile(root), shimPath(root, hostPlatform), skillPath(root)]) {
|
|
90
93
|
if (await removeInstalledTree(target, keep)) changes.push(target);
|
|
91
94
|
}
|
|
@@ -106,6 +109,7 @@ export async function detectGrok({ grokHome, home }) {
|
|
|
106
109
|
export function planGrokInstall(context) {
|
|
107
110
|
const root = grokHomeOf(context);
|
|
108
111
|
return [
|
|
112
|
+
...planGrokIndicator(context),
|
|
109
113
|
{ path: hooksFile(root), kind: "tree" },
|
|
110
114
|
{ path: shimPath(root, context.hostPlatform), kind: "tree" },
|
|
111
115
|
{ path: skillPath(root), kind: "tree" },
|
|
@@ -57,19 +57,43 @@ Do this once, not every turn. Update it only when the scope or mode materially
|
|
|
57
57
|
changes. `--hint` is important: it lets ACC match your plan against a peer's
|
|
58
58
|
claim. Intent is awareness, not permission.
|
|
59
59
|
|
|
60
|
-
Before changing shared files, claim the smallest useful
|
|
60
|
+
Before changing shared files, claim the smallest useful resources in one operation:
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
|
-
{{ACC}} claim --resource 'file:packages/core/**'
|
|
63
|
+
{{ACC}} claim --resource 'file:packages/core/**' \
|
|
64
|
+
--resource 'file:packages/protocol/**' --reason "porting the claim model"
|
|
64
65
|
```
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
Repeat `--resource` for an atomic batch, or supply it once for one claim.
|
|
68
|
+
Shared mode, enforcement, reason, and lease apply to every resource. Duplicate resources after
|
|
69
|
+
normalization are rejected. Exit 5 means a conflict: no claim is created or
|
|
70
|
+
renewed. Batch `details.conflicts` names blocked resources and their holders.
|
|
71
|
+
Narrow your scope, contact the owner, or ask the human. Repeating a successful
|
|
72
|
+
claim command renews your existing claims on those resources.
|
|
73
|
+
|
|
74
|
+
Release selected claims when useful:
|
|
68
75
|
|
|
69
76
|
```bash
|
|
70
|
-
{{ACC}} release --resource 'file:packages/core/**'
|
|
77
|
+
{{ACC}} release --resource 'file:packages/core/**' \
|
|
78
|
+
--resource 'file:packages/protocol/**'
|
|
71
79
|
```
|
|
72
80
|
|
|
81
|
+
Choose exactly one selector family: repeated `--resource`, repeated `--claim`,
|
|
82
|
+
or `--all`. Duplicate selectors after normalization are rejected. A missing or
|
|
83
|
+
foreign explicit target fails without releasing any claims. Repeating an explicit release after its targets were removed is an error.
|
|
84
|
+
Batch release accepts no force-release authority.
|
|
85
|
+
|
|
86
|
+
To release all your claims while keeping your session and intent open:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
{{ACC}} release --all
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
This selects only your session's current claims in its workspace. An empty set
|
|
93
|
+
succeeds. Each retry selects the current set and can release newly acquired claims.
|
|
94
|
+
Use `work --clear` to clear intent, `ack` to acknowledge a message, and `finish`
|
|
95
|
+
to record a handoff and close your ACC presence.
|
|
96
|
+
|
|
73
97
|
## Communicate only when it changes another agent's work
|
|
74
98
|
|
|
75
99
|
Send a message for a dependency, conflict, direct question, decision, or
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { preflightKimiIndicator } from "./indicator-install.mjs";
|
|
2
|
+
import { kimiIndicator } from "./indicator.mjs";
|
|
1
3
|
import { defineAdapter, projectContext, projectContextResult }
|
|
2
4
|
from "@agents-can-communicate/adapter-sdk";
|
|
3
5
|
import certification from "../certification.json" with { type: "json" };
|
|
@@ -28,6 +30,7 @@ export const KIMI_CODE_VERSION = "0.36.1";
|
|
|
28
30
|
export function createKimiAdapter() {
|
|
29
31
|
return defineAdapter({
|
|
30
32
|
id: "kimi",
|
|
33
|
+
statusIndicator: kimiIndicator,
|
|
31
34
|
displayName: "Kimi Code",
|
|
32
35
|
// The binary this client actually installs. Probed for a version to
|
|
33
36
|
// decide whether the client is on this machine, so it has to be the
|
|
@@ -57,6 +60,7 @@ export function createKimiAdapter() {
|
|
|
57
60
|
planInstall: context => planKimiInstall(forClient(context)),
|
|
58
61
|
detect: context => detectKimi(forClient(context)),
|
|
59
62
|
install: context => installKimiPlugin(forClient(context)),
|
|
63
|
+
preflightUninstall: context => preflightKimiIndicator(forClient(context)),
|
|
60
64
|
uninstall: context => uninstallKimiPlugin(forClient(context)),
|
|
61
65
|
|
|
62
66
|
doctor: async context => {
|