deepline 0.3.32 → 0.3.34

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.
@@ -202,6 +202,7 @@ export async function checkSdkCompatibility(
202
202
  'X-Deepline-SDK-Version': SDK_VERSION,
203
203
  'X-Deepline-API-Major': String(SDK_API_MAJOR),
204
204
  'X-Deepline-API-Contract': SDK_API_CONTRACT,
205
+ 'X-Deepline-CLI-Update-Preferences': '1',
205
206
  },
206
207
  signal: controller.signal,
207
208
  });
@@ -97,9 +97,11 @@ export type SdkSupportPolicy = {
97
97
  * Deliberately not a support floor. `commandMinimumSupported` says an older
98
98
  * client is BROKEN for a command and forces an update; this says only that
99
99
  * an older client never had the command at all. That difference matters in
100
- * both directions: introducing a command must not auto-update anyone, and a
101
- * support floor may not exceed the version being released, while an
102
- * introduction version is a fact about an already-published release.
100
+ * both directions: introducing a command must not independently require an
101
+ * update, and a support floor may not exceed the version being released,
102
+ * while an introduction version is a fact about an already-published
103
+ * release. The general default-on freshness policy may still update an older
104
+ * installed CLI.
103
105
  *
104
106
  * It exists because agent skills are served by the backend and re-synced on
105
107
  * nearly every CLI invocation, while the CLI stays pinned. A release that
@@ -124,8 +126,8 @@ export type SdkSupportPolicy = {
124
126
  directToolsCompatibilityVersions?: readonly string[];
125
127
  /**
126
128
  * Diagnostic freshness threshold reported by `/api/v2/sdk/compat`.
127
- * Stale-but-supported CLIs warn, but self-update is reserved for unsupported
128
- * versions and rollback-directed updates.
129
+ * Ownership-aware installed CLIs auto-update when older; this value remains
130
+ * metadata for clients and operational diagnostics.
129
131
  */
130
132
  autoUpdatePatchLag?: number;
131
133
  };
@@ -142,6 +144,10 @@ export type SdkRelease = {
142
144
  * in its existing update message so older installed CLIs can print it too.
143
145
  */
144
146
  updateSummary?: string;
147
+ /** Capabilities stamped into the published package's `deepline` metadata. */
148
+ packageCapabilities: {
149
+ updatePreferences: 1;
150
+ };
145
151
  /** Named compatibility policies. This is the only authored contract policy. */
146
152
  contracts: DeeplineContractPolicy;
147
153
  /** Public support policy reported by `/api/v2/sdk/compat`. */
@@ -192,9 +198,13 @@ export const SDK_RELEASE = {
192
198
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
193
199
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
194
200
  // getters keep their established compatibility behavior.
195
- version: '0.3.32',
201
+ // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
+ version: '0.3.34',
196
203
  updateSummary:
197
- 'New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.',
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
+ packageCapabilities: {
206
+ updatePreferences: 1,
207
+ },
198
208
  contracts: {
199
209
  api: {
200
210
  name: 'sdk-http-api',
@@ -221,7 +231,7 @@ export const SDK_RELEASE = {
221
231
  },
222
232
  supportPolicy: {
223
233
  minimumSupported: '0.1.53',
224
- deprecatedBelow: '0.1.219',
234
+ deprecatedBelow: '0.3.1',
225
235
  commandIntroducedIn: [
226
236
  {
227
237
  command: 'notifications',
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Execution ABI for a persisted Play launch.
3
+ *
4
+ * This is deliberately separate from a customer Play artifact version and a
5
+ * worker image/release id. The artifact is immutable customer code; this
6
+ * protocol names the stable coordinator <-> worker <-> runner contract used
7
+ * to resume that artifact. A worker may support several protocol versions,
8
+ * but it must reject an unknown one loudly rather than guessing how to replay
9
+ * a persisted run.
10
+ */
11
+ export const PLAY_RUNTIME_PROTOCOL = {
12
+ /** Launches written before this field existed. */
13
+ legacy: 0,
14
+ /** Current scheduler/runner protocol. */
15
+ current: 1,
16
+ } as const;
17
+
18
+ export type PlayRuntimeProtocolVersion =
19
+ (typeof PLAY_RUNTIME_PROTOCOL)[keyof typeof PLAY_RUNTIME_PROTOCOL];
20
+
21
+ const SUPPORTED_PROTOCOLS = new Set<number>([
22
+ PLAY_RUNTIME_PROTOCOL.legacy,
23
+ PLAY_RUNTIME_PROTOCOL.current,
24
+ ]);
25
+
26
+ /** New launches always get an explicit protocol snapshot. */
27
+ export function protocolForNewPlayRuntimeLaunch(
28
+ value?: PlayRuntimeProtocolVersion | null,
29
+ ): PlayRuntimeProtocolVersion {
30
+ return value == null
31
+ ? PLAY_RUNTIME_PROTOCOL.current
32
+ : protocolForPersistedPlayRuntimeLaunch(value);
33
+ }
34
+
35
+ /** Missing is valid only for historic rows written before the field existed. */
36
+ export function protocolForPersistedPlayRuntimeLaunch(
37
+ value: unknown,
38
+ ): PlayRuntimeProtocolVersion {
39
+ if (value == null) return PLAY_RUNTIME_PROTOCOL.legacy;
40
+ if (
41
+ typeof value === 'number' &&
42
+ Number.isSafeInteger(value) &&
43
+ SUPPORTED_PROTOCOLS.has(value)
44
+ ) {
45
+ return value as PlayRuntimeProtocolVersion;
46
+ }
47
+ throw new Error(
48
+ `Unsupported Play runtime protocol ${JSON.stringify(value)}. The run remains durable but requires a worker with an explicit compatibility handler.`,
49
+ );
50
+ }
51
+
52
+ /**
53
+ * A worker declares the persisted protocols it can execute. Keep an old
54
+ * protocol here until every open run using it is terminal and retained history
55
+ * no longer needs replay support; do not use deployment SHA as this boundary.
56
+ */
57
+ export const WORKER_SUPPORTED_PLAY_RUNTIME_PROTOCOLS = [
58
+ PLAY_RUNTIME_PROTOCOL.legacy,
59
+ PLAY_RUNTIME_PROTOCOL.current,
60
+ ] as const satisfies readonly PlayRuntimeProtocolVersion[];
61
+
62
+ export function assertWorkerSupportsPlayRuntimeProtocol(
63
+ value: unknown,
64
+ supported: readonly PlayRuntimeProtocolVersion[] = WORKER_SUPPORTED_PLAY_RUNTIME_PROTOCOLS,
65
+ ): PlayRuntimeProtocolVersion {
66
+ const protocol = protocolForPersistedPlayRuntimeLaunch(value);
67
+ if (supported.includes(protocol)) return protocol;
68
+ throw new Error(
69
+ `Play runtime protocol ${protocol} is not supported by this worker. Refuse to execute rather than replaying with an incompatible runtime.`,
70
+ );
71
+ }
@@ -22,6 +22,7 @@ import type { PlayRunnerRuntimeTiming } from './protocol';
22
22
  import type { RuntimeTestPolicyOverrides } from './test-runtime-seams';
23
23
  import type { PlayRunInputPayload } from './play-input';
24
24
  import type { RuntimeSandboxPlacementPolicyId } from './runtime-sandbox-placement-policy';
25
+ import type { PlayRuntimeProtocolVersion } from './execution-protocol';
25
26
 
26
27
  export const PLAY_SCHEDULER_BACKENDS = {
27
28
  /**
@@ -48,6 +49,8 @@ export type PlaySchedulerSubmitInput = {
48
49
  runtimeArtifact?: unknown;
49
50
  artifactHash: string;
50
51
  graphHash: string;
52
+ /** Immutable scheduler/worker/runner ABI snapshot (not a Git SHA). */
53
+ runtimeProtocolVersion?: PlayRuntimeProtocolVersion | null;
51
54
  input: PlayRunInputPayload;
52
55
  /** Convex metadata for the exact input saved before scheduler submission. */
53
56
  inputFileId?: string;