deepline 0.3.366 → 0.3.368
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/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +5 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +36 -18
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +14 -6
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +69 -0
- package/dist/cli/auth-NJ6RE6XQ.js +33 -0
- package/dist/cli/{auth-TZ75C4ZF.mjs → auth-RUWM7VTH.mjs} +4 -4
- package/dist/cli/{billing-HVC2GZIO.js → billing-PLBQKLDK.js} +73 -73
- package/dist/cli/{billing-EWUOK4GO.mjs → billing-WSS57VQY.mjs} +4 -4
- package/dist/cli/{chunk-F3M4MBWP.js → chunk-27QA6Q4G.js} +224 -224
- package/dist/cli/{chunk-EHMD3F4H.js → chunk-2YOKZW46.js} +26 -26
- package/dist/cli/{chunk-Q7EHVVXL.js → chunk-7AWSYT7H.js} +117 -9
- package/dist/cli/{chunk-HWQDC632.mjs → chunk-7PQTQSJY.mjs} +111 -3
- package/dist/cli/{chunk-ACTYDJXL.mjs → chunk-A2OLR6DK.mjs} +2 -2
- package/dist/cli/{chunk-DLKBP5OO.js → chunk-AUWKAVXB.js} +54 -146
- package/dist/cli/{chunk-ZMPLBWCO.js → chunk-BKEYQHJ2.js} +50 -50
- package/dist/cli/{chunk-7CM4UYZQ.js → chunk-DZOEDNSU.js} +9 -9
- package/dist/cli/{chunk-FLDG3DHC.mjs → chunk-ENGMDXHN.mjs} +2 -2
- package/dist/cli/{chunk-HQKAEQYO.mjs → chunk-EZUGGC5A.mjs} +1 -1
- package/dist/cli/{chunk-4TTEGFR2.mjs → chunk-GHZUH33K.mjs} +1 -1
- package/dist/cli/{chunk-NL2SM3PJ.js → chunk-GJO4H3NN.js} +60 -60
- package/dist/cli/{chunk-BLVYVSKP.js → chunk-GTC2KAZQ.js} +4 -4
- package/dist/cli/{chunk-GY2CP5CD.js → chunk-HZT2Y7WB.js} +15 -15
- package/dist/cli/{chunk-B7Z67XDJ.mjs → chunk-IG7OYVS7.mjs} +6 -6
- package/dist/cli/{chunk-6IHGYDQ2.mjs → chunk-LEZWRLB3.mjs} +1 -1
- package/dist/cli/{chunk-4MW7PFKR.js → chunk-NZHVJB2W.js} +2 -2
- package/dist/cli/{chunk-CGQYV3DP.mjs → chunk-OTI7CDLE.mjs} +10 -102
- package/dist/cli/{chunk-34VVYOOS.mjs → chunk-PU53IS6H.mjs} +2 -2
- package/dist/cli/{chunk-QGOX4BEC.mjs → chunk-S3MDB6SI.mjs} +1 -1
- package/dist/cli/{chunk-HN36RO6X.js → chunk-S4Y7B2O3.js} +1 -1
- package/dist/cli/{chunk-WQU6JKI7.js → chunk-SNENR3BL.js} +6 -6
- package/dist/cli/{chunk-HGTB7UDS.mjs → chunk-THO6F53F.mjs} +1 -1
- package/dist/cli/{chunk-POZOZVP4.mjs → chunk-XUMWO4ST.mjs} +4 -4
- package/dist/cli/{chunk-R2KRYCMG.js → chunk-YCJMDCTH.js} +8 -8
- package/dist/cli/{chunk-AA27IFNY.mjs → chunk-ZS2YQ4YK.mjs} +2 -2
- package/dist/cli/{client-XGLW3H5N.mjs → client-JJEEIOIL.mjs} +3 -3
- package/dist/cli/client-UPKWYV32.js +20 -0
- package/dist/cli/{csv-CSRHORRP.mjs → csv-75D36YRA.mjs} +3 -3
- package/dist/cli/{csv-D2FZPBLE.js → csv-EPNNU27J.js} +12 -12
- package/dist/cli/{db-SMPCTNYW.mjs → db-6HYSGMLN.mjs} +4 -4
- package/dist/cli/{db-FBTYUJNE.js → db-SWNKJUU5.js} +29 -29
- package/dist/cli/{describe-O7DAHKCV.mjs → describe-N2KSBPOR.mjs} +8 -8
- package/dist/cli/{describe-YLIQOYIQ.js → describe-XMUHTICA.js} +15 -15
- package/dist/cli/{executions-5WWOQBZA.js → executions-3ESWUDHH.js} +6 -6
- package/dist/cli/{executions-3JT2QJF3.mjs → executions-WHSG2JGN.mjs} +4 -4
- package/dist/cli/{feedback-NLO2YSK4.mjs → feedback-2VHTJXU7.mjs} +3 -3
- package/dist/cli/{feedback-JM2AYBUJ.js → feedback-CGZE7L7A.js} +7 -7
- package/dist/cli/{git-SXG2PCY3.mjs → git-IG4J5OUT.mjs} +4 -4
- package/dist/cli/git-WPEOAE72.js +23 -0
- package/dist/cli/index.js +82 -82
- package/dist/cli/index.mjs +32 -32
- package/dist/cli/{legacy-noops-7FHORR7V.mjs → legacy-noops-7WXL7PB3.mjs} +4 -4
- package/dist/cli/{legacy-noops-FPP5XP4I.js → legacy-noops-QF7S6JJB.js} +7 -7
- package/dist/cli/{monitors-ZHSUOPCC.js → monitors-6XYT53X6.js} +85 -85
- package/dist/cli/{monitors-Z4R2PECQ.mjs → monitors-QS4QFORU.mjs} +4 -4
- package/dist/cli/{org-SS2INCPG.mjs → org-5IGU7FES.mjs} +4 -4
- package/dist/cli/{org-NQYIPCDY.js → org-NLR3D3M7.js} +64 -64
- package/dist/cli/play-3ECRZYD5.js +153 -0
- package/dist/cli/{play-TNMFBICT.mjs → play-JVENSY4T.mjs} +7 -7
- package/dist/cli/{providers-AXYAEJCA.mjs → providers-RSVO5U4E.mjs} +4 -4
- package/dist/cli/{providers-ZGGKKO2C.js → providers-T4GCIOTW.js} +7 -7
- package/dist/cli/{quickstart-2SLJX4FM.js → quickstart-IHAG5QZ6.js} +5 -5
- package/dist/cli/{quickstart-2O4QL5GW.mjs → quickstart-ZDFOKNYW.mjs} +3 -3
- package/dist/cli/search-RYLADJUK.js +26 -0
- package/dist/cli/{search-BM6PCZM3.mjs → search-ZGEYJSMF.mjs} +5 -5
- package/dist/cli/{secrets-US4VXQHS.js → secrets-DVTEZCPE.js} +13 -13
- package/dist/cli/{secrets-536MUJQU.mjs → secrets-OQZRZBP6.mjs} +4 -4
- package/dist/cli/{sessions-25GZ6Q77.mjs → sessions-XM7PFJL2.mjs} +4 -4
- package/dist/cli/{sessions-EBL2YYVN.js → sessions-XYEG53JJ.js} +5 -5
- package/dist/cli/{settings-LJ5JD3SD.js → settings-NWEBQOX4.js} +74 -74
- package/dist/cli/{settings-CVJFIHPL.mjs → settings-TKXYRYYH.mjs} +7 -7
- package/dist/cli/{setup-X7KWBX3R.mjs → setup-3UD5TDRJ.mjs} +6 -6
- package/dist/cli/{setup-M5CL4OR2.js → setup-JRU6VGFQ.js} +41 -41
- package/dist/cli/{skills-HQS57Z3Z.mjs → skills-GLLMNOCY.mjs} +4 -4
- package/dist/cli/skills-PZQDJJWN.js +28 -0
- package/dist/cli/{tools-RZVJKDMA.mjs → tools-VXXAMH2X.mjs} +6 -6
- package/dist/cli/tools-WYXBAUMT.js +40 -0
- package/dist/cli/{update-7EHG6ZRX.mjs → update-UCGMUUDQ.mjs} +6 -6
- package/dist/cli/update-WM6SOME3.js +28 -0
- package/dist/cli/{workflow-5D32EFY7.mjs → workflow-BGGKNZTG.mjs} +5 -5
- package/dist/cli/{workflow-6EU3N2FH.js → workflow-G2UU7WTU.js} +15 -15
- package/dist/{client-BmKft6Pr.d.mts → client-CjHv4K6D.d.mts} +8 -0
- package/dist/{client-Bra0Nc2D.d.ts → client-rTuhNN-x.d.ts} +8 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +76 -76
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
- package/dist/cli/auth-AV5JNWDX.js +0 -33
- package/dist/cli/client-XVB5TOJ3.js +0 -20
- package/dist/cli/git-7ZQJCYJA.js +0 -23
- package/dist/cli/play-6SFL4F4A.js +0 -153
- package/dist/cli/search-BNQV6EUD.js +0 -26
- package/dist/cli/skills-LSNI3TO5.js +0 -28
- package/dist/cli/tools-TPVFLJDX.js +0 -40
- package/dist/cli/update-TW3326K2.js +0 -28
|
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
|
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
202
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
203
|
-
version: '0.3.
|
|
203
|
+
version: '0.3.368',
|
|
204
204
|
updateSummary:
|
|
205
205
|
'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
|
|
206
206
|
packageCapabilities: {
|
|
@@ -171,6 +171,11 @@ export interface ToolPricingSummary {
|
|
|
171
171
|
sampleSize: number;
|
|
172
172
|
inputMode: string;
|
|
173
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* Largest single charge any call to this tool settled in the trailing
|
|
176
|
+
* window. A recorded worst case, not a rate, quote, or ceiling.
|
|
177
|
+
*/
|
|
178
|
+
observedMax?: { creditsPerCall: number; windowDays: number };
|
|
174
179
|
}
|
|
175
180
|
|
|
176
181
|
/** A discoverable provider, returned by {@link DeeplineClient.listProviders}. */
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"locator": "schedule:",
|
|
10
10
|
"owner": "product",
|
|
11
11
|
"criticality": "critical",
|
|
12
|
-
"purpose": "Run clean Sonnet/Claude Code and Luna/Codex installs from the production homepage prompt through browser claim completion and the agent
|
|
12
|
+
"purpose": "Run clean Sonnet/Claude Code and Luna/Codex installs from the production homepage prompt through browser claim completion and the agent\u2019s complete starter handoff.",
|
|
13
13
|
"successDefinition": "Both latest coding harnesses install Deepline without installation warnings or errors, finish browser authorization and setup, present all four starter choices as a card or text, and verify test key revocation; after seven valid daily runs each finishes within 240 seconds.",
|
|
14
14
|
"failureDefinition": "Either agent, browser claim completion, read-only setup verification, complete starter handoff, verified key cleanup, or the applicable timing gate fails.",
|
|
15
15
|
"startGraceMs": 900000,
|
|
@@ -1304,37 +1304,37 @@
|
|
|
1304
1304
|
{
|
|
1305
1305
|
"id": "github.credit-purchase-readiness-scan",
|
|
1306
1306
|
"name": "Credit Purchase Readiness Daily Scan",
|
|
1307
|
-
"scheduler": "
|
|
1308
|
-
"cadence": "0
|
|
1309
|
-
"timezone": "
|
|
1310
|
-
"source": "
|
|
1311
|
-
"locator": "
|
|
1307
|
+
"scheduler": "convex_cron",
|
|
1308
|
+
"cadence": "0 12 * * *",
|
|
1309
|
+
"timezone": "UTC",
|
|
1310
|
+
"source": "packages/convex/crons.ts",
|
|
1311
|
+
"locator": "credit purchase readiness daily scan",
|
|
1312
1312
|
"owner": "billing",
|
|
1313
1313
|
"criticality": "critical",
|
|
1314
|
-
"purpose": "
|
|
1315
|
-
"successDefinition": "
|
|
1316
|
-
"failureDefinition": "The scan
|
|
1314
|
+
"purpose": "Start a durable read-only credit readiness sweep; each continuation checks one workspace.",
|
|
1315
|
+
"successDefinition": "The scan intent and first page are atomically scheduled; the morning report verifies fleet completion.",
|
|
1316
|
+
"failureDefinition": "The scan cannot be started or its daily completion evidence is unavailable.",
|
|
1317
1317
|
"startGraceMs": 900000,
|
|
1318
1318
|
"runTimeoutMs": 3000000,
|
|
1319
|
-
"failureAlert": "
|
|
1319
|
+
"failureAlert": "convex_action_wrapper",
|
|
1320
1320
|
"domainReportRequired": true
|
|
1321
1321
|
},
|
|
1322
1322
|
{
|
|
1323
1323
|
"id": "github.credit-purchase-readiness-morning",
|
|
1324
1324
|
"name": "Credit Purchase Readiness Morning Report",
|
|
1325
|
-
"scheduler": "
|
|
1326
|
-
"cadence": "0
|
|
1327
|
-
"timezone": "
|
|
1328
|
-
"source": "
|
|
1329
|
-
"locator": "
|
|
1325
|
+
"scheduler": "convex_cron",
|
|
1326
|
+
"cadence": "0 13 * * *",
|
|
1327
|
+
"timezone": "UTC",
|
|
1328
|
+
"source": "packages/convex/crons.ts",
|
|
1329
|
+
"locator": "credit purchase readiness morning report",
|
|
1330
1330
|
"owner": "billing",
|
|
1331
1331
|
"criticality": "critical",
|
|
1332
|
-
"purpose": "Publish daily
|
|
1333
|
-
"successDefinition": "
|
|
1332
|
+
"purpose": "Publish daily credit readiness counts through existing Convex telemetry.",
|
|
1333
|
+
"successDefinition": "Today\u2019s complete scan is reported to Axiom; purchase defects and unknown prerequisites remain visible in Better Stack.",
|
|
1334
1334
|
"failureDefinition": "The scan or report is missing, incomplete, inaccessible, or cannot publish telemetry.",
|
|
1335
1335
|
"startGraceMs": 900000,
|
|
1336
1336
|
"runTimeoutMs": 600000,
|
|
1337
|
-
"failureAlert": "
|
|
1337
|
+
"failureAlert": "convex_action_wrapper",
|
|
1338
1338
|
"domainReportRequired": true
|
|
1339
1339
|
},
|
|
1340
1340
|
{
|
|
@@ -1354,5 +1354,23 @@
|
|
|
1354
1354
|
"runTimeoutMs": 120000,
|
|
1355
1355
|
"failureAlert": "convex_action_wrapper",
|
|
1356
1356
|
"domainReportRequired": true
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
"id": "convex.credit-purchase-readiness-page",
|
|
1360
|
+
"name": "Credit purchase readiness page",
|
|
1361
|
+
"scheduler": "convex_scheduled_action",
|
|
1362
|
+
"cadence": "runAfter previous credit readiness checkpoint",
|
|
1363
|
+
"timezone": "UTC",
|
|
1364
|
+
"source": "packages/convex/scheduledJobsNode.ts",
|
|
1365
|
+
"locator": "checkCreditReadinessPage",
|
|
1366
|
+
"owner": "billing",
|
|
1367
|
+
"criticality": "critical",
|
|
1368
|
+
"purpose": "Inspect one workspace without a payment or grant and commit a fenced aggregate checkpoint.",
|
|
1369
|
+
"successDefinition": "A read-only page is committed once with its next continuation, or a stale delivery is skipped.",
|
|
1370
|
+
"failureDefinition": "A callback or checkpoint fails; the scan remains incomplete and the daily report pages.",
|
|
1371
|
+
"startGraceMs": 120000,
|
|
1372
|
+
"runTimeoutMs": 300000,
|
|
1373
|
+
"failureAlert": "convex_action_wrapper",
|
|
1374
|
+
"domainReportRequired": true
|
|
1357
1375
|
}
|
|
1358
1376
|
]
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const MANUALLY_RUNNABLE_CONVEX_CRON_JOB_IDS = [
|
|
11
11
|
// These persisted operations ids predate the move of their clocks to Convex.
|
|
12
|
+
'github.credit-purchase-readiness-scan',
|
|
13
|
+
'github.credit-purchase-readiness-morning',
|
|
12
14
|
'inngest.play-cron-tick',
|
|
13
15
|
'convex.fold-usage-rollups',
|
|
14
16
|
'convex.cleanup-expired-org-day-usage-shards',
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts
CHANGED
|
@@ -86,7 +86,7 @@ const RUNTIME_EVENT_LOG_POSITION_EXPRESSION = `jsonb_set(
|
|
|
86
86
|
// Migration readiness tracks this projection body independently of scheduler
|
|
87
87
|
// wire and schema versions. Bump when a changed trigger must be reinstalled.
|
|
88
88
|
export const RUNTIME_EVENT_SEARCH_OUTBOX_PROJECTION_MARKER =
|
|
89
|
-
'runtime-event-search-
|
|
89
|
+
'runtime-event-search-primary-key-fence-direct-independent-receipts';
|
|
90
90
|
/** Trusted trigger-authored state; absent on already-projected legacy rows. */
|
|
91
91
|
export const RUNTIME_EVENT_DEFERRED_PROJECTION_FIELD =
|
|
92
92
|
'_runtimeSearchProjectionPending';
|
|
@@ -1905,7 +1905,7 @@ export async function attachRuntimeEventSearchTriggers(
|
|
|
1905
1905
|
await client.query(`
|
|
1906
1906
|
CREATE OR REPLACE FUNCTION ${schema}.search_receipt_event() RETURNS trigger
|
|
1907
1907
|
LANGUAGE plpgsql SECURITY DEFINER SET search_path = pg_catalog AS $function$
|
|
1908
|
-
DECLARE play text; ref uuid; canonical_events boolean;
|
|
1908
|
+
DECLARE play text; ref uuid; canonical_events boolean; deferred_run boolean;
|
|
1909
1909
|
BEGIN
|
|
1910
1910
|
IF NEW.status NOT IN ('completed', 'failed', 'skipped') THEN RETURN NEW; END IF;
|
|
1911
1911
|
IF TG_OP = 'UPDATE' THEN
|
|
@@ -1918,7 +1918,10 @@ export async function attachRuntimeEventSearchTriggers(
|
|
|
1918
1918
|
IF NEW.run_id IS NULL OR NEW.org_id IS NULL THEN
|
|
1919
1919
|
RAISE EXCEPTION 'Terminal receipt search projection requires run and organization';
|
|
1920
1920
|
END IF;
|
|
1921
|
-
|
|
1921
|
+
deferred_run := ${schema}.defer_runtime_event_projection_for_run(NEW.run_id);
|
|
1922
|
+
-- Independent projection indexes the receipt row directly below. Only
|
|
1923
|
+
-- the deferred compatibility stage still queues a receipt carrier.
|
|
1924
|
+
IF deferred_run AND NOT ${schema}.independent_runtime_event_projection() THEN
|
|
1922
1925
|
IF NOT EXISTS (SELECT 1 FROM ${schema}.runs
|
|
1923
1926
|
WHERE run_id = NEW.run_id AND org_id = NEW.org_id) THEN
|
|
1924
1927
|
RAISE EXCEPTION 'Terminal receipt search projection has no matching run';
|
|
@@ -1935,8 +1938,12 @@ export async function attachRuntimeEventSearchTriggers(
|
|
|
1935
1938
|
FROM ${schema}.outbox WHERE run_id = NEW.run_id), clock_timestamp())));
|
|
1936
1939
|
RETURN NEW;
|
|
1937
1940
|
END IF;
|
|
1938
|
-
--
|
|
1939
|
-
|
|
1941
|
+
-- Inline runs serialize event ordering with the same per-run lock as
|
|
1942
|
+
-- outbox facts. Independent runs index logs from a background prefix,
|
|
1943
|
+
-- so this one-row receipt insert takes no log mutex and need not wait.
|
|
1944
|
+
IF NOT deferred_run THEN
|
|
1945
|
+
PERFORM pg_advisory_xact_lock(hashtext(${quoteLiteral(scope)}), hashtext(NEW.run_id));
|
|
1946
|
+
END IF;
|
|
1940
1947
|
SELECT play_name, run_event_store = 'planet_scale'
|
|
1941
1948
|
INTO play, canonical_events FROM ${schema}.runs
|
|
1942
1949
|
WHERE run_id = NEW.run_id AND org_id = NEW.org_id;
|
|
@@ -1961,7 +1968,8 @@ export async function attachRuntimeEventSearchTriggers(
|
|
|
1961
1968
|
'source', 'receipt', 'producerAttempt', NEW.lease_owner_attempt,
|
|
1962
1969
|
-- Only the reserved runtime diagnostic record supplies this flat
|
|
1963
1970
|
-- context. Ordinary authored receipt outputs are never indexed.
|
|
1964
|
-
|
|
1971
|
+
-- The reserved key is buildDurableToolReceiptPrefix(call-evidence).
|
|
1972
|
+
'context', CASE WHEN NEW.k LIKE 'ctx:%:call:tool:call\\_evidence:%'
|
|
1965
1973
|
AND NEW.output_json->>'kind' = 'tool_call_evidence' THEN jsonb_strip_nulls(jsonb_build_object(
|
|
1966
1974
|
'callKey', NEW.output_json#>'{context,callKey}',
|
|
1967
1975
|
'toolId', NEW.output_json#>'{context,toolId}',
|
|
@@ -75,6 +75,75 @@ async function mint(claims: Record<string, unknown>): Promise<string> {
|
|
|
75
75
|
return `${signingInput}.${await sign(signingInput)}`;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/** One read-only billing observer page; cannot authorize a payment or grant. */
|
|
79
|
+
export async function mintCreditReadinessToken(input: {
|
|
80
|
+
scanId: string;
|
|
81
|
+
cursor: string | null;
|
|
82
|
+
nowMs?: number;
|
|
83
|
+
}): Promise<string> {
|
|
84
|
+
const issuedAt = Math.floor((input.nowMs ?? Date.now()) / 1000);
|
|
85
|
+
return mint({
|
|
86
|
+
v: TOKEN_VERSION,
|
|
87
|
+
iss: TOKEN_ISSUER,
|
|
88
|
+
aud: 'deepline.credit_readiness',
|
|
89
|
+
scanId: input.scanId,
|
|
90
|
+
cursor: input.cursor,
|
|
91
|
+
iat: issuedAt,
|
|
92
|
+
exp: issuedAt + TOKEN_TTL_SECONDS,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export async function verifyCreditReadinessToken(
|
|
97
|
+
token: string,
|
|
98
|
+
nowMs = Date.now(),
|
|
99
|
+
): Promise<{
|
|
100
|
+
scanId: string;
|
|
101
|
+
cursor: string | null;
|
|
102
|
+
}> {
|
|
103
|
+
const parts = token.split('.');
|
|
104
|
+
if (parts.length !== 3) throw new Error('Invalid credit readiness token.');
|
|
105
|
+
const decode = (value: string) =>
|
|
106
|
+
JSON.parse(Buffer.from(value, 'base64url').toString('utf8'));
|
|
107
|
+
const key = await crypto.subtle.importKey(
|
|
108
|
+
'raw',
|
|
109
|
+
new TextEncoder().encode(rootSecret()),
|
|
110
|
+
{ name: 'HMAC', hash: 'SHA-256' },
|
|
111
|
+
false,
|
|
112
|
+
['verify'],
|
|
113
|
+
);
|
|
114
|
+
const header = decode(parts[0]);
|
|
115
|
+
const claims = decode(parts[1]);
|
|
116
|
+
const valid = await crypto.subtle.verify(
|
|
117
|
+
'HMAC',
|
|
118
|
+
key,
|
|
119
|
+
Buffer.from(parts[2], 'base64url'),
|
|
120
|
+
new TextEncoder().encode(`${parts[0]}.${parts[1]}`),
|
|
121
|
+
);
|
|
122
|
+
const now = Math.floor(nowMs / 1000);
|
|
123
|
+
if (
|
|
124
|
+
!valid ||
|
|
125
|
+
header.alg !== 'HS256' ||
|
|
126
|
+
header.typ !== 'JWT' ||
|
|
127
|
+
claims.v !== TOKEN_VERSION ||
|
|
128
|
+
claims.iss !== TOKEN_ISSUER ||
|
|
129
|
+
claims.aud !== 'deepline.credit_readiness' ||
|
|
130
|
+
typeof claims.scanId !== 'string' ||
|
|
131
|
+
!claims.scanId ||
|
|
132
|
+
(claims.cursor !== null &&
|
|
133
|
+
(typeof claims.cursor !== 'string' || !claims.cursor)) ||
|
|
134
|
+
!Number.isSafeInteger(claims.iat) ||
|
|
135
|
+
!Number.isSafeInteger(claims.exp) ||
|
|
136
|
+
claims.iat > now + 30 ||
|
|
137
|
+
claims.exp <= now ||
|
|
138
|
+
claims.exp - claims.iat !== TOKEN_TTL_SECONDS
|
|
139
|
+
)
|
|
140
|
+
throw new Error('Invalid credit readiness token.');
|
|
141
|
+
return {
|
|
142
|
+
scanId: claims.scanId,
|
|
143
|
+
cursor: claims.cursor,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
78
147
|
/**
|
|
79
148
|
* Bind a large request body to its capability without putting up to 1,024
|
|
80
149
|
* receipt IDs in an HTTP header. JSON preserves order and length, so this is
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkBKEYQHJ2js = require('./chunk-BKEYQHJ2.js');
|
|
14
|
+
require('./chunk-SNENR3BL.js');
|
|
15
|
+
require('./chunk-GTC2KAZQ.js');
|
|
16
|
+
require('./chunk-XNYIZMNQ.js');
|
|
17
|
+
require('./chunk-7P5AA3SN.js');
|
|
18
|
+
require('./chunk-S4Y7B2O3.js');
|
|
19
|
+
require('./chunk-OG64RBAC.js');
|
|
20
|
+
require('./chunk-COGTRVWW.js');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkBKEYQHJ2js.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkBKEYQHJ2js.authStatusLine; exports.clearPendingClaim = _chunkBKEYQHJ2js.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkBKEYQHJ2js.clearSatisfiedPendingClaim; exports.handleRegister = _chunkBKEYQHJ2js.handleRegister; exports.handleStatus = _chunkBKEYQHJ2js.handleStatus; exports.handleWait = _chunkBKEYQHJ2js.handleWait; exports.readPendingAuthClaim = _chunkBKEYQHJ2js.readPendingAuthClaim; exports.registerAuthCommands = _chunkBKEYQHJ2js.registerAuthCommands; exports.reportSetupCompleted = _chunkBKEYQHJ2js.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkBKEYQHJ2js.resolvePendingAuthClaimForResume;
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
registerAuthCommands,
|
|
11
11
|
reportSetupCompleted,
|
|
12
12
|
resolvePendingAuthClaimForResume
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-PU53IS6H.mjs";
|
|
14
|
+
import "./chunk-S3MDB6SI.mjs";
|
|
15
|
+
import "./chunk-EZUGGC5A.mjs";
|
|
16
16
|
import "./chunk-DLIRSHV6.mjs";
|
|
17
17
|
import "./chunk-NXGCO4JB.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-GHZUH33K.mjs";
|
|
19
19
|
import "./chunk-WZYKRD7T.mjs";
|
|
20
20
|
import "./chunk-KRD6H754.mjs";
|
|
21
21
|
export {
|