@executor-js/sdk 0.0.1 → 0.1.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.
Files changed (102) hide show
  1. package/README.md +125 -107
  2. package/dist/blob.d.ts +48 -0
  3. package/dist/blob.d.ts.map +1 -0
  4. package/dist/blob.test.d.ts +2 -0
  5. package/dist/blob.test.d.ts.map +1 -0
  6. package/dist/chunk-2WV7VSNL.js +4440 -0
  7. package/dist/chunk-2WV7VSNL.js.map +1 -0
  8. package/dist/client.d.ts +135 -0
  9. package/dist/client.d.ts.map +1 -0
  10. package/dist/client.js +87 -0
  11. package/dist/client.js.map +1 -0
  12. package/dist/client.test.d.ts +2 -0
  13. package/dist/client.test.d.ts.map +1 -0
  14. package/dist/config.d.ts +24 -0
  15. package/dist/config.d.ts.map +1 -0
  16. package/dist/connections.d.ts +107 -0
  17. package/dist/connections.d.ts.map +1 -0
  18. package/dist/connections.test.d.ts +2 -0
  19. package/dist/connections.test.d.ts.map +1 -0
  20. package/dist/core-schema.d.ts +372 -0
  21. package/dist/core-schema.d.ts.map +1 -0
  22. package/dist/core.js +296 -57
  23. package/dist/core.js.map +1 -1
  24. package/dist/elicitation.d.ts +18 -34
  25. package/dist/elicitation.d.ts.map +1 -1
  26. package/dist/error-handling.test.d.ts +2 -0
  27. package/dist/error-handling.test.d.ts.map +1 -0
  28. package/dist/errors.d.ts +95 -24
  29. package/dist/errors.d.ts.map +1 -1
  30. package/dist/executor.d.ts +107 -48
  31. package/dist/executor.d.ts.map +1 -1
  32. package/dist/executor.test.d.ts +2 -0
  33. package/dist/executor.test.d.ts.map +1 -0
  34. package/dist/ids.d.ts +6 -4
  35. package/dist/ids.d.ts.map +1 -1
  36. package/dist/index.d.ts +24 -16
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.js +80 -308
  39. package/dist/index.js.map +1 -1
  40. package/dist/oauth-discovery.d.ts +138 -0
  41. package/dist/oauth-discovery.d.ts.map +1 -0
  42. package/dist/oauth-discovery.test.d.ts +2 -0
  43. package/dist/oauth-discovery.test.d.ts.map +1 -0
  44. package/dist/oauth-helpers.d.ts +89 -0
  45. package/dist/oauth-helpers.d.ts.map +1 -0
  46. package/dist/oauth-helpers.test.d.ts +2 -0
  47. package/dist/oauth-helpers.test.d.ts.map +1 -0
  48. package/dist/oauth-popup-types.d.ts +14 -0
  49. package/dist/oauth-popup-types.d.ts.map +1 -0
  50. package/dist/oauth-service.d.ts +33 -0
  51. package/dist/oauth-service.d.ts.map +1 -0
  52. package/dist/oauth.d.ts +275 -0
  53. package/dist/oauth.d.ts.map +1 -0
  54. package/dist/plugin.d.ts +318 -28
  55. package/dist/plugin.d.ts.map +1 -1
  56. package/dist/policies.d.ts +56 -64
  57. package/dist/policies.d.ts.map +1 -1
  58. package/dist/policies.test.d.ts +2 -0
  59. package/dist/policies.test.d.ts.map +1 -0
  60. package/dist/promise-executor.d.ts +26 -128
  61. package/dist/promise-executor.d.ts.map +1 -1
  62. package/dist/promise.d.ts +12 -6
  63. package/dist/promise.d.ts.map +1 -1
  64. package/dist/promise.test.d.ts +2 -0
  65. package/dist/promise.test.d.ts.map +1 -0
  66. package/dist/schema-types.d.ts +6 -5
  67. package/dist/schema-types.d.ts.map +1 -1
  68. package/dist/scope.d.ts +5 -15
  69. package/dist/scope.d.ts.map +1 -1
  70. package/dist/scoped-adapter.d.ts +13 -0
  71. package/dist/scoped-adapter.d.ts.map +1 -0
  72. package/dist/scoped-adapter.test.d.ts +2 -0
  73. package/dist/scoped-adapter.test.d.ts.map +1 -0
  74. package/dist/secret-backed-value.d.ts +27 -0
  75. package/dist/secret-backed-value.d.ts.map +1 -0
  76. package/dist/secrets.d.ts +52 -106
  77. package/dist/secrets.d.ts.map +1 -1
  78. package/dist/testing.d.ts +5 -3
  79. package/dist/testing.d.ts.map +1 -1
  80. package/dist/types.d.ts +84 -0
  81. package/dist/types.d.ts.map +1 -0
  82. package/package.json +28 -4
  83. package/dist/chunk-D7CT3UMO.js +0 -1386
  84. package/dist/chunk-D7CT3UMO.js.map +0 -1
  85. package/dist/in-memory/policy-engine.d.ts +0 -10
  86. package/dist/in-memory/policy-engine.d.ts.map +0 -1
  87. package/dist/in-memory/secret-store.d.ts +0 -16
  88. package/dist/in-memory/secret-store.d.ts.map +0 -1
  89. package/dist/in-memory/tool-registry.d.ts +0 -35
  90. package/dist/in-memory/tool-registry.d.ts.map +0 -1
  91. package/dist/index.test.d.ts +0 -2
  92. package/dist/index.test.d.ts.map +0 -1
  93. package/dist/plugin-kv.d.ts +0 -48
  94. package/dist/plugin-kv.d.ts.map +0 -1
  95. package/dist/plugins/in-memory-tools.d.ts +0 -42
  96. package/dist/plugins/in-memory-tools.d.ts.map +0 -1
  97. package/dist/runtime-tools.d.ts +0 -41
  98. package/dist/runtime-tools.d.ts.map +0 -1
  99. package/dist/sources.d.ts +0 -130
  100. package/dist/sources.d.ts.map +0 -1
  101. package/dist/tools.d.ts +0 -219
  102. package/dist/tools.d.ts.map +0 -1
package/dist/sources.d.ts DELETED
@@ -1,130 +0,0 @@
1
- import { Context, Effect, Schema } from "effect";
2
- declare const Source_base: Schema.Class<Source, {
3
- /** Unique namespace identifier (e.g. "github_rest") */
4
- id: typeof Schema.String;
5
- /** Human-readable name */
6
- name: typeof Schema.String;
7
- /** Plugin kind that manages this source (e.g. "openapi", "mcp") */
8
- kind: typeof Schema.String;
9
- /** Optional upstream URL for this source — used to derive a favicon in the UI */
10
- url: Schema.optional<typeof Schema.String>;
11
- /** True when the source is provided by the running executor */
12
- runtime: Schema.optional<typeof Schema.Boolean>;
13
- /** Whether the source supports removal */
14
- canRemove: Schema.optional<typeof Schema.Boolean>;
15
- /** Whether the source supports refresh */
16
- canRefresh: Schema.optional<typeof Schema.Boolean>;
17
- /** Whether the source supports editing (config changes) */
18
- canEdit: Schema.optional<typeof Schema.Boolean>;
19
- }, Schema.Struct.Encoded<{
20
- /** Unique namespace identifier (e.g. "github_rest") */
21
- id: typeof Schema.String;
22
- /** Human-readable name */
23
- name: typeof Schema.String;
24
- /** Plugin kind that manages this source (e.g. "openapi", "mcp") */
25
- kind: typeof Schema.String;
26
- /** Optional upstream URL for this source — used to derive a favicon in the UI */
27
- url: Schema.optional<typeof Schema.String>;
28
- /** True when the source is provided by the running executor */
29
- runtime: Schema.optional<typeof Schema.Boolean>;
30
- /** Whether the source supports removal */
31
- canRemove: Schema.optional<typeof Schema.Boolean>;
32
- /** Whether the source supports refresh */
33
- canRefresh: Schema.optional<typeof Schema.Boolean>;
34
- /** Whether the source supports editing (config changes) */
35
- canEdit: Schema.optional<typeof Schema.Boolean>;
36
- }>, never, {
37
- readonly url?: string | undefined;
38
- } & {
39
- readonly id: string;
40
- } & {
41
- readonly name: string;
42
- } & {
43
- readonly kind: string;
44
- } & {
45
- readonly runtime?: boolean | undefined;
46
- } & {
47
- readonly canRemove?: boolean | undefined;
48
- } & {
49
- readonly canRefresh?: boolean | undefined;
50
- } & {
51
- readonly canEdit?: boolean | undefined;
52
- }, {}, {}>;
53
- export declare class Source extends Source_base {
54
- }
55
- declare const SourceDetectionResult_base: Schema.Class<SourceDetectionResult, {
56
- /** Plugin kind that detected this source */
57
- kind: typeof Schema.String;
58
- /** How confident the plugin is that the URL matches */
59
- confidence: Schema.Literal<["high", "medium", "low"]>;
60
- /** The URL that was probed */
61
- endpoint: typeof Schema.String;
62
- /** Suggested human-readable name */
63
- name: typeof Schema.String;
64
- /** Suggested namespace */
65
- namespace: typeof Schema.String;
66
- }, Schema.Struct.Encoded<{
67
- /** Plugin kind that detected this source */
68
- kind: typeof Schema.String;
69
- /** How confident the plugin is that the URL matches */
70
- confidence: Schema.Literal<["high", "medium", "low"]>;
71
- /** The URL that was probed */
72
- endpoint: typeof Schema.String;
73
- /** Suggested human-readable name */
74
- name: typeof Schema.String;
75
- /** Suggested namespace */
76
- namespace: typeof Schema.String;
77
- }>, never, {
78
- readonly name: string;
79
- } & {
80
- readonly kind: string;
81
- } & {
82
- readonly endpoint: string;
83
- } & {
84
- readonly namespace: string;
85
- } & {
86
- readonly confidence: "high" | "medium" | "low";
87
- }, {}, {}>;
88
- export declare class SourceDetectionResult extends SourceDetectionResult_base {
89
- }
90
- export interface SourceManager {
91
- /** Plugin kind this manager handles (e.g. "openapi", "mcp") */
92
- readonly kind: string;
93
- /** List all sources managed by this plugin */
94
- readonly list: () => Effect.Effect<readonly Source[]>;
95
- /** Remove a source and clean up its tools + internal state */
96
- readonly remove: (sourceId: string) => Effect.Effect<void>;
97
- /** Re-fetch / re-register tools for a source */
98
- readonly refresh?: (sourceId: string) => Effect.Effect<void>;
99
- /** Detect whether a URL matches this plugin's source type */
100
- readonly detect?: (url: string) => Effect.Effect<SourceDetectionResult | null>;
101
- }
102
- declare const SourceRegistry_base: Context.TagClass<SourceRegistry, "@executor-js/sdk/SourceRegistry", {
103
- /** Register a source manager (called by plugins during init) */
104
- readonly addManager: (manager: SourceManager) => Effect.Effect<void>;
105
- /** Register a runtime-only source entry. */
106
- readonly registerRuntime: (source: Source) => Effect.Effect<void>;
107
- /** Unregister a runtime-only source entry by id. */
108
- readonly unregisterRuntime: (sourceId: string) => Effect.Effect<void>;
109
- /** List all sources across all plugins */
110
- readonly list: () => Effect.Effect<readonly Source[]>;
111
- /** Remove a source by id. Finds the owning manager and delegates. */
112
- readonly remove: (sourceId: string) => Effect.Effect<void>;
113
- /** Refresh a source by id. Finds the owning manager and delegates. */
114
- readonly refresh: (sourceId: string) => Effect.Effect<void>;
115
- /** Detect source type from a URL by probing all registered plugins */
116
- readonly detect: (url: string) => Effect.Effect<readonly SourceDetectionResult[]>;
117
- }>;
118
- export declare class SourceRegistry extends SourceRegistry_base {
119
- }
120
- export declare const makeInMemorySourceRegistry: () => {
121
- addManager: (manager: SourceManager) => Effect.Effect<void, never, never>;
122
- registerRuntime: (source: Source) => Effect.Effect<void, never, never>;
123
- unregisterRuntime: (sourceId: string) => Effect.Effect<void, never, never>;
124
- list: () => Effect.Effect<Source[], never, never>;
125
- remove: (sourceId: string) => Effect.Effect<void, never, never>;
126
- refresh: (sourceId: string) => Effect.Effect<void, never, never>;
127
- detect: (url: string) => Effect.Effect<SourceDetectionResult[], never, never>;
128
- };
129
- export {};
130
- //# sourceMappingURL=sources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../src/sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;;IAO/C,uDAAuD;;IAEvD,0BAA0B;;IAE1B,mEAAmE;;IAEnE,iFAAiF;;IAEjF,+DAA+D;;IAE/D,0CAA0C;;IAE1C,0CAA0C;;IAE1C,2DAA2D;;;IAd3D,uDAAuD;;IAEvD,0BAA0B;;IAE1B,mEAAmE;;IAEnE,iFAAiF;;IAEjF,+DAA+D;;IAE/D,0CAA0C;;IAE1C,0CAA0C;;IAE1C,2DAA2D;;;;;;;;;;;;;;;;;;;AAf7D,qBAAa,MAAO,SAAQ,WAiB1B;CAAG;;IASH,4CAA4C;;IAE5C,uDAAuD;;IAEvD,8BAA8B;;IAE9B,oCAAoC;;IAEpC,0BAA0B;;;IAR1B,4CAA4C;;IAE5C,uDAAuD;;IAEvD,8BAA8B;;IAE9B,oCAAoC;;IAEpC,0BAA0B;;;;;;;;;;;;;AAX5B,qBAAa,qBAAsB,SAAQ,0BAazC;CAAG;AASL,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAEtD,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE3D,gDAAgD;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAE7D,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAChF;;IASG,gEAAgE;yBAC3C,CAAC,OAAO,EAAE,aAAa,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEpE,4CAA4C;8BAClB,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAEjE,oDAAoD;gCACxB,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAErE,0CAA0C;mBAC3B,MAAM,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,CAAC;IAErD,qEAAqE;qBACpD,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE1D,sEAAsE;sBACpD,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;IAE3D,sEAAsE;qBACrD,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,SAAS,qBAAqB,EAAE,CAAC;;AAtBrF,qBAAa,cAAe,SAAQ,mBAwBjC;CAAG;AAMN,eAAO,MAAM,0BAA0B;0BAKb,aAAa;8BAKT,MAAM;kCAKF,MAAM;;uBAejB,MAAM;wBAmBL,MAAM;kBAkBZ,MAAM;CAoBvB,CAAC"}
package/dist/tools.d.ts DELETED
@@ -1,219 +0,0 @@
1
- import { Context, Effect, Schema } from "effect";
2
- import { ToolId } from "./ids";
3
- import { ToolNotFoundError, ToolInvocationError } from "./errors";
4
- import type { ElicitationHandler, ElicitationDeclinedError } from "./elicitation";
5
- declare const ToolAnnotations_base: Schema.Class<ToolAnnotations, {
6
- /** Whether this tool requires user approval before execution */
7
- requiresApproval: Schema.optional<typeof Schema.Boolean>;
8
- /** Human-readable description shown in the approval prompt */
9
- approvalDescription: Schema.optional<typeof Schema.String>;
10
- }, Schema.Struct.Encoded<{
11
- /** Whether this tool requires user approval before execution */
12
- requiresApproval: Schema.optional<typeof Schema.Boolean>;
13
- /** Human-readable description shown in the approval prompt */
14
- approvalDescription: Schema.optional<typeof Schema.String>;
15
- }>, never, {
16
- readonly requiresApproval?: boolean | undefined;
17
- } & {
18
- readonly approvalDescription?: string | undefined;
19
- }, {}, {}>;
20
- export declare class ToolAnnotations extends ToolAnnotations_base {
21
- }
22
- declare const ToolMetadata_base: Schema.Class<ToolMetadata, {
23
- id: Schema.brand<typeof Schema.String, "ToolId">;
24
- pluginKey: typeof Schema.String;
25
- /** Source this tool belongs to (namespace identifier) */
26
- sourceId: typeof Schema.String;
27
- name: typeof Schema.String;
28
- description: Schema.optional<typeof Schema.String>;
29
- /** Whether this tool may request elicitation during invocation */
30
- mayElicit: Schema.optional<typeof Schema.Boolean>;
31
- }, Schema.Struct.Encoded<{
32
- id: Schema.brand<typeof Schema.String, "ToolId">;
33
- pluginKey: typeof Schema.String;
34
- /** Source this tool belongs to (namespace identifier) */
35
- sourceId: typeof Schema.String;
36
- name: typeof Schema.String;
37
- description: Schema.optional<typeof Schema.String>;
38
- /** Whether this tool may request elicitation during invocation */
39
- mayElicit: Schema.optional<typeof Schema.Boolean>;
40
- }>, never, {
41
- readonly id: string & import("effect/Brand").Brand<"ToolId">;
42
- } & {
43
- readonly name: string;
44
- } & {
45
- readonly pluginKey: string;
46
- } & {
47
- readonly sourceId: string;
48
- } & {
49
- readonly description?: string | undefined;
50
- } & {
51
- readonly mayElicit?: boolean | undefined;
52
- }, {}, {}>;
53
- export declare class ToolMetadata extends ToolMetadata_base {
54
- }
55
- declare const ToolSchema_base: Schema.Class<ToolSchema, {
56
- id: Schema.brand<typeof Schema.String, "ToolId">;
57
- inputTypeScript: Schema.optional<typeof Schema.String>;
58
- outputTypeScript: Schema.optional<typeof Schema.String>;
59
- typeScriptDefinitions: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
60
- inputSchema: Schema.optional<typeof Schema.Unknown>;
61
- outputSchema: Schema.optional<typeof Schema.Unknown>;
62
- }, Schema.Struct.Encoded<{
63
- id: Schema.brand<typeof Schema.String, "ToolId">;
64
- inputTypeScript: Schema.optional<typeof Schema.String>;
65
- outputTypeScript: Schema.optional<typeof Schema.String>;
66
- typeScriptDefinitions: Schema.optional<Schema.Record$<typeof Schema.String, typeof Schema.String>>;
67
- inputSchema: Schema.optional<typeof Schema.Unknown>;
68
- outputSchema: Schema.optional<typeof Schema.Unknown>;
69
- }>, never, {
70
- readonly id: string & import("effect/Brand").Brand<"ToolId">;
71
- } & {
72
- readonly inputTypeScript?: string | undefined;
73
- } & {
74
- readonly outputTypeScript?: string | undefined;
75
- } & {
76
- readonly typeScriptDefinitions?: {
77
- readonly [x: string]: string;
78
- } | undefined;
79
- } & {
80
- readonly inputSchema?: unknown;
81
- } & {
82
- readonly outputSchema?: unknown;
83
- }, {}, {}>;
84
- export declare class ToolSchema extends ToolSchema_base {
85
- }
86
- declare const ToolInvocationResult_base: Schema.Class<ToolInvocationResult, {
87
- data: typeof Schema.Unknown;
88
- error: Schema.NullOr<typeof Schema.Unknown>;
89
- status: Schema.optional<typeof Schema.Number>;
90
- }, Schema.Struct.Encoded<{
91
- data: typeof Schema.Unknown;
92
- error: Schema.NullOr<typeof Schema.Unknown>;
93
- status: Schema.optional<typeof Schema.Number>;
94
- }>, never, {
95
- readonly data: unknown;
96
- } & {
97
- readonly error: unknown;
98
- } & {
99
- readonly status?: number | undefined;
100
- }, {}, {}>;
101
- export declare class ToolInvocationResult extends ToolInvocationResult_base {
102
- }
103
- declare const ToolListFilter_base: Schema.Class<ToolListFilter, {
104
- /** Filter to tools belonging to a specific source */
105
- sourceId: Schema.optional<typeof Schema.String>;
106
- query: Schema.optional<typeof Schema.String>;
107
- }, Schema.Struct.Encoded<{
108
- /** Filter to tools belonging to a specific source */
109
- sourceId: Schema.optional<typeof Schema.String>;
110
- query: Schema.optional<typeof Schema.String>;
111
- }>, never, {
112
- readonly sourceId?: string | undefined;
113
- } & {
114
- readonly query?: string | undefined;
115
- }, {}, {}>;
116
- export declare class ToolListFilter extends ToolListFilter_base {
117
- }
118
- export interface InvokeOptions {
119
- /** Handler for elicitation requests, or "accept-all" to auto-approve everything. */
120
- readonly onElicitation: ElicitationHandler | "accept-all";
121
- }
122
- declare const ToolRegistry_base: Context.TagClass<ToolRegistry, "@executor-js/sdk/ToolRegistry", {
123
- readonly list: (filter?: ToolListFilter) => Effect.Effect<readonly ToolMetadata[]>;
124
- readonly schema: (toolId: ToolId) => Effect.Effect<ToolSchema, ToolNotFoundError>;
125
- readonly invoke: (toolId: ToolId, args: unknown, options: InvokeOptions) => Effect.Effect<ToolInvocationResult, ToolNotFoundError | ToolInvocationError | ElicitationDeclinedError>;
126
- /**
127
- * Shared schema definitions across all tools.
128
- * `$ref` pointers in tool schemas resolve against this store.
129
- */
130
- readonly definitions: () => Effect.Effect<Record<string, unknown>>;
131
- /**
132
- * Register named schema definitions into the shared store.
133
- * Plugins call this before registering tools whose schemas use `$ref`.
134
- */
135
- readonly registerDefinitions: (defs: Record<string, unknown>) => Effect.Effect<void>;
136
- /**
137
- * Register named schema definitions for runtime tools. These remain
138
- * runtime-only and are not persisted by storage-backed registries.
139
- */
140
- readonly registerRuntimeDefinitions: (defs: Record<string, unknown>) => Effect.Effect<void>;
141
- /** Remove named schema definitions that were registered for runtime tools. */
142
- readonly unregisterRuntimeDefinitions: (names: readonly string[]) => Effect.Effect<void>;
143
- /**
144
- * Register a plugin invoker. Must be called before registering tools
145
- * with the corresponding pluginKey.
146
- */
147
- readonly registerInvoker: (pluginKey: string, invoker: ToolInvoker) => Effect.Effect<void>;
148
- /**
149
- * Resolve annotations for a tool by delegating to the plugin's invoker.
150
- */
151
- readonly resolveAnnotations: (toolId: ToolId) => Effect.Effect<ToolAnnotations | undefined>;
152
- /** Register tools (used by plugins to push tools into the registry) */
153
- readonly register: (tools: readonly ToolRegistration[]) => Effect.Effect<void>;
154
- /**
155
- * Register runtime-only tools. These should behave like normal tools for
156
- * listing, schema lookup, discovery, and invocation, but are not persisted.
157
- */
158
- readonly registerRuntime: (tools: readonly ToolRegistration[]) => Effect.Effect<void>;
159
- /** Register a runtime-only handler for a specific tool id. */
160
- readonly registerRuntimeHandler: (toolId: ToolId, handler: RuntimeToolHandler) => Effect.Effect<void>;
161
- /** Unregister runtime-only tools by id without touching persisted storage. */
162
- readonly unregisterRuntime: (toolIds: readonly ToolId[]) => Effect.Effect<void>;
163
- /** Unregister tools by id (used by plugins on cleanup) */
164
- readonly unregister: (toolIds: readonly ToolId[]) => Effect.Effect<void>;
165
- /** Unregister all tools belonging to a source */
166
- readonly unregisterBySource: (sourceId: string) => Effect.Effect<void>;
167
- }>;
168
- export declare class ToolRegistry extends ToolRegistry_base {
169
- }
170
- export interface ToolInvoker {
171
- readonly invoke: (toolId: ToolId, args: unknown, options: InvokeOptions) => Effect.Effect<ToolInvocationResult, ToolInvocationError | ElicitationDeclinedError>;
172
- /** Dynamically compute annotations for a tool (e.g. approval requirements). */
173
- readonly resolveAnnotations?: (toolId: ToolId) => Effect.Effect<ToolAnnotations | undefined>;
174
- }
175
- export interface RuntimeToolHandler {
176
- readonly invoke: (args: unknown, options: InvokeOptions) => Effect.Effect<ToolInvocationResult, ToolInvocationError | ElicitationDeclinedError>;
177
- readonly resolveAnnotations?: () => Effect.Effect<ToolAnnotations | undefined>;
178
- }
179
- declare const ToolRegistration_base: Schema.Class<ToolRegistration, {
180
- id: Schema.brand<typeof Schema.String, "ToolId">;
181
- pluginKey: typeof Schema.String;
182
- /** Source this tool belongs to (namespace identifier) */
183
- sourceId: typeof Schema.String;
184
- name: typeof Schema.String;
185
- description: Schema.optional<typeof Schema.String>;
186
- mayElicit: Schema.optional<typeof Schema.Boolean>;
187
- inputSchema: Schema.optional<typeof Schema.Unknown>;
188
- outputSchema: Schema.optional<typeof Schema.Unknown>;
189
- }, Schema.Struct.Encoded<{
190
- id: Schema.brand<typeof Schema.String, "ToolId">;
191
- pluginKey: typeof Schema.String;
192
- /** Source this tool belongs to (namespace identifier) */
193
- sourceId: typeof Schema.String;
194
- name: typeof Schema.String;
195
- description: Schema.optional<typeof Schema.String>;
196
- mayElicit: Schema.optional<typeof Schema.Boolean>;
197
- inputSchema: Schema.optional<typeof Schema.Unknown>;
198
- outputSchema: Schema.optional<typeof Schema.Unknown>;
199
- }>, never, {
200
- readonly id: string & import("effect/Brand").Brand<"ToolId">;
201
- } & {
202
- readonly name: string;
203
- } & {
204
- readonly pluginKey: string;
205
- } & {
206
- readonly sourceId: string;
207
- } & {
208
- readonly description?: string | undefined;
209
- } & {
210
- readonly mayElicit?: boolean | undefined;
211
- } & {
212
- readonly inputSchema?: unknown;
213
- } & {
214
- readonly outputSchema?: unknown;
215
- }, {}, {}>;
216
- export declare class ToolRegistration extends ToolRegistration_base {
217
- }
218
- export {};
219
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;;IAOhF,gEAAgE;;IAEhE,8DAA8D;;;IAF9D,gEAAgE;;IAEhE,8DAA8D;;;;;;;AAHhE,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;;;;IAKH,yDAAyD;;;;IAIzD,kEAAkE;;;;;IAJlE,yDAAyD;;;;IAIzD,kEAAkE;;;;;;;;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