@parallelworks/code 0.1.0 → 0.3.0

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 (118) hide show
  1. package/README.md +171 -24
  2. package/dist/ago.d.ts +8 -0
  3. package/dist/ago.js +26 -0
  4. package/dist/api.d.ts +3547 -0
  5. package/dist/apiClient.d.ts +26 -0
  6. package/dist/apiClient.js +5 -0
  7. package/dist/base64.d.ts +3 -0
  8. package/dist/base64.js +15 -0
  9. package/dist/chatHandoff.d.ts +12 -0
  10. package/dist/chatHandoff.js +27 -0
  11. package/dist/claudeAccounts.d.ts +112 -0
  12. package/dist/claudeAccounts.js +234 -0
  13. package/dist/claudeApi.d.ts +27 -0
  14. package/dist/claudeApi.js +250 -0
  15. package/dist/claudeSignIn.d.ts +62 -0
  16. package/dist/claudeSignIn.js +239 -0
  17. package/dist/command.d.ts +47 -0
  18. package/dist/command.js +64 -0
  19. package/dist/commandsApi.d.ts +64 -0
  20. package/dist/commandsApi.js +267 -0
  21. package/dist/contextRow.d.ts +25 -0
  22. package/dist/contextRow.js +16 -0
  23. package/dist/createPwCodeApi.d.ts +696 -0
  24. package/dist/createPwCodeApi.js +33 -0
  25. package/dist/howSessionsAppear.d.ts +12 -0
  26. package/dist/howSessionsAppear.js +24 -0
  27. package/dist/index.d.ts +39 -3
  28. package/dist/index.js +38 -3
  29. package/dist/locales/en/agentTranscript.js +162 -0
  30. package/dist/locales/en/agents.js +380 -0
  31. package/dist/locales/en.d.ts +523 -0
  32. package/dist/locales/en.js +8 -0
  33. package/dist/locales/es/agentTranscript.js +162 -0
  34. package/dist/locales/es/agents.js +380 -0
  35. package/dist/locales/es.d.ts +3 -0
  36. package/dist/locales/es.js +8 -0
  37. package/dist/locales/ja/agentTranscript.js +162 -0
  38. package/dist/locales/ja/agents.js +380 -0
  39. package/dist/locales/ja.d.ts +3 -0
  40. package/dist/locales/ja.js +8 -0
  41. package/dist/locales/ko/agentTranscript.js +162 -0
  42. package/dist/locales/ko/agents.js +380 -0
  43. package/dist/locales/ko.d.ts +3 -0
  44. package/dist/locales/ko.js +8 -0
  45. package/dist/locales/zh/agentTranscript.js +162 -0
  46. package/dist/locales/zh/agents.js +380 -0
  47. package/dist/locales/zh.d.ts +3 -0
  48. package/dist/locales/zh.js +8 -0
  49. package/dist/machine.d.ts +51 -0
  50. package/dist/machine.js +60 -0
  51. package/dist/messages.d.ts +17 -0
  52. package/dist/messages.js +31 -0
  53. package/dist/models.d.ts +47 -0
  54. package/dist/models.js +49 -0
  55. package/dist/notices.d.ts +12 -0
  56. package/dist/notices.js +120 -0
  57. package/dist/pullRequest.d.ts +8 -0
  58. package/dist/pullRequest.js +29 -0
  59. package/dist/pullRequestList.d.ts +52 -0
  60. package/dist/pullRequestList.js +106 -0
  61. package/dist/query.d.ts +28 -0
  62. package/dist/query.js +25 -0
  63. package/dist/session.d.ts +75 -1
  64. package/dist/session.js +101 -1
  65. package/dist/sessionActions.d.ts +105 -0
  66. package/dist/sessionActions.js +178 -0
  67. package/dist/sessionEvents.d.ts +27 -0
  68. package/dist/sessionEvents.js +212 -0
  69. package/dist/sessionGroups.d.ts +49 -0
  70. package/dist/sessionGroups.js +72 -0
  71. package/dist/sessionHeader.d.ts +14 -0
  72. package/dist/sessionHeader.js +16 -0
  73. package/dist/sessionList.d.ts +134 -0
  74. package/dist/sessionList.js +271 -0
  75. package/dist/sessionsApi.d.ts +105 -0
  76. package/dist/sessionsApi.js +511 -0
  77. package/dist/settingsApi.d.ts +36 -0
  78. package/dist/settingsApi.js +151 -0
  79. package/dist/startSession.d.ts +138 -0
  80. package/dist/startSession.js +234 -0
  81. package/dist/terminalHandoffPanel.d.ts +30 -0
  82. package/dist/terminalHandoffPanel.js +33 -0
  83. package/dist/toolStrings.d.ts +4 -0
  84. package/dist/toolStrings.js +95 -0
  85. package/dist/transcript.d.ts +14 -1
  86. package/dist/transcript.js +55 -14
  87. package/dist/types.d.ts +20 -1
  88. package/dist/usageLimit.d.ts +8 -0
  89. package/dist/usageLimit.js +13 -0
  90. package/dist/useAwayRecap.d.ts +30 -0
  91. package/dist/useAwayRecap.js +75 -0
  92. package/dist/useComposer.d.ts +121 -0
  93. package/dist/useComposer.js +244 -0
  94. package/dist/useComposerImages.d.ts +66 -0
  95. package/dist/useComposerImages.js +195 -0
  96. package/dist/useConversation.d.ts +190 -0
  97. package/dist/useConversation.js +287 -0
  98. package/dist/useSubagent.d.ts +58 -0
  99. package/dist/useSubagent.js +149 -0
  100. package/dist/useTranscript.d.ts +4 -1
  101. package/dist/useTranscript.js +54 -11
  102. package/dist/wording.d.ts +43 -0
  103. package/dist/wording.js +101 -0
  104. package/dist/workingDirectories.d.ts +32 -0
  105. package/dist/workingDirectories.js +71 -0
  106. package/dist/worktreeChoice.d.ts +31 -0
  107. package/dist/worktreeChoice.js +38 -0
  108. package/locales/en/agentTranscript.json +154 -0
  109. package/locales/en/agents.json +366 -0
  110. package/locales/es/agentTranscript.json +154 -0
  111. package/locales/es/agents.json +366 -0
  112. package/locales/ja/agentTranscript.json +154 -0
  113. package/locales/ja/agents.json +366 -0
  114. package/locales/ko/agentTranscript.json +154 -0
  115. package/locales/ko/agents.json +366 -0
  116. package/locales/zh/agentTranscript.json +154 -0
  117. package/locales/zh/agents.json +366 -0
  118. package/package.json +24 -9
@@ -0,0 +1,696 @@
1
+ import type { Client } from 'openapi-fetch';
2
+ import type { PwCodePaths, Schemas } from './apiClient.js';
3
+ import { type PwCodeSocketOptions } from './sessionEvents.js';
4
+ export type PwCodeApiOptions = PwCodeSocketOptions;
5
+ /** Refuses a client whose API types lack a route this package calls, or type
6
+ * one differently, naming the routes it lacks. */
7
+ type CoversPwCodeRoutes<P> = [P] extends [PwCodePaths] ? unknown : {
8
+ missingPwCodeRoutes: Exclude<keyof PwCodePaths, keyof P>;
9
+ };
10
+ /** The calls and data hooks of pw code sessions over the host's API client,
11
+ * which carries its base URL and signs its requests. Create it once per
12
+ * client: its hooks share SWR cache entries keyed as
13
+ * `@parallelworks/client/swr`'s are, and the open feeds it counts are its own. */
14
+ export declare function createPwCodeApi<P extends {}>(client: Client<P> & CoversPwCodeRoutes<P>, options?: PwCodeApiOptions): {
15
+ useClaudeModels: (machine: string, sessionId: string | undefined, account: string | undefined, enabled: boolean, refresh?: boolean) => import("./apiClient.js").PwCodeQuery<{
16
+ id: string;
17
+ name?: string;
18
+ }[] | null>;
19
+ useRefreshClaudeModels: (machine: string, sessionId: string | undefined) => (account: string | undefined) => Promise<void>;
20
+ useClaudeAccountNames: (machine: string, enabled: boolean) => import("./apiClient.js").PwCodeQuery<{
21
+ email?: string;
22
+ error?: string;
23
+ errorCode?: string;
24
+ fetchedAt?: string;
25
+ fiveHourResetsAt?: string;
26
+ fiveHourUsedPercent?: number;
27
+ name: string;
28
+ plan?: string;
29
+ refreshing?: boolean;
30
+ signInRequired?: boolean;
31
+ usage?: string;
32
+ weeklyResetsAt?: string;
33
+ weeklyUsedPercent?: number;
34
+ }[] | null>;
35
+ useClaudeAccounts: (machine: string, sessionId: string | undefined, enabled: boolean) => {
36
+ accounts: {
37
+ email?: string;
38
+ error?: string;
39
+ errorCode?: string;
40
+ fetchedAt?: string;
41
+ fiveHourResetsAt?: string;
42
+ fiveHourUsedPercent?: number;
43
+ name: string;
44
+ plan?: string;
45
+ refreshing?: boolean;
46
+ signInRequired?: boolean;
47
+ usage?: string;
48
+ weeklyResetsAt?: string;
49
+ weeklyUsedPercent?: number;
50
+ }[];
51
+ loadedUsage: boolean;
52
+ loading: boolean;
53
+ error: import("./apiClient.js").PwCodeApiError | undefined;
54
+ refreshing: boolean;
55
+ refresh: () => Promise<void>;
56
+ };
57
+ useRemoveClaudeAccount: (machine: string, sessionId: string | undefined) => (name: string) => Promise<void>;
58
+ startClaudeLogin: (machine: string, account: string, sessionId: string | undefined, columns: number, rows: number) => Promise<import("./claudeApi.js").ClaudeLoginEvent>;
59
+ writeClaudeLogin: (machine: string, loginId: string, input: import("./claudeApi.js").ClaudeLoginInput) => Promise<void>;
60
+ cancelClaudeLogin: (machine: string, loginId: string) => Promise<void>;
61
+ followClaudeLogin: (machine: string, login: import("./claudeApi.js").ClaudeLogin, after: number, signal: AbortSignal, receive: (event: import("./claudeApi.js").ClaudeLoginEvent) => void) => Promise<void>;
62
+ runSlashAction: (machine: string, id: string, action: Exclude<import("./command.js").SlashAction, {
63
+ kind: 'message' | 'archive';
64
+ }>, planOnMachine: (path: string) => string) => Promise<import("./commandsApi.js").CommandOutcome>;
65
+ resolveTyped: (text: string, deps: import("./commandsApi.js").SlashDeps) => Promise<string | null>;
66
+ usePalette: (machine: string, sessionId: string) => {
67
+ palette: {
68
+ commands: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
69
+ mcpPrompts: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
70
+ prompts: string[] | null;
71
+ } | null;
72
+ loading: boolean;
73
+ load: () => Promise<{
74
+ commands: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
75
+ mcpPrompts: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
76
+ prompts: string[] | null;
77
+ } | null>;
78
+ };
79
+ useWorkspacePalette: (machine: string | undefined, workspace: string, model: string | null | undefined) => {
80
+ palette: {
81
+ commands: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
82
+ mcpPrompts: import("./api.js").components["schemas"]["AgentSlashCommand"][] | null;
83
+ prompts: string[] | null;
84
+ } | null;
85
+ loading: boolean;
86
+ load: () => void;
87
+ };
88
+ useBackgroundCommands: ({ machine, sessionId, running, onError, }: {
89
+ machine: string;
90
+ sessionId: string;
91
+ running: boolean;
92
+ onError: (error: unknown) => void;
93
+ }) => {
94
+ offered: boolean;
95
+ moving: boolean;
96
+ move: () => Promise<void>;
97
+ };
98
+ requestRecap: (machine: string, id: string, signal?: AbortSignal) => Promise<import("./apiClient.js").PwCodeResult<undefined>>;
99
+ useSessions: () => import("./apiClient.js").PwCodeQuery<{
100
+ machines: import("./api.js").components["schemas"]["AgentMachine"][] | null;
101
+ sessions: import("./api.js").components["schemas"]["AgentSession"][] | null;
102
+ }>;
103
+ useWaitingSessionCount: (enabled: boolean) => number;
104
+ useSessionDetail: (machine: string, id: string, listed: {
105
+ allocation?: string;
106
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
107
+ archivedAt?: string;
108
+ autoName?: string;
109
+ branch?: string;
110
+ createdAt: string;
111
+ effort?: string;
112
+ group?: string;
113
+ id: string;
114
+ inputTokens?: number;
115
+ lastError?: string;
116
+ liveHost?: string;
117
+ machineId: string;
118
+ messages: number;
119
+ model: string;
120
+ name?: string;
121
+ outputTokens?: number;
122
+ permissionMode?: string;
123
+ pinnedAt?: string;
124
+ preview: string;
125
+ pullRequestStates?: {
126
+ [key: string]: string;
127
+ };
128
+ pullRequests?: string[] | null;
129
+ remoteControl?: boolean;
130
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
131
+ turnStartedAt?: string;
132
+ updatedAt: string;
133
+ workspace: string;
134
+ } | undefined) => {
135
+ data: {
136
+ addDirs?: import("./api.js").components["schemas"]["AddedDirectory"][] | null;
137
+ allocation?: string;
138
+ allowedDirs?: import("./api.js").components["schemas"]["AllowedDirectory"][] | null;
139
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
140
+ archivedAt?: string;
141
+ autoName?: string;
142
+ branch?: string;
143
+ claudeAccount?: string;
144
+ createdAt: string;
145
+ effort?: string;
146
+ goal?: import("./api.js").components["schemas"]["GoalStatus"];
147
+ group?: string;
148
+ history: import("./api.js").components["schemas"]["HistoryItem"][] | null;
149
+ id: string;
150
+ inputTokens?: number;
151
+ lastError?: string;
152
+ lastSeq?: number;
153
+ liveHost?: string;
154
+ machineId: string;
155
+ messages: number;
156
+ model: string;
157
+ name?: string;
158
+ outputTokens?: number;
159
+ permissionMode?: string;
160
+ pinnedAt?: string;
161
+ preview: string;
162
+ pullRequestStates?: {
163
+ [key: string]: string;
164
+ };
165
+ pullRequests?: string[] | null;
166
+ remoteControl?: boolean;
167
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
168
+ turnId?: string;
169
+ turnStartedAt?: string;
170
+ updatedAt: string;
171
+ usageLimitResumeAt?: string;
172
+ waitingForUsageLimit?: boolean;
173
+ workspace: string;
174
+ workspaceUntrusted?: boolean;
175
+ } | undefined;
176
+ error: import("./apiClient.js").PwCodeApiError | undefined;
177
+ isLoading: boolean;
178
+ mutate: import("swr").KeyedMutator<{
179
+ addDirs?: import("./api.js").components["schemas"]["AddedDirectory"][] | null;
180
+ allocation?: string;
181
+ allowedDirs?: import("./api.js").components["schemas"]["AllowedDirectory"][] | null;
182
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
183
+ archivedAt?: string;
184
+ autoName?: string;
185
+ branch?: string;
186
+ claudeAccount?: string;
187
+ createdAt: string;
188
+ effort?: string;
189
+ goal?: import("./api.js").components["schemas"]["GoalStatus"];
190
+ group?: string;
191
+ history: import("./api.js").components["schemas"]["HistoryItem"][] | null;
192
+ id: string;
193
+ inputTokens?: number;
194
+ lastError?: string;
195
+ lastSeq?: number;
196
+ liveHost?: string;
197
+ machineId: string;
198
+ messages: number;
199
+ model: string;
200
+ name?: string;
201
+ outputTokens?: number;
202
+ permissionMode?: string;
203
+ pinnedAt?: string;
204
+ preview: string;
205
+ pullRequestStates?: {
206
+ [key: string]: string;
207
+ };
208
+ pullRequests?: string[] | null;
209
+ remoteControl?: boolean;
210
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
211
+ turnId?: string;
212
+ turnStartedAt?: string;
213
+ updatedAt: string;
214
+ usageLimitResumeAt?: string;
215
+ waitingForUsageLimit?: boolean;
216
+ workspace: string;
217
+ workspaceUntrusted?: boolean;
218
+ }>;
219
+ fresh: boolean;
220
+ };
221
+ usePullRequests: (machine: string, id: string, urls: string[], onRead?: (read: {
222
+ state?: "open" | "draft" | "merged" | "closed";
223
+ url: string;
224
+ }[]) => void) => import("./apiClient.js").PwCodeQuery<Schemas['AgentPullRequests']>;
225
+ useSessionPullRequestStates: (machine: string, id: string, urls: string[]) => {
226
+ url: string;
227
+ state: string | undefined;
228
+ }[] | undefined;
229
+ useMachine: (machine: string) => {
230
+ machine: Schemas['AgentMachine'] | undefined;
231
+ recheck: () => void;
232
+ };
233
+ useSubagents: (machine: string, id: string, enabled: boolean) => {
234
+ subagents: Schemas['Subagent'][];
235
+ refresh: () => void;
236
+ };
237
+ useSubagentDetail: (machine: string, id: string, subId: string) => {
238
+ data: Schemas['SubagentDetail'] | undefined;
239
+ error: unknown;
240
+ refresh: () => void;
241
+ };
242
+ stopSubagent: (machine: string, id: string, subId: string) => Promise<unknown>;
243
+ stopAllSubagents: (machine: string, id: string) => Promise<unknown>;
244
+ useSessionWorktree: (s: {
245
+ allocation?: string;
246
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
247
+ archivedAt?: string;
248
+ autoName?: string;
249
+ branch?: string;
250
+ createdAt: string;
251
+ effort?: string;
252
+ group?: string;
253
+ id: string;
254
+ inputTokens?: number;
255
+ lastError?: string;
256
+ liveHost?: string;
257
+ machineId: string;
258
+ messages: number;
259
+ model: string;
260
+ name?: string;
261
+ outputTokens?: number;
262
+ permissionMode?: string;
263
+ pinnedAt?: string;
264
+ preview: string;
265
+ pullRequestStates?: {
266
+ [key: string]: string;
267
+ };
268
+ pullRequests?: string[] | null;
269
+ remoteControl?: boolean;
270
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
271
+ turnStartedAt?: string;
272
+ updatedAt: string;
273
+ workspace: string;
274
+ } | undefined) => import("./apiClient.js").PwCodeQuery<Schemas['AgentSessionWorktree']>;
275
+ leaveWorktree: (s: {
276
+ allocation?: string;
277
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
278
+ archivedAt?: string;
279
+ autoName?: string;
280
+ branch?: string;
281
+ createdAt: string;
282
+ effort?: string;
283
+ group?: string;
284
+ id: string;
285
+ inputTokens?: number;
286
+ lastError?: string;
287
+ liveHost?: string;
288
+ machineId: string;
289
+ messages: number;
290
+ model: string;
291
+ name?: string;
292
+ outputTokens?: number;
293
+ permissionMode?: string;
294
+ pinnedAt?: string;
295
+ preview: string;
296
+ pullRequestStates?: {
297
+ [key: string]: string;
298
+ };
299
+ pullRequests?: string[] | null;
300
+ remoteControl?: boolean;
301
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
302
+ turnStartedAt?: string;
303
+ updatedAt: string;
304
+ workspace: string;
305
+ }, removeRoot?: string) => Promise<{
306
+ left?: Schemas['AgentWorktreeLeft'];
307
+ refusal?: unknown;
308
+ }>;
309
+ useSessionMutations: () => {
310
+ deleteSession: (s: {
311
+ allocation?: string;
312
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
313
+ archivedAt?: string;
314
+ autoName?: string;
315
+ branch?: string;
316
+ createdAt: string;
317
+ effort?: string;
318
+ group?: string;
319
+ id: string;
320
+ inputTokens?: number;
321
+ lastError?: string;
322
+ liveHost?: string;
323
+ machineId: string;
324
+ messages: number;
325
+ model: string;
326
+ name?: string;
327
+ outputTokens?: number;
328
+ permissionMode?: string;
329
+ pinnedAt?: string;
330
+ preview: string;
331
+ pullRequestStates?: {
332
+ [key: string]: string;
333
+ };
334
+ pullRequests?: string[] | null;
335
+ remoteControl?: boolean;
336
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
337
+ turnStartedAt?: string;
338
+ updatedAt: string;
339
+ workspace: string;
340
+ }, removeWorktree?: string) => Promise<unknown>;
341
+ renameSession: (s: {
342
+ allocation?: string;
343
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
344
+ archivedAt?: string;
345
+ autoName?: string;
346
+ branch?: string;
347
+ createdAt: string;
348
+ effort?: string;
349
+ group?: string;
350
+ id: string;
351
+ inputTokens?: number;
352
+ lastError?: string;
353
+ liveHost?: string;
354
+ machineId: string;
355
+ messages: number;
356
+ model: string;
357
+ name?: string;
358
+ outputTokens?: number;
359
+ permissionMode?: string;
360
+ pinnedAt?: string;
361
+ preview: string;
362
+ pullRequestStates?: {
363
+ [key: string]: string;
364
+ };
365
+ pullRequests?: string[] | null;
366
+ remoteControl?: boolean;
367
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
368
+ turnStartedAt?: string;
369
+ updatedAt: string;
370
+ workspace: string;
371
+ }, name: string) => Promise<unknown>;
372
+ archiveSession: (s: {
373
+ allocation?: string;
374
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
375
+ archivedAt?: string;
376
+ autoName?: string;
377
+ branch?: string;
378
+ createdAt: string;
379
+ effort?: string;
380
+ group?: string;
381
+ id: string;
382
+ inputTokens?: number;
383
+ lastError?: string;
384
+ liveHost?: string;
385
+ machineId: string;
386
+ messages: number;
387
+ model: string;
388
+ name?: string;
389
+ outputTokens?: number;
390
+ permissionMode?: string;
391
+ pinnedAt?: string;
392
+ preview: string;
393
+ pullRequestStates?: {
394
+ [key: string]: string;
395
+ };
396
+ pullRequests?: string[] | null;
397
+ remoteControl?: boolean;
398
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
399
+ turnStartedAt?: string;
400
+ updatedAt: string;
401
+ workspace: string;
402
+ }) => Promise<unknown>;
403
+ archiveAfterTurn: (s: {
404
+ allocation?: string;
405
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
406
+ archivedAt?: string;
407
+ autoName?: string;
408
+ branch?: string;
409
+ createdAt: string;
410
+ effort?: string;
411
+ group?: string;
412
+ id: string;
413
+ inputTokens?: number;
414
+ lastError?: string;
415
+ liveHost?: string;
416
+ machineId: string;
417
+ messages: number;
418
+ model: string;
419
+ name?: string;
420
+ outputTokens?: number;
421
+ permissionMode?: string;
422
+ pinnedAt?: string;
423
+ preview: string;
424
+ pullRequestStates?: {
425
+ [key: string]: string;
426
+ };
427
+ pullRequests?: string[] | null;
428
+ remoteControl?: boolean;
429
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
430
+ turnStartedAt?: string;
431
+ updatedAt: string;
432
+ workspace: string;
433
+ }) => Promise<{
434
+ refusal: unknown;
435
+ deferred: boolean;
436
+ }>;
437
+ restoreSession: (s: {
438
+ allocation?: string;
439
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
440
+ archivedAt?: string;
441
+ autoName?: string;
442
+ branch?: string;
443
+ createdAt: string;
444
+ effort?: string;
445
+ group?: string;
446
+ id: string;
447
+ inputTokens?: number;
448
+ lastError?: string;
449
+ liveHost?: string;
450
+ machineId: string;
451
+ messages: number;
452
+ model: string;
453
+ name?: string;
454
+ outputTokens?: number;
455
+ permissionMode?: string;
456
+ pinnedAt?: string;
457
+ preview: string;
458
+ pullRequestStates?: {
459
+ [key: string]: string;
460
+ };
461
+ pullRequests?: string[] | null;
462
+ remoteControl?: boolean;
463
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
464
+ turnStartedAt?: string;
465
+ updatedAt: string;
466
+ workspace: string;
467
+ }) => Promise<unknown>;
468
+ pinSession: (s: {
469
+ allocation?: string;
470
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
471
+ archivedAt?: string;
472
+ autoName?: string;
473
+ branch?: string;
474
+ createdAt: string;
475
+ effort?: string;
476
+ group?: string;
477
+ id: string;
478
+ inputTokens?: number;
479
+ lastError?: string;
480
+ liveHost?: string;
481
+ machineId: string;
482
+ messages: number;
483
+ model: string;
484
+ name?: string;
485
+ outputTokens?: number;
486
+ permissionMode?: string;
487
+ pinnedAt?: string;
488
+ preview: string;
489
+ pullRequestStates?: {
490
+ [key: string]: string;
491
+ };
492
+ pullRequests?: string[] | null;
493
+ remoteControl?: boolean;
494
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
495
+ turnStartedAt?: string;
496
+ updatedAt: string;
497
+ workspace: string;
498
+ }, pinned: boolean) => Promise<unknown>;
499
+ groupSession: (s: {
500
+ allocation?: string;
501
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
502
+ archivedAt?: string;
503
+ autoName?: string;
504
+ branch?: string;
505
+ createdAt: string;
506
+ effort?: string;
507
+ group?: string;
508
+ id: string;
509
+ inputTokens?: number;
510
+ lastError?: string;
511
+ liveHost?: string;
512
+ machineId: string;
513
+ messages: number;
514
+ model: string;
515
+ name?: string;
516
+ outputTokens?: number;
517
+ permissionMode?: string;
518
+ pinnedAt?: string;
519
+ preview: string;
520
+ pullRequestStates?: {
521
+ [key: string]: string;
522
+ };
523
+ pullRequests?: string[] | null;
524
+ remoteControl?: boolean;
525
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
526
+ turnStartedAt?: string;
527
+ updatedAt: string;
528
+ workspace: string;
529
+ }, group: string | null) => Promise<unknown>;
530
+ stopSession: (s: {
531
+ allocation?: string;
532
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
533
+ archivedAt?: string;
534
+ autoName?: string;
535
+ branch?: string;
536
+ createdAt: string;
537
+ effort?: string;
538
+ group?: string;
539
+ id: string;
540
+ inputTokens?: number;
541
+ lastError?: string;
542
+ liveHost?: string;
543
+ machineId: string;
544
+ messages: number;
545
+ model: string;
546
+ name?: string;
547
+ outputTokens?: number;
548
+ permissionMode?: string;
549
+ pinnedAt?: string;
550
+ preview: string;
551
+ pullRequestStates?: {
552
+ [key: string]: string;
553
+ };
554
+ pullRequests?: string[] | null;
555
+ remoteControl?: boolean;
556
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
557
+ turnStartedAt?: string;
558
+ updatedAt: string;
559
+ workspace: string;
560
+ }) => Promise<unknown>;
561
+ forkSession: (s: {
562
+ allocation?: string;
563
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
564
+ archivedAt?: string;
565
+ autoName?: string;
566
+ branch?: string;
567
+ createdAt: string;
568
+ effort?: string;
569
+ group?: string;
570
+ id: string;
571
+ inputTokens?: number;
572
+ lastError?: string;
573
+ liveHost?: string;
574
+ machineId: string;
575
+ messages: number;
576
+ model: string;
577
+ name?: string;
578
+ outputTokens?: number;
579
+ permissionMode?: string;
580
+ pinnedAt?: string;
581
+ preview: string;
582
+ pullRequestStates?: {
583
+ [key: string]: string;
584
+ };
585
+ pullRequests?: string[] | null;
586
+ remoteControl?: boolean;
587
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
588
+ turnStartedAt?: string;
589
+ updatedAt: string;
590
+ workspace: string;
591
+ }) => Promise<{
592
+ forked?: Schemas['AgentSessionForked'];
593
+ refusal?: unknown;
594
+ }>;
595
+ };
596
+ createSession: (machine: string, body: Schemas['CreateSessionBody']) => Promise<import("./apiClient.js").PwCodeResult<{
597
+ addDirs?: import("./api.js").components["schemas"]["AddedDirectory"][] | null;
598
+ allocation?: string;
599
+ allowedDirs?: import("./api.js").components["schemas"]["AllowedDirectory"][] | null;
600
+ approvals?: import("./api.js").components["schemas"]["ApprovalRequest"][] | null;
601
+ archivedAt?: string;
602
+ autoName?: string;
603
+ branch?: string;
604
+ claudeAccount?: string;
605
+ createdAt: string;
606
+ effort?: string;
607
+ goal?: import("./api.js").components["schemas"]["GoalStatus"];
608
+ group?: string;
609
+ history: import("./api.js").components["schemas"]["HistoryItem"][] | null;
610
+ id: string;
611
+ inputTokens?: number;
612
+ lastError?: string;
613
+ lastSeq?: number;
614
+ liveHost?: string;
615
+ machineId: string;
616
+ messages: number;
617
+ model: string;
618
+ name?: string;
619
+ outputTokens?: number;
620
+ permissionMode?: string;
621
+ pinnedAt?: string;
622
+ preview: string;
623
+ pullRequestStates?: {
624
+ [key: string]: string;
625
+ };
626
+ pullRequests?: string[] | null;
627
+ remoteControl?: boolean;
628
+ status: "idle" | "running" | "awaiting_approval" | "live_elsewhere";
629
+ turnId?: string;
630
+ turnStartedAt?: string;
631
+ updatedAt: string;
632
+ usageLimitResumeAt?: string;
633
+ waitingForUsageLimit?: boolean;
634
+ workspace: string;
635
+ workspaceUntrusted?: boolean;
636
+ }>>;
637
+ sendMessage: (machine: string, id: string, body: Schemas['SendMessageBody']) => Promise<import("./apiClient.js").PwCodeResult<Schemas['AgentMessageAccepted']>>;
638
+ steer: (machine: string, id: string, body: Schemas['AgentDirectionBody']) => Promise<import("./apiClient.js").PwCodeResult<Schemas['AgentDirectionDelivered']>>;
639
+ withdrawQueued: (machine: string, id: string, turnId: string) => Promise<import("./apiClient.js").PwCodeResult<undefined>>;
640
+ messageSubagent: (machine: string, id: string, subId: string, body: Schemas['SendMessageBody']) => Promise<import("./apiClient.js").PwCodeResult<Schemas['AgentMessageAccepted']>>;
641
+ steerSubagent: (machine: string, id: string, subId: string, body: Schemas['AgentDirectionBody']) => Promise<import("./apiClient.js").PwCodeResult<Schemas['AgentDirectionDelivered']>>;
642
+ saveImage: (machine: string, id: string, body: Schemas['AgentImageBody']) => Promise<import("./apiClient.js").PwCodeResult<Schemas['AgentImageSaved']>>;
643
+ answerApproval: (machine: string, sessionId: string, approvalId: string, answer: import("@parallelworks/ui/ai/headless").ApprovalAnswerValue) => Promise<unknown>;
644
+ removeSessionDirectory: (machine: string, sessionId: string, path: string) => Promise<unknown>;
645
+ uploadPaste: (machine: string, sessionId: string, text: string, describe: (error: unknown) => string) => Promise<import("./sessionsApi.js").PwCodePasteUpload>;
646
+ updateSessionSettings: (machine: string, id: string, body: {
647
+ allocation?: string;
648
+ claudeAccount?: string;
649
+ effort?: "default" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
650
+ model?: string;
651
+ permissionMode?: "read-only" | "accept-edits" | "auto" | "bypass-permissions";
652
+ }) => Promise<import("./apiClient.js").PwCodeResult<Schemas['SessionState']>>;
653
+ useSessionSettings: ({ machine, sessionId, model, effort, allocation, claudeAccount, nativeAllocation, locked, live, onPatched, onError, onModePicked, onEffortPicked, onAccountSaved, }: import("./settingsApi.js").PwCodeSessionSettingsOptions) => import("./settingsApi.js").PwCodeSessionSettings;
654
+ useMachines: () => Schemas['AgentMachine'][];
655
+ useSessionEvents: (machine: string, id: string, cursor: (() => number) | undefined, onEvent: (event: {
656
+ agentType?: string;
657
+ approval?: import("./api.js").components["schemas"]["ApprovalRequest"];
658
+ approvalId?: string;
659
+ archive?: import("./api.js").components["schemas"]["ArchiveChange"];
660
+ args?: string;
661
+ background?: boolean;
662
+ callId?: string;
663
+ client?: string;
664
+ color?: string;
665
+ content?: string;
666
+ decision?: import("./api.js").components["schemas"]["ToolDecision"];
667
+ goalProgress?: import("./api.js").components["schemas"]["GoalProgress"];
668
+ id?: string;
669
+ images?: import("./api.js").components["schemas"]["ImageContent"][] | null;
670
+ interrupted?: boolean;
671
+ isError?: boolean;
672
+ iters?: number;
673
+ mcp?: import("./api.js").components["schemas"]["MCPStatus"];
674
+ name?: string;
675
+ newId?: string;
676
+ noteId?: string;
677
+ notice?: string;
678
+ pastes?: import("./api.js").components["schemas"]["PasteView"][] | null;
679
+ recorded?: boolean;
680
+ result?: string;
681
+ resumeAt?: string;
682
+ seq: number;
683
+ shellProgress?: import("./api.js").components["schemas"]["ShellProgress"];
684
+ startLine?: number;
685
+ state?: import("./api.js").components["schemas"]["SessionState"];
686
+ turn?: import("./api.js").components["schemas"]["TurnResult"];
687
+ turnEnd?: import("./api.js").components["schemas"]["TurnEnd"];
688
+ turnId?: string;
689
+ type: string;
690
+ }) => void) => {
691
+ connected: boolean;
692
+ disconnected: boolean;
693
+ };
694
+ };
695
+ export type PwCodeApi = ReturnType<typeof createPwCodeApi>;
696
+ export {};