@opengeni/db 0.31.1 → 0.36.1
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/dist/browser-auth.d.ts +209 -1
- package/dist/browser-downloads.d.ts +51 -0
- package/dist/browser-identities.d.ts +11 -2
- package/dist/browser-sessions.d.ts +83 -1
- package/dist/browser-state-artifacts.d.ts +75 -1
- package/dist/canonical-human-identities.d.ts +48 -0
- package/dist/canonical-human-identities.js +28 -0
- package/dist/canonical-human-identities.js.map +1 -0
- package/dist/capability-integrations.d.ts +8 -6
- package/dist/{chunk-MWDVXQOL.js → chunk-5KTIEDX7.js} +5773 -4212
- package/dist/chunk-5KTIEDX7.js.map +1 -0
- package/dist/chunk-FPVAD4CO.js +117 -0
- package/dist/chunk-FPVAD4CO.js.map +1 -0
- package/dist/chunk-GYO7ED2Q.js +259 -0
- package/dist/chunk-GYO7ED2Q.js.map +1 -0
- package/dist/{chunk-F5FT7BEZ.js → chunk-HSOWSYOX.js} +2 -2
- package/dist/{chunk-YHZXQ7HP.js → chunk-VKLB2ZGI.js} +446 -19
- package/dist/chunk-VKLB2ZGI.js.map +1 -0
- package/dist/{chunk-NBE6CHRI.js → chunk-VTPRIXKG.js} +49 -9
- package/dist/chunk-VTPRIXKG.js.map +1 -0
- package/dist/{chunk-ISI2TIUG.js → chunk-Z7VYMNPZ.js} +76 -4
- package/dist/chunk-Z7VYMNPZ.js.map +1 -0
- package/dist/database.d.ts +5 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +467 -29
- package/dist/index.js +23247 -16232
- package/dist/index.js.map +1 -1
- package/dist/insights.d.ts +23 -7
- package/dist/integration-bindings.d.ts +24 -24
- package/dist/integration-facets.d.ts +99 -0
- package/dist/interaction-revisions.d.ts +11 -0
- package/dist/interaction-schema.d.ts +698 -34
- package/dist/persistence-errors.d.ts +8 -0
- package/dist/provision-roles.js +1 -1
- package/dist/runtime-posture.d.ts +8 -7
- package/dist/schema.d.ts +9464 -5412
- package/dist/schema.js +51 -9
- package/dist/session-control.d.ts +29 -3
- package/dist/session-tenancy.d.ts +44 -0
- package/dist/session-tenancy.js +16 -0
- package/dist/session-tenancy.js.map +1 -0
- package/dist/slack-task-policy-schema.d.ts +847 -0
- package/dist/slack-task-policy.d.ts +65 -0
- package/dist/task-notes-schema.d.ts +924 -0
- package/dist/task-notes.d.ts +85 -0
- package/dist/video-generation.d.ts +9 -0
- package/dist/video-generation.js +5 -3
- package/dist/xai-subscription.d.ts +326 -0
- package/drizzle/0212_browser_state_transfer_hardening.sql +560 -0
- package/drizzle/0213_browser_interaction_authority.sql +67 -0
- package/drizzle/0214_browser_download_saves.sql +34 -0
- package/drizzle/0215_browser_controller_host.sql +385 -0
- package/drizzle/0216_browser_auth_health_evidence.sql +137 -0
- package/drizzle/0217_external_browser_auth_operations.sql +22 -0
- package/drizzle/0218_organization_tenancy_foundation.sql +299 -0
- package/drizzle/0219_organization_tenancy_managed_human_provisioning.sql +317 -0
- package/drizzle/0219_site_auth_maintenance_sessions.sql +234 -0
- package/drizzle/0220_memory_slack_append_only_cascade.sql +38 -0
- package/drizzle/0220_session_channels.sql +54 -0
- package/drizzle/0221_sessions_channel_index.sql +5 -0
- package/drizzle/0222_session_visibility_authority_epochs.sql +158 -0
- package/drizzle/0222_sessions_channel_fk.sql +89 -0
- package/drizzle/0223_pending_tool_event_output.sql +55 -0
- package/drizzle/0223_sessions_channel_fk_validate.sql +118 -0
- package/drizzle/0224_slack_post_outcome_reconciliation.sql +123 -0
- package/drizzle/0225_session_visibility_fork_activation.sql +1363 -0
- package/drizzle/0226_personal_codex_authority_foundation.sql +365 -0
- package/drizzle/0227_slack_native_actions.sql +145 -0
- package/drizzle/0228_interaction_controller_data_plane.sql +14 -0
- package/drizzle/0228_slack_task_policy.sql +400 -0
- package/drizzle/0229_slack_inbox_file_fact.sql +10 -0
- package/drizzle/0230_user_scoped_variable_sets_rigs.sql +84 -0
- package/drizzle/0231_integration_definition_identity_cutover.sql +271 -0
- package/drizzle/0232_integration_facet_authority_cutover.sql +610 -0
- package/drizzle/0233_skill_and_integration_authority_cutover.sql +1162 -0
- package/drizzle/0234_xai_subscription_authority.sql +1139 -0
- package/drizzle/0235_canonical_human_login_bindings.sql +920 -0
- package/drizzle/0236_browser_identity_lifecycle.sql +39 -0
- package/drizzle/0236_session_visibility_slack_policy.sql +72 -0
- package/drizzle/0237_interaction_transition_reaper.sql +263 -0
- package/drizzle/0238_goal_persistence_policy.sql +471 -0
- package/drizzle/0238_recover_unclaimed_session_turns.sql +307 -0
- package/drizzle/0238_supergrok_realtime_model.sql +29 -0
- package/drizzle/0239_supergrok_video_funding.sql +50 -0
- package/drizzle/0239_task_tree_notes.sql +990 -0
- package/package.json +13 -5
- package/src/browser-auth.ts +2600 -123
- package/src/browser-downloads.ts +517 -0
- package/src/browser-identities.ts +220 -3
- package/src/browser-sessions.ts +334 -45
- package/src/browser-state-artifacts.ts +402 -12
- package/src/canonical-human-identities.ts +317 -0
- package/src/capability-integrations.ts +121 -213
- package/src/database.ts +41 -1
- package/src/index.ts +4625 -411
- package/src/insights.ts +109 -28
- package/src/integration-bindings.ts +101 -101
- package/src/{integration-features.ts → integration-facets.ts} +187 -184
- package/src/interaction-revisions.ts +33 -3
- package/src/interaction-schema.ts +311 -8
- package/src/pack-components.ts +43 -43
- package/src/pack-installations.ts +0 -43
- package/src/persistence-errors.ts +60 -1
- package/src/plugin-packages.ts +9 -9
- package/src/provision-roles.ts +232 -0
- package/src/runtime-posture.ts +227 -14
- package/src/schema.ts +1188 -75
- package/src/session-control.ts +122 -37
- package/src/session-queue-commands.ts +78 -1
- package/src/session-tenancy.ts +188 -0
- package/src/session-tool-call-settlement.ts +9 -3
- package/src/slack-task-policy-schema.ts +130 -0
- package/src/slack-task-policy.ts +341 -0
- package/src/task-notes-schema.ts +135 -0
- package/src/task-notes.ts +178 -0
- package/src/video-generation.ts +90 -12
- package/src/workspace-artifacts.ts +1 -1
- package/src/xai-subscription.ts +1887 -0
- package/dist/chunk-ISI2TIUG.js.map +0 -1
- package/dist/chunk-MWDVXQOL.js.map +0 -1
- package/dist/chunk-NBE6CHRI.js.map +0 -1
- package/dist/chunk-YHZXQ7HP.js.map +0 -1
- package/dist/integration-features.d.ts +0 -99
- /package/dist/{chunk-F5FT7BEZ.js.map → chunk-HSOWSYOX.js.map} +0 -0
package/dist/insights.d.ts
CHANGED
|
@@ -115,20 +115,20 @@ export declare function sumUsageQuantityByDay(db: Database, input: {
|
|
|
115
115
|
since: Date;
|
|
116
116
|
until: Date;
|
|
117
117
|
}): Promise<Map<string, number>>;
|
|
118
|
-
export declare function
|
|
118
|
+
export declare function sumUsageQuantityByHour(db: Database, input: {
|
|
119
119
|
workspaceId: string;
|
|
120
|
+
eventType: string;
|
|
120
121
|
since: Date;
|
|
121
122
|
until: Date;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}): Promise<ModelCallFactAggregateRow[]>;
|
|
125
|
-
export declare function aggregateModelCallFactsByDay(db: Database, input: {
|
|
123
|
+
}): Promise<Map<string, number>>;
|
|
124
|
+
export declare function aggregateModelCallFacts(db: Database, input: {
|
|
126
125
|
workspaceId: string;
|
|
127
126
|
since: Date;
|
|
128
127
|
until: Date;
|
|
129
128
|
provider?: string | null;
|
|
130
129
|
model?: string | null;
|
|
131
|
-
}): Promise<
|
|
130
|
+
}): Promise<ModelCallFactAggregateRow[]>;
|
|
131
|
+
type ModelCallFactSeriesAggregate = {
|
|
132
132
|
costMicros: number;
|
|
133
133
|
estimatedProviderCostMicros: number;
|
|
134
134
|
estimatedProviderCostKnownCalls: number;
|
|
@@ -142,7 +142,21 @@ export declare function aggregateModelCallFactsByDay(db: Database, input: {
|
|
|
142
142
|
tokenKnownCalls: number;
|
|
143
143
|
cacheKnownCalls: number;
|
|
144
144
|
calls: number;
|
|
145
|
-
}
|
|
145
|
+
};
|
|
146
|
+
export declare function aggregateModelCallFactsByDay(db: Database, input: {
|
|
147
|
+
workspaceId: string;
|
|
148
|
+
since: Date;
|
|
149
|
+
until: Date;
|
|
150
|
+
provider?: string | null;
|
|
151
|
+
model?: string | null;
|
|
152
|
+
}): Promise<Map<string, ModelCallFactSeriesAggregate>>;
|
|
153
|
+
export declare function aggregateModelCallFactsByHour(db: Database, input: {
|
|
154
|
+
workspaceId: string;
|
|
155
|
+
since: Date;
|
|
156
|
+
until: Date;
|
|
157
|
+
provider?: string | null;
|
|
158
|
+
model?: string | null;
|
|
159
|
+
}): Promise<Map<string, ModelCallFactSeriesAggregate>>;
|
|
146
160
|
export declare function aggregateWarmSecondsByGroup(db: Database, input: InsightsTimeWindow & {
|
|
147
161
|
workspaceId: string;
|
|
148
162
|
limit?: number;
|
|
@@ -187,6 +201,7 @@ export declare function aggregateSessionDepth(db: Database, workspaceId: string)
|
|
|
187
201
|
export declare function listFloorSessions(db: Database, workspaceId: string, limit?: number): Promise<FloorSessionRow[]>;
|
|
188
202
|
export declare function countOnlineMachines(db: Database, workspaceId: string, heartbeatFreshMs: number, now?: Date): Promise<number>;
|
|
189
203
|
export declare function enumerateUtcDays(since: Date, until: Date): string[];
|
|
204
|
+
export declare function enumerateUtcHours(since: Date, until: Date): string[];
|
|
190
205
|
/**
|
|
191
206
|
* Idempotent YTD backfill from authoritative agent.model.usage into model_call_facts.
|
|
192
207
|
* Never rewrites billing rows or existing live facts (onConflictDoNothing).
|
|
@@ -202,3 +217,4 @@ export declare function backfillModelCallFactsFromSessionEvents(db: Database, in
|
|
|
202
217
|
considered: number;
|
|
203
218
|
upserted: number;
|
|
204
219
|
}>;
|
|
220
|
+
export {};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
1
|
import type { Database } from "./database.js";
|
|
2
2
|
import * as schema from "./schema.js";
|
|
3
|
-
export type
|
|
3
|
+
export type IntegrationFacetBindingOwner = {
|
|
4
4
|
kind: "direct" | "plugin" | "pack" | "migration";
|
|
5
5
|
id: string;
|
|
6
6
|
removable: boolean;
|
|
7
7
|
};
|
|
8
|
-
export type
|
|
8
|
+
export type UpsertIntegrationFacetBindingInput = {
|
|
9
9
|
accountId: string;
|
|
10
10
|
workspaceId: string;
|
|
11
11
|
integrationFacetInstallationId: string;
|
|
12
|
-
|
|
12
|
+
facetDefinitionId: string;
|
|
13
13
|
bindingKey: string;
|
|
14
14
|
displayName: string;
|
|
15
15
|
runtimeKey?: string | null;
|
|
16
16
|
connectionId?: string | null;
|
|
17
17
|
config: Record<string, unknown>;
|
|
18
18
|
createdBySubjectId: string;
|
|
19
|
-
owner:
|
|
19
|
+
owner: IntegrationFacetBindingOwner;
|
|
20
20
|
expectedVersion?: number;
|
|
21
21
|
};
|
|
22
|
-
export declare class
|
|
22
|
+
export declare class IntegrationFacetBindingVersionConflictError extends Error {
|
|
23
23
|
readonly bindingKey: string;
|
|
24
24
|
readonly expectedVersion: number;
|
|
25
25
|
readonly actualVersion: number;
|
|
26
|
-
readonly name = "
|
|
26
|
+
readonly name = "IntegrationFacetBindingVersionConflictError";
|
|
27
27
|
constructor(bindingKey: string, expectedVersion: number, actualVersion: number);
|
|
28
28
|
}
|
|
29
|
-
export declare class
|
|
30
|
-
readonly name = "
|
|
29
|
+
export declare class IntegrationFacetBindingVersionRequiredError extends Error {
|
|
30
|
+
readonly name = "IntegrationFacetBindingVersionRequiredError";
|
|
31
31
|
}
|
|
32
|
-
export declare class
|
|
33
|
-
readonly name = "
|
|
32
|
+
export declare class IntegrationFacetBindingOwnershipConflictError extends Error {
|
|
33
|
+
readonly name = "IntegrationFacetBindingOwnershipConflictError";
|
|
34
34
|
}
|
|
35
35
|
export declare function integrationBindingKey(connectionId: string | null | undefined, requested?: string | null): string;
|
|
36
36
|
export declare function integrationRuntimeKey(baseServerId: string, bindingKey: string): string;
|
|
37
|
-
export declare function
|
|
37
|
+
export declare function ensureIntegrationFacetDefinition(db: Database, input: {
|
|
38
38
|
integrationFacetId: string;
|
|
39
|
-
|
|
39
|
+
facetKey: string;
|
|
40
40
|
kind: "tools" | "knowledge_source" | "inbound_trigger" | "delivery_destination" | "identity_link";
|
|
41
41
|
configSchema?: Record<string, unknown>;
|
|
42
42
|
capabilities?: Record<string, unknown>;
|
|
43
|
-
}): Promise<typeof schema.
|
|
44
|
-
export declare function
|
|
45
|
-
row: typeof schema.
|
|
43
|
+
}): Promise<typeof schema.integrationFacetDefinitions.$inferSelect>;
|
|
44
|
+
export declare function upsertIntegrationFacetBinding(db: Database, input: UpsertIntegrationFacetBindingInput): Promise<{
|
|
45
|
+
row: typeof schema.integrationFacetBindings.$inferSelect;
|
|
46
46
|
changed: boolean;
|
|
47
47
|
}>;
|
|
48
|
-
export declare function
|
|
49
|
-
export declare function
|
|
48
|
+
export declare function listIntegrationFacetBindingOwners(db: Database, bindingId: string): Promise<IntegrationFacetBindingOwner[]>;
|
|
49
|
+
export declare function removeIntegrationFacetBindingOwner(db: Database, input: {
|
|
50
50
|
workspaceId: string;
|
|
51
51
|
bindingId: string;
|
|
52
|
-
owner: Pick<
|
|
52
|
+
owner: Pick<IntegrationFacetBindingOwner, "kind" | "id">;
|
|
53
53
|
expectedVersion?: number;
|
|
54
54
|
}): Promise<{
|
|
55
|
-
binding: typeof schema.
|
|
56
|
-
remainingOwners:
|
|
55
|
+
binding: typeof schema.integrationFacetBindings.$inferSelect | null;
|
|
56
|
+
remainingOwners: IntegrationFacetBindingOwner[];
|
|
57
57
|
}>;
|
|
58
|
-
export declare function
|
|
58
|
+
export declare function removeIntegrationFacetBindingOwnersForOwner(db: Database, input: {
|
|
59
59
|
workspaceId: string;
|
|
60
|
-
owner: Pick<
|
|
60
|
+
owner: Pick<IntegrationFacetBindingOwner, "kind" | "id">;
|
|
61
61
|
}): Promise<{
|
|
62
62
|
disabledBindingIds: string[];
|
|
63
63
|
retainedBindingIds: string[];
|
|
@@ -65,6 +65,6 @@ export declare function removeIntegrationFeatureBindingOwnersForOwner(db: Databa
|
|
|
65
65
|
export declare function integrationDefinitionHasBindingOwner(db: Database, input: {
|
|
66
66
|
workspaceId: string;
|
|
67
67
|
pluginInstallationId: string;
|
|
68
|
-
owner: Pick<
|
|
68
|
+
owner: Pick<IntegrationFacetBindingOwner, "kind" | "id">;
|
|
69
69
|
}): Promise<boolean>;
|
|
70
|
-
export declare function
|
|
70
|
+
export declare function addIntegrationFacetBindingOwner(db: Database, bindingId: string, input: Pick<UpsertIntegrationFacetBindingInput, "accountId" | "workspaceId" | "owner">): Promise<void>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type Database } from "./database.js";
|
|
2
|
+
export type IntegrationFacetKind = "knowledge_source" | "inbound_trigger" | "delivery_destination" | "identity_link";
|
|
3
|
+
export type IntegrationFacetBindingSummary = {
|
|
4
|
+
id: string;
|
|
5
|
+
facetKey: string;
|
|
6
|
+
kind: IntegrationFacetKind;
|
|
7
|
+
bindingKey: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
connectionId: string | null;
|
|
10
|
+
status: "active" | "paused" | "needs_attention" | "disabled";
|
|
11
|
+
config: Record<string, unknown>;
|
|
12
|
+
version: number;
|
|
13
|
+
hasCursor: boolean;
|
|
14
|
+
lastSuccessAt: string | null;
|
|
15
|
+
lastErrorCode: string | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
};
|
|
19
|
+
export type IntegrationFacetDefinitionSummary = {
|
|
20
|
+
facetKey: string;
|
|
21
|
+
kind: IntegrationFacetKind;
|
|
22
|
+
configSchema: Record<string, unknown>;
|
|
23
|
+
capabilities: Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
export type IntegrationInstanceFacets = {
|
|
26
|
+
capabilityId: string;
|
|
27
|
+
instanceKey: string;
|
|
28
|
+
providerDomain: string;
|
|
29
|
+
connectionId: string | null;
|
|
30
|
+
facets: {
|
|
31
|
+
definition: IntegrationFacetDefinitionSummary;
|
|
32
|
+
binding: IntegrationFacetBindingSummary | null;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
export type IntegrationFacetMutationResult = {
|
|
36
|
+
capabilityId: string;
|
|
37
|
+
instanceKey: string;
|
|
38
|
+
facetKey: string;
|
|
39
|
+
status: "configured" | "paused" | "active";
|
|
40
|
+
binding: IntegrationFacetBindingSummary;
|
|
41
|
+
};
|
|
42
|
+
export type IntegrationFacetRemovalResult = {
|
|
43
|
+
capabilityId: string;
|
|
44
|
+
instanceKey: string;
|
|
45
|
+
facetKey: string;
|
|
46
|
+
status: "not_configured" | "removed" | "retained_by_other_owners";
|
|
47
|
+
binding: IntegrationFacetBindingSummary | null;
|
|
48
|
+
remainingOwners: {
|
|
49
|
+
kind: "direct" | "plugin" | "pack" | "migration";
|
|
50
|
+
id: string;
|
|
51
|
+
removable: boolean;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export declare class IntegrationFacetNotFoundError extends Error {
|
|
55
|
+
readonly name = "IntegrationFacetNotFoundError";
|
|
56
|
+
}
|
|
57
|
+
export declare class IntegrationFacetConnectionError extends Error {
|
|
58
|
+
readonly name = "IntegrationFacetConnectionError";
|
|
59
|
+
}
|
|
60
|
+
export declare class IntegrationFacetConfigError extends Error {
|
|
61
|
+
readonly name = "IntegrationFacetConfigError";
|
|
62
|
+
}
|
|
63
|
+
export declare class IntegrationFacetOperationIdempotencyError extends Error {
|
|
64
|
+
readonly name = "IntegrationFacetOperationIdempotencyError";
|
|
65
|
+
}
|
|
66
|
+
export declare function listIntegrationInstanceFacets(db: Database, workspaceId: string, subjectId: string, capabilityId: string, instanceKey: string): Promise<IntegrationInstanceFacets>;
|
|
67
|
+
export declare function configureIntegrationFacet(db: Database, input: {
|
|
68
|
+
accountId: string;
|
|
69
|
+
workspaceId: string;
|
|
70
|
+
subjectId: string;
|
|
71
|
+
capabilityId: string;
|
|
72
|
+
instanceKey: string;
|
|
73
|
+
facetKey: string;
|
|
74
|
+
displayName: string;
|
|
75
|
+
config: Record<string, unknown>;
|
|
76
|
+
expectedVersion?: number;
|
|
77
|
+
idempotencyKey: string;
|
|
78
|
+
}): Promise<IntegrationFacetMutationResult>;
|
|
79
|
+
export declare function setIntegrationFacetLifecycle(db: Database, input: {
|
|
80
|
+
accountId: string;
|
|
81
|
+
workspaceId: string;
|
|
82
|
+
subjectId: string;
|
|
83
|
+
capabilityId: string;
|
|
84
|
+
instanceKey: string;
|
|
85
|
+
facetKey: string;
|
|
86
|
+
action: "pause" | "resume";
|
|
87
|
+
expectedVersion: number;
|
|
88
|
+
idempotencyKey: string;
|
|
89
|
+
}): Promise<IntegrationFacetMutationResult>;
|
|
90
|
+
export declare function removeIntegrationFacet(db: Database, input: {
|
|
91
|
+
accountId: string;
|
|
92
|
+
workspaceId: string;
|
|
93
|
+
subjectId: string;
|
|
94
|
+
capabilityId: string;
|
|
95
|
+
instanceKey: string;
|
|
96
|
+
facetKey: string;
|
|
97
|
+
expectedVersion: number;
|
|
98
|
+
idempotencyKey: string;
|
|
99
|
+
}): Promise<IntegrationFacetRemovalResult>;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { type Database } from "./database.js";
|
|
2
2
|
export declare function advanceWorkspaceInteractionRevision(db: Database, accountId: string, workspaceId: string): Promise<number>;
|
|
3
3
|
export declare function readWorkspaceInteractionRevision(db: Database, workspaceId: string): Promise<number>;
|
|
4
|
+
export type WorkspaceInteractionRevisionState = {
|
|
5
|
+
revision: number;
|
|
6
|
+
updatedAt: Date | null;
|
|
7
|
+
};
|
|
8
|
+
/** Read the latest cursor while already inside the workspace RLS boundary. */
|
|
9
|
+
export declare function readWorkspaceInteractionRevisionState(db: Database, workspaceId: string): Promise<WorkspaceInteractionRevisionState>;
|
|
10
|
+
/** Standalone tenant-scoped cursor read used by the workspace SSE projection. */
|
|
11
|
+
export declare function getWorkspaceInteractionRevisionState(db: Database, input: {
|
|
12
|
+
accountId: string;
|
|
13
|
+
workspaceId: string;
|
|
14
|
+
}): Promise<WorkspaceInteractionRevisionState>;
|