deepline 0.3.189 → 0.3.191

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.
@@ -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.189',
203
+ version: '0.3.191',
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: {
@@ -50,6 +50,15 @@ export const KNOWN_SKILL_AGENTS = [
50
50
  'windsurf',
51
51
  ] as const;
52
52
 
53
+ /** The default targets of the global skills installer. Keep in SDK core. */
54
+ export const DEFAULT_SKILL_AGENTS = [
55
+ 'codex',
56
+ 'claude-code',
57
+ 'cursor',
58
+ 'gemini-cli',
59
+ 'antigravity',
60
+ ] as const;
61
+
53
62
  export function skillsAgentPathSegment(agent: string): string {
54
63
  if (agent === '*') return 'all';
55
64
  const slug = agent.replace(/[^a-z0-9]+/gi, '-').replace(/^-+|-+$/g, '');
@@ -69,6 +78,14 @@ function legacySdkSkillsVersionPath(baseUrl: string): string {
69
78
  return join(dirname(sdkCliStateDirPath(baseUrl)), 'sdk-skills', '.version');
70
79
  }
71
80
 
81
+ function readSkillsVersionFile(path: string): string {
82
+ try {
83
+ return readFileSync(path, 'utf-8').trim();
84
+ } catch {
85
+ return '';
86
+ }
87
+ }
88
+
72
89
  export function resolveAutoSyncSkillAgents(): string[] {
73
90
  switch (detectAgentRuntime()) {
74
91
  case 'codex':
@@ -81,6 +98,8 @@ export function resolveAutoSyncSkillAgents(): string[] {
81
98
  return ['gemini-cli'];
82
99
  case 'antigravity':
83
100
  return ['antigravity'];
101
+ case 'unknown':
102
+ return [...DEFAULT_SKILL_AGENTS];
84
103
  default:
85
104
  return [];
86
105
  }
@@ -91,6 +110,13 @@ export function readSdkSkillsLocalVersion(baseUrl: string): string {
91
110
  if (pluginVersion) return pluginVersion;
92
111
 
93
112
  const agents = resolveAutoSyncSkillAgents();
113
+ if (agents.length > 1) {
114
+ const versions = agents.map((agent) =>
115
+ readSkillsVersionFile(sdkSkillsVersionPath(baseUrl, [agent])),
116
+ );
117
+ const first = versions[0];
118
+ return first && versions.every((version) => version === first) ? first : '';
119
+ }
94
120
  const scopedPath = sdkSkillsVersionPath(baseUrl, agents);
95
121
  if (agents.length > 0 && existsSync(scopedPath)) {
96
122
  try {
@@ -126,8 +152,17 @@ export function writeSdkSkillsLocalVersion(
126
152
  baseUrl: string,
127
153
  version: string,
128
154
  agents: readonly string[],
129
- ): void {
130
- const path = sdkSkillsVersionPath(baseUrl, agents);
131
- mkdirSync(dirname(path), { recursive: true });
132
- writeFileSync(path, `${version}\n`, 'utf-8');
155
+ ): boolean {
156
+ const targets = agents.length > 1 ? agents.map((agent) => [agent]) : [agents];
157
+ let complete = true;
158
+ for (const target of targets) {
159
+ const path = sdkSkillsVersionPath(baseUrl, target);
160
+ try {
161
+ mkdirSync(dirname(path), { recursive: true });
162
+ writeFileSync(path, `${version}\n`, 'utf-8');
163
+ } catch {
164
+ complete = false;
165
+ }
166
+ }
167
+ return complete;
133
168
  }
@@ -994,6 +994,8 @@ function isRetryableAppRuntimeAction(
994
994
  action === 'heartbeat_runtime_step_receipts' ||
995
995
  action === 'claim_runtime_step_receipt' ||
996
996
  action === 'claim_runtime_step_receipts' ||
997
+ // Replaying the same owner only renews its existing execution fence.
998
+ action === 'acquire_runtime_receipt_execution_lock' ||
997
999
  action === 'mark_runtime_step_receipt_running' ||
998
1000
  action === 'mark_runtime_step_receipts_running' ||
999
1001
  action === 'mark_runtime_step_receipts_queued' ||
@@ -2210,7 +2210,7 @@ async function ensurePostgresSchedulerCronScheduleSchema(
2210
2210
  * current scheduler schema takes the fast path below, so keeping these only in
2211
2211
  * the full bootstrap leaves that estate with the old whole-envelope equality.
2212
2212
  */
2213
- async function ensurePostgresSchedulerLaunchAdmissionFunctions(
2213
+ export async function ensurePostgresSchedulerLaunchAdmissionFunctions(
2214
2214
  client: PostgresSchedulerQueryClient,
2215
2215
  options?: Pick<PostgresSchedulerOptions, 'schema'>,
2216
2216
  ): Promise<void> {
@@ -12102,9 +12102,10 @@ export async function cancelPostgresSchedulerRun(
12102
12102
  engineTaskTable: string | null;
12103
12103
  };
12104
12104
  /**
12105
- * Optional control-plane ownership for the pending causal head. The
12105
+ * Optional control-plane ownership for the pending causal prefix. The
12106
12106
  * caller resumes this same lease after commit to make cancellation visible
12107
- * synchronously in the canonical Run Ledger.
12107
+ * synchronously in the canonical Run Ledger, even when a later predecessor
12108
+ * was waiting on its retry schedule.
12108
12109
  */
12109
12110
  outboxLease?: { leaseOwner: string; leaseSeconds: number };
12110
12111
  },
@@ -12237,14 +12238,15 @@ export async function cancelPostgresSchedulerRun(
12237
12238
  AND NULLIF(resource->>'sandboxId', '') IS NOT NULL
12238
12239
  ON CONFLICT (provider, sandbox_id, routing_domain_key) DO NOTHING
12239
12240
  ),
12240
- cancellation_outbox_head AS MATERIALIZED (
12241
+ -- A head-only fence leaves a delayed successor between this request
12242
+ -- and its terminal event. Own and make due the complete pending prefix;
12243
+ -- the projector still claims it in causal order after commit.
12244
+ cancellation_outbox_pending AS MATERIALIZED (
12241
12245
  SELECT pending.event_id
12242
12246
  FROM ${tableName('outbox', options)} AS pending
12243
12247
  JOIN cancelled_run ON cancelled_run.run_id = pending.run_id
12244
12248
  WHERE pending.delivered_at IS NULL
12245
12249
  AND pending.failed_at IS NULL
12246
- ORDER BY ${runLedgerOrderSql('pending')}
12247
- LIMIT 1
12248
12250
  ),
12249
12251
  cancellation_outbox_lease AS (
12250
12252
  UPDATE ${tableName('outbox', options)} AS pending
@@ -12252,7 +12254,7 @@ export async function cancelPostgresSchedulerRun(
12252
12254
  lease_expires_at = now() + make_interval(secs => $7::integer),
12253
12255
  next_attempt_at = NULL
12254
12256
  WHERE $6::text IS NOT NULL
12255
- AND pending.event_id IN (SELECT event_id FROM cancellation_outbox_head)
12257
+ AND pending.event_id IN (SELECT event_id FROM cancellation_outbox_pending)
12256
12258
  RETURNING pending.event_id
12257
12259
  ),
12258
12260
  terminal_outbox AS (
@@ -12268,12 +12270,12 @@ export async function cancelPostgresSchedulerRun(
12268
12270
  ${causalOutboxCreatedAt('cancelled_run.run_id', options)},
12269
12271
  NULL,
12270
12272
  CASE
12271
- WHEN EXISTS (SELECT 1 FROM cancellation_outbox_head) THEN NULL
12273
+ WHEN EXISTS (SELECT 1 FROM cancellation_outbox_pending) THEN NULL
12272
12274
  ELSE $6::text
12273
12275
  END,
12274
12276
  CASE
12275
12277
  WHEN $6::text IS NULL
12276
- OR EXISTS (SELECT 1 FROM cancellation_outbox_head)
12278
+ OR EXISTS (SELECT 1 FROM cancellation_outbox_pending)
12277
12279
  THEN NULL
12278
12280
  ELSE now() + make_interval(secs => $7::integer)
12279
12281
  END
@@ -12311,18 +12313,12 @@ export async function cancelPostgresSchedulerRun(
12311
12313
  SET lease_owner = $2,
12312
12314
  lease_expires_at = now() + make_interval(secs => $3::integer),
12313
12315
  next_attempt_at = NULL
12314
- WHERE pending.event_id = (
12315
- SELECT candidate.event_id
12316
- FROM ${tableName('outbox', options)} AS candidate
12317
- JOIN ${tableName('runs', options)} AS terminal_run
12318
- ON terminal_run.run_id = candidate.run_id
12319
- WHERE candidate.run_id = $1
12320
- AND candidate.delivered_at IS NULL
12321
- AND candidate.failed_at IS NULL
12322
- AND terminal_run.status IN ('completed', 'failed', 'cancelled')
12323
- ORDER BY ${runLedgerOrderSql('candidate')}
12324
- LIMIT 1
12325
- )`,
12316
+ FROM ${tableName('runs', options)} AS terminal_run
12317
+ WHERE pending.run_id = $1
12318
+ AND terminal_run.run_id = pending.run_id
12319
+ AND terminal_run.status IN ('completed', 'failed', 'cancelled')
12320
+ AND pending.delivered_at IS NULL
12321
+ AND pending.failed_at IS NULL`,
12326
12322
  [input.runId, outboxLeaseOwner, outboxLeaseSeconds],
12327
12323
  );
12328
12324
  }