@cortexkit/aft-opencode 0.57.2 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bash-wait-detach.d.ts +14 -5
- package/dist/bash-wait-detach.d.ts.map +1 -1
- package/dist/bridge-bootstrap.d.ts +191 -0
- package/dist/bridge-bootstrap.d.ts.map +1 -0
- package/dist/config-error-surface.d.ts +23 -0
- package/dist/config-error-surface.d.ts.map +1 -0
- package/dist/config.d.ts +66 -54
- package/dist/config.d.ts.map +1 -1
- package/dist/entry/server.js +9729 -7942
- package/dist/hooks/auto-update-checker/index.d.ts +6 -0
- package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9515 -7793
- package/dist/logger.d.ts.map +1 -1
- package/dist/lsp-auto-install.d.ts.map +1 -1
- package/dist/rpc/register.d.ts +7 -1
- package/dist/rpc/register.d.ts.map +1 -1
- package/dist/shared/status.d.ts +45 -0
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/shared/subagent-detect.d.ts.map +1 -1
- package/dist/shutdown-hooks.d.ts +3 -9
- package/dist/shutdown-hooks.d.ts.map +1 -1
- package/dist/subc-tool-schemas.d.ts +9 -1
- package/dist/subc-tool-schemas.d.ts.map +1 -1
- package/dist/tool-registration.d.ts +19 -12
- package/dist/tool-registration.d.ts.map +1 -1
- package/dist/tools/ast.d.ts.map +1 -1
- package/dist/tools/bash.d.ts +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash_watch.d.ts.map +1 -1
- package/dist/tools/definitions/v2.d.ts.map +1 -1
- package/dist/tools/hoisted.d.ts +9 -12
- package/dist/tools/hoisted.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts +5 -7
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/tools/reading.d.ts.map +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tui/v2-status.d.ts +1 -1
- package/dist/tui/v2-status.d.ts.map +1 -1
- package/dist/workflow-hints.d.ts +1 -7
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/entry/server-runtime.mjs +117 -33
- package/src/logger.ts +5 -6
- package/src/shared/status.ts +83 -4
- package/src/shared/subagent-detect.ts +56 -1
- package/src/tui/index.tsx +4 -10
- package/src/tui/sidebar-view.tsx +36 -15
- package/src/tui/v2-status.ts +25 -4
- package/src/tui-compiled/index.tsx +3 -3
- package/src/tui-compiled/sidebar-view.tsx +168 -126
- package/src/tui-compiled/v2-status.ts +25 -4
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AftTransportPool } from "@cortexkit/aft-bridge";
|
|
2
2
|
import type { AftConfig } from "./config.js";
|
|
3
3
|
type ActiveBridgePool = Pick<AftTransportPool, "getActiveBridgeForRoot" | "activeBridges">;
|
|
4
|
-
export
|
|
4
|
+
export { BASH_WAIT_DETACH_MAGIC_KEYWORD } from "@cortexkit/aft-bridge";
|
|
5
5
|
/** Return the user-entered text parts from OpenCode's chat.message output. */
|
|
6
6
|
export declare function extractUserMessageText(output: unknown): string;
|
|
7
7
|
/** Strip control tokens from mutable OpenCode text parts before model delivery. */
|
|
8
8
|
export declare function stripUserMessageDetachKeyword(output: unknown): string;
|
|
9
9
|
/**
|
|
10
|
-
* Decide whether a
|
|
11
|
-
*
|
|
10
|
+
* Decide whether a message should detach an active wait:true bash call and
|
|
11
|
+
* abort a sync bash_watch. `messageText` is the operator-typed text from
|
|
12
|
+
* `extractUserMessageText`, read before the keyword is stripped from it.
|
|
12
13
|
*/
|
|
13
14
|
export declare function shouldDetachBashWaitOnUserMessage(config: AftConfig, messageText: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Handle OpenCode's chat.message output for the session's blocking waits:
|
|
17
|
+
* decide, strip the `&detach` token from the mutable text parts, then (only
|
|
18
|
+
* when the decision says so) abort any sync bash_watch and detach any
|
|
19
|
+
* wait:true bash. Both waits follow the same decision, so
|
|
20
|
+
* `bash.detach_on_user_message: false` protects a sync bash_watch as well.
|
|
21
|
+
* Returns whether the waits were interrupted.
|
|
22
|
+
*/
|
|
23
|
+
export declare function interruptBashWaitsForChatMessage(pool: ActiveBridgePool, config: AftConfig, projectRoot: string, sessionID: string | undefined, output: unknown): boolean;
|
|
14
24
|
export declare function signalBashWaitDetachForProject(pool: ActiveBridgePool, projectRoot: string, sessionID: string | undefined): Promise<void>;
|
|
15
|
-
export {};
|
|
16
25
|
//# sourceMappingURL=bash-wait-detach.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-wait-detach.d.ts","sourceRoot":"","sources":["../src/bash-wait-detach.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bash-wait-detach.d.ts","sourceRoot":"","sources":["../src/bash-wait-detach.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,gBAAgB,EAItB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAM7C,KAAK,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,EAAE,wBAAwB,GAAG,eAAe,CAAC,CAAC;AAE3F,OAAO,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAsBvE,8EAA8E;AAC9E,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAI9D;AAED,mFAAmF;AACnF,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAkBrE;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAKjG;AAED;;;;;;;GAOG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,SAAS,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,MAAM,EAAE,OAAO,GACd,OAAO,CAST;AAoBD,wBAAsB,8BAA8B,CAClD,IAAI,EAAE,gBAAgB,EACtB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The per-plugin environment work that feeds every AFT bridge, shared by the
|
|
3
|
+
* OpenCode 1 plugin entry (`index.ts`) and the OpenCode 2 runtime entry
|
|
4
|
+
* (`entry/server-runtime.mjs`).
|
|
5
|
+
*
|
|
6
|
+
* Both entries used to assemble this state separately, and the OpenCode 2
|
|
7
|
+
* entry silently skipped most of it: it never resolved ONNX Runtime, so every
|
|
8
|
+
* bridge it spawned fell back to a bare `dlopen("libonnxruntime.dylib")` and
|
|
9
|
+
* semantic search failed on any host without `ORT_DYLIB_PATH` exported. Keeping
|
|
10
|
+
* the whole sequence in this module means an entry can only differ in the
|
|
11
|
+
* host-specific parts (how warnings reach the user, which directory it boots
|
|
12
|
+
* for), not in what the bridge is configured with.
|
|
13
|
+
*
|
|
14
|
+
* What lives here:
|
|
15
|
+
* - loading the AFT config after migrating legacy config file locations,
|
|
16
|
+
* putting an unusable configuration into the config error state and
|
|
17
|
+
* delivering migration notices;
|
|
18
|
+
* - resolving the `aft` binary (with a background download when uncached);
|
|
19
|
+
* - the one-time storage migration into the shared CortexKit root;
|
|
20
|
+
* - the flat configure overrides: config tiers, `storage_dir`,
|
|
21
|
+
* `bash_permissions`, `harness`, and the LSP install cache
|
|
22
|
+
* (`lsp_auto_install_binaries`, `lsp_paths_extra`, `lsp_inflight_installs`);
|
|
23
|
+
* - ONNX Runtime resolution, patched in as `_ort_dylib_dir` once it settles;
|
|
24
|
+
* - the version-mismatch upgrade handler and per-project config loader the
|
|
25
|
+
* transport pool is built with;
|
|
26
|
+
* - the registration-dependent overrides `edit_slot_survives` and
|
|
27
|
+
* `aft_search_registered`, applied once the final tool map is known;
|
|
28
|
+
* - the registration warnings every entry reports the same way: one
|
|
29
|
+
* aggregated unknown-name warning per load and the hashline downgrade.
|
|
30
|
+
*/
|
|
31
|
+
import { type AftTransportPool, type PoolOptions } from "@cortexkit/aft-bridge";
|
|
32
|
+
import { type AftConfig, type ConfigLoadError } from "./config.js";
|
|
33
|
+
import { openCodeHashlineDowngrade } from "./tool-registration.js";
|
|
34
|
+
/** Delivers a user-visible warning through whatever channel the host entry has. */
|
|
35
|
+
export type BootstrapNotify = (message: string) => void;
|
|
36
|
+
/**
|
|
37
|
+
* Replaceable side effects. Production uses {@link defaultBridgeBootstrapDependencies};
|
|
38
|
+
* tests substitute fakes so a boot never downloads, spawns, or touches the
|
|
39
|
+
* user's real config and storage.
|
|
40
|
+
*/
|
|
41
|
+
export interface BridgeBootstrapDependencies {
|
|
42
|
+
loadConfig(directory: string): AftConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Deliver the migration notices recorded by the most recent `loadConfig`
|
|
45
|
+
* call, once per notice identity. Optional so a substituted `loadConfig`
|
|
46
|
+
* does not deliver notices left over from a real load.
|
|
47
|
+
*/
|
|
48
|
+
deliverLoadNotices?(notify: BootstrapNotify): void;
|
|
49
|
+
/**
|
|
50
|
+
* Parse failures recorded by the most recent `loadConfig` call. Optional for
|
|
51
|
+
* the same reason as `deliverLoadNotices`: a substituted `loadConfig` must
|
|
52
|
+
* not see failures left over from a real load.
|
|
53
|
+
*/
|
|
54
|
+
configLoadErrors?(): readonly ConfigLoadError[];
|
|
55
|
+
/** Error for a configured subc connection file that does not exist, or null. */
|
|
56
|
+
subcConnectionFileError?(subcConnectionFile: string | undefined): Promise<string | null>;
|
|
57
|
+
/** Moves legacy config files into the CortexKit layout; returns user-facing warnings. */
|
|
58
|
+
migrateConfigLocations(directory: string): string[];
|
|
59
|
+
resolveBinary(version: string): Promise<string>;
|
|
60
|
+
/** `binaryPath` is null when the subc daemon owns the binary; migration then resolves one only if it has work. */
|
|
61
|
+
ensureStorageMigrated(binaryPath: string | null): Promise<void>;
|
|
62
|
+
resolveStorageRoot(): string;
|
|
63
|
+
buildConfigureParams(directory: string, processState: Record<string, unknown>): Record<string, unknown>;
|
|
64
|
+
/** Returns the directory holding the ONNX Runtime library, or null. */
|
|
65
|
+
ensureOnnxRuntime(storageDir: string): Promise<string | null>;
|
|
66
|
+
/**
|
|
67
|
+
* Seeds the LSP entries of `configOverrides` and starts background installs.
|
|
68
|
+
* Resolves to the refreshed cache directories when installs ran, else null.
|
|
69
|
+
*/
|
|
70
|
+
startLspAutoInstall(directory: string, config: AftConfig, configOverrides: Record<string, unknown>, notify: BootstrapNotify): Promise<string[] | null> | null;
|
|
71
|
+
pushLspPaths(pool: Pick<AftTransportPool, "setConfigureOverride" | "reconfigure">, directory: string, paths: readonly string[]): Promise<void>;
|
|
72
|
+
isOrtAutoDownloadSupported(): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Why the last managed ONNX Runtime install in this process failed, or
|
|
75
|
+
* null. Read only after `ensureOnnxRuntime` resolved null on a platform that
|
|
76
|
+
* supports auto-download, to tell the user why semantic search is off.
|
|
77
|
+
*/
|
|
78
|
+
onnxInstallFailure?(): string | null;
|
|
79
|
+
}
|
|
80
|
+
/** The user-facing notice for a failed managed ONNX Runtime install. */
|
|
81
|
+
export declare function onnxInstallFailureMessage(reason: string): string;
|
|
82
|
+
export declare const defaultBridgeBootstrapDependencies: BridgeBootstrapDependencies;
|
|
83
|
+
/**
|
|
84
|
+
* Result of loading the configuration an entry boots with. A configuration
|
|
85
|
+
* that cannot be used does not stop the plugin from loading: it yields the
|
|
86
|
+
* config error state, in which the entry registers the tool surface of
|
|
87
|
+
* `config` but every tool call fails with `message` (see
|
|
88
|
+
* {@link buildConfigErrorToolMap}).
|
|
89
|
+
*/
|
|
90
|
+
export type BootstrapConfig = {
|
|
91
|
+
ok: true;
|
|
92
|
+
config: AftConfig;
|
|
93
|
+
} | {
|
|
94
|
+
ok: false;
|
|
95
|
+
/** The error, its fix, and the note that a restart is needed. */
|
|
96
|
+
message: string;
|
|
97
|
+
/** Config whose tool surface is registered: the loaded one when usable, else the default. */
|
|
98
|
+
config: AftConfig;
|
|
99
|
+
};
|
|
100
|
+
/** The surface registered when the configuration is too broken to compute its own. */
|
|
101
|
+
export declare function defaultSurfaceConfig(): AftConfig;
|
|
102
|
+
/**
|
|
103
|
+
* Load the config for `directory`, migrating legacy config file locations
|
|
104
|
+
* first. Migration notices for retired keys that are still translated are
|
|
105
|
+
* delivered through `notify`, once per notice identity.
|
|
106
|
+
*
|
|
107
|
+
* A configuration that is rejected (a retired key after its migration window,
|
|
108
|
+
* an already retired GitHub alias), that does not parse, or whose load throws
|
|
109
|
+
* for any other reason yields the config error state with the default tool
|
|
110
|
+
* surface; migration is skipped then. Nothing falls back to defaults.
|
|
111
|
+
*/
|
|
112
|
+
export declare function loadBootstrapConfig(directory: string, notify: BootstrapNotify, dependencies?: BridgeBootstrapDependencies): BootstrapConfig;
|
|
113
|
+
/**
|
|
114
|
+
* {@link loadBootstrapConfig} plus the checks that need the loaded config: a
|
|
115
|
+
* configured `subc.connection_file` that does not exist also yields the config
|
|
116
|
+
* error state, keeping the loaded config's tool surface. The check runs before
|
|
117
|
+
* any binary, storage or transport work so the error state starts none of it.
|
|
118
|
+
*/
|
|
119
|
+
export declare function resolveBootstrapConfig(directory: string, notify: BootstrapNotify, dependencies?: BridgeBootstrapDependencies): Promise<BootstrapConfig>;
|
|
120
|
+
/**
|
|
121
|
+
* Answer "may AFT work in this project?" for projects other than the one an
|
|
122
|
+
* entry booted for. There is no config switch that turns AFT off; only a
|
|
123
|
+
* rejected configuration does, until it is fixed. Answers are cached per
|
|
124
|
+
* project and a rejection is logged once.
|
|
125
|
+
*/
|
|
126
|
+
export declare function createProjectAcceptance(bootRoot: string, dependencies?: Pick<BridgeBootstrapDependencies, "loadConfig">): (projectRoot: string) => boolean;
|
|
127
|
+
export interface BridgeEnvironmentOptions {
|
|
128
|
+
/** Project whose config tiers seed the flat configure payload. */
|
|
129
|
+
configRoot: string;
|
|
130
|
+
/** Directory scanned to decide which LSP servers are relevant. */
|
|
131
|
+
lspDirectory: string;
|
|
132
|
+
config: AftConfig;
|
|
133
|
+
pluginVersion: string;
|
|
134
|
+
notify: BootstrapNotify;
|
|
135
|
+
}
|
|
136
|
+
export interface BridgeEnvironment {
|
|
137
|
+
storageDir: string;
|
|
138
|
+
/**
|
|
139
|
+
* Resolved `aft` binary for the standalone bridge, or null when the config
|
|
140
|
+
* selects the subc daemon (which runs its own binary).
|
|
141
|
+
*/
|
|
142
|
+
binaryPath: string | null;
|
|
143
|
+
/** Flat configure overrides to construct the transport pool with. */
|
|
144
|
+
configOverrides: Record<string, unknown>;
|
|
145
|
+
/** Pending ONNX Runtime directory, or null when semantic search does not need it. */
|
|
146
|
+
onnxRuntime: Promise<string | null> | null;
|
|
147
|
+
/**
|
|
148
|
+
* Wire the asynchronous results into the pool once it exists: the ONNX
|
|
149
|
+
* Runtime directory as `_ort_dylib_dir`, and LSP directories that finished
|
|
150
|
+
* installing during startup.
|
|
151
|
+
*/
|
|
152
|
+
attach(pool: Pick<AftTransportPool, "setConfigureOverride" | "reconfigure">): void;
|
|
153
|
+
}
|
|
154
|
+
export declare function prepareBridgeEnvironment(options: BridgeEnvironmentOptions, dependencies?: BridgeBootstrapDependencies): Promise<BridgeEnvironment>;
|
|
155
|
+
/**
|
|
156
|
+
* Pool options both entries share: the error prefix, the minimum binary
|
|
157
|
+
* version, the coordinated upgrade when a bridge reports an older binary, and
|
|
158
|
+
* the per-project config tiers loaded at each bridge spawn.
|
|
159
|
+
*/
|
|
160
|
+
export declare function createSharedPoolOptions(options: {
|
|
161
|
+
pluginVersion: string;
|
|
162
|
+
getPool(): Pick<AftTransportPool, "replaceBinary">;
|
|
163
|
+
isProjectEnabled(projectRoot: string): boolean;
|
|
164
|
+
notifyForRoot(projectRoot: string, message: string): void;
|
|
165
|
+
dependencies?: BridgeBootstrapDependencies;
|
|
166
|
+
}): Pick<PoolOptions, "errorPrefix" | "minVersion" | "onVersionMismatch" | "projectConfigLoader">;
|
|
167
|
+
/**
|
|
168
|
+
* Apply the overrides that depend on the final registered tool surface.
|
|
169
|
+
*
|
|
170
|
+
* `edit_slot_survives` tells Rust whether the hashline edit arm is registered;
|
|
171
|
+
* `aft_search_registered` lets the grep-rewrite footer point at `aft_search`
|
|
172
|
+
* instead of the grep tool. Both reach lazily spawned bridges through the
|
|
173
|
+
* pool's runtime overrides.
|
|
174
|
+
*/
|
|
175
|
+
export declare function applyToolSurfaceOverrides(pool: Pick<AftTransportPool, "setConfigureOverride">, config: AftConfig, registeredTools: ReadonlySet<string>): {
|
|
176
|
+
hashlineEditRegistered: boolean;
|
|
177
|
+
aftSearchRegistered: boolean;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* The callback `buildAftToolDefinitions` reports unknown `disabled_tools`
|
|
181
|
+
* names through: one aggregated warning per load. Unknown names stay inert
|
|
182
|
+
* and are kept in the list.
|
|
183
|
+
*/
|
|
184
|
+
export declare function unknownDisabledToolsReporter(notify: BootstrapNotify): (unknown: readonly string[]) => void;
|
|
185
|
+
/**
|
|
186
|
+
* Report a requested hashline surface that the registered tools cannot serve
|
|
187
|
+
* (the tagged read or the edit slot is disabled). One warning per load; the
|
|
188
|
+
* surviving slots keep their ordinary behavior. Returns the downgrade, if any.
|
|
189
|
+
*/
|
|
190
|
+
export declare function reportHashlineDowngrade(config: AftConfig, registeredTools: ReadonlySet<string>, notify: BootstrapNotify): ReturnType<typeof openCodeHashlineDowngrade>;
|
|
191
|
+
//# sourceMappingURL=bridge-bootstrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge-bootstrap.d.ts","sourceRoot":"","sources":["../src/bridge-bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EACL,KAAK,gBAAgB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G;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,CAAC,EACpD,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,GACnC;IAAE,sBAAsB,EAAE,OAAO,CAAC;IAAC,mBAAmB,EAAE,OAAO,CAAA;CAAE,CAenE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,eAAe,GACtB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAMtC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,eAAe,GACtB,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAO9C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The OpenCode side of the config error state (see `config-error.ts` in
|
|
3
|
+
* `@cortexkit/aft-bridge`): AFT's normal tool surface, with every tool call
|
|
4
|
+
* failing with the configuration error instead of reaching a bridge.
|
|
5
|
+
*/
|
|
6
|
+
import type { ToolDefinition } from "@opencode-ai/plugin";
|
|
7
|
+
import type { AftConfig } from "./config.js";
|
|
8
|
+
import type { PluginContext } from "./types.js";
|
|
9
|
+
type ToolMapBuilder = (ctx: PluginContext, config: AftConfig) => Record<string, ToolDefinition>;
|
|
10
|
+
/**
|
|
11
|
+
* Replace every tool's `execute` with one that throws `message`. A thrown
|
|
12
|
+
* error is how both OpenCode generations mark a tool call as failed, so the
|
|
13
|
+
* call shows as an error rather than a successful result carrying the text.
|
|
14
|
+
*/
|
|
15
|
+
export declare function failEveryToolCall(tools: Readonly<Record<string, ToolDefinition>>, message: string): Record<string, ToolDefinition>;
|
|
16
|
+
/**
|
|
17
|
+
* Build the tool surface `config` selects, with every call failing with
|
|
18
|
+
* `message`. The tool factories receive a transport pool that never starts a
|
|
19
|
+
* bridge, so building the surface cannot spawn anything either.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildConfigErrorToolMap(config: AftConfig, message: string, client: unknown, buildToolMap?: ToolMapBuilder): Record<string, ToolDefinition>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=config-error-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-error-surface.d.ts","sourceRoot":"","sources":["../src/config-error-surface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,KAAK,cAAc,GAAG,CAAC,GAAG,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,KAAK,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEhG;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAC/C,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAWhC;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,YAAY,GAAE,cAAwC,GACrD,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAUhC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type AftConfigFileMigrationResult, type ConfigTier } from "@cortexkit/aft-bridge";
|
|
1
|
+
import { type AftConfigFileMigrationResult, type ConfigTier, type ResolvedIndexesConfig } from "@cortexkit/aft-bridge";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
export { ConfigRejectedError } from "@cortexkit/aft-bridge";
|
|
3
4
|
/** How configure-time missing-tool warnings reach the user. Default: toast (no chat transcript). */
|
|
4
5
|
export declare const ConfigureWarningsDeliveryEnum: z.ZodEnum<{
|
|
5
6
|
toast: "toast";
|
|
@@ -8,7 +9,6 @@ export declare const ConfigureWarningsDeliveryEnum: z.ZodEnum<{
|
|
|
8
9
|
}>;
|
|
9
10
|
export type ConfigureWarningsDelivery = z.infer<typeof ConfigureWarningsDeliveryEnum>;
|
|
10
11
|
declare const GithubConfigSchema: z.ZodObject<{
|
|
11
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
12
12
|
shim: z.ZodOptional<z.ZodBoolean>;
|
|
13
13
|
read: z.ZodOptional<z.ZodBoolean>;
|
|
14
14
|
write: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -30,7 +30,6 @@ export declare const PiConfigSchema: z.ZodObject<{
|
|
|
30
30
|
export type PiConfig = z.infer<typeof PiConfigSchema>;
|
|
31
31
|
export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
32
32
|
$schema: z.ZodOptional<z.ZodString>;
|
|
33
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
34
33
|
edit_mode: z.ZodOptional<z.ZodEnum<{
|
|
35
34
|
default: "default";
|
|
36
35
|
hashline: "hashline";
|
|
@@ -69,15 +68,13 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
69
68
|
log: "log";
|
|
70
69
|
chat: "chat";
|
|
71
70
|
}>>;
|
|
72
|
-
hoist_builtin_tools: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
-
tool_surface: z.ZodOptional<z.ZodEnum<{
|
|
74
|
-
minimal: "minimal";
|
|
75
|
-
recommended: "recommended";
|
|
76
|
-
all: "all";
|
|
77
|
-
}>>;
|
|
78
71
|
disabled_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
79
72
|
restrict_to_project_root: z.ZodOptional<z.ZodBoolean>;
|
|
80
|
-
|
|
73
|
+
indexes: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
trigram: z.ZodOptional<z.ZodBoolean>;
|
|
75
|
+
semantic: z.ZodOptional<z.ZodBoolean>;
|
|
76
|
+
callgraph: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
81
78
|
index: z.ZodOptional<z.ZodObject<{
|
|
82
79
|
roots: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
83
80
|
path: z.ZodString;
|
|
@@ -94,11 +91,9 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
94
91
|
indexes: ("search" | "semantic" | "callgraph")[];
|
|
95
92
|
}>>>>;
|
|
96
93
|
}, z.core.$strip>>;
|
|
97
|
-
semantic_search: z.ZodOptional<z.ZodBoolean>;
|
|
98
94
|
views: z.ZodOptional<z.ZodObject<{
|
|
99
95
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
100
96
|
}, z.core.$strip>>;
|
|
101
|
-
callgraph_store: z.ZodOptional<z.ZodBoolean>;
|
|
102
97
|
callgraph_chunk_size: z.ZodOptional<z.ZodNumber>;
|
|
103
98
|
inspect: z.ZodOptional<z.ZodObject<{
|
|
104
99
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -130,6 +125,7 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
130
125
|
read_deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
131
126
|
}, z.core.$strip>>;
|
|
132
127
|
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
128
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
133
129
|
rewrite: z.ZodOptional<z.ZodBoolean>;
|
|
134
130
|
compress: z.ZodOptional<z.ZodBoolean>;
|
|
135
131
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -202,18 +198,13 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
202
198
|
client_reaper: z.ZodOptional<z.ZodBoolean>;
|
|
203
199
|
}, z.core.$strip>>;
|
|
204
200
|
github: z.ZodOptional<z.ZodObject<{
|
|
205
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
206
201
|
shim: z.ZodOptional<z.ZodBoolean>;
|
|
207
202
|
read: z.ZodOptional<z.ZodBoolean>;
|
|
208
203
|
write: z.ZodOptional<z.ZodBoolean>;
|
|
209
204
|
}, z.core.$strip>>;
|
|
210
205
|
gh_shim: z.ZodOptional<z.ZodObject<{
|
|
211
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
212
206
|
binary_path: z.ZodOptional<z.ZodString>;
|
|
213
207
|
}, z.core.$strip>>;
|
|
214
|
-
gh_read: z.ZodOptional<z.ZodObject<{
|
|
215
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
-
}, z.core.$strip>>;
|
|
217
208
|
git: z.ZodOptional<z.ZodObject<{
|
|
218
209
|
co_author: z.ZodOptional<z.ZodString>;
|
|
219
210
|
}, z.core.$strip>>;
|
|
@@ -225,7 +216,6 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
225
216
|
}, z.core.$strip>>;
|
|
226
217
|
harnesses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodPreprocess<z.ZodObject<{
|
|
227
218
|
$schema: z.ZodOptional<z.ZodString>;
|
|
228
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
229
219
|
edit_mode: z.ZodOptional<z.ZodEnum<{
|
|
230
220
|
default: "default";
|
|
231
221
|
hashline: "hashline";
|
|
@@ -264,15 +254,13 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
264
254
|
log: "log";
|
|
265
255
|
chat: "chat";
|
|
266
256
|
}>>;
|
|
267
|
-
hoist_builtin_tools: z.ZodOptional<z.ZodBoolean>;
|
|
268
|
-
tool_surface: z.ZodOptional<z.ZodEnum<{
|
|
269
|
-
minimal: "minimal";
|
|
270
|
-
recommended: "recommended";
|
|
271
|
-
all: "all";
|
|
272
|
-
}>>;
|
|
273
257
|
disabled_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
274
258
|
restrict_to_project_root: z.ZodOptional<z.ZodBoolean>;
|
|
275
|
-
|
|
259
|
+
indexes: z.ZodOptional<z.ZodObject<{
|
|
260
|
+
trigram: z.ZodOptional<z.ZodBoolean>;
|
|
261
|
+
semantic: z.ZodOptional<z.ZodBoolean>;
|
|
262
|
+
callgraph: z.ZodOptional<z.ZodBoolean>;
|
|
263
|
+
}, z.core.$strip>>;
|
|
276
264
|
index: z.ZodOptional<z.ZodObject<{
|
|
277
265
|
roots: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
278
266
|
path: z.ZodString;
|
|
@@ -289,11 +277,9 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
289
277
|
indexes: ("search" | "semantic" | "callgraph")[];
|
|
290
278
|
}>>>>;
|
|
291
279
|
}, z.core.$strip>>;
|
|
292
|
-
semantic_search: z.ZodOptional<z.ZodBoolean>;
|
|
293
280
|
views: z.ZodOptional<z.ZodObject<{
|
|
294
281
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
295
282
|
}, z.core.$strip>>;
|
|
296
|
-
callgraph_store: z.ZodOptional<z.ZodBoolean>;
|
|
297
283
|
callgraph_chunk_size: z.ZodOptional<z.ZodNumber>;
|
|
298
284
|
inspect: z.ZodOptional<z.ZodObject<{
|
|
299
285
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -325,6 +311,7 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
325
311
|
read_deny: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
326
312
|
}, z.core.$strip>>;
|
|
327
313
|
bash: z.ZodOptional<z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
|
|
314
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
328
315
|
rewrite: z.ZodOptional<z.ZodBoolean>;
|
|
329
316
|
compress: z.ZodOptional<z.ZodBoolean>;
|
|
330
317
|
background: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -397,18 +384,13 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
397
384
|
client_reaper: z.ZodOptional<z.ZodBoolean>;
|
|
398
385
|
}, z.core.$strip>>;
|
|
399
386
|
github: z.ZodOptional<z.ZodObject<{
|
|
400
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
401
387
|
shim: z.ZodOptional<z.ZodBoolean>;
|
|
402
388
|
read: z.ZodOptional<z.ZodBoolean>;
|
|
403
389
|
write: z.ZodOptional<z.ZodBoolean>;
|
|
404
390
|
}, z.core.$strip>>;
|
|
405
391
|
gh_shim: z.ZodOptional<z.ZodObject<{
|
|
406
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
407
392
|
binary_path: z.ZodOptional<z.ZodString>;
|
|
408
393
|
}, z.core.$strip>>;
|
|
409
|
-
gh_read: z.ZodOptional<z.ZodObject<{
|
|
410
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
411
|
-
}, z.core.$strip>>;
|
|
412
394
|
git: z.ZodOptional<z.ZodObject<{
|
|
413
395
|
co_author: z.ZodOptional<z.ZodString>;
|
|
414
396
|
}, z.core.$strip>>;
|
|
@@ -423,14 +405,25 @@ export declare const AftConfigSchema: z.ZodPreprocess<z.ZodObject<{
|
|
|
423
405
|
export type AftConfig = z.infer<typeof AftConfigSchema>;
|
|
424
406
|
export type GithubConfig = z.infer<typeof GithubConfigSchema>;
|
|
425
407
|
export interface ResolvedGithubConfig {
|
|
426
|
-
enabled: boolean;
|
|
427
408
|
shim: boolean;
|
|
428
409
|
read: boolean;
|
|
429
410
|
write: boolean;
|
|
430
411
|
}
|
|
431
|
-
/** Resolve
|
|
412
|
+
/** Resolve GitHub capability leaves and the write-implies-read safety rule. */
|
|
432
413
|
export declare function resolveGithubConfig(config: AftConfig): ResolvedGithubConfig;
|
|
414
|
+
/**
|
|
415
|
+
* Whether a tool is registered, for description wording only (for example,
|
|
416
|
+
* whether to mention `aft_zoom`). Registration itself goes through
|
|
417
|
+
* {@link resolvedDisabledTools}, which refuses a config without a resolved list.
|
|
418
|
+
*/
|
|
433
419
|
export declare function toolEnabled(config: AftConfig, toolName: string): boolean;
|
|
420
|
+
/**
|
|
421
|
+
* The resolved disabled list. `loadAftConfig` always sets it; a config that
|
|
422
|
+
* reaches registration without it is rejected instead of treated as [].
|
|
423
|
+
*/
|
|
424
|
+
export declare function resolvedDisabledTools(config: AftConfig): readonly string[];
|
|
425
|
+
/** Resolved index switches (all default on). */
|
|
426
|
+
export declare function resolvedIndexes(config: AftConfig): ResolvedIndexesConfig;
|
|
434
427
|
/** Resolve the blocking diagnostics deadline for tools that wait on `aft_inspect`. */
|
|
435
428
|
export declare function resolveInspectDiagnosticsTimeoutMs(config: AftConfig): number;
|
|
436
429
|
export interface ConfigureLspServer {
|
|
@@ -472,22 +465,20 @@ export declare function resolveLspConfigForConfigure(config: AftConfig): Configu
|
|
|
472
465
|
* MUST NOT be re-derived per-bridge — they're identical across all bridges in
|
|
473
466
|
* one OpenCode/Pi process.
|
|
474
467
|
*
|
|
475
|
-
*
|
|
476
|
-
*
|
|
477
|
-
*
|
|
478
|
-
* function returns. Per-bridge changes to those fields wouldn't take effect.
|
|
468
|
+
* Registration (`disabled_tools`) locks at plugin init because OpenCode
|
|
469
|
+
* registers tools synchronously when the plugin function returns; the list is
|
|
470
|
+
* still forwarded so the engine can answer registration questions.
|
|
479
471
|
*/
|
|
480
472
|
export declare function resolveProjectOverridesForConfigure(config: AftConfig): Record<string, unknown>;
|
|
481
473
|
/**
|
|
482
|
-
* Resolved bash configuration after merging top-level `bash
|
|
483
|
-
* legacy `experimental.bash.*` fallback
|
|
484
|
-
*
|
|
485
|
-
*
|
|
474
|
+
* Resolved bash configuration after merging top-level `bash` and the
|
|
475
|
+
* legacy `experimental.bash.*` fallback. Everything downstream —
|
|
476
|
+
* configure-override emission, runtime gating, workflow-hints — reads from
|
|
477
|
+
* this single shape.
|
|
486
478
|
*
|
|
487
|
-
* `enabled`
|
|
488
|
-
* (
|
|
489
|
-
*
|
|
490
|
-
* disables hoist; OpenCode's native bash stays in place.
|
|
479
|
+
* `enabled` is the runtime gate: when false, bash and its companions stay
|
|
480
|
+
* registered (registration is `disabled_tools` only) and report
|
|
481
|
+
* `bash_disabled`. `bash: false` also forces the three sub-features off.
|
|
491
482
|
*/
|
|
492
483
|
export interface ResolvedBashConfig {
|
|
493
484
|
enabled: boolean;
|
|
@@ -527,16 +518,15 @@ export declare function clampBashWatchSyncMaxMs(value: number | undefined): numb
|
|
|
527
518
|
* Single source of truth for bash config across the plugin. Resolution
|
|
528
519
|
* order (highest priority wins):
|
|
529
520
|
*
|
|
530
|
-
* 1. Top-level `bash: false` →
|
|
521
|
+
* 1. Top-level `bash: false` → runtime off (sub-features all false)
|
|
531
522
|
* 2. Top-level `bash: true` → fully enabled (sub-features all true)
|
|
532
|
-
* 3. Top-level `bash: { ... }` →
|
|
533
|
-
* when not specified
|
|
523
|
+
* 3. Top-level `bash: { ... }` → runtime gate from `enabled` (default
|
|
524
|
+
* true); each sub-feature defaults true when not specified
|
|
534
525
|
* 4. Top-level `bash` absent + any `experimental.bash.*` set → legacy
|
|
535
526
|
* fallback; sub-features take their explicit values (default false
|
|
536
|
-
* to preserve pre-v0.27.2 behavior — that block was opt-in)
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
* - "recommended" or "all" → enabled with all sub-features on
|
|
527
|
+
* to preserve pre-v0.27.2 behavior — that block was opt-in); the
|
|
528
|
+
* runtime gate stays on
|
|
529
|
+
* 5. Top-level `bash` absent + no experimental → everything on
|
|
540
530
|
*
|
|
541
531
|
* The long_running_reminder_* tuning fields are passed through from
|
|
542
532
|
* whichever surface specified them; they live alongside the feature
|
|
@@ -560,6 +550,21 @@ export type ConfigLoadError = {
|
|
|
560
550
|
/** Errors from the most recent {@link loadAftConfig} call (parse failures only). */
|
|
561
551
|
export declare function getConfigLoadErrors(): readonly ConfigLoadError[];
|
|
562
552
|
export declare function formatConfigParseFailureMessage(configPath: string, errorMessage: string): string;
|
|
553
|
+
/** Test hook: evaluate the retired-key policy as if running this package version. */
|
|
554
|
+
export declare function setFeatureConfigPolicyVersionForTests(version: string | undefined): void;
|
|
555
|
+
/** One migration notice awaiting delivery by the plugin. */
|
|
556
|
+
export interface ConfigLoadNotice {
|
|
557
|
+
configPath: string;
|
|
558
|
+
digest: string;
|
|
559
|
+
message: string;
|
|
560
|
+
}
|
|
561
|
+
/** Migration notices from the most recent {@link loadAftConfig} call. */
|
|
562
|
+
export declare function getConfigLoadNotices(): readonly ConfigLoadNotice[];
|
|
563
|
+
/**
|
|
564
|
+
* Deliver the notices of the last load through `deliver`, once per notice
|
|
565
|
+
* identity across restarts (see `deliverMigrationNoticeOnce`).
|
|
566
|
+
*/
|
|
567
|
+
export declare function deliverConfigLoadNotices(deliver: (message: string) => void, notices?: readonly ConfigLoadNotice[]): void;
|
|
563
568
|
/** Defaults for bridge transport when omitted from config. */
|
|
564
569
|
export declare const DEFAULT_BRIDGE_REQUEST_TIMEOUT_MS = 30000;
|
|
565
570
|
export declare const DEFAULT_BRIDGE_HANG_THRESHOLD = 2;
|
|
@@ -584,6 +589,13 @@ export declare function buildConfigTierConfigureParams(projectDirectory: string,
|
|
|
584
589
|
cortexkit_user_config_path: string;
|
|
585
590
|
subc_client_reaper?: boolean;
|
|
586
591
|
};
|
|
592
|
+
/**
|
|
593
|
+
* Load and resolve the user and project config for one project.
|
|
594
|
+
*
|
|
595
|
+
* The result always carries a sorted `disabled_tools` list (absent user base
|
|
596
|
+
* defaults to aft_move/aft_delete) and fully resolved `indexes`. Throws
|
|
597
|
+
* {@link ConfigRejectedError} when a retired key must be rejected; callers
|
|
598
|
+
* must then publish nothing (startup) or keep their last-good config (reload).
|
|
599
|
+
*/
|
|
587
600
|
export declare function loadAftConfig(projectDirectory: string): AftConfig;
|
|
588
|
-
export {};
|
|
589
601
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,4BAA4B,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,4BAA4B,EAEjC,KAAK,UAAU,EAYf,KAAK,qBAAqB,EAa3B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAmE5D,oGAAoG;AACpG,eAAO,MAAM,6BAA6B;;;;EAAmC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAqQtF,QAAA,MAAM,kBAAkB;;;;iBAOtB,CAAC;AAyBH,eAAO,MAAM,sCAAsC,SAAU,CAAC;AAC9D,eAAO,MAAM,kCAAkC,QAAS,CAAC;AACzD,eAAO,MAAM,kCAAkC,SAAU,CAAC;AAoF1D,eAAO,MAAM,sBAAsB;;;EAAwC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAExE,eAAO,MAAM,cAAc;;;;;iBAGzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAuHtD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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