deepline 0.3.87 → 0.3.89
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/client.ts +532 -2
- package/dist/bundling-sources/sdk/src/config.ts +77 -0
- package/dist/bundling-sources/sdk/src/http.ts +76 -30
- package/dist/bundling-sources/sdk/src/index.ts +6 -0
- package/dist/bundling-sources/sdk/src/play.ts +15 -1
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +83 -4
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +16 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +263 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +9 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +122 -0
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +6 -11
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +90 -12
- package/dist/bundling-sources/shared_libs/play-runtime/async-play-invocation.ts +78 -0
- package/dist/bundling-sources/shared_libs/play-runtime/checkpoint-boundaries.ts +70 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +407 -53
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +1 -32
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +57 -0
- package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-protocol.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/lane-retirement-gate.ts +189 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-semantics.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +23 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +18 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-start-admission.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +10 -8
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +20 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +30 -1
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +6 -3
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +152 -17
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +19 -4
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +6 -14
- package/dist/bundling-sources/shared_libs/plays/core.ts +11 -6
- package/dist/bundling-sources/shared_libs/plays/docflow-binding-owner.ts +16 -11
- package/dist/bundling-sources/shared_libs/plays/resolve-static-pipeline.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/slug.ts +115 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +44 -14
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +877 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +456 -0
- package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +560 -0
- package/dist/bundling-sources/shared_libs/product-notifications/content.ts +28 -0
- package/dist/bundling-sources/shared_libs/product-notifications/default-policy.ts +59 -0
- package/dist/bundling-sources/shared_libs/product-notifications/email.ts +246 -0
- package/dist/bundling-sources/shared_libs/product-notifications/evaluation.ts +280 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +433 -0
- package/dist/bundling-sources/shared_libs/product-notifications/legacy-slack.ts +80 -0
- package/dist/bundling-sources/shared_libs/product-notifications/workspace.ts +38 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +50 -0
- package/dist/cli/index.js +1065 -190
- package/dist/cli/index.mjs +1052 -177
- package/dist/{compiler-manifest-Dbov16F7.d.mts → compiler-manifest-DsLbQaew.d.mts} +132 -8
- package/dist/{compiler-manifest-Dbov16F7.d.ts → compiler-manifest-DsLbQaew.d.ts} +132 -8
- package/dist/index.d.mts +833 -11
- package/dist/index.d.ts +833 -11
- package/dist/index.js +467 -38
- package/dist/index.mjs +467 -38
- package/dist/install-integrity.json +20 -2
- package/dist/plays/bundle-play-file.d.mts +8 -3
- package/dist/plays/bundle-play-file.d.ts +8 -3
- package/dist/plays/bundle-play-file.mjs +100 -20
- package/package.json +1 -1
|
@@ -49,6 +49,12 @@ export const HOST_URL_ENV = 'DEEPLINE_HOST_URL';
|
|
|
49
49
|
export const API_KEY_ENV = 'DEEPLINE_API_KEY';
|
|
50
50
|
export const ACTIVE_ORG_ID_ENV = 'DEEPLINE_ACTIVE_ORG_ID';
|
|
51
51
|
export const ACTIVE_ORG_NAME_ENV = 'DEEPLINE_ACTIVE_ORG_NAME';
|
|
52
|
+
/**
|
|
53
|
+
* Comma-separated gated feature keys the server reported for the active
|
|
54
|
+
* workspace (`github-deploy`, …). Refreshed whenever credentials are saved;
|
|
55
|
+
* the CLI hides gated command groups whose key is absent.
|
|
56
|
+
*/
|
|
57
|
+
export const FEATURES_ENV = 'DEEPLINE_FEATURES';
|
|
52
58
|
|
|
53
59
|
/** Production API base URL. */
|
|
54
60
|
const PROD_URL = 'https://code.deepline.com';
|
|
@@ -83,8 +89,70 @@ const CLI_ENV_ALLOWED_KEYS = new Set([
|
|
|
83
89
|
API_KEY_ENV,
|
|
84
90
|
ACTIVE_ORG_ID_ENV,
|
|
85
91
|
ACTIVE_ORG_NAME_ENV,
|
|
92
|
+
FEATURES_ENV,
|
|
86
93
|
]);
|
|
87
94
|
|
|
95
|
+
/** Env line for a server-reported `features` list; absent input writes nothing. */
|
|
96
|
+
export function featureEnvValues(data: {
|
|
97
|
+
features?: unknown;
|
|
98
|
+
}): Record<string, string> {
|
|
99
|
+
if (!Array.isArray(data.features)) return {};
|
|
100
|
+
return {
|
|
101
|
+
[FEATURES_ENV]: data.features
|
|
102
|
+
.filter(
|
|
103
|
+
(key): key is string => typeof key === 'string' && key.trim() !== '',
|
|
104
|
+
)
|
|
105
|
+
.map((key) => key.trim())
|
|
106
|
+
.join(','),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** The API key saved in the host's global credentials, or '' when none. */
|
|
111
|
+
export function storedHostApiKey(baseUrl: string): string {
|
|
112
|
+
return loadCliEnv(normalizeBaseUrl(baseUrl) || baseUrl)[API_KEY_ENV] ?? '';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** The raw features line saved with the host's global credentials, if any. */
|
|
116
|
+
export function storedHostFeatures(baseUrl: string): string | undefined {
|
|
117
|
+
return loadCliEnv(normalizeBaseUrl(baseUrl) || baseUrl)[FEATURES_ENV];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** Whether a stored features list names `feature`. */
|
|
121
|
+
export function envHasFeature(env: EnvValues, feature: string): boolean {
|
|
122
|
+
return (env[FEATURES_ENV] ?? '')
|
|
123
|
+
.split(',')
|
|
124
|
+
.map((key) => key.trim())
|
|
125
|
+
.includes(feature);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Whether the active workspace was last seen with `feature` enabled. Reads
|
|
130
|
+
* the same credential sources, in the same order, as the API key: process
|
|
131
|
+
* env, the folder credentials pinned to the resolved host, then the host's
|
|
132
|
+
* global credentials. A host that cannot be resolved counts as no feature.
|
|
133
|
+
*/
|
|
134
|
+
export function cliFeatureEnabled(feature: string): boolean {
|
|
135
|
+
const processEnv = process.env as EnvValues;
|
|
136
|
+
if (envHasFeature(processEnv, feature)) return true;
|
|
137
|
+
// A process-env key wins for API calls, so only process-env features may
|
|
138
|
+
// describe it: a stored file's list belongs to a different credential.
|
|
139
|
+
if (processEnv[API_KEY_ENV]?.trim()) return false;
|
|
140
|
+
try {
|
|
141
|
+
const baseUrl = resolveBaseUrlOnly();
|
|
142
|
+
// The credential source that supplies the key also owns the features:
|
|
143
|
+
// a folder credential with no features line means "none", never "ask
|
|
144
|
+
// the global file", which may belong to a different workspace.
|
|
145
|
+
const projectEnv = loadProjectEnvCandidates().find(
|
|
146
|
+
({ env }) =>
|
|
147
|
+
normalizeBaseUrl(env[HOST_URL_ENV] ?? '') === baseUrl &&
|
|
148
|
+
Boolean(env[API_KEY_ENV]),
|
|
149
|
+
);
|
|
150
|
+
return envHasFeature(projectEnv?.env ?? loadCliEnv(baseUrl), feature);
|
|
151
|
+
} catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
88
156
|
export type CliCommandContext = {
|
|
89
157
|
active_organization: {
|
|
90
158
|
org_id: string;
|
|
@@ -402,6 +470,12 @@ function mergePersistedEnvValues(
|
|
|
402
470
|
) {
|
|
403
471
|
delete merged[ACTIVE_ORG_ID_ENV];
|
|
404
472
|
delete merged[ACTIVE_ORG_NAME_ENV];
|
|
473
|
+
delete merged[FEATURES_ENV];
|
|
474
|
+
}
|
|
475
|
+
// An explicit empty features list means "none": drop the stale line
|
|
476
|
+
// rather than keeping the previous workspace's features around.
|
|
477
|
+
if (values[FEATURES_ENV] === '') {
|
|
478
|
+
delete merged[FEATURES_ENV];
|
|
405
479
|
}
|
|
406
480
|
return merged;
|
|
407
481
|
}
|
|
@@ -582,6 +656,9 @@ export function resolveConfig(options?: DeeplineClientOptions): ResolvedConfig {
|
|
|
582
656
|
baseUrl,
|
|
583
657
|
timeout: options?.timeout ?? DEFAULT_TIMEOUT,
|
|
584
658
|
maxRetries: options?.maxRetries ?? DEFAULT_MAX_RETRIES,
|
|
659
|
+
// Pass through untouched: the transport owns case-insensitive merging so
|
|
660
|
+
// there is exactly one place that decides which header wins.
|
|
661
|
+
...(options?.headers ? { headers: { ...options.headers } } : {}),
|
|
585
662
|
};
|
|
586
663
|
}
|
|
587
664
|
|
|
@@ -104,6 +104,31 @@ function normalizeRequestAbortError(
|
|
|
104
104
|
return normalized;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/**
|
|
108
|
+
* Merge caller-supplied headers over everything the transport already derived
|
|
109
|
+
* from the environment, so an explicitly passed header always wins.
|
|
110
|
+
*
|
|
111
|
+
* HTTP header names are case-insensitive, so an existing header is removed by
|
|
112
|
+
* case-insensitive match before the normalized lowercase name is set. Without
|
|
113
|
+
* that, `Authorization` and `authorization` would both survive into the record
|
|
114
|
+
* and `new Headers(record)` would concatenate the two values.
|
|
115
|
+
*/
|
|
116
|
+
function applyExplicitHeaders(
|
|
117
|
+
headers: Record<string, string>,
|
|
118
|
+
explicit: Record<string, string> | undefined,
|
|
119
|
+
): Record<string, string> {
|
|
120
|
+
if (!explicit) return headers;
|
|
121
|
+
for (const [rawName, value] of Object.entries(explicit)) {
|
|
122
|
+
const name = rawName.trim().toLowerCase();
|
|
123
|
+
if (!name) continue;
|
|
124
|
+
for (const existing of Object.keys(headers)) {
|
|
125
|
+
if (existing.toLowerCase() === name) delete headers[existing];
|
|
126
|
+
}
|
|
127
|
+
headers[name] = value;
|
|
128
|
+
}
|
|
129
|
+
return headers;
|
|
130
|
+
}
|
|
131
|
+
|
|
107
132
|
function isAbortLikeError(error: Error): boolean {
|
|
108
133
|
const name = error.name.toLowerCase();
|
|
109
134
|
const message = error.message.toLowerCase();
|
|
@@ -114,6 +139,17 @@ function isAbortLikeError(error: Error): boolean {
|
|
|
114
139
|
);
|
|
115
140
|
}
|
|
116
141
|
|
|
142
|
+
function withErrorCause<T extends Error>(error: T, cause: unknown): T {
|
|
143
|
+
if (cause !== null && cause !== undefined) {
|
|
144
|
+
Object.defineProperty(error, 'cause', {
|
|
145
|
+
value: cause,
|
|
146
|
+
configurable: true,
|
|
147
|
+
writable: true,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return error;
|
|
151
|
+
}
|
|
152
|
+
|
|
117
153
|
function mapNetworkError(
|
|
118
154
|
baseUrl: string,
|
|
119
155
|
error: Error | null,
|
|
@@ -312,7 +348,11 @@ export class HttpClient {
|
|
|
312
348
|
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] =
|
|
313
349
|
coordinatorInternalToken.trim();
|
|
314
350
|
}
|
|
315
|
-
|
|
351
|
+
// Explicit client-option headers (e.g. `deepline plays run --header`) are
|
|
352
|
+
// applied last so an operator can override an env-derived header without
|
|
353
|
+
// rewriting the environment. Authorization of these headers stays
|
|
354
|
+
// server-side.
|
|
355
|
+
return applyExplicitHeaders(headers, this.config.headers);
|
|
316
356
|
}
|
|
317
357
|
|
|
318
358
|
/**
|
|
@@ -540,37 +580,43 @@ export class HttpClient {
|
|
|
540
580
|
);
|
|
541
581
|
if (options?.toolId) {
|
|
542
582
|
const code = mappedNetworkError.code;
|
|
543
|
-
throw
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
583
|
+
throw withErrorCause(
|
|
584
|
+
new ToolExecutionError(
|
|
585
|
+
withCoworkNetworkHint(mappedNetworkError.message),
|
|
586
|
+
{
|
|
587
|
+
toolId: options.toolId,
|
|
588
|
+
provider: providerLabelFromToolId(options.toolId),
|
|
589
|
+
operation: options.toolId,
|
|
590
|
+
code,
|
|
591
|
+
origin: 'deepline',
|
|
592
|
+
category: 'network',
|
|
593
|
+
// A direct client timeout has ambiguous delivery. Fail closed unless
|
|
594
|
+
// the server returns the authoritative action delivery contract.
|
|
595
|
+
retryable: false,
|
|
596
|
+
statusCode: null,
|
|
597
|
+
requestId: null,
|
|
598
|
+
retryAfterMs: null,
|
|
599
|
+
networkKind:
|
|
600
|
+
code === 'NETWORK_TIMEOUT'
|
|
601
|
+
? 'timeout'
|
|
602
|
+
: code === 'NETWORK_ABORTED'
|
|
603
|
+
? 'unknown'
|
|
604
|
+
: 'unavailable',
|
|
605
|
+
networkScope: 'client_to_deepline',
|
|
606
|
+
details: mappedNetworkError.details,
|
|
607
|
+
},
|
|
608
|
+
),
|
|
609
|
+
lastError,
|
|
567
610
|
);
|
|
568
611
|
}
|
|
569
|
-
throw
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
612
|
+
throw withErrorCause(
|
|
613
|
+
new DeeplineError(
|
|
614
|
+
withCoworkNetworkHint(mappedNetworkError.message),
|
|
615
|
+
undefined,
|
|
616
|
+
mappedNetworkError.code,
|
|
617
|
+
mappedNetworkError.details,
|
|
618
|
+
),
|
|
619
|
+
lastError,
|
|
574
620
|
);
|
|
575
621
|
}
|
|
576
622
|
|
|
@@ -94,6 +94,8 @@ export type {
|
|
|
94
94
|
MonitorFleetWaitOptions,
|
|
95
95
|
MonitorFleetResult,
|
|
96
96
|
MonitorFleetsNamespace,
|
|
97
|
+
CreateNotificationGroupInput,
|
|
98
|
+
CreateNotificationGroupResult,
|
|
97
99
|
IngestionStorageRepairResult,
|
|
98
100
|
PlayStatus,
|
|
99
101
|
PlaySheetRow,
|
|
@@ -270,6 +272,10 @@ export type {
|
|
|
270
272
|
PlayDatasetInput,
|
|
271
273
|
PlayCallExecution,
|
|
272
274
|
PlayCallOptions,
|
|
275
|
+
PlayAsyncCallOptions,
|
|
276
|
+
AsyncPlayRunRef,
|
|
277
|
+
PlayRunId,
|
|
278
|
+
PlayReferenceLike,
|
|
273
279
|
PlayFetchResponse,
|
|
274
280
|
RuntimeStepOptions,
|
|
275
281
|
FetchOptions,
|
|
@@ -113,6 +113,9 @@ import type { ToolExecution } from './client.js';
|
|
|
113
113
|
import type {
|
|
114
114
|
DurableCallStaleAfterSeconds,
|
|
115
115
|
PlayAuthoringBindings,
|
|
116
|
+
AsyncPlayRunRef as PlayAuthoringAsyncPlayRunRef,
|
|
117
|
+
PlayAuthoringAsyncCallOptions,
|
|
118
|
+
PlayRunId as PlayAuthoringRunId,
|
|
116
119
|
PlayAuthoringCallExecution,
|
|
117
120
|
PlayAuthoringCallOptions,
|
|
118
121
|
PlayAuthoringColumnResolver,
|
|
@@ -676,7 +679,18 @@ export type PrebuiltPlayRef = {
|
|
|
676
679
|
readonly name: string;
|
|
677
680
|
};
|
|
678
681
|
|
|
679
|
-
export type PlayReferenceLike
|
|
682
|
+
export type PlayReferenceLike<
|
|
683
|
+
TInput extends Record<string, unknown> = Record<string, unknown>,
|
|
684
|
+
> = PlayAuthoringReferenceLike<TInput>;
|
|
685
|
+
|
|
686
|
+
/** Branded durable identity returned by ctx.runPlayAsync. */
|
|
687
|
+
export type PlayRunId = PlayAuthoringRunId;
|
|
688
|
+
|
|
689
|
+
/** Serializable reference to an independently scheduled Play Run. */
|
|
690
|
+
export type AsyncPlayRunRef = PlayAuthoringAsyncPlayRunRef;
|
|
691
|
+
|
|
692
|
+
/** Author intent for an independently scheduled child Run. */
|
|
693
|
+
export type PlayAsyncCallOptions = PlayAuthoringAsyncCallOptions;
|
|
680
694
|
|
|
681
695
|
export type {
|
|
682
696
|
PlayDataset,
|
|
@@ -40,7 +40,7 @@ export type {
|
|
|
40
40
|
|
|
41
41
|
export { extractDefinedPlayName } from '../../../shared_libs/plays/bundling/index.js';
|
|
42
42
|
|
|
43
|
-
const PLAY_BUNDLE_CACHE_VERSION =
|
|
43
|
+
const PLAY_BUNDLE_CACHE_VERSION = 37;
|
|
44
44
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
45
45
|
const SDK_PACKAGE_ROOT = resolve(MODULE_DIR, '..', '..');
|
|
46
46
|
const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..', '..');
|
|
@@ -199,7 +199,7 @@ export const SDK_RELEASE = {
|
|
|
199
199
|
// available at toolResponse.rawV2 while toolResponse.raw and all declared
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
|
-
version: '0.3.
|
|
202
|
+
version: '0.3.89',
|
|
203
203
|
updateSummary:
|
|
204
204
|
'Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.',
|
|
205
205
|
packageCapabilities: {
|
|
@@ -19,6 +19,19 @@ import type {
|
|
|
19
19
|
PlayBootstrapStageKind,
|
|
20
20
|
PlayBootstrapTemplate,
|
|
21
21
|
} from '../../shared_libs/plays/bootstrap-routes';
|
|
22
|
+
import type {
|
|
23
|
+
EffectiveProductNotificationConfiguration,
|
|
24
|
+
ProductNotificationConfigurationChange,
|
|
25
|
+
ProductNotificationDefaultPolicy,
|
|
26
|
+
} from '../../shared_libs/product-notifications/configuration';
|
|
27
|
+
import type { ProductNotificationTypeCatalogItem } from '../../shared_libs/product-notifications/catalog';
|
|
28
|
+
|
|
29
|
+
export type {
|
|
30
|
+
EffectiveProductNotificationConfiguration,
|
|
31
|
+
ProductNotificationConfigurationChange,
|
|
32
|
+
ProductNotificationDefaultPolicy,
|
|
33
|
+
ProductNotificationTypeCatalogItem,
|
|
34
|
+
};
|
|
22
35
|
|
|
23
36
|
// ——————————————————————————————————————————————————————————
|
|
24
37
|
// Config
|
|
@@ -56,6 +69,17 @@ export interface DeeplineClientOptions {
|
|
|
56
69
|
timeout?: number;
|
|
57
70
|
/** Maximum retry attempts for transient failures (network errors, 429s). Default: `3`. */
|
|
58
71
|
maxRetries?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Extra request headers attached to every request this client sends.
|
|
74
|
+
*
|
|
75
|
+
* They are merged *after* the headers the transport derives from the
|
|
76
|
+
* environment, so an explicit header replaces the env-derived one. Header
|
|
77
|
+
* names match case-insensitively and are normalized to lowercase.
|
|
78
|
+
*
|
|
79
|
+
* This is transport plumbing only: the server still authorizes every
|
|
80
|
+
* internal header it honors.
|
|
81
|
+
*/
|
|
82
|
+
headers?: Record<string, string>;
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
/**
|
|
@@ -72,6 +96,12 @@ export interface ResolvedConfig {
|
|
|
72
96
|
timeout: number;
|
|
73
97
|
/** Max retry count for transient failures. */
|
|
74
98
|
maxRetries: number;
|
|
99
|
+
/**
|
|
100
|
+
* Caller-supplied headers merged over the env-derived headers on every
|
|
101
|
+
* request. Absent unless the caller passed
|
|
102
|
+
* {@link DeeplineClientOptions.headers}.
|
|
103
|
+
*/
|
|
104
|
+
headers?: Record<string, string>;
|
|
75
105
|
}
|
|
76
106
|
|
|
77
107
|
/** Column metadata returned by a customer data query. */
|
|
@@ -795,8 +825,9 @@ export interface PlayStatus {
|
|
|
795
825
|
/**
|
|
796
826
|
* Projected settled-charge billing for the run. Returned by `runs.get`.
|
|
797
827
|
* `totalCredits`/`providerEvents` describe THIS run only; `rollup` (present
|
|
798
|
-
* with `--full`) carries the true subtree cost including
|
|
799
|
-
* Deepline credits only — provider
|
|
828
|
+
* with `--full`) carries the true subtree cost including independently
|
|
829
|
+
* executing ctx.runPlayAsync descendants. Deepline credits only — provider
|
|
830
|
+
* spend is never exposed.
|
|
800
831
|
*/
|
|
801
832
|
billing?: RunBillingSummary;
|
|
802
833
|
/**
|
|
@@ -808,14 +839,26 @@ export interface PlayStatus {
|
|
|
808
839
|
billingChildCredits?: number;
|
|
809
840
|
/** True when the child-run billing rollup could not be fully resolved. */
|
|
810
841
|
billingRollupIncomplete?: boolean;
|
|
811
|
-
/** Durable summaries of ctx.
|
|
842
|
+
/** Durable summaries of ctx.runPlayAsync children, returned by `runs.get --full`. */
|
|
812
843
|
childRuns?: ChildRunSummary[];
|
|
844
|
+
/**
|
|
845
|
+
* Child Runs grouped by the authored ctx.runPlayAsync launch key. `complete`
|
|
846
|
+
* is false when the bounded response is a lower bound rather than the full
|
|
847
|
+
* direct-child set; use each opaque `runId` to retrieve a child Run.
|
|
848
|
+
*/
|
|
849
|
+
childRunProjection?: AsyncChildRunProjection;
|
|
813
850
|
}
|
|
814
851
|
|
|
815
|
-
/** One ctx.
|
|
852
|
+
/** One ctx.runPlayAsync child Run exposed on the parent's `--full` payload. */
|
|
816
853
|
export interface ChildRunSummary {
|
|
817
854
|
runId: string;
|
|
818
855
|
playName?: string | null;
|
|
856
|
+
/** Authored ctx.runPlayAsync key; stable across row fanout. */
|
|
857
|
+
launchKey?: string | null;
|
|
858
|
+
/** Opaque durable identity for one authored invocation. */
|
|
859
|
+
invocationKey?: string | null;
|
|
860
|
+
/** Whether this child uses root-owned Deepline billing attribution. */
|
|
861
|
+
rootBillingOwned?: boolean;
|
|
819
862
|
status: string;
|
|
820
863
|
parentRunId?: string | null;
|
|
821
864
|
rootRunId?: string | null;
|
|
@@ -824,6 +867,32 @@ export interface ChildRunSummary {
|
|
|
824
867
|
finishedAt?: number | null;
|
|
825
868
|
}
|
|
826
869
|
|
|
870
|
+
export interface AsyncChildRunStatusCounts {
|
|
871
|
+
total: number;
|
|
872
|
+
queued: number;
|
|
873
|
+
active: number;
|
|
874
|
+
waiting: number;
|
|
875
|
+
succeeded: number;
|
|
876
|
+
failed: number;
|
|
877
|
+
cancelled: number;
|
|
878
|
+
unknown: number;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
export interface AsyncChildRunLaunchProjection {
|
|
882
|
+
launchKey: string | null;
|
|
883
|
+
playName: string | null;
|
|
884
|
+
counts: AsyncChildRunStatusCounts;
|
|
885
|
+
children: ChildRunSummary[];
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
export interface AsyncChildRunProjection {
|
|
889
|
+
kind: 'async_child_runs';
|
|
890
|
+
returnedCount: number;
|
|
891
|
+
complete: boolean;
|
|
892
|
+
counts: AsyncChildRunStatusCounts;
|
|
893
|
+
launches: AsyncChildRunLaunchProjection[];
|
|
894
|
+
}
|
|
895
|
+
|
|
827
896
|
/**
|
|
828
897
|
* Rolled-up billing for a run subtree, projected from settled Charge Lifecycle
|
|
829
898
|
* facts. Deepline credits only — never provider spend.
|
|
@@ -1189,6 +1258,16 @@ export interface ProductNotification {
|
|
|
1189
1258
|
lastErrorMessage?: string;
|
|
1190
1259
|
}
|
|
1191
1260
|
|
|
1261
|
+
export interface ProductNotificationConfigurationResponse {
|
|
1262
|
+
configuration: EffectiveProductNotificationConfiguration;
|
|
1263
|
+
catalog: readonly ProductNotificationTypeCatalogItem[];
|
|
1264
|
+
slackConnection: {
|
|
1265
|
+
connected: boolean;
|
|
1266
|
+
status: string;
|
|
1267
|
+
connectionId?: string;
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1192
1271
|
export interface PlayDescription {
|
|
1193
1272
|
name: string;
|
|
1194
1273
|
/** Stable registry key. Same value `plays list` reports for this play. */
|
|
@@ -49,6 +49,22 @@ export const MONITOR_DEACTIVATION_REASONS: readonly MonitorDeactivationReasonDef
|
|
|
49
49
|
resolution:
|
|
50
50
|
'Add credits. Monitors are reactivated automatically once the balance is positive again.',
|
|
51
51
|
},
|
|
52
|
+
{
|
|
53
|
+
id: 'monthly_cap_exceeded',
|
|
54
|
+
owner: 'policy',
|
|
55
|
+
summary:
|
|
56
|
+
'Deactivated because the organization reached its monthly monitor spending cap.',
|
|
57
|
+
resolution:
|
|
58
|
+
'Raise or reset the monthly cap, then explicitly reactivate the monitors you want restored.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'billing_failure',
|
|
62
|
+
owner: 'policy',
|
|
63
|
+
summary:
|
|
64
|
+
'Deactivated because monitor event billing was denied.',
|
|
65
|
+
resolution:
|
|
66
|
+
'Resolve the billing restriction, then explicitly reactivate the monitors you want restored.',
|
|
67
|
+
},
|
|
52
68
|
{
|
|
53
69
|
id: 'entitlement_expired',
|
|
54
70
|
owner: 'policy',
|