@cirtium/acent-connect 1.2.2 → 1.2.4
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/acent/.claude-plugin/plugin.json +1 -1
- package/acent/.codex-plugin/plugin.json +1 -1
- package/acent/.cursor-plugin/plugin.json +1 -1
- package/acent/scripts/bridge-approval.mjs +97 -0
- package/acent/scripts/bridge.mjs +7 -5
- package/acent/scripts/mcp-proxy.mjs +13 -1
- package/acent/skills/acent-bridge/SKILL.md +11 -6
- package/antigravity/plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { bridgeTargets } from "./bridge-runners.mjs"
|
|
2
|
+
import { supportsForm } from "./clarification.mjs"
|
|
3
|
+
|
|
4
|
+
const scopeLimit = 128
|
|
5
|
+
const itemLimit = 300
|
|
6
|
+
const purposeLimit = 500
|
|
7
|
+
const choices = ["Allow once", "Continue locally"]
|
|
8
|
+
|
|
9
|
+
export const bridgeApprovalTool = {
|
|
10
|
+
name: "acent_bridge_request_approval",
|
|
11
|
+
description: "Ask for one-time permission before a Bridge handoff that needs user approval. Pass only the external agent names, file paths or names of data categories, and a brief purpose. Never include file contents, diffs, secrets, or raw logs. This tool only asks the user and does not launch a delegate or override host policy.",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: "object",
|
|
14
|
+
properties: {
|
|
15
|
+
targets: { type: "array", minItems: 1, maxItems: bridgeTargets.length, uniqueItems: true, items: { type: "string", enum: bridgeTargets } },
|
|
16
|
+
scope: { type: "array", minItems: 1, maxItems: scopeLimit, uniqueItems: true, items: { type: "string", minLength: 1, maxLength: itemLimit } },
|
|
17
|
+
purpose: { type: "string", minLength: 1, maxLength: purposeLimit },
|
|
18
|
+
},
|
|
19
|
+
required: ["targets", "scope", "purpose"],
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
},
|
|
22
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: false, openWorldHint: false },
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function validList(value, maxItems, validItem) {
|
|
26
|
+
return Array.isArray(value) && value.length > 0 && value.length <= maxItems &&
|
|
27
|
+
new Set(value).size === value.length && value.every(validItem)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function validLabel(value, limit) {
|
|
31
|
+
return typeof value === "string" && value.trim().length > 0 &&
|
|
32
|
+
value.length <= limit && !/[\r\n]/u.test(value)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export async function requestBridgeApproval(input, capabilities, protocol, request) {
|
|
36
|
+
const { targets, scope, purpose } = input ?? {}
|
|
37
|
+
if (
|
|
38
|
+
!validList(targets, bridgeTargets.length, (target) => bridgeTargets.includes(target)) ||
|
|
39
|
+
!validList(scope, scopeLimit, (item) => validLabel(item, itemLimit)) ||
|
|
40
|
+
!validLabel(purpose, purposeLimit) ||
|
|
41
|
+
Object.keys(input).some((key) => !["targets", "scope", "purpose"].includes(key))
|
|
42
|
+
) {
|
|
43
|
+
throw new Error("Provide the Bridge destinations, data scope, and purpose using brief labels only.")
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const question = [
|
|
47
|
+
"Allow Acent Bridge to share the following with the selected coding agents?",
|
|
48
|
+
`Destinations: ${targets.join(", ")}`,
|
|
49
|
+
`Purpose: ${purpose}`,
|
|
50
|
+
"Shared data:",
|
|
51
|
+
...scope.map((item) => `- ${item}`),
|
|
52
|
+
].join("\n")
|
|
53
|
+
const fallback = {
|
|
54
|
+
status: "needs_user_input",
|
|
55
|
+
question,
|
|
56
|
+
choices,
|
|
57
|
+
nextAction: "Ask the user in their language using the host's approval flow when available, or ask in the current chat if the host permits it. Wait for explicit approval of this exact scope. A chat answer does not override a host denial.",
|
|
58
|
+
}
|
|
59
|
+
if (!supportsForm(capabilities, protocol)) return fallback
|
|
60
|
+
const unavailable = {
|
|
61
|
+
status: "approval_unavailable",
|
|
62
|
+
nextAction: "Continue locally. The host did not provide an approval. Do not retry this handoff through a different path.",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let result
|
|
66
|
+
try {
|
|
67
|
+
result = await request({
|
|
68
|
+
...(protocol === "2025-11-25" ? { mode: "form" } : {}),
|
|
69
|
+
message: question,
|
|
70
|
+
requestedSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
properties: {
|
|
73
|
+
decision: { type: "string", title: "Bridge permission", enum: choices },
|
|
74
|
+
},
|
|
75
|
+
required: ["decision"],
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
} catch {
|
|
79
|
+
return unavailable
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (result?.action === "cancel") return { status: "cancelled" }
|
|
83
|
+
if (result?.action === "decline") return { status: "declined" }
|
|
84
|
+
if (result?.action === "accept") {
|
|
85
|
+
if (result.content?.decision === "Continue locally") return { status: "declined" }
|
|
86
|
+
if (result.content?.decision === "Allow once") {
|
|
87
|
+
return {
|
|
88
|
+
status: "approved_once",
|
|
89
|
+
targets,
|
|
90
|
+
scope,
|
|
91
|
+
purpose,
|
|
92
|
+
nextAction: "Submit only the approved handoff through the normal Bridge tool and follow all host approval requirements. If the host blocks it, do not retry through a different path.",
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return unavailable
|
|
97
|
+
}
|
package/acent/scripts/bridge.mjs
CHANGED
|
@@ -295,9 +295,11 @@ export const bridgeTools = [
|
|
|
295
295
|
]
|
|
296
296
|
|
|
297
297
|
export const bridgeInstructions = [
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
298
|
+
"Automatic Bridge settings select eligible tools; they do not grant permission to share sensitive data. If a handoff requires approval and the user has not already authorized the exact destinations, data scope, and purpose, call acent_bridge_request_approval before submitting any work. Pass only agent names, file paths or data category labels, and a brief purpose, never source contents, diffs, secrets, or logs. Include every destination and all data the delegate will be able to read, including diffs, task context, and read paths when applicable. For a refinement, include reviewers and the repair agent, and ask again when a replacement, continuation, or scope change introduces new data sharing.",
|
|
299
|
+
"Use approved_once only for the described handoff. If the form is unsupported and the result is needs_user_input, use the host's approval flow, or ask once in the current chat if permitted, in the user's language. Wait for an explicit answer. On decline, cancellation, or unavailable approval, keep working locally. Submit approved work through the normal Bridge tool and respect host approval decisions. Never use this question or another route to bypass a blocked tool call.",
|
|
300
|
+
"Use Acent Bridge when the user explicitly asks to delegate. For feature work or a bug fix that needs investigation or behavioral verification, identify one focused task that could run alongside your work as soon as the goal and likely scope are clear. Check acent_bridge_settings at that point, even for a single-file change. If the project reports automatic=true and a suitable candidate is available, start the independent task before detailed investigation or implementation, and continue the main work in parallel. Pass automatic=true when listing candidates, starting a task, or starting refinement. Honor any user instruction to keep the work in the current agent.",
|
|
301
|
+
"Prefer one concrete read-only task when the implementation scope is still forming, such as tracing a caller, identifying a specific regression case, or checking test coverage. Give the delegate a distinct question with a verifiable result. Check settings if a trigger first becomes clear later and reassess when a reviewable patch is ready. Other automatic triggers are independent implementation with verifiable outcomes and disjoint write scopes, substantive changes to payments, authorization, privacy, or durable data, and difficult failures where the cause remains unclear or a fix repeatedly fails.",
|
|
302
|
+
"Handle straightforward copy or styling edits and dependent steps directly. Start additional automatic tasks only when each has a distinct, useful result. Keep one writer responsible for each shared contract, state machine, or business rule, even if the files are disjoint. Resolve shared design decisions before starting parallel implementation. If one task needs an earlier result, pass dependsOn or finish the prerequisite first. Use read-only review or diagnosis for independent work when writes need one owner.",
|
|
301
303
|
"Keep authorized production actions such as deploys, database migrations, and live payments or refunds with the coordinating agent. Use Bridge for independent review of the plan and verification of the result.",
|
|
302
304
|
"If automatic delegation is disabled, continue the task directly. If automatic delegation is enabled but no suitable candidate is available, continue work you can verify and state the specific reason the independent work did not run. Report only the reviews and checks that actually completed.",
|
|
303
305
|
"Get candidates for each new task and choose a tool and model that fit the work and the user's preference. Favor lower-usage options for routine work when verified quota is low and the user has not pinned a model. Start tasks with concrete acceptance criteria.",
|
|
@@ -308,9 +310,9 @@ export const bridgeInstructions = [
|
|
|
308
310
|
"Use acent_bridge_integrate to check and apply completed diffs. For substantive changes implemented in parallel, review the integrated result and run end-to-end checks while eligible independent reviewers look at the same integrated candidate. Give multiple reviewers complementary priorities, such as concurrency, interface behavior, or regressions. Keep the reviewed files stable while reviews and checks run. Apply findings and re-review and rerun affected checks if the candidate changes.",
|
|
309
311
|
"For substantive authorized edits with a defined write scope, use acent_bridge_refine to run independent review, repair and re-review. Pass applied task IDs in dependsOn. Choose eligible model families and optionally set each reviewer's focus to a distinct priority. Set apply=true only within the user's authorized editing scope.",
|
|
310
312
|
"At needs_checks, call verify with the current checkRevision and authorized test commands to run in the private staging workspace. For a pending verified patch, inspect and approve it with apply and checkRevision. Replace a failed reviewer with replace_reviewer and an eligible reviewer. Resolve context requests using acent_bridge_continue and then resume refinement status. For standalone review of integrated work, submit commands to acent_bridge_finalize and poll without commands until verification finishes. Use setupCommands if the private check copy needs project-specific preparation. Remain responsible for the final result.",
|
|
311
|
-
"Include an Acent Bridge section in the first final answer after any Bridge run or requested independent review, including when a requested review could not run. Start with a bold Acent Bridge label and the observed status in the user's language. Follow it immediately with a Markdown table
|
|
313
|
+
"Include an Acent Bridge section in the first final answer after any Bridge run or requested independent review, including when a requested review could not run. Start with a bold Acent Bridge label and the observed status in the user's language. Follow it immediately with a Markdown table showing the agent or check and its execution model, the work it performed and its scope, the outcome, and the findings or evidence. Include the table even when only one delegate participated or its execution model is unknown. Name the coordinator and delegate separately for the checks each performed. For delegates, use actualModel as the host-reported model. For the coordinator, use the host's model metadata for that turn when available. When the execution model is unavailable, label any requested model as requested and mark the execution model unconfirmed. Keep model families separate from model names.",
|
|
312
314
|
"Use one row per task, reviewer, or check. Use reviewResult and reviewResults to distinguish findings, no findings in the reviewed scope, unclassified results, failed or blocked reviews, and reviews that did not run. Include relevant earlier and replacement rows with their round, and list checksNotRun as not run. Keep findings reported by a single reviewer visible. Report whether each material finding was reproduced, remains unverified, or was fixed and rechecked. Cite file lines and short observed evidence in the table or in an Evidence section above the conclusion. Keep raw logs and credentials out of the answer.",
|
|
313
|
-
"
|
|
315
|
+
"Put application status, pending checks, and blockers in the table or the evidence above the conclusion. End the entire final answer, after the table and any evidence, with exactly one standalone sentence summarizing the overall outcome and the delegate's most useful observed contribution. If delegation could not run, state the blocker in that sentence. Place nothing after it.",
|
|
314
316
|
].join(" ")
|
|
315
317
|
|
|
316
318
|
const cacheDuration = 120_000
|
|
@@ -8,6 +8,7 @@ import { connectionContext, createRootsChannel, projectFolder } from "./connecti
|
|
|
8
8
|
import { memoryInstructions } from "./memory-instructions.mjs"
|
|
9
9
|
import { attachmentTool, saveAttachments } from "./capture-attachments.mjs"
|
|
10
10
|
import { bridgeInstructions, bridgeTools, createBridge } from "./bridge.mjs"
|
|
11
|
+
import { bridgeApprovalTool, requestBridgeApproval } from "./bridge-approval.mjs"
|
|
11
12
|
import { bridgeCaptureEvents } from "./bridge-capture.mjs"
|
|
12
13
|
import { createInterface } from "node:readline"
|
|
13
14
|
import { mkdir } from "node:fs/promises"
|
|
@@ -95,7 +96,7 @@ async function detectConnectionContext(config, verifiedWorkspace) {
|
|
|
95
96
|
return { context, roots }
|
|
96
97
|
}
|
|
97
98
|
|
|
98
|
-
const localBridgeTools = process.env.ACENT_BRIDGE_WORKER === "1" ? [] : bridgeTools
|
|
99
|
+
const localBridgeTools = process.env.ACENT_BRIDGE_WORKER === "1" ? [] : [...bridgeTools, bridgeApprovalTool]
|
|
99
100
|
const bridge = createBridge()
|
|
100
101
|
const content = (text, isError = false) => ({
|
|
101
102
|
content: [{ type: "text", text }],
|
|
@@ -250,6 +251,17 @@ async function handleLine(line) {
|
|
|
250
251
|
message.method = workspaceCatalog ? "tools/list" : "tools/call"
|
|
251
252
|
message.params = workspaceCatalog ? undefined : { name: args.tool, arguments: args.arguments }
|
|
252
253
|
}
|
|
254
|
+
if (message.method === "tools/call" && localBridgeTools.includes(bridgeApprovalTool) &&
|
|
255
|
+
message.params?.name === bridgeApprovalTool.name) {
|
|
256
|
+
try {
|
|
257
|
+
const value = await requestBridgeApproval(message.params.arguments, clientCapabilities, protocol,
|
|
258
|
+
(params) => questions.request(params, message.id))
|
|
259
|
+
reply({ ...content(JSON.stringify(value)), structuredContent: value })
|
|
260
|
+
} catch (error) {
|
|
261
|
+
reply(content(error.message, true))
|
|
262
|
+
}
|
|
263
|
+
return
|
|
264
|
+
}
|
|
253
265
|
if (message.method === "tools/call" &&
|
|
254
266
|
localBridgeTools.some(tool => tool.name === message.params?.name)) {
|
|
255
267
|
try {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: acent-bridge
|
|
3
|
-
description: Acent Bridge delegates work to another coding agent in the current project. Use for explicit delegation
|
|
3
|
+
description: Acent Bridge delegates work to another coding agent in the current project. Use for explicit delegation and consider it early for feature work, bug fixes, and reviews with an independent check.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Acent Bridge
|
|
7
7
|
|
|
8
8
|
Use the Acent Bridge MCP tools in a session with one local project folder open. If the tools are unavailable, tell the user that Bridge is unavailable in the current session.
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
- **Early investigation.**
|
|
10
|
+
- For feature work or a bug fix that needs investigation or behavioral verification, identify one focused task that could run alongside your work as soon as the goal and likely scope are clear. Check `acent_bridge_settings` at that point, even for a single-file change. If the project reports `automatic: true` and a suitable candidate is available, start the independent task before detailed investigation or implementation, and continue the main work in parallel. Check settings when a trigger first becomes clear later and reassess when a reviewable patch is ready. Pass `automatic: true` when listing candidates, starting a task, or starting refinement. Honor the user's instructions about delegation. Users can change the setting in the project's Bridge dialog.
|
|
11
|
+
- **Early investigation.** Prefer one concrete read-only task when the implementation scope is still forming. Ask the delegate to trace a caller, identify a specific regression case, or check existing test coverage that can inform the fix. Give it a distinct question with a verifiable result, while the coordinator advances other work.
|
|
12
12
|
- **Parallel implementation.** Delegate independently verifiable tasks with disjoint write scopes once shared design decisions are settled.
|
|
13
13
|
- **Independent review.** Have a different model family review substantive changes to payments, authorization, privacy, or durable data before reporting completion. For substantive changes implemented in parallel, review the integrated result with the coordinator and eligible independent reviewers while the coordinator runs end-to-end checks.
|
|
14
14
|
- **Independent diagnosis.** Delegate a read-only investigation if the cause remains unclear or a fix repeatedly fails.
|
|
15
|
-
- Keep
|
|
15
|
+
- Keep straightforward copy or styling edits and dependent steps with the coordinating agent. Start additional automatic tasks only when each has a distinct, useful result. Give each shared contract, state machine, or business rule one writer, even when it spans separate files. Finish a prerequisite first or use `dependsOn` when later work needs its result. Use read-only review or diagnosis for independent work when writes need one owner.
|
|
16
16
|
- Keep authorized production actions with the coordinating agent, including deployments, database migrations, and live payments or refunds. Bridge can review the plan or verify the outcome independently.
|
|
17
17
|
- If automatic delegation is disabled, continue directly. If it is enabled and no suitable candidate is available, continue the work you can verify and report why independent work did not run.
|
|
18
18
|
- Classify the work as `implement`, `review`, or `diagnose`. Call `acent_bridge_candidates` and select a returned tool and model that fit the task and the user's preference. For review, diagnosis, and refinement, pass the host-reported model for this turn as `currentModel`. Supply `originModel` when reviewing earlier work whose originating model is known. Bridge uses the earlier model when supplied and recognized, otherwise it checks independence against the current model. In Codex, if candidate selection returns `origin_model_unverified` and the Bridge hook reports the current model, retry with that ID. Pass the same model inputs to start the selected work. Report when no eligible candidate is available.
|
|
@@ -26,6 +26,11 @@ Use the Acent Bridge MCP tools in a session with one local project folder open.
|
|
|
26
26
|
- At `needs_checks`, call the refinement's `verify` action with the current `checkRevision` and the authorized test executables and arguments. Bridge runs them in a private copy of the reviewed candidate. For a standalone review of integrated edits, submit `commands` to `acent_bridge_finalize` and poll without them. Both flows prepare dependencies in the private test copy. Bridge can install locked npm dependencies automatically, and `setupCommands` can supply the project's own preparation steps. Report verification after `verified`. If project files captured in the verification snapshot change, begin from the latest changes.
|
|
27
27
|
- Use `apply: true` to apply scoped repairs after the stage passes review and tests. Otherwise inspect the verified patch and call `apply` with the current `checkRevision`. If the user stops verification or refinement, call its `cancel` action and confirm the final state. If promotion has already started, check what was applied. If findings remain after three repairs or require files outside the approved scope, report the blocker.
|
|
28
28
|
|
|
29
|
+
## Approval before sharing data
|
|
30
|
+
|
|
31
|
+
- Automatic delegation selects eligible tools. When a handoff needs additional data-sharing approval, call `acent_bridge_request_approval` before submitting it. Show all destination agents, the exact file or data scope, and the purpose using labels only. Include any context, diffs, and extra read access in the scope description without including their contents. Check again before a replacement or continuation that would share new data.
|
|
32
|
+
- Proceed through the normal Bridge tool only after explicit approval of that handoff. On `needs_user_input`, use the host's approval flow or ask once in the current chat if the host permits it. On decline, cancellation, or unavailable approval, continue locally. Follow all host approval requirements and never use the Bridge question to override or route around a host denial.
|
|
33
|
+
|
|
29
34
|
## Review when only the coordinator can access a source
|
|
30
35
|
|
|
31
36
|
- When a database, provider dashboard, deployment log, or connector is available only to the coordinator, keep its checks with the coordinator and delegate the parts that can be independently reviewed using source code, migrations, local tests, or sanitized evidence. Follow the project's automatic setting and candidate selection rules.
|
|
@@ -36,8 +41,8 @@ For a payment review, the coordinator can report that a sandbox purchase produce
|
|
|
36
41
|
|
|
37
42
|
## Report Bridge results
|
|
38
43
|
|
|
39
|
-
1. Include an Acent Bridge section in the first final answer after any Bridge run or requested independent review, including when a requested review could not run. Start with `**Acent Bridge** · <status>` in the user's language. Follow it immediately with a Markdown table
|
|
44
|
+
1. Include an Acent Bridge section in the first final answer after any Bridge run or requested independent review, including when a requested review could not run. Start with `**Acent Bridge** · <status>` in the user's language. Follow it immediately with a Markdown table showing the agent or check and its execution model, the work it performed and its scope, the outcome, and the findings or evidence. Include the table even when only one delegate participated or its execution model is unknown. Name the coordinator and delegate separately for the checks each performed. For delegates, use `actualModel` as the host-reported model. For the coordinator, use the host's model metadata for that turn when available. When the execution model is unavailable, label any requested model as requested and mark the execution model unconfirmed. Keep model families separate from model names.
|
|
40
45
|
2. Use one row per distinct task, review, or check. Keep relevant earlier rounds and replacement reviewers visible. Use `reviewResult` and `reviewResults` to distinguish findings, no findings in the reviewed scope, unclassified output, failed or blocked reviews, and reviews that did not run. Mark `checksNotRun` as not run and report other unavailable tools with their observed reasons. Preserve findings reported by a single reviewer. Say whether each material finding was reproduced, fixed and rechecked, or still needs verification. Cite file lines and short observed evidence in the table or in an Evidence section above the conclusion. Keep raw logs and credentials out of the answer.
|
|
41
|
-
3.
|
|
46
|
+
3. Put application status, pending checks, and blockers in the table or the evidence above the conclusion. End the entire final answer, after the table and any evidence, with exactly one standalone sentence summarizing the overall outcome and the delegate's most useful observed contribution. If delegation could not run, state the blocker in that sentence. Place nothing after it.
|
|
42
47
|
|
|
43
48
|
When the coordinator and delegate verify different parts of a result, name the observer for each material piece of evidence and identify any check that remains unverified.
|
package/antigravity/plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://antigravity.google/schemas/v1/plugin.json",
|
|
3
3
|
"name": "acent",
|
|
4
4
|
"displayName": "Acent",
|
|
5
|
-
"version": "1.2.
|
|
5
|
+
"version": "1.2.4",
|
|
6
6
|
"description": "Recall past work, trace code changes, revisit decisions, and resume tasks with Acent.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Cirtium"
|