apps 0.0.1-beta.44 → 0.0.1-beta.46
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/framework-reference.json +1 -1
- package/js/{chunk-646JVUH4.js → chunk-3B2JAOSE.js} +23 -12
- package/js/{chunk-5SHUB37R.js → chunk-3UGDI2UI.js} +3 -3
- package/js/{chunk-7EBODVQJ.js → chunk-6QXPBJ5T.js} +14 -13
- package/js/{chunk-MGGMEGB2.js → chunk-7LGRK7TP.js} +2 -2
- package/js/{chunk-DZQYE626.js → chunk-7UUHJR2Q.js} +1 -1
- package/js/{chunk-4ZTVLEN6.js → chunk-CDXQDN7W.js} +1 -1
- package/js/{chunk-ELO5PRCO.js → chunk-CVAJ4F6O.js} +14 -1
- package/js/{chunk-CZGWW4NQ.js → chunk-JM7LOD2W.js} +187 -9
- package/js/{chunk-EJUK2NK5.js → chunk-KLYSEHUD.js} +1 -1
- package/js/{chunk-OTGUPKKK.js → chunk-LHCGND3R.js} +12 -46
- package/js/{chunk-EMHFXFTJ.js → chunk-LTDHQJ2Z.js} +53 -0
- package/js/{chunk-DRJRCHHO.js → chunk-OJ47HQVJ.js} +141 -63
- package/js/{chunk-MZH4J2PO.js → chunk-PD6I2SDG.js} +1 -1
- package/js/{chunk-KSGYJV46.js → chunk-TUMGL2OC.js} +1 -1
- package/js/{chunk-5GLC42LK.js → chunk-UM62MBJQ.js} +42 -24
- package/js/{chunk-V3RS2BK6.js → chunk-XK5I2XOI.js} +39 -29
- package/js/client.js +8 -8
- package/js/contracts.js +7 -3
- package/js/effect.js +11 -11
- package/js/graphql.js +20 -18
- package/js/host.js +76 -51
- package/js/index.js +21 -16
- package/js/mcp/effect.js +13 -13
- package/js/mcp/stdio.js +27 -22
- package/js/mcp.js +20 -18
- package/js/openapi.js +103 -77
- package/js/skills/effect.js +2 -2
- package/js/skills.js +50 -33
- package/js/ui/auth.js +3 -3
- package/js/ui/contracts.js +3 -3
- package/js/ui/serving.js +6 -6
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/host.d.ts +15 -0
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/cache.d.ts +4 -0
- package/types/apps/src/implementation/elicitation.d.ts +6 -3
- package/types/apps/src/implementation/invocation-timing.d.ts +16 -0
- package/types/apps/src/implementation/operations.d.ts +2 -2
- package/types/apps/src/implementation/router-catalog.d.ts +4 -4
- package/types/apps/src/implementation/workflows.d.ts +1 -1
- package/types/telemetry/src/index.d.ts +1 -0
- package/types/telemetry/src/ownership.d.ts +56 -0
- package/js/{chunk-LNSVJS2Q.js → chunk-EOPQ727L.js} +2 -2
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareElicitation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OJ47HQVJ.js";
|
|
4
4
|
import {
|
|
5
|
+
bodyUpstreamError,
|
|
5
6
|
fromPromise
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
bodyUpstreamError
|
|
9
|
-
} from "./chunk-EMHFXFTJ.js";
|
|
7
|
+
} from "./chunk-LTDHQJ2Z.js";
|
|
10
8
|
import {
|
|
11
9
|
ElicitationFailed,
|
|
12
10
|
McpError,
|
|
@@ -18,12 +16,15 @@ import {
|
|
|
18
16
|
defaultElicitationLimits,
|
|
19
17
|
defaultMcpClientLimits,
|
|
20
18
|
mcpSdkTimerCeilingMs
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CVAJ4F6O.js";
|
|
22
20
|
import {
|
|
23
21
|
jsonSchemaDecoder,
|
|
24
22
|
nestJsonSchema,
|
|
25
23
|
preparedJsonSchemaDecoder
|
|
26
24
|
} from "./chunk-KGCTYL2S.js";
|
|
25
|
+
import {
|
|
26
|
+
owned
|
|
27
|
+
} from "./chunk-JM7LOD2W.js";
|
|
27
28
|
import {
|
|
28
29
|
JsonObject
|
|
29
30
|
} from "./chunk-H2CJWXA3.js";
|
|
@@ -187,11 +188,14 @@ var mcpCall = (client, name, input, context, timeoutMs, failure) => Effect_expor
|
|
|
187
188
|
const callbacks = /* @__PURE__ */ new Set();
|
|
188
189
|
const lifetime = yield* Effect_exports.acquireRelease(
|
|
189
190
|
Effect_exports.sync(() => new AbortController()),
|
|
190
|
-
(controller) =>
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
191
|
+
(controller) => (
|
|
192
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the MCP SDK's elicitation callbacks
|
|
193
|
+
Effect_exports.promise(async () => {
|
|
194
|
+
controller.abort();
|
|
195
|
+
client.removeRequestHandler("elicitation/create");
|
|
196
|
+
await Promise.allSettled(callbacks);
|
|
197
|
+
})
|
|
198
|
+
)
|
|
195
199
|
);
|
|
196
200
|
client.setRequestHandler(ElicitRequestSchema, (request, extra) => {
|
|
197
201
|
const signal = AbortSignal.any([lifetime.signal, extra.signal]);
|
|
@@ -203,7 +207,10 @@ var mcpCall = (client, name, input, context, timeoutMs, failure) => Effect_expor
|
|
|
203
207
|
const deliver = context.elicit;
|
|
204
208
|
if (deliver === void 0) return yield* new ElicitationFailed({ reason: "unavailable" });
|
|
205
209
|
const answer = yield* budget.waitForInput(
|
|
206
|
-
fromPromise(
|
|
210
|
+
fromPromise(
|
|
211
|
+
deliver,
|
|
212
|
+
"elicitation"
|
|
213
|
+
)(form.request).pipe(
|
|
207
214
|
Effect_exports.mapError(
|
|
208
215
|
(error) => Option_exports.getOrElse(
|
|
209
216
|
Schema_exports.decodeUnknownOption(ElicitationFailed)(error),
|
|
@@ -253,7 +260,7 @@ var mcpCall = (client, name, input, context, timeoutMs, failure) => Effect_expor
|
|
|
253
260
|
);
|
|
254
261
|
})
|
|
255
262
|
).pipe(
|
|
256
|
-
|
|
263
|
+
owned("upstream", "provider.mcp.request", {
|
|
257
264
|
kind: "client",
|
|
258
265
|
attributes: {
|
|
259
266
|
"rpc.system.name": "jsonrpc",
|
|
@@ -311,7 +318,7 @@ function mcpClient(withClient, timeoutMs, failure) {
|
|
|
311
318
|
),
|
|
312
319
|
catch: (error) => failure("discover", error)
|
|
313
320
|
}).pipe(
|
|
314
|
-
|
|
321
|
+
owned("upstream", "provider.mcp.request", {
|
|
315
322
|
kind: "client",
|
|
316
323
|
attributes: { "rpc.system.name": "jsonrpc", "rpc.method": "tools/list" }
|
|
317
324
|
})
|
|
@@ -352,25 +359,28 @@ function mcpClient(withClient, timeoutMs, failure) {
|
|
|
352
359
|
server: Option_exports.getOrElse(server, () => ({}))
|
|
353
360
|
};
|
|
354
361
|
})
|
|
355
|
-
).pipe(
|
|
362
|
+
).pipe(owned("upstream", "provider.mcp.discover"));
|
|
356
363
|
const check = withClient(
|
|
357
364
|
"discover",
|
|
358
|
-
(client) =>
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
365
|
+
(client) => (
|
|
366
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- MCP SDK
|
|
367
|
+
Effect_exports.tryPromise({
|
|
368
|
+
try: (signal) => client.request({ method: "tools/list", params: {} }, ListToolsResultSchema, {
|
|
369
|
+
signal,
|
|
370
|
+
timeout: timeoutMs
|
|
371
|
+
}),
|
|
372
|
+
catch: (error) => failure("discover", error)
|
|
373
|
+
}).pipe(
|
|
374
|
+
Effect_exports.asVoid,
|
|
375
|
+
owned("upstream", "provider.mcp.request", {
|
|
376
|
+
kind: "client",
|
|
377
|
+
attributes: { "rpc.system.name": "jsonrpc", "rpc.method": "tools/list" }
|
|
378
|
+
})
|
|
379
|
+
)
|
|
370
380
|
)
|
|
371
|
-
).pipe(
|
|
381
|
+
).pipe(owned("upstream", "provider.mcp.check"));
|
|
372
382
|
const call = (name, input, context) => withClient("call", (client) => mcpCall(client, name, input, context, timeoutMs, failure)).pipe(
|
|
373
|
-
|
|
383
|
+
owned("upstream", "provider.mcp.call", { attributes: { "mcp.tool.name": name } })
|
|
374
384
|
);
|
|
375
385
|
return { list, check, call };
|
|
376
386
|
}
|
package/js/client.js
CHANGED
|
@@ -3,36 +3,36 @@ import {
|
|
|
3
3
|
UiContext,
|
|
4
4
|
UiDeploymentChanged,
|
|
5
5
|
UiFailed
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CDXQDN7W.js";
|
|
7
7
|
import {
|
|
8
8
|
AsyncResult_exports,
|
|
9
9
|
AtomRegistry_exports,
|
|
10
10
|
Atom_exports,
|
|
11
11
|
queryResult
|
|
12
12
|
} from "./chunk-74YVXBKY.js";
|
|
13
|
+
import {
|
|
14
|
+
decoderOf
|
|
15
|
+
} from "./chunk-KGCTYL2S.js";
|
|
13
16
|
import {
|
|
14
17
|
OtlpExporter_exports,
|
|
15
18
|
externalTrace,
|
|
16
19
|
pendingSpan,
|
|
17
20
|
telemetryLayer,
|
|
18
21
|
traceLinks
|
|
19
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-JM7LOD2W.js";
|
|
20
23
|
import {
|
|
21
24
|
FetchHttpClient_exports
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
decoderOf
|
|
25
|
-
} from "./chunk-KGCTYL2S.js";
|
|
25
|
+
} from "./chunk-PD6I2SDG.js";
|
|
26
26
|
import "./chunk-5FHWNLCI.js";
|
|
27
27
|
import {
|
|
28
28
|
JsonValue
|
|
29
29
|
} from "./chunk-H2CJWXA3.js";
|
|
30
30
|
import {
|
|
31
31
|
HttpApiClient_exports
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TUMGL2OC.js";
|
|
33
33
|
import {
|
|
34
34
|
HttpClientError_exports
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-EOPQ727L.js";
|
|
36
36
|
import {
|
|
37
37
|
Cause_exports,
|
|
38
38
|
Clock_exports,
|
package/js/contracts.js
CHANGED
|
@@ -50,6 +50,8 @@ import {
|
|
|
50
50
|
InputProblem,
|
|
51
51
|
Interval,
|
|
52
52
|
InvocationDeadline,
|
|
53
|
+
InvocationTiming,
|
|
54
|
+
InvocationTimingSink,
|
|
53
55
|
ManualWebhookDescriptor,
|
|
54
56
|
ManualWebhookSetup,
|
|
55
57
|
McpClientLimits,
|
|
@@ -118,7 +120,7 @@ import {
|
|
|
118
120
|
skillCatalog,
|
|
119
121
|
skillsCommand,
|
|
120
122
|
workflowDurationMillis
|
|
121
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-CVAJ4F6O.js";
|
|
122
124
|
import {
|
|
123
125
|
FailureCode,
|
|
124
126
|
FailureDetail,
|
|
@@ -159,8 +161,8 @@ import {
|
|
|
159
161
|
AccountId,
|
|
160
162
|
HttpUrl
|
|
161
163
|
} from "./chunk-H2CJWXA3.js";
|
|
162
|
-
import "./chunk-
|
|
163
|
-
import "./chunk-
|
|
164
|
+
import "./chunk-TUMGL2OC.js";
|
|
165
|
+
import "./chunk-EOPQ727L.js";
|
|
164
166
|
import "./chunk-IFJU5SYQ.js";
|
|
165
167
|
import "./chunk-CZ7CSFO4.js";
|
|
166
168
|
export {
|
|
@@ -231,6 +233,8 @@ export {
|
|
|
231
233
|
InputProblem,
|
|
232
234
|
Interval,
|
|
233
235
|
InvocationDeadline,
|
|
236
|
+
InvocationTiming,
|
|
237
|
+
InvocationTimingSink,
|
|
234
238
|
ManualWebhookDescriptor,
|
|
235
239
|
ManualWebhookSetup,
|
|
236
240
|
McpClientLimits,
|
package/js/effect.js
CHANGED
|
@@ -3,35 +3,35 @@ import {
|
|
|
3
3
|
ApprovalDecision,
|
|
4
4
|
createAppHandler,
|
|
5
5
|
prepareElicitation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OJ47HQVJ.js";
|
|
7
7
|
import "./chunk-AQU56EPI.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3UGDI2UI.js";
|
|
9
|
+
import "./chunk-7UUHJR2Q.js";
|
|
10
10
|
import "./chunk-XBG7HHXC.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-3B2JAOSE.js";
|
|
12
|
+
import "./chunk-LHCGND3R.js";
|
|
13
|
+
import "./chunk-LTDHQJ2Z.js";
|
|
14
14
|
import {
|
|
15
15
|
ToolAnnotations
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-CVAJ4F6O.js";
|
|
17
17
|
import "./chunk-MWKHKOTL.js";
|
|
18
18
|
import "./chunk-H72MEDMN.js";
|
|
19
|
-
import "./chunk-CZGWW4NQ.js";
|
|
20
|
-
import "./chunk-MZH4J2PO.js";
|
|
21
19
|
import {
|
|
22
20
|
compileJsonSchemaDecoder,
|
|
23
21
|
decoderOf,
|
|
24
22
|
jsonSchemaDecoder,
|
|
25
23
|
wrap
|
|
26
24
|
} from "./chunk-KGCTYL2S.js";
|
|
25
|
+
import "./chunk-JM7LOD2W.js";
|
|
26
|
+
import "./chunk-PD6I2SDG.js";
|
|
27
27
|
import "./chunk-5FHWNLCI.js";
|
|
28
28
|
import {
|
|
29
29
|
HttpUrl,
|
|
30
30
|
JsonObject,
|
|
31
31
|
ValidationError
|
|
32
32
|
} from "./chunk-H2CJWXA3.js";
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-TUMGL2OC.js";
|
|
34
|
+
import "./chunk-EOPQ727L.js";
|
|
35
35
|
import "./chunk-IFJU5SYQ.js";
|
|
36
36
|
import "./chunk-CZ7CSFO4.js";
|
|
37
37
|
export {
|
package/js/graphql.js
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
import {
|
|
2
2
|
catalogCache,
|
|
3
3
|
catalogScope
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UM62MBJQ.js";
|
|
5
5
|
import {
|
|
6
6
|
protocolOperations
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7LGRK7TP.js";
|
|
8
8
|
import "./chunk-BCSNKUAC.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-OJ47HQVJ.js";
|
|
10
10
|
import {
|
|
11
11
|
cacheKey
|
|
12
12
|
} from "./chunk-AQU56EPI.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-3UGDI2UI.js";
|
|
14
14
|
import {
|
|
15
15
|
failOnNetworkRefusal
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7UUHJR2Q.js";
|
|
17
17
|
import "./chunk-XBG7HHXC.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-3B2JAOSE.js";
|
|
19
19
|
import {
|
|
20
20
|
nativeOperation,
|
|
21
21
|
routerDeclaration
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-LHCGND3R.js";
|
|
23
23
|
import {
|
|
24
24
|
accountProviderError,
|
|
25
25
|
graphqlProviderError,
|
|
26
26
|
httpProviderError
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-LTDHQJ2Z.js";
|
|
28
|
+
import "./chunk-CVAJ4F6O.js";
|
|
29
29
|
import {
|
|
30
30
|
NetworkRefused,
|
|
31
31
|
ProviderError
|
|
32
32
|
} from "./chunk-MWKHKOTL.js";
|
|
33
33
|
import "./chunk-H72MEDMN.js";
|
|
34
|
-
import "./chunk-CZGWW4NQ.js";
|
|
35
|
-
import {
|
|
36
|
-
FetchHttpClient_exports
|
|
37
|
-
} from "./chunk-MZH4J2PO.js";
|
|
38
34
|
import {
|
|
39
35
|
jsonSchemaDecoder
|
|
40
36
|
} from "./chunk-KGCTYL2S.js";
|
|
37
|
+
import {
|
|
38
|
+
owned
|
|
39
|
+
} from "./chunk-JM7LOD2W.js";
|
|
40
|
+
import {
|
|
41
|
+
FetchHttpClient_exports
|
|
42
|
+
} from "./chunk-PD6I2SDG.js";
|
|
41
43
|
import "./chunk-5FHWNLCI.js";
|
|
42
44
|
import {
|
|
43
45
|
AccountId,
|
|
44
46
|
HttpUrl,
|
|
45
47
|
JsonObject
|
|
46
48
|
} from "./chunk-H2CJWXA3.js";
|
|
47
|
-
import "./chunk-
|
|
49
|
+
import "./chunk-TUMGL2OC.js";
|
|
48
50
|
import {
|
|
49
51
|
HttpClientRequest_exports,
|
|
50
52
|
HttpClient_exports
|
|
51
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-EOPQ727L.js";
|
|
52
54
|
import {
|
|
53
55
|
Effect_exports,
|
|
54
56
|
Redacted_exports,
|
|
@@ -276,7 +278,7 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
|
|
|
276
278
|
if (response.status < 200 || response.status >= 300)
|
|
277
279
|
return yield* httpProviderError(response.status, response.headers) ?? new GraphqlError({ phase, reason: "request", status: response.status });
|
|
278
280
|
const result = yield* response.json.pipe(
|
|
279
|
-
|
|
281
|
+
owned("upstream", "provider.http.response.read"),
|
|
280
282
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(GraphqlResponse)),
|
|
281
283
|
Effect_exports.mapError(() => new GraphqlError({ phase, reason: "invalid_response" }))
|
|
282
284
|
);
|
|
@@ -287,7 +289,7 @@ var graphqlClientEffect = (input) => Effect_exports.gen(function* () {
|
|
|
287
289
|
return result.data;
|
|
288
290
|
})
|
|
289
291
|
).pipe(
|
|
290
|
-
|
|
292
|
+
owned("upstream", "provider.graphql.request", {
|
|
291
293
|
attributes: {
|
|
292
294
|
"executor.operation": phase,
|
|
293
295
|
"server.address": url.hostname
|
|
@@ -416,7 +418,7 @@ var adaptGraphqlTool = (client, definition) => Effect_exports.gen(function* () {
|
|
|
416
418
|
return yield* new GraphqlError({ phase: "call", reason: "invalid_response" });
|
|
417
419
|
return value;
|
|
418
420
|
}).pipe(
|
|
419
|
-
|
|
421
|
+
owned("upstream", "provider.graphql.call", {
|
|
420
422
|
attributes: {
|
|
421
423
|
"graphql.operation.type": kind,
|
|
422
424
|
"executor.tool.name": name
|
package/js/host.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAppHandler
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OJ47HQVJ.js";
|
|
4
4
|
import "./chunk-AQU56EPI.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-3UGDI2UI.js";
|
|
6
|
+
import "./chunk-7UUHJR2Q.js";
|
|
7
7
|
import "./chunk-XBG7HHXC.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-3B2JAOSE.js";
|
|
9
|
+
import "./chunk-LHCGND3R.js";
|
|
10
|
+
import "./chunk-LTDHQJ2Z.js";
|
|
11
11
|
import {
|
|
12
12
|
ElicitationFailed,
|
|
13
13
|
ElicitationReply,
|
|
14
14
|
HostAccountsInvalid,
|
|
15
15
|
HostInputInvalid,
|
|
16
16
|
HostResponse,
|
|
17
|
+
InvocationTimingSink,
|
|
17
18
|
ResolvedAccounts,
|
|
18
19
|
TrustedToolApproval,
|
|
19
20
|
WorkflowFailure,
|
|
@@ -21,25 +22,26 @@ import {
|
|
|
21
22
|
WorkflowRun,
|
|
22
23
|
WorkflowRunId,
|
|
23
24
|
WorkflowRunPage
|
|
24
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-CVAJ4F6O.js";
|
|
25
26
|
import {
|
|
26
27
|
CacheCommand,
|
|
27
28
|
CacheError,
|
|
28
29
|
CacheReply
|
|
29
30
|
} from "./chunk-MWKHKOTL.js";
|
|
30
31
|
import "./chunk-H72MEDMN.js";
|
|
32
|
+
import "./chunk-KGCTYL2S.js";
|
|
31
33
|
import {
|
|
32
34
|
collectTelemetry,
|
|
33
35
|
withRemoteSpan
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-KGCTYL2S.js";
|
|
36
|
+
} from "./chunk-JM7LOD2W.js";
|
|
37
|
+
import "./chunk-PD6I2SDG.js";
|
|
37
38
|
import "./chunk-5FHWNLCI.js";
|
|
38
39
|
import "./chunk-H2CJWXA3.js";
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-TUMGL2OC.js";
|
|
41
|
+
import "./chunk-EOPQ727L.js";
|
|
41
42
|
import {
|
|
42
43
|
Cause_exports,
|
|
44
|
+
Clock_exports,
|
|
43
45
|
Effect_exports,
|
|
44
46
|
Redacted_exports,
|
|
45
47
|
Scheduler_exports,
|
|
@@ -52,14 +54,17 @@ var isolatedCacheSession = (callback) => {
|
|
|
52
54
|
const controller = new AbortController();
|
|
53
55
|
const pending = /* @__PURE__ */ new Set();
|
|
54
56
|
const cache = {
|
|
55
|
-
transport: (command) =>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
(
|
|
57
|
+
transport: (command) => (
|
|
58
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's cache RPC
|
|
59
|
+
Effect_exports.tryPromise({
|
|
60
|
+
try: () => callback(Schema_exports.encodeSync(CacheCommand)(command)),
|
|
61
|
+
catch: () => new CacheError({ reason: "storage" })
|
|
62
|
+
}).pipe(
|
|
63
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(CacheReply)),
|
|
64
|
+
Effect_exports.mapError(() => new CacheError({ reason: "storage" })),
|
|
65
|
+
Effect_exports.flatMap(
|
|
66
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
|
|
67
|
+
)
|
|
63
68
|
)
|
|
64
69
|
),
|
|
65
70
|
background: (task) => Effect_exports.gen(function* () {
|
|
@@ -97,14 +102,17 @@ var isolatedCacheSession = (callback) => {
|
|
|
97
102
|
// src/implementation/workflow-rpc.ts
|
|
98
103
|
var isolatedWorkflowExecution = (run, deliver, signal) => {
|
|
99
104
|
const runId = Schema_exports.decodeUnknownSync(WorkflowRunId)(run);
|
|
100
|
-
const request = (input, callback) =>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
(
|
|
105
|
+
const request = (input, callback) => (
|
|
106
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
|
|
107
|
+
Effect_exports.tryPromise({
|
|
108
|
+
try: () => deliver(input, callback),
|
|
109
|
+
catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
|
|
110
|
+
}).pipe(
|
|
111
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
|
|
112
|
+
Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
|
|
113
|
+
Effect_exports.flatMap(
|
|
114
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.value) : Effect_exports.fail(reply.error)
|
|
115
|
+
)
|
|
108
116
|
)
|
|
109
117
|
);
|
|
110
118
|
return {
|
|
@@ -146,14 +154,17 @@ var isolatedWorkflowExecution = (run, deliver, signal) => {
|
|
|
146
154
|
};
|
|
147
155
|
};
|
|
148
156
|
var isolatedWorkflowControls = (deliver) => {
|
|
149
|
-
const request = (input) =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
(
|
|
157
|
+
const request = (input) => (
|
|
158
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's workflow RPC
|
|
159
|
+
Effect_exports.tryPromise({
|
|
160
|
+
try: () => deliver(input),
|
|
161
|
+
catch: () => new WorkflowFailure({ reason: "engine", retryable: true })
|
|
162
|
+
}).pipe(
|
|
163
|
+
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(WorkflowRpcResult)),
|
|
164
|
+
Effect_exports.mapError(() => new WorkflowFailure({ reason: "engine", retryable: true })),
|
|
165
|
+
Effect_exports.flatMap(
|
|
166
|
+
(result) => result.ok ? Effect_exports.succeed(result.value) : Effect_exports.fail(result.error)
|
|
167
|
+
)
|
|
157
168
|
)
|
|
158
169
|
);
|
|
159
170
|
const run = (input) => request(input).pipe(
|
|
@@ -202,17 +213,27 @@ var createAppHandler2 = (app) => {
|
|
|
202
213
|
);
|
|
203
214
|
};
|
|
204
215
|
};
|
|
216
|
+
var isolatedClock = () => Effect_exports.runSync(Clock_exports.currentTimeNanos);
|
|
205
217
|
var createIsolatedAppHandler = (app) => {
|
|
206
218
|
const handler = createAppHandler(app);
|
|
207
219
|
return (request, context) => Effect_exports.runPromise(
|
|
208
220
|
Effect_exports.gen(function* () {
|
|
221
|
+
let timing;
|
|
209
222
|
const { value, telemetry } = yield* collectTelemetry(
|
|
210
|
-
handler(request, context).pipe(
|
|
223
|
+
handler(request, context).pipe(
|
|
224
|
+
withRemoteSpan(request, "app.dispatch"),
|
|
225
|
+
Effect_exports.provideService(InvocationTimingSink, (reported) => {
|
|
226
|
+
timing = reported;
|
|
227
|
+
})
|
|
228
|
+
)
|
|
211
229
|
);
|
|
212
230
|
const body = yield* Effect_exports.promise(() => value.json()).pipe(
|
|
213
231
|
Effect_exports.flatMap(Schema_exports.decodeUnknownEffect(HostResponse))
|
|
214
232
|
);
|
|
215
|
-
return Response.json(
|
|
233
|
+
return Response.json(
|
|
234
|
+
{ ...body, telemetry, ...timing === void 0 ? {} : { timing } },
|
|
235
|
+
{ status: value.status }
|
|
236
|
+
);
|
|
216
237
|
}),
|
|
217
238
|
{
|
|
218
239
|
signal: request.signal,
|
|
@@ -222,20 +243,23 @@ var createIsolatedAppHandler = (app) => {
|
|
|
222
243
|
}
|
|
223
244
|
);
|
|
224
245
|
};
|
|
225
|
-
var isolatedElicitation = (deliver, lifetime) => (request) =>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
})
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
246
|
+
var isolatedElicitation = (deliver, lifetime) => (request) => (
|
|
247
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- the host's elicitation RPC
|
|
248
|
+
Effect_exports.tryPromise({
|
|
249
|
+
try: () => deliver(request),
|
|
250
|
+
catch: () => {
|
|
251
|
+
lifetime.abort();
|
|
252
|
+
return new ElicitationFailed({ reason: "transport" });
|
|
253
|
+
}
|
|
254
|
+
}).pipe(
|
|
255
|
+
Effect_exports.flatMap(
|
|
256
|
+
(reply) => Schema_exports.decodeUnknownEffect(ElicitationReply)(reply).pipe(
|
|
257
|
+
Effect_exports.mapError(() => new ElicitationFailed({ reason: "transport" }))
|
|
258
|
+
)
|
|
259
|
+
),
|
|
260
|
+
Effect_exports.flatMap(
|
|
261
|
+
(reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
|
|
235
262
|
)
|
|
236
|
-
),
|
|
237
|
-
Effect_exports.flatMap(
|
|
238
|
-
(reply) => reply.ok ? Effect_exports.succeed(reply.response) : Effect_exports.fail(reply.error)
|
|
239
263
|
)
|
|
240
264
|
);
|
|
241
265
|
export {
|
|
@@ -243,6 +267,7 @@ export {
|
|
|
243
267
|
createIsolatedAppHandler,
|
|
244
268
|
hostContext,
|
|
245
269
|
isolatedCacheSession,
|
|
270
|
+
isolatedClock,
|
|
246
271
|
isolatedElicitation,
|
|
247
272
|
isolatedWorkflowControls,
|
|
248
273
|
isolatedWorkflowExecution
|
package/js/index.js
CHANGED
|
@@ -3,10 +3,9 @@ import {
|
|
|
3
3
|
ResponseStatusError,
|
|
4
4
|
defineApp,
|
|
5
5
|
workflow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3B2JAOSE.js";
|
|
7
7
|
import {
|
|
8
8
|
dynamicRouter,
|
|
9
|
-
fromPromise,
|
|
10
9
|
mutation,
|
|
11
10
|
nativeOperation,
|
|
12
11
|
nativeRouter,
|
|
@@ -17,10 +16,11 @@ import {
|
|
|
17
16
|
toolAnnotations,
|
|
18
17
|
withApproval,
|
|
19
18
|
withApprovals
|
|
20
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LHCGND3R.js";
|
|
21
20
|
import {
|
|
22
|
-
accountProviderError
|
|
23
|
-
|
|
21
|
+
accountProviderError,
|
|
22
|
+
fromPromise
|
|
23
|
+
} from "./chunk-LTDHQJ2Z.js";
|
|
24
24
|
import {
|
|
25
25
|
CalendarSchedule,
|
|
26
26
|
ElicitationFailed,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
ScheduleTiming,
|
|
36
36
|
SecretsMethod,
|
|
37
37
|
WorkflowFailure
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CVAJ4F6O.js";
|
|
39
39
|
import {
|
|
40
40
|
CacheError,
|
|
41
41
|
FetchOptionUnsupported,
|
|
@@ -65,14 +65,16 @@ import {
|
|
|
65
65
|
withLazyJsonSchemaDocument,
|
|
66
66
|
wrap
|
|
67
67
|
} from "./chunk-KGCTYL2S.js";
|
|
68
|
+
import "./chunk-JM7LOD2W.js";
|
|
69
|
+
import "./chunk-PD6I2SDG.js";
|
|
68
70
|
import "./chunk-5FHWNLCI.js";
|
|
69
71
|
import {
|
|
70
72
|
JsonObject,
|
|
71
73
|
JsonValue,
|
|
72
74
|
ValidationError
|
|
73
75
|
} from "./chunk-H2CJWXA3.js";
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
76
|
+
import "./chunk-TUMGL2OC.js";
|
|
77
|
+
import "./chunk-EOPQ727L.js";
|
|
76
78
|
import {
|
|
77
79
|
Effect_exports,
|
|
78
80
|
Schema_exports
|
|
@@ -100,7 +102,7 @@ var defineProvider = ({
|
|
|
100
102
|
...options
|
|
101
103
|
}) => {
|
|
102
104
|
if (health === void 0) return new Provider(options);
|
|
103
|
-
const run = fromPromise(health);
|
|
105
|
+
const run = fromPromise(health, "check");
|
|
104
106
|
return new Provider({ ...options, health: { run } });
|
|
105
107
|
};
|
|
106
108
|
|
|
@@ -341,7 +343,7 @@ var accountRouter = (accounts, discover, options) => Effect_exports.runPromise(
|
|
|
341
343
|
|
|
342
344
|
// src/implementation/dynamic-skills.ts
|
|
343
345
|
var dynamicSkills = (source) => ({
|
|
344
|
-
list: fromPromise(async () => source.list())
|
|
346
|
+
list: fromPromise(async () => source.list(), "skills")
|
|
345
347
|
});
|
|
346
348
|
|
|
347
349
|
// src/contracts/app.ts
|
|
@@ -404,12 +406,15 @@ function oauth22(options) {
|
|
|
404
406
|
var decodeJson2 = (response, schema) => {
|
|
405
407
|
const native = {
|
|
406
408
|
status: response.status,
|
|
407
|
-
json: () =>
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
json: () => (
|
|
410
|
+
// oxlint-disable-next-line executor/authored-code-through-adapter -- a Response the app passes from its own code
|
|
411
|
+
Effect_exports.tryPromise({
|
|
412
|
+
try: () => response.json(),
|
|
413
|
+
catch: (error) => error
|
|
414
|
+
}).pipe(
|
|
415
|
+
Effect_exports.catch(
|
|
416
|
+
(error) => error instanceof SyntaxError ? Effect_exports.fail(new ResponseDecodeError()) : Effect_exports.die(error)
|
|
417
|
+
)
|
|
413
418
|
)
|
|
414
419
|
)
|
|
415
420
|
};
|