apps 0.0.1-beta.44 → 0.0.1-beta.47
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-DZQYE626.js → chunk-7UUHJR2Q.js} +1 -1
- package/js/{chunk-4ZTVLEN6.js → chunk-CDXQDN7W.js} +1 -1
- package/js/{chunk-V3RS2BK6.js → chunk-D45JTD6N.js} +39 -29
- package/js/chunk-GDYPM7RS.js +266 -0
- package/js/{chunk-CZGWW4NQ.js → chunk-JM7LOD2W.js} +187 -9
- package/js/{chunk-ELO5PRCO.js → chunk-JY56GVSV.js} +95 -4
- package/js/{chunk-EJUK2NK5.js → chunk-KLYSEHUD.js} +1 -1
- package/js/{chunk-EMHFXFTJ.js → chunk-LTDHQJ2Z.js} +53 -0
- package/js/{chunk-MZH4J2PO.js → chunk-PD6I2SDG.js} +1 -1
- package/js/{chunk-DRJRCHHO.js → chunk-PO5NPRFT.js} +204 -73
- package/js/{chunk-MGGMEGB2.js → chunk-QKHTRD6G.js} +2 -2
- package/js/{chunk-5SHUB37R.js → chunk-SVHI6AKV.js} +3 -3
- package/js/{chunk-KSGYJV46.js → chunk-TUMGL2OC.js} +1 -1
- package/js/{chunk-5GLC42LK.js → chunk-UM62MBJQ.js} +42 -24
- package/js/{chunk-OTGUPKKK.js → chunk-X5U5KIWQ.js} +12 -46
- package/js/{chunk-7EBODVQJ.js → chunk-YQD2MLFY.js} +14 -13
- package/js/client.js +8 -8
- package/js/contracts.js +25 -3
- package/js/effect.js +11 -11
- package/js/graphql.js +20 -18
- package/js/host.js +76 -51
- package/js/index.js +23 -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/app.d.ts +2 -0
- package/types/apps/src/contracts/context.d.ts +8 -1
- package/types/apps/src/contracts/events.d.ts +93 -0
- package/types/apps/src/contracts/host.d.ts +21 -4
- package/types/apps/src/contracts/protocol-version.d.ts +2 -2
- package/types/apps/src/contracts/protocols/11.d.ts +1098 -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/events.d.ts +59 -0
- 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/sql.d.ts +5 -0
- package/types/apps/src/implementation/workflows.d.ts +1 -1
- package/types/apps/src/index.d.ts +2 -0
- package/types/telemetry/src/index.d.ts +1 -0
- package/types/telemetry/src/ownership.d.ts +56 -0
- package/js/chunk-646JVUH4.js +0 -156
- package/js/{chunk-LNSVJS2Q.js → chunk-EOPQ727L.js} +2 -2
|
@@ -1983,6 +1983,52 @@ var WebhookCommand = Schema_exports.Union([
|
|
|
1983
1983
|
})
|
|
1984
1984
|
]);
|
|
1985
1985
|
|
|
1986
|
+
// src/contracts/events.ts
|
|
1987
|
+
var EventName = Schema_exports.String.check(
|
|
1988
|
+
Schema_exports.isPattern(/^[a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)*$/u),
|
|
1989
|
+
Schema_exports.isMaxLength(64)
|
|
1990
|
+
);
|
|
1991
|
+
var EventFilterValue = Schema_exports.Union([Schema_exports.String, Schema_exports.Finite, Schema_exports.Boolean]);
|
|
1992
|
+
var EventLimits = Schema_exports.Struct({
|
|
1993
|
+
/** An occurrence's `data`, leaving room under a 256 KiB delivery for its envelope. */
|
|
1994
|
+
maxDataBytes: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1995
|
+
maxEventsPerInvocation: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1996
|
+
maxDescriptionLength: Schema_exports.Int.check(Schema_exports.isGreaterThan(0)),
|
|
1997
|
+
maxIdLength: Schema_exports.Int.check(Schema_exports.isGreaterThan(0))
|
|
1998
|
+
});
|
|
1999
|
+
var defaultEventLimits = EventLimits.make({
|
|
2000
|
+
maxDataBytes: 250 * 1024,
|
|
2001
|
+
maxEventsPerInvocation: 100,
|
|
2002
|
+
maxDescriptionLength: 1e3,
|
|
2003
|
+
maxIdLength: 200
|
|
2004
|
+
});
|
|
2005
|
+
var DeclaredEvent = Schema_exports.Struct({
|
|
2006
|
+
description: Schema_exports.String.check(
|
|
2007
|
+
Schema_exports.isMinLength(1),
|
|
2008
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxDescriptionLength)
|
|
2009
|
+
),
|
|
2010
|
+
/** An object of scalar fields. Subscribers may name any of them to narrow an event. */
|
|
2011
|
+
filters: JsonObject2,
|
|
2012
|
+
/** The shape of each occurrence's `data`. */
|
|
2013
|
+
payload: JsonObject2
|
|
2014
|
+
});
|
|
2015
|
+
var DeclaredEvents = Schema_exports.Record(EventName, DeclaredEvent);
|
|
2016
|
+
var EmittedEvent = Schema_exports.Struct({
|
|
2017
|
+
name: EventName,
|
|
2018
|
+
id: Schema_exports.String.check(
|
|
2019
|
+
Schema_exports.isMinLength(1),
|
|
2020
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxIdLength)
|
|
2021
|
+
),
|
|
2022
|
+
/** Milliseconds since the epoch when the event happened. */
|
|
2023
|
+
occurredAt: Schema_exports.Int.check(Schema_exports.isGreaterThanOrEqualTo(0)),
|
|
2024
|
+
data: JsonValue,
|
|
2025
|
+
filters: Schema_exports.Record(Schema_exports.String, EventFilterValue),
|
|
2026
|
+
account: Schema_exports.NullOr(AccountId)
|
|
2027
|
+
});
|
|
2028
|
+
var EmittedEvents = Schema_exports.Array(EmittedEvent).check(
|
|
2029
|
+
Schema_exports.isMaxLength(defaultEventLimits.maxEventsPerInvocation)
|
|
2030
|
+
);
|
|
2031
|
+
|
|
1986
2032
|
// src/contracts/provider.ts
|
|
1987
2033
|
var SecretsMethod = class extends Data_exports.TaggedClass(
|
|
1988
2034
|
"secrets"
|
|
@@ -2139,7 +2185,7 @@ var ManyAccounts = class extends Data_exports.TaggedClass("many") {
|
|
|
2139
2185
|
};
|
|
2140
2186
|
|
|
2141
2187
|
// src/contracts/protocol-version.ts
|
|
2142
|
-
var frameworkProtocol =
|
|
2188
|
+
var frameworkProtocol = 11;
|
|
2143
2189
|
|
|
2144
2190
|
// src/contracts/protocols/oauth.ts
|
|
2145
2191
|
var OAuthClientAuth2 = Schema_exports.Literals([
|
|
@@ -3197,6 +3243,29 @@ var protocol10 = {
|
|
|
3197
3243
|
}
|
|
3198
3244
|
};
|
|
3199
3245
|
|
|
3246
|
+
// src/contracts/protocols/11.ts
|
|
3247
|
+
var DeclaredRequirements6 = Schema_exports.Struct({
|
|
3248
|
+
...DeclaredRequirements5.fields,
|
|
3249
|
+
events: Schema_exports.optionalKey(DeclaredEvents)
|
|
3250
|
+
});
|
|
3251
|
+
var HostResponse6 = Schema_exports.Union([
|
|
3252
|
+
Schema_exports.Struct({
|
|
3253
|
+
ok: Schema_exports.Literal(true),
|
|
3254
|
+
value: JsonValue,
|
|
3255
|
+
toolError: Schema_exports.optionalKey(Schema_exports.Literal(true)),
|
|
3256
|
+
events: Schema_exports.optionalKey(EmittedEvents)
|
|
3257
|
+
}),
|
|
3258
|
+
Schema_exports.Struct({ ok: Schema_exports.Literal(false), error: HostError5 })
|
|
3259
|
+
]);
|
|
3260
|
+
var protocol11 = {
|
|
3261
|
+
version: 11,
|
|
3262
|
+
schemas: {
|
|
3263
|
+
...protocol10.schemas,
|
|
3264
|
+
requirements: DeclaredRequirements6,
|
|
3265
|
+
response: HostResponse6
|
|
3266
|
+
}
|
|
3267
|
+
};
|
|
3268
|
+
|
|
3200
3269
|
// src/contracts/host.ts
|
|
3201
3270
|
var skillsCommand = (sources) => sources ? { operation: "skills", sources: true } : { operation: "skills" };
|
|
3202
3271
|
var skillCatalog = (response) => Schema_exports.is(SkillSources2)(response) ? response : { skills: response };
|
|
@@ -3253,6 +3322,17 @@ var ToolResultObservation = Context_exports.Reference(
|
|
|
3253
3322
|
{ defaultValue: () => ({ failed: () => {
|
|
3254
3323
|
} }) }
|
|
3255
3324
|
);
|
|
3325
|
+
var InvocationTiming = Schema_exports.Struct({
|
|
3326
|
+
elapsedMs: Schema_exports.Finite,
|
|
3327
|
+
upstreamMs: Schema_exports.Finite,
|
|
3328
|
+
elicitationMs: Schema_exports.Finite,
|
|
3329
|
+
authoredMs: Schema_exports.Finite
|
|
3330
|
+
});
|
|
3331
|
+
var InvocationTimingSink = Context_exports.Reference(
|
|
3332
|
+
"apps/InvocationTimingSink",
|
|
3333
|
+
{ defaultValue: () => () => {
|
|
3334
|
+
} }
|
|
3335
|
+
);
|
|
3256
3336
|
|
|
3257
3337
|
export {
|
|
3258
3338
|
SecretsMethod,
|
|
@@ -3329,6 +3409,14 @@ export {
|
|
|
3329
3409
|
ManualWebhookDescriptor,
|
|
3330
3410
|
HostedWebhook,
|
|
3331
3411
|
WebhookCommand,
|
|
3412
|
+
EventName,
|
|
3413
|
+
EventFilterValue,
|
|
3414
|
+
EventLimits,
|
|
3415
|
+
defaultEventLimits,
|
|
3416
|
+
DeclaredEvent,
|
|
3417
|
+
DeclaredEvents,
|
|
3418
|
+
EmittedEvent,
|
|
3419
|
+
EmittedEvents,
|
|
3332
3420
|
frameworkProtocol,
|
|
3333
3421
|
minimumIntervalMilliseconds,
|
|
3334
3422
|
Interval,
|
|
@@ -3377,14 +3465,15 @@ export {
|
|
|
3377
3465
|
HostedCatalog3 as HostedCatalog,
|
|
3378
3466
|
HostedCatalogSummary3 as HostedCatalogSummary,
|
|
3379
3467
|
HostError5 as HostError,
|
|
3380
|
-
HostResponse5 as HostResponse,
|
|
3381
3468
|
protocol9,
|
|
3382
|
-
DeclaredRequirements5 as DeclaredRequirements,
|
|
3383
3469
|
MigrateCommand,
|
|
3384
3470
|
MigrateResult,
|
|
3385
3471
|
HostRequest4 as HostRequest,
|
|
3386
3472
|
HostInvocation6 as HostInvocation,
|
|
3387
3473
|
protocol10,
|
|
3474
|
+
DeclaredRequirements6 as DeclaredRequirements,
|
|
3475
|
+
HostResponse6 as HostResponse,
|
|
3476
|
+
protocol11,
|
|
3388
3477
|
skillsCommand,
|
|
3389
3478
|
skillCatalog,
|
|
3390
3479
|
inspectCommand,
|
|
@@ -3395,5 +3484,7 @@ export {
|
|
|
3395
3484
|
HostCallError,
|
|
3396
3485
|
HostAccountCheckError,
|
|
3397
3486
|
HostDataError,
|
|
3398
|
-
ToolResultObservation
|
|
3487
|
+
ToolResultObservation,
|
|
3488
|
+
InvocationTiming,
|
|
3489
|
+
InvocationTimingSink
|
|
3399
3490
|
};
|
|
@@ -2,14 +2,63 @@ import {
|
|
|
2
2
|
ProviderError,
|
|
3
3
|
maxUpstreamMessageLength
|
|
4
4
|
} from "./chunk-MWKHKOTL.js";
|
|
5
|
+
import {
|
|
6
|
+
owned
|
|
7
|
+
} from "./chunk-JM7LOD2W.js";
|
|
5
8
|
import {
|
|
6
9
|
AccountId
|
|
7
10
|
} from "./chunk-H2CJWXA3.js";
|
|
8
11
|
import {
|
|
12
|
+
Effect_exports,
|
|
9
13
|
Option_exports,
|
|
10
14
|
Schema_exports
|
|
11
15
|
} from "./chunk-IFJU5SYQ.js";
|
|
12
16
|
|
|
17
|
+
// src/implementation/authoring.ts
|
|
18
|
+
var NativeCallback = /* @__PURE__ */ Symbol("apps.NativeCallback");
|
|
19
|
+
var appCode = (code) => owned("app", "app.code", { attributes: { "executor.app.code": code } });
|
|
20
|
+
var fromPromise = (callback, code) => (...args) => {
|
|
21
|
+
if (NativeCallback in callback) {
|
|
22
|
+
const native = callback[NativeCallback];
|
|
23
|
+
return native(...args);
|
|
24
|
+
}
|
|
25
|
+
return Effect_exports.tryPromise({ try: () => callback(...args), catch: (error) => error }).pipe(
|
|
26
|
+
appCode(code)
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
var method = (target, key) => {
|
|
30
|
+
const value = target[key];
|
|
31
|
+
const call = (...args) => Reflect.apply(value, target, args);
|
|
32
|
+
if (NativeCallback in value) Object.assign(call, { [NativeCallback]: value[NativeCallback] });
|
|
33
|
+
return call;
|
|
34
|
+
};
|
|
35
|
+
var toPromise = (operation, signalOf, services) => {
|
|
36
|
+
const native = (...args) => Effect_exports.suspend(() => {
|
|
37
|
+
const signal = typeof signalOf === "function" ? signalOf(...args) : signalOf;
|
|
38
|
+
if (signal === void 0) return operation(...args);
|
|
39
|
+
if (signal.aborted) return Effect_exports.interrupt;
|
|
40
|
+
const cancelled = Effect_exports.callback((resume) => {
|
|
41
|
+
if (signal.aborted) {
|
|
42
|
+
resume(Effect_exports.interrupt);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const abort = () => resume(Effect_exports.interrupt);
|
|
46
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
47
|
+
return Effect_exports.sync(() => signal.removeEventListener("abort", abort));
|
|
48
|
+
});
|
|
49
|
+
return Effect_exports.raceFirst(
|
|
50
|
+
cancelled,
|
|
51
|
+
Effect_exports.suspend(() => operation(...args))
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
return Object.assign(
|
|
55
|
+
(...args) => services === void 0 ? Effect_exports.runPromise(native(...args)) : Effect_exports.runPromiseWith(services)(native(...args)),
|
|
56
|
+
{
|
|
57
|
+
[NativeCallback]: native
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
13
62
|
// src/implementation/upstream-error.ts
|
|
14
63
|
var ErrorToken = Schema_exports.String.check(Schema_exports.isPattern(/^[A-Za-z0-9._-]{1,128}$/u));
|
|
15
64
|
var JsonRpcError = Schema_exports.Struct({
|
|
@@ -107,6 +156,10 @@ function graphqlProviderError(errors, status) {
|
|
|
107
156
|
}
|
|
108
157
|
|
|
109
158
|
export {
|
|
159
|
+
appCode,
|
|
160
|
+
fromPromise,
|
|
161
|
+
method,
|
|
162
|
+
toPromise,
|
|
110
163
|
isShortenedUpstream,
|
|
111
164
|
bodyUpstreamError,
|
|
112
165
|
providerError,
|