@intentic/extension-api 1.311.0 → 1.313.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/README.md +14 -6
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/background.d.ts +30 -0
- package/dist/background.d.ts.map +1 -1
- package/dist/background.js +42 -0
- package/dist/background.js.map +1 -1
- package/dist/server.d.ts +29 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +5 -5
- package/src/api.ts +6 -0
- package/src/background.ts +92 -1
- package/src/server.ts +44 -0
- package/src/surface.json +236 -0
- package/src/version.ts +15 -2
package/README.md
CHANGED
|
@@ -13,17 +13,25 @@ flowchart LR
|
|
|
13
13
|
|
|
14
14
|
- There is no ambient global. The host hands `IntenticApi` to `activate(api, context)`, and everything registered
|
|
15
15
|
returns a `Disposable`. A manifest's `server` bundle gets `ExtensionServerApi` in a Node process shared by every
|
|
16
|
-
enabled extension, and reaches daemon routes only as far as `permissions.daemon` allows.
|
|
17
|
-
|
|
16
|
+
enabled extension, and reaches daemon routes only as far as `permissions.daemon` allows. The browser half reaches
|
|
17
|
+
its own backend through `api.backend`, by a path relative to its namespace, never by spelling `/x/<id>`.
|
|
18
|
+
- An extension gives the agent tools one way: `contributes.tools`, served by `api.tools.serve((card) => [...])` in
|
|
19
|
+
the backend. The host owns the MCP transport, each call's deadline and the card lookup, and hands the card's
|
|
20
|
+
settings with every call; the daemon mounts the server into every turn on every runtime. A plugin's `.mcp.json` is
|
|
21
|
+
deprecated, and a cli card's `mcp` is kept one release as an alias.
|
|
22
|
+
- This package is published to npm, and its API only grows within a major. `extensionApiVersion` moves
|
|
18
23
|
with every surface change (additive is a minor), and a manifest's `engines.intentic` range is matched against it at
|
|
19
24
|
load, failing closed. The editor's `surface-guard.test.ts` fails when the surface moves without a new entry in
|
|
20
|
-
`src/surface.json
|
|
25
|
+
`src/surface.json`, which records the api's members and, from 2.20.0, a digest of the whole generated manifest
|
|
26
|
+
schema, since a host's parse drops a field it does not know at any depth.
|
|
21
27
|
- Helpers every extension needs live here too: sandbox-scoped module state (`sandboxRef`, cleared on every sandbox
|
|
22
28
|
switch), background polling for rail badges, `sandboxLedger` (whose writes reject rather than overwrite a file they
|
|
23
|
-
could not read),
|
|
24
|
-
`
|
|
29
|
+
could not read), `sandboxDocument` (a file of the extension's own read through the `conversions` its shape has had,
|
|
30
|
+
by the contract's `readDocument`, and written with what a newer version of the extension put in it kept; every handle
|
|
31
|
+
on one path shares one write queue), SSE and ndjson stream reading, and the
|
|
32
|
+
payload for `api.workspace.openDiff`.
|
|
25
33
|
- Contribution points: `agent`, `automationTemplates`, `bin`, `capabilities`, `commands`, `documents`,
|
|
26
|
-
`environment`, `files`, `listener`, `processes`, `settings`, `viewers` and `views`, plus the manifest's top-level
|
|
34
|
+
`environment`, `files`, `listener`, `processes`, `settings`, `tools`, `viewers` and `views`, plus the manifest's top-level
|
|
27
35
|
fields, all read off `CONTRIBUTION_POINTS` in
|
|
28
36
|
[extension-manifest](../extension-manifest/src/points/index.ts).
|
|
29
37
|
- `./protocol` exports only the version and the engines matcher, for the daemon, which cannot load the Vue-dependent
|
package/dist/api.d.ts
CHANGED
|
@@ -76,6 +76,10 @@ export interface ProcessStatus {
|
|
|
76
76
|
}
|
|
77
77
|
export interface IntenticApi {
|
|
78
78
|
readonly apiVersion: string;
|
|
79
|
+
readonly backend: {
|
|
80
|
+
request(path: string, init?: RequestInit): Promise<Response>;
|
|
81
|
+
json<T>(path: string, init?: RequestInit): Promise<T>;
|
|
82
|
+
};
|
|
79
83
|
readonly views: {
|
|
80
84
|
register(view: ViewRegistration): Disposable;
|
|
81
85
|
};
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.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AAE,OAAO,GAAG,MAAM,KAAK,IAAI,GAAG,UAAU,CAAC;KACvE,CAAC;IAIF,QAAQ,CAAC,QAAQ,EAAE;QACf,OAAO,IAAI,WAAW,GAAG,OAAO,CAAC;QACjC,WAAW,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,KAAK,IAAI,GAAG,UAAU,CAAC;KAChF,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,aAAa,EAAE,UAAU,EAAE,CAAC;CACxC;AAGD,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAU3E,MAAM,WAAW,iBAAiB;IAE9B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAE3B,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;CACjF;AAID,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5E,UAAU,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CACzC"}
|
package/dist/background.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Conversion, type Granularity } from "@intentic/sandbox-contract/documents";
|
|
1
2
|
import type { Ref } from "vue";
|
|
2
3
|
import type { Disposable, IntenticApi } from "./api.js";
|
|
3
4
|
export interface SandboxPoll<T> {
|
|
@@ -20,4 +21,33 @@ export interface SandboxLedger {
|
|
|
20
21
|
replace(entries: Readonly<Record<string, string>>): Promise<boolean>;
|
|
21
22
|
}
|
|
22
23
|
export declare const sandboxLedger: (host: () => IntenticApi, path: string) => SandboxLedger;
|
|
24
|
+
export declare const conversions: {
|
|
25
|
+
readonly at: <const Path extends string, const Inner extends Conversion>(path: Path, inner: Inner) => import("@intentic/sandbox-contract/documents").AtConversion<Path, Inner>;
|
|
26
|
+
readonly drop: <const Key extends string>(key: Key) => import("@intentic/sandbox-contract/documents").DropConversion<Key>;
|
|
27
|
+
readonly dropAll: <const Keys extends readonly string[]>(keys: Keys) => { readonly [I in keyof Keys]: import("@intentic/sandbox-contract/documents").DropConversion<Keys[I] & string>; };
|
|
28
|
+
readonly fold: <const From extends string, const Into extends string, Out>(describe: string, shape: {
|
|
29
|
+
readonly from: readonly From[];
|
|
30
|
+
readonly into: Into;
|
|
31
|
+
readonly applies: (value: import("@intentic/sandbox-contract/documents").JsonObject) => boolean;
|
|
32
|
+
readonly convert: (fields: Readonly<Partial<Record<From, unknown>>>, whole: import("@intentic/sandbox-contract/documents").JsonObject) => Out;
|
|
33
|
+
}) => import("@intentic/sandbox-contract/documents").FoldConversion<From, Into, Out>;
|
|
34
|
+
readonly mapValue: <const Key extends string, const Mapping extends Readonly<Record<string, unknown>>>(key: Key, mapping: Mapping) => import("@intentic/sandbox-contract/documents").MapValueConversion<Key, Mapping>;
|
|
35
|
+
readonly nested: <const Path extends string, const History extends readonly Conversion[], const Entries extends boolean = false>(path: Path, history: History, entries?: Entries) => { readonly [I in keyof History]: History[I] extends import("@intentic/sandbox-contract/documents").RetireEntriesConversion<unknown> ? import("@intentic/sandbox-contract/documents").AtConversion<Path, History[I]> : import("@intentic/sandbox-contract/documents").AtConversion<Entries extends true ? `${Path}.*` : Path, History[I]>; };
|
|
36
|
+
readonly pinDefault: <const Key extends string, const Value>(key: Key, value: Value) => import("@intentic/sandbox-contract/documents").PinDefaultConversion<Key, Value>;
|
|
37
|
+
readonly rename: <const From extends string, const To extends string>(from: From, to: To) => import("@intentic/sandbox-contract/documents").RenameConversion<From, To>;
|
|
38
|
+
readonly retireEntries: <Retired>(describe: string, isRetired: (entry: unknown) => entry is Retired) => import("@intentic/sandbox-contract/documents").RetireEntriesConversion<Retired>;
|
|
39
|
+
readonly retype: <const Key extends string, In, Out>(key: Key, guard: (value: unknown) => value is In, convert: (value: In) => Out, describe?: string) => import("@intentic/sandbox-contract/documents").RetypeConversion<Key, In, Out>;
|
|
40
|
+
readonly transform: <In extends import("@intentic/sandbox-contract/documents").JsonObject, Out extends import("@intentic/sandbox-contract/documents").JsonObject>(describe: string, applies: (value: import("@intentic/sandbox-contract/documents").JsonObject) => value is In, convert: (value: In) => Out) => import("@intentic/sandbox-contract/documents").TransformConversion<In, Out>;
|
|
41
|
+
};
|
|
42
|
+
export interface SandboxDocument<T> {
|
|
43
|
+
read(): Promise<T>;
|
|
44
|
+
update(change: (current: T) => T): Promise<boolean>;
|
|
45
|
+
}
|
|
46
|
+
export interface SandboxDocumentOptions<T> {
|
|
47
|
+
readonly parse: (raw: unknown) => T | undefined;
|
|
48
|
+
readonly fallback: () => T;
|
|
49
|
+
readonly history?: readonly Conversion[];
|
|
50
|
+
readonly granularity?: Granularity;
|
|
51
|
+
}
|
|
52
|
+
export declare const sandboxDocument: <T>(host: () => IntenticApi, path: string, options: SandboxDocumentOptions<T>) => SandboxDocument<T>;
|
|
23
53
|
//# sourceMappingURL=background.d.ts.map
|
package/dist/background.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAOxD,MAAM,WAAW,WAAW,CAAC,CAAC;IAE1B,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IAEvB,KAAK,IAAI,UAAU,CA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rE,CAAC;AAKF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAA+G,CAAC;AAMxI,MAAM,WAAW,eAAe,CAAC,CAAC;IAE9B,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;IAGnB,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC;IAErC,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,GAAG,SAAS,CAAC;IAChD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE3B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAEzC,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;CACtC;AAMD,eAAO,MAAM,eAAe,GAAI,CAAC,QAAQ,MAAM,WAAW,QAAQ,MAAM,WAAW,sBAAsB,CAAC,CAAC,CAAC,KAAG,eAAe,CAAC,CAAC,CA0C/H,CAAC"}
|
package/dist/background.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { at, drop, dropAll, fold, mapValue, nested, pinDefault, readDocument, rename, retireEntries, retype, transform, } from "@intentic/sandbox-contract/documents";
|
|
1
2
|
import { sandboxRef, sandboxScopeGuard } from "./scope.js";
|
|
2
3
|
const WAKE_MS = 400;
|
|
3
4
|
const scheduledReads = [];
|
|
@@ -142,4 +143,45 @@ export const sandboxLedger = (host, path) => {
|
|
|
142
143
|
replace: async (entries) => settle(() => entries),
|
|
143
144
|
};
|
|
144
145
|
};
|
|
146
|
+
export const conversions = { at, drop, dropAll, fold, mapValue, nested, pinDefault, rename, retireEntries, retype, transform };
|
|
147
|
+
const queues = new Map();
|
|
148
|
+
export const sandboxDocument = (host, path, options) => {
|
|
149
|
+
const shape = { history: options.history ?? [], granularity: options.granularity ?? `object` };
|
|
150
|
+
const readAs = async () => {
|
|
151
|
+
const answer = await host().sandbox.rpc.workspace.file({ path });
|
|
152
|
+
return answer.present ? readDocument(answer.content, shape, { kind: `whole`, parse: (raw) => options.parse(raw) }) : undefined;
|
|
153
|
+
};
|
|
154
|
+
const read = async () => {
|
|
155
|
+
try {
|
|
156
|
+
return (await readAs())?.value ?? options.fallback();
|
|
157
|
+
}
|
|
158
|
+
catch {
|
|
159
|
+
return options.fallback();
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const update = (change) => {
|
|
163
|
+
const run = async () => {
|
|
164
|
+
const current = sandboxScopeGuard();
|
|
165
|
+
const stored = await readAs();
|
|
166
|
+
if (stored !== undefined && stored.value === undefined) {
|
|
167
|
+
throw new Error(`${path} holds what this version of the extension cannot read; it is left as it is`, { cause: stored.problems[0] });
|
|
168
|
+
}
|
|
169
|
+
const before = stored?.value ?? options.fallback();
|
|
170
|
+
const after = change(before);
|
|
171
|
+
if (after === before) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
if (!current()) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
const written = stored === undefined ? after : stored.carry(after);
|
|
178
|
+
await host().workspace.write(path, `${JSON.stringify(written, undefined, 2)}\n`);
|
|
179
|
+
return true;
|
|
180
|
+
};
|
|
181
|
+
const next = (queues.get(path) ?? Promise.resolve()).then(run, run);
|
|
182
|
+
queues.set(path, next.catch(() => undefined));
|
|
183
|
+
return next;
|
|
184
|
+
};
|
|
185
|
+
return { read, update };
|
|
186
|
+
};
|
|
145
187
|
//# sourceMappingURL=background.js.map
|
package/dist/background.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.js","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"background.js","sourceRoot":"","sources":["../src/background.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,EAAE,EAEF,IAAI,EACJ,OAAO,EACP,IAAI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,QAAQ,EAAE,CAAC;YACnD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;YAC7B,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;gBACnB,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;gBACb,OAAO,KAAK,CAAC;YACjB,CAAC;YACD,MAAM,OAAO,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACnE,MAAM,IAAI,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YACjF,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QACF,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAEpE,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;QAC9C,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { sandboxContract } from "@intentic/sandbox-contract";
|
|
2
2
|
import type { ContractRouterClient } from "@orpc/contract";
|
|
3
|
+
export interface ToolCard {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly config: Readonly<Record<string, string>>;
|
|
6
|
+
}
|
|
7
|
+
export type ToolContent = {
|
|
8
|
+
readonly type: "text";
|
|
9
|
+
readonly text: string;
|
|
10
|
+
} | {
|
|
11
|
+
readonly type: "image";
|
|
12
|
+
readonly data: string;
|
|
13
|
+
readonly mimeType: string;
|
|
14
|
+
};
|
|
15
|
+
export interface ToolResult {
|
|
16
|
+
readonly content: readonly ToolContent[];
|
|
17
|
+
readonly isError?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ToolCallContext {
|
|
20
|
+
readonly signal: AbortSignal;
|
|
21
|
+
readonly conversationId?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ToolDefinition {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly description: string;
|
|
26
|
+
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
27
|
+
readonly call: (args: Readonly<Record<string, unknown>>, context: ToolCallContext) => Promise<ToolResult | string | unknown> | ToolResult | string | unknown;
|
|
28
|
+
}
|
|
3
29
|
export type BackendRouteHandler = (request: Request) => Promise<Response | undefined>;
|
|
4
30
|
export interface ExtensionServerApi {
|
|
5
31
|
readonly apiVersion: string;
|
|
@@ -9,6 +35,9 @@ export interface ExtensionServerApi {
|
|
|
9
35
|
readonly routes: {
|
|
10
36
|
mount(handler: BackendRouteHandler): void;
|
|
11
37
|
};
|
|
38
|
+
readonly tools: {
|
|
39
|
+
serve(tools: (card: ToolCard | undefined) => readonly ToolDefinition[] | Promise<readonly ToolDefinition[]>): void;
|
|
40
|
+
};
|
|
12
41
|
readonly daemon: {
|
|
13
42
|
readonly rpc: ContractRouterClient<typeof sandboxContract>;
|
|
14
43
|
request(path: string, init?: RequestInit): Promise<Response>;
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],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|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const extensionApiVersion = "2.
|
|
1
|
+
export declare const extensionApiVersion = "2.20.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AA4HA,eAAO,MAAM,mBAAmB,WAAW,CAAC"}
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const extensionApiVersion = "2.
|
|
1
|
+
export const extensionApiVersion = "2.20.0";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AA4HA,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/extension-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.313.0",
|
|
4
4
|
"description": "The versioned public API intentic extensions compile against, manifest schema, detection facts and the host API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@intentic/sandbox-contract": "1.
|
|
46
|
-
"@orpc/contract": "1.
|
|
45
|
+
"@intentic/sandbox-contract": "1.313.0",
|
|
46
|
+
"@orpc/contract": "1.15.4",
|
|
47
47
|
"tslib": "2.8.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@intentic/tsconfig": "0.0.0",
|
|
54
|
-
"@types/node": "24.13.
|
|
54
|
+
"@types/node": "24.13.6",
|
|
55
55
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
56
|
-
"vue": "3.5.
|
|
56
|
+
"vue": "3.5.43"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "tsgo",
|
package/src/api.ts
CHANGED
|
@@ -154,6 +154,12 @@ export interface ProcessStatus {
|
|
|
154
154
|
export interface IntenticApi {
|
|
155
155
|
// The host's @intentic/extension-api version, checked against `engines.intentic`.
|
|
156
156
|
readonly apiVersion: string;
|
|
157
|
+
// This extension's own backend (`server`), by a path relative to its namespace: the host adds the routing prefix,
|
|
158
|
+
// which is the extension's install id and not always `publisher.name`, so no extension spells `/x/<id>` itself.
|
|
159
|
+
readonly backend: {
|
|
160
|
+
request(path: string, init?: RequestInit): Promise<Response>;
|
|
161
|
+
json<T>(path: string, init?: RequestInit): Promise<T>;
|
|
162
|
+
};
|
|
157
163
|
readonly views: {
|
|
158
164
|
register(view: ViewRegistration): Disposable;
|
|
159
165
|
};
|
package/src/background.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
at,
|
|
3
|
+
type Conversion,
|
|
4
|
+
drop,
|
|
5
|
+
dropAll,
|
|
6
|
+
fold,
|
|
7
|
+
type Granularity,
|
|
8
|
+
mapValue,
|
|
9
|
+
nested,
|
|
10
|
+
pinDefault,
|
|
11
|
+
readDocument,
|
|
12
|
+
rename,
|
|
13
|
+
retireEntries,
|
|
14
|
+
retype,
|
|
15
|
+
transform,
|
|
16
|
+
} from "@intentic/sandbox-contract/documents";
|
|
1
17
|
import type { Ref } from "vue";
|
|
2
18
|
import type { Disposable, IntenticApi } from "./api.js";
|
|
3
19
|
import { sandboxRef, sandboxScopeGuard } from "./scope.js";
|
|
@@ -187,7 +203,7 @@ export const sandboxLedger = (host: () => IntenticApi, path: string): SandboxLed
|
|
|
187
203
|
try {
|
|
188
204
|
return marksOf(JSON.parse(answer.content));
|
|
189
205
|
} catch {
|
|
190
|
-
// silent-catch: an unparseable ledger holds nothing acknowledged, the contract `read` states.
|
|
206
|
+
// allow(silent-catch): an unparseable ledger holds nothing acknowledged, the contract `read` states.
|
|
191
207
|
return {};
|
|
192
208
|
}
|
|
193
209
|
};
|
|
@@ -215,3 +231,78 @@ export const sandboxLedger = (host: () => IntenticApi, path: string): SandboxLed
|
|
|
215
231
|
replace: async (entries) => settle(() => entries),
|
|
216
232
|
};
|
|
217
233
|
};
|
|
234
|
+
|
|
235
|
+
// The vocabulary an extension's stored file evolves by, the same the daemon's own stores use: each a guarded, pure
|
|
236
|
+
// rewrite of the raw JSON, a no-op on a file already past it, so a file from any earlier version of the extension reads
|
|
237
|
+
// as today's shape. One namespace rather than ten loose names, since `rename` and `drop` are an author's words too.
|
|
238
|
+
export const conversions = { at, drop, dropAll, fold, mapValue, nested, pinDefault, rename, retireEntries, retype, transform } as const;
|
|
239
|
+
|
|
240
|
+
// A file an extension keeps under the workspace (its own record, cache or settings), read through the conversions its
|
|
241
|
+
// shape has had, and written with everything a NEWER version of the extension put in it kept in place, so switching an
|
|
242
|
+
// extension back never deletes what the later version recorded. A file that exists but cannot be read is left alone:
|
|
243
|
+
// `update` rejects rather than writing its fallback over it.
|
|
244
|
+
export interface SandboxDocument<T> {
|
|
245
|
+
// Today's value: the file converted and parsed; the fallback when it is absent or this version cannot read it.
|
|
246
|
+
read(): Promise<T>;
|
|
247
|
+
// Read-change-write, serialized through this handle. Returning `current` unchanged writes nothing; `false` means only
|
|
248
|
+
// that the sandbox changed mid-write, and nothing was written.
|
|
249
|
+
update(change: (current: T) => T): Promise<boolean>;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface SandboxDocumentOptions<T> {
|
|
253
|
+
// Today's shape, or undefined for a file this version cannot read.
|
|
254
|
+
readonly parse: (raw: unknown) => T | undefined;
|
|
255
|
+
readonly fallback: () => T;
|
|
256
|
+
// Append-only: a conversion is never edited or removed once shipped, only followed by another.
|
|
257
|
+
readonly history?: readonly Conversion[];
|
|
258
|
+
// Where the conversions apply: the document, each entry of a top-level array, or each value of an object keyed by id.
|
|
259
|
+
readonly granularity?: Granularity;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// Every handle on one path queues behind the others, not just behind itself: two handles opened on the same file (two
|
|
263
|
+
// panels, a panel and a command) would otherwise each read, change and write, and the second write would drop the first.
|
|
264
|
+
const queues = new Map<string, Promise<unknown>>();
|
|
265
|
+
|
|
266
|
+
export const sandboxDocument = <T>(host: () => IntenticApi, path: string, options: SandboxDocumentOptions<T>): SandboxDocument<T> => {
|
|
267
|
+
const shape = { history: options.history ?? [], granularity: options.granularity ?? `object` } as const;
|
|
268
|
+
// The one reading every store shares (@intentic/sandbox-contract/documents): undefined when absent; a value, or
|
|
269
|
+
// `value: undefined` with why, when present.
|
|
270
|
+
const readAs = async () => {
|
|
271
|
+
// Through the contract's own read, which throws for a refused or unreachable read where `readJson` answers absent.
|
|
272
|
+
const answer = await host().sandbox.rpc.workspace.file({ path });
|
|
273
|
+
return answer.present ? readDocument<T>(answer.content, shape, { kind: `whole`, parse: (raw) => options.parse(raw) }) : undefined;
|
|
274
|
+
};
|
|
275
|
+
const read = async (): Promise<T> => {
|
|
276
|
+
try {
|
|
277
|
+
return (await readAs())?.value ?? options.fallback();
|
|
278
|
+
} catch {
|
|
279
|
+
// allow(silent-catch): a file this version cannot reach reads as the fallback, the contract `read` states.
|
|
280
|
+
return options.fallback();
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
const update = (change: (current: T) => T): Promise<boolean> => {
|
|
284
|
+
const run = async (): Promise<boolean> => {
|
|
285
|
+
const current = sandboxScopeGuard();
|
|
286
|
+
const stored = await readAs();
|
|
287
|
+
if (stored !== undefined && stored.value === undefined) {
|
|
288
|
+
throw new Error(`${path} holds what this version of the extension cannot read; it is left as it is`, { cause: stored.problems[0] });
|
|
289
|
+
}
|
|
290
|
+
const before = stored?.value ?? options.fallback();
|
|
291
|
+
const after = change(before);
|
|
292
|
+
if (after === before) {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
if (!current()) {
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
const written = stored === undefined ? after : stored.carry(after);
|
|
299
|
+
await host().workspace.write(path, `${JSON.stringify(written, undefined, 2)}\n`);
|
|
300
|
+
return true;
|
|
301
|
+
};
|
|
302
|
+
const next = (queues.get(path) ?? Promise.resolve()).then(run, run);
|
|
303
|
+
// allow(silent-catch): the queue only orders the next update behind this one; this one's caller still gets its rejection
|
|
304
|
+
queues.set(path, next.catch(() => undefined));
|
|
305
|
+
return next;
|
|
306
|
+
};
|
|
307
|
+
return { read, update };
|
|
308
|
+
};
|
package/src/server.ts
CHANGED
|
@@ -5,6 +5,43 @@ import type { ContractRouterClient } from "@orpc/contract";
|
|
|
5
5
|
// shared by every enabled extension, separate from the daemon. Mediates only the extension's route namespace (mount)
|
|
6
6
|
// and its reach into daemon routes (`daemon.*`, gated by `permissions.daemon`).
|
|
7
7
|
|
|
8
|
+
// The card a tool server was mounted for (`contributes.tools.perCard`): its id, which names the server the agent sees,
|
|
9
|
+
// and its settings as the daemon holds them now, secrets included, every value a string. Handed with every call, so a
|
|
10
|
+
// switch flipped on the card applies to the next call without anything to invalidate.
|
|
11
|
+
export interface ToolCard {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly config: Readonly<Record<string, string>>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// One piece of what a tool answers, as MCP carries it.
|
|
17
|
+
export type ToolContent =
|
|
18
|
+
| { readonly type: "text"; readonly text: string }
|
|
19
|
+
| { readonly type: "image"; readonly data: string; readonly mimeType: string };
|
|
20
|
+
|
|
21
|
+
// A tool's whole answer. `isError` marks a refusal or a failure the model should read rather than a transport error.
|
|
22
|
+
export interface ToolResult {
|
|
23
|
+
readonly content: readonly ToolContent[];
|
|
24
|
+
readonly isError?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// What one call is handed beside its arguments.
|
|
28
|
+
export interface ToolCallContext {
|
|
29
|
+
// Aborted when the agent's client gives up on the call, or the host's deadline for it passes.
|
|
30
|
+
readonly signal: AbortSignal;
|
|
31
|
+
// The conversation the calling turn belongs to, when it has one.
|
|
32
|
+
readonly conversationId?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ToolDefinition {
|
|
36
|
+
// The name the model calls it by, under the server's own `mcp__<server>__` prefix.
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly description: string;
|
|
39
|
+
// A JSON Schema object for the arguments (`z.toJSONSchema(schema)` produces one).
|
|
40
|
+
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
41
|
+
// A string answers as text, a ToolResult as itself, anything else as its JSON; a throw answers as a tool error.
|
|
42
|
+
readonly call: (args: Readonly<Record<string, unknown>>, context: ToolCallContext) => Promise<ToolResult | string | unknown> | ToolResult | string | unknown;
|
|
43
|
+
}
|
|
44
|
+
|
|
8
45
|
// One request into this extension's `/x/<id>` namespace, prefix already stripped. Return `undefined` for "not mine":
|
|
9
46
|
// the host answers 404.
|
|
10
47
|
export type BackendRouteHandler = (request: Request) => Promise<Response | undefined>;
|
|
@@ -23,6 +60,13 @@ export interface ExtensionServerApi {
|
|
|
23
60
|
// second mount replaces the first.
|
|
24
61
|
mount(handler: BackendRouteHandler): void;
|
|
25
62
|
};
|
|
63
|
+
// The agent's tools (`contributes.tools`). The host owns the MCP transport, its deadlines and the card lookup: it
|
|
64
|
+
// answers the handshake, lists what `tools` returns for the card a server was mounted for (undefined for an
|
|
65
|
+
// extension-level server), and runs a call with its arguments. `tools` runs per request, so what it returns may
|
|
66
|
+
// follow the card's switches. A second serve replaces the first.
|
|
67
|
+
readonly tools: {
|
|
68
|
+
serve(tools: (card: ToolCard | undefined) => readonly ToolDefinition[] | Promise<readonly ToolDefinition[]>): void;
|
|
69
|
+
};
|
|
26
70
|
// Authenticated transport to the daemon's own routes; every call is checked against the manifest's
|
|
27
71
|
// `permissions.daemon` allowlist.
|
|
28
72
|
readonly daemon: {
|
package/src/surface.json
CHANGED
|
@@ -1609,5 +1609,241 @@
|
|
|
1609
1609
|
"request",
|
|
1610
1610
|
"rpc"
|
|
1611
1611
|
]
|
|
1612
|
+
},
|
|
1613
|
+
"2.19.0": {
|
|
1614
|
+
"manifest": [
|
|
1615
|
+
"$schema",
|
|
1616
|
+
"art",
|
|
1617
|
+
"category",
|
|
1618
|
+
"contributes",
|
|
1619
|
+
"engines",
|
|
1620
|
+
"entry",
|
|
1621
|
+
"icon",
|
|
1622
|
+
"logo",
|
|
1623
|
+
"name",
|
|
1624
|
+
"permissions",
|
|
1625
|
+
"publisher",
|
|
1626
|
+
"server",
|
|
1627
|
+
"version"
|
|
1628
|
+
],
|
|
1629
|
+
"contributes": [
|
|
1630
|
+
"agent",
|
|
1631
|
+
"automationTemplates",
|
|
1632
|
+
"bin",
|
|
1633
|
+
"capabilities",
|
|
1634
|
+
"commands",
|
|
1635
|
+
"documents",
|
|
1636
|
+
"environment",
|
|
1637
|
+
"files",
|
|
1638
|
+
"listener",
|
|
1639
|
+
"processes",
|
|
1640
|
+
"settings",
|
|
1641
|
+
"viewers",
|
|
1642
|
+
"views"
|
|
1643
|
+
],
|
|
1644
|
+
"api": [
|
|
1645
|
+
"apiVersion",
|
|
1646
|
+
"audience",
|
|
1647
|
+
"chat",
|
|
1648
|
+
"commands",
|
|
1649
|
+
"documents",
|
|
1650
|
+
"href",
|
|
1651
|
+
"models",
|
|
1652
|
+
"navigate",
|
|
1653
|
+
"processes",
|
|
1654
|
+
"route",
|
|
1655
|
+
"sandbox",
|
|
1656
|
+
"settings",
|
|
1657
|
+
"terminal",
|
|
1658
|
+
"theme",
|
|
1659
|
+
"viewers",
|
|
1660
|
+
"views",
|
|
1661
|
+
"workspace"
|
|
1662
|
+
],
|
|
1663
|
+
"listener": [
|
|
1664
|
+
"automation",
|
|
1665
|
+
"events",
|
|
1666
|
+
"provider"
|
|
1667
|
+
],
|
|
1668
|
+
"sandboxApi": [
|
|
1669
|
+
"fetch",
|
|
1670
|
+
"json",
|
|
1671
|
+
"key",
|
|
1672
|
+
"origin",
|
|
1673
|
+
"previewAddress",
|
|
1674
|
+
"reachable",
|
|
1675
|
+
"request",
|
|
1676
|
+
"role",
|
|
1677
|
+
"rpc"
|
|
1678
|
+
],
|
|
1679
|
+
"moduleExports": [
|
|
1680
|
+
"conversions",
|
|
1681
|
+
"extensionApiVersion",
|
|
1682
|
+
"flattenQuery",
|
|
1683
|
+
"hostSlot",
|
|
1684
|
+
"mergeQuery",
|
|
1685
|
+
"readDaemonStream",
|
|
1686
|
+
"resetSandboxScope",
|
|
1687
|
+
"sandboxDocument",
|
|
1688
|
+
"sandboxLedger",
|
|
1689
|
+
"sandboxPoll",
|
|
1690
|
+
"sandboxRef",
|
|
1691
|
+
"sandboxScopeGuard",
|
|
1692
|
+
"sandboxShallowRef",
|
|
1693
|
+
"sandboxValue",
|
|
1694
|
+
"satisfiesEngines"
|
|
1695
|
+
],
|
|
1696
|
+
"workspaceApi": [
|
|
1697
|
+
"capabilities",
|
|
1698
|
+
"file",
|
|
1699
|
+
"fillDiff",
|
|
1700
|
+
"inProject",
|
|
1701
|
+
"onDidChange",
|
|
1702
|
+
"onDidChangeFiles",
|
|
1703
|
+
"onDidChangeProject",
|
|
1704
|
+
"onDidChangeRefs",
|
|
1705
|
+
"onDidChangeRepos",
|
|
1706
|
+
"openDiff",
|
|
1707
|
+
"project",
|
|
1708
|
+
"readJson",
|
|
1709
|
+
"repos",
|
|
1710
|
+
"setProject",
|
|
1711
|
+
"write"
|
|
1712
|
+
],
|
|
1713
|
+
"chatApi": [
|
|
1714
|
+
"composeLoop",
|
|
1715
|
+
"composeWorkflow",
|
|
1716
|
+
"openAgent",
|
|
1717
|
+
"openSession"
|
|
1718
|
+
],
|
|
1719
|
+
"daemonApi": [
|
|
1720
|
+
"json",
|
|
1721
|
+
"request",
|
|
1722
|
+
"rpc"
|
|
1723
|
+
]
|
|
1724
|
+
},
|
|
1725
|
+
"2.20.0": {
|
|
1726
|
+
"manifest": [
|
|
1727
|
+
"$schema",
|
|
1728
|
+
"art",
|
|
1729
|
+
"category",
|
|
1730
|
+
"contributes",
|
|
1731
|
+
"engines",
|
|
1732
|
+
"entry",
|
|
1733
|
+
"icon",
|
|
1734
|
+
"logo",
|
|
1735
|
+
"name",
|
|
1736
|
+
"permissions",
|
|
1737
|
+
"publisher",
|
|
1738
|
+
"server",
|
|
1739
|
+
"version"
|
|
1740
|
+
],
|
|
1741
|
+
"contributes": [
|
|
1742
|
+
"agent",
|
|
1743
|
+
"automationTemplates",
|
|
1744
|
+
"bin",
|
|
1745
|
+
"capabilities",
|
|
1746
|
+
"commands",
|
|
1747
|
+
"documents",
|
|
1748
|
+
"environment",
|
|
1749
|
+
"files",
|
|
1750
|
+
"listener",
|
|
1751
|
+
"processes",
|
|
1752
|
+
"settings",
|
|
1753
|
+
"tools",
|
|
1754
|
+
"viewers",
|
|
1755
|
+
"views"
|
|
1756
|
+
],
|
|
1757
|
+
"api": [
|
|
1758
|
+
"apiVersion",
|
|
1759
|
+
"audience",
|
|
1760
|
+
"backend",
|
|
1761
|
+
"chat",
|
|
1762
|
+
"commands",
|
|
1763
|
+
"documents",
|
|
1764
|
+
"href",
|
|
1765
|
+
"models",
|
|
1766
|
+
"navigate",
|
|
1767
|
+
"processes",
|
|
1768
|
+
"route",
|
|
1769
|
+
"sandbox",
|
|
1770
|
+
"settings",
|
|
1771
|
+
"terminal",
|
|
1772
|
+
"theme",
|
|
1773
|
+
"viewers",
|
|
1774
|
+
"views",
|
|
1775
|
+
"workspace"
|
|
1776
|
+
],
|
|
1777
|
+
"listener": [
|
|
1778
|
+
"automation",
|
|
1779
|
+
"events",
|
|
1780
|
+
"provider"
|
|
1781
|
+
],
|
|
1782
|
+
"sandboxApi": [
|
|
1783
|
+
"fetch",
|
|
1784
|
+
"json",
|
|
1785
|
+
"key",
|
|
1786
|
+
"origin",
|
|
1787
|
+
"previewAddress",
|
|
1788
|
+
"reachable",
|
|
1789
|
+
"request",
|
|
1790
|
+
"role",
|
|
1791
|
+
"rpc"
|
|
1792
|
+
],
|
|
1793
|
+
"moduleExports": [
|
|
1794
|
+
"conversions",
|
|
1795
|
+
"extensionApiVersion",
|
|
1796
|
+
"flattenQuery",
|
|
1797
|
+
"hostSlot",
|
|
1798
|
+
"mergeQuery",
|
|
1799
|
+
"readDaemonStream",
|
|
1800
|
+
"resetSandboxScope",
|
|
1801
|
+
"sandboxDocument",
|
|
1802
|
+
"sandboxLedger",
|
|
1803
|
+
"sandboxPoll",
|
|
1804
|
+
"sandboxRef",
|
|
1805
|
+
"sandboxScopeGuard",
|
|
1806
|
+
"sandboxShallowRef",
|
|
1807
|
+
"sandboxValue",
|
|
1808
|
+
"satisfiesEngines"
|
|
1809
|
+
],
|
|
1810
|
+
"workspaceApi": [
|
|
1811
|
+
"capabilities",
|
|
1812
|
+
"file",
|
|
1813
|
+
"fillDiff",
|
|
1814
|
+
"inProject",
|
|
1815
|
+
"onDidChange",
|
|
1816
|
+
"onDidChangeFiles",
|
|
1817
|
+
"onDidChangeProject",
|
|
1818
|
+
"onDidChangeRefs",
|
|
1819
|
+
"onDidChangeRepos",
|
|
1820
|
+
"openDiff",
|
|
1821
|
+
"project",
|
|
1822
|
+
"readJson",
|
|
1823
|
+
"repos",
|
|
1824
|
+
"setProject",
|
|
1825
|
+
"write"
|
|
1826
|
+
],
|
|
1827
|
+
"chatApi": [
|
|
1828
|
+
"composeLoop",
|
|
1829
|
+
"composeWorkflow",
|
|
1830
|
+
"openAgent",
|
|
1831
|
+
"openSession"
|
|
1832
|
+
],
|
|
1833
|
+
"daemonApi": [
|
|
1834
|
+
"json",
|
|
1835
|
+
"request",
|
|
1836
|
+
"rpc"
|
|
1837
|
+
],
|
|
1838
|
+
"serverApi": [
|
|
1839
|
+
"apiVersion",
|
|
1840
|
+
"daemon",
|
|
1841
|
+
"extensionDir",
|
|
1842
|
+
"log",
|
|
1843
|
+
"routes",
|
|
1844
|
+
"tools",
|
|
1845
|
+
"workspaceRoot"
|
|
1846
|
+
],
|
|
1847
|
+
"manifestSchema": "dac4d58e713132c347e6535f980d72d636af6608bb0e55a1b4718ef14c87c311"
|
|
1612
1848
|
}
|
|
1613
1849
|
}
|
package/src/version.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The extension API's protocol version, the value `engines.intentic` ranges are matched against at load, and
|
|
2
2
|
// the value the host reports as IntenticApi.apiVersion. Bumped ONLY with the published package: additive
|
|
3
|
-
// surface = minor, breaking = major
|
|
3
|
+
// surface = minor, breaking = major; published, so its surface only grows within a major.
|
|
4
4
|
//
|
|
5
5
|
// 1.0.0 rather than 0.5.0, and the reason is the drift that forced that bump. While the major was 0 the caret
|
|
6
6
|
// matcher treats the MINOR as breaking (engines.ts), so every addition invalidated every declared range, which
|
|
@@ -109,4 +109,17 @@
|
|
|
109
109
|
// server.ts): the backend half was the one surface no recorded grain could see.
|
|
110
110
|
// 2.18.0 adds `api.workspace.onDidChangeRepos`: the repository set moving (a clone, a scaffold, a delete). `repos()` is
|
|
111
111
|
// narrowed to the open project, so a view listing every repository (the Projects dashboard) could only poll. Additive.
|
|
112
|
-
|
|
112
|
+
// 2.19.0 adds `sandboxDocument` and the `conversions` vocabulary: a file an extension keeps, read through the
|
|
113
|
+
// conversions its shape has had and written with what a newer version of the extension put in it kept in place, the
|
|
114
|
+
// evolution the daemon's own stores got (the daemon's store/evolution/conversions.ts). Until now an extension that changed the
|
|
115
|
+
// shape of its own file had two choices, a hand-written tolerant reader or a reset for everyone who updated. Additive.
|
|
116
|
+
// 2.20.0 gives an extension one way to hand the agent tools: `contributes.tools`, served by the backend's new
|
|
117
|
+
// `api.tools.serve((card) => [...])` with the host owning the MCP transport, its deadlines and the card lookup, or by a
|
|
118
|
+
// declared process's port. The daemon mounts it into every turn at its one MCP door, so every runtime gets it, where a
|
|
119
|
+
// plugin's `.mcp.json` reached Claude Code alone. The UI half gains `api.backend`, its own backend by a namespace-relative
|
|
120
|
+
// path, since the routing id is the install id and not always `publisher.name`. A cli card's `mcp` stays one release as
|
|
121
|
+
// an alias. The recorded surface grows two grains here: the backend api's own members (`serverApi`), where `tools`
|
|
122
|
+
// arrived unseen by any grain, and a digest of the whole generated manifest schema (`manifestSchema`), so a field added
|
|
123
|
+
// anywhere in the manifest, not only at the top level, needs a new version: an older host's parse drops what it does not
|
|
124
|
+
// know without a word.
|
|
125
|
+
export const extensionApiVersion = "2.20.0";
|