capable-kit 0.0.1-alpha.8 → 0.1.0-alpha.11
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/CHANGELOG.md +385 -0
- package/LICENSE +21 -0
- package/README.md +12 -0
- package/dist/ai-sdk.d.mts +3 -3
- package/dist/ai-sdk.mjs +9 -7
- package/dist/ai-sdk.mjs.map +1 -1
- package/dist/app.d.mts +2 -2
- package/dist/app.mjs +2 -2
- package/dist/bin.mjs +19 -15
- package/dist/bin.mjs.map +1 -1
- package/dist/cli.d.mts +9 -1
- package/dist/cli.mjs +1 -1
- package/dist/core.d.mts +3 -3
- package/dist/core.mjs +2 -2
- package/dist/eve.d.mts +92 -9
- package/dist/eve.mjs +606 -26
- package/dist/eve.mjs.map +1 -1
- package/dist/http.d.mts +1 -1
- package/dist/http.mjs +1 -1
- package/dist/{index-_qKFfWV4.d.mts → index-BIO_hbXJ.d.mts} +69 -26
- package/dist/{index-hdH_K5Zc.d.mts → index-C0tU5Y2n.d.mts} +4 -4
- package/dist/{index-Dl4NK9G0.d.mts → index-CwvjDizW.d.mts} +5 -3
- package/dist/{index-F4ba_olD.d.mts → index-F_eaksy8.d.mts} +58 -17
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/mcp.d.mts +19 -4
- package/dist/mcp.mjs +2 -2
- package/dist/{mount-CEFAplR5.mjs → mount-pvIaehZC.mjs} +159 -107
- package/dist/mount-pvIaehZC.mjs.map +1 -0
- package/dist/react-query.d.mts +2 -2
- package/dist/react-query.mjs +1 -1
- package/dist/react-query.mjs.map +1 -1
- package/dist/runtime-support.d.mts +1 -1
- package/dist/runtime-support.mjs +3 -3
- package/dist/server.d.mts +1 -1
- package/dist/server.mjs +1 -1
- package/dist/{src-rkr5j_NH.mjs → src-Bk3lEhI7.mjs} +63 -25
- package/dist/src-Bk3lEhI7.mjs.map +1 -0
- package/dist/src-C2OEkZ3c.mjs +760 -0
- package/dist/src-C2OEkZ3c.mjs.map +1 -0
- package/dist/{src-BWxDO2Ua.mjs → src-DFrxQ_S6.mjs} +9 -7
- package/dist/src-DFrxQ_S6.mjs.map +1 -0
- package/dist/{src-D_0PIhqq.mjs → src-DklM1g7V.mjs} +69 -40
- package/dist/src-DklM1g7V.mjs.map +1 -0
- package/dist/{src-D-cm2gQ6.mjs → src-TCQGaWar.mjs} +119 -45
- package/dist/src-TCQGaWar.mjs.map +1 -0
- package/dist/{subscription-B-auXJbm.d.mts → subscription-fVgS4T8P.d.mts} +2 -2
- package/dist/swr.d.mts +2 -2
- package/dist/swr.mjs +1 -1
- package/dist/swr.mjs.map +1 -1
- package/docs/CONTEXT.md +44 -22
- package/docs/README.md +3 -0
- package/docs/internal/README.md +3 -0
- package/docs/internal/adr/0001-capability-is-the-semantic-boundary.md +1 -1
- package/docs/internal/adr/0003-capability-reference-customization.md +68 -0
- package/docs/internal/architecture.md +31 -17
- package/docs/internal/capability-first-model.md +126 -17
- package/docs/internal/eve-recovery-validation.md +87 -0
- package/docs/internal/feedback/v-ray/README.md +258 -0
- package/docs/internal/feedback/v-ray/inference.mjs +43 -0
- package/docs/internal/feedback/v-ray/reproduce.mjs +36 -0
- package/docs/internal/implementation-friction.md +445 -1
- package/docs/internal/releases.md +79 -0
- package/docs/site/capable-orpc-and-trpc.mdx +2 -2
- package/docs/site/concepts/apps.mdx +7 -1
- package/docs/site/concepts/architecture.mdx +9 -1
- package/docs/site/concepts/capabilities.mdx +41 -4
- package/docs/site/concepts/errors.mdx +26 -4
- package/docs/site/concepts/presentations.mdx +20 -0
- package/docs/site/hosting/standalone-server.mdx +2 -0
- package/docs/site/patterns/composition.mdx +152 -8
- package/docs/site/patterns/remote-apps.mdx +29 -3
- package/docs/site/patterns/subscriptions.mdx +79 -32
- package/docs/site/quickstart.mdx +3 -2
- package/docs/site/reference/packages-and-entry-points.mdx +52 -4
- package/docs/site/reference/the-cap-cli.mdx +2 -2
- package/docs/site/surfaces/cli.mdx +44 -0
- package/docs/site/surfaces/eve.mdx +67 -18
- package/docs/site/surfaces/mcp.mdx +84 -2
- package/docs/site/surfaces/typescript.mdx +3 -3
- package/package-docs.mjs +3 -0
- package/package.json +17 -12
- package/src/bin.ts +0 -0
- package/src/index.test.ts +2 -1
- package/src/index.ts +8 -1
- package/src/package.test.ts +15 -0
- package/dist/mount-CEFAplR5.mjs.map +0 -1
- package/dist/src-BWxDO2Ua.mjs.map +0 -1
- package/dist/src-D-cm2gQ6.mjs.map +0 -1
- package/dist/src-D_0PIhqq.mjs.map +0 -1
- package/dist/src-betOfnDL.mjs +0 -481
- package/dist/src-betOfnDL.mjs.map +0 -1
- package/dist/src-rkr5j_NH.mjs.map +0 -1
package/dist/eve.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eve.mjs","names":[],"sources":["../../eve/src/index.ts"],"sourcesContent":["import {\n getAppRuntime,\n type AnyApp,\n type ManifestNode,\n type ManifestCapability,\n} from \"@capable/app\";\nimport type { CapabilityMetaRegistry } from \"@capable/core\";\nimport {\n defineDynamic,\n defineTool,\n type DynamicResolveContext,\n type DynamicSentinel,\n type ToolDefinition,\n} from \"eve/tools\";\nimport type { Approval } from \"eve/tools/approval\";\n\nexport type EveCapabilityMeta =\n | false\n | {\n readonly name?: string;\n };\n\ndeclare module \"@capable/core\" {\n interface CapabilityMetaRegistry {\n readonly eve?: EveCapabilityMeta;\n }\n}\n\nexport type CreateEveToolsOptions = {\n readonly approval?: (\n capability: ManifestCapability,\n ) => Approval | undefined;\n};\n\nexport type EveAppProvider =\n | AnyApp\n | ((\n context: DynamicResolveContext,\n ) => AnyApp | Promise<AnyApp>);\n\nconst emptyInputSchema = Object.freeze({\n type: \"object\",\n properties: Object.freeze({}),\n additionalProperties: false,\n});\n\ntype EveTool = ToolDefinition<Record<string, unknown>, unknown>;\n\n/**\n * Projects an executable Capable App into native, in-process Eve tools.\n *\n * The returned dynamic definition resolves at `step.started`. Eve deliberately\n * keeps step-scoped executors live, so the Capable App and its context provider do\n * not have to cross a durable serialization boundary.\n */\nexport function createEveTools(\n app: EveAppProvider,\n options: CreateEveToolsOptions = {},\n): DynamicSentinel<Record<string, EveTool>> {\n const capabilitiesByApp = new WeakMap<\n AnyApp,\n Promise<readonly ManifestCapability[]>\n >();\n const capabilities = (resolvedApp: AnyApp) => {\n const existing = capabilitiesByApp.get(resolvedApp);\n if (existing) return existing;\n const resolved = getAppRuntime(resolvedApp).manifest().then((manifest) =>\n flatten(manifest.capabilities)\n );\n capabilitiesByApp.set(resolvedApp, resolved);\n return resolved;\n };\n\n return defineDynamic({\n events: {\n \"step.started\": async (_event, context) => {\n const resolvedApp = typeof app === \"function\"\n ? await app(context)\n : app;\n const runtime = getAppRuntime(resolvedApp);\n const tools: Record<string, EveTool> = {};\n const names = new Set<string>();\n\n for (const capability of await capabilities(resolvedApp)) {\n const meta = capability.meta.eve as EveCapabilityMeta | undefined;\n if (meta === false) continue;\n\n const name = meta?.name ?? capability.path.join(\"__\");\n if (!/^[A-Za-z0-9_-]{1,64}$/.test(name)) {\n throw new Error(\n `Eve tool name \"${name}\" is invalid; set meta.eve.name to 1-64 letters, numbers, underscores, or hyphens`,\n );\n }\n if (names.has(name)) {\n throw new Error(`Duplicate Eve tool name \"${name}\"`);\n }\n names.add(name);\n\n const approval = options.approval?.(capability);\n const tool: EveTool = {\n description:\n capability.description ??\n capability.title ??\n `Run the Capable Capability at ${capability.path.join(\".\")}.`,\n inputSchema: (capability.input ??\n emptyInputSchema) as EveTool[\"inputSchema\"],\n ...(capability.output\n ? {\n outputSchema:\n capability.output as NonNullable<EveTool[\"outputSchema\"]>,\n }\n : {}),\n ...(approval ? { approval } : {}),\n async execute(input, context) {\n const result = await runtime.call({\n id: capability.id,\n input,\n signal: context.abortSignal,\n });\n return result.output;\n },\n };\n tools[name] = defineTool(tool);\n }\n\n return tools;\n },\n },\n });\n}\n\nfunction flatten(\n nodes: readonly ManifestNode[],\n): readonly ManifestCapability[] {\n return nodes.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AAW,SACX,EACE,cACE,WAAW,OACf,IACA,CAAC;IACL,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;IAC/B,MAAM,QAAQ,OAAO,SAAS;KAM5B,QAAO,MALc,QAAQ,KAAK;MAChC,IAAI,WAAW;MACf;MACA,QAAQ,QAAQ;KAClB,CAAC,EAAA,CACa;IAChB;GAE0B,CAAC;EAC/B;EAEA,OAAO;CACT,EACF,EACF,CAAC;AACH;AAEA,SAAS,QACP,OAC+B;CAC/B,OAAO,MAAM,SAAS,SACpB,KAAK,SAAS,eAAe,CAAC,IAAI,IAAI,QAAQ,KAAK,QAAQ,CAC7D;AACF"}
|
|
1
|
+
{"version":3,"file":"eve.mjs","names":["delivery","deliveryOf","sessionOf"],"sources":["../../eve/src/agent-schemas.ts","../../eve/src/agent-presentation.ts","../../eve/src/agent.ts","../../eve/src/index.ts"],"sourcesContent":["import type { Schema } from \"@capable/core\";\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue };\n\ntype Direction = \"input\" | \"output\";\ntype JsonSchema = Record<string, unknown>;\ntype Path = readonly PropertyKey[];\n\nclass Invalid extends Error {\n readonly path: Path;\n\n constructor(path: Path, message: string) {\n super(message);\n this.path = path;\n }\n}\n\nfunction fail(path: Path, message: string): never {\n throw new Invalid(path, message);\n}\n\nexport interface Field<\n TInput,\n TOutput,\n TInputOptional extends boolean = false,\n TOutputOptional extends boolean = false,\n> {\n readonly parse: (value: unknown) => TOutput;\n readonly parseAt: (value: unknown, path: Path) => TOutput;\n readonly json: (direction: Direction) => JsonSchema;\n readonly inputOptional: TInputOptional;\n readonly outputOptional: TOutputOptional;\n readonly inputType?: TInput;\n}\n\nfunction field<TInput, TOutput>(\n parseAt: (value: unknown, path: Path) => TOutput,\n json: (direction: Direction) => JsonSchema,\n): Field<TInput, TOutput> {\n return {\n parse: (value) => parseAt(value, []),\n parseAt,\n json,\n inputOptional: false,\n outputOptional: false,\n };\n}\n\nexport function string(\n options: {\n readonly minLength?: number;\n readonly maxLength?: number;\n readonly description?: string;\n } = {},\n): Field<string, string> {\n return field<string, string>((value, path) => {\n if (typeof value !== \"string\") fail(path, \"Expected string\");\n if (options.minLength !== undefined && value.length < options.minLength) {\n fail(path, `Expected at least ${options.minLength} characters`);\n }\n if (options.maxLength !== undefined && value.length > options.maxLength) {\n fail(path, `Expected at most ${options.maxLength} characters`);\n }\n return value;\n }, () => ({\n type: \"string\",\n ...(options.minLength === undefined ? {} : { minLength: options.minLength }),\n ...(options.maxLength === undefined ? {} : { maxLength: options.maxLength }),\n ...(options.description === undefined ? {} : { description: options.description }),\n }));\n}\n\nexport function integer(\n options: {\n readonly minimum?: number;\n readonly maximum?: number;\n readonly description?: string;\n } = {},\n): Field<number, number> {\n const minimum = options.minimum ?? -Number.MAX_SAFE_INTEGER;\n const maximum = options.maximum ?? Number.MAX_SAFE_INTEGER;\n return field<number, number>((value, path) => {\n if (typeof value !== \"number\" || !Number.isSafeInteger(value)) {\n fail(path, \"Expected integer\");\n }\n if (value < minimum) fail(path, `Expected an integer >= ${minimum}`);\n if (value > maximum) fail(path, `Expected an integer <= ${maximum}`);\n return value;\n }, () => ({\n type: \"integer\",\n minimum,\n maximum,\n ...(options.description === undefined ? {} : { description: options.description }),\n }));\n}\n\nexport function boolean(\n options: { readonly description?: string } = {},\n): Field<boolean, boolean> {\n return field<boolean, boolean>((value, path) => {\n if (typeof value !== \"boolean\") fail(path, \"Expected boolean\");\n return value;\n }, () => ({\n type: \"boolean\",\n ...(options.description === undefined ? {} : { description: options.description }),\n }));\n}\n\nexport function enumOf<const T extends string>(\n ...values: readonly T[]\n): Field<T, T> {\n const allowed = new Set<string>(values);\n return field<T, T>((value, path) => {\n if (typeof value !== \"string\" || !allowed.has(value)) {\n fail(path, `Expected one of: ${values.join(\", \")}`);\n }\n return value as T;\n }, () => ({ type: \"string\", enum: [...values] }));\n}\n\nexport function array<TItem>(\n item: Field<TItem, TItem>,\n): Field<TItem[], TItem[]> {\n return field<TItem[], TItem[]>((value, path) => {\n if (!Array.isArray(value)) fail(path, \"Expected array\");\n return Array.from(value, (entry, index) =>\n item.parseAt(entry, [...path, index])\n );\n }, (direction) => ({ type: \"array\", items: item.json(direction) }));\n}\n\nexport function optional<T>(\n item: Field<T, T>,\n): Field<T | undefined, T | undefined, true, true> {\n return {\n parse: (value) => value === undefined ? undefined : item.parse(value),\n parseAt: (value, path) =>\n value === undefined ? undefined : item.parseAt(value, path),\n json: item.json,\n inputOptional: true,\n outputOptional: true,\n };\n}\n\nexport function withDefault<T>(\n item: Field<T, T>,\n value: T,\n): Field<T | undefined, T, true, false> {\n return {\n parse: (input) => input === undefined ? value : item.parse(input),\n parseAt: (input, path) =>\n input === undefined ? value : item.parseAt(input, path),\n json: (direction) =>\n direction === \"input\"\n ? { default: value, ...item.json(direction) }\n : item.json(direction),\n inputOptional: true,\n outputOptional: false,\n };\n}\n\nfunction jsonValueSchema(): JsonSchema {\n return {\n anyOf: [\n { type: \"string\" },\n { type: \"number\" },\n { type: \"boolean\" },\n { type: \"null\" },\n { type: \"array\", items: {} },\n { type: \"object\", additionalProperties: {} },\n ],\n };\n}\n\nexport function json(): Field<JsonValue, JsonValue> {\n return field<JsonValue, JsonValue>(\n (value, path) => parseJson(value, path, new Set()),\n jsonValueSchema,\n );\n}\n\nexport function parseJsonValue(value: unknown): JsonValue {\n return parseJson(value, [], new Set());\n}\n\nfunction parseJson(value: unknown, path: Path, seen: Set<object>): JsonValue {\n if (value === null) return null;\n if (typeof value === \"string\" || typeof value === \"boolean\") return value;\n if (typeof value === \"number\") {\n if (!Number.isFinite(value)) fail(path, \"Expected a finite number\");\n return value;\n }\n if (typeof value !== \"object\") fail(path, \"Expected a JSON value\");\n if (seen.has(value)) fail(path, \"Expected an acyclic JSON value\");\n seen.add(value);\n try {\n if (Array.isArray(value)) {\n return Array.from(value, (entry, index) =>\n parseJson(entry, [...path, index], seen)\n );\n }\n const prototype = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n fail(path, \"Expected a plain JSON object\");\n }\n return Object.fromEntries(Object.entries(value).map(([key, entry]) => [\n key,\n parseJson(entry, [...path, key], seen),\n ])) as JsonValue;\n } finally {\n seen.delete(value);\n }\n}\n\ntype Shape = Record<string, Field<unknown, unknown, boolean, boolean>>;\ntype InputOf<TField> = TField extends Field<infer T, any, any, any> ? T : never;\ntype OutputOf<TField> = TField extends Field<any, infer T, any, any> ? T : never;\ntype InputOptionalOf<TField> =\n TField extends Field<any, any, infer T, any> ? T : never;\ntype OutputOptionalOf<TField> =\n TField extends Field<any, any, any, infer T> ? T : never;\ntype RequiredKeys<TS extends Shape, TDirectory extends Direction> = {\n [K in keyof TS]: TS[K] extends Field<any, any, any, any>\n ? (TDirectory extends \"input\"\n ? InputOptionalOf<TS[K]>\n : OutputOptionalOf<TS[K]>) extends false ? K : never\n : never;\n}[keyof TS];\ntype OptionalKeys<TS extends Shape, TDirectory extends Direction> =\n Exclude<keyof TS, RequiredKeys<TS, TDirectory>>;\n\nexport type ShapeInput<TS extends Shape> = {\n [K in RequiredKeys<TS, \"input\">]: InputOf<TS[K]>;\n} & {\n [K in OptionalKeys<TS, \"input\">]?: InputOf<TS[K]>;\n};\n\nexport type ShapeOutput<TS extends Shape> = {\n [K in RequiredKeys<TS, \"output\">]: OutputOf<TS[K]>;\n} & {\n [K in OptionalKeys<TS, \"output\">]?: OutputOf<TS[K]>;\n};\n\nexport type ObjectField<TInput, TOutput> =\n & Field<TInput, TOutput, false, false>\n & Schema<TInput, TOutput>;\n\nexport function object<const TS extends Shape>(\n shape: TS,\n): ObjectField<ShapeInput<TS>, ShapeOutput<TS>> {\n const json = (direction: Direction) => shapeJson(shape, direction);\n const parseAt = (value: unknown, path: Path) =>\n parseShape(shape, value, path) as ShapeOutput<TS>;\n return {\n ...defineSchema<ShapeInput<TS>, ShapeOutput<TS>>(parseAt, json),\n parse: (value) => parseAt(value, []),\n parseAt,\n json,\n inputOptional: false,\n outputOptional: false,\n };\n}\n\nfunction parseShape<TS extends Shape>(\n shape: TS,\n value: unknown,\n path: Path,\n): ShapeOutput<TS> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n fail(path, \"Expected object\");\n }\n const source = value as Record<string, unknown>;\n const parsed: Record<string, unknown> = {};\n for (const [key, item] of Object.entries(shape)) {\n const fieldPath = [...path, key];\n if (!Object.hasOwn(source, key)) {\n if (!item.inputOptional) fail(fieldPath, \"Required\");\n const output = item.parseAt(undefined, fieldPath);\n if (output !== undefined) parsed[key] = output;\n continue;\n }\n const output = item.parseAt(source[key], fieldPath);\n if (output !== undefined) parsed[key] = output;\n }\n return parsed as ShapeOutput<TS>;\n}\n\nfunction shapeJson<TS extends Shape>(\n shape: TS,\n direction: Direction,\n): JsonSchema {\n const properties: Record<string, JsonSchema> = {};\n const required: string[] = [];\n for (const [key, item] of Object.entries(shape)) {\n properties[key] = item.json(direction);\n if (!(direction === \"input\" ? item.inputOptional : item.outputOptional)) {\n required.push(key);\n }\n }\n return {\n type: \"object\",\n properties,\n required,\n ...(direction === \"output\" ? { additionalProperties: false } : {}),\n };\n}\n\nconst targetUrls: Readonly<Record<string, string>> = {\n \"draft-2020-12\": \"https://json-schema.org/draft/2020-12/schema\",\n \"draft-07\": \"http://json-schema.org/draft-07/schema#\",\n};\n\nfunction defineSchema<TInput, TOutput>(\n parseAt: (value: unknown, path: Path) => TOutput,\n json: (direction: Direction) => JsonSchema,\n): Schema<TInput, TOutput> {\n return {\n \"~standard\": {\n version: 1,\n vendor: \"capable-eve\",\n validate(value) {\n try {\n return { value: parseAt(value, []) };\n } catch (error) {\n if (!(error instanceof Invalid)) throw error;\n return {\n issues: error.path.length === 0\n ? [{ message: error.message }]\n : [{ message: error.message, path: [...error.path] }],\n };\n }\n },\n jsonSchema: {\n input: (options) => withTarget(json(\"input\"), options.target),\n output: (options) => withTarget(json(\"output\"), options.target),\n },\n },\n };\n}\n\nfunction withTarget(schema: JsonSchema, target: string): JsonSchema {\n const url = targetUrls[target];\n return url === undefined ? schema : { $schema: url, ...schema };\n}\n","import type { EveAgentResult } from \"./agent.ts\";\n\n/** Portable presentation shared by the CLI and other presentation-aware surfaces. */\nexport function presentAgentResult(result: EveAgentResult & { runId?: string }): string {\n const status = {\n running: \"Running. Check the result again to follow progress.\",\n waiting: \"Waiting for input.\",\n completed: \"Completed.\",\n failed: \"Agent execution failed.\",\n cancelled: \"Cancelled.\",\n }[result.status];\n const parts = [status];\n if (result.text) parts.push(result.text);\n if (result.data !== undefined) parts.push(JSON.stringify(result.data, null, 2));\n if (result.textTruncated) parts.push(\"The answer was truncated.\");\n if (result.dataOmitted) parts.push(\"Structured output was too large to include.\");\n for (const request of result.requests) {\n parts.push(request.prompt);\n parts.push(`Request ID: ${request.requestId}`);\n if (request.options?.length) {\n parts.push(request.options.map(option => `- ${option.label} (option ID: ${option.id})${option.description ? ` — ${option.description}` : \"\"}`).join(\"\\n\"));\n }\n if (request.allowFreeform === false || (request.options?.length && request.allowFreeform !== true)) {\n parts.push(\"Reply with an option ID.\");\n }\n }\n if (result.requiresHostInput) parts.push(\"Approval or authorization must be completed through the Eve host.\");\n if (result.runId) parts.push(`Run ID: ${result.runId}`);\n return parts.join(\"\\n\\n\");\n}\n","import { createApp, type App } from \"@capable/app\";\nimport { capability, defineApp, type CapabilityDefinition, type DefinedErrors, type Schema } from \"@capable/core\";\nimport type { Client, SessionStreamEvent } from \"eve/client\";\nimport {\n delivery as deliveryOf, emptySessionView, failure, foldEvents, interaction, openInteractions, parts, reply, session as sessionOf, turn, turns,\n type Interaction, type SessionView,\n} from \"eve/events\";\nimport type { Delivery } from \"eve/sessions\";\nimport {\n array,\n boolean,\n enumOf,\n integer,\n json,\n object,\n optional,\n parseJsonValue,\n string,\n withDefault,\n type JsonValue,\n} from \"./agent-schemas.ts\";\nimport { presentAgentResult } from \"./agent-presentation.ts\";\n\nconst runId = string({ minLength: 1, description: \"Eve session ID returned by send.\" });\nconst question = object({\n requestId: string(),\n prompt: string(),\n display: optional(enumOf(\"confirmation\", \"select\", \"text\")),\n allowFreeform: optional(boolean()),\n options: optional(array(object({\n id: string(),\n label: string(),\n description: optional(string()),\n }))),\n});\nconst resultShape = {\n status: enumOf(\"running\", \"waiting\", \"completed\", \"failed\", \"cancelled\"),\n cursor: integer({ minimum: 0 }),\n eventCount: integer({ minimum: 0 }),\n requests: array(question),\n text: optional(string()),\n data: optional(json()),\n dataOmitted: optional(boolean()),\n textTruncated: optional(boolean()),\n requiresHostInput: optional(boolean()),\n error: optional(string()),\n};\nconst resultSchema = object(resultShape);\nconst sendOutput = object({ ...resultShape, runId: string() });\nexport interface EveAgentQuestion {\n requestId: string;\n prompt: string;\n display?: \"confirmation\" | \"select\" | \"text\" | undefined;\n allowFreeform?: boolean | undefined;\n options?: { id: string; label: string; description?: string | undefined }[] | undefined;\n}\nexport type EveAgentData = JsonValue;\nexport interface EveAgentResult {\n status: \"running\" | \"waiting\" | \"completed\" | \"failed\" | \"cancelled\";\n cursor: number;\n eventCount: number;\n requests: EveAgentQuestion[];\n text?: string | undefined;\n data?: EveAgentData | undefined;\n dataOmitted?: boolean | undefined;\n textTruncated?: boolean | undefined;\n requiresHostInput?: boolean | undefined;\n error?: string | undefined;\n}\n\ntype AgentCapability<TInput extends Record<string, unknown>, TOutput, TParsed extends Record<string, unknown> = TInput> =\n CapabilityDefinition<undefined, Schema<TInput, TParsed>, TOutput, DefinedErrors<{}>, {}, \"unary\">;\ntype AgentCapabilities = {\n send: AgentCapability<{\n message: string; runId?: string | undefined; requestId?: string | undefined;\n optionId?: string | undefined; wait?: boolean | undefined; timeoutMs?: number | undefined;\n }, EveAgentResult & { runId: string }>;\n result: AgentCapability<{ runId: string; cursor?: number | undefined }, EveAgentResult, { runId: string; cursor: number }>;\n cancel: AgentCapability<{ runId: string; turnId?: string | undefined }, { status: \"accepted\" | \"pending\" | \"no_active_turn\" }>;\n};\nexport interface EveAgentAdapter<TName extends string> {\n readonly app: App<{ [K in TName]: AgentCapabilities }>;\n /** Abort local requests without cancelling remote execution. */\n dispose(): void;\n}\nexport type EveAgentOperation = \"send\" | \"result\" | \"cancel\";\n\nexport interface EveAgentAdapterOptions<TName extends string> {\n /** Namespace and capability ID prefix; unique within the composed App. */\n readonly name: TName;\n /** Host-configured client for ONE authenticated caller. Never share an adapter across callers. */\n readonly client: Pick<Client, \"sessions\">;\n /** Recheck host-owned authorization on every invocation, including reconstructed reads. Throw to deny. */\n readonly authorize: (operation: EveAgentOperation, runId?: string) => void | Promise<void>;\n readonly maxEventsPerRead?: number;\n readonly readTimeoutMs?: number;\n}\n\ntype Question = EveAgentQuestion;\ntype Run = { view: SessionView; cursor: number; result: EveAgentResult };\n\n/**\n * Wrap Eve execution as a caller-scoped Capable App.\n * Eve session IDs are run IDs. Every read reconstructs state from durable events.\n */\nexport function createEveAgentAdapter<const TName extends string>(options: EveAgentAdapterOptions<TName>): EveAgentAdapter<TName> {\n if (!/^[A-Za-z][A-Za-z0-9_-]*$/.test(options.name)) throw new Error(\"Invalid Eve agent namespace\");\n const maxEvents = positive(options.maxEventsPerRead ?? 10_000, \"maxEventsPerRead\");\n const timeoutMs = positive(options.readTimeoutMs ?? 1_000, \"readTimeoutMs\");\n const lifetime = new AbortController();\n\n async function authorize(operation: EveAgentOperation, runId?: string) {\n lifetime.signal.throwIfAborted();\n await options.authorize(operation, runId);\n lifetime.signal.throwIfAborted();\n }\n function signalFor(signal?: AbortSignal) {\n return AbortSignal.any([lifetime.signal, ...(signal ? [signal] : [])]);\n }\n async function readRun(runId: string, signal?: AbortSignal, since = 0, turnId?: string): Promise<Run> {\n const requestSignal = signalFor(signal);\n requestSignal.throwIfAborted();\n const read = new AbortController();\n const timer = setTimeout(() => read.abort(), timeoutMs);\n const combined = AbortSignal.any([requestSignal, read.signal]);\n const events: SessionStreamEvent[] = [];\n try {\n const session = options.client.sessions.attach(runId);\n for await (const event of session.stream({ follow: false, signal: combined, reconnect: false })) {\n if (events.length >= maxEvents) throw new Error(\"Eve history exceeds maxEventsPerRead\");\n events.push(event);\n }\n // Eve can swallow stream aborts. Never validate an answer against partial history.\n combined.throwIfAborted();\n } finally {\n clearTimeout(timer);\n read.abort();\n }\n const cursor = events.length ? events.at(-1)!.meta.position.line + 1 : 0;\n const view = foldEvents(emptySessionView(), events);\n const eventCount = events.filter(event => event.meta.position.line >= since).length;\n return { view, cursor, result: summarize(view, cursor, eventCount, turnId) };\n }\n\n const capabilities = {\n send: capability({\n id: `${options.name}.send`, effect: \"write\",\n description: \"Send a message, optionally continuing an Eve session and waiting for its answer.\",\n meta: { cli: { positional: [\"message\"] } },\n input: object({\n message: string({\n minLength: 1,\n maxLength: 65_536,\n description: \"Message to send, or a text answer to a pending question. With option-id, only the selected option is submitted.\",\n }),\n runId: optional(string({ minLength: 1, description: \"Continue this Eve session. Omit to begin a new conversation.\" })),\n requestId: optional(string({ minLength: 1, description: \"Pending question to answer. Required when several questions are waiting; use with run-id.\" })),\n optionId: optional(string({ minLength: 1, description: \"Answer option ID shown by result. Required for questions that do not accept freeform text; use with run-id.\" })),\n wait: optional(boolean({ description: \"Wait for an answer, pending input, failure, or cancellation. Otherwise return the run ID immediately.\" })),\n timeoutMs: optional(integer({\n minimum: 1,\n maximum: 300_000,\n description: \"Wait limit in milliseconds after acceptance (default: 30000; maximum: 300000). Only used with wait. Expiry leaves Eve running.\",\n })),\n }),\n output: sendOutput,\n toPresentation: presentAgentResult,\n handler: async ({ input, signal }) => {\n await authorize(\"send\", input.runId);\n if (!input.runId && (input.requestId || input.optionId)) throw new Error(\"Question answers require a runId\");\n const waiting = new AbortController();\n const requestSignal = AbortSignal.any([signalFor(signal), waiting.signal]);\n const sendOptions = { signal: requestSignal, reconnect: false as const };\n let delivery: Delivery;\n let answered: Interaction | undefined;\n let view = emptySessionView();\n let cursor = 0;\n if (input.runId) {\n const run = await readRun(input.runId, signal);\n ({ view, cursor } = run);\n const session = options.client.sessions.attach(input.runId, { streamIndex: cursor });\n const open = openInteractions(view);\n const pending = questionsOf(open);\n if (input.requestId || pending.length) {\n const selected = input.requestId ? pending.find(entry => entry.requestId === input.requestId)\n : pending.length === 1 ? pending[0] : undefined;\n if (!selected || run.result.status !== \"waiting\") throw new Error(\"Specify requestId for a current pending question\");\n if (input.optionId) {\n if (!selected.options?.some(option => option.id === input.optionId)) throw new Error(\"Unknown answer option\");\n } else if (selected.allowFreeform === false || (selected.options?.length && selected.allowFreeform !== true)) {\n throw new Error(\"This question requires optionId\");\n }\n answered = interaction(view, selected.requestId);\n delivery = await session.respond([{\n interactionId: selected.requestId,\n ...(input.optionId ? { optionId: input.optionId } : { text: input.message }),\n }], sendOptions);\n } else {\n if (input.optionId) throw new Error(\"No pending question for optionId\");\n if (open.length) throw new Error(\"Pending approval or authorization requires host action\");\n delivery = await session.send(input.message, sendOptions);\n }\n if (delivery.sessionId !== input.runId) throw new Error(\"Eve resumed a different session\");\n } else {\n ({ delivery } = await options.client.sessions.create({ message: input.message, ...sendOptions }));\n }\n const runId = delivery.sessionId;\n const accepted = { runId, status: \"running\" as const, cursor: 0, eventCount: 0, requests: [] };\n if (!input.wait) return accepted;\n // Follow from the pre-send cursor until this delivery's turn settles or pauses again.\n // The timer starts after acceptance; aborting this local stream never cancels Eve.\n const timer = setTimeout(() => waiting.abort(), input.timeoutMs ?? 30_000);\n try {\n let line: SessionStreamEvent[] = [];\n let count = 0;\n let boundary: string | undefined | false = false;\n const stream = options.client.sessions.attach(runId).stream({ startIndex: cursor, signal: requestSignal, reconnect: false });\n for await (const event of stream) {\n requestSignal.throwIfAborted();\n if (++count > maxEvents) throw new Error(\"Eve response exceeds maxEventsPerRead\");\n line.push(event);\n if (event.meta.endOfLine === false) continue;\n view = foldEvents(view, line);\n line = [];\n if (settled(view, delivery.deliveryId, answered)) {\n boundary = deliveryOf(view, delivery.deliveryId)?.turnId ?? answered?.turnId;\n break;\n }\n }\n requestSignal.throwIfAborted();\n if (boundary === false) return accepted;\n // Summarize this delivery's turn, not whichever turn is newest by the time of the reread.\n const run = await readRun(runId, requestSignal, 0, boundary);\n return { runId, ...run.result };\n } catch (error) {\n signalFor(signal).throwIfAborted();\n if (waiting.signal.aborted) return accepted;\n throw error;\n } finally {\n clearTimeout(timer);\n waiting.abort();\n }\n },\n }),\n result: capability({\n id: `${options.name}.result`, effect: \"read\",\n description: \"Read bounded progress, pending questions, or the final output. Pass the last returned cursor.\",\n input: object({\n runId,\n cursor: withDefault(\n integer({\n minimum: 0,\n description: \"Cursor from the previous result, used to count new events. Defaults to 0; the full current result is still returned.\",\n }),\n 0,\n ),\n }),\n output: resultSchema,\n toPresentation: presentAgentResult,\n handler: async ({ input, signal }) => {\n await authorize(\"result\", input.runId);\n const run = await readRun(input.runId, signal, input.cursor);\n if (input.cursor > run.cursor) throw new Error(\"Eve cursor is ahead of this run\");\n return run.result;\n },\n }),\n cancel: capability({\n id: `${options.name}.cancel`, effect: \"write\",\n description: \"Cancel the active Eve turn. Pending means Eve accepted the request but has not confirmed it yet.\",\n input: object({\n runId,\n turnId: optional(string({\n minLength: 1,\n description: \"Specific Eve turn to cancel. Omit to cancel the session’s active turn.\",\n })),\n }),\n output: object({ status: enumOf(\"accepted\", \"pending\", \"no_active_turn\") }),\n toPresentation: ({ status }) => status === \"accepted\" ? \"Cancelled the active turn.\"\n : status === \"pending\" ? \"Cancellation requested. Check the result to confirm execution has stopped.\"\n : \"No active turn to cancel.\",\n handler: async ({ input, signal }) => {\n await authorize(\"cancel\", input.runId);\n signalFor(signal).throwIfAborted();\n // Cancellation can run alongside a bounded result read.\n const delivery = await options.client.sessions.attach(input.runId).cancel({\n signal: signalFor(signal),\n ...(input.turnId ? { turnId: input.turnId } : {}),\n });\n // Bound the local confirmation read; expiry leaves the accepted cancel to Eve.\n const confirm = new AbortController();\n const timer = setTimeout(() => confirm.abort(), timeoutMs);\n try {\n const { outcome } = await delivery.result({ signal: AbortSignal.any([signalFor(signal), confirm.signal]) });\n if (outcome === \"applied\") return { status: \"accepted\" as const };\n if (outcome === \"ignored\") return { status: \"no_active_turn\" as const };\n throw new Error(\"Eve cancellation failed\");\n } catch (error) {\n signalFor(signal).throwIfAborted();\n if (confirm.signal.aborted) return { status: \"pending\" as const };\n throw error;\n } finally {\n clearTimeout(timer);\n }\n },\n }),\n };\n // Widen the key during construction: TypeScript cannot reduce context inference\n // for a generic mapped namespace, although all three capabilities are context-free.\n const checked: AgentCapabilities = capabilities;\n const app = createApp(defineApp({ capabilities: { [options.name]: checked } })) as App<{ [K in TName]: AgentCapabilities }>;\n return {\n app,\n dispose() {\n lifetime.abort();\n },\n };\n}\n\nfunction positive(value: number, name: string) {\n if (!Number.isSafeInteger(value) || value < 1) throw new Error(`${name} must be a positive safe integer`);\n return value;\n}\n\nfunction questionsOf(open: readonly Interaction[]): Question[] {\n const found = open.filter(entry => entry.request.kind === \"question\");\n if (found.length > 100) throw new Error(\"Eve question limit exceeded\");\n return found.map(entry => {\n // Deliberate allowlist: no call input, tool names, sign-in details, or credentials.\n const safe = question.parse({ ...entry.request, requestId: entry.interactionId });\n if (JSON.stringify(safe).length > 65_536) throw new Error(\"Eve question limit exceeded\");\n return safe;\n });\n}\n\nfunction summarize(view: SessionView, cursor: number, eventCount: number, turnId?: string): EveAgentResult {\n const base = { cursor, eventCount, requests: [] };\n const latest = turnId ? turn(view, turnId) : turns(view).at(-1);\n // Raw failure details can include private tool arguments or credentials.\n if (failure(view, latest?.turnId)) return { ...base, status: \"failed\", error: \"Eve agent execution failed\" };\n const open = openInteractions(view).filter(entry => !turnId || entry.turnId === turnId);\n if (open.length) {\n const requests = questionsOf(open);\n return { ...base, status: \"waiting\", requests, requiresHostInput: requests.length < open.length };\n }\n if (!latest || latest.status === \"running\") return { ...base, status: \"running\" };\n if (latest.outcome === \"cancelled\") return { ...base, status: \"cancelled\" };\n if (latest.outcome !== \"completed\") return { ...base, status: \"failed\", error: \"Eve agent execution failed\" };\n const result: EveAgentResult = { ...base, status: \"completed\" };\n const text = reply(view, latest.turnId).flatMap(part => part.kind === \"text\" && typeof part.value === \"string\" ? [part.value] : []).join(\"\");\n if (text) {\n result.text = text.slice(0, 65_536);\n if (text.length > 65_536) result.textTruncated = true;\n }\n const data = parts(view, { turnId: latest.turnId, kind: \"result\" }).at(-1)?.value;\n if (data !== undefined) {\n if (JSON.stringify(data).length > 65_536) result.dataOmitted = true;\n else result.data = parseJsonValue(data);\n }\n return result;\n}\n\n/** True once the delivery settled and its turn settled or paused on a new interaction. */\nfunction settled(view: SessionView, deliveryId: string, answered?: Interaction) {\n const received = deliveryOf(view, deliveryId);\n if (received?.status !== \"settled\") return sessionOf(view).status === \"ended\";\n const turnId = received.turnId ?? answered?.turnId;\n if (!turnId) return true;\n return turn(view, turnId)?.status === \"settled\"\n || openInteractions(view).some(entry => entry.turnId === turnId && entry.interactionId !== answered?.interactionId);\n}\n","import {\n getAppRuntime,\n getCapabilityDisplay,\n flattenManifestCapabilities,\n type AnyApp,\n type ManifestCapability,\n} from \"@capable/app\";\nimport type { CapabilityMetaRegistry } from \"@capable/core\";\nimport {\n defineDynamic,\n defineTool,\n type DynamicContext,\n type DynamicSentinel,\n type DynamicToolResult,\n type ToolDefinition,\n} from \"eve/tools\";\nimport type { Approval } from \"eve/tools/approval\";\n\nexport type EveCapabilityMeta =\n | false\n | {\n readonly name?: string;\n };\n\ndeclare module \"@capable/core\" {\n interface CapabilityMetaRegistry {\n readonly eve?: EveCapabilityMeta;\n }\n}\n\nexport type CreateEveToolsOptions = {\n readonly approval?: (\n capability: ManifestCapability,\n ) => Approval | undefined;\n};\n\n/** Providers receive only the session; discovery and execution both supply one. */\nexport type EveAppContext = { readonly session: DynamicContext[\"session\"] };\n\nexport type EveAppProvider =\n | AnyApp\n | ((context: EveAppContext) => AnyApp | Promise<AnyApp>);\n\nconst emptyInputSchema = Object.freeze({\n type: \"object\",\n properties: Object.freeze({}),\n additionalProperties: false,\n});\n\ntype EveTool = ToolDefinition<Record<string, unknown>, unknown>;\n\n/**\n * Projects an executable Capable App into native, in-process Eve tools.\n *\n * Eve evaluates the resolver before every model call. The App manifest is\n * memoized per session, and each call rebuilds the App from the execution\n * session. Keep persistent data outside the process.\n */\nexport function createEveTools(\n app: EveAppProvider,\n options: CreateEveToolsOptions = {},\n): DynamicSentinel<DynamicToolResult> {\n const resolveApp = (context: EveAppContext) =>\n typeof app === \"function\" ? app({ session: context.session }) : app;\n\n return defineDynamic(async (context) => {\n const capabilities = await context.memo(\n [\"capable.manifest\", context.session.id],\n async () => {\n const manifest = await getAppRuntime(await resolveApp(context)).manifest();\n return flattenManifestCapabilities(manifest.capabilities);\n },\n );\n const tools: Record<string, EveTool> = {};\n const names = new Set<string>();\n\n for (const capability of capabilities) {\n const display = getCapabilityDisplay(capability);\n const meta = capability.meta.eve as EveCapabilityMeta | undefined;\n if (meta === false) continue;\n if (capability.execution === \"events\") {\n if (meta !== undefined) {\n throw new Error(\n `Event Capability \"${capability.id}\" cannot be exposed as an Eve tool`,\n );\n }\n continue;\n }\n\n const name = meta?.name ?? capability.path.join(\"__\");\n if (!/^[A-Za-z0-9_-]{1,64}$/.test(name)) {\n throw new Error(\n `Eve tool name \"${name}\" is invalid; set meta.eve.name to 1-64 letters, numbers, underscores, or hyphens`,\n );\n }\n if (names.has(name)) {\n throw new Error(`Duplicate Eve tool name \"${name}\"`);\n }\n names.add(name);\n\n const approval = options.approval?.(capability);\n const id = capability.id;\n tools[name] = defineTool({\n description:\n display.description ??\n display.title ??\n `Run the Capable Capability at ${capability.path.join(\".\")}.`,\n inputSchema: (capability.input ??\n emptyInputSchema) as EveTool[\"inputSchema\"],\n ...(capability.output\n ? {\n outputSchema:\n capability.output as NonNullable<EveTool[\"outputSchema\"]>,\n }\n : {}),\n ...(approval ? { approval } : {}),\n execute: async (input, toolContext) => {\n // A rejected approval can change the latest resolver's caller.\n // Rebuild per-caller Apps from the actual execution identity.\n const executionApp = await resolveApp({ session: toolContext.session });\n const result = await getAppRuntime(executionApp).call({\n id, input, signal: toolContext.abortSignal,\n });\n return result.output;\n },\n });\n }\n\n return tools;\n });\n}\n\nexport {\n createEveAgentAdapter,\n type EveAgentAdapter,\n type EveAgentAdapterOptions,\n type EveAgentOperation,\n type EveAgentData,\n type EveAgentQuestion,\n type EveAgentResult,\n} from \"./agent.ts\";\n"],"mappings":";;;;;AAcA,IAAM,UAAN,cAAsB,MAAM;CAC1B;CAEA,YAAY,MAAY,SAAiB;EACvC,MAAM,OAAO;EACb,KAAK,OAAO;CACd;AACF;AAEA,SAAS,KAAK,MAAY,SAAwB;CAChD,MAAM,IAAI,QAAQ,MAAM,OAAO;AACjC;AAgBA,SAAS,MACP,SACA,MACwB;CACxB,OAAO;EACL,QAAQ,UAAU,QAAQ,OAAO,CAAC,CAAC;EACnC;EACA;EACA,eAAe;EACf,gBAAgB;CAClB;AACF;AAEA,SAAgB,OACd,UAII,CAAC,GACkB;CACvB,OAAO,OAAuB,OAAO,SAAS;EAC5C,IAAI,OAAO,UAAU,UAAU,KAAK,MAAM,iBAAiB;EAC3D,IAAI,QAAQ,cAAc,KAAA,KAAa,MAAM,SAAS,QAAQ,WAC5D,KAAK,MAAM,qBAAqB,QAAQ,UAAU,YAAY;EAEhE,IAAI,QAAQ,cAAc,KAAA,KAAa,MAAM,SAAS,QAAQ,WAC5D,KAAK,MAAM,oBAAoB,QAAQ,UAAU,YAAY;EAE/D,OAAO;CACT,UAAU;EACR,MAAM;EACN,GAAI,QAAQ,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,WAAW,QAAQ,UAAU;EAC1E,GAAI,QAAQ,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,WAAW,QAAQ,UAAU;EAC1E,GAAI,QAAQ,gBAAgB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa,QAAQ,YAAY;CAClF,EAAE;AACJ;AAEA,SAAgB,QACd,UAII,CAAC,GACkB;CACvB,MAAM,UAAU,QAAQ,WAAW,CAAC,OAAO;CAC3C,MAAM,UAAU,QAAQ,WAAW,OAAO;CAC1C,OAAO,OAAuB,OAAO,SAAS;EAC5C,IAAI,OAAO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;GAEF,IAAI,MAAM,IAAI,IAAI,GAChB,MAAM,IAAI,MAAM,4BAA4B,KAAK,EAAE;GAErD,MAAM,IAAI,IAAI;GAEd,MAAM,WAAW,QAAQ,WAAW,UAAU;GAC9C,MAAM,KAAK,WAAW;GACtB,MAAM,QAAQ,WAAW;IACvB,aACE,QAAQ,eACR,QAAQ,SACR,iCAAiC,WAAW,KAAK,KAAK,GAAG,EAAE;IAC7D,aAAc,WAAW,SACvB;IACF,GAAI,WAAW,SACX,EACE,cACE,WAAW,OACf,IACA,CAAC;IACL,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;IAC/B,SAAS,OAAO,OAAO,gBAAgB;KAOrC,QAAO,MAHc,cAAc,MADR,WAAW,EAAE,SAAS,YAAY,QAAQ,CAAC,CACvB,CAAC,CAAC,KAAK;MACpD;MAAI;MAAO,QAAQ,YAAY;KACjC,CAAC,EAAA,CACa;IAChB;GACF,CAAC;EACH;EAEA,OAAO;CACT,CAAC;AACH"}
|
package/dist/http.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as HttpGroupMeta, c as FetchHandler, d as createProtocolHandler, f as JsonValue, i as HttpCapabilityMeta, l as TransportHeaders, m as defineProtocolCodec, n as CompiledHttpRoute, o as HttpMethod, p as ProtocolCodec, r as ContextProvider, s as createHttpHandler, t as CapabilitySelection, u as createHttpTransport } from "./index-
|
|
1
|
+
import { a as HttpGroupMeta, c as FetchHandler, d as createProtocolHandler, f as JsonValue, i as HttpCapabilityMeta, l as TransportHeaders, m as defineProtocolCodec, n as CompiledHttpRoute, o as HttpMethod, p as ProtocolCodec, r as ContextProvider, s as createHttpHandler, t as CapabilitySelection, u as createHttpTransport } from "./index-CwvjDizW.mjs";
|
|
2
2
|
export { type CapabilitySelection, type CompiledHttpRoute, type ContextProvider, type FetchHandler, type HttpCapabilityMeta, type HttpGroupMeta, type HttpMethod, type JsonValue, type ProtocolCodec, type TransportHeaders, createHttpHandler, createHttpTransport, createProtocolHandler, defineProtocolCodec };
|
package/dist/http.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as defineProtocolCodec, n as createHttpTransport, r as createProtocolHandler, t as createHttpHandler } from "./src-
|
|
1
|
+
import { i as defineProtocolCodec, n as createHttpTransport, r as createProtocolHandler, t as createHttpHandler } from "./src-Bk3lEhI7.mjs";
|
|
2
2
|
export { createHttpHandler, createHttpTransport, createProtocolHandler, defineProtocolCodec };
|
|
@@ -65,6 +65,12 @@ type AnyDefinedErrors = {
|
|
|
65
65
|
readonly [CAPABILITY_ERROR_DEFINITIONS_SYMBOL]: CapabilityErrorContract;
|
|
66
66
|
};
|
|
67
67
|
declare function defineErrors<const TDefinitions extends CapabilityErrorContract>(definitions: TDefinitions): DefinedErrors<TDefinitions>;
|
|
68
|
+
/** @internal Mark an error as validated for external wire serialization. */
|
|
69
|
+
declare function markPublicError<TError extends object>(error: TError): TError;
|
|
70
|
+
/** @internal Revoke wire-serialization permission when an error escapes an unvalidated seam. */
|
|
71
|
+
declare function unmarkPublicError(error: unknown): void;
|
|
72
|
+
/** @internal True only for errors explicitly validated or created at a public boundary. */
|
|
73
|
+
declare function isPublicError(error: unknown): boolean;
|
|
68
74
|
//#endregion
|
|
69
75
|
//#region packages/core/src/projection.d.ts
|
|
70
76
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -145,7 +151,7 @@ declare function group<const TCapabilities extends CapabilityTree, const TErrors
|
|
|
145
151
|
readonly title?: string;
|
|
146
152
|
readonly description?: string;
|
|
147
153
|
readonly errors?: TErrors;
|
|
148
|
-
readonly middleware?: readonly CapabilityMiddleware<
|
|
154
|
+
readonly middleware?: readonly CapabilityMiddleware<NoInfer<SharedContext<TCapabilities>>>[];
|
|
149
155
|
readonly meta?: TMeta;
|
|
150
156
|
readonly capabilities: TCapabilities;
|
|
151
157
|
}): CapabilityGroupDefinition<TCapabilities, TErrors, TMeta>;
|
|
@@ -162,19 +168,24 @@ type AppDefinition<TCapabilities extends CapabilityTree = CapabilityTree, TConte
|
|
|
162
168
|
readonly name: string;
|
|
163
169
|
readonly version: string;
|
|
164
170
|
readonly description?: string;
|
|
171
|
+
readonly errors: AnyDefinedErrors;
|
|
172
|
+
readonly middleware: readonly CapabilityMiddleware<any>[];
|
|
165
173
|
readonly capabilities: TCapabilities;
|
|
166
174
|
readonly locatedCapabilities: readonly LocatedCapability[];
|
|
167
175
|
readonly "~capable/context"?: TContext;
|
|
168
176
|
};
|
|
169
|
-
type CapabilityTreeContext<TTree> = TTree extends CapabilityDefinition<infer TContext, any, any, any, any> ? TContext : TTree extends CapabilityGroupDefinition<infer TCapabilities, any, any> ? CapabilityTreeContext<TCapabilities> : TTree extends Readonly<Record<string, unknown>> ? CapabilityTreeContext<TTree[keyof TTree]> : never;
|
|
177
|
+
type CapabilityTreeContext<TTree> = TTree extends CapabilityDefinition<infer TContext, any, any, any, any> ? TContext : TTree extends CapabilityGroupDefinition<infer TCapabilities, any, any> ? CapabilityTreeContext<TCapabilities> : TTree extends Readonly<Record<string, unknown>> ? CapabilityTree extends TTree ? unknown : CapabilityTreeContext<TTree[keyof TTree]> : never;
|
|
170
178
|
type UnionToIntersection<TValue> = (TValue extends unknown ? (value: TValue) => void : never) extends ((value: infer TIntersection) => void) ? TIntersection : never;
|
|
179
|
+
type SharedContext<TCapabilities> = [Exclude<CapabilityTreeContext<TCapabilities>, undefined>] extends [never] ? undefined : UnionToIntersection<Exclude<CapabilityTreeContext<TCapabilities>, undefined>>;
|
|
171
180
|
type AppContext<TDefinition extends AppDefinition<any, any>> = TDefinition extends AppDefinition<any, infer TContext> ? TContext : never;
|
|
172
181
|
declare function defineApp<const TCapabilities extends CapabilityTree>(config: {
|
|
173
182
|
readonly name?: string;
|
|
174
183
|
readonly version?: string;
|
|
175
184
|
readonly description?: string;
|
|
185
|
+
readonly errors?: AnyDefinedErrors;
|
|
186
|
+
readonly middleware?: readonly CapabilityMiddleware<NoInfer<SharedContext<TCapabilities>>>[];
|
|
176
187
|
readonly capabilities: TCapabilities;
|
|
177
|
-
}): AppDefinition<TCapabilities,
|
|
188
|
+
}): AppDefinition<TCapabilities, SharedContext<TCapabilities>>;
|
|
178
189
|
declare function isCapabilityGroup(value: unknown): value is AnyCapabilityGroup;
|
|
179
190
|
//#endregion
|
|
180
191
|
//#region packages/core/src/capability.d.ts
|
|
@@ -197,13 +208,19 @@ type CapabilitySubscriberArgs<TContext, TInput> = {
|
|
|
197
208
|
};
|
|
198
209
|
type CapabilitySubscriber<TContext, TInput, TOutput> = (args: CapabilitySubscriberArgs<TContext, TInput>) => AsyncIterable<TOutput>;
|
|
199
210
|
type CapabilityMiddlewareArgs<TContext, TInput = unknown> = {
|
|
211
|
+
readonly capability: {
|
|
212
|
+
readonly id: string;
|
|
213
|
+
readonly effect: CapabilityEffect | undefined;
|
|
214
|
+
};
|
|
215
|
+
readonly mode: "call" | "subscribe";
|
|
200
216
|
readonly input: TInput;
|
|
201
217
|
readonly context: TContext;
|
|
202
218
|
readonly signal?: AbortSignal;
|
|
203
219
|
next(): Promise<unknown>;
|
|
204
220
|
};
|
|
205
221
|
type CapabilityMiddleware<TContext, TInput = unknown> = (args: CapabilityMiddlewareArgs<TContext, TInput>) => MaybePromise<unknown>;
|
|
206
|
-
type
|
|
222
|
+
type CapabilityExecution = "unary" | "live" | "events";
|
|
223
|
+
type CapabilityDefinition<TContext = unknown, TInput extends AnyObjectSchema | undefined = AnyObjectSchema | undefined, TOutput = unknown, TErrors extends AnyDefinedErrors = AnyDefinedErrors, TMeta extends OpenMeta<CapabilityMetaRegistry> = OpenMeta<CapabilityMetaRegistry>, TExecution extends CapabilityExecution = CapabilityExecution> = {
|
|
207
224
|
readonly [CAPABILITY_SYMBOL]: true;
|
|
208
225
|
readonly id: string;
|
|
209
226
|
readonly title?: string;
|
|
@@ -215,19 +232,31 @@ type CapabilityDefinition<TContext = unknown, TInput extends AnyObjectSchema | u
|
|
|
215
232
|
readonly errors: TErrors;
|
|
216
233
|
readonly middleware: readonly CapabilityMiddleware<TContext, ParsedInput<TInput>>[];
|
|
217
234
|
readonly meta: TMeta;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
235
|
+
toPresentation?(output: TOutput, options: {
|
|
236
|
+
readonly context: TContext;
|
|
237
|
+
}): MaybePromise<PresentationValue>;
|
|
221
238
|
readonly "~capable/context"?: (context: TContext) => TContext;
|
|
222
239
|
readonly "~capable/input"?: TInput;
|
|
223
240
|
readonly "~capable/output"?: TOutput;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
241
|
+
} & (TExecution extends "events" ? {
|
|
242
|
+
readonly execution: "events";
|
|
243
|
+
readonly handler?: never;
|
|
244
|
+
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, any>;
|
|
245
|
+
} : TExecution extends "live" ? {
|
|
246
|
+
readonly execution: "live";
|
|
247
|
+
readonly handler: (args: CapabilityHandlerArgs<TContext, ParsedInput<TInput>>) => MaybePromise<TOutput>;
|
|
248
|
+
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, any>;
|
|
249
|
+
} : {
|
|
250
|
+
readonly execution: "unary";
|
|
251
|
+
readonly handler: (args: CapabilityHandlerArgs<TContext, ParsedInput<TInput>>) => MaybePromise<TOutput>;
|
|
252
|
+
readonly subscribe?: never;
|
|
253
|
+
});
|
|
254
|
+
type AnyCapability = CapabilityDefinition<any, any, any, any, any, CapabilityExecution>;
|
|
227
255
|
type CapabilityInput<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<any, infer TInput, any, any, any> ? TInput extends AnyObjectSchema ? InferSchemaInput<TInput> : EmptyInput : never;
|
|
228
256
|
type CapabilityOutput<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<any, any, infer TOutput, any, any> ? TOutput : never;
|
|
229
257
|
type CapabilityContext<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<infer TContext, any, any, any, any> ? TContext : never;
|
|
230
|
-
type SubscribableCapability = CapabilityDefinition<any, any, any, any, any,
|
|
258
|
+
type SubscribableCapability = CapabilityDefinition<any, any, any, any, any, "live" | "events">;
|
|
259
|
+
type CallableCapability = CapabilityDefinition<any, any, any, any, any, "unary" | "live">;
|
|
231
260
|
type ExecuteCapabilityOptions<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<infer TContext, infer TInput, any, any, any> ? (TInput extends AnyObjectSchema ? {
|
|
232
261
|
readonly input: InferSchemaInput<TInput>;
|
|
233
262
|
} : {
|
|
@@ -256,32 +285,46 @@ type ExplicitOutputCapabilityConfig<TContext, TInput extends AnyObjectSchema | u
|
|
|
256
285
|
readonly toPresentation?: PresentationRenderer<InferSchemaOutput<TOutput>, TContext>;
|
|
257
286
|
readonly subscribe?: CapabilitySubscriber<TContext, ParsedInput<TInput>, InferSchemaInput<TOutput>>;
|
|
258
287
|
};
|
|
259
|
-
type InferredOutputCapabilityConfig<TContext, TInput extends AnyObjectSchema | undefined,
|
|
288
|
+
type InferredOutputCapabilityConfig<TContext, TInput extends AnyObjectSchema | undefined, TReturn, TErrors extends AnyDefinedErrors, TMeta extends OpenMeta<CapabilityMetaRegistry>> = CapabilityBaseConfig<TContext, TInput, TErrors, TMeta> & {
|
|
289
|
+
readonly output?: never;
|
|
290
|
+
readonly handler: (args: CapabilityHandlerArgs<TContext, ParsedInput<TInput>>) => TReturn;
|
|
291
|
+
readonly toPresentation?: PresentationRenderer<Awaited<TReturn>, TContext>;
|
|
292
|
+
readonly subscribe?: CapabilitySubscriber<TContext, ParsedInput<TInput>, Awaited<TReturn>>;
|
|
293
|
+
};
|
|
294
|
+
type ExplicitEventConfig<TContext, TInput extends AnyObjectSchema | undefined, TOutput extends AnySchema, TErrors extends AnyDefinedErrors, TMeta extends OpenMeta<CapabilityMetaRegistry>> = Omit<ExplicitOutputCapabilityConfig<TContext, TInput, TOutput, TErrors, TMeta>, "handler" | "subscribe" | "effect"> & {
|
|
295
|
+
readonly handler?: never;
|
|
296
|
+
readonly effect: "read";
|
|
297
|
+
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, InferSchemaInput<TOutput>>;
|
|
298
|
+
};
|
|
299
|
+
type InferredEventConfig<TContext, TInput extends AnyObjectSchema | undefined, TOutput, TErrors extends AnyDefinedErrors, TMeta extends OpenMeta<CapabilityMetaRegistry>> = CapabilityBaseConfig<TContext, TInput, TErrors, TMeta> & {
|
|
300
|
+
readonly handler?: never;
|
|
260
301
|
readonly output?: never;
|
|
261
|
-
readonly
|
|
262
|
-
readonly
|
|
263
|
-
readonly
|
|
302
|
+
readonly effect: "read";
|
|
303
|
+
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, TOutput>;
|
|
304
|
+
readonly toPresentation?: PresentationRenderer<NoInfer<TOutput>, TContext>;
|
|
264
305
|
};
|
|
265
306
|
type CapabilityFactory<TContext> = {
|
|
307
|
+
<TInput extends AnyObjectSchema | undefined = undefined, TOutput extends AnySchema = AnySchema, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: ExplicitEventConfig<TContext, TInput, TOutput, TErrors, TMeta>): CapabilityDefinition<TContext, TInput, InferSchemaOutput<TOutput>, TErrors, TMeta, "events">;
|
|
308
|
+
<TInput extends AnyObjectSchema | undefined = undefined, TOutput = unknown, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: InferredEventConfig<TContext, TInput, TOutput, TErrors, TMeta>): CapabilityDefinition<TContext, TInput, TOutput, TErrors, TMeta, "events">;
|
|
266
309
|
<TInput extends AnyObjectSchema | undefined = undefined, TOutput extends AnySchema = AnySchema, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: ExplicitOutputCapabilityConfig<TContext, TInput, TOutput, TErrors, TMeta> & {
|
|
267
310
|
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, InferSchemaInput<TOutput>>;
|
|
268
|
-
}): CapabilityDefinition<TContext, TInput, InferSchemaOutput<TOutput>, TErrors, TMeta,
|
|
311
|
+
}): CapabilityDefinition<TContext, TInput, InferSchemaOutput<TOutput>, TErrors, TMeta, "live">;
|
|
269
312
|
<TInput extends AnyObjectSchema | undefined = undefined, TOutput extends AnySchema = AnySchema, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: ExplicitOutputCapabilityConfig<TContext, TInput, TOutput, TErrors, TMeta> & {
|
|
270
313
|
readonly subscribe?: never;
|
|
271
|
-
}): CapabilityDefinition<TContext, TInput, InferSchemaOutput<TOutput>, TErrors, TMeta,
|
|
272
|
-
<TInput extends AnyObjectSchema | undefined = undefined,
|
|
273
|
-
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, Awaited<
|
|
274
|
-
}): CapabilityDefinition<TContext, TInput, Awaited<
|
|
275
|
-
<TInput extends AnyObjectSchema | undefined = undefined,
|
|
314
|
+
}): CapabilityDefinition<TContext, TInput, InferSchemaOutput<TOutput>, TErrors, TMeta, "unary">;
|
|
315
|
+
<TInput extends AnyObjectSchema | undefined = undefined, TReturn = unknown, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: InferredOutputCapabilityConfig<TContext, TInput, TReturn, TErrors, TMeta> & {
|
|
316
|
+
readonly subscribe: CapabilitySubscriber<TContext, ParsedInput<TInput>, Awaited<TReturn>>;
|
|
317
|
+
}): CapabilityDefinition<TContext, TInput, Awaited<TReturn>, TErrors, TMeta, "live">;
|
|
318
|
+
<TInput extends AnyObjectSchema | undefined = undefined, TReturn = unknown, const TErrors extends AnyDefinedErrors = DefinedNoErrors, const TMeta extends OpenMeta<CapabilityMetaRegistry> = {}>(config: InferredOutputCapabilityConfig<TContext, TInput, TReturn, TErrors, TMeta> & {
|
|
276
319
|
readonly subscribe?: never;
|
|
277
|
-
}): CapabilityDefinition<TContext, TInput, Awaited<
|
|
320
|
+
}): CapabilityDefinition<TContext, TInput, Awaited<TReturn>, TErrors, TMeta, "unary">;
|
|
278
321
|
};
|
|
279
322
|
type CapabilityFunction = CapabilityFactory<undefined> & {
|
|
280
323
|
<TContext>(): CapabilityFactory<TContext>;
|
|
281
324
|
withContext<TContext>(): CapabilityFactory<TContext>;
|
|
282
325
|
};
|
|
283
326
|
declare const capability: CapabilityFunction;
|
|
284
|
-
declare function executeCapability<const TCapability extends
|
|
327
|
+
declare function executeCapability<const TCapability extends CallableCapability>(capability: TCapability, options: ExecuteCapabilityOptions<TCapability>): Promise<CapabilityOutput<TCapability>>;
|
|
285
328
|
declare function executeLocatedCapability(located: LocatedCapability, input: unknown, options: {
|
|
286
329
|
readonly context: unknown;
|
|
287
330
|
readonly signal?: AbortSignal;
|
|
@@ -291,8 +334,8 @@ declare function subscribeCapability<const TCapability extends SubscribableCapab
|
|
|
291
334
|
declare function subscribeLocatedCapability(located: LocatedCapability, input: unknown, options: {
|
|
292
335
|
readonly context: unknown;
|
|
293
336
|
readonly signal?: AbortSignal;
|
|
294
|
-
}): AsyncIterableIterator<unknown
|
|
337
|
+
}): Promise<AsyncIterableIterator<unknown>>;
|
|
295
338
|
declare function isCapability(value: unknown): value is AnyCapability;
|
|
296
339
|
//#endregion
|
|
297
|
-
export {
|
|
298
|
-
//# sourceMappingURL=index-
|
|
340
|
+
export { CapabilityErrorContract as $, CAPABILITY_GROUP_SYMBOL as A, MarkdownPresentationPart as B, isCapability as C, AnyCapabilityGroup as D, APPLICATION_SYMBOL as E, defineApp as F, TablePresentationPart as G, PresentationRenderer as H, group as I, renderPresentationMarkdown as J, normalizePresentation as K, isCapabilityGroup as L, CapabilityTree as M, GroupMetaRegistry as N, AppContext as O, LocatedCapability as P, CAPABILITY_ERRORS_SYMBOL as Q, FilePresentationPart as R, executeLocatedCapability as S, subscribeLocatedCapability as T, PresentationTableCell as U, PresentationPart as V, PresentationValue as W, md as X, MaybePromise as Y, AnyDefinedErrors as Z, ExecuteCapabilityOptions as _, CapabilityDefinition as a, defineErrors as at, capability as b, CapabilityFactory as c, unmarkPublicError as ct, CapabilityMetaRegistry as d, InferSchemaInput as dt, CapabilityErrorDefinition as et, CapabilityMiddleware as f, InferSchemaOutput as ft, CapabilitySubscriberArgs as g, schemaToJsonSchema as gt, CapabilitySubscriber as h, parseSchema as ht, CapabilityContext as i, ErrorMetaRegistry as it, CapabilityGroupDefinition as j, AppDefinition as k, CapabilityHandlerArgs as l, AnyObjectSchema as lt, CapabilityOutput as m, SchemaValidationError as mt, CAPABILITY_SYMBOL as n, CapableError as nt, CapabilityEffect as o, isPublicError as ot, CapabilityMiddlewareArgs as p, Schema as pt, present as q, CallableCapability as r, DefinedErrors as rt, CapabilityExecution as s, markPublicError as st, AnyCapability as t, CapabilityErrorFactory as tt, CapabilityInput as u, AnySchema as ut, SubscribableCapability as v, subscribeCapability as w, executeCapability as x, SubscribeCapabilityOptions as y, ImagePresentationPart as z };
|
|
341
|
+
//# sourceMappingURL=index-BIO_hbXJ.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ApplicationSelection } from "./index-
|
|
3
|
-
import { p as ProtocolCodec, r as ContextProvider, t as CapabilitySelection } from "./index-
|
|
1
|
+
import { Y as MaybePromise, k as AppDefinition } from "./index-BIO_hbXJ.mjs";
|
|
2
|
+
import { t as ApplicationSelection } from "./index-F_eaksy8.mjs";
|
|
3
|
+
import { p as ProtocolCodec, r as ContextProvider, t as CapabilitySelection } from "./index-CwvjDizW.mjs";
|
|
4
4
|
//#region packages/server/src/index.d.ts
|
|
5
5
|
type ServerMount<TContext> = {
|
|
6
6
|
readonly kind: "capable.server.mount";
|
|
@@ -40,4 +40,4 @@ type CreateServerArgs<TContext> = [TContext] extends [undefined] ? [options?: Cr
|
|
|
40
40
|
declare function createServer<TContext>(app: AppDefinition<any, TContext>, ...[providedOptions]: CreateServerArgs<TContext>): CapableServer;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { createServer as a, ServerMount as i, CompiledServerMount as n, http as o, ServerMiddleware as r, protocol as s, CapableServer as t };
|
|
43
|
-
//# sourceMappingURL=index-
|
|
43
|
+
//# sourceMappingURL=index-C0tU5Y2n.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { M as CapabilityTree, P as LocatedCapability, k as AppDefinition } from "./index-BIO_hbXJ.mjs";
|
|
2
|
+
import { d as AnyApp, t as ApplicationSelection, y as ApplicationTransport } from "./index-F_eaksy8.mjs";
|
|
3
3
|
//#region packages/fetch/src/codec.d.ts
|
|
4
4
|
type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
5
5
|
readonly [key: string]: JsonValue;
|
|
@@ -19,6 +19,7 @@ type FetchHandler = (request: Request) => Response | Promise<Response>;
|
|
|
19
19
|
declare function createProtocolHandler(application: AnyApp | ((request: Request) => AnyApp | Promise<AnyApp>), options?: {
|
|
20
20
|
readonly basePath?: string;
|
|
21
21
|
readonly codec?: ProtocolCodec;
|
|
22
|
+
readonly onError?: (error: unknown) => void;
|
|
22
23
|
}): {
|
|
23
24
|
readonly fetch: FetchHandler;
|
|
24
25
|
};
|
|
@@ -63,6 +64,7 @@ declare function createHttpHandler<const TCapabilities extends CapabilityTree, T
|
|
|
63
64
|
readonly openapiPath?: string | false;
|
|
64
65
|
readonly requireExplicitRoutes?: boolean;
|
|
65
66
|
readonly selection?: CapabilitySelection<TCapabilities>;
|
|
67
|
+
readonly onError?: (error: unknown) => void;
|
|
66
68
|
}): {
|
|
67
69
|
readonly fetch: FetchHandler;
|
|
68
70
|
readonly routes: readonly CompiledHttpRoute[];
|
|
@@ -70,4 +72,4 @@ declare function createHttpHandler<const TCapabilities extends CapabilityTree, T
|
|
|
70
72
|
};
|
|
71
73
|
//#endregion
|
|
72
74
|
export { HttpGroupMeta as a, FetchHandler as c, createProtocolHandler as d, JsonValue as f, HttpCapabilityMeta as i, TransportHeaders as l, defineProtocolCodec as m, CompiledHttpRoute as n, HttpMethod as o, ProtocolCodec as p, ContextProvider as r, createHttpHandler as s, CapabilitySelection as t, createHttpTransport as u };
|
|
73
|
-
//# sourceMappingURL=index-
|
|
75
|
+
//# sourceMappingURL=index-CwvjDizW.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as CapabilityTree, O as AppContext, V as PresentationPart, Y as MaybePromise, a as CapabilityDefinition, dt as InferSchemaInput, j as CapabilityGroupDefinition, k as AppDefinition, lt as AnyObjectSchema, m as CapabilityOutput, s as CapabilityExecution, t as AnyCapability, v as SubscribableCapability } from "./index-BIO_hbXJ.mjs";
|
|
2
2
|
//#region packages/app/src/manifest.d.ts
|
|
3
3
|
type JsonSchema = Readonly<Record<string, unknown>>;
|
|
4
4
|
type ManifestError = {
|
|
@@ -9,15 +9,20 @@ type ManifestError = {
|
|
|
9
9
|
};
|
|
10
10
|
type ManifestCapability = {
|
|
11
11
|
readonly type: "capability";
|
|
12
|
+
readonly customization?: {
|
|
13
|
+
/** Use the Capability's placed path for surface navigation. */
|
|
14
|
+
readonly navigation?: "destination";
|
|
15
|
+
readonly title?: string;
|
|
16
|
+
readonly description?: string;
|
|
17
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
18
|
+
};
|
|
12
19
|
readonly id: string;
|
|
13
20
|
readonly path: readonly string[];
|
|
14
21
|
readonly title?: string;
|
|
15
22
|
readonly description?: string;
|
|
16
23
|
readonly deprecated: boolean;
|
|
17
24
|
readonly effect?: "read" | "write" | "destructive";
|
|
18
|
-
readonly
|
|
19
|
-
readonly mode: "replace";
|
|
20
|
-
};
|
|
25
|
+
readonly execution: CapabilityExecution;
|
|
21
26
|
readonly input?: JsonSchema;
|
|
22
27
|
readonly output?: JsonSchema;
|
|
23
28
|
readonly errors: Readonly<Record<string, ManifestError>>;
|
|
@@ -33,13 +38,14 @@ type ManifestGroup = {
|
|
|
33
38
|
};
|
|
34
39
|
type ManifestNode = ManifestGroup | ManifestCapability;
|
|
35
40
|
type ApplicationManifest = {
|
|
36
|
-
readonly protocol: "capable.capabilities.
|
|
41
|
+
readonly protocol: "capable.capabilities.v4";
|
|
37
42
|
readonly name: string;
|
|
38
43
|
readonly version: string;
|
|
39
44
|
readonly description?: string;
|
|
40
45
|
readonly capabilities: readonly ManifestNode[];
|
|
41
46
|
};
|
|
42
47
|
declare function createAppManifest(definition: AppDefinition<any>): ApplicationManifest;
|
|
48
|
+
declare function flattenManifestCapabilities(nodes: readonly ManifestNode[]): readonly ManifestCapability[];
|
|
43
49
|
//#endregion
|
|
44
50
|
//#region packages/app/src/runtime.d.ts
|
|
45
51
|
type CapabilityCall = {
|
|
@@ -57,12 +63,15 @@ interface ApplicationTransport {
|
|
|
57
63
|
readonly signal?: AbortSignal;
|
|
58
64
|
}): Promise<ApplicationManifest>;
|
|
59
65
|
call(call: CapabilityCall): Promise<CapabilityResult>;
|
|
60
|
-
subscribe(call: CapabilityCall): AsyncIterableIterator<CapabilityResult
|
|
66
|
+
subscribe(call: CapabilityCall): Promise<AsyncIterableIterator<CapabilityResult>>;
|
|
61
67
|
}
|
|
68
|
+
type CreateRemoteAppOptions = {
|
|
69
|
+
readonly manifest?: ApplicationManifest;
|
|
70
|
+
};
|
|
62
71
|
declare const APP_RUNTIME_SYMBOL: unique symbol;
|
|
63
72
|
declare const APP_CAPABILITIES_SYMBOL: unique symbol;
|
|
64
|
-
type
|
|
65
|
-
readonly "~capable/capability"
|
|
73
|
+
type AppCapabilityReference<TCapability extends AnyCapability = AnyCapability> = {
|
|
74
|
+
readonly "~capable/capability": TCapability;
|
|
66
75
|
};
|
|
67
76
|
type AppCapabilityInput<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<any, infer TInput, any, any, any> ? TInput extends AnyObjectSchema ? InferSchemaInput<TInput> : Record<never, never> : never;
|
|
68
77
|
type AppCapabilityOutput<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<any, any, infer TOutput, any, any> ? TOutput : never;
|
|
@@ -70,9 +79,10 @@ type AppCapabilityOptions = {
|
|
|
70
79
|
readonly signal?: AbortSignal;
|
|
71
80
|
};
|
|
72
81
|
type AppCapabilityArgs<TCapability extends AnyCapability> = TCapability extends CapabilityDefinition<any, infer TInput, any, any, any> ? TInput extends undefined ? [input?: Record<never, never>, options?: AppCapabilityOptions] : Record<never, never> extends AppCapabilityInput<TCapability> ? [input?: AppCapabilityInput<TCapability>, options?: AppCapabilityOptions] : [input: AppCapabilityInput<TCapability>, options?: AppCapabilityOptions] : never;
|
|
73
|
-
type AppCapabilityCall<TCapability extends AnyCapability> = ((...args: AppCapabilityArgs<TCapability>) => Promise<AppCapabilityOutput<TCapability>>) &
|
|
74
|
-
type AppCapabilityIsSubscribable<TCall> = TCall extends
|
|
75
|
-
type
|
|
82
|
+
type AppCapabilityCall<TCapability extends AnyCapability> = ((...args: AppCapabilityArgs<TCapability>) => Promise<AppCapabilityOutput<TCapability>>) & AppCapabilityReference<TCapability>;
|
|
83
|
+
type AppCapabilityIsSubscribable<TCall> = TCall extends AppCapabilityReference<infer TCapability> ? TCapability["execution"] extends "live" | "events" ? true : false : false;
|
|
84
|
+
type AppCapabilityIsLive<TCall> = TCall extends AppCapabilityReference<infer TCapability> ? TCapability["execution"] extends "live" ? true : false : false;
|
|
85
|
+
type CallableTree<TTree> = TTree extends AnyCapability ? TTree["execution"] extends "events" ? AppCapabilityReference<TTree> : AppCapabilityCall<TTree> : TTree extends CapabilityGroupDefinition<infer TCapabilities, any, any> ? CallableTree<TCapabilities> : TTree extends CapabilityTree ? { readonly [TKey in keyof TTree]: CallableTree<TTree[TKey]>; } : never;
|
|
76
86
|
type App<TCapabilities extends CapabilityTree = CapabilityTree> = CallableTree<TCapabilities> & {
|
|
77
87
|
readonly [APP_RUNTIME_SYMBOL]: ApplicationTransport;
|
|
78
88
|
readonly [APP_CAPABILITIES_SYMBOL]?: TCapabilities;
|
|
@@ -87,7 +97,7 @@ type AppCapabilities<TApplication extends AnyApp> = TApplication extends {
|
|
|
87
97
|
} ? TCapabilities : never;
|
|
88
98
|
declare function getAppRuntime(app: AnyApp): ApplicationTransport;
|
|
89
99
|
declare function isApp(value: unknown): value is AnyApp;
|
|
90
|
-
declare function subscribe<const TCapability extends SubscribableCapability>(capabilityCall:
|
|
100
|
+
declare function subscribe<const TCapability extends SubscribableCapability>(capabilityCall: AppCapabilityReference<TCapability>, ...args: AppCapabilityArgs<TCapability>): AsyncIterableIterator<CapabilityOutput<TCapability>>;
|
|
91
101
|
type AppContextProvider<TContext> = (call: {
|
|
92
102
|
readonly id: string;
|
|
93
103
|
readonly signal?: AbortSignal;
|
|
@@ -97,7 +107,7 @@ type CreateAppOptions<TContext> = {
|
|
|
97
107
|
};
|
|
98
108
|
type CreateAppArgs<TContext> = [TContext] extends [undefined] ? [options?: Partial<CreateAppOptions<TContext>>] : [options: CreateAppOptions<TContext>];
|
|
99
109
|
declare function createApp<const TDefinition extends AppDefinition<any, any>>(definition: TDefinition, ...[options]: CreateAppArgs<AppContext<TDefinition>>): App<DefinitionCapabilities<TDefinition>>;
|
|
100
|
-
declare function createRemoteApp<TDefinition extends AppDefinition<any, any> = AppDefinition<CapabilityTree>>(transport: ApplicationTransport): App<DefinitionCapabilities<TDefinition>>;
|
|
110
|
+
declare function createRemoteApp<TDefinition extends AppDefinition<any, any> = AppDefinition<CapabilityTree>>(transport: ApplicationTransport, options?: CreateRemoteAppOptions): App<DefinitionCapabilities<TDefinition>>;
|
|
101
111
|
declare class TransportError extends Error {
|
|
102
112
|
readonly code: string;
|
|
103
113
|
readonly status: number | undefined;
|
|
@@ -110,10 +120,41 @@ declare class TransportError extends Error {
|
|
|
110
120
|
});
|
|
111
121
|
}
|
|
112
122
|
//#endregion
|
|
123
|
+
//#region packages/app/src/customization.d.ts
|
|
124
|
+
declare global {
|
|
125
|
+
interface CapableCustomizationMeta {}
|
|
126
|
+
}
|
|
127
|
+
type CapabilityCustomization = {
|
|
128
|
+
readonly title?: string;
|
|
129
|
+
readonly description?: string;
|
|
130
|
+
readonly meta?: keyof CapableCustomizationMeta extends never ? never : Partial<CapableCustomizationMeta>;
|
|
131
|
+
};
|
|
132
|
+
declare const CUSTOMIZED_SYMBOL: unique symbol;
|
|
133
|
+
type CustomizedCapability<TCapability extends AnyCapability = any> = {
|
|
134
|
+
readonly [CUSTOMIZED_SYMBOL]: true;
|
|
135
|
+
readonly reference: AppCapabilityReference<TCapability>;
|
|
136
|
+
readonly customization: CapabilityCustomization;
|
|
137
|
+
};
|
|
138
|
+
/** Customize a bound local or remote reference without changing its execution. */
|
|
139
|
+
declare function customize<TCapability extends AnyCapability>(reference: AppCapabilityReference<TCapability> | CustomizedCapability<TCapability>, options: CapabilityCustomization): CustomizedCapability<TCapability>;
|
|
140
|
+
/** Surface-facing fields only. Policies and executors retain the source contract. */
|
|
141
|
+
declare function getCapabilityDisplay(capability: ManifestCapability): {
|
|
142
|
+
readonly title?: string;
|
|
143
|
+
readonly description?: string;
|
|
144
|
+
readonly meta: Readonly<Record<string, unknown>>;
|
|
145
|
+
};
|
|
146
|
+
/** Navigation overrides come from the destination only for relocated leaves. */
|
|
147
|
+
declare function getCapabilityNavigationMeta<TSurface extends keyof CapableCustomizationMeta>(capability: ManifestCapability, surface: TSurface): CapableCustomizationMeta[TSurface] | undefined;
|
|
148
|
+
//#endregion
|
|
113
149
|
//#region packages/app/src/composition.d.ts
|
|
114
150
|
type UnionToIntersection<TValue> = (TValue extends unknown ? (value: TValue) => void : never) extends ((value: infer TIntersection) => void) ? TIntersection : never;
|
|
115
|
-
type
|
|
116
|
-
|
|
151
|
+
type AppComposition = AnyApp | {
|
|
152
|
+
readonly [key: string]: AppComposition | AppCapabilityReference | CustomizedCapability;
|
|
153
|
+
};
|
|
154
|
+
type ComposedNode<TNode> = TNode extends AnyApp ? AppCapabilities<TNode> : TNode extends CustomizedCapability<infer TCapability> ? TCapability : TNode extends AppCapabilityReference<infer TCapability> ? TCapability : TNode extends Readonly<Record<string, unknown>> ? { readonly [TKey in keyof TNode]: ComposedNode<TNode[TKey]>; } : never;
|
|
155
|
+
type ComposedCapabilities<TNodes extends readonly AppComposition[]> = UnionToIntersection<ComposedNode<TNodes[number]>> extends (infer TCapabilities extends CapabilityTree) ? TCapabilities : never;
|
|
156
|
+
/** Compose executable Apps, subtrees, and Capability references into one tree. */
|
|
157
|
+
declare function composeApps<const TNodes extends readonly [AppComposition, ...AppComposition[]]>(...nodes: TNodes): App<ComposedCapabilities<TNodes>>;
|
|
117
158
|
type SelectionNode<TTree> = TTree extends AnyCapability ? true : TTree extends CapabilityGroupDefinition<infer TCapabilities, any, any> ? true | SelectionNode<TCapabilities> : TTree extends CapabilityTree ? true | { readonly [TKey in keyof TTree]?: SelectionNode<TTree[TKey]>; } : never;
|
|
118
159
|
type ApplicationSelection<TCapabilities extends CapabilityTree = CapabilityTree> = {
|
|
119
160
|
readonly include?: Exclude<SelectionNode<TCapabilities>, true>;
|
|
@@ -121,5 +162,5 @@ type ApplicationSelection<TCapabilities extends CapabilityTree = CapabilityTree>
|
|
|
121
162
|
};
|
|
122
163
|
declare function selectApp<const TCapabilities extends CapabilityTree>(application: App<TCapabilities>, selection: ApplicationSelection<TCapabilities>): App<TCapabilities>;
|
|
123
164
|
//#endregion
|
|
124
|
-
export {
|
|
125
|
-
//# sourceMappingURL=index-
|
|
165
|
+
export { ApplicationManifest as A, CreateRemoteAppOptions as C, getAppRuntime as D, createRemoteApp as E, ManifestNode as F, createAppManifest as I, flattenManifestCapabilities as L, ManifestCapability as M, ManifestError as N, isApp as O, ManifestGroup as P, CapabilityResult as S, createApp as T, AppCapabilityReference as _, CustomizedCapability as a, CallableTree as b, getCapabilityNavigationMeta as c, AnyApp as d, App as f, AppCapabilityIsSubscribable as g, AppCapabilityIsLive as h, CapabilityCustomization as i, JsonSchema as j, subscribe as k, APP_CAPABILITIES_SYMBOL as l, AppCapabilityCall as m, composeApps as n, customize as o, AppCapabilities as p, selectApp as r, getCapabilityDisplay as s, ApplicationSelection as t, APP_RUNTIME_SYMBOL as u, AppContextProvider as v, TransportError as w, CapabilityCall as x, ApplicationTransport as y };
|
|
166
|
+
//# sourceMappingURL=index-F_eaksy8.d.mts.map
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as watchQuery, t as WatchQueryOptions } from "./subscription-
|
|
3
|
-
import {
|
|
4
|
-
export { type App, type AppCapabilityCall, type AppContext, type AppContextProvider, type AppDefinition, type ApplicationSelection, type CapabilityContext, type CapabilityDefinition, type CapabilityEffect, type CapabilityFactory, type CapabilityHandlerArgs, type CapabilityInput, type CapabilityMiddleware, type CapabilityMiddlewareArgs, type CapabilityOutput, type CapabilitySubscriber, type CapabilitySubscriberArgs, type CapabilityTree, type DefinedErrors, type ExecuteCapabilityOptions, type PresentationPart, type PresentationRenderer, type PresentationTableCell, type PresentationValue, type WatchQueryOptions, capability, createApp, createRemoteApp, defineApp, defineErrors, executeCapability, group, md,
|
|
1
|
+
import { F as defineApp, H as PresentationRenderer, I as group, M as CapabilityTree, O as AppContext, U as PresentationTableCell, V as PresentationPart, W as PresentationValue, X as md, _ as ExecuteCapabilityOptions, a as CapabilityDefinition, at as defineErrors, b as capability, c as CapabilityFactory, f as CapabilityMiddleware, g as CapabilitySubscriberArgs, h as CapabilitySubscriber, i as CapabilityContext, k as AppDefinition, l as CapabilityHandlerArgs, m as CapabilityOutput, o as CapabilityEffect, p as CapabilityMiddlewareArgs, q as present, rt as DefinedErrors, s as CapabilityExecution, u as CapabilityInput, x as executeCapability } from "./index-BIO_hbXJ.mjs";
|
|
2
|
+
import { n as watchQuery, t as WatchQueryOptions } from "./subscription-fVgS4T8P.mjs";
|
|
3
|
+
import { A as ApplicationManifest, C as CreateRemoteAppOptions, E as createRemoteApp, T as createApp, _ as AppCapabilityReference, a as CustomizedCapability, f as App, i as CapabilityCustomization, k as subscribe, m as AppCapabilityCall, n as composeApps, o as customize, r as selectApp, t as ApplicationSelection, v as AppContextProvider } from "./index-F_eaksy8.mjs";
|
|
4
|
+
export { type App, type AppCapabilityCall, type AppCapabilityReference, type AppContext, type AppContextProvider, type AppDefinition, type ApplicationManifest, type ApplicationSelection, type CapabilityContext, type CapabilityCustomization, type CapabilityDefinition, type CapabilityEffect, type CapabilityExecution, type CapabilityFactory, type CapabilityHandlerArgs, type CapabilityInput, type CapabilityMiddleware, type CapabilityMiddlewareArgs, type CapabilityOutput, type CapabilitySubscriber, type CapabilitySubscriberArgs, type CapabilityTree, type CreateRemoteAppOptions, type CustomizedCapability, type DefinedErrors, type ExecuteCapabilityOptions, type PresentationPart, type PresentationRenderer, type PresentationTableCell, type PresentationValue, type WatchQueryOptions, capability, composeApps, createApp, createRemoteApp, customize, defineApp, defineErrors, executeCapability, group, md, present, selectApp, subscribe, watchQuery };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as defineErrors, c as executeCapability, g as watchQuery, i as group, r as defineApp, s as capability, v as present } from "./src-
|
|
1
|
+
import { S as defineErrors, c as executeCapability, g as watchQuery, i as group, r as defineApp, s as capability, v as present } from "./src-TCQGaWar.mjs";
|
|
2
2
|
import { t as md } from "./projection-Cgq2u0Wt.mjs";
|
|
3
|
-
import { n as selectApp,
|
|
4
|
-
export { capability, createApp, createRemoteApp, defineApp, defineErrors, executeCapability, group, md,
|
|
3
|
+
import { l as createApp, n as selectApp, p as subscribe, r as customize, t as composeApps, u as createRemoteApp } from "./src-C2OEkZ3c.mjs";
|
|
4
|
+
export { capability, composeApps, createApp, createRemoteApp, customize, defineApp, defineErrors, executeCapability, group, md, present, selectApp, subscribe, watchQuery };
|