@codeworksh/plugin 0.3.0 → 0.4.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/{event-6sTQ_4bq.d.mts → event-CmzS4aGe.d.mts} +328 -23
- package/event.d.mts +2 -2
- package/event.mjs +15 -3
- package/event.mjs.map +1 -1
- package/{ids-CHjmAdTc.d.mts → ids-CpPeP5Ks.d.mts} +11 -3
- package/ids.d.mts +2 -2
- package/ids.mjs +7 -2
- package/ids.mjs.map +1 -1
- package/index.d.mts +2 -2
- package/index.mjs +1 -1
- package/mcp-DEWhnBQw.d.mts +122 -0
- package/package.json +7 -2
- package/plugin/mcp.d.mts +2 -0
- package/plugin/mcp.mjs +7 -0
- package/plugin/mcp.mjs.map +1 -0
- package/plugin/section.mjs +1 -0
- package/plugin/section.mjs.map +1 -1
- package/plugin/tool.d.mts +1 -1
- package/plugin/tool.mjs +2 -1
- package/plugin/tool.mjs.map +1 -1
- package/{plugin-XaYYRsX-.mjs → plugin-C3Qy4-Yx.mjs} +9 -3
- package/plugin-C3Qy4-Yx.mjs.map +1 -0
- package/{plugin-Dcv5TWNr.d.mts → plugin-aMOw2zJZ.d.mts} +23 -14
- package/plugin.d.mts +4 -3
- package/plugin.mjs +3 -2
- package/schema.d.mts +2 -0
- package/schema.mjs +3 -1
- package/schema.mjs.map +1 -1
- package/{settings-DGYWREuu.d.mts → settings-CxiAtEXT.d.mts} +22 -2
- package/settings.d.mts +2 -2
- package/settings.mjs +4 -0
- package/settings.mjs.map +1 -1
- package/tool/progress.d.mts +1 -1
- package/{tool-_ajVYIY5.d.mts → tool-C7gcMoga.d.mts} +33 -3
- package/{tool-D4_I_rzy.d.mts → tool-C9TzQ9nG.d.mts} +10 -10
- package/tool.d.mts +2 -2
- package/tool.mjs +49 -3
- package/tool.mjs.map +1 -1
- package/plugin-XaYYRsX-.mjs.map +0 -1
package/ids.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.mjs","names":[],"sources":["../../src/ids.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { uuidv7 } from \"uuidv7\";\nimport { withStatics } from \"./schema.ts\";\n\n/**\n * The identifiers that cross the plugin boundary.\n *\n * A plugin reads a session id off its context and a message id off every tool call, so both\n * brands have to be the ones the harness itself mints -- a structurally identical brand declared\n * twice is two types, and a plugin would have to cast to hand either back. They live here, in the\n * package both sides depend on, rather than being re-declared on each side.\n */\n\n// Session identity. Branded so a session ID is not interchangeable with an\n// entry, part, or workspace ID at the type level — service signatures take\n// `SessionID`, never a bare `string`.\n//\n// `create` mints a new one; `ascending` adopts an ID that came from outside\n// (a persisted row, a request payload) and rejects a foreign prefix rather\n// than branding it silently. uuidv7 keeps IDs lexicographically sortable by\n// creation time, so `ORDER BY id` is `ORDER BY created`.\nexport const SessionID = Schema.String.check(Schema.isStartingWith(\"ses\")).pipe(\n\tSchema.brand(\"Session.ID\"),\n\twithStatics((schema) => ({\n\t\tascending: (id?: string) => {\n\t\t\tif (!id) return schema.make(\"ses_\" + uuidv7());\n\t\t\tif (!id.startsWith(\"ses\")) throw new Error(`ID ${id} does not start with ses`);\n\t\t\treturn schema.make(id);\n\t\t},\n\t\tcreate: () => schema.make(\"ses_\" + uuidv7()),\n\t})),\n);\nexport type SessionID = typeof SessionID.Type;\n\n/**\n * A conversation message id.\n *\n * Deliberately unprefixed. aikit mints assistant message ids itself, as bare\n * uuidv7, and `stream()` accepts no id -- so any naming rule of ours would have\n * to be imposed on messages aikit hands us, by rewriting a field of the value we\n * were given. Sharing aikit's format instead means an id means the same thing on\n * both sides of the boundary and never needs translating.\n *\n * The brand carries the meaning; uuidv7 keeps ids time-ordered, so they sort by\n * creation.\n */\nexport const MessageID = Schema.String.pipe(\n\tSchema.brand(\"Message.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(uuidv7()),\n\t\t/**\n\t\t * Adopt an id minted elsewhere -- in practice aikit's, which arrives as a\n\t\t * plain string on every stream event and inside every assistant message.\n\t\t *\n\t\t * `make` does the same thing. This exists so the boundary where a foreign\n\t\t * id enters the domain is named and greppable, and so the pairing with\n\t\t * `create` says which side chose the id.\n\t\t */\n\t\tfrom: (id: string) => schema.make(id),\n\t})),\n);\nexport type MessageID = typeof MessageID.Type;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KAC1E,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,YAAY,OAAgB;EAC3B,IAAI,CAAC,IAAI,OAAO,OAAO,KAAK,SAAS,OAAO,CAAC;EAC7C,IAAI,CAAC,GAAG,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,MAAM,GAAG,yBAAyB;EAC7E,OAAO,OAAO,KAAK,EAAE;CACtB;CACA,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC;AAC5C,EAAE,CACH;;;;;;;;;;;;;AAeA,MAAa,YAAY,OAAO,OAAO,KACtC,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,cAAc,OAAO,KAAK,OAAO,CAAC;;;;;;;;;CASlC,OAAO,OAAe,OAAO,KAAK,EAAE;AACrC,EAAE,CACH"}
|
|
1
|
+
{"version":3,"file":"ids.mjs","names":[],"sources":["../../src/ids.ts"],"sourcesContent":["import { Schema } from \"effect\";\nimport { uuidv7 } from \"uuidv7\";\nimport { withStatics } from \"./schema.ts\";\n\n/**\n * The identifiers that cross the plugin boundary.\n *\n * A plugin reads a session and thread id off its context and a message id off every tool call, so both\n * brands have to be the ones the harness itself mints -- a structurally identical brand declared\n * twice is two types, and a plugin would have to cast to hand either back. They live here, in the\n * package both sides depend on, rather than being re-declared on each side.\n */\n\n// Session identity. Branded so a session ID is not interchangeable with an\n// entry, part, or workspace ID at the type level — service signatures take\n// `SessionID`, never a bare `string`.\n//\n// `create` mints a new one; `ascending` adopts an ID that came from outside\n// (a persisted row, a request payload) and rejects a foreign prefix rather\n// than branding it silently. uuidv7 keeps IDs lexicographically sortable by\n// creation time, so `ORDER BY id` is `ORDER BY created`.\nexport const SessionID = Schema.String.check(Schema.isStartingWith(\"ses\")).pipe(\n\tSchema.brand(\"Session.ID\"),\n\twithStatics((schema) => ({\n\t\tascending: (id?: string) => {\n\t\t\tif (!id) return schema.make(\"ses_\" + uuidv7());\n\t\t\tif (!id.startsWith(\"ses\")) throw new Error(`ID ${id} does not start with ses`);\n\t\t\treturn schema.make(id);\n\t\t},\n\t\tcreate: () => schema.make(\"ses_\" + uuidv7()),\n\t})),\n);\nexport type SessionID = typeof SessionID.Type;\n\n/**\n * Thread identity: one linear transcript inside a session. Every session has a `main` thread;\n * forks add more. Also the provider session and prompt-cache key, so it is fresh per thread.\n */\nexport const ThreadID = Schema.String.check(Schema.isStartingWith(\"thr\")).pipe(\n\tSchema.brand(\"Thread.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(\"thr_\" + uuidv7()),\n\t})),\n);\nexport type ThreadID = typeof ThreadID.Type;\n\n/**\n * A conversation message id.\n *\n * Deliberately unprefixed. aikit mints assistant message ids itself, as bare\n * uuidv7, and `stream()` accepts no id -- so any naming rule of ours would have\n * to be imposed on messages aikit hands us, by rewriting a field of the value we\n * were given. Sharing aikit's format instead means an id means the same thing on\n * both sides of the boundary and never needs translating.\n *\n * The brand carries the meaning; uuidv7 keeps ids time-ordered, so they sort by\n * creation.\n */\nexport const MessageID = Schema.String.pipe(\n\tSchema.brand(\"Message.ID\"),\n\twithStatics((schema) => ({\n\t\tcreate: () => schema.make(uuidv7()),\n\t\t/**\n\t\t * Adopt an id minted elsewhere -- in practice aikit's, which arrives as a\n\t\t * plain string on every stream event and inside every assistant message.\n\t\t *\n\t\t * `make` does the same thing. This exists so the boundary where a foreign\n\t\t * id enters the domain is named and greppable, and so the pairing with\n\t\t * `create` says which side chose the id.\n\t\t */\n\t\tfrom: (id: string) => schema.make(id),\n\t})),\n);\nexport type MessageID = typeof MessageID.Type;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAa,YAAY,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KAC1E,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,YAAY,OAAgB;EAC3B,IAAI,CAAC,IAAI,OAAO,OAAO,KAAK,SAAS,OAAO,CAAC;EAC7C,IAAI,CAAC,GAAG,WAAW,KAAK,GAAG,MAAM,IAAI,MAAM,MAAM,GAAG,yBAAyB;EAC7E,OAAO,OAAO,KAAK,EAAE;CACtB;CACA,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC;AAC5C,EAAE,CACH;;;;;AAOA,MAAa,WAAW,OAAO,OAAO,MAAM,OAAO,eAAe,KAAK,CAAC,CAAC,CAAC,KACzE,OAAO,MAAM,WAAW,GACxB,aAAa,YAAY,EACxB,cAAc,OAAO,KAAK,SAAS,OAAO,CAAC,EAC5C,EAAE,CACH;;;;;;;;;;;;;AAeA,MAAa,YAAY,OAAO,OAAO,KACtC,OAAO,MAAM,YAAY,GACzB,aAAa,YAAY;CACxB,cAAc,OAAO,KAAK,OAAO,CAAC;;;;;;;;;CASlC,OAAO,OAAe,OAAO,KAAK,EAAE;AACrC,EAAE,CACH"}
|
package/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { t as plugin_d_exports } from "./plugin-
|
|
2
|
+
import { b as tool_d_exports } from "./tool-C7gcMoga.mjs";
|
|
3
|
+
import { t as plugin_d_exports } from "./plugin-aMOw2zJZ.mjs";
|
|
4
4
|
export { plugin_d_exports as Plugin, section_d_exports as Section, tool_d_exports as Tool };
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as plugin_exports } from "./plugin-
|
|
1
|
+
import { t as plugin_exports } from "./plugin-C3Qy4-Yx.mjs";
|
|
2
2
|
import { t as section_exports } from "./plugin/section.mjs";
|
|
3
3
|
import { t as tool_exports } from "./tool.mjs";
|
|
4
4
|
export { plugin_exports as Plugin, section_exports as Section, tool_exports as Tool };
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
declare namespace mcp_d_exports {
|
|
2
|
+
export { Exposure, HttpServer, McpRegistry, OAuthConfig, Scope, ServerConfig, ServerPatch, StdioServer };
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* MCP servers a session runs, as plugins see and edit them.
|
|
6
|
+
*
|
|
7
|
+
* The harness seeds the bucket from `mcp.json` (the user file, then the project's), `mcp` plugins
|
|
8
|
+
* edit it, and it freezes before the `tool` domain runs: the servers are settled before any tool
|
|
9
|
+
* exists. Only configuration lives here. Whether a server is connected changes on its own, at any
|
|
10
|
+
* moment, so it is never part of what a plugin reads during setup.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* How a server's tools reach the model.
|
|
14
|
+
*
|
|
15
|
+
* - `direct`: declared to the model like any other tool.
|
|
16
|
+
* - `codemode`: called from codemode scripts, never declared to the model.
|
|
17
|
+
* - `deferred`: declared once `toolsearch` loads them.
|
|
18
|
+
* - `hidden`: never offered to the model.
|
|
19
|
+
*
|
|
20
|
+
* Until codemode exists, `codemode` tools cannot be called. `codemode-deferred` in `mcp.json` is
|
|
21
|
+
* read as `codemode`.
|
|
22
|
+
*/
|
|
23
|
+
type Exposure = "direct" | "codemode" | "deferred" | "hidden";
|
|
24
|
+
/**
|
|
25
|
+
* Who shares one running instance of a server.
|
|
26
|
+
*
|
|
27
|
+
* - `session`: threads of one session at the same place share one.
|
|
28
|
+
* - `space`: sessions in the same space (sandbox and folder) share one.
|
|
29
|
+
* - `app`: every session shares one.
|
|
30
|
+
*/
|
|
31
|
+
type Scope = "session" | "space" | "app";
|
|
32
|
+
interface Base {
|
|
33
|
+
/** Default: `direct`. */
|
|
34
|
+
readonly exposure?: Exposure;
|
|
35
|
+
/**
|
|
36
|
+
* Exposure of single tools, overriding `exposure`. Keys are tool names as the server offers them,
|
|
37
|
+
* or patterns where `*` matches any characters. An exact name wins over patterns; among patterns
|
|
38
|
+
* the first match wins. `"exposure": "hidden"` with a few entries here exposes only those tools.
|
|
39
|
+
*/
|
|
40
|
+
readonly toolExposure?: Readonly<Record<string, Exposure>>;
|
|
41
|
+
/** `false` keeps the entry without connecting. Default: `true`. */
|
|
42
|
+
readonly enabled?: boolean;
|
|
43
|
+
/** Default: `session`. Share a server only when it is safe to share. */
|
|
44
|
+
readonly scope?: Scope;
|
|
45
|
+
/** Per-request timeout in seconds. Progress notifications from the server reset it. Default: 60. */
|
|
46
|
+
readonly timeout?: number;
|
|
47
|
+
/** What the server offers, in a sentence. */
|
|
48
|
+
readonly description?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A server the harness starts as a process on the host. `env` values may name environment
|
|
52
|
+
* variables (`${NAME}`) or be a command whose output is the value (`!command`).
|
|
53
|
+
*/
|
|
54
|
+
interface StdioServer extends Base {
|
|
55
|
+
readonly type?: "stdio";
|
|
56
|
+
/** One executable, not a shell command line. */
|
|
57
|
+
readonly command: string;
|
|
58
|
+
readonly args?: ReadonlyArray<string>;
|
|
59
|
+
readonly env?: Readonly<Record<string, string>>;
|
|
60
|
+
/** Relative to the session's directory. */
|
|
61
|
+
readonly cwd?: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* OAuth client settings, for servers that do not accept dynamic client registration or need a
|
|
65
|
+
* fixed redirect URI.
|
|
66
|
+
*/
|
|
67
|
+
interface OAuthConfig {
|
|
68
|
+
/** A pre-registered client id. Without it, the harness registers a client with the server. */
|
|
69
|
+
readonly clientId?: string;
|
|
70
|
+
/** Resolves like a header value. */
|
|
71
|
+
readonly clientSecret?: string;
|
|
72
|
+
/** Port of the loopback callback, for a client registered with a fixed redirect URI. */
|
|
73
|
+
readonly callbackPort?: number;
|
|
74
|
+
/**
|
|
75
|
+
* The redirect URI registered for `clientId`: `http` on `localhost`, `127.0.0.1` or `[::1]`.
|
|
76
|
+
* Without a port, the callback listens on `callbackPort` or a free port.
|
|
77
|
+
*/
|
|
78
|
+
readonly callbackUrl?: string;
|
|
79
|
+
/** Scopes to request, separated by spaces. Default: the scopes the server advertises. */
|
|
80
|
+
readonly scope?: string;
|
|
81
|
+
/** `client_name` sent with dynamic client registration. Default: `CodeWork`. */
|
|
82
|
+
readonly clientName?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Authorization server metadata (RFC 8414 or OpenID Connect discovery) to use instead of
|
|
85
|
+
* discovering it through the server. `https`, or `http` on a loopback host.
|
|
86
|
+
*/
|
|
87
|
+
readonly authServerMetadataUrl?: string;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* A Streamable HTTP server. `headers` values resolve like a stdio server's `env`.
|
|
91
|
+
*
|
|
92
|
+
* A server without an `Authorization` header or `auth` signs in with OAuth when it answers 401
|
|
93
|
+
* (`codework mcp login <name>`).
|
|
94
|
+
*/
|
|
95
|
+
interface HttpServer extends Base {
|
|
96
|
+
readonly type?: "http" | "streamable-http";
|
|
97
|
+
readonly url: string;
|
|
98
|
+
readonly headers?: Readonly<Record<string, string>>;
|
|
99
|
+
readonly oauth?: OAuthConfig;
|
|
100
|
+
/**
|
|
101
|
+
* Send a model provider's credential (its login token, else its API key) as the bearer instead
|
|
102
|
+
* of using OAuth. Only in the user `mcp.json`, and only to `https` URLs or loopback hosts.
|
|
103
|
+
*/
|
|
104
|
+
readonly auth?: {
|
|
105
|
+
readonly provider: string;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
type ServerConfig = StdioServer | HttpServer;
|
|
109
|
+
/** The settings a plugin can change on a server without restating where it runs. */
|
|
110
|
+
type ServerPatch = Pick<Base, "enabled" | "exposure" | "toolExposure" | "timeout" | "description">;
|
|
111
|
+
interface McpRegistry {
|
|
112
|
+
readonly list: () => ReadonlyArray<readonly [name: string, config: ServerConfig]>;
|
|
113
|
+
readonly get: (name: string) => ServerConfig | undefined;
|
|
114
|
+
/** Add a server or replace one. Throws on an invalid name or config. */
|
|
115
|
+
readonly set: (name: string, config: ServerConfig) => void;
|
|
116
|
+
/** Throws when no server has this name. */
|
|
117
|
+
readonly update: (name: string, patch: ServerPatch) => void;
|
|
118
|
+
readonly remove: (name: string) => void;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { Scope as a, StdioServer as c, OAuthConfig as i, mcp_d_exports as l, HttpServer as n, ServerConfig as o, McpRegistry as r, ServerPatch as s, Exposure as t };
|
|
122
|
+
//# sourceMappingURL=mcp-DEWhnBQw.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeworksh/plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "SDK for building CodeWork plugins — the plugin, tool, and sandbox contracts shared with @codeworksh/harness.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"import": "./plugin/prompt.mjs",
|
|
46
46
|
"default": "./plugin/prompt.mjs"
|
|
47
47
|
},
|
|
48
|
+
"./plugin/mcp": {
|
|
49
|
+
"types": "./plugin/mcp.d.mts",
|
|
50
|
+
"import": "./plugin/mcp.mjs",
|
|
51
|
+
"default": "./plugin/mcp.mjs"
|
|
52
|
+
},
|
|
48
53
|
"./plugin/section": {
|
|
49
54
|
"types": "./plugin/section.d.mts",
|
|
50
55
|
"import": "./plugin/section.mjs",
|
|
@@ -168,7 +173,7 @@
|
|
|
168
173
|
"uuidv7": "^1.2.1"
|
|
169
174
|
},
|
|
170
175
|
"peerDependencies": {
|
|
171
|
-
"@codeworksh/aikit": "^0.
|
|
176
|
+
"@codeworksh/aikit": "^0.13.0",
|
|
172
177
|
"effect": "4.0.5"
|
|
173
178
|
}
|
|
174
179
|
}
|
package/plugin/mcp.d.mts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as Scope, c as StdioServer, i as OAuthConfig, n as HttpServer, o as ServerConfig, r as McpRegistry, s as ServerPatch, t as Exposure } from "../mcp-DEWhnBQw.mjs";
|
|
2
|
+
export { Exposure, HttpServer, McpRegistry, OAuthConfig, Scope, ServerConfig, ServerPatch, StdioServer };
|
package/plugin/mcp.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":[],"sources":["../../../src/plugin/mcp.ts"],"sourcesContent":["/**\n * MCP servers a session runs, as plugins see and edit them.\n *\n * The harness seeds the bucket from `mcp.json` (the user file, then the project's), `mcp` plugins\n * edit it, and it freezes before the `tool` domain runs: the servers are settled before any tool\n * exists. Only configuration lives here. Whether a server is connected changes on its own, at any\n * moment, so it is never part of what a plugin reads during setup.\n */\n\n/**\n * How a server's tools reach the model.\n *\n * - `direct`: declared to the model like any other tool.\n * - `codemode`: called from codemode scripts, never declared to the model.\n * - `deferred`: declared once `toolsearch` loads them.\n * - `hidden`: never offered to the model.\n *\n * Until codemode exists, `codemode` tools cannot be called. `codemode-deferred` in `mcp.json` is\n * read as `codemode`.\n */\nexport type Exposure = \"direct\" | \"codemode\" | \"deferred\" | \"hidden\";\n\n/**\n * Who shares one running instance of a server.\n *\n * - `session`: threads of one session at the same place share one.\n * - `space`: sessions in the same space (sandbox and folder) share one.\n * - `app`: every session shares one.\n */\nexport type Scope = \"session\" | \"space\" | \"app\";\n\ninterface Base {\n\t/** Default: `direct`. */\n\treadonly exposure?: Exposure;\n\t/**\n\t * Exposure of single tools, overriding `exposure`. Keys are tool names as the server offers them,\n\t * or patterns where `*` matches any characters. An exact name wins over patterns; among patterns\n\t * the first match wins. `\"exposure\": \"hidden\"` with a few entries here exposes only those tools.\n\t */\n\treadonly toolExposure?: Readonly<Record<string, Exposure>>;\n\t/** `false` keeps the entry without connecting. Default: `true`. */\n\treadonly enabled?: boolean;\n\t/** Default: `session`. Share a server only when it is safe to share. */\n\treadonly scope?: Scope;\n\t/** Per-request timeout in seconds. Progress notifications from the server reset it. Default: 60. */\n\treadonly timeout?: number;\n\t/** What the server offers, in a sentence. */\n\treadonly description?: string;\n}\n\n/**\n * A server the harness starts as a process on the host. `env` values may name environment\n * variables (`${NAME}`) or be a command whose output is the value (`!command`).\n */\nexport interface StdioServer extends Base {\n\treadonly type?: \"stdio\";\n\t/** One executable, not a shell command line. */\n\treadonly command: string;\n\treadonly args?: ReadonlyArray<string>;\n\treadonly env?: Readonly<Record<string, string>>;\n\t/** Relative to the session's directory. */\n\treadonly cwd?: string;\n}\n\n/**\n * OAuth client settings, for servers that do not accept dynamic client registration or need a\n * fixed redirect URI.\n */\nexport interface OAuthConfig {\n\t/** A pre-registered client id. Without it, the harness registers a client with the server. */\n\treadonly clientId?: string;\n\t/** Resolves like a header value. */\n\treadonly clientSecret?: string;\n\t/** Port of the loopback callback, for a client registered with a fixed redirect URI. */\n\treadonly callbackPort?: number;\n\t/**\n\t * The redirect URI registered for `clientId`: `http` on `localhost`, `127.0.0.1` or `[::1]`.\n\t * Without a port, the callback listens on `callbackPort` or a free port.\n\t */\n\treadonly callbackUrl?: string;\n\t/** Scopes to request, separated by spaces. Default: the scopes the server advertises. */\n\treadonly scope?: string;\n\t/** `client_name` sent with dynamic client registration. Default: `CodeWork`. */\n\treadonly clientName?: string;\n\t/**\n\t * Authorization server metadata (RFC 8414 or OpenID Connect discovery) to use instead of\n\t * discovering it through the server. `https`, or `http` on a loopback host.\n\t */\n\treadonly authServerMetadataUrl?: string;\n}\n\n/**\n * A Streamable HTTP server. `headers` values resolve like a stdio server's `env`.\n *\n * A server without an `Authorization` header or `auth` signs in with OAuth when it answers 401\n * (`codework mcp login <name>`).\n */\nexport interface HttpServer extends Base {\n\treadonly type?: \"http\" | \"streamable-http\";\n\treadonly url: string;\n\treadonly headers?: Readonly<Record<string, string>>;\n\treadonly oauth?: OAuthConfig;\n\t/**\n\t * Send a model provider's credential (its login token, else its API key) as the bearer instead\n\t * of using OAuth. Only in the user `mcp.json`, and only to `https` URLs or loopback hosts.\n\t */\n\treadonly auth?: { readonly provider: string };\n}\n\nexport type ServerConfig = StdioServer | HttpServer;\n\n/** The settings a plugin can change on a server without restating where it runs. */\nexport type ServerPatch = Pick<Base, \"enabled\" | \"exposure\" | \"toolExposure\" | \"timeout\" | \"description\">;\n\nexport interface McpRegistry {\n\treadonly list: () => ReadonlyArray<readonly [name: string, config: ServerConfig]>;\n\treadonly get: (name: string) => ServerConfig | undefined;\n\t/** Add a server or replace one. Throws on an invalid name or config. */\n\treadonly set: (name: string, config: ServerConfig) => void;\n\t/** Throws when no server has this name. */\n\treadonly update: (name: string, patch: ServerPatch) => void;\n\treadonly remove: (name: string) => void;\n}\n"],"mappings":""}
|
package/plugin/section.mjs
CHANGED
package/plugin/section.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"section.mjs","names":[],"sources":["../../../src/plugin/section.ts"],"sourcesContent":["// Sections are passed by value, never by name string, so a typo fails to compile instead of\n// quietly opening a new section.\n\n/** `text`: entries verbatim, blank-line separated. `list`: deduplicated `- ` bullets. */\nexport type Format = \"text\" | \"list\";\n\nexport interface Section<Name extends string = string> {\n\treadonly name: Name;\n\treadonly format: Format;\n}\n\nexport const Rules: Section<\"rules\"> = Object.freeze({ name: \"rules\", format: \"list\" });\nexport const Addendum: Section<\"addendum\"> = Object.freeze({ name: \"addendum\", format: \"text\" });\nexport const ProjectContext: Section<\"project_context\"> = Object.freeze({ name: \"project_context\", format: \"text\" });\nexport const Skills: Section<\"skills\"> = Object.freeze({ name: \"skills\", format: \"text\" });\n\n/** Rendered in this order, before custom sections. */\nexport const builtins: ReadonlyArray<Section> = Object.freeze([Rules, Addendum, ProjectContext, Skills]);\n\n/** Rendered by the harness, never by a plugin. */\nexport const reserved: ReadonlySet<string> = new Set([\"tools\", \"cwd\", \"foundation\"]);\n\nconst pattern = /^[a-z][a-z0-9_-]*$/;\n\nconst formats: ReadonlySet<unknown> = new Set<Format>([\"text\", \"list\"]);\n\n/** Runtime check: a JavaScript plugin can pass anything. */\nexport const isFormat = (format: unknown): format is Format => formats.has(format);\n\nexport const invalid = (name: unknown): string | undefined => {\n\tif (typeof name !== \"string\" || !pattern.test(name))\n\t\treturn `prompt section name must be lowercase letters, digits, \"_\" or \"-\": ${JSON.stringify(name)}`;\n\tif (reserved.has(name)) return `prompt section name is reserved: ${name}`;\n\treturn undefined;\n};\n\n/** A custom section. Throws on a name that is malformed, reserved, or built in. */\nexport const define = <const Name extends string>(\n\tname: Name,\n\toptions?: { readonly format?: Format },\n): Section<Name> => {\n\tconst reason =\n\t\tinvalid(name) ??\n\t\t(builtins.some((section) => section.name === name) ? `prompt section name is built in: ${name}` : undefined);\n\tif (reason !== undefined) throw new Error(reason);\n\tconst format = options?.format ?? \"text\";\n\tif (!isFormat(format)) throw new Error(`prompt section format must be \"text\" or \"list\": ${JSON.stringify(format)}`);\n\treturn Object.freeze({ name, format });\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,QAA0B,OAAO,OAAO;CAAE,MAAM;CAAS,QAAQ;AAAO,CAAC;AACtF,MAAa,WAAgC,OAAO,OAAO;CAAE,MAAM;CAAY,QAAQ;AAAO,CAAC;AAC/F,MAAa,iBAA6C,OAAO,OAAO;CAAE,MAAM;CAAmB,QAAQ;AAAO,CAAC;AACnH,MAAa,SAA4B,OAAO,OAAO;CAAE,MAAM;CAAU,QAAQ;AAAO,CAAC;;AAGzF,MAAa,WAAmC,OAAO,OAAO;CAAC;CAAO;CAAU;CAAgB;AAAM,CAAC;;AAGvG,MAAa,2BAAgC,IAAI,IAAI;CAAC;CAAS;CAAO;AAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"section.mjs","names":[],"sources":["../../../src/plugin/section.ts"],"sourcesContent":["// Sections are passed by value, never by name string, so a typo fails to compile instead of\n// quietly opening a new section.\n\n/** `text`: entries verbatim, blank-line separated. `list`: deduplicated `- ` bullets. */\nexport type Format = \"text\" | \"list\";\n\nexport interface Section<Name extends string = string> {\n\treadonly name: Name;\n\treadonly format: Format;\n}\n\nexport const Rules: Section<\"rules\"> = Object.freeze({ name: \"rules\", format: \"list\" });\nexport const Addendum: Section<\"addendum\"> = Object.freeze({ name: \"addendum\", format: \"text\" });\nexport const ProjectContext: Section<\"project_context\"> = Object.freeze({ name: \"project_context\", format: \"text\" });\nexport const Skills: Section<\"skills\"> = Object.freeze({ name: \"skills\", format: \"text\" });\n\n/** Rendered in this order, before custom sections. */\nexport const builtins: ReadonlyArray<Section> = Object.freeze([Rules, Addendum, ProjectContext, Skills]);\n\n/** Rendered by the harness, never by a plugin. */\nexport const reserved: ReadonlySet<string> = new Set([\"tools\", \"cwd\", \"mcpservers\", \"foundation\"]);\n\nconst pattern = /^[a-z][a-z0-9_-]*$/;\n\nconst formats: ReadonlySet<unknown> = new Set<Format>([\"text\", \"list\"]);\n\n/** Runtime check: a JavaScript plugin can pass anything. */\nexport const isFormat = (format: unknown): format is Format => formats.has(format);\n\nexport const invalid = (name: unknown): string | undefined => {\n\tif (typeof name !== \"string\" || !pattern.test(name))\n\t\treturn `prompt section name must be lowercase letters, digits, \"_\" or \"-\": ${JSON.stringify(name)}`;\n\tif (reserved.has(name)) return `prompt section name is reserved: ${name}`;\n\treturn undefined;\n};\n\n/** A custom section. Throws on a name that is malformed, reserved, or built in. */\nexport const define = <const Name extends string>(\n\tname: Name,\n\toptions?: { readonly format?: Format },\n): Section<Name> => {\n\tconst reason =\n\t\tinvalid(name) ??\n\t\t(builtins.some((section) => section.name === name) ? `prompt section name is built in: ${name}` : undefined);\n\tif (reason !== undefined) throw new Error(reason);\n\tconst format = options?.format ?? \"text\";\n\tif (!isFormat(format)) throw new Error(`prompt section format must be \"text\" or \"list\": ${JSON.stringify(format)}`);\n\treturn Object.freeze({ name, format });\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,QAA0B,OAAO,OAAO;CAAE,MAAM;CAAS,QAAQ;AAAO,CAAC;AACtF,MAAa,WAAgC,OAAO,OAAO;CAAE,MAAM;CAAY,QAAQ;AAAO,CAAC;AAC/F,MAAa,iBAA6C,OAAO,OAAO;CAAE,MAAM;CAAmB,QAAQ;AAAO,CAAC;AACnH,MAAa,SAA4B,OAAO,OAAO;CAAE,MAAM;CAAU,QAAQ;AAAO,CAAC;;AAGzF,MAAa,WAAmC,OAAO,OAAO;CAAC;CAAO;CAAU;CAAgB;AAAM,CAAC;;AAGvG,MAAa,2BAAgC,IAAI,IAAI;CAAC;CAAS;CAAO;CAAc;AAAY,CAAC;AAEjG,MAAM,UAAU;AAEhB,MAAM,0BAAgC,IAAI,IAAY,CAAC,QAAQ,MAAM,CAAC;;AAGtE,MAAa,YAAY,WAAsC,QAAQ,IAAI,MAAM;AAEjF,MAAa,WAAW,SAAsC;CAC7D,IAAI,OAAO,SAAS,YAAY,CAAC,QAAQ,KAAK,IAAI,GACjD,OAAO,sEAAsE,KAAK,UAAU,IAAI;CACjG,IAAI,SAAS,IAAI,IAAI,GAAG,OAAO,oCAAoC;AAEpE;;AAGA,MAAa,UACZ,MACA,YACmB;CACnB,MAAM,SACL,QAAQ,IAAI,MACX,SAAS,MAAM,YAAY,QAAQ,SAAS,IAAI,IAAI,oCAAoC,SAAS,KAAA;CACnG,IAAI,WAAW,KAAA,GAAW,MAAM,IAAI,MAAM,MAAM;CAChD,MAAM,SAAS,SAAS,UAAU;CAClC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,mDAAmD,KAAK,UAAU,MAAM,GAAG;CAClH,OAAO,OAAO,OAAO;EAAE;EAAM;CAAO,CAAC;AACtC"}
|
package/plugin/tool.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ToolAfterResult, c as ToolBeforeResult, d as ToolRegistry, f as ToolResultContent, i as ToolAfterFn, l as ToolDefPatch, n as ToolAddOptions, o as ToolBefore, r as ToolAfter, s as ToolBeforeFn, t as HookReturn, u as ToolRegistration } from "../tool-
|
|
1
|
+
import { a as ToolAfterResult, c as ToolBeforeResult, d as ToolRegistry, f as ToolResultContent, i as ToolAfterFn, l as ToolDefPatch, n as ToolAddOptions, o as ToolBefore, r as ToolAfter, s as ToolBeforeFn, t as HookReturn, u as ToolRegistration } from "../tool-C9TzQ9nG.mjs";
|
|
2
2
|
export { HookReturn, ToolAddOptions, ToolAfter, ToolAfterFn, ToolAfterResult, ToolBefore, ToolBeforeFn, ToolBeforeResult, ToolDefPatch, ToolRegistration, ToolRegistry, ToolResultContent };
|
package/plugin/tool.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { AikitToolCallTerminalPart } from "../event.mjs";
|
|
3
|
-
import { MessageID, SessionID } from "../ids.mjs";
|
|
3
|
+
import { MessageID, SessionID, ThreadID } from "../ids.mjs";
|
|
4
4
|
import { ToolCallContext } from "../tool.mjs";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
6
|
//#region src/plugin/tool.ts
|
|
@@ -12,6 +12,7 @@ var tool_exports = /* @__PURE__ */ __exportAll({
|
|
|
12
12
|
const ToolBefore = Schema.Struct({
|
|
13
13
|
...ToolCallContext.fields,
|
|
14
14
|
sessionId: SessionID,
|
|
15
|
+
threadId: ThreadID,
|
|
15
16
|
messageId: MessageID,
|
|
16
17
|
params: Schema.Unknown
|
|
17
18
|
});
|
package/plugin/tool.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.mjs","names":[],"sources":["../../../src/plugin/tool.ts"],"sourcesContent":["import { type Effect, Schema } from \"effect\";\nimport { AikitToolCallTerminalPart } from \"../event.ts\";\nimport { MessageID, SessionID } from \"../ids.ts\";\nimport { type AnyToolDef, type ModelContent, type RegisteredTool, ToolCallContext } from \"../tool.ts\";\n\nexport const ToolBefore = Schema.Struct({\n\t...ToolCallContext.fields,\n\tsessionId: SessionID,\n\tmessageId: MessageID,\n\tparams: Schema.Unknown,\n});\nexport type ToolBefore = typeof ToolBefore.Type;\nexport const ToolAfter = Schema.Struct({ ...ToolBefore.fields, terminal: AikitToolCallTerminalPart });\nexport type ToolAfter = typeof ToolAfter.Type;\nexport const ToolBeforeResult = Schema.Struct({ block: Schema.Boolean, reason: Schema.optional(Schema.String) });\nexport type ToolBeforeResult = typeof ToolBeforeResult.Type;\nexport type ToolResultContent = ModelContent;\nexport interface ToolAfterResult {\n\treadonly content?: ToolResultContent;\n\treadonly details?: unknown;\n\treadonly isError?: boolean;\n}\nexport type HookReturn<A> = A | void | Promise<A | void> | Effect.Effect<A | void, unknown>;\nexport type ToolBeforeFn = (call: ToolBefore) => HookReturn<ToolBeforeResult>;\nexport type ToolAfterFn = (call: ToolAfter) => HookReturn<ToolAfterResult>;\nexport interface ToolAddOptions {\n\treadonly beforeToolCall?: ToolBeforeFn;\n\treadonly afterToolCall?: ToolAfterFn;\n}\nexport interface ToolDefPatch {\n\treadonly description?: string;\n\treadonly label?: string;\n\treadonly promptSnippet?: string;\n\treadonly promptGuidelines?: ReadonlyArray<string>;\n}\n/**\n * One frozen bucket entry: the winning tool for a name together with the hooks that\n * `add` declared alongside it. Kept here rather than in the bucket implementation so\n * the executor shares the contract without importing plugin assembly.\n */\nexport interface ToolRegistration {\n\treadonly tool: RegisteredTool;\n\treadonly hooks: ToolAddOptions;\n}\nexport interface ToolRegistry {\n\treadonly add: (tool: RegisteredTool, options?: ToolAddOptions) => void;\n\treadonly update: (name: string, patch: ToolDefPatch) => void;\n\treadonly list: () => ReadonlyArray<AnyToolDef>;\n\treadonly get: (name: string) => AnyToolDef | undefined;\n\treadonly has: (name: string) => boolean;\n}\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,aAAa,OAAO,OAAO;CACvC,GAAG,gBAAgB;CACnB,WAAW;CACX,WAAW;CACX,QAAQ,OAAO;AAChB,CAAC;AAED,MAAa,YAAY,OAAO,OAAO;CAAE,GAAG,WAAW;CAAQ,UAAU;AAA0B,CAAC;AAEpG,MAAa,mBAAmB,OAAO,OAAO;CAAE,OAAO,OAAO;CAAS,QAAQ,OAAO,SAAS,OAAO,MAAM;AAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"tool.mjs","names":[],"sources":["../../../src/plugin/tool.ts"],"sourcesContent":["import { type Effect, Schema } from \"effect\";\nimport { AikitToolCallTerminalPart } from \"../event.ts\";\nimport { MessageID, SessionID, ThreadID } from \"../ids.ts\";\nimport { type AnyToolDef, type ModelContent, type RegisteredTool, ToolCallContext } from \"../tool.ts\";\n\nexport const ToolBefore = Schema.Struct({\n\t...ToolCallContext.fields,\n\tsessionId: SessionID,\n\tthreadId: ThreadID,\n\tmessageId: MessageID,\n\tparams: Schema.Unknown,\n});\nexport type ToolBefore = typeof ToolBefore.Type;\nexport const ToolAfter = Schema.Struct({ ...ToolBefore.fields, terminal: AikitToolCallTerminalPart });\nexport type ToolAfter = typeof ToolAfter.Type;\nexport const ToolBeforeResult = Schema.Struct({ block: Schema.Boolean, reason: Schema.optional(Schema.String) });\nexport type ToolBeforeResult = typeof ToolBeforeResult.Type;\nexport type ToolResultContent = ModelContent;\nexport interface ToolAfterResult {\n\treadonly content?: ToolResultContent;\n\treadonly details?: unknown;\n\treadonly isError?: boolean;\n}\nexport type HookReturn<A> = A | void | Promise<A | void> | Effect.Effect<A | void, unknown>;\nexport type ToolBeforeFn = (call: ToolBefore) => HookReturn<ToolBeforeResult>;\nexport type ToolAfterFn = (call: ToolAfter) => HookReturn<ToolAfterResult>;\nexport interface ToolAddOptions {\n\treadonly beforeToolCall?: ToolBeforeFn;\n\treadonly afterToolCall?: ToolAfterFn;\n}\nexport interface ToolDefPatch {\n\treadonly description?: string;\n\treadonly label?: string;\n\treadonly promptSnippet?: string;\n\treadonly promptGuidelines?: ReadonlyArray<string>;\n}\n/**\n * One frozen bucket entry: the winning tool for a name together with the hooks that\n * `add` declared alongside it. Kept here rather than in the bucket implementation so\n * the executor shares the contract without importing plugin assembly.\n */\nexport interface ToolRegistration {\n\treadonly tool: RegisteredTool;\n\treadonly hooks: ToolAddOptions;\n}\nexport interface ToolRegistry {\n\treadonly add: (tool: RegisteredTool, options?: ToolAddOptions) => void;\n\treadonly update: (name: string, patch: ToolDefPatch) => void;\n\treadonly list: () => ReadonlyArray<AnyToolDef>;\n\treadonly get: (name: string) => AnyToolDef | undefined;\n\treadonly has: (name: string) => boolean;\n}\n"],"mappings":";;;;;;;;;;;AAKA,MAAa,aAAa,OAAO,OAAO;CACvC,GAAG,gBAAgB;CACnB,WAAW;CACX,UAAU;CACV,WAAW;CACX,QAAQ,OAAO;AAChB,CAAC;AAED,MAAa,YAAY,OAAO,OAAO;CAAE,GAAG,WAAW;CAAQ,UAAU;AAA0B,CAAC;AAEpG,MAAa,mBAAmB,OAAO,OAAO;CAAE,OAAO,OAAO;CAAS,QAAQ,OAAO,SAAS,OAAO,MAAM;AAAE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { t as mcp_exports } from "./plugin/mcp.mjs";
|
|
2
3
|
import { t as prompt_exports } from "./plugin/prompt.mjs";
|
|
3
4
|
import { t as section_exports } from "./plugin/section.mjs";
|
|
4
5
|
import { t as tool_exports } from "./plugin/tool.mjs";
|
|
@@ -17,12 +18,16 @@ import { t as tool_exports } from "./plugin/tool.mjs";
|
|
|
17
18
|
* composition actually happens -- a plugin patching another's tool, or appending to the prompt a
|
|
18
19
|
* previous one rendered, is written next to it and deliberately after it.
|
|
19
20
|
*
|
|
21
|
+
* `mcp` runs first: the MCP servers a session runs are settled before any tool exists, because
|
|
22
|
+
* their tools join the tool registry before the `tool` domain starts.
|
|
23
|
+
*
|
|
20
24
|
* Kept as data so a later release can add a domain, or make the order configurable, without
|
|
21
25
|
* touching the loader: `{ tool: 1, skill: 2, prompt: 3 }` needs no code change here.
|
|
22
26
|
*/
|
|
23
27
|
const domains = {
|
|
24
|
-
|
|
25
|
-
|
|
28
|
+
mcp: 1,
|
|
29
|
+
tool: 2,
|
|
30
|
+
prompt: 3
|
|
26
31
|
};
|
|
27
32
|
/** Sort key for a plugin: its domain first, then where it was written. */
|
|
28
33
|
const rank = (kind) => domains[kind];
|
|
@@ -30,6 +35,7 @@ const define = (plugin) => plugin;
|
|
|
30
35
|
//#endregion
|
|
31
36
|
//#region src/plugin.ts
|
|
32
37
|
var plugin_exports = /* @__PURE__ */ __exportAll({
|
|
38
|
+
Mcp: () => mcp_exports,
|
|
33
39
|
Prompt: () => prompt_exports,
|
|
34
40
|
Section: () => section_exports,
|
|
35
41
|
Tool: () => tool_exports,
|
|
@@ -40,4 +46,4 @@ var plugin_exports = /* @__PURE__ */ __exportAll({
|
|
|
40
46
|
//#endregion
|
|
41
47
|
export { rank as i, define as n, domains as r, plugin_exports as t };
|
|
42
48
|
|
|
43
|
-
//# sourceMappingURL=plugin-
|
|
49
|
+
//# sourceMappingURL=plugin-C3Qy4-Yx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-C3Qy4-Yx.mjs","names":[],"sources":["../../src/plugin/plugin.ts","../../src/plugin.ts"],"sourcesContent":["import type { Effect } from \"effect\";\nimport type { Definition } from \"../event.ts\";\nimport type { Service as LocationService } from \"../location.ts\";\nimport type { SandboxIO } from \"../sandbox/io.ts\";\nimport type { SharedPluginContext } from \"./context.ts\";\nimport type { PluginOptions } from \"./ref.ts\";\n\n/**\n * The domains a plugin can extend, and the order the harness runs them in.\n *\n * Order is declared, not positional. A plugin's place used to come from where its entry sat in\n * the `plugins` array, which is unknowable when the entry is written: a user's settings file and\n * a project's are edited by different people at different times, and neither can see the other's\n * order. Since a prompt plugin indexes the tools registered before it, that made a tool added\n * from settings invisible in the system prompt, with no way to fix it from a settings file.\n *\n * A plugin instead says which domain it extends, and the harness runs the domains in this order.\n * Entries within one domain keep the order they were written in, because that is where\n * composition actually happens -- a plugin patching another's tool, or appending to the prompt a\n * previous one rendered, is written next to it and deliberately after it.\n *\n * `mcp` runs first: the MCP servers a session runs are settled before any tool exists, because\n * their tools join the tool registry before the `tool` domain starts.\n *\n * Kept as data so a later release can add a domain, or make the order configurable, without\n * touching the loader: `{ tool: 1, skill: 2, prompt: 3 }` needs no code change here.\n */\nexport const domains = { mcp: 1, tool: 2, prompt: 3 } as const;\n\nexport type PluginKind = keyof typeof domains;\n\n/** Sort key for a plugin: its domain first, then where it was written. */\nexport const rank = (kind: PluginKind) => domains[kind];\n\nexport type Mount = SandboxIO.Provides | LocationService;\nexport interface Plugin {\n\treadonly id: string;\n\t/**\n\t * The domain this plugin extends, which decides when it runs: every `mcp` plugin is set up\n\t * before any `tool` plugin, and every `tool` plugin before any `prompt` plugin, whichever\n\t * settings layer each came from, so a prompt plugin always sees the complete tool set. Plugins within one domain run in the order they were\n\t * written.\n\t */\n\treadonly kind: PluginKind;\n\t/**\n\t * Event definitions this plugin publishes. Declared rather than registered at\n\t * runtime so they are known before the event system builds, and so a bad type\n\t * fails the boot instead of the first publish. Types must be namespaced\n\t * `plugin.<id>.*`.\n\t */\n\treadonly events?: ReadonlyArray<Definition>;\n\t/**\n\t * Off until a user asks for it. An `optIn` plugin is selected like any other but runs only\n\t * when a settings entry turns it on: `{ \"plugin\": \"<id>\", \"enabled\": true }`.\n\t */\n\treadonly optIn?: boolean;\n\t/**\n\t * `options` is this plugin's own configuration block, `{}` when its entry carried none.\n\t * Unvalidated: the harness never looks inside it, so a plugin checks whatever shape it\n\t * documents. It is a second argument rather than a context field so `ctx` stays one object\n\t * shared by every plugin in the turn.\n\t */\n\treadonly setup: (\n\t\tctx: SharedPluginContext,\n\t\toptions: PluginOptions,\n\t) => void | Promise<void> | Effect.Effect<void, unknown, Mount>;\n}\n\nexport const define = (plugin: Plugin): Plugin => plugin;\n","/**\n * The plugin authoring surface.\n *\n * Everything a third-party plugin needs to describe itself and to write into the harness during\n * `setup`, and nothing about how the harness finds, installs or runs it. Loading, the store and\n * the `.npmrc` anchoring stay in `@codeworksh/harness`, which imports this same module — so a\n * plugin and its host agree on one set of types rather than two that happen to match.\n */\nexport type { Config, Events, Paths, PromptResolver, SharedPluginContext } from \"./plugin/context.ts\";\nexport { define, domains, type Mount, type Plugin, type PluginKind, rank } from \"./plugin/plugin.ts\";\nexport * as Mcp from \"./plugin/mcp.ts\";\nexport * as Prompt from \"./plugin/prompt.ts\";\nexport * as Section from \"./plugin/section.ts\";\nexport type { PluginOptions, PluginPatch, PluginRef, PluginSpec } from \"./plugin/ref.ts\";\nexport type { PluginRegistry } from \"./plugin/registry.ts\";\nexport * as Tool from \"./plugin/tool.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,UAAU;CAAE,KAAK;CAAG,MAAM;CAAG,QAAQ;AAAE;;AAKpD,MAAa,QAAQ,SAAqB,QAAQ;AAoClD,MAAa,UAAU,WAA2B"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as SessionID } from "./ids-
|
|
1
|
+
import { a as Definition, c as PublishOptions, i as Data, s as Payload } from "./event-CmzS4aGe.mjs";
|
|
2
|
+
import { n as SessionID, r as ThreadID } from "./ids-CpPeP5Ks.mjs";
|
|
3
3
|
import { o as Service, r as Info } from "./location-Q39els63.mjs";
|
|
4
4
|
import { f as io_d_exports, i as Identity, s as Provides } from "./io-Br9WZTsG.mjs";
|
|
5
|
-
import {
|
|
5
|
+
import { l as mcp_d_exports, r as McpRegistry } from "./mcp-DEWhnBQw.mjs";
|
|
6
|
+
import { i as Info$1 } from "./settings-CxiAtEXT.mjs";
|
|
6
7
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
7
8
|
import { n as prompt_d_exports, t as PromptRegistry } from "./prompt-DWaA5ZXj.mjs";
|
|
8
|
-
import { d as ToolRegistry, p as tool_d_exports } from "./tool-
|
|
9
|
+
import { d as ToolRegistry, p as tool_d_exports } from "./tool-C9TzQ9nG.mjs";
|
|
9
10
|
import { Model } from "@codeworksh/aikit";
|
|
10
11
|
import { Effect } from "effect";
|
|
11
12
|
//#region src/plugin/registry.d.ts
|
|
@@ -17,6 +18,8 @@ import { Effect } from "effect";
|
|
|
17
18
|
* effective tool catalog and the final system prompt — is the harness's job, not the contract's.
|
|
18
19
|
*/
|
|
19
20
|
interface PluginRegistry {
|
|
21
|
+
/** Writable during the `mcp` domain only; later domains read the servers it settled. */
|
|
22
|
+
readonly mcp: McpRegistry;
|
|
20
23
|
readonly tools: ToolRegistry;
|
|
21
24
|
readonly prompt: PromptRegistry;
|
|
22
25
|
}
|
|
@@ -48,9 +51,11 @@ interface Paths {
|
|
|
48
51
|
readonly data: string;
|
|
49
52
|
readonly log: string;
|
|
50
53
|
}
|
|
51
|
-
/** One object, shared by every plugin in one
|
|
54
|
+
/** One object, shared by every plugin in one turn. */
|
|
52
55
|
interface SharedPluginContext {
|
|
53
56
|
readonly sessionId: SessionID;
|
|
57
|
+
/** The thread whose turn this is. `sandbox` and `location` are its placement, else the session's. */
|
|
58
|
+
readonly threadId: ThreadID;
|
|
54
59
|
readonly sandbox: Identity;
|
|
55
60
|
readonly paths: Paths;
|
|
56
61
|
readonly location: Info;
|
|
@@ -109,23 +114,27 @@ type PluginRef = PluginSpec | PluginPatch;
|
|
|
109
114
|
* composition actually happens -- a plugin patching another's tool, or appending to the prompt a
|
|
110
115
|
* previous one rendered, is written next to it and deliberately after it.
|
|
111
116
|
*
|
|
117
|
+
* `mcp` runs first: the MCP servers a session runs are settled before any tool exists, because
|
|
118
|
+
* their tools join the tool registry before the `tool` domain starts.
|
|
119
|
+
*
|
|
112
120
|
* Kept as data so a later release can add a domain, or make the order configurable, without
|
|
113
121
|
* touching the loader: `{ tool: 1, skill: 2, prompt: 3 }` needs no code change here.
|
|
114
122
|
*/
|
|
115
123
|
declare const domains: {
|
|
116
|
-
readonly
|
|
117
|
-
readonly
|
|
124
|
+
readonly mcp: 1;
|
|
125
|
+
readonly tool: 2;
|
|
126
|
+
readonly prompt: 3;
|
|
118
127
|
};
|
|
119
128
|
type PluginKind = keyof typeof domains;
|
|
120
129
|
/** Sort key for a plugin: its domain first, then where it was written. */
|
|
121
|
-
declare const rank: (kind: PluginKind) => 1 | 2;
|
|
130
|
+
declare const rank: (kind: PluginKind) => 1 | 2 | 3;
|
|
122
131
|
type Mount = Provides | Service;
|
|
123
132
|
interface Plugin {
|
|
124
133
|
readonly id: string;
|
|
125
134
|
/**
|
|
126
|
-
* The domain this plugin extends, which decides when it runs: every `
|
|
127
|
-
* before any `
|
|
128
|
-
* always sees the complete tool set. Plugins within one domain run in the order they were
|
|
135
|
+
* The domain this plugin extends, which decides when it runs: every `mcp` plugin is set up
|
|
136
|
+
* before any `tool` plugin, and every `tool` plugin before any `prompt` plugin, whichever
|
|
137
|
+
* settings layer each came from, so a prompt plugin always sees the complete tool set. Plugins within one domain run in the order they were
|
|
129
138
|
* written.
|
|
130
139
|
*/
|
|
131
140
|
readonly kind: PluginKind;
|
|
@@ -145,14 +154,14 @@ interface Plugin {
|
|
|
145
154
|
* `options` is this plugin's own configuration block, `{}` when its entry carried none.
|
|
146
155
|
* Unvalidated: the harness never looks inside it, so a plugin checks whatever shape it
|
|
147
156
|
* documents. It is a second argument rather than a context field so `ctx` stays one object
|
|
148
|
-
* shared by every plugin in the
|
|
157
|
+
* shared by every plugin in the turn.
|
|
149
158
|
*/
|
|
150
159
|
readonly setup: (ctx: SharedPluginContext, options: PluginOptions) => void | Promise<void> | Effect.Effect<void, unknown, Mount>;
|
|
151
160
|
}
|
|
152
161
|
declare const define: (plugin: Plugin) => Plugin;
|
|
153
162
|
declare namespace plugin_d_exports {
|
|
154
|
-
export { Config, Events, Mount, Paths, Plugin, PluginKind, PluginOptions, PluginPatch, PluginRef, PluginRegistry, PluginSpec, prompt_d_exports as Prompt, PromptResolver, section_d_exports as Section, SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
|
|
163
|
+
export { Config, Events, mcp_d_exports as Mcp, Mount, Paths, Plugin, PluginKind, PluginOptions, PluginPatch, PluginRef, PluginRegistry, PluginSpec, prompt_d_exports as Prompt, PromptResolver, section_d_exports as Section, SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
|
|
155
164
|
}
|
|
156
165
|
//#endregion
|
|
157
166
|
export { PluginRegistry as _, define as a, PluginOptions as c, PluginSpec as d, Config as f, SharedPluginContext as g, PromptResolver as h, PluginKind as i, PluginPatch as l, Paths as m, Mount as n, domains as o, Events as p, Plugin as r, rank as s, plugin_d_exports as t, PluginRef as u };
|
|
158
|
-
//# sourceMappingURL=plugin-
|
|
167
|
+
//# sourceMappingURL=plugin-aMOw2zJZ.d.mts.map
|
package/plugin.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { l as mcp_d_exports } from "./mcp-DEWhnBQw.mjs";
|
|
1
2
|
import { t as section_d_exports } from "./plugin/section.mjs";
|
|
2
3
|
import { n as prompt_d_exports } from "./prompt-DWaA5ZXj.mjs";
|
|
3
|
-
import { p as tool_d_exports } from "./tool-
|
|
4
|
-
import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-
|
|
5
|
-
export { type Config, type Events, type Mount, type Paths, type Plugin, type PluginKind, type PluginOptions, type PluginPatch, type PluginRef, type PluginRegistry, type PluginSpec, prompt_d_exports as Prompt, type PromptResolver, section_d_exports as Section, type SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
|
|
4
|
+
import { p as tool_d_exports } from "./tool-C9TzQ9nG.mjs";
|
|
5
|
+
import { _ as PluginRegistry, a as define, c as PluginOptions, d as PluginSpec, f as Config, g as SharedPluginContext, h as PromptResolver, i as PluginKind, l as PluginPatch, m as Paths, n as Mount, o as domains, p as Events, r as Plugin, s as rank, u as PluginRef } from "./plugin-aMOw2zJZ.mjs";
|
|
6
|
+
export { type Config, type Events, mcp_d_exports as Mcp, type Mount, type Paths, type Plugin, type PluginKind, type PluginOptions, type PluginPatch, type PluginRef, type PluginRegistry, type PluginSpec, prompt_d_exports as Prompt, type PromptResolver, section_d_exports as Section, type SharedPluginContext, tool_d_exports as Tool, define, domains, rank };
|
package/plugin.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { i as rank, n as define, r as domains } from "./plugin-
|
|
1
|
+
import { i as rank, n as define, r as domains } from "./plugin-C3Qy4-Yx.mjs";
|
|
2
|
+
import { t as mcp_exports } from "./plugin/mcp.mjs";
|
|
2
3
|
import { t as prompt_exports } from "./plugin/prompt.mjs";
|
|
3
4
|
import { t as section_exports } from "./plugin/section.mjs";
|
|
4
5
|
import { t as tool_exports } from "./plugin/tool.mjs";
|
|
5
|
-
export { prompt_exports as Prompt, section_exports as Section, tool_exports as Tool, define, domains, rank };
|
|
6
|
+
export { mcp_exports as Mcp, prompt_exports as Prompt, section_exports as Section, tool_exports as Tool, define, domains, rank };
|
package/schema.d.mts
CHANGED
|
@@ -5,10 +5,12 @@ import { Schema } from "effect";
|
|
|
5
5
|
export declare const validateAikitMessage: (value: unknown, label: string) => Message.Message;
|
|
6
6
|
export declare const validateAikitUserMessage: (value: unknown, label: string) => Message.UserMessage;
|
|
7
7
|
export declare const validateAikitAssistantMessage: (value: unknown, label: string) => Message.AssistantMessage;
|
|
8
|
+
export declare const validateAikitAssistantPart: (value: unknown, label: string) => Message.AssistantMessage["parts"][number];
|
|
8
9
|
export declare const validateAikitToolCallTerminalPart: (value: unknown, label: string) => Message.ToolCallTerminalPart;
|
|
9
10
|
export declare const validateAikitModelInfo: (value: unknown, label: string) => Model.Info;
|
|
10
11
|
export declare const isAikitModelInfo: (value: unknown) => value is Model.Info;
|
|
11
12
|
export declare const isAikitAssistantMessage: (value: unknown) => value is Message.AssistantMessage;
|
|
13
|
+
export declare const isAikitAssistantPart: (value: unknown) => value is Message.AssistantMessage["parts"][number];
|
|
12
14
|
export declare const isAikitToolCallTerminalPart: (value: unknown) => value is Message.ToolCallTerminalPart;
|
|
13
15
|
/**
|
|
14
16
|
* Integer greater than zero.
|
package/schema.mjs
CHANGED
|
@@ -26,10 +26,12 @@ const validateAikitSchema = (schema, value, label) => {
|
|
|
26
26
|
const validateAikitMessage = (value, label) => validateAikitSchema(Message.MessageSchema, value, label);
|
|
27
27
|
const validateAikitUserMessage = (value, label) => validateAikitSchema(Message.UserMessageSchema, value, label);
|
|
28
28
|
const validateAikitAssistantMessage = (value, label) => validateAikitSchema(Message.AssistantMessageSchema, value, label);
|
|
29
|
+
const validateAikitAssistantPart = (value, label) => validateAikitSchema(Message.AssistantMessageSchema.properties.parts.items, value, label);
|
|
29
30
|
const validateAikitToolCallTerminalPart = (value, label) => validateAikitSchema(Message.ToolCallTerminalPartSchema, value, label);
|
|
30
31
|
const validateAikitModelInfo = (value, label) => validateAikitSchema(Model.Info, value, label);
|
|
31
32
|
const isAikitModelInfo = (value) => aikitValidatorFor(Model.Info).Check(value);
|
|
32
33
|
const isAikitAssistantMessage = (value) => aikitValidatorFor(Message.AssistantMessageSchema).Check(value);
|
|
34
|
+
const isAikitAssistantPart = (value) => aikitValidatorFor(Message.AssistantMessageSchema.properties.parts.items).Check(value);
|
|
33
35
|
const isAikitToolCallTerminalPart = (value) => aikitValidatorFor(Message.ToolCallTerminalPartSchema).Check(value);
|
|
34
36
|
/**
|
|
35
37
|
* Integer greater than zero.
|
|
@@ -102,6 +104,6 @@ const DateTimeUtcFromMillis = Schema.Finite.pipe(Schema.decodeTo(Schema.DateTime
|
|
|
102
104
|
encode: SchemaGetter.transform((value) => DateTime.toEpochMillis(value))
|
|
103
105
|
}));
|
|
104
106
|
//#endregion
|
|
105
|
-
export { AbsolutePath, DateTimeUtcFromMillis, Newtype, NonNegativeCost, NonNegativeInt, PositiveInt, isAikitAssistantMessage, isAikitModelInfo, isAikitToolCallTerminalPart, optional, validateAikitAssistantMessage, validateAikitMessage, validateAikitModelInfo, validateAikitToolCallTerminalPart, validateAikitUserMessage, withStatics };
|
|
107
|
+
export { AbsolutePath, DateTimeUtcFromMillis, Newtype, NonNegativeCost, NonNegativeInt, PositiveInt, isAikitAssistantMessage, isAikitAssistantPart, isAikitModelInfo, isAikitToolCallTerminalPart, optional, validateAikitAssistantMessage, validateAikitAssistantPart, validateAikitMessage, validateAikitModelInfo, validateAikitToolCallTerminalPart, validateAikitUserMessage, withStatics };
|
|
106
108
|
|
|
107
109
|
//# sourceMappingURL=schema.mjs.map
|
package/schema.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.mjs","names":[],"sources":["../../src/schema.ts"],"sourcesContent":["import { Message, Model } from \"@codeworksh/aikit\";\nimport { DateTime, Option, Schema, SchemaGetter } from \"effect\";\nimport type { Static, TSchema } from \"typebox\";\nimport TypeBoxSchema from \"typebox/schema\";\n\nconst aikitValidators = new WeakMap<TSchema, ReturnType<typeof TypeBoxSchema.Compile>>();\n\nconst aikitValidatorFor = <T extends TSchema>(schema: T): ReturnType<typeof TypeBoxSchema.Compile<T>> => {\n\tconst cached = aikitValidators.get(schema) as ReturnType<typeof TypeBoxSchema.Compile<T>> | undefined;\n\tif (cached !== undefined) return cached;\n\tconst compiled = TypeBoxSchema.Compile(schema);\n\taikitValidators.set(schema, compiled);\n\treturn compiled;\n};\n\nconst aikitErrorPath = (error: {\n\treadonly instancePath?: string;\n\treadonly params?: Record<string, unknown>;\n}): string => {\n\tif (error.instancePath) return error.instancePath.substring(1);\n\tconst required = error.params?.requiredProperties;\n\treturn Array.isArray(required) ? required.join(\", \") : \"root\";\n};\n\nconst validateAikitSchema = <T extends TSchema>(schema: T, value: unknown, label: string): Static<T> => {\n\tconst validator = aikitValidatorFor(schema);\n\tif (validator.Check(value)) return value;\n\n\tconst [, issues] = validator.Errors(value);\n\tconst details = issues.map((issue) => ` - ${aikitErrorPath(issue)}: ${issue.message}`).join(\"\\n\") || \"unknown error\";\n\tthrow new Error(`validation failed for ${label}\\n${details}`);\n};\n\n/** Validate an aikit message without coercing or rewriting durable data. */\nexport const validateAikitMessage = (value: unknown, label: string): Message.Message =>\n\tvalidateAikitSchema(Message.MessageSchema, value, label);\n\nexport const validateAikitUserMessage = (value: unknown, label: string): Message.UserMessage =>\n\tvalidateAikitSchema(Message.UserMessageSchema, value, label);\n\nexport const validateAikitAssistantMessage = (value: unknown, label: string): Message.AssistantMessage =>\n\tvalidateAikitSchema(Message.AssistantMessageSchema, value, label);\n\nexport const validateAikitToolCallTerminalPart = (value: unknown, label: string): Message.ToolCallTerminalPart =>\n\tvalidateAikitSchema(Message.ToolCallTerminalPartSchema, value, label);\n\nexport const validateAikitModelInfo = (value: unknown, label: string): Model.Info =>\n\tvalidateAikitSchema(Model.Info, value, label);\n\nexport const isAikitModelInfo = (value: unknown): value is Model.Info => aikitValidatorFor(Model.Info).Check(value);\n\nexport const isAikitAssistantMessage = (value: unknown): value is Message.AssistantMessage =>\n\taikitValidatorFor(Message.AssistantMessageSchema).Check(value);\n\nexport const isAikitToolCallTerminalPart = (value: unknown): value is Message.ToolCallTerminalPart =>\n\taikitValidatorFor(Message.ToolCallTerminalPartSchema).Check(value);\n\n/**\n * Integer greater than zero.\n */\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/**\n * Integer greater than or equal to zero.\n */\nexport const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n\n/**\n * Cost greater than or equal with finite value\n */\nexport const NonNegativeCost = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\n/**\n * Absolute POSIX file path (e.g., `/home/user/projects/myapp/src/main.ts`).\n */\nexport const AbsolutePath = Schema.String.check(Schema.isPattern(/^\\//)).pipe(Schema.brand(\"AbsolutePath\"));\nexport type AbsolutePath = Schema.Schema.Type<typeof AbsolutePath>;\n\n/**\n * Optional public JSON field that can hold explicit `undefined` on the type\n * side but encodes it as an omitted key, matching legacy `JSON.stringify`.\n */\nexport const optional = <S extends Schema.Top>(schema: S) =>\n\tSchema.optionalKey(schema).pipe(\n\t\tSchema.decodeTo(Schema.optional(Schema.toType(schema)), {\n\t\t\tdecode: SchemaGetter.passthrough({ strict: false }),\n\t\t\tencode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)),\n\t\t}),\n\t);\n\n/**\n * Strip `readonly` from a nested type. Stand-in for `effect`'s `Types.DeepMutable`\n * until `effect:core/x228my` (\"Types.DeepMutable widens unknown to `{}`\") lands.\n *\n * The upstream version falls through `unknown` into `{ -readonly [K in keyof T]: ... }`\n * where `keyof unknown = never`, so `unknown` collapses to `{}`. This local\n * version gates the object branch on `extends object` (which `unknown` does\n * not) so `unknown` passes through untouched.\n *\n * Primitive bailout matches upstream — without it, branded strings like\n * `string & Brand<\"SessionID\">` fall into the object branch and get their\n * prototype methods walked.\n *\n * Tuple branch preserves readonly tuples (e.g. `ConfigPlugin.Spec`'s\n * `readonly [string, Options]`); the general array branch would otherwise\n * widen them to unbounded arrays.\n */\nexport type DeepMutable<T> = T extends string | number | boolean | bigint | symbol | Function\n\t? T\n\t: T extends readonly [unknown, ...unknown[]]\n\t\t? { -readonly [K in keyof T]: DeepMutable<T[K]> }\n\t\t: T extends readonly (infer U)[]\n\t\t\t? DeepMutable<U>[]\n\t\t\t: T extends object\n\t\t\t\t? { -readonly [K in keyof T]: DeepMutable<T[K]> }\n\t\t\t\t: T;\n\n/**\n * Attach static methods to a schema object. Designed to be used with `.pipe()`:\n *\n * @example\n * export const Foo = fooSchema.pipe(\n * withStatics((schema) => ({\n * zero: schema.make(0),\n * from: Schema.decodeUnknownOption(schema),\n * }))\n * )\n */\nexport const withStatics =\n\t<S extends object, M extends Record<string, unknown>>(methods: (schema: S) => M) =>\n\t(schema: S): S & M =>\n\t\tObject.assign(schema, methods(schema));\n\n/**\n * Nominal wrapper for scalar types. The class itself is a valid schema —\n * pass it directly to `Schema.decode`, `Schema.decodeEffect`, etc.\n *\n * Overrides `~type.make` on the derived `Schema.Opaque` so `Schema.Schema.Type`\n * of a field using this newtype resolves to `Self` rather than the underlying\n * branded phantom. Without that override, passing a class instance to code\n * typed against `Schema.Schema.Type<FieldSchema>` would require a cast even\n * though the values are structurally equivalent at runtime.\n *\n * @example\n * class QuestionID extends Newtype<QuestionID>()(\"QuestionID\", Schema.String) {\n * static make(id: string): QuestionID {\n * return this.make(id)\n * }\n * }\n *\n * Schema.decodeEffect(QuestionID)(input)\n */\nexport function Newtype<Self>() {\n\treturn <const Tag extends string, S extends Schema.Top>(tag: Tag, schema: S) => {\n\t\tabstract class Base {\n\t\t\tdeclare readonly _newtype: Tag;\n\n\t\t\tstatic make(value: Schema.Schema.Type<S>): Self {\n\t\t\t\treturn value as unknown as Self;\n\t\t\t}\n\t\t}\n\n\t\tObject.setPrototypeOf(Base, schema);\n\n\t\treturn Base as unknown as (abstract new (_: never) => { readonly _newtype: Tag }) & {\n\t\t\treadonly make: (value: Schema.Schema.Type<S>) => Self;\n\t\t} & Omit<Schema.Opaque<Self, S, {}>, \"make\" | \"~type.make\"> & {\n\t\t\t\treadonly \"~type.make\": Self;\n\t\t\t};\n\t};\n}\n\nexport const DateTimeUtcFromMillis = Schema.Finite.pipe(\n\tSchema.decodeTo(Schema.DateTimeUtc, {\n\t\tdecode: SchemaGetter.transform((value) => DateTime.makeUnsafe(value)),\n\t\tencode: SchemaGetter.transform((value) => DateTime.toEpochMillis(value)),\n\t}),\n);\n"],"mappings":";;;;AAKA,MAAM,kCAAkB,IAAI,QAA2D;AAEvF,MAAM,qBAAwC,WAA2D;CACxG,MAAM,SAAS,gBAAgB,IAAI,MAAM;CACzC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,WAAW,cAAc,QAAQ,MAAM;CAC7C,gBAAgB,IAAI,QAAQ,QAAQ;CACpC,OAAO;AACR;AAEA,MAAM,kBAAkB,UAGV;CACb,IAAI,MAAM,cAAc,OAAO,MAAM,aAAa,UAAU,CAAC;CAC7D,MAAM,WAAW,MAAM,QAAQ;CAC/B,OAAO,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI;AACxD;AAEA,MAAM,uBAA0C,QAAW,OAAgB,UAA6B;CACvG,MAAM,YAAY,kBAAkB,MAAM;CAC1C,IAAI,UAAU,MAAM,KAAK,GAAG,OAAO;CAEnC,MAAM,GAAG,UAAU,UAAU,OAAO,KAAK;CACzC,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,eAAe,KAAK,EAAE,IAAI,MAAM,SAAS,CAAC,CAAC,KAAK,IAAI,KAAK;CACrG,MAAM,IAAI,MAAM,yBAAyB,MAAM,IAAI,SAAS;AAC7D;;AAGA,MAAa,wBAAwB,OAAgB,UACpD,oBAAoB,QAAQ,eAAe,OAAO,KAAK;AAExD,MAAa,4BAA4B,OAAgB,UACxD,oBAAoB,QAAQ,mBAAmB,OAAO,KAAK;AAE5D,MAAa,iCAAiC,OAAgB,UAC7D,oBAAoB,QAAQ,wBAAwB,OAAO,KAAK;AAEjE,MAAa,qCAAqC,OAAgB,UACjE,oBAAoB,QAAQ,4BAA4B,OAAO,KAAK;AAErE,MAAa,0BAA0B,OAAgB,UACtD,oBAAoB,MAAM,MAAM,OAAO,KAAK;AAE7C,MAAa,oBAAoB,UAAwC,kBAAkB,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK;AAElH,MAAa,2BAA2B,UACvC,kBAAkB,QAAQ,sBAAsB,CAAC,CAAC,MAAM,KAAK;AAE9D,MAAa,+BAA+B,UAC3C,kBAAkB,QAAQ,0BAA0B,CAAC,CAAC,MAAM,KAAK;;;;AAKlE,MAAa,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;;;AAKnE,MAAa,iBAAiB,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;;;AAK/E,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;;;;AAKnF,MAAa,eAAe,OAAO,OAAO,MAAM,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,cAAc,CAAC;;;;;AAO1G,MAAa,YAAkC,WAC9C,OAAO,YAAY,MAAM,CAAC,CAAC,KAC1B,OAAO,SAAS,OAAO,SAAS,OAAO,OAAO,MAAM,CAAC,GAAG;CACvD,QAAQ,aAAa,YAAY,EAAE,QAAQ,MAAM,CAAC;CAClD,QAAQ,aAAa,kBAAkB,OAAO,QAAQ,UAAU,UAAU,KAAA,CAAS,CAAC;AACrF,CAAC,CACF;;;;;;;;;;;;AAwCD,MAAa,eAC0C,aACrD,WACA,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;AAqBvC,SAAgB,UAAgB;CAC/B,QAAwD,KAAU,WAAc;EAC/E,MAAe,KAAK;GAGnB,OAAO,KAAK,OAAoC;IAC/C,OAAO;GACR;EACD;EAEA,OAAO,eAAe,MAAM,MAAM;EAElC,OAAO;CAKR;AACD;AAEA,MAAa,wBAAwB,OAAO,OAAO,KAClD,OAAO,SAAS,OAAO,aAAa;CACnC,QAAQ,aAAa,WAAW,UAAU,SAAS,WAAW,KAAK,CAAC;CACpE,QAAQ,aAAa,WAAW,UAAU,SAAS,cAAc,KAAK,CAAC;AACxE,CAAC,CACF"}
|
|
1
|
+
{"version":3,"file":"schema.mjs","names":[],"sources":["../../src/schema.ts"],"sourcesContent":["import { Message, Model } from \"@codeworksh/aikit\";\nimport { DateTime, Option, Schema, SchemaGetter } from \"effect\";\nimport type { Static, TSchema } from \"typebox\";\nimport TypeBoxSchema from \"typebox/schema\";\n\nconst aikitValidators = new WeakMap<TSchema, ReturnType<typeof TypeBoxSchema.Compile>>();\n\nconst aikitValidatorFor = <T extends TSchema>(schema: T): ReturnType<typeof TypeBoxSchema.Compile<T>> => {\n\tconst cached = aikitValidators.get(schema) as ReturnType<typeof TypeBoxSchema.Compile<T>> | undefined;\n\tif (cached !== undefined) return cached;\n\tconst compiled = TypeBoxSchema.Compile(schema);\n\taikitValidators.set(schema, compiled);\n\treturn compiled;\n};\n\nconst aikitErrorPath = (error: {\n\treadonly instancePath?: string;\n\treadonly params?: Record<string, unknown>;\n}): string => {\n\tif (error.instancePath) return error.instancePath.substring(1);\n\tconst required = error.params?.requiredProperties;\n\treturn Array.isArray(required) ? required.join(\", \") : \"root\";\n};\n\nconst validateAikitSchema = <T extends TSchema>(schema: T, value: unknown, label: string): Static<T> => {\n\tconst validator = aikitValidatorFor(schema);\n\tif (validator.Check(value)) return value;\n\n\tconst [, issues] = validator.Errors(value);\n\tconst details = issues.map((issue) => ` - ${aikitErrorPath(issue)}: ${issue.message}`).join(\"\\n\") || \"unknown error\";\n\tthrow new Error(`validation failed for ${label}\\n${details}`);\n};\n\n/** Validate an aikit message without coercing or rewriting durable data. */\nexport const validateAikitMessage = (value: unknown, label: string): Message.Message =>\n\tvalidateAikitSchema(Message.MessageSchema, value, label);\n\nexport const validateAikitUserMessage = (value: unknown, label: string): Message.UserMessage =>\n\tvalidateAikitSchema(Message.UserMessageSchema, value, label);\n\nexport const validateAikitAssistantMessage = (value: unknown, label: string): Message.AssistantMessage =>\n\tvalidateAikitSchema(Message.AssistantMessageSchema, value, label);\n\nexport const validateAikitAssistantPart = (value: unknown, label: string): Message.AssistantMessage[\"parts\"][number] =>\n\tvalidateAikitSchema(Message.AssistantMessageSchema.properties.parts.items, value, label);\n\nexport const validateAikitToolCallTerminalPart = (value: unknown, label: string): Message.ToolCallTerminalPart =>\n\tvalidateAikitSchema(Message.ToolCallTerminalPartSchema, value, label);\n\nexport const validateAikitModelInfo = (value: unknown, label: string): Model.Info =>\n\tvalidateAikitSchema(Model.Info, value, label);\n\nexport const isAikitModelInfo = (value: unknown): value is Model.Info => aikitValidatorFor(Model.Info).Check(value);\n\nexport const isAikitAssistantMessage = (value: unknown): value is Message.AssistantMessage =>\n\taikitValidatorFor(Message.AssistantMessageSchema).Check(value);\n\nexport const isAikitAssistantPart = (value: unknown): value is Message.AssistantMessage[\"parts\"][number] =>\n\taikitValidatorFor(Message.AssistantMessageSchema.properties.parts.items).Check(value);\n\nexport const isAikitToolCallTerminalPart = (value: unknown): value is Message.ToolCallTerminalPart =>\n\taikitValidatorFor(Message.ToolCallTerminalPartSchema).Check(value);\n\n/**\n * Integer greater than zero.\n */\nexport const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));\n\n/**\n * Integer greater than or equal to zero.\n */\nexport const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n\n/**\n * Cost greater than or equal with finite value\n */\nexport const NonNegativeCost = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\n/**\n * Absolute POSIX file path (e.g., `/home/user/projects/myapp/src/main.ts`).\n */\nexport const AbsolutePath = Schema.String.check(Schema.isPattern(/^\\//)).pipe(Schema.brand(\"AbsolutePath\"));\nexport type AbsolutePath = Schema.Schema.Type<typeof AbsolutePath>;\n\n/**\n * Optional public JSON field that can hold explicit `undefined` on the type\n * side but encodes it as an omitted key, matching legacy `JSON.stringify`.\n */\nexport const optional = <S extends Schema.Top>(schema: S) =>\n\tSchema.optionalKey(schema).pipe(\n\t\tSchema.decodeTo(Schema.optional(Schema.toType(schema)), {\n\t\t\tdecode: SchemaGetter.passthrough({ strict: false }),\n\t\t\tencode: SchemaGetter.transformOptional(Option.filter((value) => value !== undefined)),\n\t\t}),\n\t);\n\n/**\n * Strip `readonly` from a nested type. Stand-in for `effect`'s `Types.DeepMutable`\n * until `effect:core/x228my` (\"Types.DeepMutable widens unknown to `{}`\") lands.\n *\n * The upstream version falls through `unknown` into `{ -readonly [K in keyof T]: ... }`\n * where `keyof unknown = never`, so `unknown` collapses to `{}`. This local\n * version gates the object branch on `extends object` (which `unknown` does\n * not) so `unknown` passes through untouched.\n *\n * Primitive bailout matches upstream — without it, branded strings like\n * `string & Brand<\"SessionID\">` fall into the object branch and get their\n * prototype methods walked.\n *\n * Tuple branch preserves readonly tuples (e.g. `ConfigPlugin.Spec`'s\n * `readonly [string, Options]`); the general array branch would otherwise\n * widen them to unbounded arrays.\n */\nexport type DeepMutable<T> = T extends string | number | boolean | bigint | symbol | Function\n\t? T\n\t: T extends readonly [unknown, ...unknown[]]\n\t\t? { -readonly [K in keyof T]: DeepMutable<T[K]> }\n\t\t: T extends readonly (infer U)[]\n\t\t\t? DeepMutable<U>[]\n\t\t\t: T extends object\n\t\t\t\t? { -readonly [K in keyof T]: DeepMutable<T[K]> }\n\t\t\t\t: T;\n\n/**\n * Attach static methods to a schema object. Designed to be used with `.pipe()`:\n *\n * @example\n * export const Foo = fooSchema.pipe(\n * withStatics((schema) => ({\n * zero: schema.make(0),\n * from: Schema.decodeUnknownOption(schema),\n * }))\n * )\n */\nexport const withStatics =\n\t<S extends object, M extends Record<string, unknown>>(methods: (schema: S) => M) =>\n\t(schema: S): S & M =>\n\t\tObject.assign(schema, methods(schema));\n\n/**\n * Nominal wrapper for scalar types. The class itself is a valid schema —\n * pass it directly to `Schema.decode`, `Schema.decodeEffect`, etc.\n *\n * Overrides `~type.make` on the derived `Schema.Opaque` so `Schema.Schema.Type`\n * of a field using this newtype resolves to `Self` rather than the underlying\n * branded phantom. Without that override, passing a class instance to code\n * typed against `Schema.Schema.Type<FieldSchema>` would require a cast even\n * though the values are structurally equivalent at runtime.\n *\n * @example\n * class QuestionID extends Newtype<QuestionID>()(\"QuestionID\", Schema.String) {\n * static make(id: string): QuestionID {\n * return this.make(id)\n * }\n * }\n *\n * Schema.decodeEffect(QuestionID)(input)\n */\nexport function Newtype<Self>() {\n\treturn <const Tag extends string, S extends Schema.Top>(tag: Tag, schema: S) => {\n\t\tabstract class Base {\n\t\t\tdeclare readonly _newtype: Tag;\n\n\t\t\tstatic make(value: Schema.Schema.Type<S>): Self {\n\t\t\t\treturn value as unknown as Self;\n\t\t\t}\n\t\t}\n\n\t\tObject.setPrototypeOf(Base, schema);\n\n\t\treturn Base as unknown as (abstract new (_: never) => { readonly _newtype: Tag }) & {\n\t\t\treadonly make: (value: Schema.Schema.Type<S>) => Self;\n\t\t} & Omit<Schema.Opaque<Self, S, {}>, \"make\" | \"~type.make\"> & {\n\t\t\t\treadonly \"~type.make\": Self;\n\t\t\t};\n\t};\n}\n\nexport const DateTimeUtcFromMillis = Schema.Finite.pipe(\n\tSchema.decodeTo(Schema.DateTimeUtc, {\n\t\tdecode: SchemaGetter.transform((value) => DateTime.makeUnsafe(value)),\n\t\tencode: SchemaGetter.transform((value) => DateTime.toEpochMillis(value)),\n\t}),\n);\n"],"mappings":";;;;AAKA,MAAM,kCAAkB,IAAI,QAA2D;AAEvF,MAAM,qBAAwC,WAA2D;CACxG,MAAM,SAAS,gBAAgB,IAAI,MAAM;CACzC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,WAAW,cAAc,QAAQ,MAAM;CAC7C,gBAAgB,IAAI,QAAQ,QAAQ;CACpC,OAAO;AACR;AAEA,MAAM,kBAAkB,UAGV;CACb,IAAI,MAAM,cAAc,OAAO,MAAM,aAAa,UAAU,CAAC;CAC7D,MAAM,WAAW,MAAM,QAAQ;CAC/B,OAAO,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK,IAAI,IAAI;AACxD;AAEA,MAAM,uBAA0C,QAAW,OAAgB,UAA6B;CACvG,MAAM,YAAY,kBAAkB,MAAM;CAC1C,IAAI,UAAU,MAAM,KAAK,GAAG,OAAO;CAEnC,MAAM,GAAG,UAAU,UAAU,OAAO,KAAK;CACzC,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,eAAe,KAAK,EAAE,IAAI,MAAM,SAAS,CAAC,CAAC,KAAK,IAAI,KAAK;CACrG,MAAM,IAAI,MAAM,yBAAyB,MAAM,IAAI,SAAS;AAC7D;;AAGA,MAAa,wBAAwB,OAAgB,UACpD,oBAAoB,QAAQ,eAAe,OAAO,KAAK;AAExD,MAAa,4BAA4B,OAAgB,UACxD,oBAAoB,QAAQ,mBAAmB,OAAO,KAAK;AAE5D,MAAa,iCAAiC,OAAgB,UAC7D,oBAAoB,QAAQ,wBAAwB,OAAO,KAAK;AAEjE,MAAa,8BAA8B,OAAgB,UAC1D,oBAAoB,QAAQ,uBAAuB,WAAW,MAAM,OAAO,OAAO,KAAK;AAExF,MAAa,qCAAqC,OAAgB,UACjE,oBAAoB,QAAQ,4BAA4B,OAAO,KAAK;AAErE,MAAa,0BAA0B,OAAgB,UACtD,oBAAoB,MAAM,MAAM,OAAO,KAAK;AAE7C,MAAa,oBAAoB,UAAwC,kBAAkB,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK;AAElH,MAAa,2BAA2B,UACvC,kBAAkB,QAAQ,sBAAsB,CAAC,CAAC,MAAM,KAAK;AAE9D,MAAa,wBAAwB,UACpC,kBAAkB,QAAQ,uBAAuB,WAAW,MAAM,KAAK,CAAC,CAAC,MAAM,KAAK;AAErF,MAAa,+BAA+B,UAC3C,kBAAkB,QAAQ,0BAA0B,CAAC,CAAC,MAAM,KAAK;;;;AAKlE,MAAa,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;;;AAKnE,MAAa,iBAAiB,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;;;AAK/E,MAAa,kBAAkB,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;;;;AAKnF,MAAa,eAAe,OAAO,OAAO,MAAM,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,cAAc,CAAC;;;;;AAO1G,MAAa,YAAkC,WAC9C,OAAO,YAAY,MAAM,CAAC,CAAC,KAC1B,OAAO,SAAS,OAAO,SAAS,OAAO,OAAO,MAAM,CAAC,GAAG;CACvD,QAAQ,aAAa,YAAY,EAAE,QAAQ,MAAM,CAAC;CAClD,QAAQ,aAAa,kBAAkB,OAAO,QAAQ,UAAU,UAAU,KAAA,CAAS,CAAC;AACrF,CAAC,CACF;;;;;;;;;;;;AAwCD,MAAa,eAC0C,aACrD,WACA,OAAO,OAAO,QAAQ,QAAQ,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;AAqBvC,SAAgB,UAAgB;CAC/B,QAAwD,KAAU,WAAc;EAC/E,MAAe,KAAK;GAGnB,OAAO,KAAK,OAAoC;IAC/C,OAAO;GACR;EACD;EAEA,OAAO,eAAe,MAAM,MAAM;EAElC,OAAO;CAKR;AACD;AAEA,MAAa,wBAAwB,OAAO,OAAO,KAClD,OAAO,SAAS,OAAO,aAAa;CACnC,QAAQ,aAAa,WAAW,UAAU,SAAS,WAAW,KAAK,CAAC;CACpE,QAAQ,aAAa,WAAW,UAAU,SAAS,cAAc,KAAK,CAAC;AACxE,CAAC,CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { o as ServerConfig } from "./mcp-DEWhnBQw.mjs";
|
|
1
2
|
import { Model } from "@codeworksh/aikit";
|
|
2
3
|
import { Schema } from "effect";
|
|
3
4
|
//#region src/settings.d.ts
|
|
@@ -106,6 +107,7 @@ declare const ModelEntry: Schema.decodeTo<Schema.declare<{
|
|
|
106
107
|
supportsThinkingLevel?: boolean;
|
|
107
108
|
supportsToolSearch?: boolean;
|
|
108
109
|
supportsAdditionalTools?: boolean;
|
|
110
|
+
supportsMidConvoSystemMessages?: boolean;
|
|
109
111
|
supportsStrictMode?: boolean;
|
|
110
112
|
supportsOpenAIGrammarTools?: boolean;
|
|
111
113
|
supportsThinkingTokenBudget?: boolean;
|
|
@@ -187,6 +189,7 @@ declare const ModelEntry: Schema.decodeTo<Schema.declare<{
|
|
|
187
189
|
supportsThinkingLevel?: boolean;
|
|
188
190
|
supportsToolSearch?: boolean;
|
|
189
191
|
supportsAdditionalTools?: boolean;
|
|
192
|
+
supportsMidConvoSystemMessages?: boolean;
|
|
190
193
|
supportsStrictMode?: boolean;
|
|
191
194
|
supportsOpenAIGrammarTools?: boolean;
|
|
192
195
|
supportsThinkingTokenBudget?: boolean;
|
|
@@ -365,6 +368,7 @@ declare const Patch: Schema.Struct<{
|
|
|
365
368
|
supportsThinkingLevel?: boolean;
|
|
366
369
|
supportsToolSearch?: boolean;
|
|
367
370
|
supportsAdditionalTools?: boolean;
|
|
371
|
+
supportsMidConvoSystemMessages?: boolean;
|
|
368
372
|
supportsStrictMode?: boolean;
|
|
369
373
|
supportsOpenAIGrammarTools?: boolean;
|
|
370
374
|
supportsThinkingTokenBudget?: boolean;
|
|
@@ -446,6 +450,7 @@ declare const Patch: Schema.Struct<{
|
|
|
446
450
|
supportsThinkingLevel?: boolean;
|
|
447
451
|
supportsToolSearch?: boolean;
|
|
448
452
|
supportsAdditionalTools?: boolean;
|
|
453
|
+
supportsMidConvoSystemMessages?: boolean;
|
|
449
454
|
supportsStrictMode?: boolean;
|
|
450
455
|
supportsOpenAIGrammarTools?: boolean;
|
|
451
456
|
supportsThinkingTokenBudget?: boolean;
|
|
@@ -560,6 +565,20 @@ interface DeclaredModel {
|
|
|
560
565
|
readonly entry: Model.Info;
|
|
561
566
|
readonly file: string;
|
|
562
567
|
}
|
|
568
|
+
/** One server from an `mcp.json`, and the file that defined it. */
|
|
569
|
+
interface McpServer {
|
|
570
|
+
readonly name: string;
|
|
571
|
+
readonly config: ServerConfig;
|
|
572
|
+
readonly file: string;
|
|
573
|
+
/** The project `mcp.json` whose entry overrides this user server's `enabled` or exposure. */
|
|
574
|
+
readonly override?: string;
|
|
575
|
+
}
|
|
576
|
+
/** The `mcp.json` layers: the user file, then the project's, whose entries replace same-named ones. */
|
|
577
|
+
interface McpSettings {
|
|
578
|
+
readonly servers: ReadonlyArray<McpServer>;
|
|
579
|
+
/** Files and entries that could not be used. Each is skipped; everything else still loads. */
|
|
580
|
+
readonly errors: ReadonlyArray<string>;
|
|
581
|
+
}
|
|
563
582
|
interface Info {
|
|
564
583
|
/**
|
|
565
584
|
* Plugin entries added to the harness selection, in order: every layer's entries, lowest
|
|
@@ -583,9 +602,10 @@ interface Info {
|
|
|
583
602
|
readonly toolExecution: ToolExecution;
|
|
584
603
|
};
|
|
585
604
|
readonly retry: RetryPolicy;
|
|
605
|
+
readonly mcp: McpSettings;
|
|
586
606
|
}
|
|
587
607
|
/** Let aikit supply model-aware generation defaults. */
|
|
588
608
|
declare const defaults: Info;
|
|
589
609
|
//#endregion
|
|
590
|
-
export {
|
|
591
|
-
//# sourceMappingURL=settings-
|
|
610
|
+
export { ToolExecution as _, KeyReference as a, requestFields as b, Model$1 as c, Patch as d, PluginEntry as f, ThinkingLevel as g, RetryPolicy as h, Info as i, ModelEntry as l, Retry as m, Declared as n, McpServer as o, PluginPatch as p, DeclaredModel as r, McpSettings as s, Block as t, ModelProtocol as u, defaults as v, keyName as y };
|
|
611
|
+
//# sourceMappingURL=settings-CxiAtEXT.d.mts.map
|
package/settings.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { Block, Declared, DeclaredModel, Info, KeyReference, Model, ModelEntry, ModelProtocol, Patch, PluginEntry, PluginPatch, Retry, RetryPolicy, ThinkingLevel, ToolExecution, defaults, keyName, requestFields };
|
|
1
|
+
import { _ as ToolExecution, a as KeyReference, b as requestFields, c as Model, d as Patch, f as PluginEntry, g as ThinkingLevel, h as RetryPolicy, i as Info, l as ModelEntry, m as Retry, n as Declared, o as McpServer, p as PluginPatch, r as DeclaredModel, s as McpSettings, t as Block, u as ModelProtocol, v as defaults, y as keyName } from "./settings-CxiAtEXT.mjs";
|
|
2
|
+
export { Block, Declared, DeclaredModel, Info, KeyReference, McpServer, McpSettings, Model, ModelEntry, ModelProtocol, Patch, PluginEntry, PluginPatch, Retry, RetryPolicy, ThinkingLevel, ToolExecution, defaults, keyName, requestFields };
|