apps 0.0.1-beta.91 → 0.0.1-beta.92
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 +4 -4
- package/framework-reference.json +1 -1
- package/js/{chunk-YRGL4QEF.js → chunk-2GPX2E57.js} +3 -3
- package/js/{chunk-H72MEDMN.js → chunk-4PIQKACY.js} +2 -2
- package/js/{chunk-JPEUKEV4.js → chunk-4X2UI4R2.js} +1 -1
- package/js/{chunk-KLYSEHUD.js → chunk-62NVUKED.js} +2 -2
- package/js/{chunk-KUCCHNVY.js → chunk-6C2I6JLA.js} +6 -6
- package/js/{chunk-YWFUWTUJ.js → chunk-6F3WAXVN.js} +4 -4
- package/js/{chunk-6XQLA5NC.js → chunk-6WC2OWHV.js} +15 -10
- package/js/{chunk-YNJ5CZMJ.js → chunk-74H25C4X.js} +13 -11
- package/js/{chunk-DDHBUKXX.js → chunk-7HG422GB.js} +42 -2
- package/js/{chunk-EOPQ727L.js → chunk-ACQXVKVQ.js} +1 -1
- package/js/{chunk-PYQLOLOC.js → chunk-ATBBIJ5O.js} +2 -2
- package/js/{chunk-TUMGL2OC.js → chunk-DILSCQPJ.js} +2 -2
- package/js/{chunk-5MDA7MKL.js → chunk-DYE2CKHG.js} +8 -8
- package/js/{chunk-XPRZTLHD.js → chunk-FA5MLNYL.js} +15 -15
- package/js/{chunk-7PHHWYV4.js → chunk-JJZZLNJY.js} +6 -6
- package/js/{chunk-74YVXBKY.js → chunk-KLSEU35Y.js} +1 -1
- package/js/{chunk-3LEVTFD4.js → chunk-MBCUKNUA.js} +10 -10
- package/js/{chunk-I5C7FD5Z.js → chunk-MN5XVRKW.js} +4 -4
- package/js/{chunk-5FHWNLCI.js → chunk-OWN3DP2W.js} +1 -1
- package/js/{chunk-XBG7HHXC.js → chunk-PBGPES67.js} +2 -2
- package/js/{chunk-GQ33QSNB.js → chunk-RKFLB36H.js} +2 -2
- package/js/{chunk-DADXWWRZ.js → chunk-TNVB3KLB.js} +6 -6
- package/js/{chunk-QWQM3CLH.js → chunk-URKOTNDA.js} +4 -4
- package/js/{chunk-PD6I2SDG.js → chunk-YDW7DX3A.js} +2 -2
- package/js/{chunk-IFJU5SYQ.js → chunk-ZKDXML77.js} +178 -23
- package/js/client.js +16 -16
- package/js/contracts.js +7 -7
- package/js/effect.js +18 -18
- package/js/graphql.js +20 -20
- package/js/host.js +18 -18
- package/js/index.js +13 -13
- package/js/mcp/effect.js +19 -19
- package/js/mcp.js +21 -21
- package/js/openapi.js +16 -16
- package/js/react.js +2 -2
- package/js/skills/effect.js +6 -6
- package/js/skills.js +15 -15
- package/js/ui/auth/contracts.js +2 -2
- package/js/ui/auth.js +5 -5
- package/js/ui/contracts.js +9 -9
- package/js/ui/serving.js +15 -15
- package/package.json +1 -1
- package/runtime.json +1 -1
- package/types/apps/src/contracts/app.d.ts +1 -1
- package/types/apps/src/contracts/openapi-document.d.ts +1 -1
- package/types/apps/src/contracts/ui.d.ts +31 -21
- package/types/apps/src/contracts/workflows.d.ts +37 -17
- package/types/apps/src/implementation/browser-scripts.gen.d.ts +1 -1
- package/types/apps/src/implementation/openapi-source.d.ts +1 -1
- package/types/apps/src/implementation/sql.d.ts +1 -1
- package/types/apps/src/implementation/ui-client.d.ts +1 -1
- package/types/apps/src/implementation/ui-document.d.ts +2 -2
- package/types/apps/src/implementation/ui-serving.d.ts +4 -4
- package/types/apps/src/implementation/ui-watch.d.ts +1 -1
- package/types/utils/src/legacy-keys.d.ts +20 -0
|
@@ -60,7 +60,7 @@ export type BoundAccounts<Slots extends AccountSlots> = {
|
|
|
60
60
|
export interface InvocationServices {
|
|
61
61
|
/** Explicit app/build-scoped caching. Account-specific loaders opt into forAccount. */
|
|
62
62
|
readonly cache: import("./cache.js").AppCache;
|
|
63
|
-
/** Text files retained in this
|
|
63
|
+
/** Text files retained in this version. Paths are package-relative, never host filesystem paths. */
|
|
64
64
|
readonly files: readonly SkillFile[];
|
|
65
65
|
/** Read-only run management, bound to this configured app. */
|
|
66
66
|
readonly workflows: WorkflowReads;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** OpenAPI boundary parsing. Unsupported transport/auth features fail before
|
|
1
|
+
/** OpenAPI boundary parsing. Unsupported transport/auth features fail before deploying. */
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
/** Parsed OpenAPI 3 source; individual operation references are resolved separately. */
|
|
4
4
|
export declare const Specification: Schema.Struct<{
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/** Browser-to-host operations bind identity and authentication outside authored app code. */
|
|
2
2
|
import { Schema, type Effect, type Stream } from "effect";
|
|
3
3
|
import { HttpApi, HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export declare const UiContext: Schema.Struct<{
|
|
9
|
-
readonly deployment: Schema.NonEmptyString;
|
|
4
|
+
import { withLegacyKeys } from "../../../utils/src/legacy-keys.js";
|
|
5
|
+
export declare const UiContext: withLegacyKeys<Schema.Struct<{
|
|
6
|
+
readonly version: Schema.NonEmptyString;
|
|
10
7
|
readonly accounts: Schema.optional<Schema.$Record<Schema.NonEmptyString, Schema.$Array<Schema.NonEmptyString>>>;
|
|
8
|
+
}>, {
|
|
9
|
+
readonly version: "deployment";
|
|
11
10
|
}>;
|
|
12
11
|
/** A problem with one of the page's accounts, from stored state. Labels are the owner's own names. */
|
|
13
12
|
export type UiAccountProblem = {
|
|
@@ -36,7 +35,7 @@ export interface AppUiRange {
|
|
|
36
35
|
readonly length: number;
|
|
37
36
|
}
|
|
38
37
|
/**
|
|
39
|
-
* A public file the
|
|
38
|
+
* A public file the version's source served from `ui/public/`, which the host copied to its
|
|
40
39
|
* own store. `etag` names its exact bytes. Hosts authorize access before reading it.
|
|
41
40
|
*/
|
|
42
41
|
export interface AppUiStoredFile {
|
|
@@ -46,12 +45,14 @@ export interface AppUiStoredFile {
|
|
|
46
45
|
readonly read: (range: AppUiRange | undefined) => Effect.Effect<Stream.Stream<Uint8Array, UiFailed>, UiFailed>;
|
|
47
46
|
}
|
|
48
47
|
export type AppUiAsset = AppUiFile | AppUiStoredFile;
|
|
49
|
-
/** Requests name an operation on this app and the page's
|
|
50
|
-
export declare const UiOperation: Schema.Struct<{
|
|
48
|
+
/** Requests name an operation on this app and the page's version, never another app or account. */
|
|
49
|
+
export declare const UiOperation: withLegacyKeys<Schema.Struct<{
|
|
51
50
|
readonly name: Schema.NonEmptyString;
|
|
52
51
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
53
|
-
readonly
|
|
52
|
+
readonly version: Schema.NonEmptyString;
|
|
54
53
|
readonly accounts: Schema.optional<Schema.$Record<Schema.NonEmptyString, Schema.$Array<Schema.NonEmptyString>>>;
|
|
54
|
+
}>, {
|
|
55
|
+
readonly version: "deployment";
|
|
55
56
|
}>;
|
|
56
57
|
declare const UiUnauthorized_base: Schema.Class<UiUnauthorized, Schema.TaggedStruct<"UiUnauthorized", {}>, import("effect/Cause").YieldableError>;
|
|
57
58
|
/** The app session is absent or its parent login was revoked. */
|
|
@@ -61,9 +62,12 @@ declare const UiForbidden_base: Schema.Class<UiForbidden, Schema.TaggedStruct<"U
|
|
|
61
62
|
/** The request did not originate from the configured app. */
|
|
62
63
|
export declare class UiForbidden extends UiForbidden_base {
|
|
63
64
|
}
|
|
64
|
-
declare const
|
|
65
|
-
/**
|
|
66
|
-
|
|
65
|
+
declare const UiVersionChanged_base: Schema.Class<UiVersionChanged, Schema.TaggedStruct<"UiDeploymentChanged", {}>, import("effect/Cause").YieldableError>;
|
|
66
|
+
/**
|
|
67
|
+
* The page should reload before starting another operation. The tag keeps its former name: pages
|
|
68
|
+
* built with earlier framework releases reload on it.
|
|
69
|
+
*/
|
|
70
|
+
export declare class UiVersionChanged extends UiVersionChanged_base {
|
|
67
71
|
}
|
|
68
72
|
declare const UiFailed_base: Schema.Class<UiFailed, Schema.TaggedStruct<"UiFailed", {
|
|
69
73
|
readonly reason: Schema.Literals<readonly ["unavailable", "operation_failed", "account_required"]>;
|
|
@@ -83,21 +87,27 @@ export declare const UiSnapshot: Schema.Union<readonly [Schema.Struct<{
|
|
|
83
87
|
readonly type: Schema.Literal<"heartbeat">;
|
|
84
88
|
}>]>;
|
|
85
89
|
/** Portable serving contract; the host authenticates and resolves the configured app. */
|
|
86
|
-
export declare const AppUiApi: HttpApi.HttpApi<"app-ui", HttpApiGroup.HttpApiGroup<"ui", HttpApiEndpoint.HttpApiEndpoint<"query", "POST", "/_executor/api/query", never, never, Schema.toCodecJson<Schema.Struct<{
|
|
90
|
+
export declare const AppUiApi: HttpApi.HttpApi<"app-ui", HttpApiGroup.HttpApiGroup<"ui", HttpApiEndpoint.HttpApiEndpoint<"query", "POST", "/_executor/api/query", never, never, Schema.toCodecJson<withLegacyKeys<Schema.Struct<{
|
|
87
91
|
readonly name: Schema.NonEmptyString;
|
|
88
92
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
89
|
-
readonly
|
|
93
|
+
readonly version: Schema.NonEmptyString;
|
|
90
94
|
readonly accounts: Schema.optional<Schema.$Record<Schema.NonEmptyString, Schema.$Array<Schema.NonEmptyString>>>;
|
|
91
|
-
}
|
|
95
|
+
}>, {
|
|
96
|
+
readonly version: "deployment";
|
|
97
|
+
}>>, never, Schema.toCodecJson<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.toCodecJson<typeof UiUnauthorized | typeof UiForbidden | typeof UiVersionChanged | typeof UiFailed>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"mutate", "POST", "/_executor/api/mutate", never, never, Schema.toCodecJson<withLegacyKeys<Schema.Struct<{
|
|
92
98
|
readonly name: Schema.NonEmptyString;
|
|
93
99
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
94
|
-
readonly
|
|
100
|
+
readonly version: Schema.NonEmptyString;
|
|
95
101
|
readonly accounts: Schema.optional<Schema.$Record<Schema.NonEmptyString, Schema.$Array<Schema.NonEmptyString>>>;
|
|
96
|
-
}
|
|
102
|
+
}>, {
|
|
103
|
+
readonly version: "deployment";
|
|
104
|
+
}>>, never, Schema.toCodecJson<Schema.Codec<Schema.Json, Schema.Json, never, never>>, Schema.toCodecJson<typeof UiUnauthorized | typeof UiForbidden | typeof UiVersionChanged | typeof UiFailed>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"subscribe", "POST", "/_executor/api/subscribe", never, never, Schema.toCodecJson<withLegacyKeys<Schema.Struct<{
|
|
97
105
|
readonly name: Schema.NonEmptyString;
|
|
98
106
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
99
|
-
readonly
|
|
107
|
+
readonly version: Schema.NonEmptyString;
|
|
100
108
|
readonly accounts: Schema.optional<Schema.$Record<Schema.NonEmptyString, Schema.$Array<Schema.NonEmptyString>>>;
|
|
109
|
+
}>, {
|
|
110
|
+
readonly version: "deployment";
|
|
101
111
|
}>>, never, HttpApiSchema.StreamSse<HttpApiSchema.SseEventFromData<Schema.Union<readonly [Schema.Struct<{
|
|
102
112
|
readonly type: Schema.Literal<"snapshot">;
|
|
103
113
|
readonly value: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
@@ -107,7 +117,7 @@ export declare const AppUiApi: HttpApi.HttpApi<"app-ui", HttpApiGroup.HttpApiGro
|
|
|
107
117
|
readonly error: typeof UiFailed;
|
|
108
118
|
}>, Schema.Struct<{
|
|
109
119
|
readonly type: Schema.Literal<"heartbeat">;
|
|
110
|
-
}>]>>, Schema.Union<readonly [typeof UiUnauthorized, typeof UiForbidden, typeof
|
|
120
|
+
}>]>>, Schema.Union<readonly [typeof UiUnauthorized, typeof UiForbidden, typeof UiVersionChanged, typeof UiFailed]>, {
|
|
111
121
|
readonly value: Schema.Json;
|
|
112
122
|
readonly type: "snapshot";
|
|
113
123
|
readonly trace?: unknown;
|
|
@@ -116,5 +126,5 @@ export declare const AppUiApi: HttpApi.HttpApi<"app-ui", HttpApiGroup.HttpApiGro
|
|
|
116
126
|
readonly error: UiFailed;
|
|
117
127
|
} | {
|
|
118
128
|
readonly type: "heartbeat";
|
|
119
|
-
}>, Schema.toCodecJson<typeof UiUnauthorized | typeof UiForbidden | typeof
|
|
129
|
+
}>, Schema.toCodecJson<typeof UiUnauthorized | typeof UiForbidden | typeof UiVersionChanged | typeof UiFailed>, never, never>, false>>;
|
|
120
130
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Portable workflow declarations, run views and durable execution capabilities. */
|
|
2
|
+
import { withLegacyKeys } from "../../../utils/src/legacy-keys.js";
|
|
2
3
|
import { Schema, type Effect } from "effect";
|
|
3
4
|
import { RecordedMessage } from "../../../utils/src/recorded-message.js";
|
|
4
5
|
import { JsonValue } from "./schema.js";
|
|
@@ -71,23 +72,30 @@ export declare const HostedWorkflow: Schema.Struct<{
|
|
|
71
72
|
readonly outputSchema: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>;
|
|
72
73
|
}>;
|
|
73
74
|
export type HostedWorkflow = typeof HostedWorkflow.Type;
|
|
74
|
-
/**
|
|
75
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Results are available only on completed runs; failures carry a reason code and app error detail.
|
|
77
|
+
* Runs name their version under its former name too, for apps and callers written before the rename.
|
|
78
|
+
*/
|
|
79
|
+
export declare const WorkflowRun: Schema.Union<readonly [withLegacyKeys<Schema.Struct<{
|
|
76
80
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "paused", "waitingForPause"]>;
|
|
77
81
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
78
82
|
readonly app: Schema.NonEmptyString;
|
|
79
|
-
readonly
|
|
83
|
+
readonly version: Schema.NonEmptyString;
|
|
80
84
|
readonly workflow: Schema.NonEmptyString;
|
|
81
85
|
readonly createdAt: Schema.String;
|
|
82
|
-
}>,
|
|
86
|
+
}>, {
|
|
87
|
+
readonly version: "deployment";
|
|
88
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
83
89
|
readonly status: Schema.Literal<"complete">;
|
|
84
90
|
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
85
91
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
86
92
|
readonly app: Schema.NonEmptyString;
|
|
87
|
-
readonly
|
|
93
|
+
readonly version: Schema.NonEmptyString;
|
|
88
94
|
readonly workflow: Schema.NonEmptyString;
|
|
89
95
|
readonly createdAt: Schema.String;
|
|
90
|
-
}>,
|
|
96
|
+
}>, {
|
|
97
|
+
readonly version: "deployment";
|
|
98
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
91
99
|
readonly status: Schema.Literal<"errored">;
|
|
92
100
|
readonly error: Schema.Literals<readonly ["unavailable", "not_found", "input", "output", "operation", "approval", "credentials", "terminated", "execution", "conflict", "engine"]>;
|
|
93
101
|
/** The failing step and the app's own error, when the run recorded them. */
|
|
@@ -98,36 +106,44 @@ export declare const WorkflowRun: Schema.Union<readonly [Schema.Struct<{
|
|
|
98
106
|
}>>;
|
|
99
107
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
100
108
|
readonly app: Schema.NonEmptyString;
|
|
101
|
-
readonly
|
|
109
|
+
readonly version: Schema.NonEmptyString;
|
|
102
110
|
readonly workflow: Schema.NonEmptyString;
|
|
103
111
|
readonly createdAt: Schema.String;
|
|
104
|
-
}>,
|
|
112
|
+
}>, {
|
|
113
|
+
readonly version: "deployment";
|
|
114
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
105
115
|
readonly status: Schema.Literal<"terminated">;
|
|
106
116
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
107
117
|
readonly app: Schema.NonEmptyString;
|
|
108
|
-
readonly
|
|
118
|
+
readonly version: Schema.NonEmptyString;
|
|
109
119
|
readonly workflow: Schema.NonEmptyString;
|
|
110
120
|
readonly createdAt: Schema.String;
|
|
121
|
+
}>, {
|
|
122
|
+
readonly version: "deployment";
|
|
111
123
|
}>]>;
|
|
112
124
|
export type WorkflowRun = typeof WorkflowRun.Type;
|
|
113
125
|
/** A bounded run-history page, already scoped to an authorized configured app. */
|
|
114
126
|
export declare const WorkflowRunPage: Schema.Struct<{
|
|
115
|
-
readonly items: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
127
|
+
readonly items: Schema.$Array<Schema.Union<readonly [withLegacyKeys<Schema.Struct<{
|
|
116
128
|
readonly status: Schema.Literals<readonly ["queued", "running", "waiting", "paused", "waitingForPause"]>;
|
|
117
129
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
118
130
|
readonly app: Schema.NonEmptyString;
|
|
119
|
-
readonly
|
|
131
|
+
readonly version: Schema.NonEmptyString;
|
|
120
132
|
readonly workflow: Schema.NonEmptyString;
|
|
121
133
|
readonly createdAt: Schema.String;
|
|
122
|
-
}>,
|
|
134
|
+
}>, {
|
|
135
|
+
readonly version: "deployment";
|
|
136
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
123
137
|
readonly status: Schema.Literal<"complete">;
|
|
124
138
|
readonly output: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
125
139
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
126
140
|
readonly app: Schema.NonEmptyString;
|
|
127
|
-
readonly
|
|
141
|
+
readonly version: Schema.NonEmptyString;
|
|
128
142
|
readonly workflow: Schema.NonEmptyString;
|
|
129
143
|
readonly createdAt: Schema.String;
|
|
130
|
-
}>,
|
|
144
|
+
}>, {
|
|
145
|
+
readonly version: "deployment";
|
|
146
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
131
147
|
readonly status: Schema.Literal<"errored">;
|
|
132
148
|
readonly error: Schema.Literals<readonly ["unavailable", "not_found", "input", "output", "operation", "approval", "credentials", "terminated", "execution", "conflict", "engine"]>;
|
|
133
149
|
/** The failing step and the app's own error, when the run recorded them. */
|
|
@@ -138,16 +154,20 @@ export declare const WorkflowRunPage: Schema.Struct<{
|
|
|
138
154
|
}>>;
|
|
139
155
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
140
156
|
readonly app: Schema.NonEmptyString;
|
|
141
|
-
readonly
|
|
157
|
+
readonly version: Schema.NonEmptyString;
|
|
142
158
|
readonly workflow: Schema.NonEmptyString;
|
|
143
159
|
readonly createdAt: Schema.String;
|
|
144
|
-
}>,
|
|
160
|
+
}>, {
|
|
161
|
+
readonly version: "deployment";
|
|
162
|
+
}>, withLegacyKeys<Schema.Struct<{
|
|
145
163
|
readonly status: Schema.Literal<"terminated">;
|
|
146
164
|
readonly id: Schema.brand<Schema.NonEmptyString, "wfr">;
|
|
147
165
|
readonly app: Schema.NonEmptyString;
|
|
148
|
-
readonly
|
|
166
|
+
readonly version: Schema.NonEmptyString;
|
|
149
167
|
readonly workflow: Schema.NonEmptyString;
|
|
150
168
|
readonly createdAt: Schema.String;
|
|
169
|
+
}>, {
|
|
170
|
+
readonly version: "deployment";
|
|
151
171
|
}>]>>;
|
|
152
172
|
readonly next: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "wfr">>;
|
|
153
173
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Compiled from src/browser/app-watch.ts. */
|
|
2
|
-
export declare const appWatchSource = "\"use strict\";(()=>{var
|
|
2
|
+
export declare const appWatchSource = "\"use strict\";(()=>{var c=()=>{let s=document.getElementById(\"executor-context\")?.textContent;if(!s)return;let n=JSON.parse(s);if(typeof n!=\"object\"||n===null||!(\"version\"in n))return;let r=n.version;if(typeof r!=\"string\"||r.length===0)return;let t=new EventSource(\"/_executor/version\"),d=!1,o=()=>{d||(d=!0,t.close(),location.reload())};t.addEventListener(\"version\",i=>{let e=JSON.parse(i.data);typeof e==\"object\"&&e!==null&&\"version\"in e&&(e.version===null||typeof e.version==\"string\")&&e.version!==r&&o()}),t.addEventListener(\"revoked\",o),window.addEventListener(\"executor:deployment-changed\",o),window.addEventListener(\"pagehide\",()=>t.close(),{once:!0}),window.addEventListener(\"pageshow\",i=>{i.persisted&&o()})};c();})();";
|
|
3
3
|
/** Compiled from src/browser/app-failure.ts. */
|
|
4
4
|
export declare const appFailureSource = "\"use strict\";(()=>{var M=()=>{let d,w=Date.now(),m=0,g=0,f=new Map,v=/^(?:chrome|moz|safari-web)-extension:/,A=new Set([\"ResizeObserver loop completed with undelivered notifications.\",\"ResizeObserver loop limit exceeded\"]),V=new Set([\"Error\",\"TypeError\",\"ReferenceError\",\"SyntaxError\",\"RangeError\",\"URIError\",\"EvalError\",\"AggregateError\"]),b=(e,t=0,i=0)=>{let r=[];if(!URL.canParse(e))return r;let a=new URL(e);return a.origin!==location.origin||!a.pathname.startsWith(\"/_executor/assets/\")||!a.pathname.endsWith(\".js\")||(r.push({key:\"code.file.path\",value:{stringValue:a.pathname}}),Number.isSafeInteger(t)&&t>0&&r.push({key:\"code.line.number\",value:{intValue:String(t)}}),Number.isSafeInteger(i)&&i>0&&r.push({key:\"code.column.number\",value:{intValue:String(i)}})),r},h=(e,t,i=[])=>{let r=Date.now();r-w>=6e4&&(w=r,m=0,f.clear());let a=`${e}:${t.slice(0,2e3)}`,x=f.get(a);if(x!==void 0&&r-x<1e3||m>=20){g++;return}f.set(a,r),m++,i.push({key:\"executor.ui.failure.suppressed\",value:{intValue:String(g)}}),g=0;let E=Array.from(crypto.getRandomValues(new Uint8Array(16)),s=>s.toString(16).padStart(2,\"0\")).join(\"\"),S=`${Date.now()}000000`,n,l=\"Sending error report\\u2026\",k=()=>{if(d?.open)return;let s=document.createElement(\"div\"),D=s.attachShadow({mode:\"open\"}),o=document.createElement(\"dialog\");d=o,o.setAttribute(\"aria-labelledby\",\"executor-failure-title\");let y=document.createElement(\"h2\");y.id=\"executor-failure-title\",y.textContent=e===\"script\"?\"This app could not load\":\"This app stopped working\";let C=document.createElement(\"p\");C.textContent=e===\"script\"?\"A file needed by this page did not load. Reload the page to try again.\":\"The app encountered an unexpected error. Reload the page to try again.\";let L=document.createElement(\"p\");L.textContent=\"Copy any unsaved work before reloading.\";let R=document.createElement(\"details\"),T=document.createElement(\"summary\");T.textContent=\"Error details\";let c=document.createElement(\"textarea\");c.readOnly=!0,c.rows=10,c.cols=36,c.setAttribute(\"aria-label\",\"Error details\"),c.value=`${t.slice(0,12e3)}\n\nDiagnostic ID: ${E}`,R.append(T,c),n=document.createElement(\"p\"),n.setAttribute(\"role\",\"status\"),n.textContent=l;let u=document.createElement(\"button\");u.type=\"button\",u.textContent=\"Reload page\",u.addEventListener(\"click\",()=>location.reload());let p=document.createElement(\"button\");p.type=\"button\",p.textContent=\"Close\",p.addEventListener(\"click\",()=>o.close()),o.addEventListener(\"close\",()=>{d===o&&(d=void 0),s.remove()}),o.append(y,C,L,R,n,u,p),D.append(o),document.documentElement.append(s),o.showModal()};document.readyState===\"loading\"?document.addEventListener(\"DOMContentLoaded\",k,{once:!0}):k(),fetch(\"/_executor/api/telemetry/traces\",{method:\"POST\",headers:{\"content-type\":\"application/json\"},credentials:\"same-origin\",keepalive:!0,body:JSON.stringify({resourceSpans:[{scopeSpans:[{spans:[{traceId:E,spanId:E.slice(0,16),name:\"ui.app.failure\",kind:1,startTimeUnixNano:S,endTimeUnixNano:S,status:{code:2},attributes:[{key:\"executor.ui.failure.kind\",value:{stringValue:e}},...i]}]}]}]})}).then(s=>{l=s.ok?\"Error report sent.\":\"Could not send the error report. You can copy the error details.\",n&&(n.textContent=l)},()=>{l=\"Could not send the error report. You can copy the error details.\",n&&(n.textContent=l)})};window.addEventListener(\"error\",e=>{if(e instanceof ErrorEvent){if(v.test(e.filename)||e.error===null&&e.lineno===0&&A.has(e.message))return;let t=b(e.filename,e.lineno,e.colno);e.error instanceof Error&&V.has(e.error.name)&&t.push({key:\"exception.type\",value:{stringValue:e.error.name}}),h(\"runtime\",e.error instanceof Error?e.error.stack??e.message:e.message,t)}else e.target instanceof HTMLScriptElement&&h(\"script\",`Could not load script: ${e.target.src}`,b(e.target.src))},!0),window.addEventListener(\"unhandledrejection\",e=>{let t=e.reason;h(\"rejection\",t instanceof Error?t.stack??t.message:\"An app operation failed without handling its error.\")})};M();})();";
|
|
5
5
|
/** Compiled from src/browser/account-notice.ts. */
|
|
@@ -49,7 +49,7 @@ export declare const liveOpenapiRouter: (options: OpenapiSourceOptions) => Route
|
|
|
49
49
|
export type OpenapiToolNamesOptions = Omit<OpenapiSourceOptions, "cache" | "account" | "parameterDefaults" | "freshFor" | "staleFor">;
|
|
50
50
|
/**
|
|
51
51
|
* The tools `liveOpenapiRouter` with the same options exposes, from the definition alone: no
|
|
52
|
-
* account, cache or
|
|
52
|
+
* account, cache or deployed version. Each tool says which `methods` and `oauth` entries expose it, so
|
|
53
53
|
* an author can check the names a `withApprovals` policy matches before any account connects.
|
|
54
54
|
* `skipped` lists only the operations the compiler left out and why. An operation no configured
|
|
55
55
|
* `methods` or `oauth` entry can authorize is missing from `tools` and not listed in `skipped`.
|
|
@@ -61,7 +61,7 @@ export declare const hasMigrations: (files: readonly {
|
|
|
61
61
|
}[]) => boolean;
|
|
62
62
|
/**
|
|
63
63
|
* Apply the build's pending migrations and report which ran. Every pending migration runs in one
|
|
64
|
-
* transaction, so a failing one leaves the database exactly as the active
|
|
64
|
+
* transaction, so a failing one leaves the database exactly as the active version knows it. The
|
|
65
65
|
* migrations already applied must still be the build's first ones, byte for byte.
|
|
66
66
|
*/
|
|
67
67
|
export declare const migrate: (storage: AppSqlStorage, files: readonly SkillFile[]) => Effect.Effect<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsyncResult, Atom } from "effect/reactivity";
|
|
2
2
|
import { type OperationReference } from "../contracts/live.js";
|
|
3
3
|
import { type Schema } from "./schema.js";
|
|
4
|
-
/** A scoped page client. Host-injected context carries only the
|
|
4
|
+
/** A scoped page client. Host-injected context carries only the version, never credentials. */
|
|
5
5
|
export declare const createAppClient: () => {
|
|
6
6
|
/** Close this client when its page or embedding owner is removed. */
|
|
7
7
|
dispose: () => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Retained files sit at the
|
|
2
|
+
* Retained files sit at the version's asset root. Resolving path-relative resource URLs there,
|
|
3
3
|
* instead of with `<base>`, leaves the document base as the page URL for links, history and forms.
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const versionDocument: (html: string, version: string) => string;
|
|
@@ -2,11 +2,11 @@ import { Effect, Option, Stream } from "effect";
|
|
|
2
2
|
import { HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
3
3
|
import { UiFailed, UiForbidden, type AppUiAsset, type AppUiRange, type AppUiStoredFile, type UiAccountNotice } from "../contracts/ui.js";
|
|
4
4
|
/**
|
|
5
|
-
* Render an authorized
|
|
5
|
+
* Render an authorized version with a host-owned version watcher. Account problems that stop
|
|
6
6
|
* the app replace its document with a page that links to their fix; others add a dismissible card.
|
|
7
7
|
*/
|
|
8
8
|
export declare const appDocument: <E, R>(options: {
|
|
9
|
-
readonly
|
|
9
|
+
readonly version: string;
|
|
10
10
|
/** The account IDs the page runs with, by requirement. */
|
|
11
11
|
readonly accountIds?: Readonly<Record<string, readonly string[]>> | undefined;
|
|
12
12
|
readonly origin: string;
|
|
@@ -14,7 +14,7 @@ export declare const appDocument: <E, R>(options: {
|
|
|
14
14
|
readonly asset: (path: string) => Effect.Effect<AppUiAsset | undefined, E, R>;
|
|
15
15
|
}) => Effect.Effect<HttpServerResponse.HttpServerResponse, UiFailed | UiForbidden | E, HttpServerRequest.HttpServerRequest | R>;
|
|
16
16
|
/**
|
|
17
|
-
* A
|
|
17
|
+
* A version's public file, read from the host's store. The version lists it, so bytes that
|
|
18
18
|
* are gone are a storage fault, never a missing page.
|
|
19
19
|
*/
|
|
20
20
|
export declare const storedAppFile: <E1, E2>(stored: {
|
|
@@ -27,7 +27,7 @@ export declare const storedAppFile: <E1, E2>(stored: {
|
|
|
27
27
|
/** The file a URL path names: each segment percent-decoded, or none when one does not decode. */
|
|
28
28
|
export declare const assetPath: (path: string) => Option.Option<string>;
|
|
29
29
|
/** Serve an asset only after the host has checked current access and file existence.
|
|
30
|
-
* Asset URLs name their
|
|
30
|
+
* Asset URLs name their version, so their bytes never change: the browser keeps them for a year
|
|
31
31
|
* and does not ask again. Shared proxies never store them. Revoking access stops every new request
|
|
32
32
|
* and all app data, while bytes a browser already downloaded stay in its cache.
|
|
33
33
|
* HTML remains an uncached host-rendered entry point; other HTML files are served as they are.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Dependency-free browser source served by each host after app authorization. */
|
|
2
|
-
export declare const appWatchScript = "\"use strict\";(()=>{var
|
|
2
|
+
export declare const appWatchScript = "\"use strict\";(()=>{var c=()=>{let s=document.getElementById(\"executor-context\")?.textContent;if(!s)return;let n=JSON.parse(s);if(typeof n!=\"object\"||n===null||!(\"version\"in n))return;let r=n.version;if(typeof r!=\"string\"||r.length===0)return;let t=new EventSource(\"/_executor/version\"),d=!1,o=()=>{d||(d=!0,t.close(),location.reload())};t.addEventListener(\"version\",i=>{let e=JSON.parse(i.data);typeof e==\"object\"&&e!==null&&\"version\"in e&&(e.version===null||typeof e.version==\"string\")&&e.version!==r&&o()}),t.addEventListener(\"revoked\",o),window.addEventListener(\"executor:deployment-changed\",o),window.addEventListener(\"pagehide\",()=>t.close(),{once:!0}),window.addEventListener(\"pageshow\",i=>{i.persisted&&o()})};c();})();";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
type Mapping<S extends Schema.Struct<Schema.Struct.Fields>> = {
|
|
3
|
+
readonly [K in keyof S["fields"]]?: string;
|
|
4
|
+
};
|
|
5
|
+
type LegacyEncoded<S extends Schema.Struct<Schema.Struct.Fields>, M extends Mapping<S>> = Omit<S["Encoded"], keyof M> & {
|
|
6
|
+
readonly [K in keyof M & keyof S["Encoded"]]?: S["Encoded"][K];
|
|
7
|
+
} & {
|
|
8
|
+
readonly [K in keyof M as M[K] extends string ? M[K] : never]?: K extends keyof S["Encoded"] ? S["Encoded"][K] : never;
|
|
9
|
+
};
|
|
10
|
+
/** A struct whose renamed fields also travel under their former names. */
|
|
11
|
+
export interface withLegacyKeys<S extends Schema.Struct<Schema.Struct.Fields>, M extends Mapping<S>> extends Schema.decodeTo<S, Schema.Codec<LegacyEncoded<S, M>>> {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Keep renamed fields readable by callers that still use their former names. `{ version:
|
|
15
|
+
* "deployment" }` decodes `version`, or `deployment` when `version` is absent, and encodes the
|
|
16
|
+
* value under both keys. Clients, stored values and app bundles written before a rename keep
|
|
17
|
+
* working, while the decoded type has only the new name.
|
|
18
|
+
*/
|
|
19
|
+
export declare const withLegacyKeys: <S extends Schema.Struct<Schema.Struct.Fields>, const M extends Mapping<S>>(mapping: M) => (self: S) => withLegacyKeys<S, M>;
|
|
20
|
+
export {};
|