@cirtium/acent-connect 0.3.1 → 0.3.2

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acent",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Recall past work, trace code changes, revisit decisions, and resume tasks with Acent.",
5
5
  "mcpServers": "./mcp-claude.json",
6
6
  "hooks": "./hooks/claude.json"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acent",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Recall past work, trace code changes, revisit decisions, and resume tasks with Acent.",
5
5
  "skills": "./skills/",
6
6
  "mcpServers": "./mcp-codex.json",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acent",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Recall past work, trace code changes, revisit decisions, and resume tasks with Acent.",
5
5
  "author": {
6
6
  "name": "Cirtium"
@@ -1,11 +1,31 @@
1
1
  // Installation prepares files; connection authorizes Acent. Neither proves hooks ran.
2
2
  export function installationGuidance(tool) {
3
- return {
4
- Codex: "Restart Codex and check Acent in Plugins. If it is not enabled, install or enable the local Acent entry. Review and trust Acent's hooks to enable conversation saving. Then ask: Connect Acent.",
5
- "Claude Code": "Start a new Claude Code session or run /reload-plugins, then ask: Connect Acent. Respond to workspace or tool permission prompts only if Claude Code shows them.",
6
- Cursor: "Restart Cursor or run Developer: Reload Window, then check Acent in Customize and ask: Connect Acent. A marketplace copy can take precedence; organization policy can block local plugins.",
7
- Antigravity: "Open Customizations > Installed and check that Acent is available and enabled, then ask: Connect Acent. If it has not loaded in the current conversation, start a new conversation. No separate hook approval step is prescribed.",
8
- }[tool] || "Open your coding tool and check that Acent is available."
3
+ const steps = {
4
+ Codex: [
5
+ "Restart Codex and check Acent in Plugins.\n If it is not enabled, install or enable the local Acent entry.",
6
+ "Review and trust Acent's hooks to enable conversation saving.",
7
+ ],
8
+ "Claude Code": [
9
+ "Start a new Claude Code session or run /reload-plugins.",
10
+ "Respond to workspace or tool permission prompts if Claude Code shows them.",
11
+ ],
12
+ Cursor: [
13
+ "Restart Cursor or run Developer: Reload Window.",
14
+ "Check that Acent is enabled in Customize.",
15
+ ],
16
+ Antigravity: [
17
+ "Open Customizations > Installed and check that Acent is enabled.",
18
+ "If Acent has not loaded, start a new conversation.",
19
+ ],
20
+ }[tool] || ["Open your coding tool and check that Acent is available."]
21
+ steps.push(
22
+ 'In your tool\'s chat, ask: "Connect Acent".',
23
+ "Follow the connection link to choose a project and review conversation saving."
24
+ )
25
+ const note = tool === "Cursor"
26
+ ? "A marketplace copy can take precedence; organization policy can block local plugins."
27
+ : ""
28
+ return "Next steps\n\n" + steps.map((step, index) => `${index + 1}. ${step}`).join("\n\n") + (note ? `\n\n${note}` : "")
9
29
  }
10
30
  export function connectionGuidance(tool) {
11
31
  const common = "Acent account authorization is complete. Refresh the available tools and continue in this session; do not request a restart solely because authorization completed. Connection does not prove that conversation saving has run."
@@ -44,6 +44,44 @@ const content = (text, isError = false) => ({
44
44
  content: [{ type: "text", text }],
45
45
  isError,
46
46
  })
47
+ const needsConnection = (error) =>
48
+ error.code === "ENOENT" ||
49
+ error.code === "invalid_grant" ||
50
+ error.code === "project_unavailable" ||
51
+ error.status === 401
52
+
53
+ function toolErrorMessage(error) {
54
+ if (needsConnection(error))
55
+ return "Acent needs a connection for this folder. Call acent_connect and show the user its link, then retry after approval."
56
+ if (["subscription_required", "capacity_exceeded"].includes(error.code))
57
+ return error.message
58
+ if (error.status === 429)
59
+ return "Acent is receiving too many requests. Try again shortly."
60
+ if (error.status === 403)
61
+ return "This Acent connection does not have permission to access this resource."
62
+ if (error.status >= 500 || ["TimeoutError", "AbortError", "TypeError"].includes(error.name))
63
+ return "Acent is temporarily unavailable. Try again shortly."
64
+ return "The Acent request failed. Try again shortly."
65
+ }
66
+ async function postMcp(config, access, message) {
67
+ const response = await fetch(`${config.server}/mcp`, {
68
+ method: "POST",
69
+ headers: {
70
+ Authorization: `Bearer ${access}`,
71
+ "Content-Type": "application/json",
72
+ Accept: "application/json, text/event-stream",
73
+ ...(protocol ? { "MCP-Protocol-Version": protocol } : {}),
74
+ },
75
+ body: JSON.stringify(message),
76
+ signal: AbortSignal.timeout(60_000),
77
+ })
78
+ if (response.ok) return response
79
+ const failure = await response.json().catch(() => ({}))
80
+ throw Object.assign(
81
+ new Error(failure?.error_description || `Acent request failed (${response.status}).`),
82
+ { status: response.status, code: failure?.error }
83
+ )
84
+ }
47
85
  async function startConnection(config) {
48
86
  const directory = configDirectory(config)
49
87
  if (pendingConnection) return connectionUrl
@@ -150,12 +188,17 @@ async function handleLine(line) {
150
188
  }
151
189
  if (message.params.arguments?.reconnect !== true) {
152
190
  try {
153
- await accessToken(config, configDirectory(config))
191
+ const access = await accessToken(config, configDirectory(config))
192
+ // A cached token can still be fresh locally after the grant is revoked.
193
+ const response = await postMcp(config, access, {
194
+ jsonrpc: "2.0", id: message.id, method: "tools/list",
195
+ })
196
+ await response.body?.cancel()
154
197
  reply(content(connectionGuidance(config.tool)))
155
198
  write({ jsonrpc: "2.0", method: "notifications/tools/list_changed" })
156
199
  return
157
200
  } catch (error) {
158
- if (error.code !== "ENOENT" && error.status !== 401 && error.status !== 400) throw error
201
+ if (!needsConnection(error)) throw error
159
202
  }
160
203
  }
161
204
  const url = await startConnection(config)
@@ -171,7 +214,7 @@ async function handleLine(line) {
171
214
  try {
172
215
  access = await accessToken(config, directory)
173
216
  } catch (error) {
174
- if (message.method === "tools/list") {
217
+ if (message.method === "tools/list" && needsConnection(error)) {
175
218
  reply({ tools: [setupTool] })
176
219
  return
177
220
  }
@@ -194,30 +237,13 @@ async function handleLine(line) {
194
237
  } catch (error) { reply(content(error.message, true)) }
195
238
  return
196
239
  }
197
- const response = await fetch(`${config.server}/mcp`, {
198
- method: "POST",
199
- headers: {
200
- Authorization: `Bearer ${access}`,
201
- "Content-Type": "application/json",
202
- Accept: "application/json, text/event-stream",
203
- ...(protocol ? { "MCP-Protocol-Version": protocol } : {}),
204
- },
205
- body: JSON.stringify(message),
206
- signal: AbortSignal.timeout(60_000),
207
- })
208
- if (!response.ok) {
209
- if (
210
- message.method === "tools/list" &&
211
- [401, 403].includes(response.status)
212
- ) {
213
- reply({ tools: [setupTool] })
214
- return
215
- }
216
- const failure = await response.json().catch(() => ({}))
217
- if (["subscription_required", "capacity_exceeded"].includes(failure.error)) {
218
- throw Object.assign(new Error(failure.error_description), { entitlementFailure: true })
219
- }
220
- throw new Error(`Acent request failed (${response.status}).`)
240
+ let response
241
+ try {
242
+ response = await postMcp(config, access, message)
243
+ } catch (error) {
244
+ if (message.method === "tools/list" && needsConnection(error))
245
+ return reply({ tools: [setupTool] })
246
+ throw error
221
247
  }
222
248
  if (response.status === 202 || response.status === 204) return
223
249
  const result = await response.json()
@@ -232,16 +258,12 @@ async function handleLine(line) {
232
258
  id: message.id,
233
259
  ...(message.method === "tools/call"
234
260
  ? {
235
- result: content(
236
- error.entitlementFailure ? error.message : "Acent needs a connection for this folder. Call acent_connect and show the user its link, then retry after approval.",
237
- true
238
- ),
261
+ result: content(toolErrorMessage(error), true),
239
262
  }
240
263
  : {
241
264
  error: {
242
265
  code: -32000,
243
- message:
244
- error.entitlementFailure ? error.message : "Acent is unavailable. Use acent_connect to connect or retry.",
266
+ message: toolErrorMessage(error),
245
267
  },
246
268
  }),
247
269
  })
@@ -3,7 +3,7 @@
3
3
  export const memoryInstructions = [
4
4
  "Acent has five named skills: Acent Recall finds past context; Acent Trace explains saved code edits; Acent Decisions retrieves choices and reasons; Acent Resume continues saved work; Acent Connect manages connection setup. Recognize these names in user requests and use the relevant exposed tools. These are workflows within the Acent plugin, not separate connections. Automatic capture remains controlled by saving consent.",
5
5
  "Use connected Acent as the first source for missing project history when it could change the answer or next action, including within the same conversation or after context compaction. Search before asking the user to restate that history, even without an explicit mention of Acent. For example, if the user says 'do it like last time' or '저번처럼 해줘' and the earlier approach is unclear, search using the task, feature, or error they mention. Also retrieve for resumed work, unexplained past decisions or constraints, conflicting records, and recurring failures where earlier attempts could affect the next step. Skip retrieval when the current context and files already answer the question. Reuse evidence already read and search again when the task changes, a reference is stale, or later corrections may matter.",
6
- "Choose one focused entry point rather than calling every search tool. For recent work without a topic use get_recent_work when available; for a named task use get_handoff; for a specific choice, rejection, change or reported outcome use get_decision_context with 1–8 distinctive keywords. Use search_evidence for missing details, failed attempts, conflicts or later unsummarized corrections; use keyword mode for exact code or errors and hybrid for meaning. Use read_evidence for selected passages that need more context. To open the exact archived decision message, use read_original with the originalReference id and messageIndex when available. For saved files or images use search_attachments with a known sourceId, filename, extracted text or distinctive surrounding words. Use read_saved_file for extracted document text and follow nextOffset only as needed. Check analysis_status: partial is not the whole file and saved does not mean analyzed. Image links are not visual inspection.",
6
+ "Choose one focused entry point rather than calling every search tool. For recent work without a named task use get_recent_work first (just now, earlier, recently, 방금, 방금 전, 좀 전, 아까, 최근). An agent name identifies the source, so for '방금 Codex에서 어디까지 했지?' call get_recent_work with provider=codex when supported. For a named task use get_handoff with the task topic; for a specific choice, rejection, change or reported outcome use get_decision_context with 1–8 distinctive keywords. Use search_evidence for missing details, failed attempts, conflicts or later unsummarized corrections; use keyword mode for exact code or errors and hybrid for meaning. Use read_evidence for selected passages that need more context. To open the exact archived decision message, use read_original with the originalReference id and messageIndex when available. For saved files or images use search_attachments with a known sourceId, filename, extracted text or distinctive surrounding words. Use read_saved_file for extracted document text and follow nextOffset only as needed. Check analysis_status: partial is not the whole file and saved does not mean analyzed. Image links are not visual inspection.",
7
7
  "Read the smallest relevant scope. Follow nextOffset only while the question remains unresolved; do not dump the whole project or send entire conversations as search queries. If a focused search misses, try a distinct term or permitted source before declaring the evidence unavailable; avoid repeated equivalent searches. No result does not prove no decision exists. Only use exposed tools within the approved project and account-wide scope. If original access is unavailable, use search_memories and read_memory when available, state the coverage limit, and never bypass it. If retrieval fails, report the limitation and continue independent work; ask for missing information only when needed for the dependent task.",
8
8
  "For questions about past events, success, or decision reasons, use the evidence already available when it clearly supports the answer. Search original evidence and open the relevant passage with surrounding turns when summaries or excerpts are ambiguous, conflicting, incomplete, or fail to establish the requested fact. Also read the original when the user explicitly requests it or exact wording matters. Do not open originals routinely merely because a question concerns the past. Use read_evidence with the returned ID and revision, read_original with the originalReference ID and messageIndex, or read_context for legacy row hits. Reuse an original passage already read when it contains enough context. Continue adjacent passages or pagination only until the claimed action, its reported result, and relevant later corrections are clear. These read-only steps within approved access do not require another confirmation.",
9
9
  "If a focused search misses or returns unrelated results, try distinct wording from the likely conversation, including product names, user-language terms, and the action or result. A code symbol alone may miss a natural-language discussion. Open relevant candidates rather than inferring absence from a snippet. If the evidence remains insufficient, say which searches and passages were checked and that the event is unconfirmed; do not claim the entire history contains no record.",
@@ -24,7 +24,7 @@ Use [Acent Trace](../acent-trace/SKILL.md) for specific code changes, [Acent Dec
24
24
 
25
25
  | Need | Tool |
26
26
  | --- | --- |
27
- | Recent work with no named topic | `get_recent_work` when available |
27
+ | Recent work with no named topic (e.g. “방금”, “좀 전”, “아까”, “최근”) | `get_recent_work` when available, with `provider` when the user names a coding agent |
28
28
  | Resume a specific task | `get_handoff` |
29
29
  | Prior choice, reason, rejection or change | `get_decision_context` with 1–8 distinctive topic keywords |
30
30
  | Missing detail, previous failure or later correction | `search_evidence`; hybrid for meaning, keyword for exact code/errors |
@@ -5,9 +5,16 @@ description: Acent Resume reconstructs saved work so the user can continue a tas
5
5
 
6
6
  # Acent Resume
7
7
 
8
- For recent work without a topic, start with `get_recent_work`. For a named task, use `get_handoff`. Skip redundant retrieval when the current conversation already supplies the needed context.
8
+ For recent work without a specific task, start with `get_recent_work`. This includes “just now”, “earlier”, “recently”, “방금”, “방금 전”, “좀 전”, “아까”, and “최근”. Treat the coding agent's name as a source filter. Use `provider` when supported, with `codex`, `cursor`, `claude-code`, or `antigravity`. Use `get_handoff` for a named task and query its topic. Skip redundant retrieval when the current conversation already supplies the needed context.
9
9
 
10
- Read relevant returned references to recover the last user request, completed or attempted work, remaining work, decisions and later corrections. Open code-change candidates with `read_code_change` using source_id and id. Use [Acent Trace](../acent-trace/SKILL.md) when understanding a particular edit is necessary.
10
+ - “방금 전 Codex에서 어디까지 했지?” → `get_recent_work({ provider: "codex" })`. Check the newest eligible conversation and read its latest relevant turn.
11
+ - “좀 전에 하던 거 어디까지 했지?” → `get_recent_work({})`. Use the current project context to identify the task.
12
+ - “최근 Codex에서 뭐 했어?” → `get_recent_work({ provider: "codex" })`. Summarize the relevant recent conversations.
13
+ - “아까 Codex에서 하던 로그인 수정 이어서 해줘” → `get_handoff({ query: "로그인 수정", provider: "codex" })` when the tool schema supports `provider`. Read the Codex evidence for that task.
14
+
15
+ Use the wording and the returned evidence to judge recency instead of assigning a fixed window to these expressions. If the requested agent has no saved recent candidates, explain the coverage limit and keep the requested source when checking related evidence.
16
+
17
+ Read relevant returned references to recover the last user request, completed or attempted work, remaining work, decisions and later corrections. Use edits from the selected sourceId and relevant turn as evidence for that task. Open an edit with `read_code_change` using its source_id and id, and request the diff section when needed. Use [Acent Trace](../acent-trace/SKILL.md) when understanding a particular edit is necessary.
11
18
 
12
19
  Conversation candidates are not verified task lists. Distinguish message time, collection time and archive storage time. Do not assume the newest conversation is unfinished, or that a reported successful change still exists. Compare the selected evidence with current files and repository state before proceeding.
13
20
 
@@ -5,7 +5,7 @@ description: Acent Trace finds saved code edits, their originating requests and
5
5
 
6
6
  # Acent Trace
7
7
 
8
- Search `search_code_changes` with a file path, code symbol or distinctive request words. Omit the query for recent edits, or use a known sourceId to narrow the conversation. Open relevant results with `read_code_change`, passing the returned source_id as sourceId and the edit id. Follow nextOffset and nextDecisionOffset only while needed.
8
+ Search `search_code_changes` with a file path, code symbol or distinctive request words. Omit the query for recent edits, or use a known sourceId to narrow the conversation. Pass the returned source_id as sourceId and the edit id to `read_code_change`. Use `section: "overview"` for capture status, `section: "diff"` for the patch, `section: "request"` for the original request, and `section: "decisions"` for related decisions. Follow nextOffset for text and nextDecisionOffset for decisions while needed. If the tool schema has no section parameter, use the combined response.
9
9
 
10
10
  Explain the changed file and code, captured request, tool, and recorded explanation. Cite the returned sourceId/id and decision originalReference; use `read_original` when exact source wording or surrounding context is needed. Never invent a source URL.
11
11
 
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "acent",
4
4
  "displayName": "Acent",
5
- "version": "0.3.1",
5
+ "version": "0.3.2",
6
6
  "description": "Recall past work, trace code changes, revisit decisions, and resume tasks with Acent.",
7
7
  "author": {
8
8
  "name": "Cirtium"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cirtium/acent-connect",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "Install and connect the shared Acent coding-tool plugin",
6
6
  "repository": {
package/scripts/acent.mjs CHANGED
@@ -23,8 +23,8 @@ async function applyPlugin(tool, command, settings, folder, execute, dependencie
23
23
  execute,
24
24
  })
25
25
  const action = command === "update" ? "files and settings updated" : "files and settings prepared"
26
- console.error(`Acent ${installed.version} ${action} for ${tool}.`)
27
- console.error(installationGuidance(tool))
26
+ console.error(`\nAcent ${installed.version} ${action} for ${tool}.\n`)
27
+ console.error(installationGuidance(tool) + "\n")
28
28
  return true
29
29
  }
30
30
 
@@ -62,7 +62,13 @@ export async function main(
62
62
  args = [...args]
63
63
  if (args.includes("--help") || args[0] === "help") {
64
64
  console.log(
65
- "Usage: acent [connect|install|update|disconnect|flush] [--tool codex|claude|cursor|antigravity] [--folder PATH]\n acent install --all\n acent update --all\nNo command starts interactive connection. Run in the project folder to connect.\ninstall: install without authorization; update: apply this CLI release without changing grants.\ninstall --all: prepare Acent for all four supported tools.\nupdate --all: update all plugins installed by the Acent CLI.\nGet the latest CLI release before running update. Node 22+ required."
65
+ [
66
+ "Usage\n\n acent [connect|install|update|disconnect|flush]\n [--tool codex|claude|cursor|antigravity] [--folder PATH]",
67
+ "Install\n\n acent install\n acent install --all\n\n Install for one tool, or prepare all four supported tools with --all.\n After installation, follow the printed steps and ask your agent: Connect Acent.",
68
+ "Connect\n\n acent connect\n\n Run in your project folder. Running acent without a command also starts connection.",
69
+ "Update\n\n acent update\n acent update --all\n\n Update one tool, or all plugins installed by this CLI.\n Existing project connections are kept.",
70
+ "Get the latest CLI release before running update. Node 22+ required.",
71
+ ].join("\n\n") + "\n"
66
72
  )
67
73
  return
68
74
  }
@@ -213,10 +213,7 @@ export async function installPlugin(
213
213
  tool,
214
214
  {
215
215
  command = "install",
216
- executable,
217
- folder,
218
216
  home = homedir(),
219
- execute = run,
220
217
  source = packageRoot,
221
218
  register = registerLocal,
222
219
  } = {}