@oxy-hq/sdk 2.13.0 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -0
- package/dist/{function-context-D8eyZuw_.d.cts → function-context-BNpL5bFb.d.cts} +223 -20
- package/dist/function-context-BNpL5bFb.d.cts.map +1 -0
- package/dist/{function-context-D8eyZuw_.d.mts → function-context-BNpL5bFb.d.mts} +223 -20
- package/dist/function-context-BNpL5bFb.d.mts.map +1 -0
- package/dist/index.cjs +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +17 -15
- package/dist/index.mjs.map +1 -1
- package/dist/ops.d.cts +1 -1
- package/dist/ops.d.mts +1 -1
- package/dist/{react-D-Sf973d.d.mts → react-CljeXJuw.d.cts} +56 -7
- package/dist/react-CljeXJuw.d.cts.map +1 -0
- package/dist/{react-D-Sf973d.d.cts → react-CljeXJuw.d.mts} +56 -7
- package/dist/react-CljeXJuw.d.mts.map +1 -0
- package/dist/{react-CkAQg9wB.cjs → react-Dvkv2deI.cjs} +46 -55
- package/dist/react-Dvkv2deI.cjs.map +1 -0
- package/dist/{react-Cq3xULOr.mjs → react-OW1t_J0M.mjs} +39 -22
- package/dist/react-OW1t_J0M.mjs.map +1 -0
- package/dist/rolldown-runtime-KC0qvQup.cjs +34 -0
- package/dist/shell.cjs +4 -3
- package/dist/shell.cjs.map +1 -1
- package/dist/shell.d.cts +2 -2
- package/dist/shell.d.mts +2 -2
- package/dist/shell.mjs +1 -1
- package/dist/testing.cjs +4431 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +656 -0
- package/dist/testing.d.cts.map +1 -0
- package/dist/testing.d.mts +656 -0
- package/dist/testing.d.mts.map +1 -0
- package/dist/testing.mjs +4395 -0
- package/dist/testing.mjs.map +1 -0
- package/package.json +22 -9
- package/dist/function-context-D8eyZuw_.d.cts.map +0 -1
- package/dist/function-context-D8eyZuw_.d.mts.map +0 -1
- package/dist/react-CkAQg9wB.cjs.map +0 -1
- package/dist/react-Cq3xULOr.mjs.map +0 -1
- package/dist/react-D-Sf973d.d.cts.map +0 -1
- package/dist/react-D-Sf973d.d.mts.map +0 -1
|
@@ -50,6 +50,13 @@ interface OxyAppFunctionManifest {
|
|
|
50
50
|
};
|
|
51
51
|
/** Wall-clock timeout. Default 30, max 300. */
|
|
52
52
|
timeoutSeconds?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Mark this function as a check. `oxyc checks run` runs it; with a
|
|
55
|
+
* `schedule` the platform runs it continuously and a failure pages. A
|
|
56
|
+
* check fails when it throws, times out, or returns `{ ok: false }`.
|
|
57
|
+
* Checks must not have customer-visible side effects.
|
|
58
|
+
*/
|
|
59
|
+
check?: boolean;
|
|
53
60
|
/**
|
|
54
61
|
* Opt-in result caching for route invocations. Omit (the default) to never
|
|
55
62
|
* cache — the safe choice for a side-effectful function (writes, external
|
|
@@ -68,13 +75,31 @@ interface OxyAppFunctionManifest {
|
|
|
68
75
|
* destination here ONLY for a function that legitimately writes to it; a
|
|
69
76
|
* read-only function omits it. This scopes writes away from the project's
|
|
70
77
|
* source warehouse.
|
|
78
|
+
*
|
|
79
|
+
* A customer warehouse (anything but `airhouse` / `airhouse_managed`) is
|
|
80
|
+
* read-only: listing it here is not enough, it must also appear in
|
|
81
|
+
* `customerWarehouseWrites` with a reason.
|
|
71
82
|
*/
|
|
72
83
|
destinations?: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Customer warehouses this function writes to anyway, each with the reason —
|
|
86
|
+
* the exception to "customer warehouses are read-only". Every key must also be
|
|
87
|
+
* in `destinations`; a write to a customer warehouse not named here is refused.
|
|
88
|
+
* Prefer moving the data: facts to `airhouse`, records to `oltp`.
|
|
89
|
+
*
|
|
90
|
+
* ```json
|
|
91
|
+
* "customerWarehouseWrites": {
|
|
92
|
+
* "clickhouse": "Journal entries stay beside the legacy ClickHouse facts until QuickBooks lands in Airhouse"
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
customerWarehouseWrites?: Record<string, string>;
|
|
73
97
|
/**
|
|
74
98
|
* Capability to write app-scoped secrets via `ctx.secrets.set` (fail-closed:
|
|
75
99
|
* omit → writes rejected). Only the app's own `apps/<app-id>/` namespace is
|
|
76
|
-
* writable. Declare for a function that
|
|
77
|
-
* token-refresher that writes the rotated token back to Oxy Secrets.
|
|
100
|
+
* writable. Declare for a function that rotates a credential — e.g. a
|
|
101
|
+
* scheduled token-refresher that writes the rotated token back to Oxy Secrets.
|
|
102
|
+
* Secrets are not a state store: a cursor or counter is a record for `oltp`.
|
|
78
103
|
*/
|
|
79
104
|
secrets?: {
|
|
80
105
|
write?: boolean;
|
|
@@ -127,6 +152,17 @@ interface OxyAppFunctionManifest {
|
|
|
127
152
|
oltp?: {
|
|
128
153
|
enabled?: boolean;
|
|
129
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Capability for `ctx.airhouse` — append the app's own FACTS (what happened,
|
|
157
|
+
* never edited) to its schema in the workspace's Airhouse (fail-closed: omit →
|
|
158
|
+
* every `ctx.airhouse` call rejected). A pure GATE like `oltp`: the schema is
|
|
159
|
+
* derived from the app's slug (`store-ops` → `app_store_ops`), never named
|
|
160
|
+
* here. Writes run as the app, whoever invoked the function, so a scheduled
|
|
161
|
+
* run can write. Tables come from `airhouseMigrations`.
|
|
162
|
+
*/
|
|
163
|
+
airhouse?: {
|
|
164
|
+
enabled?: boolean;
|
|
165
|
+
};
|
|
130
166
|
/**
|
|
131
167
|
* Retry policy for **background** runs (a `schedule` fire or a manual job
|
|
132
168
|
* trigger). Omit → a job run is attempted once. Route (HTTP) invocations are
|
|
@@ -153,9 +189,9 @@ interface OxyAppManifest {
|
|
|
153
189
|
/** Must be 2. v1 manifests are no longer supported. */
|
|
154
190
|
schemaVersion: 2;
|
|
155
191
|
/**
|
|
156
|
-
* Optional display name.
|
|
157
|
-
*
|
|
158
|
-
*
|
|
192
|
+
* Optional display name. Informational: the name an app shows is its
|
|
193
|
+
* registry row's, set when the row is created (the admin **New app**
|
|
194
|
+
* dialog, or `oxyc publish --name` on a first publish).
|
|
159
195
|
*/
|
|
160
196
|
name?: string;
|
|
161
197
|
/**
|
|
@@ -184,7 +220,8 @@ interface OxyAppManifest {
|
|
|
184
220
|
*/
|
|
185
221
|
functions?: Record<string, OxyAppFunctionManifest>;
|
|
186
222
|
/**
|
|
187
|
-
* Schema migrations
|
|
223
|
+
* Schema migrations for the app's OLTP store (`ctx.oltp`) that ship WITH this
|
|
224
|
+
* bundle and run on promote.
|
|
188
225
|
*
|
|
189
226
|
* `dir` is a directory inside the built bundle holding numbered `.sql` files.
|
|
190
227
|
* The platform runs them in lexical order, **once each, ever**, inside a
|
|
@@ -202,6 +239,18 @@ interface OxyAppManifest {
|
|
|
202
239
|
migrations?: {
|
|
203
240
|
dir: string;
|
|
204
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* Tables for the app's FACTS, in its Airhouse schema `app_<writer>`: a
|
|
244
|
+
* directory of numbered `.sql` files run once each, at promote, with the same
|
|
245
|
+
* ledger rules as `migrations` (never edit, rename or copy one that ran).
|
|
246
|
+
*
|
|
247
|
+
* Every object must be named `app_<writer>.<name>`. Airhouse is DuckLake, so a
|
|
248
|
+
* file declaring a PRIMARY KEY, UNIQUE, an index or a foreign key is refused at
|
|
249
|
+
* publish — a table carrying one fails and leaves the writer inert.
|
|
250
|
+
*/
|
|
251
|
+
airhouseMigrations?: {
|
|
252
|
+
dir: string;
|
|
253
|
+
};
|
|
205
254
|
/**
|
|
206
255
|
* Optional Ask Oxygen binding (agent ref + composer chips). The
|
|
207
256
|
* platform's registered copy is authoritative (surfaced by
|
|
@@ -921,4 +970,4 @@ interface OxyChatProps {
|
|
|
921
970
|
declare function OxyChat(props: OxyChatProps): React.JSX.Element;
|
|
922
971
|
//#endregion
|
|
923
972
|
export { loadCustomAppManifest as $, UseSemanticQueryOpts as A, FunctionError as B, UseProcedureRunInput as C, UseQueryOpts as D, UseQueryInput as E, useProcedureRun as F, apiErrorFromResponse as G, FunctionResult as H, useQuery as I, OxyAppFunctionManifest as J, interpretCustomAppError as K, useResolvedManifest as L, useAgentRun as M, useFunction as N, UseQueryResult as O, useOxyApp as P, _resetCustomAppManifestCacheForTest as Q, useSemanticQuery as R, UseFunctionResult as S, UseProcedureRunResult as T, CustomAppErrorReport as U, FunctionLog as V, OxyApiError as W, OxyAppPerformanceManifest as X, OxyAppManifest as Y, ResolvedCustomAppManifest as Z, SemanticFilter as _, AppFetcher as a, UseAgentRunInput as b, OxyAppProvider as c, OxyChatProps as d, ProcedureProgress as f, SemanticDateRangeOp as g, SemanticArrayOp as h, AgentSqlArtifact as i, UseSemanticQueryResult as j, UseSemanticQueryInput as k, OxyAppProviderProps as l, ProcedureRunState as m, AgentRunEvent as n, OxyAnswer as o, ProcedureResult as p, LoadManifestOptions as q, AgentRunState as r, OxyAnswerProps as s, AgentArtifact as t, OxyChat as u, SemanticScalarOp as v, UseProcedureRunOpts as w, UseAgentRunResult as x, SemanticTimeDimension as y, useTrackEvent as z };
|
|
924
|
-
//# sourceMappingURL=react-
|
|
973
|
+
//# sourceMappingURL=react-CljeXJuw.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-CljeXJuw.d.cts","names":[],"sources":["../src/custom-app/manifest.ts","../src/custom-app/errors.ts","../src/custom-app/function-sse.ts","../src/custom-app/react.tsx"],"mappings":";;;;;;;;;;;UA0BiB;;EAEf;;EAEA;;EAEA;;EAEA;;EAEA;IAAe;IAAkB;;;;;;;;;;;EAUjC;;;;;;;;;;IAUE;;IAEA;;IAEA;;;EAGF;;;;;;;EAOA;;;;;;;;;EASA;IAAU;;;;;;;;;;;;;;EAaV;;;;;;;;;;;;;EAaA,0BAA0B;;;;;;;;EAQ1B;IAAY;;;;;;;;;EAQZ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;;EAEjC;;EAEA,QAAQ;;;;EAIR,WAAW;;EAEX;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;EAmBA;EACA,OAAO;;iBAGO,YAAY,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuiBtC,kBAAkB,cAAc,UAAU;UAmHzC;;EAEf;;EAEA,YAAY;;EAEZ,OAAO;;EAEP;;EAEA,QAAQ;;;;;;;;EAQR;;EAEA;;;EAGA;;EAEA;;;;;;;;;;;;;;;;;;;iBAoBc,UAAU,OAAO,iBAAiB,MAAM,IAAI;UAgE3C;;EAEf;;EAEA;;EAEA;;EAEA,aAAa,MAAM;;EAEnB;;EAEA;;;;;;;;;;;;;;iBAec,QAAQ,OAAO,eAAe,MAAM,IAAI"}
|
|
@@ -50,6 +50,13 @@ interface OxyAppFunctionManifest {
|
|
|
50
50
|
};
|
|
51
51
|
/** Wall-clock timeout. Default 30, max 300. */
|
|
52
52
|
timeoutSeconds?: number;
|
|
53
|
+
/**
|
|
54
|
+
* Mark this function as a check. `oxyc checks run` runs it; with a
|
|
55
|
+
* `schedule` the platform runs it continuously and a failure pages. A
|
|
56
|
+
* check fails when it throws, times out, or returns `{ ok: false }`.
|
|
57
|
+
* Checks must not have customer-visible side effects.
|
|
58
|
+
*/
|
|
59
|
+
check?: boolean;
|
|
53
60
|
/**
|
|
54
61
|
* Opt-in result caching for route invocations. Omit (the default) to never
|
|
55
62
|
* cache — the safe choice for a side-effectful function (writes, external
|
|
@@ -68,13 +75,31 @@ interface OxyAppFunctionManifest {
|
|
|
68
75
|
* destination here ONLY for a function that legitimately writes to it; a
|
|
69
76
|
* read-only function omits it. This scopes writes away from the project's
|
|
70
77
|
* source warehouse.
|
|
78
|
+
*
|
|
79
|
+
* A customer warehouse (anything but `airhouse` / `airhouse_managed`) is
|
|
80
|
+
* read-only: listing it here is not enough, it must also appear in
|
|
81
|
+
* `customerWarehouseWrites` with a reason.
|
|
71
82
|
*/
|
|
72
83
|
destinations?: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Customer warehouses this function writes to anyway, each with the reason —
|
|
86
|
+
* the exception to "customer warehouses are read-only". Every key must also be
|
|
87
|
+
* in `destinations`; a write to a customer warehouse not named here is refused.
|
|
88
|
+
* Prefer moving the data: facts to `airhouse`, records to `oltp`.
|
|
89
|
+
*
|
|
90
|
+
* ```json
|
|
91
|
+
* "customerWarehouseWrites": {
|
|
92
|
+
* "clickhouse": "Journal entries stay beside the legacy ClickHouse facts until QuickBooks lands in Airhouse"
|
|
93
|
+
* }
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
customerWarehouseWrites?: Record<string, string>;
|
|
73
97
|
/**
|
|
74
98
|
* Capability to write app-scoped secrets via `ctx.secrets.set` (fail-closed:
|
|
75
99
|
* omit → writes rejected). Only the app's own `apps/<app-id>/` namespace is
|
|
76
|
-
* writable. Declare for a function that
|
|
77
|
-
* token-refresher that writes the rotated token back to Oxy Secrets.
|
|
100
|
+
* writable. Declare for a function that rotates a credential — e.g. a
|
|
101
|
+
* scheduled token-refresher that writes the rotated token back to Oxy Secrets.
|
|
102
|
+
* Secrets are not a state store: a cursor or counter is a record for `oltp`.
|
|
78
103
|
*/
|
|
79
104
|
secrets?: {
|
|
80
105
|
write?: boolean;
|
|
@@ -127,6 +152,17 @@ interface OxyAppFunctionManifest {
|
|
|
127
152
|
oltp?: {
|
|
128
153
|
enabled?: boolean;
|
|
129
154
|
};
|
|
155
|
+
/**
|
|
156
|
+
* Capability for `ctx.airhouse` — append the app's own FACTS (what happened,
|
|
157
|
+
* never edited) to its schema in the workspace's Airhouse (fail-closed: omit →
|
|
158
|
+
* every `ctx.airhouse` call rejected). A pure GATE like `oltp`: the schema is
|
|
159
|
+
* derived from the app's slug (`store-ops` → `app_store_ops`), never named
|
|
160
|
+
* here. Writes run as the app, whoever invoked the function, so a scheduled
|
|
161
|
+
* run can write. Tables come from `airhouseMigrations`.
|
|
162
|
+
*/
|
|
163
|
+
airhouse?: {
|
|
164
|
+
enabled?: boolean;
|
|
165
|
+
};
|
|
130
166
|
/**
|
|
131
167
|
* Retry policy for **background** runs (a `schedule` fire or a manual job
|
|
132
168
|
* trigger). Omit → a job run is attempted once. Route (HTTP) invocations are
|
|
@@ -153,9 +189,9 @@ interface OxyAppManifest {
|
|
|
153
189
|
/** Must be 2. v1 manifests are no longer supported. */
|
|
154
190
|
schemaVersion: 2;
|
|
155
191
|
/**
|
|
156
|
-
* Optional display name.
|
|
157
|
-
*
|
|
158
|
-
*
|
|
192
|
+
* Optional display name. Informational: the name an app shows is its
|
|
193
|
+
* registry row's, set when the row is created (the admin **New app**
|
|
194
|
+
* dialog, or `oxyc publish --name` on a first publish).
|
|
159
195
|
*/
|
|
160
196
|
name?: string;
|
|
161
197
|
/**
|
|
@@ -184,7 +220,8 @@ interface OxyAppManifest {
|
|
|
184
220
|
*/
|
|
185
221
|
functions?: Record<string, OxyAppFunctionManifest>;
|
|
186
222
|
/**
|
|
187
|
-
* Schema migrations
|
|
223
|
+
* Schema migrations for the app's OLTP store (`ctx.oltp`) that ship WITH this
|
|
224
|
+
* bundle and run on promote.
|
|
188
225
|
*
|
|
189
226
|
* `dir` is a directory inside the built bundle holding numbered `.sql` files.
|
|
190
227
|
* The platform runs them in lexical order, **once each, ever**, inside a
|
|
@@ -202,6 +239,18 @@ interface OxyAppManifest {
|
|
|
202
239
|
migrations?: {
|
|
203
240
|
dir: string;
|
|
204
241
|
};
|
|
242
|
+
/**
|
|
243
|
+
* Tables for the app's FACTS, in its Airhouse schema `app_<writer>`: a
|
|
244
|
+
* directory of numbered `.sql` files run once each, at promote, with the same
|
|
245
|
+
* ledger rules as `migrations` (never edit, rename or copy one that ran).
|
|
246
|
+
*
|
|
247
|
+
* Every object must be named `app_<writer>.<name>`. Airhouse is DuckLake, so a
|
|
248
|
+
* file declaring a PRIMARY KEY, UNIQUE, an index or a foreign key is refused at
|
|
249
|
+
* publish — a table carrying one fails and leaves the writer inert.
|
|
250
|
+
*/
|
|
251
|
+
airhouseMigrations?: {
|
|
252
|
+
dir: string;
|
|
253
|
+
};
|
|
205
254
|
/**
|
|
206
255
|
* Optional Ask Oxygen binding (agent ref + composer chips). The
|
|
207
256
|
* platform's registered copy is authoritative (surfaced by
|
|
@@ -921,4 +970,4 @@ interface OxyChatProps {
|
|
|
921
970
|
declare function OxyChat(props: OxyChatProps): React.JSX.Element;
|
|
922
971
|
//#endregion
|
|
923
972
|
export { loadCustomAppManifest as $, UseSemanticQueryOpts as A, FunctionError as B, UseProcedureRunInput as C, UseQueryOpts as D, UseQueryInput as E, useProcedureRun as F, apiErrorFromResponse as G, FunctionResult as H, useQuery as I, OxyAppFunctionManifest as J, interpretCustomAppError as K, useResolvedManifest as L, useAgentRun as M, useFunction as N, UseQueryResult as O, useOxyApp as P, _resetCustomAppManifestCacheForTest as Q, useSemanticQuery as R, UseFunctionResult as S, UseProcedureRunResult as T, CustomAppErrorReport as U, FunctionLog as V, OxyApiError as W, OxyAppPerformanceManifest as X, OxyAppManifest as Y, ResolvedCustomAppManifest as Z, SemanticFilter as _, AppFetcher as a, UseAgentRunInput as b, OxyAppProvider as c, OxyChatProps as d, ProcedureProgress as f, SemanticDateRangeOp as g, SemanticArrayOp as h, AgentSqlArtifact as i, UseSemanticQueryResult as j, UseSemanticQueryInput as k, OxyAppProviderProps as l, ProcedureRunState as m, AgentRunEvent as n, OxyAnswer as o, ProcedureResult as p, LoadManifestOptions as q, AgentRunState as r, OxyAnswerProps as s, AgentArtifact as t, OxyChat as u, SemanticScalarOp as v, UseProcedureRunOpts as w, UseAgentRunResult as x, SemanticTimeDimension as y, useTrackEvent as z };
|
|
924
|
-
//# sourceMappingURL=react-
|
|
973
|
+
//# sourceMappingURL=react-CljeXJuw.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-CljeXJuw.d.mts","names":[],"sources":["../src/custom-app/manifest.ts","../src/custom-app/errors.ts","../src/custom-app/function-sse.ts","../src/custom-app/react.ts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;EACA,UAAU;EACV,QAAQ;EACR,OAAO;;;;;;;;;;;;;;;;;;;;iBAyBO,gBACd,OAAO,sBACP,OAAM,sBACL;KA0LS;UAEK;EACf;EACA;;;;;;UAOe;EACf;;;EAGA;;;EAGA;EACA;;EAEA;IACE;IACA;IACA;;;;;EAKF;;KAGU,gBAAgB;UAEX;EACf;;UAGe;EACf,OAAO;;EAEP,MAAM,kBAAkB;IAAS;;;EAEjC;;EAEA,QAAQ;;;;EAIR,WAAW;;EAEX;;EAEA;;EAEA;;;;;;;;;;;;;;;;;;;EAmBA;EACA,OAAO;;iBAGO,YAAY,OAAO,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuiBtC,kBAAkB,cAAc,UAAU;UAmHzC;;EAEf;;EAEA,YAAY;;EAEZ,OAAO;;EAEP;;EAEA,QAAQ;;;;;;;;EAQR;;EAEA;;;EAGA;;EAEA;;;;;;;;;;;;;;;;;;;iBAoBc,UAAU,OAAO,iBAAiB,MAAM,IAAI;UAgE3C;;EAEf;;EAEA;;EAEA;;EAEA,aAAa,MAAM;;EAEnB;;EAEA;;;;;;;;;;;;;;iBAec,QAAQ,OAAO,eAAe,MAAM,IAAI"}
|
|
@@ -1,33 +1,7 @@
|
|
|
1
1
|
// @oxy/sdk - TypeScript SDK for Oxy data platform
|
|
2
|
-
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
-
key = keys[i];
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
-
__defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return to;
|
|
22
|
-
};
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
24
|
-
value: mod,
|
|
25
|
-
enumerable: true
|
|
26
|
-
}) : target, mod));
|
|
27
|
-
|
|
28
|
-
//#endregion
|
|
2
|
+
const require_rolldown_runtime = require('./rolldown-runtime-KC0qvQup.cjs');
|
|
29
3
|
let react = require("react");
|
|
30
|
-
react = __toESM(react, 1);
|
|
4
|
+
react = require_rolldown_runtime.__toESM(react, 1);
|
|
31
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
32
6
|
|
|
33
7
|
//#region src/custom-app/logger.ts
|
|
@@ -115,6 +89,25 @@ async function apiErrorFromResponse(resp) {
|
|
|
115
89
|
message: snippet || `HTTP ${resp.status}`
|
|
116
90
|
});
|
|
117
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Normalize a rejected request into the `Error` a hook reports.
|
|
94
|
+
*
|
|
95
|
+
* An `AbortError` reaching a hook's `.catch` is by construction an abort the
|
|
96
|
+
* hook did NOT cause — its own teardown is marked separately — so it is a
|
|
97
|
+
* fetcher's request timeout, a dropped socket, or a navigation. The platform's
|
|
98
|
+
* wording for those ("The user aborted a request.") is wrong on its face by
|
|
99
|
+
* the time a bundle renders it, so rephrase and keep the original as `cause`.
|
|
100
|
+
*
|
|
101
|
+
* The name is used only to WORD an error already being reported. Whether to
|
|
102
|
+
* report at all is the caller's teardown flag, never the name — that
|
|
103
|
+
* conflation is what left hooks loading forever.
|
|
104
|
+
*/
|
|
105
|
+
function asReportableError(err) {
|
|
106
|
+
const name = typeof err === "object" && err !== null && "name" in err ? String(err.name) : "";
|
|
107
|
+
const e = err instanceof Error ? err : new Error(String(err));
|
|
108
|
+
if (name !== "AbortError" && e.name !== "AbortError") return e;
|
|
109
|
+
return Object.assign(/* @__PURE__ */ new Error("request was interrupted (the connection dropped or timed out)"), { cause: e });
|
|
110
|
+
}
|
|
118
111
|
const ARCH_DOC = "internal-docs/customer-apps.md";
|
|
119
112
|
/** Interpret a thrown error as a structured report for UI display. */
|
|
120
113
|
function interpretCustomAppError(err) {
|
|
@@ -327,7 +320,7 @@ const FUNCTION_NAME_RE = /^[a-z][a-z0-9-]{0,63}$/;
|
|
|
327
320
|
*
|
|
328
321
|
* This runs at manifest LOAD (app boot / `pnpm dev`), not at `oxy build` — the
|
|
329
322
|
* build-time gate is the vite plugin's `validateManifest`, which now checks
|
|
330
|
-
* function names too. `
|
|
323
|
+
* function names too. `oxyc publish` also validates them locally before esbuild,
|
|
331
324
|
* so a bad name fails before the upload regardless.
|
|
332
325
|
*/
|
|
333
326
|
function validateFunctions(raw) {
|
|
@@ -366,6 +359,10 @@ function validateFunctions(raw) {
|
|
|
366
359
|
if (typeof t !== "number" || !Number.isInteger(t) || t < 1 || t > 300) throw new Error(`oxy-app.json: function "${fnName}" \`timeoutSeconds\` must be an integer in [1, 300]`);
|
|
367
360
|
fn.timeoutSeconds = t;
|
|
368
361
|
}
|
|
362
|
+
if (value.check !== void 0) {
|
|
363
|
+
if (typeof value.check !== "boolean") throw new Error(`oxy-app.json: function "${fnName}" \`check\` must be a boolean`);
|
|
364
|
+
fn.check = value.check;
|
|
365
|
+
}
|
|
369
366
|
if (value.cache !== void 0) {
|
|
370
367
|
const c = value.cache;
|
|
371
368
|
if (!isRecord(c)) throw new Error(`oxy-app.json: function "${fnName}" \`cache\` must be an object`);
|
|
@@ -920,7 +917,7 @@ function useQuery(input, opts = {}) {
|
|
|
920
917
|
setState((s) => ({
|
|
921
918
|
...s,
|
|
922
919
|
loading: false,
|
|
923
|
-
error:
|
|
920
|
+
error: asReportableError(err)
|
|
924
921
|
}));
|
|
925
922
|
});
|
|
926
923
|
return () => {
|
|
@@ -1098,11 +1095,10 @@ function useSemanticQuery(input, opts = {}) {
|
|
|
1098
1095
|
});
|
|
1099
1096
|
}).catch((err) => {
|
|
1100
1097
|
if (cancelled) return;
|
|
1101
|
-
if (err instanceof DOMException && err.name === "AbortError") return;
|
|
1102
1098
|
setState((s) => ({
|
|
1103
1099
|
...s,
|
|
1104
1100
|
loading: false,
|
|
1105
|
-
error:
|
|
1101
|
+
error: asReportableError(err)
|
|
1106
1102
|
}));
|
|
1107
1103
|
});
|
|
1108
1104
|
return () => {
|
|
@@ -1259,13 +1255,13 @@ function useProcedureRun(input, opts = {}) {
|
|
|
1259
1255
|
return;
|
|
1260
1256
|
}
|
|
1261
1257
|
} catch (e) {
|
|
1262
|
-
if (
|
|
1258
|
+
if (ctrl.signal.aborted) return;
|
|
1263
1259
|
inflight.current.runId = void 0;
|
|
1264
1260
|
setState({
|
|
1265
1261
|
state: "failed",
|
|
1266
1262
|
progress: null,
|
|
1267
1263
|
result: null,
|
|
1268
|
-
error:
|
|
1264
|
+
error: asReportableError(e)
|
|
1269
1265
|
});
|
|
1270
1266
|
}
|
|
1271
1267
|
})();
|
|
@@ -1366,6 +1362,8 @@ function useAgentRun(input) {
|
|
|
1366
1362
|
if (ctrl.signal.aborted) return;
|
|
1367
1363
|
if (terminated) return;
|
|
1368
1364
|
attempts += 1;
|
|
1365
|
+
const idBeforeAttempt = lastEventId;
|
|
1366
|
+
let windowError;
|
|
1369
1367
|
try {
|
|
1370
1368
|
await consumeSseStream({
|
|
1371
1369
|
url: `/api/projects/${projectId}/agents/runs/${encodeURIComponent(run_id)}/events`,
|
|
@@ -1415,36 +1413,29 @@ function useAgentRun(input) {
|
|
|
1415
1413
|
}
|
|
1416
1414
|
});
|
|
1417
1415
|
} catch (err) {
|
|
1418
|
-
if (
|
|
1419
|
-
|
|
1420
|
-
inflight.current.runId = void 0;
|
|
1421
|
-
setState((s) => ({
|
|
1422
|
-
...s,
|
|
1423
|
-
state: "failed",
|
|
1424
|
-
error: err instanceof Error ? err : new Error(String(err))
|
|
1425
|
-
}));
|
|
1426
|
-
return;
|
|
1427
|
-
}
|
|
1416
|
+
if (ctrl.signal.aborted) return;
|
|
1417
|
+
windowError = err;
|
|
1428
1418
|
}
|
|
1429
1419
|
if (terminated) return;
|
|
1430
|
-
if (
|
|
1420
|
+
if (lastEventId !== idBeforeAttempt) attempts = 0;
|
|
1421
|
+
else if (attempts >= 5) {
|
|
1431
1422
|
inflight.current.runId = void 0;
|
|
1432
1423
|
setState((s) => ({
|
|
1433
1424
|
...s,
|
|
1434
1425
|
state: "failed",
|
|
1435
|
-
error: /* @__PURE__ */ new Error("run event stream closed without a terminal event")
|
|
1426
|
+
error: windowError ? asReportableError(windowError) : /* @__PURE__ */ new Error("run event stream closed without a terminal event")
|
|
1436
1427
|
}));
|
|
1437
1428
|
return;
|
|
1438
1429
|
}
|
|
1439
1430
|
await sleep(1e3, ctrl.signal);
|
|
1440
1431
|
}
|
|
1441
1432
|
} catch (e) {
|
|
1442
|
-
if (
|
|
1433
|
+
if (ctrl.signal.aborted) return;
|
|
1443
1434
|
inflight.current.runId = void 0;
|
|
1444
1435
|
setState((s) => ({
|
|
1445
1436
|
...s,
|
|
1446
1437
|
state: "failed",
|
|
1447
|
-
error:
|
|
1438
|
+
error: asReportableError(e)
|
|
1448
1439
|
}));
|
|
1449
1440
|
}
|
|
1450
1441
|
})();
|
|
@@ -2408,12 +2399,6 @@ Object.defineProperty(exports, 'OxyChat', {
|
|
|
2408
2399
|
return OxyChat;
|
|
2409
2400
|
}
|
|
2410
2401
|
});
|
|
2411
|
-
Object.defineProperty(exports, '__toESM', {
|
|
2412
|
-
enumerable: true,
|
|
2413
|
-
get: function () {
|
|
2414
|
-
return __toESM;
|
|
2415
|
-
}
|
|
2416
|
-
});
|
|
2417
2402
|
Object.defineProperty(exports, '_resetCustomAppManifestCacheForTest', {
|
|
2418
2403
|
enumerable: true,
|
|
2419
2404
|
get: function () {
|
|
@@ -2426,6 +2411,12 @@ Object.defineProperty(exports, 'apiErrorFromResponse', {
|
|
|
2426
2411
|
return apiErrorFromResponse;
|
|
2427
2412
|
}
|
|
2428
2413
|
});
|
|
2414
|
+
Object.defineProperty(exports, 'asReportableError', {
|
|
2415
|
+
enumerable: true,
|
|
2416
|
+
get: function () {
|
|
2417
|
+
return asReportableError;
|
|
2418
|
+
}
|
|
2419
|
+
});
|
|
2429
2420
|
Object.defineProperty(exports, 'getOxyAppLogger', {
|
|
2430
2421
|
enumerable: true,
|
|
2431
2422
|
get: function () {
|
|
@@ -2504,4 +2495,4 @@ Object.defineProperty(exports, 'useTrackEvent', {
|
|
|
2504
2495
|
return useTrackEvent;
|
|
2505
2496
|
}
|
|
2506
2497
|
});
|
|
2507
|
-
//# sourceMappingURL=react-
|
|
2498
|
+
//# sourceMappingURL=react-Dvkv2deI.cjs.map
|