apps 0.0.1-beta.1 → 0.0.1-beta.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -72
- package/framework-reference.json +1 -1
- package/js/browser-XIPJGLH2.js +65 -0
- package/js/chunk-2CURR5Y7.js +264 -0
- package/js/chunk-2LSGC7XY.js +42 -0
- package/js/{chunk-YEJOQEII.js → chunk-4PIQKACY.js} +65 -10
- package/js/chunk-4UPC36ZL.js +5185 -0
- package/js/{chunk-4LPG6RCH.js → chunk-4X2UI4R2.js} +7 -27
- package/js/chunk-5C6RAGAS.js +335 -0
- package/js/chunk-62NVUKED.js +39 -0
- package/js/chunk-74H25C4X.js +95 -0
- package/js/chunk-7HG422GB.js +90 -0
- package/js/chunk-7STIP5CS.js +171 -0
- package/js/{chunk-QKHR7BMF.js → chunk-ACQXVKVQ.js} +87 -51
- package/js/{chunk-OHRT55C4.js → chunk-DILSCQPJ.js} +226 -265
- package/js/chunk-ILYCJ3HV.js +449 -0
- package/js/chunk-K6TSCYAO.js +712 -0
- package/js/{chunk-EVJUVWN2.js → chunk-KLSEU35Y.js} +463 -218
- package/js/chunk-OD3KFKZD.js +1617 -0
- package/js/chunk-OWN3DP2W.js +88 -0
- package/js/{chunk-ZTFQHGEB.js → chunk-PBGPES67.js} +3 -5
- package/js/chunk-QI66R4FP.js +786 -0
- package/js/chunk-RN4YB4JT.js +1922 -0
- package/js/{chunk-ZCAMUXSG.js → chunk-URKOTNDA.js} +795 -177
- package/js/{chunk-NCYXZN2G.js → chunk-UVL56Z6E.js} +390 -23
- package/js/{chunk-2HHMABB6.js → chunk-VAI3EVCS.js} +700 -78
- package/js/chunk-VCYWAA4N.js +49 -0
- package/js/{chunk-HDJH3RPR.js → chunk-YDW7DX3A.js} +4 -4
- package/js/chunk-YWVISRZD.js +268 -0
- package/js/{chunk-FW5HBOIK.js → chunk-ZKDXML77.js} +19272 -18299
- package/js/client.js +148 -100
- package/js/contracts.js +208 -24
- package/js/effect.js +18 -19
- package/js/es-DIULA3ZF.js +39371 -0
- package/js/graphql.js +62 -58
- package/js/host.js +83 -60
- package/js/index.js +381 -263
- package/js/mcp/effect.js +21 -21
- package/js/mcp.js +117 -74
- package/js/openapi.js +4613 -42691
- package/js/react.js +2 -3
- package/js/skills/effect.js +6 -4
- package/js/skills.js +233 -70
- package/js/storage/facet.js +1 -540
- package/js/ui/auth/contracts.js +8 -9
- package/js/ui/auth.js +16 -14
- package/js/ui/contracts.js +9 -8
- package/js/ui/serving.js +8609 -227
- package/package.json +3 -8
- package/runtime.json +1 -1
- package/types/app-cache/src/contracts/cache.d.ts +60 -2
- package/types/app-cache/src/index.d.ts +92 -2
- package/types/app-data/src/contracts/database.d.ts +33 -6
- package/types/apps/src/contracts/api-response-error.d.ts +4 -0
- package/types/apps/src/contracts/app.d.ts +63 -17
- package/types/apps/src/contracts/cache.d.ts +24 -1
- package/types/apps/src/contracts/context.d.ts +60 -17
- package/types/apps/src/contracts/elicitation.d.ts +23 -7
- package/types/apps/src/contracts/events.d.ts +94 -0
- package/types/apps/src/contracts/failure.d.ts +54 -0
- package/types/apps/src/contracts/graphql.d.ts +2 -1
- package/types/apps/src/contracts/host.d.ts +1325 -534
- package/types/apps/src/contracts/icons.d.ts +28 -0
- package/types/apps/src/contracts/live.d.ts +2 -0
- package/types/apps/src/contracts/mcp.d.ts +97 -20
- package/types/apps/src/contracts/network.d.ts +120 -0
- package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
- package/types/apps/src/contracts/openapi-document.d.ts +1 -1
- package/types/apps/src/contracts/openapi.d.ts +51 -9
- package/types/apps/src/contracts/operations.d.ts +14 -12
- package/types/apps/src/contracts/placement.d.ts +102 -0
- package/types/apps/src/contracts/protocol-version.d.ts +6 -0
- package/types/apps/src/contracts/protocols/1.d.ts +2241 -0
- package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
- package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
- package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
- package/types/apps/src/contracts/protocols/2.d.ts +711 -0
- package/types/apps/src/contracts/protocols/3.d.ts +776 -0
- package/types/apps/src/contracts/protocols/4.d.ts +1306 -0
- package/types/apps/src/contracts/protocols/5.d.ts +1200 -0
- package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
- package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
- package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
- package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
- package/types/apps/src/contracts/protocols/current.d.ts +6857 -0
- package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
- package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
- package/types/apps/src/contracts/provider-error.d.ts +9 -0
- package/types/apps/src/contracts/provider.d.ts +140 -10
- package/types/apps/src/contracts/router.d.ts +59 -0
- package/types/apps/src/contracts/schedules.d.ts +7 -1
- package/types/apps/src/contracts/schema.d.ts +21 -0
- package/types/apps/src/contracts/shared-catalog.d.ts +11 -0
- package/types/apps/src/contracts/skills.d.ts +60 -14
- package/types/apps/src/contracts/sql.d.ts +63 -0
- package/types/apps/src/contracts/ui-auth.d.ts +6 -14
- package/types/apps/src/contracts/ui.d.ts +70 -30
- package/types/apps/src/contracts/webhooks.d.ts +24 -7
- package/types/apps/src/contracts/workflows.d.ts +89 -36
- package/types/apps/src/facet.d.ts +4 -5
- package/types/apps/src/graphql.d.ts +1 -3
- package/types/apps/src/host.d.ts +5 -0
- package/types/apps/src/implementation/account-router.d.ts +13 -0
- package/types/apps/src/implementation/app.d.ts +44 -16
- package/types/apps/src/implementation/authoring.d.ts +25 -5
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
- package/types/apps/src/implementation/cache.d.ts +32 -3
- package/types/apps/src/implementation/catalog-cache.d.ts +43 -5
- package/types/apps/src/implementation/elicitation.d.ts +18 -15
- package/types/apps/src/implementation/events.d.ts +64 -0
- package/types/apps/src/implementation/failure-detail.d.ts +48 -0
- package/types/apps/src/implementation/graphql-catalog.d.ts +4 -7
- package/types/apps/src/implementation/graphql.d.ts +4 -3
- package/types/apps/src/implementation/input-problems.d.ts +6 -2
- package/types/apps/src/implementation/invocation-timing.d.ts +18 -0
- package/types/apps/src/implementation/live.d.ts +2 -2
- package/types/apps/src/implementation/mcp-call.d.ts +6 -5
- package/types/apps/src/implementation/mcp-catalog.d.ts +7 -8
- package/types/apps/src/implementation/mcp-client.d.ts +49 -25
- package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
- package/types/apps/src/implementation/mcp.d.ts +52 -25
- package/types/apps/src/implementation/network.d.ts +16 -0
- package/types/apps/src/implementation/openapi-compile.d.ts +30 -8
- package/types/apps/src/implementation/openapi-document.d.ts +46 -21
- package/types/apps/src/implementation/openapi-names.d.ts +23 -0
- package/types/apps/src/implementation/openapi-request.d.ts +10 -3
- package/types/apps/src/implementation/openapi-source.d.ts +30 -8
- package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
- package/types/apps/src/implementation/operations.d.ts +84 -10
- package/types/apps/src/implementation/optimistic.d.ts +1 -1
- package/types/apps/src/implementation/placement.d.ts +60 -0
- package/types/apps/src/implementation/protocol-operations.d.ts +6 -4
- package/types/apps/src/implementation/provider-error.d.ts +28 -1
- package/types/apps/src/implementation/provider.d.ts +26 -6
- package/types/apps/src/implementation/query-commit.d.ts +1 -1
- package/types/apps/src/implementation/router-catalog.d.ts +227 -0
- package/types/apps/src/implementation/router.d.ts +78 -0
- package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
- package/types/apps/src/implementation/schedules.d.ts +39 -8
- package/types/apps/src/implementation/schema.d.ts +111 -15
- package/types/apps/src/implementation/skills.d.ts +18 -24
- package/types/apps/src/implementation/sql.d.ts +71 -0
- package/types/apps/src/implementation/swagger-client.d.ts +28 -0
- package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
- package/types/apps/src/implementation/ui-auth.d.ts +12 -6
- package/types/apps/src/implementation/ui-client.d.ts +3 -3
- package/types/apps/src/implementation/ui-document.d.ts +5 -0
- package/types/apps/src/implementation/ui-errors.d.ts +1 -1
- package/types/apps/src/implementation/ui-serving.d.ts +31 -12
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/apps/src/implementation/upstream-error.d.ts +7 -0
- package/types/apps/src/implementation/webhooks.d.ts +15 -6
- package/types/apps/src/implementation/workflow-context.d.ts +17 -5
- package/types/apps/src/implementation/workflows.d.ts +11 -4
- package/types/apps/src/index.d.ts +71 -21
- package/types/apps/src/mcp.d.ts +25 -5
- package/types/apps/src/openapi.d.ts +11 -6
- package/types/apps/src/react.d.ts +1 -1
- package/types/apps/src/skills.d.ts +13 -8
- package/types/apps/src/ui-auth.d.ts +2 -2
- package/types/apps/src/ui-serving.d.ts +1 -1
- package/types/telemetry/src/app-records.d.ts +42 -0
- package/types/telemetry/src/browser-operations.d.ts +7 -4
- package/types/telemetry/src/browser.d.ts +8 -3
- package/types/telemetry/src/config.d.ts +2 -2
- package/types/telemetry/src/index.d.ts +2 -1
- package/types/telemetry/src/layer.d.ts +10 -4
- package/types/telemetry/src/measurements.d.ts +1 -1
- package/types/telemetry/src/ownership.d.ts +60 -0
- package/types/telemetry/src/recorded-failure.d.ts +29 -0
- package/types/telemetry/src/relay.d.ts +16 -6
- package/types/telemetry/src/span-attributes.d.ts +17 -1
- package/types/telemetry/src/transport.d.ts +8 -1
- package/types/utils/src/api-error.d.ts +55 -0
- package/types/utils/src/connection-failure.d.ts +33 -0
- package/types/utils/src/legacy-keys.d.ts +20 -0
- package/types/utils/src/recorded-message.d.ts +18 -0
- package/types/utils/src/schema-definitions.d.ts +13 -0
- package/types/utils/src/user-facing-error.d.ts +83 -0
- package/js/chunk-6IIO4NPI.js +0 -29
- package/js/chunk-6YBRWRK3.js +0 -160
- package/js/chunk-BMOIAIVR.js +0 -138
- package/js/chunk-FZJOYIZO.js +0 -19
- package/js/chunk-G7IE6BKC.js +0 -224
- package/js/chunk-IHQ4ML7K.js +0 -2193
- package/js/chunk-KOXMLKTM.js +0 -1288
- package/js/chunk-M6ZRRIBI.js +0 -877
- package/js/chunk-PLCMJREA.js +0 -590
- package/js/chunk-PZ36XMXW.js +0 -93
- package/js/chunk-RBAC33PQ.js +0 -267
- package/js/chunk-SATWJKN6.js +0 -34
- package/js/chunk-SWPD52J7.js +0 -35
- package/js/chunk-TE4KO4HI.js +0 -47
- package/js/chunk-W7D7WVSY.js +0 -18
- package/js/chunk-X7SFGU4Q.js +0 -280
- package/js/chunk-ZJWDMTE3.js +0 -63
- package/js/mcp/stdio.js +0 -128
- package/types/app-data/src/implementation/cursor.d.ts +0 -10
- package/types/app-data/src/implementation/index-key.d.ts +0 -7
- package/types/app-data/src/implementation/promise.d.ts +0 -68
- package/types/app-data/src/implementation/range.d.ts +0 -8
- package/types/app-data/src/implementation/schema.d.ts +0 -33
- package/types/app-data/src/implementation/sqlite.d.ts +0 -11
- package/types/app-data/src/index.d.ts +0 -4
- package/types/apps/src/contracts/dynamic-tools.d.ts +0 -13
- package/types/apps/src/contracts/storage.d.ts +0 -68
- package/types/apps/src/implementation/account-operations.d.ts +0 -151
- package/types/apps/src/implementation/dynamic-tools.d.ts +0 -8
- package/types/apps/src/implementation/mcp-stdio.d.ts +0 -4
- package/types/apps/src/implementation/storage.d.ts +0 -13
- package/types/apps/src/mcp-stdio.d.ts +0 -8
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App events. An app declares the events it emits beside its account requirements, so a host
|
|
3
|
+
* reads them without evaluating the app. Handlers emit occurrences; the host keeps them only
|
|
4
|
+
* when the invocation that emitted them succeeds, then delivers them to its subscribers.
|
|
5
|
+
*/
|
|
6
|
+
import { Schema } from "effect";
|
|
7
|
+
/** Dotted lower-case words, such as `issue.opened`. Hosts prefix them with the app's slug. */
|
|
8
|
+
export declare const EventName: Schema.String;
|
|
9
|
+
export type EventName = typeof EventName.Type;
|
|
10
|
+
/** A filter value: subscribers match an occurrence by equal scalars. */
|
|
11
|
+
export declare const EventFilterValue: Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>;
|
|
12
|
+
export type EventFilterValue = typeof EventFilterValue.Type;
|
|
13
|
+
/** Size and count limits for events; bytes are UTF-8 bytes of the JSON text. */
|
|
14
|
+
export declare const EventLimits: Schema.Struct<{
|
|
15
|
+
/** An occurrence's `data`, leaving room under a 256 KiB delivery for its envelope. */
|
|
16
|
+
readonly maxDataBytes: Schema.Int;
|
|
17
|
+
readonly maxEventsPerInvocation: Schema.Int;
|
|
18
|
+
readonly maxDescriptionLength: Schema.Int;
|
|
19
|
+
readonly maxIdLength: Schema.Int;
|
|
20
|
+
}>;
|
|
21
|
+
export type EventLimits = typeof EventLimits.Type;
|
|
22
|
+
export declare const defaultEventLimits: {
|
|
23
|
+
readonly maxDataBytes: number;
|
|
24
|
+
readonly maxEventsPerInvocation: number;
|
|
25
|
+
readonly maxDescriptionLength: number;
|
|
26
|
+
readonly maxIdLength: number;
|
|
27
|
+
};
|
|
28
|
+
/** One event as the host reads it from an app's requirements. Both schemas are JSON Schema. */
|
|
29
|
+
export declare const DeclaredEvent: Schema.Struct<{
|
|
30
|
+
readonly description: Schema.String;
|
|
31
|
+
/** An object of scalar fields. Subscribers may name any of them to narrow an event. */
|
|
32
|
+
readonly filters: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
33
|
+
/** The shape of each occurrence's `data`. */
|
|
34
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
35
|
+
}>;
|
|
36
|
+
export type DeclaredEvent = typeof DeclaredEvent.Type;
|
|
37
|
+
/** An app's declared events, by name. */
|
|
38
|
+
export declare const DeclaredEvents: Schema.$Record<Schema.String, Schema.Struct<{
|
|
39
|
+
readonly description: Schema.String;
|
|
40
|
+
/** An object of scalar fields. Subscribers may name any of them to narrow an event. */
|
|
41
|
+
readonly filters: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
42
|
+
/** The shape of each occurrence's `data`. */
|
|
43
|
+
readonly payload: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
44
|
+
}>>;
|
|
45
|
+
export type DeclaredEvents = typeof DeclaredEvents.Type;
|
|
46
|
+
/**
|
|
47
|
+
* One occurrence an invocation emitted. `id` is the stable identifier subscribers deduplicate on,
|
|
48
|
+
* such as the provider's delivery ID. `account` is the account the event came from, or null for
|
|
49
|
+
* an app without accounts.
|
|
50
|
+
*/
|
|
51
|
+
export declare const EmittedEvent: Schema.Struct<{
|
|
52
|
+
readonly name: Schema.String;
|
|
53
|
+
readonly id: Schema.String;
|
|
54
|
+
/** Milliseconds since the epoch when the event happened. */
|
|
55
|
+
readonly occurredAt: Schema.Int;
|
|
56
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
57
|
+
readonly filters: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>;
|
|
58
|
+
readonly account: Schema.NullOr<Schema.brand<Schema.String, "acc">>;
|
|
59
|
+
}>;
|
|
60
|
+
export type EmittedEvent = typeof EmittedEvent.Type;
|
|
61
|
+
/** What a successful invocation emitted, in order. */
|
|
62
|
+
export declare const EmittedEvents: Schema.$Array<Schema.Struct<{
|
|
63
|
+
readonly name: Schema.String;
|
|
64
|
+
readonly id: Schema.String;
|
|
65
|
+
/** Milliseconds since the epoch when the event happened. */
|
|
66
|
+
readonly occurredAt: Schema.Int;
|
|
67
|
+
readonly data: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
68
|
+
readonly filters: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>;
|
|
69
|
+
readonly account: Schema.NullOr<Schema.brand<Schema.String, "acc">>;
|
|
70
|
+
}>>;
|
|
71
|
+
/** Native event declaration. Filters are named scalar fields; the payload is any JSON schema. */
|
|
72
|
+
export interface AppEvent {
|
|
73
|
+
readonly description: string;
|
|
74
|
+
readonly filters: Readonly<Record<string, Schema.Decoder<unknown>>>;
|
|
75
|
+
readonly payload: Schema.Decoder<unknown>;
|
|
76
|
+
}
|
|
77
|
+
/** Options for one emitted occurrence. */
|
|
78
|
+
export interface EmitOptions<Filters> {
|
|
79
|
+
/** Values subscribers filter on. Required when the event declares filters. */
|
|
80
|
+
readonly filters?: Filters;
|
|
81
|
+
/**
|
|
82
|
+
* A stable identifier, such as the provider's delivery or record ID, so a repeated delivery of
|
|
83
|
+
* the same upstream event is not delivered twice. Defaults to a random ID.
|
|
84
|
+
*/
|
|
85
|
+
readonly id?: string | undefined;
|
|
86
|
+
/** When the event happened. Defaults to now. */
|
|
87
|
+
readonly occurredAt?: Date | number | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The ID of the account the event came from. A webhook handler defaults to its source account,
|
|
90
|
+
* and an invocation with exactly one of the caller's accounts to that account; the app's own
|
|
91
|
+
* accounts never count. Name it when there are several.
|
|
92
|
+
*/
|
|
93
|
+
readonly account?: string | undefined;
|
|
94
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Failure detail that crosses the runtime boundary to the app's own caller. */
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/** Longest failure message carried across the runtime boundary. */
|
|
4
|
+
export declare const maxFailureMessageLength = 2048;
|
|
5
|
+
/**
|
|
6
|
+
* `app` for errors thrown by authored code, `storage` for app data failures the host raised, and
|
|
7
|
+
* `service` for an external API the app called through a framework helper.
|
|
8
|
+
*/
|
|
9
|
+
export declare const FailureSource: Schema.Literals<readonly ["app", "storage", "service"]>;
|
|
10
|
+
/** The thrown error's name, such as `TypeError`, or the host error's tag. */
|
|
11
|
+
export declare const FailureName: Schema.String;
|
|
12
|
+
/** A stable host failure code, such as an app data reason, or the thrown error's own `code`. */
|
|
13
|
+
export declare const FailureCode: Schema.String;
|
|
14
|
+
/** Bounded, with the invocation's account secrets replaced. */
|
|
15
|
+
export declare const FailureMessage: Schema.String;
|
|
16
|
+
/** Most fields of one thrown error carried across the runtime boundary. */
|
|
17
|
+
export declare const maxFailureFields = 8;
|
|
18
|
+
/** Longest text field value carried across the runtime boundary. */
|
|
19
|
+
export declare const maxFailureFieldLength = 256;
|
|
20
|
+
/** A field name as the error's code spells it, such as `reason` or `pointer`. */
|
|
21
|
+
export declare const FailureFieldName: Schema.String;
|
|
22
|
+
/** Bounded text with account secrets replaced, a finite number, or a boolean. */
|
|
23
|
+
export declare const FailureFieldValue: Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>;
|
|
24
|
+
/**
|
|
25
|
+
* The thrown error's own scalar fields beside its name, code and message, such as the `reason`
|
|
26
|
+
* and `pointer` a spec compiler sets. Nested values, stacks and causes are never carried.
|
|
27
|
+
*/
|
|
28
|
+
export declare const FailureFields: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>;
|
|
29
|
+
export type FailureFields = typeof FailureFields.Type;
|
|
30
|
+
/**
|
|
31
|
+
* The error an app's own code raised, or the specific host failure it hit. Stacks and cause
|
|
32
|
+
* values stay private. Builds from before these fields existed send none.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FailureDetail: {
|
|
35
|
+
source: Schema.optionalKey<Schema.Literals<readonly ["app", "storage", "service"]>>;
|
|
36
|
+
errorName: Schema.optionalKey<Schema.String>;
|
|
37
|
+
code: Schema.optionalKey<Schema.String>;
|
|
38
|
+
message: Schema.optionalKey<Schema.String>;
|
|
39
|
+
fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Finite, Schema.Boolean]>>>;
|
|
40
|
+
};
|
|
41
|
+
/** Longest error message a service stated, as carried across the runtime boundary. */
|
|
42
|
+
export declare const maxUpstreamMessageLength = 1024;
|
|
43
|
+
/**
|
|
44
|
+
* The error a service stated in its own response: a JSON-RPC error's code and message, or an
|
|
45
|
+
* OAuth Bearer error code and description. Bounded, with the invocation's account secrets replaced.
|
|
46
|
+
*/
|
|
47
|
+
export declare const UpstreamError: Schema.Struct<{
|
|
48
|
+
readonly code: Schema.Union<readonly [Schema.Int, Schema.String]>;
|
|
49
|
+
readonly message: Schema.optionalKey<Schema.String>;
|
|
50
|
+
}>;
|
|
51
|
+
export type UpstreamError = typeof UpstreamError.Type;
|
|
52
|
+
/** Where a service failed: setting up a session, listing tools, or running one. */
|
|
53
|
+
export declare const FailurePhase: Schema.Literals<readonly ["connect", "discover", "call"]>;
|
|
54
|
+
export type FailurePhase = typeof FailurePhase.Type;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ProviderError } from "./provider-error.js";
|
|
2
|
+
import type { NetworkRefused } from "./network.js";
|
|
2
3
|
/** GraphQL discovery contracts. Catalogs are evaluated with the selected account. */
|
|
3
4
|
import { Schema, type Effect } from "effect";
|
|
4
5
|
import { type JsonValue } from "./schema.js";
|
|
@@ -97,7 +98,7 @@ export interface GraphqlTool {
|
|
|
97
98
|
readonly description: string;
|
|
98
99
|
readonly readOnly: boolean;
|
|
99
100
|
readonly input: Schema.Decoder<JsonValue>;
|
|
100
|
-
readonly run: (context: unknown, input: JsonValue) => Effect.Effect<JsonValue, GraphqlError | ProviderError>;
|
|
101
|
+
readonly run: (context: unknown, input: JsonValue) => Effect.Effect<JsonValue, GraphqlError | ProviderError | NetworkRefused>;
|
|
101
102
|
}
|
|
102
103
|
/** One tool per root field; subscriptions require a separate long-lived host. */
|
|
103
104
|
export type GraphqlTools = Readonly<Record<string, GraphqlTool>>;
|