@oxy-hq/sdk 2.9.1 → 2.11.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 +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +118 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{react-DBG6Pfp_.d.mts → react-CLONxcnA.d.cts} +127 -3
- package/dist/react-CLONxcnA.d.cts.map +1 -0
- package/dist/{react-DBG6Pfp_.d.cts → react-CLONxcnA.d.mts} +127 -3
- package/dist/react-CLONxcnA.d.mts.map +1 -0
- package/dist/{react-sACIu6Ea.mjs → react-DqnINwTi.mjs} +45 -14
- package/dist/react-DqnINwTi.mjs.map +1 -0
- package/dist/{react-CDYGAfGA.cjs → react-riTxd9ce.cjs} +45 -14
- package/dist/react-riTxd9ce.cjs.map +1 -0
- package/dist/shell.cjs +1 -1
- package/dist/shell.d.cts +1 -1
- package/dist/shell.d.mts +1 -1
- package/dist/shell.mjs +1 -1
- package/package.json +7 -7
- package/dist/react-CDYGAfGA.cjs.map +0 -1
- package/dist/react-DBG6Pfp_.d.cts.map +0 -1
- package/dist/react-DBG6Pfp_.d.mts.map +0 -1
- package/dist/react-sACIu6Ea.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as UseSemanticQueryOpts, B as
|
|
2
|
+
import { $ as loadCustomAppManifest, A as UseSemanticQueryOpts, B as FunctionError, C as UseProcedureRunInput, D as UseQueryOpts, E as UseQueryInput, F as useProcedureRun, G as apiErrorFromResponse, H as FunctionResult, I as useQuery, J as OxyAppFunctionManifest, K as interpretCustomAppError, L as useResolvedManifest, M as useAgentRun, N as useFunction, O as UseQueryResult, P as useOxyApp, Q as _resetCustomAppManifestCacheForTest, R as useSemanticQuery, S as UseFunctionResult, T as UseProcedureRunResult, U as CustomAppErrorReport, V as FunctionLog, W as OxyApiError, X as OxyAppPerformanceManifest, Y as OxyAppManifest, Z as ResolvedCustomAppManifest, _ as SemanticFilter, a as AppFetcher, b as UseAgentRunInput, c as OxyAppProvider, d as OxyChatProps, f as ProcedureProgress, g as SemanticDateRangeOp, h as SemanticArrayOp, i as AgentSqlArtifact, j as UseSemanticQueryResult, k as UseSemanticQueryInput, l as OxyAppProviderProps, m as ProcedureRunState, n as AgentRunEvent, o as OxyAnswer, p as ProcedureResult, q as LoadManifestOptions, r as AgentRunState, s as OxyAnswerProps, t as AgentArtifact, u as OxyChat, v as SemanticScalarOp, w as UseProcedureRunOpts, x as UseAgentRunResult, y as SemanticTimeDimension, z as useTrackEvent } from "./react-CLONxcnA.cjs";
|
|
3
3
|
//#region src/config.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Configuration for the Oxy SDK
|
|
@@ -787,8 +787,16 @@ interface OxyFunctionUser {
|
|
|
787
787
|
* caller — check {@link kind} before attributing anything to it.
|
|
788
788
|
*/
|
|
789
789
|
id: string;
|
|
790
|
-
/**
|
|
791
|
-
|
|
790
|
+
/**
|
|
791
|
+
* Their email; `schedule+<fn>@system.oxy` when {@link kind} is `"system"`; and
|
|
792
|
+
* **`null` for a frontline worker** — a crew member enrolled by PIN on a shared
|
|
793
|
+
* device has no mailbox, and the platform stores none rather than inventing
|
|
794
|
+
* one. That null is the one field that tells the crew from the office inside
|
|
795
|
+
* a function, because a worker can never hold org membership (see
|
|
796
|
+
* `orgRole`, which is absent for them too). Treat it as `string | null` in
|
|
797
|
+
* app logic; it was typed `string` before the crew existed.
|
|
798
|
+
*/
|
|
799
|
+
email: string | null;
|
|
792
800
|
/**
|
|
793
801
|
* The org that owns this app — the tenant boundary for anything the function
|
|
794
802
|
* reads or writes.
|
|
@@ -894,8 +902,26 @@ type OxyFetchInit = RequestInit & {
|
|
|
894
902
|
*/
|
|
895
903
|
encoding?: "utf8" | "base64";
|
|
896
904
|
};
|
|
897
|
-
/**
|
|
905
|
+
/**
|
|
906
|
+
* `ctx.warehouse.*` — one of the app's configured databases by name.
|
|
907
|
+
*
|
|
908
|
+
* The writes require the database in the function's `destinations` allowlist;
|
|
909
|
+
* `query` does not, because that allowlist is about modifying a project's
|
|
910
|
+
* warehouse, and a `postgres_managed` database resolves the read-only analyst
|
|
911
|
+
* for every caller regardless.
|
|
912
|
+
*/
|
|
898
913
|
interface OxyWarehouseApi {
|
|
914
|
+
/**
|
|
915
|
+
* Read from a named database.
|
|
916
|
+
*
|
|
917
|
+
* `ctx.query` only ever reaches the project's DEFAULT database, so this is
|
|
918
|
+
* how an app reads its own per-org OLTP store, which sits beside whatever
|
|
919
|
+
* warehouse the project analyses.
|
|
920
|
+
*/
|
|
921
|
+
query(database: string, sql: string): Promise<{
|
|
922
|
+
rows: OxyFunctionRow[];
|
|
923
|
+
truncated: boolean;
|
|
924
|
+
}>;
|
|
899
925
|
insert(database: string, table: string, rows: OxyFunctionRow[]): Promise<unknown>;
|
|
900
926
|
exec(database: string, sql: string): Promise<unknown>;
|
|
901
927
|
upsert(database: string, table: string, rows: OxyFunctionRow[], conflictColumns: string[]): Promise<unknown>;
|
|
@@ -918,6 +944,49 @@ interface OxyTransaction {
|
|
|
918
944
|
/** Run a statement for its effect; resolves to the number of rows affected. */
|
|
919
945
|
exec(sql: string, params?: unknown[]): Promise<number>;
|
|
920
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* `ctx.oltp` — read and WRITE the app's OWN per-org OLTP schema (`app_<writer>`)
|
|
949
|
+
* on the managed Postgres tenant, and nothing else.
|
|
950
|
+
*
|
|
951
|
+
* This is the write half `ctx.warehouse` cannot give an app: for a
|
|
952
|
+
* `postgres_managed` database `ctx.warehouse` resolves the read-only analyst
|
|
953
|
+
* (org-wide read, the org's `raw_*` extracts included), so a write authenticates
|
|
954
|
+
* and then fails `permission denied`. `ctx.oltp` resolves the app's **writer**
|
|
955
|
+
* role instead — DML rights scoped to the one `app_<writer>` schema, so it is
|
|
956
|
+
* narrower on reads (no `raw_*`) and finally writable.
|
|
957
|
+
*
|
|
958
|
+
* Gated by the fail-closed `oltp` manifest capability (`"oltp": { "enabled":
|
|
959
|
+
* true }`) — a pure gate. The target schema is derived from the app's own slug
|
|
960
|
+
* (`oltp-bookings` → `app_oltp_bookings`), never named in the manifest, so a
|
|
961
|
+
* manifest cannot point `ctx.oltp` at another app's schema. The store must be
|
|
962
|
+
* provisioned first (ask whoever operates the org). No database name is passed —
|
|
963
|
+
* the app's own store is implicit.
|
|
964
|
+
*
|
|
965
|
+
* Both methods take **bound parameters** (`$1`, `$2`, …). Never build SQL by
|
|
966
|
+
* concatenating request data — a booking form is exactly the surface that takes
|
|
967
|
+
* end-user input, and placeholders are the only thing that makes it safe. Each
|
|
968
|
+
* call auto-commits; a failed statement rolls back.
|
|
969
|
+
*
|
|
970
|
+
* **Cost:** each call opens its own connection to the tenant (a TCP + TLS
|
|
971
|
+
* handshake, and a wake-up if the compute was idle) and its own transaction, so
|
|
972
|
+
* a per-row loop pays that per row. Prefer one statement over many — a
|
|
973
|
+
* multi-row `INSERT`, an `INSERT … SELECT`, or `INSERT … RETURNING` to avoid a
|
|
974
|
+
* follow-up read — and reach for `ctx.oltp` a handful of times per request, not
|
|
975
|
+
* in a hot loop.
|
|
976
|
+
*
|
|
977
|
+
* ```ts
|
|
978
|
+
* const [row] = await ctx.oltp.query(
|
|
979
|
+
* "INSERT INTO bookings (name, party_size) VALUES ($1, $2) RETURNING id",
|
|
980
|
+
* [name, partySize],
|
|
981
|
+
* );
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
interface OxyOltpApi {
|
|
985
|
+
/** Run a row-returning statement (including `INSERT … RETURNING`). */
|
|
986
|
+
query(sql: string, params?: unknown[]): Promise<OxyFunctionRow[]>;
|
|
987
|
+
/** Run a statement for its effect; resolves to the number of rows affected. */
|
|
988
|
+
exec(sql: string, params?: unknown[]): Promise<number>;
|
|
989
|
+
}
|
|
921
990
|
/** `ctx.secrets` — write app-scoped secrets (gated by the `secrets.write` capability). */
|
|
922
991
|
interface OxySecretsApi {
|
|
923
992
|
set(key: string, value: string): Promise<void>;
|
|
@@ -1196,6 +1265,41 @@ interface OxyStorageApi {
|
|
|
1196
1265
|
interface OxyFunctionContext {
|
|
1197
1266
|
/** Invoking user (route) or system identity (schedule/airway). */
|
|
1198
1267
|
user: OxyFunctionUser;
|
|
1268
|
+
/**
|
|
1269
|
+
* The org's people directory. Requires `"org": { "read": true }` in this
|
|
1270
|
+
* function's manifest entry — without it the call is rejected before any
|
|
1271
|
+
* query reaches the database.
|
|
1272
|
+
*
|
|
1273
|
+
* For naming a person: an assignee, a roster entry, who submitted something.
|
|
1274
|
+
* Returns a display name and a role, and deliberately **no email, no phone,
|
|
1275
|
+
* no location**.
|
|
1276
|
+
*
|
|
1277
|
+
* Who is in it: **people who can reach this app**. Org members, plus frontline
|
|
1278
|
+
* workers holding a grant on this app — `kind` tells them apart, so a caller
|
|
1279
|
+
* that must not name a worker can refuse on the field rather than by
|
|
1280
|
+
* convention. A worker's `role` is `null`: that vocabulary is org membership's
|
|
1281
|
+
* and a worker has none.
|
|
1282
|
+
*
|
|
1283
|
+
* REQUIRED, like every sibling here — `oltp`, `secrets`, `email`, `storage`,
|
|
1284
|
+
* `airway` are all gated and all declared required. The binding is
|
|
1285
|
+
* unconditional: `__buildCtx` is a static string that attaches `org` whatever
|
|
1286
|
+
* the manifest says, and the refusal lives in the op, not in the binding. An
|
|
1287
|
+
* optional member would therefore be a lie in the other direction, and under
|
|
1288
|
+
* `strict` it makes `ctx.org.people()` — the spelling in every doc here and
|
|
1289
|
+
* the only one the host binds — fail with "possibly undefined".
|
|
1290
|
+
*/
|
|
1291
|
+
org: {
|
|
1292
|
+
people(): Promise<{
|
|
1293
|
+
people: Array<{
|
|
1294
|
+
id: string;
|
|
1295
|
+
name: string;
|
|
1296
|
+
/** The org role, or `null` for a frontline worker. */
|
|
1297
|
+
role: string | null;
|
|
1298
|
+
kind: "member" | "frontline";
|
|
1299
|
+
}>;
|
|
1300
|
+
total: number;
|
|
1301
|
+
}>;
|
|
1302
|
+
};
|
|
1199
1303
|
/** Read-only view of the app's configured secrets (project-scoped). */
|
|
1200
1304
|
env: Record<string, string>;
|
|
1201
1305
|
/** Structured per-invocation logging (captured + surfaced with the response). */
|
|
@@ -1245,6 +1349,13 @@ interface OxyFunctionContext {
|
|
|
1245
1349
|
* ```
|
|
1246
1350
|
*/
|
|
1247
1351
|
tx<T>(database: string, fn: (tx: OxyTransaction) => Promise<T> | T): Promise<T>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Read/write the app's OWN per-org OLTP schema (derived from its slug). The
|
|
1354
|
+
* write half `ctx.warehouse` cannot give an app on a managed database. Gated
|
|
1355
|
+
* by the fail-closed `oltp` manifest capability (`{ enabled: true }`). See
|
|
1356
|
+
* {@link OxyOltpApi}.
|
|
1357
|
+
*/
|
|
1358
|
+
oltp: OxyOltpApi;
|
|
1248
1359
|
secrets: OxySecretsApi;
|
|
1249
1360
|
semantic: OxySemanticApi;
|
|
1250
1361
|
airway: OxyAirwayApi;
|
|
@@ -1485,7 +1596,7 @@ interface UseWorldModelGraphResult {
|
|
|
1485
1596
|
* project's `.world-model.yml` display config server-side.
|
|
1486
1597
|
*
|
|
1487
1598
|
* @remarks
|
|
1488
|
-
* This returns the raw semantic-
|
|
1599
|
+
* This returns the raw semantic-model entity graph. For the higher-level
|
|
1489
1600
|
* node-paradigm interface (`world.metric(id)` speaking `expand` / `explain` /
|
|
1490
1601
|
* `size`), use {@link useWorldModel} from `./world-node` instead.
|
|
1491
1602
|
*/
|
|
@@ -1616,10 +1727,10 @@ declare function createWorldModel(projectId: string | null, fetcher: AppFetcher)
|
|
|
1616
1727
|
* ```
|
|
1617
1728
|
*
|
|
1618
1729
|
* @remarks
|
|
1619
|
-
* This is the node-paradigm hook. For the raw semantic-
|
|
1730
|
+
* This is the node-paradigm hook. For the raw semantic-model entity/measure
|
|
1620
1731
|
* graph, use {@link useWorldModelGraph} instead.
|
|
1621
1732
|
*/
|
|
1622
1733
|
declare function useWorldModel(): WorldModelApi;
|
|
1623
1734
|
//#endregion
|
|
1624
|
-
export { type AdditivityClass, type AgentArtifact, type AgentRunEvent, type AgentRunState, type AgentSqlArtifact, AnomaliesClient, type Anomaly, type AnomalyFilter, type AnomalySeverity, type AnomalyStatus, type AppFetcher, type BulkUpdateStatusResponse, type CustomAppDebugSnapshot, type CustomAppErrorReport, type DimensionOpportunity, type DistributionRequest, type DriverAttribution, type DriverConfidence, type DriverDirection, type DriverForm, type DriverStrength, type EdgeKind, type EmailAttachment, type EmailSendInput, type EmailSendResult, type ExpandedNode, type ExplainConfigOverride, type ExplainNode, type ExplainOptions, type ExplainOpts, type ExplainRequest, type ExplainResult, type ExplainSibling, type ExplainWarning, type ListAnomaliesOptions, type ListAnomaliesResponse, type LoadManifestOptions, type MetricEdge, type MetricHandle, type MetricNode, type MetricScope, type MetricTree, MetricTreeClient, type MetricTreeHookResult, type OpportunityRequest, type OpportunityResult, type OxyAirwayApi, OxyAnswer, type OxyAnswerProps, OxyApiError, type OxyAppFunctionManifest, type OxyAppLogLevel, type OxyAppLogger, type OxyAppManifest, OxyAppProvider, type OxyAppProviderProps, OxyChat, type OxyChatProps, type OxyEmailApi, type OxyFetchResult, type OxyFunctionContext, type OxyFunctionHandler, type OxyFunctionRequest, type OxyFunctionRow, type OxyFunctionUser, type OxyIdentityKind, type OxyInjectedAppConfig, type OxyOrgTeam, type OxySecretsApi, type OxySemanticApi, type OxyStorageApi, type OxyTransaction, type OxyWarehouseApi, type PredictChange, type PredictImpact, type PredictResult, type ProcedureProgress, type ProcedureResult, type ProcedureRunState, type ResolvedCustomAppManifest, type ScanFailure, type ScanOptions, type ScanResponse, type SegmentOpportunity, type SemanticArrayOp, type SemanticDateRangeOp, type SemanticFilter, type SemanticScalarOp, type SemanticTimeDimension, type SensitivityDriver, type SensitivityResult, type SizeOpts, type SkippedDimension, type SplitKind, type StorageDownloadUrl, type StorageListPage, type StorageObject, type StoragePutOptions, type StoragePutResult, type StorageUploadUrl, type StorageUploadUrlInput, type TimeDimensionsResponse, type UseAgentRunInput, type UseAgentRunResult, type UseFunctionResult, type UseMeasureBreakdownResult, type UseMetricTreeOpts, type UseProcedureRunInput, type UseProcedureRunOpts, type UseProcedureRunResult, type UseQueryInput, type UseQueryOpts, type UseQueryResult, type UseSemanticQueryInput, type UseSemanticQueryOpts, type UseSemanticQueryResult, type UseWorldModelGraphResult, type UseWorldModelInstancesOpts, type UseWorldModelInstancesResult, type WmBreakdownEdge, type WmBreakdownNode, type WmEntityCount, type WmFilterCountsResponse, type WmInstance, type WmInstancesResponse, type WmMeasureBreakdown, type WmMeasureBreakdownEvent, type WorldModel, type WorldModelApi, type WorldModelDimension, type WorldModelEdge, type WorldModelEntity, type WorldModelInducedMeasure, type WorldModelMeasure, WorldModelScopeUnsupportedError, _resetCustomAppManifestCacheForTest, apiErrorFromResponse, base64ToBytes, bytesToBase64, createWorldModel, getCustomAppDebug, getOxyAppLogger, interpretCustomAppError, loadCustomAppManifest, readInjectedAppConfig, readJsonSseStream, setOxyAppLogger, useAgentRun, useDistribution, useExplain, useFunction, useMeasureBreakdown, useMetricTree, useOpportunity, useOxyApp, usePredict, useProcedureRun, useQuery, useResolvedManifest, useSemanticQuery, useSensitivity, useTimeDimensions, useTrackEvent, useWorldModel, useWorldModelGraph, useWorldModelInstances };
|
|
1735
|
+
export { type AdditivityClass, type AgentArtifact, type AgentRunEvent, type AgentRunState, type AgentSqlArtifact, AnomaliesClient, type Anomaly, type AnomalyFilter, type AnomalySeverity, type AnomalyStatus, type AppFetcher, type BulkUpdateStatusResponse, type CustomAppDebugSnapshot, type CustomAppErrorReport, type DimensionOpportunity, type DistributionRequest, type DriverAttribution, type DriverConfidence, type DriverDirection, type DriverForm, type DriverStrength, type EdgeKind, type EmailAttachment, type EmailSendInput, type EmailSendResult, type ExpandedNode, type ExplainConfigOverride, type ExplainNode, type ExplainOptions, type ExplainOpts, type ExplainRequest, type ExplainResult, type ExplainSibling, type ExplainWarning, type FunctionError, type FunctionLog, type FunctionResult, type ListAnomaliesOptions, type ListAnomaliesResponse, type LoadManifestOptions, type MetricEdge, type MetricHandle, type MetricNode, type MetricScope, type MetricTree, MetricTreeClient, type MetricTreeHookResult, type OpportunityRequest, type OpportunityResult, type OxyAirwayApi, OxyAnswer, type OxyAnswerProps, OxyApiError, type OxyAppFunctionManifest, type OxyAppLogLevel, type OxyAppLogger, type OxyAppManifest, type OxyAppPerformanceManifest, OxyAppProvider, type OxyAppProviderProps, OxyChat, type OxyChatProps, type OxyEmailApi, type OxyFetchResult, type OxyFunctionContext, type OxyFunctionHandler, type OxyFunctionRequest, type OxyFunctionRow, type OxyFunctionUser, type OxyIdentityKind, type OxyInjectedAppConfig, type OxyOltpApi, type OxyOrgTeam, type OxySecretsApi, type OxySemanticApi, type OxyStorageApi, type OxyTransaction, type OxyWarehouseApi, type PredictChange, type PredictImpact, type PredictResult, type ProcedureProgress, type ProcedureResult, type ProcedureRunState, type ResolvedCustomAppManifest, type ScanFailure, type ScanOptions, type ScanResponse, type SegmentOpportunity, type SemanticArrayOp, type SemanticDateRangeOp, type SemanticFilter, type SemanticScalarOp, type SemanticTimeDimension, type SensitivityDriver, type SensitivityResult, type SizeOpts, type SkippedDimension, type SplitKind, type StorageDownloadUrl, type StorageListPage, type StorageObject, type StoragePutOptions, type StoragePutResult, type StorageUploadUrl, type StorageUploadUrlInput, type TimeDimensionsResponse, type UseAgentRunInput, type UseAgentRunResult, type UseFunctionResult, type UseMeasureBreakdownResult, type UseMetricTreeOpts, type UseProcedureRunInput, type UseProcedureRunOpts, type UseProcedureRunResult, type UseQueryInput, type UseQueryOpts, type UseQueryResult, type UseSemanticQueryInput, type UseSemanticQueryOpts, type UseSemanticQueryResult, type UseWorldModelGraphResult, type UseWorldModelInstancesOpts, type UseWorldModelInstancesResult, type WmBreakdownEdge, type WmBreakdownNode, type WmEntityCount, type WmFilterCountsResponse, type WmInstance, type WmInstancesResponse, type WmMeasureBreakdown, type WmMeasureBreakdownEvent, type WorldModel, type WorldModelApi, type WorldModelDimension, type WorldModelEdge, type WorldModelEntity, type WorldModelInducedMeasure, type WorldModelMeasure, WorldModelScopeUnsupportedError, _resetCustomAppManifestCacheForTest, apiErrorFromResponse, base64ToBytes, bytesToBase64, createWorldModel, getCustomAppDebug, getOxyAppLogger, interpretCustomAppError, loadCustomAppManifest, readInjectedAppConfig, readJsonSseStream, setOxyAppLogger, useAgentRun, useDistribution, useExplain, useFunction, useMeasureBreakdown, useMetricTree, useOpportunity, useOxyApp, usePredict, useProcedureRun, useQuery, useResolvedManifest, useSemanticQuery, useSensitivity, useTimeDimensions, useTrackEvent, useWorldModel, useWorldModelGraph, useWorldModelInstances };
|
|
1625
1736
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config.ts","../src/metricTree.ts","../src/anomalies.ts","../src/custom-app/base64.ts","../src/custom-app/debug.ts","../src/custom-app/function-context.ts","../src/custom-app/inject.ts","../src/custom-app/logger.ts","../src/custom-app/metric-tree-hooks.tsx","../src/custom-app/sse.ts","../src/worldModel.ts","../src/custom-app/world-model-hooks.tsx","../src/custom-app/world-node.tsx"],"mappings":";;;;;;UAGiB;;;;EAIf;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;EAMA;;;;KCjCU;KACA;KACA;KACA;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;EACA,WAAW;EACX,UAAU;EACV,YAAY;EACZ;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP;;UAKe;EACf;EACA;EACA;EACA;EACA,OAAO;EACP,WAAW;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A;IACA;;EAEF;EACA;;EAEA,UAAU;EACV;EACA,UAAU;IAAQ;IAAc;;;;;;;;;iBASZ,kBACpB,UAAU,4BACT,QAAQ;;;;;;;;;;;UChBM;;EAEf;;;KAMU,iBAAiB;;UAGZ;EACf;EACA;;;;;;;;;;;;;;;;;KAkBU;;;;;;;;;;;UAYK;;;;;EAKf
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/config.ts","../src/metricTree.ts","../src/anomalies.ts","../src/custom-app/base64.ts","../src/custom-app/debug.ts","../src/custom-app/function-context.ts","../src/custom-app/inject.ts","../src/custom-app/logger.ts","../src/custom-app/metric-tree-hooks.tsx","../src/custom-app/sse.ts","../src/worldModel.ts","../src/custom-app/world-model-hooks.tsx","../src/custom-app/world-node.tsx"],"mappings":";;;;;;UAGiB;;;;EAIf;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;EAMA;;;;KCjCU;KACA;KACA;KACA;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;EACA,WAAW;EACX,UAAU;EACV,YAAY;EACZ;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP;;UAKe;EACf;EACA;EACA;EACA;EACA,OAAO;EACP,WAAW;EACX,UAAU;EACV;EACA;;UAGe;EACf;EACA,SAAS;;UAKM;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;;UAGe;EACf,QAAQ;EACR,SAAS;;KAKC;EACN;EAAmB;;EACnB;EAAmB;EAAmB;;EACtC;EAA6B;EAAmB;;EAChD;EAAuB;EAAmB;EAAe;;UAE9C;EACf,OAAO;EACP;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA,WAAW;;;;;;;KAQD;;;;;UAMK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA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S,cAAc,QAAQ;;EAEvC,QAAQ,MAAM,aAAa,SAAS,cAAc,QAAQ;;EAE1D,KAAK,MAAM,UAAU,SAAS,cAAc,QAAQ;;EAEpD,MAAM,OAAO,yBAAyB;;;;;;;UAQvB;;WAEN;;EAET,KAAK,eAAe,SAAS,cAAc,QAAQ;;EAEnD,OAAO,aAAa;;;;;;;;cAST,wCAAwC;WAC1C;WACA,OAAO;EAChB,YAAY,cAAc,OAAO;;;;;;;iBAkBnB,iBAAiB,0BAA0B,SAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;iBAqGjE,iBAAiB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { A as UseSemanticQueryOpts, B as
|
|
2
|
+
import { $ as loadCustomAppManifest, A as UseSemanticQueryOpts, B as FunctionError, C as UseProcedureRunInput, D as UseQueryOpts, E as UseQueryInput, F as useProcedureRun, G as apiErrorFromResponse, H as FunctionResult, I as useQuery, J as OxyAppFunctionManifest, K as interpretCustomAppError, L as useResolvedManifest, M as useAgentRun, N as useFunction, O as UseQueryResult, P as useOxyApp, Q as _resetCustomAppManifestCacheForTest, R as useSemanticQuery, S as UseFunctionResult, T as UseProcedureRunResult, U as CustomAppErrorReport, V as FunctionLog, W as OxyApiError, X as OxyAppPerformanceManifest, Y as OxyAppManifest, Z as ResolvedCustomAppManifest, _ as SemanticFilter, a as AppFetcher, b as UseAgentRunInput, c as OxyAppProvider, d as OxyChatProps, f as ProcedureProgress, g as SemanticDateRangeOp, h as SemanticArrayOp, i as AgentSqlArtifact, j as UseSemanticQueryResult, k as UseSemanticQueryInput, l as OxyAppProviderProps, m as ProcedureRunState, n as AgentRunEvent, o as OxyAnswer, p as ProcedureResult, q as LoadManifestOptions, r as AgentRunState, s as OxyAnswerProps, t as AgentArtifact, u as OxyChat, v as SemanticScalarOp, w as UseProcedureRunOpts, x as UseAgentRunResult, y as SemanticTimeDimension, z as useTrackEvent } from "./react-CLONxcnA.mjs";
|
|
3
3
|
//#region src/config.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Configuration for the Oxy SDK
|
|
@@ -787,8 +787,16 @@ interface OxyFunctionUser {
|
|
|
787
787
|
* caller — check {@link kind} before attributing anything to it.
|
|
788
788
|
*/
|
|
789
789
|
id: string;
|
|
790
|
-
/**
|
|
791
|
-
|
|
790
|
+
/**
|
|
791
|
+
* Their email; `schedule+<fn>@system.oxy` when {@link kind} is `"system"`; and
|
|
792
|
+
* **`null` for a frontline worker** — a crew member enrolled by PIN on a shared
|
|
793
|
+
* device has no mailbox, and the platform stores none rather than inventing
|
|
794
|
+
* one. That null is the one field that tells the crew from the office inside
|
|
795
|
+
* a function, because a worker can never hold org membership (see
|
|
796
|
+
* `orgRole`, which is absent for them too). Treat it as `string | null` in
|
|
797
|
+
* app logic; it was typed `string` before the crew existed.
|
|
798
|
+
*/
|
|
799
|
+
email: string | null;
|
|
792
800
|
/**
|
|
793
801
|
* The org that owns this app — the tenant boundary for anything the function
|
|
794
802
|
* reads or writes.
|
|
@@ -894,8 +902,26 @@ type OxyFetchInit = RequestInit & {
|
|
|
894
902
|
*/
|
|
895
903
|
encoding?: "utf8" | "base64";
|
|
896
904
|
};
|
|
897
|
-
/**
|
|
905
|
+
/**
|
|
906
|
+
* `ctx.warehouse.*` — one of the app's configured databases by name.
|
|
907
|
+
*
|
|
908
|
+
* The writes require the database in the function's `destinations` allowlist;
|
|
909
|
+
* `query` does not, because that allowlist is about modifying a project's
|
|
910
|
+
* warehouse, and a `postgres_managed` database resolves the read-only analyst
|
|
911
|
+
* for every caller regardless.
|
|
912
|
+
*/
|
|
898
913
|
interface OxyWarehouseApi {
|
|
914
|
+
/**
|
|
915
|
+
* Read from a named database.
|
|
916
|
+
*
|
|
917
|
+
* `ctx.query` only ever reaches the project's DEFAULT database, so this is
|
|
918
|
+
* how an app reads its own per-org OLTP store, which sits beside whatever
|
|
919
|
+
* warehouse the project analyses.
|
|
920
|
+
*/
|
|
921
|
+
query(database: string, sql: string): Promise<{
|
|
922
|
+
rows: OxyFunctionRow[];
|
|
923
|
+
truncated: boolean;
|
|
924
|
+
}>;
|
|
899
925
|
insert(database: string, table: string, rows: OxyFunctionRow[]): Promise<unknown>;
|
|
900
926
|
exec(database: string, sql: string): Promise<unknown>;
|
|
901
927
|
upsert(database: string, table: string, rows: OxyFunctionRow[], conflictColumns: string[]): Promise<unknown>;
|
|
@@ -918,6 +944,49 @@ interface OxyTransaction {
|
|
|
918
944
|
/** Run a statement for its effect; resolves to the number of rows affected. */
|
|
919
945
|
exec(sql: string, params?: unknown[]): Promise<number>;
|
|
920
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* `ctx.oltp` — read and WRITE the app's OWN per-org OLTP schema (`app_<writer>`)
|
|
949
|
+
* on the managed Postgres tenant, and nothing else.
|
|
950
|
+
*
|
|
951
|
+
* This is the write half `ctx.warehouse` cannot give an app: for a
|
|
952
|
+
* `postgres_managed` database `ctx.warehouse` resolves the read-only analyst
|
|
953
|
+
* (org-wide read, the org's `raw_*` extracts included), so a write authenticates
|
|
954
|
+
* and then fails `permission denied`. `ctx.oltp` resolves the app's **writer**
|
|
955
|
+
* role instead — DML rights scoped to the one `app_<writer>` schema, so it is
|
|
956
|
+
* narrower on reads (no `raw_*`) and finally writable.
|
|
957
|
+
*
|
|
958
|
+
* Gated by the fail-closed `oltp` manifest capability (`"oltp": { "enabled":
|
|
959
|
+
* true }`) — a pure gate. The target schema is derived from the app's own slug
|
|
960
|
+
* (`oltp-bookings` → `app_oltp_bookings`), never named in the manifest, so a
|
|
961
|
+
* manifest cannot point `ctx.oltp` at another app's schema. The store must be
|
|
962
|
+
* provisioned first (ask whoever operates the org). No database name is passed —
|
|
963
|
+
* the app's own store is implicit.
|
|
964
|
+
*
|
|
965
|
+
* Both methods take **bound parameters** (`$1`, `$2`, …). Never build SQL by
|
|
966
|
+
* concatenating request data — a booking form is exactly the surface that takes
|
|
967
|
+
* end-user input, and placeholders are the only thing that makes it safe. Each
|
|
968
|
+
* call auto-commits; a failed statement rolls back.
|
|
969
|
+
*
|
|
970
|
+
* **Cost:** each call opens its own connection to the tenant (a TCP + TLS
|
|
971
|
+
* handshake, and a wake-up if the compute was idle) and its own transaction, so
|
|
972
|
+
* a per-row loop pays that per row. Prefer one statement over many — a
|
|
973
|
+
* multi-row `INSERT`, an `INSERT … SELECT`, or `INSERT … RETURNING` to avoid a
|
|
974
|
+
* follow-up read — and reach for `ctx.oltp` a handful of times per request, not
|
|
975
|
+
* in a hot loop.
|
|
976
|
+
*
|
|
977
|
+
* ```ts
|
|
978
|
+
* const [row] = await ctx.oltp.query(
|
|
979
|
+
* "INSERT INTO bookings (name, party_size) VALUES ($1, $2) RETURNING id",
|
|
980
|
+
* [name, partySize],
|
|
981
|
+
* );
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
interface OxyOltpApi {
|
|
985
|
+
/** Run a row-returning statement (including `INSERT … RETURNING`). */
|
|
986
|
+
query(sql: string, params?: unknown[]): Promise<OxyFunctionRow[]>;
|
|
987
|
+
/** Run a statement for its effect; resolves to the number of rows affected. */
|
|
988
|
+
exec(sql: string, params?: unknown[]): Promise<number>;
|
|
989
|
+
}
|
|
921
990
|
/** `ctx.secrets` — write app-scoped secrets (gated by the `secrets.write` capability). */
|
|
922
991
|
interface OxySecretsApi {
|
|
923
992
|
set(key: string, value: string): Promise<void>;
|
|
@@ -1196,6 +1265,41 @@ interface OxyStorageApi {
|
|
|
1196
1265
|
interface OxyFunctionContext {
|
|
1197
1266
|
/** Invoking user (route) or system identity (schedule/airway). */
|
|
1198
1267
|
user: OxyFunctionUser;
|
|
1268
|
+
/**
|
|
1269
|
+
* The org's people directory. Requires `"org": { "read": true }` in this
|
|
1270
|
+
* function's manifest entry — without it the call is rejected before any
|
|
1271
|
+
* query reaches the database.
|
|
1272
|
+
*
|
|
1273
|
+
* For naming a person: an assignee, a roster entry, who submitted something.
|
|
1274
|
+
* Returns a display name and a role, and deliberately **no email, no phone,
|
|
1275
|
+
* no location**.
|
|
1276
|
+
*
|
|
1277
|
+
* Who is in it: **people who can reach this app**. Org members, plus frontline
|
|
1278
|
+
* workers holding a grant on this app — `kind` tells them apart, so a caller
|
|
1279
|
+
* that must not name a worker can refuse on the field rather than by
|
|
1280
|
+
* convention. A worker's `role` is `null`: that vocabulary is org membership's
|
|
1281
|
+
* and a worker has none.
|
|
1282
|
+
*
|
|
1283
|
+
* REQUIRED, like every sibling here — `oltp`, `secrets`, `email`, `storage`,
|
|
1284
|
+
* `airway` are all gated and all declared required. The binding is
|
|
1285
|
+
* unconditional: `__buildCtx` is a static string that attaches `org` whatever
|
|
1286
|
+
* the manifest says, and the refusal lives in the op, not in the binding. An
|
|
1287
|
+
* optional member would therefore be a lie in the other direction, and under
|
|
1288
|
+
* `strict` it makes `ctx.org.people()` — the spelling in every doc here and
|
|
1289
|
+
* the only one the host binds — fail with "possibly undefined".
|
|
1290
|
+
*/
|
|
1291
|
+
org: {
|
|
1292
|
+
people(): Promise<{
|
|
1293
|
+
people: Array<{
|
|
1294
|
+
id: string;
|
|
1295
|
+
name: string;
|
|
1296
|
+
/** The org role, or `null` for a frontline worker. */
|
|
1297
|
+
role: string | null;
|
|
1298
|
+
kind: "member" | "frontline";
|
|
1299
|
+
}>;
|
|
1300
|
+
total: number;
|
|
1301
|
+
}>;
|
|
1302
|
+
};
|
|
1199
1303
|
/** Read-only view of the app's configured secrets (project-scoped). */
|
|
1200
1304
|
env: Record<string, string>;
|
|
1201
1305
|
/** Structured per-invocation logging (captured + surfaced with the response). */
|
|
@@ -1245,6 +1349,13 @@ interface OxyFunctionContext {
|
|
|
1245
1349
|
* ```
|
|
1246
1350
|
*/
|
|
1247
1351
|
tx<T>(database: string, fn: (tx: OxyTransaction) => Promise<T> | T): Promise<T>;
|
|
1352
|
+
/**
|
|
1353
|
+
* Read/write the app's OWN per-org OLTP schema (derived from its slug). The
|
|
1354
|
+
* write half `ctx.warehouse` cannot give an app on a managed database. Gated
|
|
1355
|
+
* by the fail-closed `oltp` manifest capability (`{ enabled: true }`). See
|
|
1356
|
+
* {@link OxyOltpApi}.
|
|
1357
|
+
*/
|
|
1358
|
+
oltp: OxyOltpApi;
|
|
1248
1359
|
secrets: OxySecretsApi;
|
|
1249
1360
|
semantic: OxySemanticApi;
|
|
1250
1361
|
airway: OxyAirwayApi;
|
|
@@ -1485,7 +1596,7 @@ interface UseWorldModelGraphResult {
|
|
|
1485
1596
|
* project's `.world-model.yml` display config server-side.
|
|
1486
1597
|
*
|
|
1487
1598
|
* @remarks
|
|
1488
|
-
* This returns the raw semantic-
|
|
1599
|
+
* This returns the raw semantic-model entity graph. For the higher-level
|
|
1489
1600
|
* node-paradigm interface (`world.metric(id)` speaking `expand` / `explain` /
|
|
1490
1601
|
* `size`), use {@link useWorldModel} from `./world-node` instead.
|
|
1491
1602
|
*/
|
|
@@ -1616,10 +1727,10 @@ declare function createWorldModel(projectId: string | null, fetcher: AppFetcher)
|
|
|
1616
1727
|
* ```
|
|
1617
1728
|
*
|
|
1618
1729
|
* @remarks
|
|
1619
|
-
* This is the node-paradigm hook. For the raw semantic-
|
|
1730
|
+
* This is the node-paradigm hook. For the raw semantic-model entity/measure
|
|
1620
1731
|
* graph, use {@link useWorldModelGraph} instead.
|
|
1621
1732
|
*/
|
|
1622
1733
|
declare function useWorldModel(): WorldModelApi;
|
|
1623
1734
|
//#endregion
|
|
1624
|
-
export { type AdditivityClass, type AgentArtifact, type AgentRunEvent, type AgentRunState, type AgentSqlArtifact, AnomaliesClient, type Anomaly, type AnomalyFilter, type AnomalySeverity, type AnomalyStatus, type AppFetcher, type BulkUpdateStatusResponse, type CustomAppDebugSnapshot, type CustomAppErrorReport, type DimensionOpportunity, type DistributionRequest, type DriverAttribution, type DriverConfidence, type DriverDirection, type DriverForm, type DriverStrength, type EdgeKind, type EmailAttachment, type EmailSendInput, type EmailSendResult, type ExpandedNode, type ExplainConfigOverride, type ExplainNode, type ExplainOptions, type ExplainOpts, type ExplainRequest, type ExplainResult, type ExplainSibling, type ExplainWarning, type ListAnomaliesOptions, type ListAnomaliesResponse, type LoadManifestOptions, type MetricEdge, type MetricHandle, type MetricNode, type MetricScope, type MetricTree, MetricTreeClient, type MetricTreeHookResult, type OpportunityRequest, type OpportunityResult, type OxyAirwayApi, OxyAnswer, type OxyAnswerProps, OxyApiError, type OxyAppFunctionManifest, type OxyAppLogLevel, type OxyAppLogger, type OxyAppManifest, OxyAppProvider, type OxyAppProviderProps, OxyChat, type OxyChatProps, type OxyEmailApi, type OxyFetchResult, type OxyFunctionContext, type OxyFunctionHandler, type OxyFunctionRequest, type OxyFunctionRow, type OxyFunctionUser, type OxyIdentityKind, type OxyInjectedAppConfig, type OxyOrgTeam, type OxySecretsApi, type OxySemanticApi, type OxyStorageApi, type OxyTransaction, type OxyWarehouseApi, type PredictChange, type PredictImpact, type PredictResult, type ProcedureProgress, type ProcedureResult, type ProcedureRunState, type ResolvedCustomAppManifest, type ScanFailure, type ScanOptions, type ScanResponse, type SegmentOpportunity, type SemanticArrayOp, type SemanticDateRangeOp, type SemanticFilter, type SemanticScalarOp, type SemanticTimeDimension, type SensitivityDriver, type SensitivityResult, type SizeOpts, type SkippedDimension, type SplitKind, type StorageDownloadUrl, type StorageListPage, type StorageObject, type StoragePutOptions, type StoragePutResult, type StorageUploadUrl, type StorageUploadUrlInput, type TimeDimensionsResponse, type UseAgentRunInput, type UseAgentRunResult, type UseFunctionResult, type UseMeasureBreakdownResult, type UseMetricTreeOpts, type UseProcedureRunInput, type UseProcedureRunOpts, type UseProcedureRunResult, type UseQueryInput, type UseQueryOpts, type UseQueryResult, type UseSemanticQueryInput, type UseSemanticQueryOpts, type UseSemanticQueryResult, type UseWorldModelGraphResult, type UseWorldModelInstancesOpts, type UseWorldModelInstancesResult, type WmBreakdownEdge, type WmBreakdownNode, type WmEntityCount, type WmFilterCountsResponse, type WmInstance, type WmInstancesResponse, type WmMeasureBreakdown, type WmMeasureBreakdownEvent, type WorldModel, type WorldModelApi, type WorldModelDimension, type WorldModelEdge, type WorldModelEntity, type WorldModelInducedMeasure, type WorldModelMeasure, WorldModelScopeUnsupportedError, _resetCustomAppManifestCacheForTest, apiErrorFromResponse, base64ToBytes, bytesToBase64, createWorldModel, getCustomAppDebug, getOxyAppLogger, interpretCustomAppError, loadCustomAppManifest, readInjectedAppConfig, readJsonSseStream, setOxyAppLogger, useAgentRun, useDistribution, useExplain, useFunction, useMeasureBreakdown, useMetricTree, useOpportunity, useOxyApp, usePredict, useProcedureRun, useQuery, useResolvedManifest, useSemanticQuery, useSensitivity, useTimeDimensions, useTrackEvent, useWorldModel, useWorldModelGraph, useWorldModelInstances };
|
|
1735
|
+
export { type AdditivityClass, type AgentArtifact, type AgentRunEvent, type AgentRunState, type AgentSqlArtifact, AnomaliesClient, type Anomaly, type AnomalyFilter, type AnomalySeverity, type AnomalyStatus, type AppFetcher, type BulkUpdateStatusResponse, type CustomAppDebugSnapshot, type CustomAppErrorReport, type DimensionOpportunity, type DistributionRequest, type DriverAttribution, type DriverConfidence, type DriverDirection, type DriverForm, type DriverStrength, type EdgeKind, type EmailAttachment, type EmailSendInput, type EmailSendResult, type ExpandedNode, type ExplainConfigOverride, type ExplainNode, type ExplainOptions, type ExplainOpts, type ExplainRequest, type ExplainResult, type ExplainSibling, type ExplainWarning, type FunctionError, type FunctionLog, type FunctionResult, type ListAnomaliesOptions, type ListAnomaliesResponse, type LoadManifestOptions, type MetricEdge, type MetricHandle, type MetricNode, type MetricScope, type MetricTree, MetricTreeClient, type MetricTreeHookResult, type OpportunityRequest, type OpportunityResult, type OxyAirwayApi, OxyAnswer, type OxyAnswerProps, OxyApiError, type OxyAppFunctionManifest, type OxyAppLogLevel, type OxyAppLogger, type OxyAppManifest, type OxyAppPerformanceManifest, OxyAppProvider, type OxyAppProviderProps, OxyChat, type OxyChatProps, type OxyEmailApi, type OxyFetchResult, type OxyFunctionContext, type OxyFunctionHandler, type OxyFunctionRequest, type OxyFunctionRow, type OxyFunctionUser, type OxyIdentityKind, type OxyInjectedAppConfig, type OxyOltpApi, type OxyOrgTeam, type OxySecretsApi, type OxySemanticApi, type OxyStorageApi, type OxyTransaction, type OxyWarehouseApi, type PredictChange, type PredictImpact, type PredictResult, type ProcedureProgress, type ProcedureResult, type ProcedureRunState, type ResolvedCustomAppManifest, type ScanFailure, type ScanOptions, type ScanResponse, type SegmentOpportunity, type SemanticArrayOp, type SemanticDateRangeOp, type SemanticFilter, type SemanticScalarOp, type SemanticTimeDimension, type SensitivityDriver, type SensitivityResult, type SizeOpts, type SkippedDimension, type SplitKind, type StorageDownloadUrl, type StorageListPage, type StorageObject, type StoragePutOptions, type StoragePutResult, type StorageUploadUrl, type StorageUploadUrlInput, type TimeDimensionsResponse, type UseAgentRunInput, type UseAgentRunResult, type UseFunctionResult, type UseMeasureBreakdownResult, type UseMetricTreeOpts, type UseProcedureRunInput, type UseProcedureRunOpts, type UseProcedureRunResult, type UseQueryInput, type UseQueryOpts, type UseQueryResult, type UseSemanticQueryInput, type UseSemanticQueryOpts, type UseSemanticQueryResult, type UseWorldModelGraphResult, type UseWorldModelInstancesOpts, type UseWorldModelInstancesResult, type WmBreakdownEdge, type WmBreakdownNode, type WmEntityCount, type WmFilterCountsResponse, type WmInstance, type WmInstancesResponse, type WmMeasureBreakdown, type WmMeasureBreakdownEvent, type WorldModel, type WorldModelApi, type WorldModelDimension, type WorldModelEdge, type WorldModelEntity, type WorldModelInducedMeasure, type WorldModelMeasure, WorldModelScopeUnsupportedError, _resetCustomAppManifestCacheForTest, apiErrorFromResponse, base64ToBytes, bytesToBase64, createWorldModel, getCustomAppDebug, getOxyAppLogger, interpretCustomAppError, loadCustomAppManifest, readInjectedAppConfig, readJsonSseStream, setOxyAppLogger, useAgentRun, useDistribution, useExplain, useFunction, useMeasureBreakdown, useMetricTree, useOpportunity, useOxyApp, usePredict, useProcedureRun, useQuery, useResolvedManifest, useSemanticQuery, useSensitivity, useTimeDimensions, useTrackEvent, useWorldModel, useWorldModelGraph, useWorldModelInstances };
|
|
1625
1736
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config.ts","../src/metricTree.ts","../src/anomalies.ts","../src/custom-app/base64.ts","../src/custom-app/debug.ts","../src/custom-app/function-context.ts","../src/custom-app/inject.ts","../src/custom-app/logger.ts","../src/custom-app/metric-tree-hooks.tsx","../src/custom-app/sse.ts","../src/worldModel.ts","../src/custom-app/world-model-hooks.tsx","../src/custom-app/world-node.tsx"],"mappings":";;;;;;UAGiB;;;;EAIf;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;EAMA;;;;KCjCU;KACA;KACA;KACA;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;EACA,WAAW;EACX,UAAU;EACV,YAAY;EACZ;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP;;UAKe;EACf;EACA;EACA;EACA;EACA,OAAO;EACP,WAAW;EACX,UAAU;EACV;EACA;;UAGe;EACf;EACA,SAAS;;UAKM;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;;UAGe;EACf,QAAQ;EACR,SAAS;;KAKC;EACN;EAAmB;;EACnB;EAAmB;EAAmB;;EACtC;EAA6B;EAAmB;;EAChD;EAAuB;EAAmB;EAAe;;UAE9C;EACf,OAAO;EACP;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA,WAAW;;;;;;;KAQD;;;;;UAMK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;;EAGA,YAAY;EACZ,eAAe;EACf;EACA,MAAM;;EAEN;EACA;EACA,cAAc;;KAGJ;EAEN;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EAC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AIe;EACf;EACA;EACA;EACA;;EAEA;;EAEA,SAAS;EACT;;UAGe;EACf;EACA;EACA;;;;;;;EAOA;;;;;EAKA,UAAU;;UAGK;;EAEf;;KAKU,aAAa,GAAG,kBAAkB,UAAU,gBAAgB,QAAQ;;;;;;;;;;;;;;cAsBnE;mBACM;mBACA;EAEjB,YAAY,QAAQ,WAAW,SAAS;UAKhC;UAIA;;;;;;;;;;;;;;;EAqBF,KAAK,UAAS,uBAA4B,QAAQ;;;;;;;;;;;;;;;;;;;;;;EAqClD,KAAK,UAAS,cAAmB,QAAQ;;;;EAWzC,aAAa,mBAAmB,QAAQ,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0ChE,iBACJ;IAAU;IAAgB;IAAqB,eAAe;KAC9D,QAAQ,gBACP,QAAQ;;;;;;;;;;EA6BL,QAAQ,mBAAmB,UAAS,iBAAsB,QAAQ;;;;;;;;;;;;;;;;;;;;iBChV1D,cAAc,OAAO,aAAa,cAAc;;;;;;;;iBA8BhD,cAAc,iBAAiB;;;;;;UC9D9B;EACf;EACA;EACA;IACE;IACA;IACA;IACA;IACA;IACA;IACA;;EAEF;EACA;;EAEA,UAAU;EACV;EACA,UAAU;IAAQ;IAAc;;;;;;;;;iBASZ,kBACpB,UAAU,4BACT,QAAQ;;;;;;;;;;;UChBM;;EAEf;;;KAMU,iBAAiB;;UAGZ;EACf;EACA;;;;;;;;;;;;;;;;;KAkBU;;;;;;;;;;;UAYK;;;;;EAKf
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/config.ts","../src/metricTree.ts","../src/anomalies.ts","../src/custom-app/base64.ts","../src/custom-app/debug.ts","../src/custom-app/function-context.ts","../src/custom-app/inject.ts","../src/custom-app/logger.ts","../src/custom-app/metric-tree-hooks.tsx","../src/custom-app/sse.ts","../src/worldModel.ts","../src/custom-app/world-model-hooks.tsx","../src/custom-app/world-node.tsx"],"mappings":";;;;;;UAGiB;;;;EAIf;;;;EAKA;;;;EAKA;;;;EAKA;;;;EAKA;;;;;;;EAQA;;;;;EAMA;;;;KCjCU;KACA;KACA;KACA;KACA;UAEK;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA,MAAM;;EAEN;EACA,WAAW;EACX,UAAU;EACV,YAAY;EACZ;EACA,MAAM;EACN;EACA;EACA;EACA;;UAGe;EACf,OAAO;EACP,OAAO;EACP;;UAKe;EACf;EACA;EACA;EACA;EACA,OAAO;EACP,WAAW;EACX,UAAU;EACV;EACA;;UAGe;EACf;EACA,SAAS;;UAKM;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,MAAM;EACN;;UAGe;EACf,QAAQ;EACR,SAAS;;KAKC;EACN;EAAmB;;EACnB;EAAmB;EAAmB;;EACtC;EAA6B;EAAmB;;EAChD;EAAuB;EAAmB;EAAe;;UAE9C;EACf,OAAO;EACP;EACA;EACA;;UAGe;EACf,OAAO;EACP;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA,WAAW;;;;;;;KAQD;;;;;UAMK;EACf;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;;;EAGA,YAAY;EACZ,eAAe;EACf;EACA,MAAM;;EAEN;EACA;EACA,cAAc;;KAGJ;EAEN;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;EACA;;EAGA;EACA;EACA;EACA;;UAGW;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA,SAAS;;UAGM;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA,OAAO;EACP;EACA,qBAAqB;EACrB;EACA,WAAW;;UAKI;EACf;EACA;EACA;EACA;EACA;;EAEA;;UAGe;EACf;EACA;;EAEA;EACA;EACA,UAAU;EACV;;UAGe;EACf;EACA;;UAGe;EACf;EACA;EACA;;UAGe;EACf;EACA;EACA;;;;;EAKA;EACA,YAAY;EACZ,oBAAoB;EACpB,YAAY;;;;;;;;UAWG;EACf;EACA;;EAEA;;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;;UAKR;;EAEf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;EAEA;EACA;;UAGe;EACf;EACA;EACA;EACA;;;;KAKU;EAEN;EACA;EACA,OAAO,KAAK;EACZ,OAAO;;EAEP;EAAe;EAAiB;EAAsB;;EACtD;;;;UAIW;EACf;EACA,OAAO;EACP,OAAO;;;;UCzGQ;EACf,MAAM;EACN;EACA,OAAO;EACP;;;;;;;;;;;;iBAac,mBAAmB;EAAQ;IAA2B;UA6CrD;;EAEf;;EAEA;EACA;;UAGe;EACf,MAAM;EACN;EACA,OAAO;EACP;;;;;;;iBAQc,uBACd,yBACA,OAAM,6BACL;UAoDc;;EAEf,WAAW;EACX;EACA;EACA,OAAO;;;;;;;;iBAmCO,oBACd,yBACA,yBACA,yBACC;;;;KCtKS,cAAc,SAAS;;;KAIvB,cAAc,KAAK;;;KAInB,WAAW,KAAK;;;UAIX;;EAEf,MAAM;;EAEN,MAAM;;EAEN,QAAQ;;;;;;;UAQO;;WAEN;;WAEA,OAAO;;EAEhB,KAAK,SAAS,cAAc,QAAQ;;EAEpC,OAAO,SAAS,cAAc,QAAQ;;EAEtC,QAAQ,SAAS,cAAc,QAAQ;;EAEvC,QAAQ,MAAM,aAAa,SAAS,cAAc,QAAQ;;EAE1D,KAAK,MAAM,UAAU,SAAS,cAAc,QAAQ;;EAEpD,MAAM,OAAO,yBAAyB;;;;;;;UAQvB;;WAEN;;EAET,KAAK,eAAe,SAAS,cAAc,QAAQ;;EAEnD,OAAO,aAAa;;;;;;;;cAST,wCAAwC;WAC1C;WACA,OAAO;EAChB,YAAY,cAAc,OAAO;;;;;;;iBAkBnB,iBAAiB,0BAA0B,SAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;iBAqGjE,iBAAiB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @oxy/sdk - TypeScript SDK for Oxy data platform
|
|
2
|
-
import { _ as interpretCustomAppError, a as useFunction, c as useQuery, d as useTrackEvent, f as _resetCustomAppManifestCacheForTest, g as apiErrorFromResponse, h as OxyApiError, i as useAgentRun, l as useResolvedManifest, m as readInjectedAppConfig, n as OxyAppProvider, o as useOxyApp, p as loadCustomAppManifest, r as OxyChat, s as useProcedureRun, t as OxyAnswer, u as useSemanticQuery, v as getOxyAppLogger, y as setOxyAppLogger } from "./react-
|
|
2
|
+
import { _ as interpretCustomAppError, a as useFunction, c as useQuery, d as useTrackEvent, f as _resetCustomAppManifestCacheForTest, g as apiErrorFromResponse, h as OxyApiError, i as useAgentRun, l as useResolvedManifest, m as readInjectedAppConfig, n as OxyAppProvider, o as useOxyApp, p as loadCustomAppManifest, r as OxyChat, s as useProcedureRun, t as OxyAnswer, u as useSemanticQuery, v as getOxyAppLogger, y as setOxyAppLogger } from "./react-DqnINwTi.mjs";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/anomalies.ts
|
|
@@ -496,7 +496,7 @@ function worldModelPath(projectId) {
|
|
|
496
496
|
* project's `.world-model.yml` display config server-side.
|
|
497
497
|
*
|
|
498
498
|
* @remarks
|
|
499
|
-
* This returns the raw semantic-
|
|
499
|
+
* This returns the raw semantic-model entity graph. For the higher-level
|
|
500
500
|
* node-paradigm interface (`world.metric(id)` speaking `expand` / `explain` /
|
|
501
501
|
* `size`), use {@link useWorldModel} from `./world-node` instead.
|
|
502
502
|
*/
|
|
@@ -805,7 +805,7 @@ function createWorldModel(projectId, fetcher) {
|
|
|
805
805
|
* ```
|
|
806
806
|
*
|
|
807
807
|
* @remarks
|
|
808
|
-
* This is the node-paradigm hook. For the raw semantic-
|
|
808
|
+
* This is the node-paradigm hook. For the raw semantic-model entity/measure
|
|
809
809
|
* graph, use {@link useWorldModelGraph} instead.
|
|
810
810
|
*/
|
|
811
811
|
function useWorldModel() {
|