@cortexkit/aft-opencode 0.58.1 → 0.59.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.
Files changed (109) hide show
  1. package/dist/bash-wait-detach.d.ts.map +1 -1
  2. package/dist/bg-notifications.d.ts +8 -0
  3. package/dist/bg-notifications.d.ts.map +1 -1
  4. package/dist/bridge-bootstrap.d.ts +4 -4
  5. package/dist/config-live-reload.d.ts +44 -8
  6. package/dist/config-live-reload.d.ts.map +1 -1
  7. package/dist/config.d.ts +85 -13
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/configure-warnings.d.ts.map +1 -1
  10. package/dist/entry/server.js +5329 -2607
  11. package/dist/hashline-tag-sources.d.ts +18 -0
  12. package/dist/hashline-tag-sources.d.ts.map +1 -0
  13. package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
  14. package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +4511 -2373
  17. package/dist/lsp-auto-install.d.ts +30 -0
  18. package/dist/lsp-auto-install.d.ts.map +1 -1
  19. package/dist/lsp-github-install.d.ts +5 -2
  20. package/dist/lsp-github-install.d.ts.map +1 -1
  21. package/dist/lsp-github-table.d.ts +4 -3
  22. package/dist/lsp-github-table.d.ts.map +1 -1
  23. package/dist/lsp-npm-table.d.ts +10 -0
  24. package/dist/lsp-npm-table.d.ts.map +1 -1
  25. package/dist/lsp-registry-probe.d.ts +8 -4
  26. package/dist/lsp-registry-probe.d.ts.map +1 -1
  27. package/dist/notifications.d.ts +1 -1
  28. package/dist/notifications.d.ts.map +1 -1
  29. package/dist/permissions/v2-service.d.ts +110 -5
  30. package/dist/permissions/v2-service.d.ts.map +1 -1
  31. package/dist/rpc/contract.d.ts +1 -1
  32. package/dist/rpc/contract.d.ts.map +1 -1
  33. package/dist/rpc/register.d.ts +3 -5
  34. package/dist/rpc/register.d.ts.map +1 -1
  35. package/dist/shared/ignored-message.d.ts.map +1 -1
  36. package/dist/shared/read-vision.d.ts.map +1 -1
  37. package/dist/shared/rpc-client.d.ts +8 -0
  38. package/dist/shared/rpc-client.d.ts.map +1 -1
  39. package/dist/shared/rpc-server.d.ts.map +1 -1
  40. package/dist/shared/session-directory.d.ts +9 -0
  41. package/dist/shared/session-directory.d.ts.map +1 -1
  42. package/dist/shared/status.d.ts +1 -0
  43. package/dist/shared/status.d.ts.map +1 -1
  44. package/dist/shared/subagent-detect.d.ts +11 -4
  45. package/dist/shared/subagent-detect.d.ts.map +1 -1
  46. package/dist/shared/v2-context.d.ts +3 -0
  47. package/dist/shared/v2-context.d.ts.map +1 -0
  48. package/dist/subc-tool-schemas.d.ts +23 -1
  49. package/dist/subc-tool-schemas.d.ts.map +1 -1
  50. package/dist/tool-registration.d.ts +11 -8
  51. package/dist/tool-registration.d.ts.map +1 -1
  52. package/dist/tools/_shared.d.ts +16 -15
  53. package/dist/tools/_shared.d.ts.map +1 -1
  54. package/dist/tools/bash.d.ts +41 -1
  55. package/dist/tools/bash.d.ts.map +1 -1
  56. package/dist/tools/bash_watch.d.ts +14 -4
  57. package/dist/tools/bash_watch.d.ts.map +1 -1
  58. package/dist/tools/bash_write.d.ts.map +1 -1
  59. package/dist/tools/definitions/v2.d.ts +4 -0
  60. package/dist/tools/definitions/v2.d.ts.map +1 -1
  61. package/dist/tools/hoisted/v2.d.ts +8 -1
  62. package/dist/tools/hoisted/v2.d.ts.map +1 -1
  63. package/dist/tools/hoisted.d.ts +27 -7
  64. package/dist/tools/hoisted.d.ts.map +1 -1
  65. package/dist/tools/inspect.d.ts +10 -1
  66. package/dist/tools/inspect.d.ts.map +1 -1
  67. package/dist/tools/permissions.d.ts +2 -1
  68. package/dist/tools/permissions.d.ts.map +1 -1
  69. package/dist/tools/reading.d.ts +0 -3
  70. package/dist/tools/reading.d.ts.map +1 -1
  71. package/dist/tools/search.d.ts.map +1 -1
  72. package/dist/tools/semantic.d.ts.map +1 -1
  73. package/dist/tui/aft-rpc.d.ts +14 -0
  74. package/dist/tui/aft-rpc.d.ts.map +1 -1
  75. package/dist/tui/v2-status.d.ts.map +1 -1
  76. package/dist/v2-host-tool-overlap.d.ts +66 -0
  77. package/dist/v2-host-tool-overlap.d.ts.map +1 -0
  78. package/dist/v2-prompt-detach.d.ts +70 -0
  79. package/dist/v2-prompt-detach.d.ts.map +1 -0
  80. package/dist/v2-tool-hooks.d.ts +6 -0
  81. package/dist/v2-tool-hooks.d.ts.map +1 -0
  82. package/dist/v2-workflow-hints.d.ts +4 -0
  83. package/dist/v2-workflow-hints.d.ts.map +1 -0
  84. package/dist/wakes/runtime-consumer.d.ts +2 -0
  85. package/dist/wakes/runtime-consumer.d.ts.map +1 -1
  86. package/dist/wakes/session-delivery.d.ts +9 -0
  87. package/dist/wakes/session-delivery.d.ts.map +1 -1
  88. package/dist/workflow-hints.d.ts +20 -7
  89. package/dist/workflow-hints.d.ts.map +1 -1
  90. package/package.json +9 -9
  91. package/src/entry/server-runtime.mjs +41 -5
  92. package/src/shared/ignored-message.ts +18 -0
  93. package/src/shared/read-vision.ts +14 -4
  94. package/src/shared/rpc-client.ts +46 -5
  95. package/src/shared/rpc-server.ts +10 -0
  96. package/src/shared/session-directory.ts +147 -7
  97. package/src/shared/status.ts +15 -5
  98. package/src/shared/subagent-detect.ts +89 -28
  99. package/src/shared/v2-context.ts +7 -0
  100. package/src/tui/aft-rpc.ts +11 -0
  101. package/src/tui/index.tsx +20 -16
  102. package/src/tui/sidebar-view.tsx +9 -1
  103. package/src/tui/v2-status.ts +7 -5
  104. package/src/tui/v2.tsx +47 -0
  105. package/src/tui-compiled/aft-rpc.ts +11 -0
  106. package/src/tui-compiled/index.tsx +27 -16
  107. package/src/tui-compiled/sidebar-view.tsx +11 -2
  108. package/src/tui-compiled/v2-status.ts +7 -5
  109. package/src/tui-compiled/v2.tsx +26 -0
@@ -46,11 +46,14 @@ export declare function openCodeHashlineDowngrade(config: AftConfig, registeredT
46
46
  /**
47
47
  * Build the exact OpenCode registration map without starting a bridge.
48
48
  *
49
- * A tool is registered exactly when its canonical name is absent from the
50
- * resolved `disabled_tools`. Index state, backends and runtime gates (bash,
51
- * backup, inspect) never remove a registration; those tools report their
52
- * runtime state when called. Production calls this after startup has prepared
53
- * the transport context, and the registration tests call the same function.
49
+ * A tool is registered when its canonical name is absent from the resolved
50
+ * `disabled_tools`, with one exception: the bash companions (`bash_status`,
51
+ * `bash_watch`, `bash_write`, `bash_kill`) also need `bash.background`, since
52
+ * they only act on background tasks. Index state, backends and the other
53
+ * runtime gates (`bash.enabled`, backup, inspect) never remove a registration;
54
+ * those tools report their runtime state when called. Production calls this
55
+ * after startup has prepared the transport context, and the registration tests
56
+ * call the same function.
54
57
  *
55
58
  * `onUnknownDisabled` receives, once per call, the sorted distinct disabled
56
59
  * names that are not in the canonical tool inventory.
@@ -62,9 +65,9 @@ export declare function buildOpenCodeToolMap(ctx: PluginContext, config: AftConf
62
65
  * Register the shared definition inventory on V2 as direct provider tools.
63
66
  *
64
67
  * The transform removes only the host tools AFT replaces, does not mutate the
65
- * shared V1 definitions, and never calls `update`. Provider and model data are
66
- * deliberately not inputs, so the same definitions produce the same registered
67
- * projection on every turn.
68
+ * shared V1 definitions, and never calls `update`. Projection runs when the
69
+ * host reads its tool transform, so the live runon gate is reflected without
70
+ * changing the registered inventory.
68
71
  */
69
72
  export declare function registerAftTools(context: V2ToolRegistrationContext, location: V2Location, definitions: Readonly<Record<string, ToolDefinition>>, consumers?: V2ToolConsumers): unknown;
70
73
  //# sourceMappingURL=tool-registration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-registration.d.ts","sourceRoot":"","sources":["../src/tool-registration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,EAAE,KAAK,SAAS,EAAyB,MAAM,aAAa,CAAC;AAIpE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,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AAM,EAAE,SAAS,GAAG,OAAO,CAMpE;AAED,kFAAkF;AAClF,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GACnC,OAAO,CAIT;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,wBAAwB,GAAG,wBAAwB,CAAC;IAC1D,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GACnC,wBAAwB,GAAG,IAAI,CAejC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,SAAS,EACjB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,GACrD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwBhC;AAkCD,uEAAuE;AACvE,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,SAAS,EACjB,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,GACrD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAEhC;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,yBAAyB,EAClC,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EACrD,SAAS,GAAE,eAAoB,GAC9B,OAAO,CAUT"}
@@ -56,6 +56,16 @@ export interface ToolRuntime {
56
56
  directory: string;
57
57
  /** Opaque OpenCode session identifier. Missing in CLI tests / some hosts. */
58
58
  sessionID?: string;
59
+ /**
60
+ * True when `directory` is the directory the host placed this session in, so
61
+ * it, not `worktree`, is the root to use while no session directory is
62
+ * cached. OpenCode 2 sets this: its `directory` is the session's Location
63
+ * directory, while its `worktree` is the project's main checkout, which is
64
+ * the wrong root for a session in a linked git worktree (issue #387).
65
+ * OpenCode 1 leaves it unset because its `directory` can be the launch cwd
66
+ * of a resumed session rather than the session's project.
67
+ */
68
+ directoryIsSessionRoot?: boolean;
59
69
  /** Effect-owned cancellation is explicit so V1 ToolContext signals remain unchanged. */
60
70
  effectAbort?: AbortSignal;
61
71
  }
@@ -73,6 +83,12 @@ export interface ToolRuntime {
73
83
  * stored directory wins. This is the workaround for OpenCode's bug where
74
84
  * `ctx.directory` is set to `process.cwd()` rather than the resumed
75
85
  * session's actual project directory.
86
+ *
87
+ * With no cached directory, an OpenCode 2 runtime (`directoryIsSessionRoot`)
88
+ * resolves to its `directory`, never to `worktree`: there `worktree` is the
89
+ * main checkout, which for a session in a linked git worktree is the one
90
+ * wrong answer (issue #387). `worktree` keeps that meaning for the permission
91
+ * checks that treat the main checkout as part of the project.
76
92
  */
77
93
  export declare function projectRootFor(runtime: ToolRuntime): string;
78
94
  /**
@@ -107,21 +123,6 @@ export declare function resolvePathArg(ctx: PluginContext, runtime: ToolRuntime,
107
123
  * subsequent calls in the same session.
108
124
  */
109
125
  export declare function bridgeFor(ctx: PluginContext, runtime: ToolRuntime): AftProjectTransport;
110
- /**
111
- * Send a single command to the Rust binary with `session_id` injected.
112
- *
113
- * This is the canonical way for a tool handler to call AFT: the helper picks
114
- * the right bridge (project-keyed), attaches the session namespace from
115
- * `context.sessionID`, and returns whatever the binary responds.
116
- *
117
- * Before routing, it ensures the session-directory cache is warm so the
118
- * very first tool call on a resumed-from-wrong-cwd session still reaches
119
- * the correct project bridge. Subsequent calls hit the cache synchronously.
120
- *
121
- * The Rust side falls back to a shared default namespace when `session_id`
122
- * is absent (see `RawRequest::session()`), so hosts that don't expose a
123
- * session identifier still work — they just share undo/checkpoint state.
124
- */
125
126
  export declare function callBridge(ctx: PluginContext, runtime: ToolRuntime, command: string, params?: Record<string, unknown>, options?: BridgeRequestOptions): Promise<Record<string, unknown>>;
126
127
  /**
127
128
  * Dispatch one hoisted agent tool through the server-side `tool_call` command.
@@ -1 +1 @@
1
- {"version":3,"file":"_shared.d.ts","sourceRoot":"","sources":["../../src/tools/_shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,uBAAuB,CAAC;AAY/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,GACR,CAAC;AAOhD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAIhD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,YAAY,EACZ,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAiBD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAW3D;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQjD;AAKD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEt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EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAEjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,mBAAmB,CAYvF;AA2BD,wBAAsB,UAAU,CAC9B,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA+ClC;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACrC,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,cAAc,CAAC,CAmCzB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,aAAa,EAClB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACpC,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAUlC"}
@@ -1,6 +1,46 @@
1
+ import { type WatchCallerRole } from "@cortexkit/aft-bridge";
1
2
  import type { ToolDefinition } from "@opencode-ai/plugin";
2
3
  import type { PluginContext } from "../types.js";
3
- export declare function bashToolDescription(aftSearchRegistered: boolean, compressionOn: boolean, backgroundOn: boolean, detachOnUserMessage?: boolean, zoomEnabled?: boolean, watchToolRegistered?: boolean): string;
4
+ /**
5
+ * Whether a bash companion tool (`bash_status`, `bash_watch`, `bash_write`,
6
+ * `bash_kill`) is registered for this configuration: it needs
7
+ * `bash.background` and must not be in `disabled_tools`. Descriptions use this
8
+ * to name a companion only when the model can call it.
9
+ */
10
+ export declare function bashCompanionRegistered(config: PluginContext["config"], companion: "bash_status" | "bash_watch" | "bash_write" | "bash_kill"): boolean;
11
+ /**
12
+ * Which neighbouring tools the bash description may name. Each defaults to
13
+ * registered; `watchToolRegistered`, `aftSearchRegistered` and `zoomEnabled`
14
+ * are separate positional arguments for historical reasons.
15
+ */
16
+ export interface BashDescriptionSurface {
17
+ outline?: boolean;
18
+ status?: boolean;
19
+ write?: boolean;
20
+ /**
21
+ * Whose surface this describes. Defaults to `primary`, the wording every
22
+ * plugin registration uses (it covers both roles). The subc module
23
+ * catalog's `worker` preset asks for `worker`, which never offers a
24
+ * completion reminder or ending the turn.
25
+ */
26
+ role?: WatchCallerRole;
27
+ /** Add remote-run guidance only where the tool also offers its parameter. */
28
+ remoteRuns?: boolean;
29
+ }
30
+ export declare function bashToolDescription(aftSearchRegistered: boolean, compressionOn: boolean, backgroundOn: boolean, detachOnUserMessage?: boolean, zoomEnabled?: boolean, watchToolRegistered?: boolean, surface?: BashDescriptionSurface): string;
31
+ /**
32
+ * Whether the native bash sandbox is on for this configuration. The `sandbox`
33
+ * argument only asks to leave that sandbox for one command, so it is offered
34
+ * only when there is a sandbox to leave.
35
+ */
36
+ export declare function nativeSandboxEnabled(config: PluginContext["config"]): boolean;
37
+ /**
38
+ * The `timeout` argument's description. The primary wording is what every
39
+ * plugin registration shows; the subc module catalog's `worker` preset uses
40
+ * the worker wording, because a worker's promoted command never sends it a
41
+ * completion reminder.
42
+ */
43
+ export declare function bashTimeoutDescription(backgroundOn: boolean, role?: WatchCallerRole): string;
4
44
  export declare function createBashTool(ctx: PluginContext, aftSearchRegisteredOverride?: boolean): ToolDefinition;
5
45
  export declare function createBashStatusTool(ctx: PluginContext): ToolDefinition;
6
46
  export declare function createBashKillTool(ctx: PluginContext): ToolDefinition;
@@ -1 +1 @@
1
- {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuKjD,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,mBAAmB,UAAO,EAC1B,WAAW,UAAO,EAClB,mBAAmB,UAAO,GACzB,MAAM,CAaR;AAwGD,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAyQhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2BvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
1
+ {"version":3,"file":"bash.d.ts","sourceRoot":"","sources":["../../src/tools/bash.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,eAAe,EAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoKjD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAC/B,SAAS,EAAE,aAAa,GAAG,YAAY,GAAG,YAAY,GAAG,WAAW,GACnE,OAAO,CAET;AAuCD;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,OAAO,EAC5B,aAAa,EAAE,OAAO,EACtB,YAAY,EAAE,OAAO,EACrB,mBAAmB,UAAO,EAC1B,WAAW,UAAO,EAClB,mBAAmB,UAAO,EAC1B,OAAO,GAAE,sBAA2B,GACnC,MAAM,CA8BR;AAoHD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,GAAG,OAAO,CAE7E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,OAAO,EACrB,IAAI,GAAE,eAA2B,GAChC,MAAM,CASR;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,aAAa,EAClB,2BAA2B,CAAC,EAAE,OAAO,GACpC,cAAc,CAqWhB;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAqCvE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAwBrE"}
@@ -1,3 +1,4 @@
1
+ import { type WatchCallerRole } from "@cortexkit/aft-bridge";
1
2
  import type { ToolContext, ToolDefinition } from "@opencode-ai/plugin";
2
3
  import type { PluginContext } from "../types.js";
3
4
  export type BashWaitPattern = {
@@ -8,11 +9,11 @@ export type BashWaitPattern = {
8
9
  source: string;
9
10
  };
10
11
  export type BashStatusWaited = {
11
- reason: "matched" | "exited" | "timeout" | "user_message" | "unavailable";
12
+ reason: "matched" | "exited" | "timeout" | "user_message" | "unavailable" | "aborted";
12
13
  /** Real time the watch held the call, measured on a monotonic clock. */
13
14
  elapsed_ms: number;
14
- /** Longest time this watch was allowed to hold the call. */
15
- limit_ms: number;
15
+ /** Longest time this watch was allowed to hold the call; absent when it had no deadline. */
16
+ limit_ms?: number;
16
17
  match?: string;
17
18
  match_offset?: number;
18
19
  match_stream?: "stdout" | "stderr";
@@ -20,8 +21,17 @@ export type BashStatusWaited = {
20
21
  type BashStatusWithWait = Record<string, unknown> & {
21
22
  waited?: BashStatusWaited;
22
23
  };
24
+ /**
25
+ * The bash_watch tool description. Every plugin registration uses the
26
+ * `primary` wording, which covers both roles. The subc module catalog's
27
+ * `worker` preset uses the `worker` wording: a delegated worker is never woken
28
+ * by a completion reminder or an async notification once its turn ends, so it
29
+ * is told only how to wait. The polling warning names bash_status only when
30
+ * the model can call it.
31
+ */
32
+ export declare function bashWatchDescription(role: WatchCallerRole, statusRegistered: boolean): string;
23
33
  export declare function createBashWatchTool(ctx: PluginContext): ToolDefinition;
24
- export declare function waitForBashStatus(ctx: PluginContext, runtime: ToolContext, taskId: string, outputMode: string | undefined, waitFor: BashWaitPattern | undefined, effectiveWaitMs: number): Promise<BashStatusWithWait>;
34
+ export declare function waitForBashStatus(ctx: PluginContext, runtime: ToolContext, taskId: string, outputMode: string | undefined, waitFor: BashWaitPattern | undefined, effectiveWaitMs: number | undefined, role: WatchCallerRole): Promise<BashStatusWithWait>;
25
35
  export declare function parseWaitPattern(value: unknown): BashWaitPattern | undefined;
26
36
  export declare function __trimWaitScanBufferForTests(text: string, baseOffset: number, pattern: BashWaitPattern): {
27
37
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"bash_watch.d.ts","sourceRoot":"","sources":["../../src/tools/bash_watch.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAavE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOjD,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,cAAc,GAAG,aAAa,CAAC;IAC1E,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,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAEtC"}
@@ -1 +1 @@
1
- {"version":3,"file":"bash_write.d.ts","sourceRoot":"","sources":["../../src/tools/bash_write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA6CtE"}
1
+ {"version":3,"file":"bash_write.d.ts","sourceRoot":"","sources":["../../src/tools/bash_write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAMjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CAiDtE"}
@@ -28,6 +28,8 @@ export interface V2PermissionRequest {
28
28
  }
29
29
  export interface V2DefinitionRuntime extends V2ExecutionContext {
30
30
  directory: string;
31
+ /** Always true here; see `ToolRuntime.directoryIsSessionRoot` in `tools/_shared.ts`. */
32
+ directoryIsSessionRoot: true;
31
33
  effectAbort: AbortSignal;
32
34
  worktree: string;
33
35
  abort: AbortSignal;
@@ -41,6 +43,8 @@ export interface V2BashExecution {
41
43
  definition: ToolDefinition;
42
44
  }
43
45
  export interface V2ToolConsumers {
46
+ /** A resumed session can discover pending wakes without starting another shell. */
47
+ registerSession?: (sessionID: string | undefined) => void;
44
48
  /** Maps legacy tool permission requests to the V2 session permission service. */
45
49
  requestPermission?: (request: V2PermissionRequest, context: V2ExecutionContext) => Promise<void>;
46
50
  /** Runs bash through the dedicated V2 executor while preserving the shared schema. */
@@ -1 +1 @@
1
- {"version":3,"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AAa,CAC3B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,UAAU,EACpB,SAAS,GAAE,eAAoB,GAC9B,cAAc,CAwChB;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,GAAG,MAAM,CAwBhG"}
@@ -1,5 +1,5 @@
1
1
  import { type V2PermissionHostContext } from "../../permissions/v2.js";
2
- import { type V2PromptChannel } from "../../permissions/v2-service.js";
2
+ import { type V2PromptChannel, type V2PromptServerSettings } from "../../permissions/v2-service.js";
3
3
  import type { V2ToolConsumers } from "../definitions/v2.js";
4
4
  export declare const V2_BUILTIN_REPLACEMENTS: readonly ["read", "edit", "write", "apply_patch"];
5
5
  export declare const V2_AFT_FILESYSTEM_TOOLS: readonly ["aft_delete", "aft_move"];
@@ -15,4 +15,11 @@ export declare const V2_PERMISSION_ASK_INVENTORY: readonly ["read", "edit", "wri
15
15
  * dropped with these consumers when the Location scope ends.
16
16
  */
17
17
  export declare function hoistedV2ToolConsumers(host: V2PermissionHostContext | object, prompt?: V2PromptChannel): V2ToolConsumers;
18
+ /**
19
+ * The prompt channel for a Location, honoring the user's `opencode` setting.
20
+ *
21
+ * The setting is the user-tier `opencode` block of the AFT config the Location
22
+ * booted with; a project config cannot supply it.
23
+ */
24
+ export declare function v2PromptChannelFor(settings: V2PromptServerSettings | undefined): V2PromptChannel;
18
25
  //# sourceMappingURL=v2.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/hoisted/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,eAAO,MAAM,uBAAuB,qCAAsC,CAAC;AAE3E,eAAO,MAAM,2BAA2B,8HAS9B,CAAC;AAQX;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EACtC,MAAM,GAAE,eAAyC,GAChD,eAAe,CAMjB"}
1
+ {"version":3,"file":"v2.d.ts","sourceRoot":"","sources":["../../../src/tools/hoisted/v2.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC1F,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,eAAO,MAAM,uBAAuB,qCAAsC,CAAC;AAE3E,eAAO,MAAM,2BAA2B,8HAS9B,CAAC;AAQX;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,uBAAuB,GAAG,MAAM,EACtC,MAAM,GAAE,eAAyC,GAChD,eAAe,CAMjB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,SAAS,GAAG,eAAe,CAEhG"}
@@ -14,20 +14,40 @@ import type { PluginContext } from "../types.js";
14
14
  export declare function whenGhReadEnabled(enabled: boolean, description: string): string;
15
15
  /** Test-only export. Production code uses buildUnifiedDiff directly. */
16
16
  export declare const _buildUnifiedDiffForTest: (fp: string, before: string, after: string) => string;
17
+ /** Test-only export of the line diff behind buildUnifiedDiff. */
18
+ export declare const _diffLinesForTest: (a: readonly string[], b: readonly string[]) => DiffOp[];
19
+ export declare const _diffTableCellsForTest: () => number;
20
+ type DiffOp = {
21
+ tag: "eq";
22
+ beforeIdx: number;
23
+ afterIdx: number;
24
+ line: string;
25
+ } | {
26
+ tag: "del";
27
+ beforeIdx: number;
28
+ line: string;
29
+ } | {
30
+ tag: "ins";
31
+ afterIdx: number;
32
+ line: string;
33
+ };
17
34
  /**
18
35
  * Creates the simple read tool. Registers as "read" when hoisted, "aft_read" when not.
19
36
  */
20
37
  export declare function createReadTool(ctx: PluginContext): ToolDefinition;
21
38
  /**
22
39
  * Returns AFT's host-slot tools keyed by the host's built-in names, plus the
23
- * move/delete tools and the bash companions.
40
+ * move/delete tools and, while `bash.background` is on, the bash companions.
24
41
  *
25
- * Every entry is always returned; `buildAftToolDefinitions` removes only the
26
- * names listed in the resolved `disabled_tools`. The bash companions
27
- * (`bash_status`, `bash_write`, `bash_watch`, `bash_kill`) are independent
28
- * registrations: disabling `bash` does not remove them, and when the bash
29
- * runtime gate (`bash.enabled`) is off every bash operation reports
30
- * `bash_disabled` instead of disappearing.
42
+ * `buildAftToolDefinitions` then removes the names listed in the resolved
43
+ * `disabled_tools`. The bash companions (`bash_status`, `bash_write`,
44
+ * `bash_watch`, `bash_kill`) are independent of `bash` itself: disabling
45
+ * `bash` does not remove them, and when the bash runtime gate (`bash.enabled`)
46
+ * is off every bash operation reports `bash_disabled` instead of disappearing.
47
+ * They exist only to inspect, wait on, feed and stop background tasks, so with
48
+ * `bash.background` off, when no background task can exist, they are not
49
+ * registered at all.
31
50
  */
32
51
  export declare function hoistedTools(ctx: PluginContext): Record<string, ToolDefinition>;
52
+ export {};
33
53
  //# sourceMappingURL=hoisted.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hoisted.d.ts","sourceRoot":"","sources":["../../src/tools/hoisted.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAMnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA4CjD,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,C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CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAuNnD;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,cAAc,CA2JjE;AAszBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAsB/E"}
@@ -1,6 +1,6 @@
1
1
  import type { ToolDefinition } from "@opencode-ai/plugin";
2
2
  import type { PluginContext } from "../types.js";
3
- export type InspectTerminalKind = "FRESH" | "INTERRUPTED" | "PHASE-FAILED";
3
+ export type InspectTerminalKind = "FRESH" | "PARTIAL" | "INTERRUPTED" | "PHASE-FAILED";
4
4
  /** A completed inspect phase, normalized once for every terminal outcome. */
5
5
  export interface InspectPhaseEntry {
6
6
  id: string;
@@ -12,6 +12,8 @@ export interface InspectTerminal {
12
12
  kind: InspectTerminalKind;
13
13
  phases: InspectPhaseEntry[];
14
14
  waitStampText?: string;
15
+ /** Set for PARTIAL: which diagnostics producers are unknown. */
16
+ partialReason?: string;
15
17
  failedPhase?: InspectPhaseEntry;
16
18
  failureReason?: string;
17
19
  failureDetail?: string;
@@ -26,6 +28,13 @@ export declare function parseInspectPhaseEntries(value: unknown): InspectPhaseEn
26
28
  * spellings keep older payload encodings compatible with the canonical shape.
27
29
  */
28
30
  export declare function parseInspectTerminal(payload: unknown): InspectTerminal | undefined;
31
+ /**
32
+ * One line per phase id, with a count and a per-producer (or per-category)
33
+ * breakdown, largest first: `lsp_start ×25 (typescript 12, bash 6)`. A project
34
+ * with two dozen language servers otherwise printed two dozen near-identical
35
+ * lines. Mirrors `collapse_phase_entries` in the Rust phase log.
36
+ */
37
+ export declare function collapseInspectPhases(phases: InspectPhaseEntry[]): string[];
29
38
  /** Render every terminal honestly without reducing failures to a generic error. */
30
39
  export declare function renderInspectTerminal(terminal: InspectTerminal, serverText?: string): string;
31
40
  export interface InspectToolConfig {
@@ -1 +1 @@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gC;0BAiB1D,MAAM,KAAG,IAAI;uBAZhB,MAAM,KAAG,IAAI;oBAOlB,IAAI;EAsB1B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAwD/E"}
@@ -34,7 +34,7 @@ export declare function workspacePattern(_context: ToolContext): string;
34
34
  export declare function askEditPermission(context: ToolContext, patterns: string[], metadata?: Record<string, unknown>): Promise<string | undefined>;
35
35
  /**
36
36
  * Check if `child` is inside `parent`. Mirrors `AppFileSystem.contains` in
37
- * opencode core (uses `path.relative` and ensures it doesn't start with `..`).
37
+ * opencode core (uses `path.relative` and rejects parent-directory segments).
38
38
  */
39
39
  declare function containsPath(parent: string, child: string): boolean;
40
40
  declare function isSystemTempPath(target: string): boolean;
@@ -55,6 +55,7 @@ declare function normalizePathPattern(p: string): string;
55
55
  export declare const _permissionsInternalsForTest: {
56
56
  classifyPermissionError: typeof classifyPermissionError;
57
57
  containsPath: typeof containsPath;
58
+ gitRootProbeCount: () => number;
58
59
  isSystemTempPath: typeof isSystemTempPath;
59
60
  normalizePathPattern: typeof normalizePathPattern;
60
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/tools/permissions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAYjD,MAAM,MAAM,wBAAwB,GAAG,aAAa,GAAG,eAAe,GAAG,UAAU,CAAC;AAEpF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA2BF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,eAAe,SAAuB,GACrC,oBAAoB,CA2BtB;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MA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,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7B;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/B,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgB7B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOhE"}
@@ -11,9 +11,6 @@ interface ZoomBatchResult {
11
11
  symbols: ZoomBatchSymbolResult[];
12
12
  text: string;
13
13
  }
14
- /**
15
- * Tool definitions for code reading commands: outline + zoom.
16
- */
17
14
  export declare function readingTools(ctx: PluginContext): Record<string, ToolDefinition>;
18
15
  /**
19
16
  * Format multi-symbol zoom results as plain text. Successful entries use
@@ -1 +1 @@
1
- {"version":3,"file":"reading.d.ts","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyCjD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA4S/E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACnC,eAAe,CAyBjB"}
1
+ {"version":3,"file":"reading.d.ts","sourceRoot":"","sources":["../../src/tools/reading.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAe,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAInF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA8CjD,UAAU,qBAAqB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAsBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CA2R/E;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GACnC,eAAe,CAyBjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyGjD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BrD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAuJ9E"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/tools/search.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAc,MAAM,qBAAqB,CAAC;AAEtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyGjD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA0BrD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAoL9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoGjD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAyIhF"}
1
+ {"version":3,"file":"semantic.d.ts","sourceRoot":"","sources":["../../src/tools/semantic.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAoGjD,wBAAgB,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAsKhF"}
@@ -10,8 +10,17 @@ export declare const IndexProgress: Schema.Struct<{
10
10
  readonly completed: Schema.optional<Schema.Number>;
11
11
  readonly total: Schema.optional<Schema.Number>;
12
12
  }>;
13
+ /**
14
+ * A one-off notice for the user, shown by the OpenCode 2 TUI as a toast. It
15
+ * travels over RPC rather than into the session because anything written into
16
+ * a session (a synthetic record included) is sent to the model on later turns.
17
+ */
18
+ export declare const HostToolOverlapNotice: Schema.Struct<{
19
+ readonly message: Schema.String;
20
+ }>;
13
21
  export type AftRpcSession = typeof RpcSession.Type;
14
22
  export type AftIndexProgress = typeof IndexProgress.Type;
23
+ export type AftHostToolOverlapNotice = typeof HostToolOverlapNotice.Type;
15
24
  export declare const AftRpc: {
16
25
  readonly id: "aft";
17
26
  readonly methods: {
@@ -43,6 +52,11 @@ export declare const AftRpc: {
43
52
  readonly total: Schema.optional<Schema.Number>;
44
53
  }>;
45
54
  };
55
+ readonly hostToolOverlap: {
56
+ readonly schema: Schema.Struct<{
57
+ readonly message: Schema.String;
58
+ }>;
59
+ };
46
60
  };
47
61
  };
48
62
  //# sourceMappingURL=aft-rpc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"aft-rpc.d.ts","sourceRoot":"","sources":["../../src/tui/aft-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAahC,eAAO,MAAM,UAAU;;EAErB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;EAOxB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEzD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAajB,CAAC"}
1
+ {"version":3,"file":"aft-rpc.d.ts","sourceRoot":"","sources":["../../src/tui/aft-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAahC,eAAO,MAAM,UAAU;;EAErB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;EAOxB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB;;EAEhC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,UAAU,CAAC,IAAI,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AACzD,MAAM,MAAM,wBAAwB,GAAG,OAAO,qBAAqB,CAAC,IAAI,CAAC;AAEzE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,kBAAkB,CAAC;AAsBhG;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAY/E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAWF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,iBAAiB,CAsBvF"}
1
+ {"version":3,"file":"v2-status.d.ts","sourceRoot":"","sources":["../../src/tui/v2-status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwC,MAAM,kBAAkB,CAAC;AAwBhG;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,MAAM,CAY/E;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAWF;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,GAAG,iBAAiB,CAsBvF"}
@@ -0,0 +1,66 @@
1
+ /**
2
+ * On OpenCode 2, AFT's `apply_patch` and `bash` sit beside the host's own
3
+ * `patch` and `shell` tools unless the user's opencode config turns the host
4
+ * plugins off (`-opencode.tool.patch` / `-opencode.tool.shell` under
5
+ * `plugins`, which `aft setup` and `aft doctor --fix` write). Someone who
6
+ * installed AFT without setup, or turned the host tools back on, gets two
7
+ * editing tools and two shells with nothing saying why. This module tells the
8
+ * user once per host process and points at `doctor --fix`.
9
+ *
10
+ * What counts is what the host actually registered: `context.tool.list()`
11
+ * returns the host's tools after every plugin's transform, keyed by the name
12
+ * the model sees. The check waits for the first user prompt rather than
13
+ * running at plugin start, because at start other plugins (the host's own
14
+ * patch and shell plugins included) may not have registered yet, and because
15
+ * the notice is an RPC event the host does not replay: a TUI that has not
16
+ * subscribed yet would miss it, while a prompt typed into the TUI proves its
17
+ * subscription is live. A host without `tool.list()`
18
+ * (OpenCode 2.0.3 has none) or a list call that fails gets no notice: the
19
+ * reason is logged once at debug level and nothing is guessed.
20
+ *
21
+ * The notice must reach the user and never the model. Nothing is written into
22
+ * the session: OpenCode 2 sends a synthetic session record to the model as a
23
+ * user message on every later turn, where a notice would read as an
24
+ * instruction. A server plugin has no toast or dialog of its own, so the
25
+ * notice goes out as an AFT RPC event and AFT's OpenCode 2 TUI plugin shows
26
+ * it as a toast. The desktop and web apps run no TUI plugin and show nothing;
27
+ * `aft doctor` reports the same problem there.
28
+ */
29
+ import { Effect } from "effect";
30
+ /** An AFT tool and the OpenCode 2 built-in that does the same job. */
31
+ export interface HostToolOverlap {
32
+ readonly aft: "apply_patch" | "bash";
33
+ readonly host: "patch" | "shell";
34
+ }
35
+ /**
36
+ * The pairs where AFT registered its tool (it is not in `disabled_tools`) and
37
+ * the host also has its built-in, in a fixed order. `hostToolNames` is the
38
+ * host's whole registry after every transform, AFT's own tools included, so a
39
+ * name AFT registered itself is never taken for the host's built-in.
40
+ */
41
+ export declare function findHostToolOverlaps(hostToolNames: ReadonlySet<string>, registeredAftTools: ReadonlySet<string>): HostToolOverlap[];
42
+ /** One notice for every overlapping pair, or null when there is none. */
43
+ export declare function hostToolOverlapNotice(overlaps: readonly HostToolOverlap[]): string | null;
44
+ /** Reset the once-per-process state. Tests only. */
45
+ export declare function __resetHostToolOverlapNoticeForTests(): void;
46
+ interface PromptEvent {
47
+ readonly sessionID: string;
48
+ readonly metadata?: Record<string, unknown>;
49
+ }
50
+ /** Hands the notice text to the user-only channel (the TUI toast event). */
51
+ export type HostToolOverlapDelivery = (message: string) => Promise<void>;
52
+ /**
53
+ * The session `prompt` hook for one Location. It never fails and never waits:
54
+ * the host holds the prompt until the hook returns, so the check runs in the
55
+ * background after it.
56
+ */
57
+ export declare function createHostToolOverlapPromptHook(context: unknown, registeredAftTools: ReadonlySet<string>, deliver: HostToolOverlapDelivery, onChecked?: (done: Promise<void>) => void): (event: PromptEvent) => Effect.Effect<void>;
58
+ /**
59
+ * Register the overlap check on an OpenCode 2 host's session `prompt` hook.
60
+ * `registeredAftTools` is AFT's final tool surface, so a tool listed in
61
+ * `disabled_tools` never counts as an overlap. `deliver` must reach the user
62
+ * only, never the session.
63
+ */
64
+ export declare function registerV2HostToolOverlapNotice(context: unknown, registeredAftTools: ReadonlySet<string>, deliver: HostToolOverlapDelivery, onChecked?: (done: Promise<void>) => void): Effect.Effect<boolean, never, unknown>;
65
+ export {};
66
+ //# sourceMappingURL=v2-host-tool-overlap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v2-host-tool-overlap.d.ts","sourceRoot":"","sources":["../src/v2-host-tool-overlap.ts"],"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