deepline 0.3.162 → 0.3.163
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/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-control.ts +156 -0
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/install-integrity.json +1 -0
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +1 -1
- package/dist/release.mjs +1 -1
- package/package.json +1 -1
|
@@ -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.163',
|
|
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: {
|
|
@@ -585,6 +585,7 @@ export function normalizeQueueItemState(nativeState: string): QueueItemState {
|
|
|
585
585
|
state === 'open' ||
|
|
586
586
|
state === 'pending' ||
|
|
587
587
|
state === 'queued' ||
|
|
588
|
+
state === 'continuation_pending' ||
|
|
588
589
|
state === 'active' ||
|
|
589
590
|
state === 'received' ||
|
|
590
591
|
state === 'partial'
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Owner-neutral control port for cataloged scheduled work.
|
|
3
|
+
*
|
|
4
|
+
* The shared operations surface routes by stable job id. Scheduler adapters
|
|
5
|
+
* own authorization details and durable execution; callers never invoke a
|
|
6
|
+
* GitHub workflow, Vercel route, Inngest function, or Convex root directly.
|
|
7
|
+
*/
|
|
8
|
+
export const SCHEDULED_WORK_CONTROL_CONTRACT_VERSION = 1 as const;
|
|
9
|
+
|
|
10
|
+
export type ScheduledWorkControlAction = 'run';
|
|
11
|
+
|
|
12
|
+
export type ScheduledWorkControlContext = {
|
|
13
|
+
readonly jobId: string;
|
|
14
|
+
readonly environment: string;
|
|
15
|
+
readonly requestedByUserId: string;
|
|
16
|
+
readonly requestedByEmail: string;
|
|
17
|
+
readonly reason: string;
|
|
18
|
+
readonly idempotencyKey: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ScheduledWorkRunResult = {
|
|
22
|
+
readonly operationId: string;
|
|
23
|
+
readonly status: 'queued' | 'running' | 'succeeded' | 'failed';
|
|
24
|
+
readonly replayed: boolean;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type ScheduledWorkControlConnector = {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
/** Stable implementation identity, such as `convex_cron` or `github_actions`. */
|
|
30
|
+
readonly scheduler: string;
|
|
31
|
+
readonly jobIds: readonly string[];
|
|
32
|
+
readonly actions: readonly ScheduledWorkControlAction[];
|
|
33
|
+
/** Registered owners may expose an honest read-only adapter before a safe
|
|
34
|
+
* mutation exists. These reasons are returned by the same capability API. */
|
|
35
|
+
readonly unavailableActions?: Partial<
|
|
36
|
+
Record<ScheduledWorkControlAction, string>
|
|
37
|
+
>;
|
|
38
|
+
run?: (
|
|
39
|
+
context: ScheduledWorkControlContext,
|
|
40
|
+
) => Promise<ScheduledWorkRunResult>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type ScheduledWorkControlRegisterOptions = {
|
|
44
|
+
/** Permit replacing an explicitly read-only startup adapter with its owner. */
|
|
45
|
+
readonly replaceUnavailable?: boolean;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export type ScheduledWorkControlCapability =
|
|
49
|
+
| {
|
|
50
|
+
readonly available: true;
|
|
51
|
+
readonly action: ScheduledWorkControlAction;
|
|
52
|
+
readonly connectorId: string;
|
|
53
|
+
readonly scheduler: string;
|
|
54
|
+
}
|
|
55
|
+
| {
|
|
56
|
+
readonly available: false;
|
|
57
|
+
readonly action: ScheduledWorkControlAction;
|
|
58
|
+
readonly reason: string;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Dispatch boundary shared by all scheduled-work implementations. Duplicate
|
|
63
|
+
* job ownership is a startup error so one scheduler cannot shadow another.
|
|
64
|
+
*/
|
|
65
|
+
export class ScheduledWorkControlRegistry {
|
|
66
|
+
private readonly connectorsByJobId = new Map<
|
|
67
|
+
string,
|
|
68
|
+
ScheduledWorkControlConnector
|
|
69
|
+
>();
|
|
70
|
+
|
|
71
|
+
register(
|
|
72
|
+
connector: ScheduledWorkControlConnector,
|
|
73
|
+
options: ScheduledWorkControlRegisterOptions = {},
|
|
74
|
+
): this {
|
|
75
|
+
if (!connector.id.trim())
|
|
76
|
+
throw new Error('Scheduled-work connector id is required.');
|
|
77
|
+
if (!connector.scheduler.trim())
|
|
78
|
+
throw new Error('Scheduled-work connector scheduler is required.');
|
|
79
|
+
if (connector.jobIds.length === 0)
|
|
80
|
+
throw new Error(
|
|
81
|
+
`Scheduled-work connector ${connector.id} must own at least one job.`,
|
|
82
|
+
);
|
|
83
|
+
if (
|
|
84
|
+
connector.actions.includes('run') &&
|
|
85
|
+
typeof connector.run !== 'function'
|
|
86
|
+
) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Scheduled-work connector ${connector.id} declares run without an implementation.`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (
|
|
92
|
+
connector.actions.length === 0 &&
|
|
93
|
+
Object.keys(connector.unavailableActions ?? {}).length === 0
|
|
94
|
+
) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`Scheduled-work connector ${connector.id} must declare a supported action or an explicit unavailable reason.`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
const jobIds = new Set<string>();
|
|
100
|
+
for (const jobId of connector.jobIds) {
|
|
101
|
+
if (!jobId.trim())
|
|
102
|
+
throw new Error(
|
|
103
|
+
`Scheduled-work connector ${connector.id} has an empty job id.`,
|
|
104
|
+
);
|
|
105
|
+
if (jobIds.has(jobId))
|
|
106
|
+
throw new Error(
|
|
107
|
+
`Scheduled-work connector ${connector.id} repeats job ${jobId}.`,
|
|
108
|
+
);
|
|
109
|
+
jobIds.add(jobId);
|
|
110
|
+
const existing = this.connectorsByJobId.get(jobId);
|
|
111
|
+
if (existing && !options.replaceUnavailable) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`Scheduled-work job ${jobId} is already owned by ${existing.id}.`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
if (
|
|
117
|
+
existing &&
|
|
118
|
+
options.replaceUnavailable &&
|
|
119
|
+
existing.actions.length > 0
|
|
120
|
+
) {
|
|
121
|
+
throw new Error(
|
|
122
|
+
`Scheduled-work job ${jobId} is already owned by ${existing.id}; replacement is not allowed.`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
for (const jobId of jobIds) this.connectorsByJobId.set(jobId, connector);
|
|
127
|
+
return this;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get(jobId: string): ScheduledWorkControlConnector | undefined {
|
|
131
|
+
return this.connectorsByJobId.get(jobId);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
capability(
|
|
135
|
+
jobId: string,
|
|
136
|
+
action: ScheduledWorkControlAction = 'run',
|
|
137
|
+
): ScheduledWorkControlCapability {
|
|
138
|
+
const connector = this.get(jobId);
|
|
139
|
+
if (connector?.actions.includes(action)) {
|
|
140
|
+
return {
|
|
141
|
+
available: true,
|
|
142
|
+
action,
|
|
143
|
+
connectorId: connector.id,
|
|
144
|
+
scheduler: connector.scheduler,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
available: false,
|
|
149
|
+
action,
|
|
150
|
+
reason: connector
|
|
151
|
+
? (connector.unavailableActions?.[action] ??
|
|
152
|
+
`Scheduler connector ${connector.id} does not support ${action}.`)
|
|
153
|
+
: `No shared control connector is registered for scheduler work ${jobId}.`,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
}
|
package/dist/cli/index.js
CHANGED
|
@@ -3051,7 +3051,7 @@ var SDK_RELEASE = {
|
|
|
3051
3051
|
// getters keep their established compatibility behavior.
|
|
3052
3052
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
3053
3053
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
3054
|
-
version: "0.3.
|
|
3054
|
+
version: "0.3.163",
|
|
3055
3055
|
updateSummary: "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.",
|
|
3056
3056
|
packageCapabilities: {
|
|
3057
3057
|
updatePreferences: 1
|
package/dist/cli/index.mjs
CHANGED
|
@@ -3046,7 +3046,7 @@ var SDK_RELEASE = {
|
|
|
3046
3046
|
// getters keep their established compatibility behavior.
|
|
3047
3047
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
3048
3048
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
3049
|
-
version: "0.3.
|
|
3049
|
+
version: "0.3.163",
|
|
3050
3050
|
updateSummary: "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.",
|
|
3051
3051
|
packageCapabilities: {
|
|
3052
3052
|
updatePreferences: 1
|
package/dist/index.js
CHANGED
|
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
|
|
|
864
864
|
// getters keep their established compatibility behavior.
|
|
865
865
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
866
866
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
867
|
-
version: "0.3.
|
|
867
|
+
version: "0.3.163",
|
|
868
868
|
updateSummary: "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.",
|
|
869
869
|
packageCapabilities: {
|
|
870
870
|
updatePreferences: 1
|
package/dist/index.mjs
CHANGED
|
@@ -768,7 +768,7 @@ var SDK_RELEASE = {
|
|
|
768
768
|
// getters keep their established compatibility behavior.
|
|
769
769
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
770
770
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
771
|
-
version: "0.3.
|
|
771
|
+
version: "0.3.163",
|
|
772
772
|
updateSummary: "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.",
|
|
773
773
|
packageCapabilities: {
|
|
774
774
|
updatePreferences: 1
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"dist/bundling-sources/shared_libs/observability/runtime-console.ts",
|
|
102
102
|
"dist/bundling-sources/shared_libs/observability/scheduled-job-errors.ts",
|
|
103
103
|
"dist/bundling-sources/shared_libs/observability/scheduled-jobs.json",
|
|
104
|
+
"dist/bundling-sources/shared_libs/observability/scheduled-work-control.ts",
|
|
104
105
|
"dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts",
|
|
105
106
|
"dist/bundling-sources/shared_libs/observability/scheduled-work-v2.ts",
|
|
106
107
|
"dist/bundling-sources/shared_libs/observability/scheduled-work.ts",
|
package/dist/release.d.mts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.163";
|
|
153
153
|
readonly updateSummary: "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.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ type SdkRelease = {
|
|
|
149
149
|
supportPolicy: SdkSupportPolicy;
|
|
150
150
|
};
|
|
151
151
|
declare const SDK_RELEASE: {
|
|
152
|
-
readonly version: "0.3.
|
|
152
|
+
readonly version: "0.3.163";
|
|
153
153
|
readonly updateSummary: "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.";
|
|
154
154
|
readonly packageCapabilities: {
|
|
155
155
|
readonly updatePreferences: 1;
|
package/dist/release.js
CHANGED
|
@@ -74,7 +74,7 @@ var SDK_RELEASE = {
|
|
|
74
74
|
// getters keep their established compatibility behavior.
|
|
75
75
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
76
76
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
77
|
-
version: "0.3.
|
|
77
|
+
version: "0.3.163",
|
|
78
78
|
updateSummary: "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.",
|
|
79
79
|
packageCapabilities: {
|
|
80
80
|
updatePreferences: 1
|
package/dist/release.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var SDK_RELEASE = {
|
|
|
48
48
|
// getters keep their established compatibility behavior.
|
|
49
49
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
50
50
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
51
|
-
version: "0.3.
|
|
51
|
+
version: "0.3.163",
|
|
52
52
|
updateSummary: "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.",
|
|
53
53
|
packageCapabilities: {
|
|
54
54
|
updatePreferences: 1
|