@opengeni/db 1.3.0 → 1.4.2
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-reconciliation.js +2 -2
- package/dist/{chunk-7QWWTVYH.js → chunk-5ROHLEN6.js} +29 -4
- package/dist/chunk-5ROHLEN6.js.map +1 -0
- package/dist/{chunk-AQMH2ZEH.js → chunk-A4J7EECR.js} +2 -2
- package/dist/{chunk-VQX54TK3.js → chunk-B5C5SBSI.js} +3 -3
- package/dist/{chunk-OI6YZXTU.js → chunk-DKFEUGM4.js} +2 -2
- package/dist/{chunk-HYBQABBJ.js → chunk-HUKBIZGH.js} +2 -2
- package/dist/{chunk-LRSIODCQ.js → chunk-IT3EYY2C.js} +6 -4
- package/dist/{chunk-LRSIODCQ.js.map → chunk-IT3EYY2C.js.map} +1 -1
- package/dist/{chunk-DSNEIW5E.js → chunk-JL6TBB76.js} +2 -1
- package/dist/chunk-JL6TBB76.js.map +1 -0
- package/dist/{chunk-OEFNTGR3.js → chunk-JWBEE4CL.js} +4 -4
- package/dist/{chunk-BRVBLQAL.js → chunk-K5MTNKJU.js} +4 -4
- package/dist/{chunk-6UKNJ43T.js → chunk-NZ2SP55O.js} +2 -2
- package/dist/{chunk-3XHC5KC5.js → chunk-OKCBARX6.js} +2 -2
- package/dist/{chunk-PNWWNEDM.js → chunk-OV5AUIBA.js} +2 -2
- package/dist/{chunk-BID3CNN3.js → chunk-TODVDGMO.js} +36 -18
- package/dist/{chunk-BID3CNN3.js.map → chunk-TODVDGMO.js.map} +1 -1
- package/dist/{chunk-6S5T6FSP.js → chunk-W75DRYG3.js} +5 -5
- package/dist/{chunk-7S3O33NM.js → chunk-Y72DP3JF.js} +2 -2
- package/dist/codemode-approvals.d.ts +7 -1
- package/dist/connect-attempts.js +3 -3
- package/dist/connection-metadata.d.ts +416 -0
- package/dist/credit-balances.d.ts +25 -4
- package/dist/database.d.ts +7 -1
- package/dist/editable-artifact-durable-export.js +2 -2
- package/dist/editable-artifacts.js +3 -3
- package/dist/index.d.ts +51 -8
- package/dist/index.js +10826 -10129
- package/dist/index.js.map +1 -1
- package/dist/legacy-tool-action-reviews.d.ts +75 -0
- package/dist/managed-auth-session-sets.js +3 -3
- package/dist/mcp-operations.js +2 -2
- package/dist/modal-native-live-origin.d.ts +75 -0
- package/dist/organization-integration-policy.js +3 -3
- package/dist/organization-slack-bots.d.ts +1 -1
- package/dist/provision-roles.js +1 -1
- package/dist/retained-provider-commands.d.ts +21 -21
- package/dist/retained-provider-commands.js +6 -6
- package/dist/runtime-posture.d.ts +1 -1
- package/dist/sandbox-interaction-idle.d.ts +22 -0
- package/dist/schema.js +1 -1
- package/dist/session-background-commands.js +4 -4
- package/dist/session-command-output.js +5 -5
- package/dist/session-event-slices.js +3 -3
- package/dist/session-mcp-credential-rotation.js +5 -5
- package/dist/session-realtime-billing.d.ts +48 -0
- package/dist/session-realtime.d.ts +8 -2
- package/dist/session-tenancy.js +3 -3
- package/dist/video-generation.js +3 -3
- package/dist/voice-transcription-settlement.d.ts +36 -0
- package/dist/workspace-tool-defaults.js +4 -4
- package/drizzle/0623_voice_transcription_attribution.sql +128 -0
- package/drizzle/0624_azure_live_realtime_model.sql +30 -0
- package/drizzle/0625_transcription_billing_refusal_codes.sql +29 -0
- package/drizzle/0632_modal_native_live_origin.sql +239 -0
- package/package.json +7 -7
- package/src/codemode-approvals.ts +52 -22
- package/src/codemode-operations.ts +198 -181
- package/src/connection-metadata.ts +166 -0
- package/src/credit-balances.ts +58 -17
- package/src/database.ts +9 -0
- package/src/index.ts +540 -412
- package/src/insights-unified.ts +2 -1
- package/src/legacy-tool-action-reviews.ts +242 -0
- package/src/modal-native-live-origin.ts +148 -0
- package/src/organization-slack-bots.ts +1 -1
- package/src/provision-roles.ts +12 -0
- package/src/runtime-posture.ts +32 -3
- package/src/sandbox-interaction-idle.ts +91 -0
- package/src/schema.ts +1 -0
- package/src/session-realtime-billing.ts +135 -0
- package/src/session-realtime-ledger.ts +9 -4
- package/src/session-realtime.ts +20 -2
- package/src/tool-action-reviews.ts +129 -18
- package/src/transcription-recordings.ts +3 -1
- package/src/voice-transcription-settlement.ts +94 -0
- package/dist/chunk-7QWWTVYH.js.map +0 -1
- package/dist/chunk-DSNEIW5E.js.map +0 -1
- /package/dist/{chunk-AQMH2ZEH.js.map → chunk-A4J7EECR.js.map} +0 -0
- /package/dist/{chunk-VQX54TK3.js.map → chunk-B5C5SBSI.js.map} +0 -0
- /package/dist/{chunk-OI6YZXTU.js.map → chunk-DKFEUGM4.js.map} +0 -0
- /package/dist/{chunk-HYBQABBJ.js.map → chunk-HUKBIZGH.js.map} +0 -0
- /package/dist/{chunk-OEFNTGR3.js.map → chunk-JWBEE4CL.js.map} +0 -0
- /package/dist/{chunk-BRVBLQAL.js.map → chunk-K5MTNKJU.js.map} +0 -0
- /package/dist/{chunk-6UKNJ43T.js.map → chunk-NZ2SP55O.js.map} +0 -0
- /package/dist/{chunk-3XHC5KC5.js.map → chunk-OKCBARX6.js.map} +0 -0
- /package/dist/{chunk-PNWWNEDM.js.map → chunk-OV5AUIBA.js.map} +0 -0
- /package/dist/{chunk-6S5T6FSP.js.map → chunk-W75DRYG3.js.map} +0 -0
- /package/dist/{chunk-7S3O33NM.js.map → chunk-Y72DP3JF.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cancelUnacceptedVideoGenerationsForToolCallsInTransaction
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TODVDGMO.js";
|
|
4
4
|
import {
|
|
5
5
|
external_exports
|
|
6
6
|
} from "./chunk-4UJCXBR2.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
withSessionActivityRlsContext,
|
|
15
15
|
withWorkspaceRls,
|
|
16
16
|
withWorkspaceSubjectRls
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IT3EYY2C.js";
|
|
18
18
|
import {
|
|
19
19
|
auditEvents,
|
|
20
20
|
codexCapacityWaiters,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
workspaceInferenceControls,
|
|
43
43
|
workspaceMemberships,
|
|
44
44
|
workspaces
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-JL6TBB76.js";
|
|
46
46
|
import {
|
|
47
47
|
LOSSLESS_CONTENT_CODEC_VERSION,
|
|
48
48
|
fromPostgresLosslessJson,
|
|
@@ -6449,4 +6449,4 @@ export {
|
|
|
6449
6449
|
setWorkspacePauseTimerInTransaction,
|
|
6450
6450
|
fireWorkspacePauseTimerInTransaction
|
|
6451
6451
|
};
|
|
6452
|
-
//# sourceMappingURL=chunk-
|
|
6452
|
+
//# sourceMappingURL=chunk-JWBEE4CL.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
lockSessionEventWriteRows
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JWBEE4CL.js";
|
|
4
4
|
import {
|
|
5
5
|
withSessionActivityRlsContext
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-IT3EYY2C.js";
|
|
7
7
|
import {
|
|
8
8
|
sandboxRetainedProcesses,
|
|
9
9
|
sessionBackgroundCommands,
|
|
10
10
|
sessionEvents,
|
|
11
11
|
sessions
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JL6TBB76.js";
|
|
13
13
|
import {
|
|
14
14
|
fromPostgresLosslessJson,
|
|
15
15
|
withLosslessContentWriteVersion
|
|
@@ -140,4 +140,4 @@ async function appendSessionCommandOutput(db, input) {
|
|
|
140
140
|
export {
|
|
141
141
|
appendSessionCommandOutput
|
|
142
142
|
};
|
|
143
|
-
//# sourceMappingURL=chunk-
|
|
143
|
+
//# sourceMappingURL=chunk-K5MTNKJU.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
nestedPostgresSqlState,
|
|
3
3
|
rawRows
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IT3EYY2C.js";
|
|
5
5
|
|
|
6
6
|
// src/canonical-human-identities.ts
|
|
7
7
|
import { createHash } from "crypto";
|
|
@@ -318,4 +318,4 @@ export {
|
|
|
318
318
|
getCanonicalHumanIdentityProjection,
|
|
319
319
|
applyCanonicalHumanIdentityOperation
|
|
320
320
|
};
|
|
321
|
-
//# sourceMappingURL=chunk-
|
|
321
|
+
//# sourceMappingURL=chunk-NZ2SP55O.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
rawRows,
|
|
3
3
|
withRlsContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IT3EYY2C.js";
|
|
5
5
|
|
|
6
6
|
// src/editable-artifacts.ts
|
|
7
7
|
import { createHash } from "crypto";
|
|
@@ -3592,4 +3592,4 @@ export {
|
|
|
3592
3592
|
PostgresEditableArtifactLiveReadStore,
|
|
3593
3593
|
transactionallyAuthorizeEditableArtifactActor
|
|
3594
3594
|
};
|
|
3595
|
-
//# sourceMappingURL=chunk-
|
|
3595
|
+
//# sourceMappingURL=chunk-OKCBARX6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setSubjectRlsContext,
|
|
3
3
|
withRlsContext
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IT3EYY2C.js";
|
|
5
5
|
|
|
6
6
|
// src/connection-token-resolver.ts
|
|
7
7
|
import { normalizeSlackScopes, OFFICIAL_SLACK_MCP_URL } from "@opengeni/contracts/slack-rest-mcp";
|
|
@@ -857,4 +857,4 @@ export {
|
|
|
857
857
|
refreshOAuthConnectionCredential,
|
|
858
858
|
isPrivateAddress
|
|
859
859
|
};
|
|
860
|
-
//# sourceMappingURL=chunk-
|
|
860
|
+
//# sourceMappingURL=chunk-OV5AUIBA.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
withAccountRls,
|
|
8
8
|
withRlsContext,
|
|
9
9
|
withWorkspaceRls
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IT3EYY2C.js";
|
|
11
11
|
import {
|
|
12
12
|
connections,
|
|
13
13
|
creditDebitAllocations,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
workspaceVideoGenerationPolicies,
|
|
21
21
|
workspaceVideoGenerationQuotas,
|
|
22
22
|
workspaces
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-JL6TBB76.js";
|
|
24
24
|
|
|
25
25
|
// src/video-generation.ts
|
|
26
26
|
import {
|
|
@@ -345,7 +345,8 @@ async function getBillingBalance(db, accountId, policyRevision) {
|
|
|
345
345
|
else policy->'offers'->(g.metadata->>'creditOfferId')->'eligibleModelIds' end,
|
|
346
346
|
policy->'defaultModelIds'
|
|
347
347
|
) from current_policy), to_jsonb(g.eligible_model_ids)),
|
|
348
|
-
'remainingMicros', g.amount_micros - coalesce(used.amount, 0)
|
|
348
|
+
'remainingMicros', g.amount_micros - coalesce(used.amount, 0),
|
|
349
|
+
'coversVoice', g.source_type = 'verified_signup_trial'
|
|
349
350
|
) order by g.created_at, g.id)
|
|
350
351
|
from ${creditLedgerEntries} g
|
|
351
352
|
left join (
|
|
@@ -371,30 +372,45 @@ async function getBillingBalance(db, accountId, policyRevision) {
|
|
|
371
372
|
};
|
|
372
373
|
});
|
|
373
374
|
}
|
|
374
|
-
|
|
375
|
+
var VOICE_CREDIT_USAGE = Object.freeze({ kind: "voice" });
|
|
376
|
+
function grantCovers(grant, usage) {
|
|
377
|
+
if (!usage) return false;
|
|
378
|
+
if (typeof usage === "string") return grant.eligibleModelIds.includes(usage);
|
|
379
|
+
return grant.coversVoice === true;
|
|
380
|
+
}
|
|
381
|
+
function spendableCreditMicros(balance, usage) {
|
|
375
382
|
return Math.max(0, balance.generalBalanceMicros ?? balance.balanceMicros) + (balance.promotionalCredits ?? []).reduce(
|
|
376
|
-
(sum, grant) => sum + (
|
|
383
|
+
(sum, grant) => sum + (grantCovers(grant, usage) ? grant.remainingMicros : 0),
|
|
377
384
|
0
|
|
378
385
|
);
|
|
379
386
|
}
|
|
380
|
-
async function getSpendableCreditBalance(db, accountId,
|
|
387
|
+
async function getSpendableCreditBalance(db, accountId, usage, policyRevision) {
|
|
381
388
|
const balance = await getBillingBalance(db, accountId, policyRevision);
|
|
382
|
-
return { ...balance, balanceMicros: spendableCreditMicros(balance,
|
|
389
|
+
return { ...balance, balanceMicros: spendableCreditMicros(balance, usage) };
|
|
390
|
+
}
|
|
391
|
+
function allocateToCoveringGrants(balance, amountMicros, usage) {
|
|
392
|
+
let remaining = amountMicros;
|
|
393
|
+
const allocations = [];
|
|
394
|
+
for (const grant of balance.promotionalCredits ?? []) {
|
|
395
|
+
if (!remaining || !grantCovers(grant, usage) || grant.remainingMicros <= 0) continue;
|
|
396
|
+
const allocated = Math.min(remaining, grant.remainingMicros);
|
|
397
|
+
allocations.push({ grantEntryId: grant.grantId, amountMicros: allocated });
|
|
398
|
+
remaining -= allocated;
|
|
399
|
+
}
|
|
400
|
+
return allocations;
|
|
383
401
|
}
|
|
384
|
-
function planCreditDebit(balance, requestedMicros,
|
|
402
|
+
function planCreditDebit(balance, requestedMicros, usage) {
|
|
385
403
|
if (!Number.isSafeInteger(requestedMicros) || requestedMicros <= 0) {
|
|
386
404
|
throw new Error("credit debit requires a positive, safe integer micro amount");
|
|
387
405
|
}
|
|
388
|
-
const debitedMicros = Math.min(requestedMicros, spendableCreditMicros(balance,
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
allocations.push({ grantEntryId: grant.grantId, amountMicros });
|
|
395
|
-
remaining -= amountMicros;
|
|
406
|
+
const debitedMicros = Math.min(requestedMicros, spendableCreditMicros(balance, usage));
|
|
407
|
+
return { debitedMicros, allocations: allocateToCoveringGrants(balance, debitedMicros, usage) };
|
|
408
|
+
}
|
|
409
|
+
function planPostUseCreditAllocations(balance, amountMicros, usage) {
|
|
410
|
+
if (!Number.isSafeInteger(amountMicros) || amountMicros <= 0) {
|
|
411
|
+
throw new Error("credit debit requires a positive, safe integer micro amount");
|
|
396
412
|
}
|
|
397
|
-
return
|
|
413
|
+
return allocateToCoveringGrants(balance, amountMicros, usage);
|
|
398
414
|
}
|
|
399
415
|
|
|
400
416
|
// src/video-generation.ts
|
|
@@ -1378,9 +1394,11 @@ export {
|
|
|
1378
1394
|
checkWorkspaceAllowance,
|
|
1379
1395
|
maintainWorkspaceAllowances,
|
|
1380
1396
|
getBillingBalance,
|
|
1397
|
+
VOICE_CREDIT_USAGE,
|
|
1381
1398
|
spendableCreditMicros,
|
|
1382
1399
|
getSpendableCreditBalance,
|
|
1383
1400
|
planCreditDebit,
|
|
1401
|
+
planPostUseCreditAllocations,
|
|
1384
1402
|
ACTIVE_VIDEO_GENERATION_STATUSES,
|
|
1385
1403
|
VideoGenerationConflictError,
|
|
1386
1404
|
VideoGenerationCapacityError,
|
|
@@ -1412,4 +1430,4 @@ export {
|
|
|
1412
1430
|
mediaGenerationResultForStoredOperation,
|
|
1413
1431
|
getVideoGenerationOperationSummary
|
|
1414
1432
|
};
|
|
1415
|
-
//# sourceMappingURL=chunk-
|
|
1433
|
+
//# sourceMappingURL=chunk-TODVDGMO.js.map
|