@opengeni/db 4.1.0-canary.1 → 4.2.1-canary.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/dist/canonical-human-identities.js +3 -3
- package/dist/capability-components.d.ts +3 -1
- package/dist/{chunk-F2VG7ILA.js → chunk-6GAPAYZR.js} +28 -9
- package/dist/chunk-6GAPAYZR.js.map +1 -0
- package/dist/{chunk-Z66B7JIE.js → chunk-6IQ4X35Y.js} +45 -1
- package/dist/chunk-6IQ4X35Y.js.map +1 -0
- package/dist/{chunk-4LUKL2R5.js → chunk-6Y7ZDVJ5.js} +2 -2
- package/dist/{chunk-L6T3C3BX.js → chunk-7WX3R3YL.js} +2 -2
- package/dist/{chunk-Y7SWJ4YB.js → chunk-B2KR3TEM.js} +2 -2
- package/dist/{chunk-Q243OJLS.js → chunk-FPTI4NP4.js} +2 -2
- package/dist/{chunk-7YZP2CSL.js → chunk-GSBONN55.js} +237 -2
- package/dist/chunk-GSBONN55.js.map +1 -0
- package/dist/{chunk-WBET5ILT.js → chunk-MGVOYVPS.js} +3 -3
- package/dist/{chunk-E54YFFFC.js → chunk-S4Y42VSX.js} +4479 -4378
- package/dist/chunk-S4Y42VSX.js.map +1 -0
- package/dist/{chunk-BTFNF27P.js → chunk-SNLIKELL.js} +2 -2
- package/dist/company-profile-schema.d.ts +14 -0
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +78 -9
- package/dist/index.js +16687 -15679
- package/dist/index.js.map +1 -1
- package/dist/lossless-columns.d.ts +27 -0
- package/dist/managed-auth-session-sets.js +3 -3
- package/dist/migrate.d.ts +2 -0
- package/dist/migrate.js +3 -1
- package/dist/pack-components.d.ts +8 -2
- package/dist/plugin-packages.d.ts +10 -2
- package/dist/preference-registry-schema.d.ts +44 -2
- package/dist/preference-registry.d.ts +15 -15
- package/dist/provision-roles.js +1 -1
- package/dist/retained-provider-commands.d.ts +64 -0
- package/dist/retained-provider-commands.js +106 -0
- package/dist/retained-provider-commands.js.map +1 -0
- package/dist/runtime-posture.d.ts +4 -4
- package/dist/schema.d.ts +178 -10
- package/dist/schema.js +7 -1
- package/dist/session-background-commands.js +4 -4
- package/dist/session-command-output.js +4 -4
- package/dist/session-event-slices.js +2 -2
- package/dist/session-tenancy.js +3 -3
- package/dist/skill-config-migration.d.ts +8 -0
- package/dist/skill-metadata-migration.d.ts +15 -0
- package/dist/skill-publication.d.ts +6 -0
- package/dist/skill-source-release.d.ts +23 -0
- package/dist/skills-schema.d.ts +431 -0
- package/dist/skills.d.ts +55 -0
- package/dist/transcription-recordings.d.ts +4 -0
- package/dist/video-generation.js +3 -3
- package/dist/workspace-tool-defaults.js +4 -4
- package/drizzle/0430_session_personal_variable_set_continuations.sql +35 -0
- package/drizzle/0431_retained_provider_commands.sql +19 -0
- package/drizzle/0432_xai_disconnect_session_pins.sql +79 -0
- package/drizzle/0433_unified_skill_lifecycle.sql +869 -0
- package/drizzle/0434_ordered_model_history.sql +95 -0
- package/drizzle/0435_skill_chat_confirmation.sql +304 -0
- package/drizzle/0436_unobservable_command_idle_drain.sql +62 -0
- package/package.json +10 -6
- package/src/automations.ts +6 -5
- package/src/capability-components.ts +22 -4
- package/src/company-brain-governed-writes.ts +5 -0
- package/src/index.ts +952 -213
- package/src/lossless-columns.ts +13 -0
- package/src/migrate.ts +28 -2
- package/src/pack-components.ts +19 -6
- package/src/pack-installations.ts +69 -5
- package/src/plugin-packages.ts +97 -8
- package/src/preference-registry-schema.ts +2 -0
- package/src/preference-registry.ts +1 -0
- package/src/provision-roles.ts +13 -0
- package/src/retained-provider-commands.ts +167 -0
- package/src/runtime-posture.ts +34 -0
- package/src/schema.ts +36 -5
- package/src/session-background-commands.ts +29 -4
- package/src/skill-config-migration.ts +180 -0
- package/src/skill-metadata-migration.ts +90 -0
- package/src/skill-publication.ts +35 -0
- package/src/skill-source-release.ts +125 -0
- package/src/skills-schema.ts +63 -0
- package/src/skills.ts +382 -0
- package/src/transcription-recordings.ts +9 -0
- package/dist/chunk-7YZP2CSL.js.map +0 -1
- package/dist/chunk-E54YFFFC.js.map +0 -1
- package/dist/chunk-F2VG7ILA.js.map +0 -1
- package/dist/chunk-Z66B7JIE.js.map +0 -1
- /package/dist/{chunk-4LUKL2R5.js.map → chunk-6Y7ZDVJ5.js.map} +0 -0
- /package/dist/{chunk-L6T3C3BX.js.map → chunk-7WX3R3YL.js.map} +0 -0
- /package/dist/{chunk-Y7SWJ4YB.js.map → chunk-B2KR3TEM.js.map} +0 -0
- /package/dist/{chunk-Q243OJLS.js.map → chunk-FPTI4NP4.js.map} +0 -0
- /package/dist/{chunk-WBET5ILT.js.map → chunk-MGVOYVPS.js.map} +0 -0
- /package/dist/{chunk-BTFNF27P.js.map → chunk-SNLIKELL.js.map} +0 -0
|
@@ -11,9 +11,9 @@ import {
|
|
|
11
11
|
getCanonicalHumanIdentityProjection,
|
|
12
12
|
synchronizeCanonicalHumanLoginBindings,
|
|
13
13
|
validateCanonicalHumanSession
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-SNLIKELL.js";
|
|
15
|
+
import "./chunk-B2KR3TEM.js";
|
|
16
|
+
import "./chunk-S4Y42VSX.js";
|
|
17
17
|
import "./chunk-PZ5AY32C.js";
|
|
18
18
|
export {
|
|
19
19
|
CanonicalHumanIdentityAuthorityError,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { SkillActor } from "@opengeni/contracts";
|
|
1
2
|
import { sql, type SQLWrapper } from "drizzle-orm";
|
|
2
3
|
import type { Database } from "./database.js";
|
|
4
|
+
import { type SkillSourceReleaseReceipt } from "./skill-source-release.js";
|
|
3
5
|
export type CapabilityComponentOwnerIdentity = {
|
|
4
6
|
kind: "direct" | "plugin" | "pack" | "migration";
|
|
5
7
|
id: string;
|
|
@@ -34,4 +36,4 @@ export declare function assertCapabilityComponentVersionCanChange(db: Database,
|
|
|
34
36
|
* have claimed a component while its installation is pending or repairing,
|
|
35
37
|
* even though that owner is intentionally hidden from runtime reads.
|
|
36
38
|
*/
|
|
37
|
-
export declare function cleanupOrphanedCapabilityComponents(db: Database, workspaceId: string, facetInstallationIds: string[]): Promise<
|
|
39
|
+
export declare function cleanupOrphanedCapabilityComponents(db: Database, workspaceId: string, facetInstallationIds: string[], skillActor?: SkillActor): Promise<SkillSourceReleaseReceipt[]>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cancelUnacceptedVideoGenerationsForToolCallsInTransaction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MGVOYVPS.js";
|
|
4
4
|
import {
|
|
5
5
|
nestedPostgresSqlState,
|
|
6
6
|
withRlsContext,
|
|
7
7
|
withSessionActivityRlsContext
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-B2KR3TEM.js";
|
|
9
9
|
import {
|
|
10
10
|
LOSSLESS_CONTENT_CODEC_VERSION,
|
|
11
11
|
auditEvents,
|
|
@@ -32,12 +32,12 @@ import {
|
|
|
32
32
|
workspaceControlEvents,
|
|
33
33
|
workspaceInferenceControls,
|
|
34
34
|
workspaces
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-S4Y42VSX.js";
|
|
36
36
|
|
|
37
37
|
// src/session-background-commands.ts
|
|
38
38
|
import { SessionCommandFailure } from "@opengeni/contracts";
|
|
39
39
|
import { isDeepStrictEqual } from "util";
|
|
40
|
-
import { and as and4, asc as asc2, desc as desc2, eq as eq4, gte, inArray as inArray3, sql as sql4 } from "drizzle-orm";
|
|
40
|
+
import { and as and4, asc as asc2, desc as desc2, eq as eq4, getTableColumns, gte, inArray as inArray3, sql as sql4 } from "drizzle-orm";
|
|
41
41
|
|
|
42
42
|
// src/session-control.ts
|
|
43
43
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -3457,6 +3457,22 @@ function commandPreview(value) {
|
|
|
3457
3457
|
const normalized = value.replace(/\s+/g, " ").trim();
|
|
3458
3458
|
return Array.from(normalized).slice(0, 512).join("");
|
|
3459
3459
|
}
|
|
3460
|
+
var commandObservationUnavailable = sql4`
|
|
3461
|
+
${sessionBackgroundCommands.state} in ('running','stopping') and exists (
|
|
3462
|
+
select 1 from sandbox_retained_processes process
|
|
3463
|
+
where process.id = ${sessionBackgroundCommands.retainedProcessId}
|
|
3464
|
+
and process.account_id = ${sessionBackgroundCommands.accountId}
|
|
3465
|
+
and process.workspace_id = ${sessionBackgroundCommands.workspaceId}
|
|
3466
|
+
and process.session_id = ${sessionBackgroundCommands.sessionId}
|
|
3467
|
+
and process.state = 'active'
|
|
3468
|
+
and process.last_reconcile_outcome in ('process_observation_unavailable',
|
|
3469
|
+
'quarantined_process_observation_unavailable', 'provider_binding_missing',
|
|
3470
|
+
'quarantined_provider_binding_missing', 'provider_binding_mismatch',
|
|
3471
|
+
'quarantined_provider_binding_mismatch'))`;
|
|
3472
|
+
var commandReadColumns = {
|
|
3473
|
+
...getTableColumns(sessionBackgroundCommands),
|
|
3474
|
+
observationUnavailable: commandObservationUnavailable
|
|
3475
|
+
};
|
|
3460
3476
|
function mapCommand(row) {
|
|
3461
3477
|
const terminal = row.state === "exited" || row.state === "lost";
|
|
3462
3478
|
const legacyFailureCode = row.provider === "connected_machine" ? /^op_failure_([A-Za-z0-9_-]{1,128})$/.exec(row.settlementReason ?? "")?.[1] : void 0;
|
|
@@ -3474,6 +3490,7 @@ function mapCommand(row) {
|
|
|
3474
3490
|
sessionId: row.sessionId,
|
|
3475
3491
|
provider: row.provider,
|
|
3476
3492
|
state: row.state,
|
|
3493
|
+
...!terminal && row.observationUnavailable ? { observationStatus: "unavailable" } : {},
|
|
3477
3494
|
commandPreview: row.commandPreview,
|
|
3478
3495
|
cancelRequestedAt: row.cancelRequestedAt?.toISOString() ?? null,
|
|
3479
3496
|
exitCode: row.exitCode ?? null,
|
|
@@ -3494,7 +3511,8 @@ async function backgroundCommandActivityForSessions(db, input) {
|
|
|
3494
3511
|
const rows = await scopedDb.select({
|
|
3495
3512
|
sessionId: sessionBackgroundCommands.sessionId,
|
|
3496
3513
|
count: sql4`count(*)::int`,
|
|
3497
|
-
stoppingCount: sql4`count(*) filter (where ${sessionBackgroundCommands.state} = 'stopping')::int
|
|
3514
|
+
stoppingCount: sql4`count(*) filter (where ${sessionBackgroundCommands.state} = 'stopping')::int`,
|
|
3515
|
+
unavailableCount: sql4`count(*) filter (where ${commandObservationUnavailable})::int`
|
|
3498
3516
|
}).from(sessionBackgroundCommands).where(
|
|
3499
3517
|
and4(
|
|
3500
3518
|
eq4(sessionBackgroundCommands.workspaceId, input.workspaceId),
|
|
@@ -3507,7 +3525,8 @@ async function backgroundCommandActivityForSessions(db, input) {
|
|
|
3507
3525
|
row.sessionId,
|
|
3508
3526
|
{
|
|
3509
3527
|
state: Number(row.stoppingCount) > 0 ? "stopping" : "running",
|
|
3510
|
-
count: Number(row.count)
|
|
3528
|
+
count: Number(row.count),
|
|
3529
|
+
...Number(row.unavailableCount) > 0 ? { unavailableCount: Number(row.unavailableCount) } : {}
|
|
3511
3530
|
}
|
|
3512
3531
|
])
|
|
3513
3532
|
);
|
|
@@ -3519,7 +3538,7 @@ async function listSessionBackgroundCommands(db, input) {
|
|
|
3519
3538
|
db,
|
|
3520
3539
|
{ accountId: input.accountId, workspaceId: input.workspaceId },
|
|
3521
3540
|
async (scopedDb) => {
|
|
3522
|
-
const rows = await scopedDb.select().from(sessionBackgroundCommands).where(
|
|
3541
|
+
const rows = await scopedDb.select(commandReadColumns).from(sessionBackgroundCommands).where(
|
|
3523
3542
|
and4(
|
|
3524
3543
|
eq4(sessionBackgroundCommands.workspaceId, input.workspaceId),
|
|
3525
3544
|
eq4(sessionBackgroundCommands.sessionId, input.sessionId),
|
|
@@ -4022,7 +4041,7 @@ async function getSessionBackgroundCommand(db, input) {
|
|
|
4022
4041
|
db,
|
|
4023
4042
|
{ accountId: input.accountId, workspaceId: input.workspaceId },
|
|
4024
4043
|
async (scopedDb) => {
|
|
4025
|
-
const [row] = await scopedDb.select().from(sessionBackgroundCommands).where(
|
|
4044
|
+
const [row] = await scopedDb.select(commandReadColumns).from(sessionBackgroundCommands).where(
|
|
4026
4045
|
and4(
|
|
4027
4046
|
eq4(sessionBackgroundCommands.workspaceId, input.workspaceId),
|
|
4028
4047
|
eq4(sessionBackgroundCommands.sessionId, input.sessionId),
|
|
@@ -4274,4 +4293,4 @@ export {
|
|
|
4274
4293
|
setWorkspacePauseTimerInTransaction,
|
|
4275
4294
|
fireWorkspacePauseTimerInTransaction
|
|
4276
4295
|
};
|
|
4277
|
-
//# sourceMappingURL=chunk-
|
|
4296
|
+
//# sourceMappingURL=chunk-6GAPAYZR.js.map
|