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
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
flattenStaticPipeline,
|
|
3
|
+
type PlayStaticPipeline,
|
|
4
|
+
} from '../plays/static-pipeline';
|
|
5
|
+
import { SHARED_EXECUTION_POLICY } from './governor/policy';
|
|
6
|
+
|
|
7
|
+
export const CTX_RUN_PLAY_ASYNC_TARGET_UNRESOLVED =
|
|
8
|
+
'CTX_RUN_PLAY_ASYNC_TARGET_UNRESOLVED';
|
|
9
|
+
export const CTX_RUN_PLAY_ASYNC_DATASET_UNSUPPORTED =
|
|
10
|
+
'CTX_RUN_PLAY_ASYNC_DATASET_UNSUPPORTED';
|
|
11
|
+
export const CTX_RUN_PLAY_ASYNC_RECURSIVE = 'CTX_RUN_PLAY_ASYNC_RECURSIVE';
|
|
12
|
+
export const CTX_RUN_PLAY_ASYNC_DEPTH_EXCEEDED =
|
|
13
|
+
'CTX_RUN_PLAY_ASYNC_DEPTH_EXCEEDED';
|
|
14
|
+
export const MAX_ASYNC_PLAY_CALL_DEPTH =
|
|
15
|
+
SHARED_EXECUTION_POLICY.budgets.maxPlayCallDepth;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Assert that one independently scheduled Play closure may be admitted.
|
|
19
|
+
*
|
|
20
|
+
* Async children may suspend for sleep/HITL, but never own a Dataset, CSV, or
|
|
21
|
+
* Runtime Sheet. The checker and runtime both call this function so the same
|
|
22
|
+
* authored target cannot pass publish and fail differently at execution.
|
|
23
|
+
*/
|
|
24
|
+
export function assertAsyncPlayInvocation(input: {
|
|
25
|
+
pipeline: PlayStaticPipeline | null | undefined;
|
|
26
|
+
childPlayName?: string | null;
|
|
27
|
+
}): void {
|
|
28
|
+
const childPlayName = input.childPlayName?.trim() || 'child';
|
|
29
|
+
if (!input.pipeline) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
`${CTX_RUN_PLAY_ASYNC_TARGET_UNRESOLVED}: ctx.runPlayAsync("${childPlayName}") requires a statically resolved published Play contract. Publish the target with the current Deepline CLI before launching it.`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const steps = flattenStaticPipeline(input.pipeline);
|
|
36
|
+
if (
|
|
37
|
+
input.pipeline.tableNamespace ||
|
|
38
|
+
input.pipeline.sheetContract ||
|
|
39
|
+
steps.some((step) => step.type === 'dataset' || step.type === 'csv')
|
|
40
|
+
) {
|
|
41
|
+
throw new Error(
|
|
42
|
+
`${CTX_RUN_PLAY_ASYNC_DATASET_UNSUPPORTED}: ctx.runPlayAsync("${childPlayName}") launches one independent scalar or HITL Play Run, but the target owns ctx.dataset(), ctx.csv(), or a Runtime Sheet. Keep batch work in its top-level Play or extract a scalar per-record child.`,
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Admit a child against the persisted root-to-parent Play lineage. */
|
|
49
|
+
export function admitAsyncPlayLineage(input: {
|
|
50
|
+
ancestryPlayIds: readonly string[];
|
|
51
|
+
childPlayName: string;
|
|
52
|
+
}): Readonly<{ ancestryPlayIds: readonly string[]; callDepth: number }> {
|
|
53
|
+
const childPlayName = input.childPlayName.trim();
|
|
54
|
+
const ancestryPlayIds = input.ancestryPlayIds
|
|
55
|
+
.map((playId) => playId.trim())
|
|
56
|
+
.filter(Boolean);
|
|
57
|
+
if (ancestryPlayIds.includes(childPlayName)) {
|
|
58
|
+
throw new Error(
|
|
59
|
+
`${CTX_RUN_PLAY_ASYNC_RECURSIVE}: Recursive play graph detected: ${[
|
|
60
|
+
...ancestryPlayIds,
|
|
61
|
+
childPlayName,
|
|
62
|
+
].join(' -> ')}`,
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
// The lineage includes the root Play, while call depth counts child edges.
|
|
66
|
+
// Appending this child therefore makes its depth equal to the current
|
|
67
|
+
// lineage length: [root] -> child is depth 1, not depth 2.
|
|
68
|
+
const callDepth = ancestryPlayIds.length;
|
|
69
|
+
if (callDepth > MAX_ASYNC_PLAY_CALL_DEPTH) {
|
|
70
|
+
throw new Error(
|
|
71
|
+
`${CTX_RUN_PLAY_ASYNC_DEPTH_EXCEEDED}: Play-call depth exceeded (${callDepth}/${MAX_ASYNC_PLAY_CALL_DEPTH}).`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
ancestryPlayIds: [...ancestryPlayIds, childPlayName],
|
|
76
|
+
callDepth,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable checkpoint boundary kinds — the one list every checkpoint reader
|
|
3
|
+
* narrows against.
|
|
4
|
+
*
|
|
5
|
+
* Compatibility contract (`docs/runtime-compatibility-contract.md`): a parked
|
|
6
|
+
* run's checkpoint is written by one build and read by a newer-or-same build.
|
|
7
|
+
* Adding a boundary KIND is therefore not an additive change: a build that does
|
|
8
|
+
* not know the kind falls through every `existing?.kind === '...'` narrow and
|
|
9
|
+
* silently re-arms the wait or re-executes the side effect the boundary already
|
|
10
|
+
* resolved. That is a duplicate durable wait or a duplicate external effect,
|
|
11
|
+
* with no trace of what happened.
|
|
12
|
+
*
|
|
13
|
+
* So an unknown kind FAILS LOUD here instead. Recovery is roll-forward: deploy a
|
|
14
|
+
* build that understands the kind, and the parked run resumes.
|
|
15
|
+
*/
|
|
16
|
+
import type { PlayCheckpoint } from './ctx-types';
|
|
17
|
+
|
|
18
|
+
/** One entry of `PlayCheckpoint.resolvedBoundaries`. */
|
|
19
|
+
export type PlayResolvedBoundary = NonNullable<
|
|
20
|
+
PlayCheckpoint['resolvedBoundaries']
|
|
21
|
+
>[string];
|
|
22
|
+
|
|
23
|
+
/** Every boundary kind this build can replay. */
|
|
24
|
+
export const PLAY_RESOLVED_BOUNDARY_KINDS = [
|
|
25
|
+
'sleep',
|
|
26
|
+
'integration_event',
|
|
27
|
+
'fetch',
|
|
28
|
+
'step',
|
|
29
|
+
] as const satisfies readonly PlayResolvedBoundary['kind'][];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Compile fence in the other direction: adding a kind to `PlayCheckpoint`
|
|
33
|
+
* without listing it above resolves to `never` and fails the build, rather than
|
|
34
|
+
* shipping a kind that every reader would then reject at runtime.
|
|
35
|
+
*/
|
|
36
|
+
type UnlistedBoundaryKind = Exclude<
|
|
37
|
+
PlayResolvedBoundary['kind'],
|
|
38
|
+
(typeof PLAY_RESOLVED_BOUNDARY_KINDS)[number]
|
|
39
|
+
>;
|
|
40
|
+
const ALL_BOUNDARY_KINDS_LISTED: UnlistedBoundaryKind extends never
|
|
41
|
+
? true
|
|
42
|
+
: never = true;
|
|
43
|
+
void ALL_BOUNDARY_KINDS_LISTED;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Return the checkpoint entry for `boundaryId`, or throw when it carries a kind
|
|
47
|
+
* this build cannot replay. Absent (`undefined`/`null`) stays absent — an
|
|
48
|
+
* unresolved boundary is normal and simply re-arms.
|
|
49
|
+
*/
|
|
50
|
+
export function assertKnownResolvedBoundary(
|
|
51
|
+
boundaryId: string,
|
|
52
|
+
entry: PlayResolvedBoundary | null | undefined,
|
|
53
|
+
): PlayResolvedBoundary | undefined {
|
|
54
|
+
if (entry === null || entry === undefined) return undefined;
|
|
55
|
+
const kind = (entry as { kind?: unknown }).kind;
|
|
56
|
+
if (
|
|
57
|
+
typeof kind !== 'string' ||
|
|
58
|
+
!(PLAY_RESOLVED_BOUNDARY_KINDS as readonly string[]).includes(kind)
|
|
59
|
+
) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Play checkpoint boundary "${boundaryId}" is resolved with unknown kind ` +
|
|
62
|
+
`"${String(kind)}". This build only replays ` +
|
|
63
|
+
`${PLAY_RESOLVED_BOUNDARY_KINDS.join(', ')}. The checkpoint was written ` +
|
|
64
|
+
`by a newer runtime build; continuing would re-arm the wait or re-run ` +
|
|
65
|
+
`the effect this boundary already resolved. Roll forward to a build ` +
|
|
66
|
+
`that understands "${String(kind)}".`,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
return entry;
|
|
70
|
+
}
|