deepline 0.3.346 → 0.3.347
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/http.ts +14 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +78 -17
- package/dist/cli/auth-PSMCNXBC.js +31 -0
- package/dist/cli/{auth-HTWHQNMY.mjs → auth-RWP45MJX.mjs} +4 -4
- package/dist/cli/{billing-4DCHVGO5.js → billing-F6RNSQWW.js} +71 -71
- package/dist/cli/{billing-X56CVZWC.mjs → billing-XPKHI4LF.mjs} +4 -4
- package/dist/cli/{chunk-NVNHV73C.mjs → chunk-3JJLQQLW.mjs} +2 -2
- package/dist/cli/{chunk-ZEUFYRUR.js → chunk-3PRBUTJK.js} +240 -231
- package/dist/cli/{chunk-22GXXUTB.js → chunk-5UJOJKPW.js} +33 -27
- package/dist/cli/{chunk-5NNSJTJ3.js → chunk-723POEH5.js} +279 -244
- package/dist/cli/{chunk-SGBSQHXS.js → chunk-AGV2VS4U.js} +55 -53
- package/dist/cli/{chunk-MOVEHSNM.mjs → chunk-AOKWJJLP.mjs} +1 -1
- package/dist/cli/{chunk-KQCTQGUU.mjs → chunk-AYR45POY.mjs} +51 -16
- package/dist/cli/{chunk-YUKZHAFW.js → chunk-BUXJSW26.js} +26 -26
- package/dist/cli/{chunk-L2R72RQJ.js → chunk-EOS73ZCP.js} +8 -8
- package/dist/cli/{chunk-5QG2UAYH.js → chunk-GS2ZSOAQ.js} +2 -2
- package/dist/cli/{chunk-EJ2NVO5K.js → chunk-GT7OCAWV.js} +48 -48
- package/dist/cli/{chunk-4Q572AVS.js → chunk-JB4UKD3B.js} +6 -6
- package/dist/cli/{chunk-GGSLHWTB.js → chunk-L4TXOCCC.js} +1 -1
- package/dist/cli/{chunk-WKZTHHJI.mjs → chunk-LH4VHCN5.mjs} +9 -7
- package/dist/cli/{chunk-2RJ7RMRM.js → chunk-LPKV6IBM.js} +8 -8
- package/dist/cli/{chunk-GCBLVWDQ.mjs → chunk-LTJOC47W.mjs} +16 -7
- package/dist/cli/{chunk-AFNEQ43J.js → chunk-MX53GIOB.js} +40 -1
- package/dist/cli/{chunk-P4IKGWYF.mjs → chunk-NU5EU2SH.mjs} +4 -4
- package/dist/cli/{chunk-62TKYGY6.mjs → chunk-OS6CZRJE.mjs} +3 -3
- package/dist/cli/{chunk-VC7M2QR7.mjs → chunk-PQGDU7B5.mjs} +7 -1
- package/dist/cli/{chunk-YEKAGC52.js → chunk-ROEN4NXY.js} +60 -60
- package/dist/cli/{chunk-2GRMXCLZ.mjs → chunk-SFJEAK54.mjs} +1 -1
- package/dist/cli/{chunk-3GLIYDIF.mjs → chunk-U2GPF4SB.mjs} +2 -2
- package/dist/cli/{chunk-O4SXVVNQ.mjs → chunk-VRYRVD3F.mjs} +1 -1
- package/dist/cli/{chunk-T7EVEXHS.js → chunk-WX7W76U7.js} +15 -15
- package/dist/cli/{chunk-ZR4EHO62.mjs → chunk-X32ZLEUU.mjs} +2 -2
- package/dist/cli/{chunk-XAM3XOUA.mjs → chunk-Y6D2JYBR.mjs} +2 -2
- package/dist/cli/{chunk-JOA6IKDE.mjs → chunk-Z6B4UPM4.mjs} +39 -0
- package/dist/cli/{client-C2KUT452.mjs → client-FZJ3RSO3.mjs} +3 -3
- package/dist/cli/client-J4QGSQ6Y.js +20 -0
- package/dist/cli/{csv-SLACAH4F.mjs → csv-HPBPBU3I.mjs} +3 -3
- package/dist/cli/{csv-3TAA2MTR.js → csv-QSMT5HZS.js} +12 -12
- package/dist/cli/{db-IN4I6KJ5.mjs → db-2KAUAVVC.mjs} +4 -4
- package/dist/cli/{db-BT6Q3FE6.js → db-IKZKICP3.js} +29 -29
- package/dist/cli/{describe-EDXTYMOF.mjs → describe-EW4GZMUK.mjs} +9 -9
- package/dist/cli/{describe-FJZXYKFH.js → describe-QM7Q5Y2H.js} +25 -25
- package/dist/cli/{executions-YYQC2TVR.js → executions-5ICONLFX.js} +6 -6
- package/dist/cli/{executions-X36QA5NY.mjs → executions-U5WWUFEZ.mjs} +4 -4
- package/dist/cli/{feedback-BS3S46O3.js → feedback-N2KGAK4V.js} +7 -7
- package/dist/cli/{feedback-KTEPHZ4S.mjs → feedback-ZBQPQPFG.mjs} +3 -3
- package/dist/cli/git-2N5LS25H.js +23 -0
- package/dist/cli/{git-3ZVYB63W.mjs → git-M5YEP57H.mjs} +4 -4
- package/dist/cli/index.js +79 -79
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-VVBJXM2K.mjs → legacy-noops-GJUYBH2F.mjs} +4 -4
- package/dist/cli/{legacy-noops-V5R7ITER.js → legacy-noops-IQIPPJF7.js} +7 -7
- package/dist/cli/{monitors-J6XDE76B.js → monitors-DQUCHISX.js} +85 -85
- package/dist/cli/{monitors-KYTMBNUQ.mjs → monitors-XJAJNMG4.mjs} +4 -4
- package/dist/cli/{org-RGABGQKP.mjs → org-DFWDN4EJ.mjs} +4 -4
- package/dist/cli/{org-MHF2NGDV.js → org-G45CXUJV.js} +60 -60
- package/dist/cli/{play-UII4SSA7.mjs → play-URTZW2Q4.mjs} +8 -8
- package/dist/cli/play-WWMUYKWS.js +153 -0
- package/dist/cli/{providers-LQOSKPUH.mjs → providers-CCKMRCXU.mjs} +4 -4
- package/dist/cli/{providers-3GDMD7T6.js → providers-IVUWWGFP.js} +7 -7
- package/dist/cli/{quickstart-GAMYLCLJ.mjs → quickstart-CRHIA3PZ.mjs} +3 -3
- package/dist/cli/{quickstart-R34Z7EMU.js → quickstart-MMIVNRV4.js} +5 -5
- package/dist/cli/{search-AOOMDVF5.mjs → search-NDRDOINX.mjs} +5 -5
- package/dist/cli/search-YZL2QRIF.js +26 -0
- package/dist/cli/{secrets-T4XXIASK.js → secrets-GQUBMJGM.js} +13 -13
- package/dist/cli/{secrets-U7YGLUSX.mjs → secrets-SUC3KLLH.mjs} +4 -4
- package/dist/cli/{sessions-VPXR4DSZ.mjs → sessions-7CAU6JL5.mjs} +4 -4
- package/dist/cli/{sessions-JQGKWKJS.js → sessions-AQCRVLHW.js} +5 -5
- package/dist/cli/{settings-LXF45R7X.js → settings-4SDI73XW.js} +74 -74
- package/dist/cli/{settings-LP55G43L.mjs → settings-LFFOFAU6.mjs} +7 -7
- package/dist/cli/{setup-36QA4JI3.mjs → setup-BKCQOJBD.mjs} +6 -6
- package/dist/cli/{setup-MA2GLU4N.js → setup-FQ3E7U7G.js} +41 -41
- package/dist/cli/skills-7BPEGDIA.js +28 -0
- package/dist/cli/{skills-HB6PARLZ.mjs → skills-USGJ5MF7.mjs} +4 -4
- package/dist/cli/{tools-E7K7R4AO.mjs → tools-5HTXLDZ4.mjs} +7 -7
- package/dist/cli/tools-5VEZ4QR4.js +40 -0
- package/dist/cli/{update-IT63P3NV.mjs → update-F7TIJEIV.mjs} +6 -6
- package/dist/cli/update-YFPMWKI4.js +28 -0
- package/dist/cli/{workflow-UO3PMX7R.mjs → workflow-FXJ2D2MG.mjs} +5 -5
- package/dist/cli/{workflow-SJHASZ5C.js → workflow-J5JVOUIL.js} +15 -15
- package/dist/{client-BHReRdWK.d.mts → client-D20uyRYB.d.mts} +6 -0
- package/dist/{client-DW3zASj8.d.ts → client-rHyf5s_Y.d.ts} +6 -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 +78 -78
- 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-5YTC2XH2.js +0 -31
- package/dist/cli/client-4RKYHB7Z.js +0 -20
- package/dist/cli/git-ZHAD5TJN.js +0 -23
- package/dist/cli/play-ZWAH3U44.js +0 -153
- package/dist/cli/search-FVB7ZNCO.js +0 -26
- package/dist/cli/skills-GUWC4FV7.js +0 -28
- package/dist/cli/tools-T5WIAD5Z.js +0 -40
- package/dist/cli/update-QY6RY3A6.js +0 -28
|
@@ -89,6 +89,12 @@ interface RequestOptions {
|
|
|
89
89
|
/** Enables endpoint-specific structured tool failure mapping. */
|
|
90
90
|
toolId?: string;
|
|
91
91
|
onResponse?: (response: Response) => void;
|
|
92
|
+
/** Observation after the entire response body arrives, before error mapping. */
|
|
93
|
+
onResponseBody?: (observation: {
|
|
94
|
+
receivedAtMs: number;
|
|
95
|
+
httpStatus: number;
|
|
96
|
+
body: unknown;
|
|
97
|
+
}) => void;
|
|
92
98
|
allowNotFound?: boolean;
|
|
93
99
|
idempotencyKey?: string;
|
|
94
100
|
}
|
|
@@ -524,8 +530,14 @@ export class HttpClient {
|
|
|
524
530
|
// Receiving headers is not completion: a stalled response body must
|
|
525
531
|
// remain inside the same request deadline and abort its connection.
|
|
526
532
|
const body = await response.text();
|
|
533
|
+
const receivedAtMs = Date.now();
|
|
527
534
|
clearTimeout(timeoutId);
|
|
528
535
|
const parsed = parseResponseBody(body);
|
|
536
|
+
options?.onResponseBody?.({
|
|
537
|
+
receivedAtMs,
|
|
538
|
+
httpStatus: response.status,
|
|
539
|
+
body: parsed,
|
|
540
|
+
});
|
|
529
541
|
|
|
530
542
|
const structuredToolError =
|
|
531
543
|
options?.toolId && !response.ok
|
|
@@ -783,6 +795,7 @@ export class HttpClient {
|
|
|
783
795
|
| 'exactUrlOnly'
|
|
784
796
|
| 'toolId'
|
|
785
797
|
| 'onResponse'
|
|
798
|
+
| 'onResponseBody'
|
|
786
799
|
| 'allowNotFound'
|
|
787
800
|
| 'idempotencyKey'
|
|
788
801
|
| 'headers'
|
|
@@ -916,6 +929,7 @@ export class HttpClient {
|
|
|
916
929
|
| 'exactUrlOnly'
|
|
917
930
|
| 'toolId'
|
|
918
931
|
| 'onResponse'
|
|
932
|
+
| 'onResponseBody'
|
|
919
933
|
| 'allowNotFound'
|
|
920
934
|
| 'idempotencyKey'
|
|
921
935
|
>,
|
|
@@ -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.347',
|
|
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: {
|
|
@@ -135,6 +135,12 @@ export type ExecuteToolRawOptions = {
|
|
|
135
135
|
searchRef?: string;
|
|
136
136
|
/** Correlates one CLI command with its execute request and server telemetry. */
|
|
137
137
|
cliInvocationId?: string;
|
|
138
|
+
/** Optional terminal API body-receipt observation; never a CLI exit clock. */
|
|
139
|
+
onResponseReceived?: (observation: {
|
|
140
|
+
receivedAtMs: number;
|
|
141
|
+
httpStatus: number;
|
|
142
|
+
state: 'completed' | 'failed' | 'cancelled';
|
|
143
|
+
}) => void;
|
|
138
144
|
};
|
|
139
145
|
|
|
140
146
|
/** Durable state returned for a keyed tool execution. */
|
|
@@ -398,23 +404,77 @@ export class ToolCalls {
|
|
|
398
404
|
? { 'x-deepline-cli-invocation-id': options.cliInvocationId }
|
|
399
405
|
: {}),
|
|
400
406
|
};
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
407
|
+
let lastResponse: {
|
|
408
|
+
receivedAtMs: number;
|
|
409
|
+
httpStatus: number;
|
|
410
|
+
body: unknown;
|
|
411
|
+
} | null = null;
|
|
412
|
+
const observeTerminal = (failure?: { error: unknown }) => {
|
|
413
|
+
if (!lastResponse) return;
|
|
414
|
+
// A final rejection is measurable only if it belongs to this complete
|
|
415
|
+
// HTTP body. Never reuse an earlier retry's body after a network failure.
|
|
416
|
+
if (failure) {
|
|
417
|
+
const { error } = failure;
|
|
418
|
+
if (
|
|
419
|
+
isRecoverableExecutionAttemptError(error) ||
|
|
420
|
+
!(error instanceof DeeplineError) ||
|
|
421
|
+
error.statusCode === undefined ||
|
|
422
|
+
error.statusCode !== lastResponse.httpStatus ||
|
|
423
|
+
error.code === 'EXECUTION_OUTCOME_UNKNOWN'
|
|
424
|
+
)
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
const body = lastResponse.body;
|
|
428
|
+
const recovery = getExecutionRecoveryState(body);
|
|
429
|
+
if (recovery === 'running' || recovery === 'outcome_unknown') return;
|
|
430
|
+
const state = isRecord(body) ? body.status : null;
|
|
431
|
+
const terminal =
|
|
432
|
+
state === 'completed' || state === 'failed' || state === 'cancelled'
|
|
433
|
+
? state
|
|
434
|
+
: state === 'canceled'
|
|
435
|
+
? 'cancelled'
|
|
436
|
+
: failure
|
|
437
|
+
? 'failed'
|
|
438
|
+
: null;
|
|
439
|
+
if (terminal)
|
|
440
|
+
options?.onResponseReceived?.({
|
|
441
|
+
receivedAtMs: lastResponse.receivedAtMs,
|
|
442
|
+
httpStatus: lastResponse.httpStatus,
|
|
443
|
+
state: terminal,
|
|
444
|
+
});
|
|
445
|
+
};
|
|
446
|
+
const request = async (requestTimeoutMs: number | undefined) => {
|
|
447
|
+
lastResponse = null;
|
|
448
|
+
try {
|
|
449
|
+
return await this.http.post<ToolExecution<TData, TMeta>>(
|
|
450
|
+
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
451
|
+
{
|
|
452
|
+
payload: inputSnapshot,
|
|
453
|
+
...(metadataSnapshot ? { metadata: metadataSnapshot } : {}),
|
|
454
|
+
},
|
|
455
|
+
headers,
|
|
456
|
+
{
|
|
457
|
+
timeout: requestTimeoutMs,
|
|
458
|
+
maxRetries: idempotencyKey ? 0 : (options?.maxRetries ?? 0),
|
|
459
|
+
retryApiErrors: options?.retryApiErrors === true,
|
|
460
|
+
exactUrlOnly: true,
|
|
461
|
+
toolId,
|
|
462
|
+
idempotencyKey,
|
|
463
|
+
onResponse: () => {
|
|
464
|
+
lastResponse = null;
|
|
465
|
+
},
|
|
466
|
+
onResponseBody: (observation) => {
|
|
467
|
+
lastResponse = observation;
|
|
468
|
+
},
|
|
469
|
+
},
|
|
470
|
+
);
|
|
471
|
+
} catch (error) {
|
|
472
|
+
// Only the final HTTP rejection, not an intermediate retry or an
|
|
473
|
+
// ambiguous network/cancellation failure, proves a response endpoint.
|
|
474
|
+
observeTerminal({ error });
|
|
475
|
+
throw error;
|
|
476
|
+
}
|
|
477
|
+
};
|
|
418
478
|
let response: ToolExecution<TData, TMeta>;
|
|
419
479
|
let recoveryDeadline: number | null = null;
|
|
420
480
|
const recoveryTimeoutMs =
|
|
@@ -518,6 +578,7 @@ export class ToolCalls {
|
|
|
518
578
|
});
|
|
519
579
|
}
|
|
520
580
|
}
|
|
581
|
+
observeTerminal();
|
|
521
582
|
const materialized = materializeToolExecutionResponse(response);
|
|
522
583
|
return idempotencyKey ? { ...materialized, idempotencyKey } : materialized;
|
|
523
584
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkGT7OCAWVjs = require('./chunk-GT7OCAWV.js');
|
|
13
|
+
require('./chunk-JB4UKD3B.js');
|
|
14
|
+
require('./chunk-5UJOJKPW.js');
|
|
15
|
+
require('./chunk-XNYIZMNQ.js');
|
|
16
|
+
require('./chunk-L4TXOCCC.js');
|
|
17
|
+
require('./chunk-7P5AA3SN.js');
|
|
18
|
+
require('./chunk-OG64RBAC.js');
|
|
19
|
+
require('./chunk-COGTRVWW.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkGT7OCAWVjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkGT7OCAWVjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkGT7OCAWVjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkGT7OCAWVjs.handleRegister; exports.handleStatus = _chunkGT7OCAWVjs.handleStatus; exports.handleWait = _chunkGT7OCAWVjs.handleWait; exports.readPendingAuthClaim = _chunkGT7OCAWVjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkGT7OCAWVjs.registerAuthCommands; exports.reportSetupCompleted = _chunkGT7OCAWVjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkGT7OCAWVjs.resolvePendingAuthClaimForResume;
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
registerAuthCommands,
|
|
10
10
|
reportSetupCompleted,
|
|
11
11
|
resolvePendingAuthClaimForResume
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-Y6D2JYBR.mjs";
|
|
13
|
+
import "./chunk-SFJEAK54.mjs";
|
|
14
|
+
import "./chunk-PQGDU7B5.mjs";
|
|
15
15
|
import "./chunk-DLIRSHV6.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-AOKWJJLP.mjs";
|
|
17
17
|
import "./chunk-NXGCO4JB.mjs";
|
|
18
18
|
import "./chunk-WZYKRD7T.mjs";
|
|
19
19
|
import "./chunk-KRD6H754.mjs";
|