@intentic/extension-manifest 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 +9 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/manifest.d.ts +6 -0
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +38 -3
- package/dist/manifest.js.map +1 -1
- package/dist/meaning.d.ts +21 -0
- package/dist/meaning.d.ts.map +1 -0
- package/dist/meaning.js +127 -0
- package/dist/meaning.js.map +1 -0
- package/dist/points/agent.d.ts +1 -1
- package/dist/points/agent.d.ts.map +1 -1
- package/dist/points/agent.js +3 -2
- package/dist/points/agent.js.map +1 -1
- package/dist/points/bin.d.ts.map +1 -1
- package/dist/points/bin.js +2 -1
- package/dist/points/bin.js.map +1 -1
- package/dist/points/capabilities.d.ts +5 -0
- package/dist/points/capabilities.d.ts.map +1 -1
- package/dist/points/capabilities.js +54 -7
- package/dist/points/capabilities.js.map +1 -1
- package/dist/points/commands.d.ts.map +1 -1
- package/dist/points/commands.js +4 -2
- package/dist/points/commands.js.map +1 -1
- package/dist/points/documents.d.ts.map +1 -1
- package/dist/points/documents.js +2 -1
- package/dist/points/documents.js.map +1 -1
- package/dist/points/environment.d.ts.map +1 -1
- package/dist/points/environment.js +2 -1
- package/dist/points/environment.js.map +1 -1
- package/dist/points/files.d.ts.map +1 -1
- package/dist/points/files.js +2 -1
- package/dist/points/files.js.map +1 -1
- package/dist/points/index.d.ts +17 -1
- package/dist/points/index.d.ts.map +1 -1
- package/dist/points/index.js +3 -0
- package/dist/points/index.js.map +1 -1
- package/dist/points/listener.d.ts.map +1 -1
- package/dist/points/listener.js +2 -1
- package/dist/points/listener.js.map +1 -1
- package/dist/points/processes.d.ts.map +1 -1
- package/dist/points/processes.js +2 -1
- package/dist/points/processes.js.map +1 -1
- package/dist/points/settings.d.ts.map +1 -1
- package/dist/points/settings.js +2 -1
- package/dist/points/settings.js.map +1 -1
- package/dist/points/tools.d.ts +18 -0
- package/dist/points/tools.d.ts.map +1 -0
- package/dist/points/tools.js +31 -0
- package/dist/points/tools.js.map +1 -0
- package/dist/points/viewers.d.ts.map +1 -1
- package/dist/points/viewers.js +2 -1
- package/dist/points/viewers.js.map +1 -1
- package/dist/points/views.d.ts.map +1 -1
- package/dist/points/views.js +4 -2
- package/dist/points/views.js.map +1 -1
- package/dist/powers-diff.d.ts +1 -1
- package/dist/powers-diff.d.ts.map +1 -1
- package/dist/powers-diff.js +6 -56
- package/dist/powers-diff.js.map +1 -1
- package/dist/tool-servers.d.ts +19 -0
- package/dist/tool-servers.d.ts.map +1 -0
- package/dist/tool-servers.js +21 -0
- package/dist/tool-servers.js.map +1 -0
- package/intentic-extension.schema.json +123 -6
- package/package.json +4 -4
- package/src/index.ts +2 -0
- package/src/manifest.ts +40 -3
- package/src/meaning.ts +189 -0
- package/src/points/agent.ts +5 -3
- package/src/points/bin.ts +2 -1
- package/src/points/capabilities.ts +72 -14
- package/src/points/commands.ts +4 -2
- package/src/points/documents.ts +2 -1
- package/src/points/environment.ts +2 -1
- package/src/points/files.ts +2 -1
- package/src/points/index.ts +3 -0
- package/src/points/listener.ts +2 -1
- package/src/points/processes.ts +2 -1
- package/src/points/settings.ts +2 -1
- package/src/points/tools.ts +48 -0
- package/src/points/viewers.ts +2 -1
- package/src/points/views.ts +4 -2
- package/src/powers-diff.ts +9 -60
- package/src/tool-servers.ts +50 -0
package/README.md
CHANGED
|
@@ -18,7 +18,14 @@ flowchart LR
|
|
|
18
18
|
editor's `manifest-schema.test.ts` fails when either copy is stale.
|
|
19
19
|
- `sandboxRouteAllowed` is the permission rule: an entry is `"<METHOD> <path-glob>"`, and each `*` matches one path
|
|
20
20
|
segment.
|
|
21
|
-
-
|
|
21
|
+
- What a field MEANS to the host is declared on the field, with `.meta({ power, effect, mintsServer })`
|
|
22
|
+
(`meaning.ts`), and read from there: the powers `diffPowers` folds a manifest into (so an update re-asks only
|
|
23
|
+
when it adds one), the effects a card discloses in the capability catalog, and the capability kinds whose ids
|
|
24
|
+
become `mcp__<id>__` servers in the contract's reserved-name check. A new field is either given a meaning where it
|
|
25
|
+
is defined or has none.
|
|
26
|
+
- `toolServersOf` is the one reading of which MCP servers a manifest serves the agent: `contributes.tools`, or a cli
|
|
27
|
+
card's `mcp`, its alias for one release. A `superRefine` on the envelope says what no single field can: tools need
|
|
28
|
+
a `server` bundle or a declared process to serve them.
|
|
22
29
|
- `HOST_PUBLISHED_SPECIFIERS` lists the only bare imports a published bundle may use: the modules the shell's import
|
|
23
30
|
map provides.
|
|
24
31
|
|
|
@@ -27,8 +34,8 @@ flowchart LR
|
|
|
27
34
|
- [src/manifest.ts](src/manifest.ts) — `ExtensionManifestSchema`, the envelope.
|
|
28
35
|
- [src/points/index.ts](src/points/index.ts) — every contribution point, assembled into `contributes`.
|
|
29
36
|
- [src/permissions.ts](src/permissions.ts) — the sandbox-route allowlist rule.
|
|
37
|
+
- [src/meaning.ts](src/meaning.ts) — the meaning a field declares, and the walk that reads it off a manifest.
|
|
30
38
|
- [src/powers-diff.ts](src/powers-diff.ts) — what an update asks for, as set arithmetic over powers.
|
|
31
|
-
- [src/bundle.ts](src/bundle.ts) — which imports a published bundle may name.
|
|
32
39
|
- [intentic-extension.schema.json](intentic-extension.schema.json) — the generated authoring schema.
|
|
33
40
|
|
|
34
41
|
## Commands
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ export * from "./bundle.js";
|
|
|
2
2
|
export * from "./contribution-point.js";
|
|
3
3
|
export * from "./json-schema.js";
|
|
4
4
|
export * from "./manifest.js";
|
|
5
|
+
export * from "./meaning.js";
|
|
5
6
|
export * from "./permissions.js";
|
|
6
7
|
export * from "./points/index.js";
|
|
7
8
|
export * from "./powers-diff.js";
|
|
9
|
+
export * from "./tool-servers.js";
|
|
8
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,9 @@ export * from "./bundle.js";
|
|
|
2
2
|
export * from "./contribution-point.js";
|
|
3
3
|
export * from "./json-schema.js";
|
|
4
4
|
export * from "./manifest.js";
|
|
5
|
+
export * from "./meaning.js";
|
|
5
6
|
export * from "./permissions.js";
|
|
6
7
|
export * from "./points/index.js";
|
|
7
8
|
export * from "./powers-diff.js";
|
|
9
|
+
export * from "./tool-servers.js";
|
|
8
10
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
107
107
|
identity: z.ZodOptional<z.ZodString>;
|
|
108
108
|
insecure: z.ZodOptional<z.ZodBoolean>;
|
|
109
109
|
}, z.core.$strip>>;
|
|
110
|
+
mcp: z.ZodOptional<z.ZodString>;
|
|
110
111
|
}, z.core.$strip>, z.ZodObject<{
|
|
111
112
|
id: z.ZodString;
|
|
112
113
|
catalog: z.ZodObject<{
|
|
@@ -348,6 +349,11 @@ export declare const ExtensionManifestSchema: z.ZodObject<{
|
|
|
348
349
|
secret: z.ZodOptional<z.ZodBoolean>;
|
|
349
350
|
env: z.ZodOptional<z.ZodString>;
|
|
350
351
|
}, z.core.$strip>>>;
|
|
352
|
+
tools: z.ZodOptional<z.ZodObject<{
|
|
353
|
+
perCard: z.ZodOptional<z.ZodString>;
|
|
354
|
+
process: z.ZodOptional<z.ZodString>;
|
|
355
|
+
path: z.ZodOptional<z.ZodString>;
|
|
356
|
+
}, z.core.$strip>>;
|
|
351
357
|
viewers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
352
358
|
id: z.ZodString;
|
|
353
359
|
extensions: z.ZodArray<z.ZodString>;
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA0GxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyC,CAAC;AAC9E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE,eAAO,MAAM,aAAa,aAAc,IAAI,CAAC,iBAAiB,EAAE,WAAW,GAAG,MAAM,CAAC,KAAG,MAAkD,CAAC"}
|
package/dist/manifest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { MARK_FIELDS } from "./mark.js";
|
|
3
3
|
import { contributesSchema } from "./points/index.js";
|
|
4
|
-
|
|
4
|
+
const ManifestShape = z.object({
|
|
5
5
|
$schema: z.string().optional().describe("The authoring schema, for editor completion and validation. Nothing at runtime reads it."),
|
|
6
6
|
publisher: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
7
7
|
name: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
|
|
@@ -19,22 +19,24 @@ export const ExtensionManifestSchema = z.object({
|
|
|
19
19
|
.string()
|
|
20
20
|
.min(1)
|
|
21
21
|
.refine((value) => !value.split("/").includes(".."), { message: "entry must stay inside the checkout" })
|
|
22
|
+
.meta({ power: { key: "entry", sentence: "runs a UI bundle in your browser" } })
|
|
22
23
|
.optional()
|
|
23
24
|
.describe("Repo-relative path of your prebuilt single-file ESM bundle, built with `vue` and `@intentic/extension-api` as externals. Absent ⇒ an extension with no UI."),
|
|
24
25
|
server: z
|
|
25
26
|
.string()
|
|
26
27
|
.min(1)
|
|
27
28
|
.refine((value) => !value.split("/").includes(".."), { message: "server must stay inside the checkout" })
|
|
29
|
+
.meta({ power: { key: "server", sentence: "runs a backend bundle inside the daemon's extension host" } })
|
|
28
30
|
.optional()
|
|
29
31
|
.describe("Repo-relative path of your prebuilt single-file node ESM server bundle, exporting `activateServer`. Served under your own route namespace, which the daemon proxies. Nothing is provided at runtime but node builtins, so bundle everything else in. Absent ⇒ no backend."),
|
|
30
32
|
permissions: z
|
|
31
33
|
.object({
|
|
32
34
|
sandbox: z
|
|
33
|
-
.array(z.string())
|
|
35
|
+
.array(z.string().meta({ power: { key: "sandbox:${value}", sentence: "its UI calls the sandbox route ${value}" } }))
|
|
34
36
|
.optional()
|
|
35
37
|
.describe("Daemon routes your UI half may call. Your own backend namespace needs no entry: its backend is your own code."),
|
|
36
38
|
daemon: z
|
|
37
|
-
.array(z.string())
|
|
39
|
+
.array(z.string().meta({ power: { key: "daemon:${value}", sentence: "its backend calls the daemon route ${value}" } }))
|
|
38
40
|
.optional()
|
|
39
41
|
.describe("Daemon routes your SERVER half may call. Separate from `sandbox` because the two halves run as different principals: the UI as the owner's session, the backend as a minted per-extension token, so a grant to one must never quietly widen the other."),
|
|
40
42
|
})
|
|
@@ -42,5 +44,38 @@ export const ExtensionManifestSchema = z.object({
|
|
|
42
44
|
.describe('How far this extension may reach into the daemon, as "<METHOD> <path-glob>" entries where `*` matches one path segment: e.g. "GET /panels", "POST /panels/*/start". The install dialog shows these, the host refuses anything undeclared, and the usage ledger records which were actually earned.'),
|
|
43
45
|
contributes: contributesSchema.optional(),
|
|
44
46
|
});
|
|
47
|
+
const servedTools = (manifest, ctx) => {
|
|
48
|
+
const contributes = manifest.contributes;
|
|
49
|
+
const tools = contributes?.tools;
|
|
50
|
+
const cards = contributes?.capabilities ?? [];
|
|
51
|
+
for (const card of cards) {
|
|
52
|
+
if (card.kind === "cli" && card.mcp !== undefined && manifest.server === undefined) {
|
|
53
|
+
ctx.addIssue({ code: "custom", path: ["contributes", "capabilities"], message: `card "${card.id}" declares \`mcp\`, which only a \`server\` bundle can answer` });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (tools === undefined) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (tools.process !== undefined) {
|
|
60
|
+
const process = contributes?.processes?.find((entry) => entry.name === tools.process);
|
|
61
|
+
if (process?.port !== "auto") {
|
|
62
|
+
ctx.addIssue({
|
|
63
|
+
code: "custom",
|
|
64
|
+
path: ["contributes", "tools", "process"],
|
|
65
|
+
message: `tools.process must name a process in contributes.processes declared with port: "auto"`,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (tools.path === undefined) {
|
|
69
|
+
ctx.addIssue({ code: "custom", path: ["contributes", "tools", "path"], message: "tools served by a process need the path its MCP endpoint answers at" });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else if (manifest.server === undefined) {
|
|
73
|
+
ctx.addIssue({ code: "custom", path: ["contributes", "tools"], message: "tools need a `server` bundle to serve them, or a `process` that does" });
|
|
74
|
+
}
|
|
75
|
+
if (tools.perCard !== undefined && !cards.some((card) => card.kind === "cli" && card.id === tools.perCard)) {
|
|
76
|
+
ctx.addIssue({ code: "custom", path: ["contributes", "tools", "perCard"], message: `tools.perCard must name one of this extension's cli cards` });
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export const ExtensionManifestSchema = ManifestShape.superRefine(servedTools);
|
|
45
80
|
export const extensionIdOf = (manifest) => `${manifest.publisher}.${manifest.name}`;
|
|
46
81
|
//# sourceMappingURL=manifest.js.map
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMtD,MAAM,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAMtD,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IAE3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0FAA0F,CAAC;IACnI,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC;IACnD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,CAAC;IAE9C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qGAAqG,CAAC;IAE1I,QAAQ,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACL,6NAA6N,CAChO;IAEL,GAAG,WAAW;IAEd,OAAO,EAAE,CAAC;SACL,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACvC,QAAQ,CAAC,8FA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only sentence: string;
|
|
5
|
+
}
|
|
6
|
+
export type EffectMeaning = "mcp" | "image" | "process";
|
|
7
|
+
export interface FieldMeaning {
|
|
8
|
+
readonly power?: PowerMeaning;
|
|
9
|
+
readonly effect?: EffectMeaning;
|
|
10
|
+
readonly mintsServer?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface Unwrapped {
|
|
13
|
+
readonly schema: z.ZodType;
|
|
14
|
+
readonly meaning: FieldMeaning;
|
|
15
|
+
}
|
|
16
|
+
export declare const unwrapMeaning: (schema: z.ZodType) => Unwrapped;
|
|
17
|
+
export declare const fillTemplate: (template: string, context: Record<string, unknown>) => string;
|
|
18
|
+
export declare const walkMeaning: (schema: z.ZodType, value: unknown, visit: (meaning: FieldMeaning, context: Record<string, unknown>) => void, parent?: Record<string, unknown>) => void;
|
|
19
|
+
export declare const fieldMeanings: (schema: z.ZodType) => Map<string, FieldMeaning>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=meaning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meaning.d.ts","sourceRoot":"","sources":["../src/meaning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAU7B,MAAM,WAAW,YAAY;IAEzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC7B;AAGD,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;AAExD,MAAM,WAAW,YAAY;IAEzB,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAEhC,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAClC;AAWD,UAAU,SAAS;IACf,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;CAClC;AAGD,eAAO,MAAM,aAAa,WAAY,CAAC,CAAC,OAAO,KAAG,SAejD,CAAC;AAiCF,eAAO,MAAM,YAAY,aAAc,MAAM,WAAW,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,MA6BjF,CAAC;AAmBF,eAAO,MAAM,WAAW,WACZ,CAAC,CAAC,OAAO,SACV,OAAO,SACP,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,WAChE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAChC,IA8BF,CAAC;AAIF,eAAO,MAAM,aAAa,WAAY,CAAC,CAAC,OAAO,KAAG,GAAG,CAAC,MAAM,EAAE,YAAY,CAUzE,CAAC"}
|
package/dist/meaning.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const readMeta = (schema) => {
|
|
2
|
+
const { power, effect, mintsServer } = (schema.meta() ?? {});
|
|
3
|
+
return { ...(power === undefined ? {} : { power }), ...(effect === undefined ? {} : { effect }), ...(mintsServer === undefined ? {} : { mintsServer }) };
|
|
4
|
+
};
|
|
5
|
+
const WRAPPERS = new Set(["optional", "nullable", "default", "prefault", "readonly", "nonoptional", "catch"]);
|
|
6
|
+
export const unwrapMeaning = (schema) => {
|
|
7
|
+
let current = schema;
|
|
8
|
+
const met = [];
|
|
9
|
+
for (;;) {
|
|
10
|
+
met.unshift(readMeta(current));
|
|
11
|
+
const def = current._zod.def;
|
|
12
|
+
if (WRAPPERS.has(def.type) && def.innerType !== undefined) {
|
|
13
|
+
current = def.innerType;
|
|
14
|
+
}
|
|
15
|
+
else if (def.type === "pipe" && def.in !== undefined) {
|
|
16
|
+
current = def.in;
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return { schema: current, meaning: Object.assign({}, ...met) };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24
|
+
const lookup = (context, path) => path.split(".").reduce((at, part) => (isRecord(at) ? at[part] : undefined), context);
|
|
25
|
+
const present = (value) => value !== undefined && value !== null && value !== false && value !== "";
|
|
26
|
+
const holesOf = (template) => {
|
|
27
|
+
const holes = [];
|
|
28
|
+
for (let at = template.indexOf("${"); at !== -1; at = template.indexOf("${", at)) {
|
|
29
|
+
let depth = 0;
|
|
30
|
+
let close = -1;
|
|
31
|
+
for (let i = at + 1; i < template.length; i++) {
|
|
32
|
+
if (template[i] === "{") {
|
|
33
|
+
depth++;
|
|
34
|
+
}
|
|
35
|
+
else if (template[i] === "}" && --depth === 0) {
|
|
36
|
+
close = i;
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (close === -1) {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
holes.push({ start: at, end: close + 1, body: template.slice(at + 2, close) });
|
|
44
|
+
at = close + 1;
|
|
45
|
+
}
|
|
46
|
+
return holes;
|
|
47
|
+
};
|
|
48
|
+
export const fillTemplate = (template, context) => {
|
|
49
|
+
let filled = "";
|
|
50
|
+
let from = 0;
|
|
51
|
+
for (const hole of holesOf(template)) {
|
|
52
|
+
filled += template.slice(from, hole.start);
|
|
53
|
+
from = hole.end;
|
|
54
|
+
const choice = /^([\w.]+)\?([\s\S]*)$/u.exec(hole.body);
|
|
55
|
+
if (choice !== null) {
|
|
56
|
+
const branches = choice[2] ?? "";
|
|
57
|
+
let depth = 0;
|
|
58
|
+
let split = -1;
|
|
59
|
+
for (let i = 0; i < branches.length; i++) {
|
|
60
|
+
const char = branches[i];
|
|
61
|
+
depth += char === "{" ? 1 : char === "}" ? -1 : 0;
|
|
62
|
+
if (char === ":" && depth === 0) {
|
|
63
|
+
split = i;
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const [yes, no] = split === -1 ? [branches, ""] : [branches.slice(0, split), branches.slice(split + 1)];
|
|
68
|
+
filled += fillTemplate(present(lookup(context, choice[1] ?? "")) ? yes : no, context);
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const [path = "", separator = ", "] = hole.body.split("|");
|
|
72
|
+
const value = lookup(context, path);
|
|
73
|
+
filled += Array.isArray(value) ? value.map(String).join(separator) : value === undefined || value === null ? "" : String(value);
|
|
74
|
+
}
|
|
75
|
+
return filled + template.slice(from);
|
|
76
|
+
};
|
|
77
|
+
const optionFor = (options, value, discriminator) => {
|
|
78
|
+
if (discriminator !== undefined && isRecord(value)) {
|
|
79
|
+
for (const option of options) {
|
|
80
|
+
const shape = unwrapMeaning(option).schema.shape;
|
|
81
|
+
const literal = shape?.[discriminator]?._zod.def;
|
|
82
|
+
if (literal?.values?.includes(value[discriminator]) === true) {
|
|
83
|
+
return option;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return options.find((option) => option.safeParse(value).success);
|
|
88
|
+
};
|
|
89
|
+
export const walkMeaning = (schema, value, visit, parent = {}) => {
|
|
90
|
+
if (!present(value)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const { schema: inner, meaning } = unwrapMeaning(schema);
|
|
94
|
+
const context = isRecord(value) ? value : { ...parent, value };
|
|
95
|
+
if (Object.keys(meaning).length > 0) {
|
|
96
|
+
visit(meaning, context);
|
|
97
|
+
}
|
|
98
|
+
const def = inner._zod.def;
|
|
99
|
+
if (def.type === "object" && def.shape !== undefined && isRecord(value)) {
|
|
100
|
+
for (const [key, field] of Object.entries(def.shape)) {
|
|
101
|
+
walkMeaning(field, value[key], visit, value);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (def.type === "array" && def.element !== undefined && Array.isArray(value)) {
|
|
105
|
+
for (const element of value) {
|
|
106
|
+
walkMeaning(def.element, element, visit, parent);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else if (def.type === "union" && def.options !== undefined) {
|
|
110
|
+
const option = optionFor(def.options, value, def.discriminator);
|
|
111
|
+
if (option !== undefined) {
|
|
112
|
+
walkMeaning(option, value, visit, parent);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
export const fieldMeanings = (schema) => {
|
|
117
|
+
const meanings = new Map();
|
|
118
|
+
const shape = unwrapMeaning(schema).schema.shape ?? {};
|
|
119
|
+
for (const [key, field] of Object.entries(shape)) {
|
|
120
|
+
const { meaning } = unwrapMeaning(field);
|
|
121
|
+
if (Object.keys(meaning).length > 0) {
|
|
122
|
+
meanings.set(key, meaning);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return meanings;
|
|
126
|
+
};
|
|
127
|
+
//# sourceMappingURL=meaning.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meaning.js","sourceRoot":"","sources":["../src/meaning.ts"],"names":[],"mappings":"AA8BA,MAAM,QAAQ,GAAG,CAAC,MAAiB,EAAgB,EAAE;IACjD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,CAAiB,CAAC;IAC7E,OAAO,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC;AAC7J,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,OAAO,CAAC,CAA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AC,CAAC"}
|
package/dist/points/agent.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const AgentContributionSchema: z.ZodObject<{
|
|
|
5
5
|
export type AgentContribution = z.infer<typeof AgentContributionSchema>;
|
|
6
6
|
export declare const agentPoint: {
|
|
7
7
|
readonly name: "agent";
|
|
8
|
-
readonly description: "Declare that this checkout is also a Claude Code plugin, so
|
|
8
|
+
readonly description: "Declare that this checkout is also a Claude Code plugin, so Claude Code turns pick up its skills, agents, hooks and commands. Only Claude Code reads it: give the agent tools with `contributes.tools`, which every runtime gets, and put a skill every runtime should read in a capability card's `skill`. MCP servers in the plugin's `.mcp.json` are deprecated, reach Claude Code alone, and are warned about at load.";
|
|
9
9
|
readonly schema: z.ZodObject<{
|
|
10
10
|
path: z.ZodOptional<z.ZodString>;
|
|
11
11
|
}, z.core.$strip>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/points/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/points/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,uBAAuB;;iBAGyE,CAAC;AAC9G,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,UAAU;mBACb,OAAO;0BAET,4ZAA4Z;;;;CAE9X,CAAC"}
|
package/dist/points/agent.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const AgentContributionSchema = z.object({
|
|
3
3
|
path: z.string().optional().describe("Relative to the extension checkout. Absent ⇒ the checkout root."),
|
|
4
|
-
})
|
|
4
|
+
})
|
|
5
|
+
.meta({ power: { key: "agent", sentence: "contributes skills, agents and hooks to the agent's turns" } });
|
|
5
6
|
export const agentPoint = {
|
|
6
7
|
name: "agent",
|
|
7
|
-
description: "Declare that this checkout is also a Claude Code plugin, so
|
|
8
|
+
description: "Declare that this checkout is also a Claude Code plugin, so Claude Code turns pick up its skills, agents, hooks and commands. Only Claude Code reads it: give the agent tools with `contributes.tools`, which every runtime gets, and put a skill every runtime should read in a capability card's `skill`. MCP servers in the plugin's `.mcp.json` are deprecated, reach Claude Code alone, and are warned about at load.",
|
|
8
9
|
schema: AgentContributionSchema,
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=agent.js.map
|
package/dist/points/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/points/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../../src/points/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iEAAiE,CAAC;CAC1G,CAAC;KACG,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,2DAA2D,EAAE,EAAE,CAAC,CAAC;AAG9G,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,IAAI,EAAE,OAAO;IACb,WAAW,EACP,4ZAA4Z;IACha,MAAM,EAAE,uBAAuB;CACG,CAAC"}
|
package/dist/points/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/points/bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,QAAQ;mBACX,KAAK;0BAEP,qQAAqQ;;
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/points/bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,QAAQ;mBACX,KAAK;0BAEP,qQAAqQ;;CAMvO,CAAC"}
|
package/dist/points/bin.js
CHANGED
|
@@ -5,6 +5,7 @@ export const binPoint = {
|
|
|
5
5
|
schema: z
|
|
6
6
|
.string()
|
|
7
7
|
.min(1)
|
|
8
|
-
.refine((value) => !value.split("/").includes(".."), { message: "bin must stay inside the checkout" })
|
|
8
|
+
.refine((value) => !value.split("/").includes(".."), { message: "bin must stay inside the checkout" })
|
|
9
|
+
.meta({ power: { key: "bin", sentence: "puts its shipped tools on the agent's PATH" } }),
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=bin.js.map
|
package/dist/points/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/points/bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,IAAI,EAAE,KAAK;IACX,WAAW,EACP,qQAAqQ;IACzQ,MAAM,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../../src/points/bin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACpB,IAAI,EAAE,KAAK;IACX,WAAW,EACP,qQAAqQ;IACzQ,MAAM,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC;SACrG,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,4CAA4C,EAAE,EAAE,CAAC;CAC1D,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type EffectMeaning } from "../meaning.js";
|
|
2
3
|
export declare const CapabilityFieldSchema: z.ZodObject<{
|
|
3
4
|
key: z.ZodString;
|
|
4
5
|
label: z.ZodString;
|
|
@@ -76,6 +77,7 @@ export declare const CapabilityContributionSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
76
77
|
identity: z.ZodOptional<z.ZodString>;
|
|
77
78
|
insecure: z.ZodOptional<z.ZodBoolean>;
|
|
78
79
|
}, z.core.$strip>>;
|
|
80
|
+
mcp: z.ZodOptional<z.ZodString>;
|
|
79
81
|
}, z.core.$strip>, z.ZodObject<{
|
|
80
82
|
id: z.ZodString;
|
|
81
83
|
catalog: z.ZodObject<{
|
|
@@ -310,6 +312,7 @@ export declare const capabilitiesPoint: {
|
|
|
310
312
|
identity: z.ZodOptional<z.ZodString>;
|
|
311
313
|
insecure: z.ZodOptional<z.ZodBoolean>;
|
|
312
314
|
}, z.core.$strip>>;
|
|
315
|
+
mcp: z.ZodOptional<z.ZodString>;
|
|
313
316
|
}, z.core.$strip>, z.ZodObject<{
|
|
314
317
|
id: z.ZodString;
|
|
315
318
|
catalog: z.ZodObject<{
|
|
@@ -478,4 +481,6 @@ export declare const capabilitiesPoint: {
|
|
|
478
481
|
kind: z.ZodLiteral<"agent">;
|
|
479
482
|
}, z.core.$strip>], "kind">>;
|
|
480
483
|
};
|
|
484
|
+
export declare const contributedServerMintingKinds: () => ReadonlySet<CapabilityContribution["kind"]>;
|
|
485
|
+
export declare const contributionEffectsOf: (contribution: CapabilityContribution) => ReadonlySet<EffectMeaning>;
|
|
481
486
|
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/points/capabilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/points/capabilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAAE,KAAK,aAAa,EAAgC,MAAM,eAAe,CAAC;AAIjF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;iBAkEhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAIpE,eAAO,MAAM,YAAY,UAAW,eAAe,UAAU,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAAG,OACtB,CAAC;AAqE5E,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAiHiE,CAAC;AAC3G,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAQnF,eAAO,MAAM,yBAAyB,SAAU,MAAM,KAAG,MAAM,GAAG,SAA8D,CAAC;AAKjI,eAAO,MAAM,kBAAkB,kBACZ,SAAS,sBAAsB,EAAE,cACpC;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,KAC1F,sBAAsB,GAAG,SAM3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;mBACpB,cAAc;0BAEhB,kYAAkY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEpW,CAAC;AAKvC,eAAO,MAAM,6BAA6B,QAAO,WAAW,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAa1F,CAAC;AAIF,eAAO,MAAM,qBAAqB,iBAAkB,sBAAsB,KAAG,WAAW,CAAC,aAAa,CAarG,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { evaluateWhen, isWhenExpression, parseWhen } from "@intentic/base/when";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { TOOL_PATH } from "./tools.js";
|
|
3
4
|
import { MARK_FIELDS } from "../mark.js";
|
|
5
|
+
import { fieldMeanings, unwrapMeaning } from "../meaning.js";
|
|
4
6
|
export const CapabilityFieldSchema = z.object({
|
|
5
7
|
key: z.string().regex(/^[a-zA-Z][a-zA-Z0-9]*$/),
|
|
6
8
|
label: z.string().min(1),
|
|
@@ -109,13 +111,25 @@ export const CapabilityContributionSchema = z
|
|
|
109
111
|
.string()
|
|
110
112
|
.min(1)
|
|
111
113
|
.optional()
|
|
112
|
-
.describe("A Dockerfile fragment holding the client binary this tool needs (psql, mysql, whisper).")
|
|
114
|
+
.describe("A Dockerfile fragment holding the client binary this tool needs (psql, mysql, whisper).")
|
|
115
|
+
.meta({ effect: "image" }),
|
|
113
116
|
pack: z
|
|
114
117
|
.string()
|
|
115
118
|
.min(1)
|
|
116
119
|
.optional()
|
|
117
|
-
.describe("A sandbox feature pack name (whisper, llamacpp, browser, …) supplying this tool. Preferred over `fragment`: an image that already bakes the pack needs no rebuild, and there is no copy to drift.")
|
|
120
|
+
.describe("A sandbox feature pack name (whisper, llamacpp, browser, …) supplying this tool. Preferred over `fragment`: an image that already bakes the pack needs no rebuild, and there is no copy to drift.")
|
|
121
|
+
.meta({ effect: "image" }),
|
|
118
122
|
probe: ProbeSchema.optional().describe("One authenticated request that tests this card's settings before they are saved, so a wrong token or an unreachable host is answered on the form rather than by a card that says 'not connected' afterwards."),
|
|
123
|
+
mcp: z
|
|
124
|
+
.string()
|
|
125
|
+
.regex(TOOL_PATH)
|
|
126
|
+
.optional()
|
|
127
|
+
.describe("Deprecated: declare `contributes.tools` with `perCard` naming this card instead, and serve the tools with `api.tools.serve`. A path in this extension's backend (`server`) answering MCP over Streamable HTTP; every turn granted a card of this kind gets it as a server named by the card's id, each request arriving at `<path>/<card id>`.")
|
|
128
|
+
.meta({
|
|
129
|
+
effect: "mcp",
|
|
130
|
+
mintsServer: true,
|
|
131
|
+
power: { key: "capability-tools:${id}", sentence: 'serves MCP tools to the agent for each "${catalog.name}" card' },
|
|
132
|
+
}),
|
|
119
133
|
}),
|
|
120
134
|
z.object({
|
|
121
135
|
...contributionBase,
|
|
@@ -133,17 +147,21 @@ export const CapabilityContributionSchema = z
|
|
|
133
147
|
.min(1)
|
|
134
148
|
.describe("Checkout-relative SKILL.md teaching the agent this site's actions: rendered once per site, all its connected accounts on one roster (`${accounts}`), the core tool note at `${tools}`."),
|
|
135
149
|
}),
|
|
136
|
-
z
|
|
150
|
+
z
|
|
151
|
+
.object({
|
|
137
152
|
...contributionBase,
|
|
138
153
|
kind: z.literal("device"),
|
|
139
154
|
skill: z.string().min(1).describe("Checkout-relative SKILL.md teaching the agent that machine's shell."),
|
|
140
|
-
})
|
|
141
|
-
|
|
155
|
+
})
|
|
156
|
+
.meta({ mintsServer: true }),
|
|
157
|
+
z
|
|
158
|
+
.object({
|
|
142
159
|
...contributionBase,
|
|
143
160
|
kind: z.literal("webext"),
|
|
144
161
|
install: z.url().optional().describe("Where this browser's extension is installed from: its store listing, or a page offering the build."),
|
|
145
162
|
skill: z.string().min(1).describe("Checkout-relative SKILL.md teaching the agent to drive this browser."),
|
|
146
|
-
})
|
|
163
|
+
})
|
|
164
|
+
.meta({ mintsServer: true }),
|
|
147
165
|
z.object({ ...contributionBase, kind: z.literal("agent") }),
|
|
148
166
|
])
|
|
149
167
|
.superRefine((spec, ctx) => {
|
|
@@ -158,7 +176,8 @@ export const CapabilityContributionSchema = z
|
|
|
158
176
|
});
|
|
159
177
|
}
|
|
160
178
|
}
|
|
161
|
-
})
|
|
179
|
+
})
|
|
180
|
+
.meta({ power: { key: "capability:${id}", sentence: 'a ${kind} capability card "${catalog.name}"' } });
|
|
162
181
|
const DISCRIMINATOR = { cli: "provider", browser: "platform", device: "platform", webext: "platform", agent: undefined };
|
|
163
182
|
export const contributionDiscriminator = (kind) => DISCRIMINATOR[kind];
|
|
164
183
|
export const contributedEntryOf = (contributions, capability) => {
|
|
@@ -173,4 +192,32 @@ export const capabilitiesPoint = {
|
|
|
173
192
|
description: 'Capability cards this pack adds to the "+" grid: a connected CLI tool, a site the agent acts on as the owner through the shared browser, an operating system pack, a browser family the owner connects their own copy of, or a preset over a core kind. The card and its form are data here; the machinery that acts on them is core, which is why a card may only name one of these five kinds.',
|
|
174
193
|
schema: z.array(CapabilityContributionSchema),
|
|
175
194
|
};
|
|
195
|
+
export const contributedServerMintingKinds = () => {
|
|
196
|
+
const kinds = new Set();
|
|
197
|
+
for (const option of CapabilityContributionSchema.options) {
|
|
198
|
+
const shape = option.shape;
|
|
199
|
+
const kind = shape["kind"]?._zod.def?.values?.[0];
|
|
200
|
+
if (kind === undefined) {
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (unwrapMeaning(option).meaning.mintsServer === true || [...fieldMeanings(option).values()].some((meaning) => meaning.mintsServer === true)) {
|
|
204
|
+
kinds.add(kind);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return kinds;
|
|
208
|
+
};
|
|
209
|
+
export const contributionEffectsOf = (contribution) => {
|
|
210
|
+
const effects = new Set();
|
|
211
|
+
const option = CapabilityContributionSchema.options.find((candidate) => candidate.shape.kind.value === contribution.kind);
|
|
212
|
+
if (option === undefined) {
|
|
213
|
+
return effects;
|
|
214
|
+
}
|
|
215
|
+
for (const [key, meaning] of fieldMeanings(option)) {
|
|
216
|
+
const value = contribution[key];
|
|
217
|
+
if (meaning.effect !== undefined && value !== undefined && value !== false) {
|
|
218
|
+
effects.add(meaning.effect);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return effects;
|
|
222
|
+
};
|
|
176
223
|
//# sourceMappingURL=capabilities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/points/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../src/points/capabilities.ts"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AC,MAAM,qBAAqB,GAAG,CAAC,YAAoC,EAA8B,EAAE;IACtG,MAAM,OAAO,GAAG,IAAI,GAAG,EAAiB,CAAC;IACzC,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;IAC1H,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QACjD,MAAM,KAAK,GAAI,YAAwC,CAAC,GAAG,CAAC,CAAC;QAC7D,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;YACzE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/points/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;;;;;;
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/points/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;;;;;;iBA+BuD,CAAC;AAC9F,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,aAAa;mBAChB,UAAU;0BAEZ,6NAA6N;;;;;;;;;CAE/L,CAAC"}
|
package/dist/points/commands.js
CHANGED
|
@@ -13,13 +13,15 @@ export const CommandContributionSchema = z.object({
|
|
|
13
13
|
.string()
|
|
14
14
|
.regex(/^\S+$/)
|
|
15
15
|
.optional()
|
|
16
|
-
.describe('A global keyboard shortcut, e.g. "Mod+Shift+K" — `Mod` is ⌘ on Apple and Ctrl elsewhere. Declared here because a global shortcut is consequential: the owner approves it at install, and the host binds only what was approved.')
|
|
16
|
+
.describe('A global keyboard shortcut, e.g. "Mod+Shift+K" — `Mod` is ⌘ on Apple and Ctrl elsewhere. Declared here because a global shortcut is consequential: the owner approves it at install, and the host binds only what was approved.')
|
|
17
|
+
.meta({ power: { key: "keybinding:${command}", sentence: 'the global shortcut ${keybinding} ("${title}")' } }),
|
|
17
18
|
when: z
|
|
18
19
|
.string()
|
|
19
20
|
.refine(isWhenExpression, { message: "not a valid `when` condition" })
|
|
20
21
|
.optional()
|
|
21
22
|
.describe("When the shortcut applies, as a condition over the shell's context keys, `tabSurface == 'chat'`, `!editableTarget`. Without one the chord is claimed everywhere, including inside a terminal where a bare key belongs to the program running in it. The command palette ignores this: a command is always runnable by name."),
|
|
22
|
-
})
|
|
23
|
+
})
|
|
24
|
+
.meta({ power: { key: "command:${command}", sentence: 'a palette command "${title}"' } });
|
|
23
25
|
export const commandsPoint = {
|
|
24
26
|
name: "commands",
|
|
25
27
|
description: "Commands this extension may register handlers for, surfaced in the command palette. Title, icon and shortcut all come from here rather than from the registration call, because this is what the owner approved at install.",
|