@cirtium/acent-connect 1.2.3 → 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 +2 -0
- package/acent/scripts/mcp-proxy.mjs +13 -1
- package/acent/skills/acent-bridge/SKILL.md +5 -0
- 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,6 +295,8 @@ export const bridgeTools = [
|
|
|
295
295
|
]
|
|
296
296
|
|
|
297
297
|
export const bridgeInstructions = [
|
|
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.",
|
|
298
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.",
|
|
299
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.",
|
|
300
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.",
|
|
@@ -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 {
|
|
@@ -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.
|
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"
|