dp-worker 0.1.3 → 0.1.5

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.
Files changed (35) hide show
  1. package/dist/browser/chrome-process.js +30 -58
  2. package/dist/browser/chrome-process.js.map +1 -1
  3. package/dist/chrome-extension/omni-flow/background.js +24 -6
  4. package/node_modules/dp-shared/dist/configs-contracts.d.ts +5 -0
  5. package/node_modules/dp-shared/dist/configs-contracts.d.ts.map +1 -1
  6. package/node_modules/dp-shared/dist/configs-contracts.js +5 -0
  7. package/node_modules/dp-shared/dist/configs-contracts.js.map +1 -1
  8. package/node_modules/dp-shared/dist/db-rows.d.ts +1 -1
  9. package/node_modules/dp-shared/dist/db-rows.d.ts.map +1 -1
  10. package/node_modules/dp-shared/dist/db-rows.js +1 -1
  11. package/node_modules/dp-shared/dist/db-rows.js.map +1 -1
  12. package/node_modules/dp-shared/dist/identities.d.ts +2 -0
  13. package/node_modules/dp-shared/dist/identities.d.ts.map +1 -1
  14. package/node_modules/dp-shared/dist/identities.js +2 -0
  15. package/node_modules/dp-shared/dist/identities.js.map +1 -1
  16. package/node_modules/dp-shared/dist/task-history-contracts.d.ts +6 -0
  17. package/node_modules/dp-shared/dist/task-history-contracts.d.ts.map +1 -1
  18. package/node_modules/dp-shared/dist/task-history-contracts.js +3 -0
  19. package/node_modules/dp-shared/dist/task-history-contracts.js.map +1 -1
  20. package/node_modules/dp-shared/dist/worker-detail-contracts.d.ts +2 -0
  21. package/node_modules/dp-shared/dist/worker-detail-contracts.d.ts.map +1 -1
  22. package/package.json +1 -1
  23. package/node_modules/dp-shared/src/admin-broadcast.ts +0 -38
  24. package/node_modules/dp-shared/src/audit-contracts.ts +0 -33
  25. package/node_modules/dp-shared/src/configs-contracts.ts +0 -206
  26. package/node_modules/dp-shared/src/db-rows.ts +0 -280
  27. package/node_modules/dp-shared/src/deploy-contracts.ts +0 -38
  28. package/node_modules/dp-shared/src/domain.ts +0 -124
  29. package/node_modules/dp-shared/src/identities.ts +0 -36
  30. package/node_modules/dp-shared/src/index.ts +0 -25
  31. package/node_modules/dp-shared/src/omni-flow-session.ts +0 -80
  32. package/node_modules/dp-shared/src/rest-contracts.ts +0 -409
  33. package/node_modules/dp-shared/src/task-history-contracts.ts +0 -115
  34. package/node_modules/dp-shared/src/worker-detail-contracts.ts +0 -230
  35. package/node_modules/dp-shared/src/ws-protocol.ts +0 -435
@@ -1,38 +0,0 @@
1
- /**
2
- * Wire types shared by the AdminBroadcast Durable Object (server) and the
3
- * useAdminSocket hook (browser). See
4
- * docs/superpowers/specs/2026-05-28-live-page-refresh-design.md.
5
- */
6
-
7
- export type AdminTopic =
8
- | "workers"
9
- | "directors"
10
- | "identities"
11
- | "proxies"
12
- | "llm_profiles"
13
- | "groups"
14
- | "users"
15
- | "social_accounts"
16
- | "scheduled_tasks"
17
- | "adhoc_batches"
18
- | "task_runs"
19
- | "audit_log"
20
- | "worker_chat_messages"
21
- | "group_chat_messages"
22
- | "dispatch_settings";
23
-
24
- export interface Envelope<T = unknown> {
25
- v: 1;
26
- topic: AdminTopic;
27
- op: "inserted" | "updated" | "deleted";
28
- /** For op:"deleted" this is just `{ id }`. */
29
- row: T;
30
- /** ms since epoch, stamped by broadcaster.publish. */
31
- ts: number;
32
- }
33
-
34
- /** Inbound messages the browser sends on the open admin WS. */
35
- export type AdminClientOp =
36
- | { op: "subscribe"; topics: AdminTopic[] }
37
- | { op: "unsubscribe"; topics: AdminTopic[] }
38
- | { op: "ping" };
@@ -1,33 +0,0 @@
1
- import { z } from "zod/v4";
2
- import { Uuid } from "./domain.js";
3
-
4
- /**
5
- * Audit-log read contracts (M8 Agent X).
6
- *
7
- * Every mutating handler in dp-center-worker writes one audit_log row via
8
- * `writeAudit(...)` wrapped in `c.executionCtx.waitUntil`. The UI reads
9
- * back through `GET /api/audit-log` which paginates newest-first by
10
- * `(created_at, id) DESC` with an opaque base64url cursor.
11
- *
12
- * `actor_email` is JOIN-resolved from `public.users` so the list view can
13
- * render "alice@example.com did X" without a second lookup. `payload_json`
14
- * is a small, human-readable hint object — never row data, never secrets.
15
- */
16
- export const AuditLogItemSchema = z.object({
17
- id: Uuid,
18
- actor_user_id: Uuid.optional(),
19
- actor_email: z.string().optional(),
20
- actor_machine_id: Uuid.optional(),
21
- action: z.string(),
22
- target_type: z.string(),
23
- target_id: z.string(),
24
- payload_json: z.unknown().nullable(),
25
- created_at: z.string().datetime(),
26
- });
27
- export type AuditLogItem = z.infer<typeof AuditLogItemSchema>;
28
-
29
- export const AuditLogListResponseSchema = z.object({
30
- items: z.array(AuditLogItemSchema),
31
- next_cursor: z.string().optional(),
32
- });
33
- export type AuditLogListResponse = z.infer<typeof AuditLogListResponseSchema>;
@@ -1,206 +0,0 @@
1
- import { z } from "zod/v4";
2
- import {
3
- DpWorkerRuntimeMode,
4
- DpWorkerUpgradeStatus,
5
- EffectiveDirectorStatus,
6
- IanaTimezone,
7
- LlmProtocol,
8
- ProxyProtocol,
9
- } from "./domain.js";
10
-
11
- /**
12
- * Request/response contracts for the `/configs/*` REST family — LLM profile
13
- * and proxy CRUD that the Web UI drives. Kept distinct from
14
- * `rest-contracts.ts` so the wave-1 UI work doesn't touch the
15
- * already-stable bootstrap/task schemas.
16
- *
17
- * Notes:
18
- * - LLM profile responses include `api_key` / `image_api_key` in plaintext
19
- * for the admin UI's reveal/copy affordance (internal-use project; see
20
- * CLAUDE.md). dp-worker bootstrap reads the same secrets via a separate
21
- * schema (`LlmProfileSchema` in rest-contracts.ts).
22
- * - Proxy responses include `password` in plaintext for the same reason
23
- * (admin UI reveal/copy).
24
- * - `base_url` is sanitized server-side per the project convention (strip
25
- * trailing `/v1`); the client can send either form.
26
- */
27
-
28
- /* ============================================================================
29
- * LLM profiles
30
- * ============================================================================ */
31
-
32
- export const LlmProfileBodySchema = z.object({
33
- name: z.string().min(1).max(120),
34
- protocol: LlmProtocol,
35
- base_url: z.string().min(1).max(500),
36
- api_key: z.string().min(1),
37
- model: z.string().min(1).max(120),
38
- image_model: z.string().min(1).max(120).optional(),
39
- image_api_key: z.string().min(1).optional(),
40
- image_size: z.string().min(1).max(40).optional(),
41
- });
42
- export type LlmProfileBody = z.infer<typeof LlmProfileBodySchema>;
43
-
44
- export const LlmProfilePatchSchema = z
45
- .object({
46
- name: z.string().min(1).max(120).optional(),
47
- protocol: LlmProtocol.optional(),
48
- base_url: z.string().min(1).max(500).optional(),
49
- api_key: z.string().min(1).optional(),
50
- model: z.string().min(1).max(120).optional(),
51
- image_model: z.string().min(1).max(120).nullable().optional(),
52
- image_api_key: z.string().min(1).nullable().optional(),
53
- image_size: z.string().min(1).max(40).nullable().optional(),
54
- })
55
- .refine((v) => Object.keys(v).length > 0, {
56
- message: "patch body must contain at least one field",
57
- });
58
- export type LlmProfilePatch = z.infer<typeof LlmProfilePatchSchema>;
59
-
60
- export const LlmProfileListItemSchema = z.object({
61
- id: z.string().uuid(),
62
- name: z.string(),
63
- protocol: LlmProtocol,
64
- base_url: z.string(),
65
- api_key: z.string(),
66
- model: z.string(),
67
- image_model: z.string().optional(),
68
- image_api_key: z.string().optional(),
69
- image_size: z.string().optional(),
70
- in_use_by_worker_count: z.number().int().nonnegative(),
71
- created_at: z.string().datetime(),
72
- updated_at: z.string().datetime(),
73
- });
74
- export type LlmProfileListItem = z.infer<typeof LlmProfileListItemSchema>;
75
-
76
- export const LlmProfileTestResultSchema = z.object({
77
- ok: z.boolean(),
78
- latency_ms: z.number().int().nonnegative(),
79
- detail: z.string(),
80
- });
81
- export type LlmProfileTestResult = z.infer<
82
- typeof LlmProfileTestResultSchema
83
- >;
84
-
85
- /* ============================================================================
86
- * Proxies
87
- * ============================================================================ */
88
-
89
- export const ProxyBodySchema = z.object({
90
- label: z.string().min(1).max(120),
91
- protocol: ProxyProtocol,
92
- host: z.string().min(1).max(255),
93
- port: z.number().int().positive().max(65535),
94
- username: z.string().min(1).max(255),
95
- password: z.string().min(1),
96
- timezone: IanaTimezone,
97
- note: z.string().max(2000).optional(),
98
- });
99
- export type ProxyBody = z.infer<typeof ProxyBodySchema>;
100
-
101
- export const ProxyPatchSchema = z
102
- .object({
103
- label: z.string().min(1).max(120).optional(),
104
- protocol: ProxyProtocol.optional(),
105
- host: z.string().min(1).max(255).optional(),
106
- port: z.number().int().positive().max(65535).optional(),
107
- username: z.string().min(1).max(255).optional(),
108
- password: z.string().min(1).optional(),
109
- timezone: IanaTimezone.optional(),
110
- note: z.string().max(2000).nullable().optional(),
111
- })
112
- .refine((v) => Object.keys(v).length > 0, {
113
- message: "patch body must contain at least one field",
114
- });
115
- export type ProxyPatch = z.infer<typeof ProxyPatchSchema>;
116
-
117
- export const ProxyListItemSchema = z.object({
118
- id: z.string().uuid(),
119
- label: z.string(),
120
- protocol: ProxyProtocol,
121
- host: z.string(),
122
- port: z.number().int().positive(),
123
- username: z.string(),
124
- password: z.string(),
125
- timezone: IanaTimezone,
126
- note: z.string().optional(),
127
- in_use_by_worker_id: z.string().uuid().optional(),
128
- /** How many identities currently have this proxy bound. */
129
- bound_identity_count: z.number().int().nonnegative().default(0),
130
- created_at: z.string().datetime(),
131
- updated_at: z.string().datetime(),
132
- });
133
- export type ProxyListItem = z.infer<typeof ProxyListItemSchema>;
134
-
135
- export const ProxyTestResultSchema = z.object({
136
- ok: z.boolean(),
137
- latency_ms: z.number().int().nonnegative(),
138
- detail: z.string(),
139
- });
140
- export type ProxyTestResult = z.infer<typeof ProxyTestResultSchema>;
141
-
142
- /* ============================================================================
143
- * dp-directors
144
- * ============================================================================ */
145
-
146
- export const DirectorListItemSchema = z.object({
147
- id: z.string().uuid(),
148
- name: z.string(),
149
- host_label: z.string(),
150
- api_key: z.string(),
151
- status: EffectiveDirectorStatus,
152
- max_concurrent_tasks: z.number().int().nonnegative().default(0),
153
- last_heartbeat_at: z.string().datetime().optional(),
154
- version: z.string().optional(),
155
- dp_worker_version: z.string().optional(),
156
- dp_worker_latest_version: z.string().optional(),
157
- dp_worker_runtime_mode: DpWorkerRuntimeMode.optional(),
158
- dp_worker_upgrade_status: DpWorkerUpgradeStatus.optional(),
159
- dp_worker_upgrade_message: z.string().optional(),
160
- dp_worker_upgrade_started_at: z.string().datetime().optional(),
161
- dp_worker_upgrade_finished_at: z.string().datetime().optional(),
162
- created_at: z.string().datetime(),
163
- updated_at: z.string().datetime(),
164
- });
165
- export type DirectorListItem = z.infer<typeof DirectorListItemSchema>;
166
-
167
- export const DirectorCreateBodySchema = z.object({
168
- name: z.string().trim().min(1),
169
- host_label: z.string().trim().min(1),
170
- api_key: z.string().trim().min(1).optional(),
171
- max_concurrent_tasks: z.number().int().nonnegative().default(0),
172
- });
173
- export type DirectorCreateBody = z.infer<typeof DirectorCreateBodySchema>;
174
-
175
- export const DirectorPatchSchema = z
176
- .object({
177
- name: z.string().trim().min(1).optional(),
178
- host_label: z.string().trim().min(1).optional(),
179
- api_key: z.string().trim().min(1).optional(),
180
- max_concurrent_tasks: z.number().int().nonnegative().optional(),
181
- })
182
- .refine((v) => Object.keys(v).length > 0, {
183
- message: "patch body must contain at least one field",
184
- });
185
- export type DirectorPatch = z.infer<typeof DirectorPatchSchema>;
186
-
187
- /* ============================================================================
188
- * Dispatch settings
189
- * ============================================================================ */
190
-
191
- export const DispatchSettingsSchema = z.object({
192
- global_max_concurrent_tasks: z.number().int().nonnegative().default(0),
193
- updated_at: z.string().datetime(),
194
- });
195
- export type DispatchSettings = z.infer<typeof DispatchSettingsSchema>;
196
-
197
- export const DispatchSettingsPatchSchema = z
198
- .object({
199
- global_max_concurrent_tasks: z.number().int().nonnegative().optional(),
200
- })
201
- .refine((v) => Object.keys(v).length > 0, {
202
- message: "patch body must contain at least one field",
203
- });
204
- export type DispatchSettingsPatch = z.infer<
205
- typeof DispatchSettingsPatchSchema
206
- >;
@@ -1,280 +0,0 @@
1
- import { z } from "zod/v4";
2
- import {
3
- ProcessStatus,
4
- RuntimeStatus,
5
- ChatScopeType,
6
- ConfigEtag,
7
- ContentHash,
8
- DpWorkerRuntimeMode,
9
- DpWorkerUpgradeStatus,
10
- IanaTimezone,
11
- LlmProtocol,
12
- ProxyProtocol,
13
- SocialPlatform,
14
- TaskRunStatus,
15
- TaskSource,
16
- UserRole,
17
- Uuid,
18
- } from "./domain.js";
19
-
20
- /**
21
- * Database row schemas — mirror the Postgres tables described in
22
- * docs/architecture.md §Data model. These are the canonical TypeScript shapes
23
- * that DAL code (Workers `src/lib/db.ts`) returns; do not hand-roll row types
24
- * elsewhere.
25
- *
26
- * All timestamps are ISO-8601 strings here (postgres.js returns Date but we
27
- * normalize at the DAL boundary). Nullable columns are modelled with .optional().
28
- */
29
-
30
- const Timestamps = {
31
- created_at: z.string().datetime(),
32
- updated_at: z.string().datetime(),
33
- };
34
-
35
- export const TenantRow = z.object({
36
- id: Uuid,
37
- name: z.string().min(1),
38
- ...Timestamps,
39
- });
40
-
41
- export const UserRow = z.object({
42
- id: Uuid,
43
- email: z.string().email(),
44
- role: UserRole,
45
- ...Timestamps,
46
- });
47
-
48
- export const ProxyRow = z.object({
49
- id: Uuid,
50
- label: z.string().min(1),
51
- protocol: ProxyProtocol,
52
- host: z.string().min(1),
53
- port: z.number().int().positive(),
54
- username: z.string().min(1),
55
- password: z.string().min(1),
56
- /** IANA timezone of the proxy egress. Required since v2.1 of the plan. */
57
- timezone: IanaTimezone,
58
- note: z.string().optional(),
59
- in_use_by_worker_id: Uuid.optional(),
60
- ...Timestamps,
61
- });
62
-
63
- export const LlmProfileRow = z.object({
64
- id: Uuid,
65
- name: z.string().min(1),
66
- protocol: LlmProtocol,
67
- base_url: z.string().min(1),
68
- api_key: z.string().min(1),
69
- model: z.string().min(1),
70
- image_model: z.string().optional(),
71
- image_api_key: z.string().optional(),
72
- image_size: z.string().optional(),
73
- ...Timestamps,
74
- });
75
-
76
- export const DirectorRow = z.object({
77
- id: Uuid,
78
- name: z.string().min(1),
79
- api_key: z.string().min(1),
80
- host_label: z.string().min(1),
81
- max_concurrent_tasks: z.number().int().nonnegative().default(0),
82
- last_heartbeat_at: z.string().datetime().optional(),
83
- version: z.string().optional(),
84
- dp_worker_version: z.string().optional(),
85
- dp_worker_latest_version: z.string().optional(),
86
- dp_worker_runtime_mode: DpWorkerRuntimeMode.optional(),
87
- dp_worker_upgrade_status: DpWorkerUpgradeStatus.optional(),
88
- dp_worker_upgrade_message: z.string().optional(),
89
- dp_worker_upgrade_started_at: z.string().datetime().optional(),
90
- dp_worker_upgrade_finished_at: z.string().datetime().optional(),
91
- ...Timestamps,
92
- });
93
-
94
- export const WorkerRow = z.object({
95
- id: Uuid,
96
- name: z.string().min(1),
97
- director_id: Uuid.optional(),
98
- api_key: z.string().min(1),
99
- llm_profile_id: Uuid,
100
- proxy_id: Uuid.optional(),
101
- /**
102
- * Per-dp-worker Chrome headless flag (M6). Defaults to false at the schema
103
- * level; operators flip it via Web UI.
104
- */
105
- headless: z.boolean().default(false),
106
- identity_id: Uuid.nullable().optional(),
107
- process_status: ProcessStatus,
108
- process_observed_at: z.string().datetime().optional(),
109
- runtime_status: RuntimeStatus,
110
- runtime_observed_at: z.string().datetime().optional(),
111
- last_heartbeat_at: z.string().datetime().optional(),
112
- current_task_id: Uuid.optional(),
113
- config_etag: ConfigEtag,
114
- session_content_hash: ContentHash.optional(),
115
- telegram_bot_token: z.string().optional(),
116
- telegram_allowed_users: z.array(z.number().int()).optional(),
117
- ...Timestamps,
118
- });
119
-
120
- export const SocialAccountRow = z.object({
121
- id: Uuid,
122
- identity_id: Uuid,
123
- platform: SocialPlatform,
124
- profile_name: z.string().default(""),
125
- login_type: z.enum(["password", "oauth"]).default("password"),
126
- username: z.string().nullable(),
127
- email: z.string().nullable(),
128
- password: z.string().nullable(),
129
- /** NULL = inherit identity.persona_text; non-null = own persona. */
130
- persona_text: z.string().nullable(),
131
- persona_other_json: z.record(z.string(), z.unknown()).optional(),
132
- enabled: z.boolean().default(true),
133
- ...Timestamps,
134
- });
135
-
136
- export const WorkerGroupRow = z.object({
137
- id: Uuid,
138
- name: z.string().min(1),
139
- description: z.string().optional(),
140
- ...Timestamps,
141
- });
142
-
143
- export const WorkerGroupMemberRow = z.object({
144
- group_id: Uuid,
145
- worker_id: Uuid,
146
- added_at: z.string().datetime(),
147
- });
148
-
149
- export const ChromeSessionRow = z.object({
150
- id: Uuid,
151
- identity_id: Uuid,
152
- r2_object_key: z.string().min(1),
153
- content_hash: ContentHash,
154
- size_bytes: z.number().int().positive(),
155
- uploaded_by: Uuid,
156
- uploaded_at: z.string().datetime(),
157
- note: z.string().optional(),
158
- });
159
-
160
- export const ScheduledTaskRow = z.object({
161
- id: Uuid,
162
- worker_id: Uuid,
163
- name: z.string().min(1),
164
- cron: z.string().min(1),
165
- timezone: z.string().optional(),
166
- prompt: z.string().min(1),
167
- random_delay_seconds: z.number().int().nonnegative().default(0),
168
- enabled: z.boolean(),
169
- last_run_at: z.string().datetime().optional(),
170
- last_status: z.enum(["ok", "error"]).optional(),
171
- run_count: z.number().int().nonnegative().default(0),
172
- success_count: z.number().int().nonnegative().default(0),
173
- created_by: Uuid.optional(),
174
- ...Timestamps,
175
- });
176
-
177
- export const TaskRunRow = z.object({
178
- id: Uuid,
179
- worker_id: Uuid,
180
- scheduled_task_id: Uuid.optional(),
181
- source: TaskSource,
182
- prompt: z.string().min(1),
183
- target_descriptor_json: z.record(z.string(), z.unknown()).optional(),
184
- status: TaskRunStatus,
185
- dispatched_at: z.string().datetime().optional(),
186
- started_at: z.string().datetime().optional(),
187
- finished_at: z.string().datetime().optional(),
188
- result_summary: z.string().optional(),
189
- error: z.string().optional(),
190
- randomized_delay_ms: z.number().int().nonnegative().default(0),
191
- created_by: Uuid.optional(),
192
- parent_adhoc_task_id: Uuid.optional(),
193
- ...Timestamps,
194
- });
195
-
196
- export const AdhocTaskBatchRow = z.object({
197
- id: Uuid,
198
- name: z.string().min(1),
199
- prompt: z.string().min(1),
200
- target_descriptor_json: z.record(z.string(), z.unknown()),
201
- random_delay_seconds: z.number().int().nonnegative().default(0),
202
- dispatch_window_seconds: z.number().int().nonnegative().default(0),
203
- created_by: Uuid.optional(),
204
- created_at: z.string().datetime(),
205
- summary_stats_json: z.record(z.string(), z.unknown()).optional(),
206
- });
207
-
208
- export const TaskDispatchQueueRow = z.object({
209
- id: Uuid,
210
- worker_id: Uuid,
211
- task_run_id: Uuid,
212
- eta: z.string().datetime(),
213
- priority: z.number().int().default(0),
214
- attempts: z.number().int().nonnegative().default(0),
215
- ...Timestamps,
216
- });
217
-
218
- export const ChatRow = z.object({
219
- id: Uuid,
220
- scope_type: ChatScopeType,
221
- scope_id: Uuid,
222
- last_message_at: z.string().datetime().optional(),
223
- ...Timestamps,
224
- });
225
-
226
- export const ChatMessageRow = z.object({
227
- id: Uuid,
228
- chat_id: Uuid,
229
- role: z.string().min(1),
230
- content_json: z.unknown(),
231
- attachment_ids: z.array(Uuid).default([]),
232
- task_run_id: Uuid.optional(),
233
- sender_user_id: Uuid.optional(),
234
- created_at: z.string().datetime(),
235
- });
236
-
237
- export const AttachmentRow = z.object({
238
- id: Uuid,
239
- chat_id: Uuid.optional(),
240
- r2_object_key: z.string().min(1),
241
- filename: z.string().min(1),
242
- mime: z.string().optional(),
243
- size: z.number().int().positive(),
244
- uploaded_by: Uuid,
245
- created_at: z.string().datetime(),
246
- });
247
-
248
- export const AuditLogRow = z.object({
249
- id: Uuid,
250
- actor_user_id: Uuid.optional(),
251
- actor_machine_id: Uuid.optional(),
252
- action: z.string().min(1),
253
- target_type: z.string().min(1),
254
- target_id: z.string().min(1),
255
- payload_json: z.record(z.string(), z.unknown()).optional(),
256
- created_at: z.string().datetime(),
257
- });
258
-
259
- /* ============================================================================
260
- * Inferred row types — what DAL functions return.
261
- * ============================================================================ */
262
-
263
- export type TenantRow = z.infer<typeof TenantRow>;
264
- export type UserRow = z.infer<typeof UserRow>;
265
- export type ProxyRow = z.infer<typeof ProxyRow>;
266
- export type LlmProfileRow = z.infer<typeof LlmProfileRow>;
267
- export type DirectorRow = z.infer<typeof DirectorRow>;
268
- export type WorkerRow = z.infer<typeof WorkerRow>;
269
- export type SocialAccountRow = z.infer<typeof SocialAccountRow>;
270
- export type WorkerGroupRow = z.infer<typeof WorkerGroupRow>;
271
- export type WorkerGroupMemberRow = z.infer<typeof WorkerGroupMemberRow>;
272
- export type ChromeSessionRow = z.infer<typeof ChromeSessionRow>;
273
- export type ScheduledTaskRow = z.infer<typeof ScheduledTaskRow>;
274
- export type TaskRunRow = z.infer<typeof TaskRunRow>;
275
- export type AdhocTaskBatchRow = z.infer<typeof AdhocTaskBatchRow>;
276
- export type TaskDispatchQueueRow = z.infer<typeof TaskDispatchQueueRow>;
277
- export type ChatRow = z.infer<typeof ChatRow>;
278
- export type ChatMessageRow = z.infer<typeof ChatMessageRow>;
279
- export type AttachmentRow = z.infer<typeof AttachmentRow>;
280
- export type AuditLogRow = z.infer<typeof AuditLogRow>;
@@ -1,38 +0,0 @@
1
- import { z } from "zod/v4";
2
- import { Uuid } from "./domain.js";
3
-
4
- /**
5
- * dp-worker lifecycle deploy / restart / stop contracts (M-X wave 2 Agent A).
6
- *
7
- * The UI button hits dp-center-worker; dp-center-worker RPCs the DirectorConnection DO,
8
- * which forwards a `spawn_worker` / `restart_worker` / `stop_worker` envelope
9
- * (defined in ws-protocol.ts) over the hibernating WS to the dp-director. The
10
- * dp-director's `worker_state_change` flows back asynchronously — the REST call
11
- * just confirms the envelope was queued for delivery.
12
- *
13
- * Request bodies are intentionally thin: the WS envelope is assembled
14
- * server-side from the dp-worker row (api_key, director_id, …) so callers never
15
- * see the api_key in the wire path.
16
- */
17
-
18
- /** No body. The deploy envelope is constructed entirely server-side. */
19
- export const DeployRequestSchema = z.object({});
20
- export type DeployRequest = z.infer<typeof DeployRequestSchema>;
21
-
22
- /** Same shape used by all three lifecycle endpoints on the 202 path. */
23
- export const DeployResponseSchema = z.object({
24
- accepted: z.literal(true),
25
- envelope_id: Uuid,
26
- director_id: Uuid,
27
- });
28
- export type DeployResponse = z.infer<typeof DeployResponseSchema>;
29
-
30
- /**
31
- * Optional `graceful` flag on stop. When `false` the dp-director SIGKILLs instead
32
- * of giving the dp-worker process its normal SIGTERM grace window. Defaults to
33
- * true (graceful) when the body is omitted.
34
- */
35
- export const StopRequestSchema = z.object({
36
- graceful: z.boolean().optional(),
37
- });
38
- export type StopRequest = z.infer<typeof StopRequestSchema>;