@parallelworks/code 0.4.0 → 0.5.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.
- package/README.md +39 -12
- package/dist/agentSwitcher.d.ts +13 -2
- package/dist/agentSwitcher.js +28 -6
- package/dist/ago.d.ts +1 -3
- package/dist/ago.js +1 -3
- package/dist/api.d.ts +200 -0
- package/dist/chatStrings.d.ts +1 -0
- package/dist/chatStrings.js +2 -1
- package/dist/claudeAccounts.d.ts +20 -2
- package/dist/claudeAccounts.js +51 -7
- package/dist/claudeApi.d.ts +2 -1
- package/dist/claudeApi.js +49 -3
- package/dist/command.d.ts +5 -1
- package/dist/command.js +6 -1
- package/dist/createPwCodeApi.d.ts +70 -1
- package/dist/createPwCodeApi.js +4 -2
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -4
- package/dist/locales/en/agentTranscript.js +2 -1
- package/dist/locales/en/agents.js +16 -3
- package/dist/locales/en.d.ts +13 -0
- package/dist/locales/es/agentTranscript.js +2 -1
- package/dist/locales/es/agents.js +16 -3
- package/dist/locales/ja/agentTranscript.js +2 -1
- package/dist/locales/ja/agents.js +16 -3
- package/dist/locales/ko/agentTranscript.js +2 -1
- package/dist/locales/ko/agents.js +16 -3
- package/dist/locales/zh/agentTranscript.js +2 -1
- package/dist/locales/zh/agents.js +16 -3
- package/dist/notices.d.ts +2 -0
- package/dist/notices.js +20 -13
- package/dist/query.d.ts +4 -1
- package/dist/query.js +9 -3
- package/dist/session.d.ts +6 -0
- package/dist/session.js +5 -1
- package/dist/sessionEvents.d.ts +29 -2
- package/dist/sessionEvents.js +187 -73
- package/dist/sessionGroups.d.ts +3 -3
- package/dist/sessionGroups.js +3 -3
- package/dist/sessionHeader.js +6 -2
- package/dist/sessionList.d.ts +13 -8
- package/dist/sessionList.js +20 -10
- package/dist/sessionScreen.d.ts +5 -1
- package/dist/sessionScreen.js +12 -7
- package/dist/sessionsApi.d.ts +19 -3
- package/dist/sessionsApi.js +100 -12
- package/dist/sessionsFeed.d.ts +22 -0
- package/dist/sessionsFeed.js +125 -0
- package/dist/todos.d.ts +42 -0
- package/dist/todos.js +104 -0
- package/dist/transcript.d.ts +1 -2
- package/dist/transcript.js +63 -102
- package/dist/transcriptRead.d.ts +56 -0
- package/dist/transcriptRead.js +121 -0
- package/dist/useComposer.d.ts +14 -5
- package/dist/useComposer.js +20 -7
- package/dist/useComposerImages.js +3 -4
- package/dist/useComposerPastes.js +3 -8
- package/dist/useConversation.d.ts +6 -0
- package/dist/useConversation.js +72 -5
- package/dist/useMounted.d.ts +3 -0
- package/dist/useMounted.js +14 -0
- package/dist/useSubagent.d.ts +2 -0
- package/dist/useSubagent.js +2 -0
- package/dist/wording.d.ts +5 -2
- package/dist/wording.js +6 -4
- package/locales/en/agentTranscript.json +2 -1
- package/locales/en/agents.json +14 -2
- package/locales/es/agentTranscript.json +2 -1
- package/locales/es/agents.json +14 -2
- package/locales/ja/agentTranscript.json +2 -1
- package/locales/ja/agents.json +14 -2
- package/locales/ko/agentTranscript.json +2 -1
- package/locales/ko/agents.json +14 -2
- package/locales/zh/agentTranscript.json +2 -1
- package/locales/zh/agents.json +14 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -116,10 +116,13 @@ showing a toast, wording an error. Types are exported beside each.
|
|
|
116
116
|
- `usePwCodeSessionScreen`, the screen around those two: the banner while
|
|
117
117
|
nothing new can reach the transcript (`sessionBanner`, whose `tone` is
|
|
118
118
|
`danger` for a machine that does not answer and `info` for a session live
|
|
119
|
-
elsewhere), the activity line (`sessionActivity`), the
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
(`
|
|
119
|
+
elsewhere), the activity line (`sessionActivity`), whether the turn waits
|
|
120
|
+
at its account's usage limit as that line says, which it doesn't while the
|
|
121
|
+
feed reconnects (`waitingAtLimit`, for the Claude Code account panel), the
|
|
122
|
+
goal (`goalLabel`, whose dot, a `PwCodeGoalMark`, has the `info` tone,
|
|
123
|
+
unlit while paused and pulsing while a check runs), what shows when the
|
|
124
|
+
transcript never loaded (`loadErrorMessage`), the command menu and the
|
|
125
|
+
settings row.
|
|
123
126
|
The goal itself is read, edited, paused, resumed and cleared from a panel
|
|
124
127
|
over `useSessionGoal` (a `PwCodeSessionGoal`), which also gives the panel's
|
|
125
128
|
`view` and `note`, the run's `state`, `lastCheck` and `pausedNote`, which
|
|
@@ -134,6 +137,11 @@ showing a toast, wording an error. Types are exported beside each.
|
|
|
134
137
|
(`sessionSettingsOptions`), what the machine allows
|
|
135
138
|
of Claude Code (`claudeOnMachine`), and the account a Claude model runs as
|
|
136
139
|
(`claudeAccountChip`).
|
|
140
|
+
The task list pinned above the composer (`useTodoPanel`, a
|
|
141
|
+
`PwCodeTodoPanel`) gives its title, how far along it is (`progress`), the
|
|
142
|
+
running task a folded panel names (`running`), up to six rows from the one
|
|
143
|
+
before the running task, each with its status in words (`rows`), and the
|
|
144
|
+
control that shows the rest or fewer again (`more`).
|
|
137
145
|
- Images and pastes sent with a message. `useComposerImages` holds the images
|
|
138
146
|
until there is a session to save them with, through the host's encoder,
|
|
139
147
|
which throws `PwCodeImageTooLarge` for one it cannot fit; `fitImageWith`
|
|
@@ -156,14 +164,18 @@ showing a toast, wording an error. Types are exported beside each.
|
|
|
156
164
|
activity line (`activity`), where a queued message goes
|
|
157
165
|
(`queueDelivery`), taking one back (`canRemoveQueued`, `removeQueued`) or
|
|
158
166
|
all of them into the composer (`recall`, as the main composer's), its
|
|
159
|
-
composer's draft key (`draftKey`),
|
|
167
|
+
composer's draft key (`draftKey`), the `id` its `promptHistory` takes
|
|
168
|
+
(`historyId`), and the model it runs on (`model`) and
|
|
160
169
|
that model's name (`modelLabel`, from the `modelNames` option, the session
|
|
161
170
|
state's). Beside it, the switcher that lists them
|
|
162
171
|
(`usePwCodeAgentSwitcher`, `switcherAgent`, `usePwCodeAgentLine`,
|
|
163
|
-
`useAgentTypeLabel`),
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
shows
|
|
172
|
+
`useAgentTypeLabel`), taking one that is not running off the list, which
|
|
173
|
+
shows the main conversation again when it was the one in view and the
|
|
174
|
+
screen that asked is still open (`useDismissSubagent`), the mark each
|
|
175
|
+
agent shows for its state (`agentMark`), and the tone of its state's word
|
|
176
|
+
(`stateTone`, a `PwCodeStateTone` the host maps to its colors) and whether
|
|
177
|
+
that word shows beside the mark (`flagged`), the main conversation's
|
|
178
|
+
included.
|
|
167
179
|
- Where typed text goes (`slashAction`, `shellCommand`), the commands a
|
|
168
180
|
session offers (`paletteOptions`), read from the structural
|
|
169
181
|
`PwCodePalette`, whether a direction that got no answer may have landed
|
|
@@ -312,6 +324,11 @@ showing a toast, wording an error. Types are exported beside each.
|
|
|
312
324
|
whenever the selected or first enabled row changes, such as when the
|
|
313
325
|
accounts' sign-in states arrive. Its setter must keep its identity, as a
|
|
314
326
|
`useState` setter does: a new one moves the highlight back too.
|
|
327
|
+
Given `waitingAtLimit`, the session screen's, it asks for another account
|
|
328
|
+
to continue on (`handoff`) and offers to take the other sessions on the
|
|
329
|
+
spent one along (`others`, `moveOthers`, `setMoveOthers`), under the label
|
|
330
|
+
`moveOthersLabel`, null when the option doesn't show. `onMovedOthers` is
|
|
331
|
+
handed the words that say how many moved.
|
|
315
332
|
- The sign-in itself, run in the host's terminal (`useClaudeSignIn`, also
|
|
316
333
|
given `machineName`), with the sign-in page to offer opening, what to do,
|
|
317
334
|
a note when earlier output was dropped, the label that leaves it, and,
|
|
@@ -433,6 +450,12 @@ Its other options:
|
|
|
433
450
|
ref, to be loaded when it is drawn. Set it only where the host loads an
|
|
434
451
|
image from its URL on the platform's API signed in as the API client is, as
|
|
435
452
|
a browser on the platform's origin does.
|
|
453
|
+
- `transcriptEndFirst` reads a session's transcript end first and draws the
|
|
454
|
+
end of the conversation while the rest arrives, which over a slow
|
|
455
|
+
connection is most of the wait. Set it only where the client's `fetch` hands
|
|
456
|
+
over a response's body as it arrives (`response.body`), as a browser's does
|
|
457
|
+
and React Native's own does not. Until the whole transcript is there the
|
|
458
|
+
composer is disabled and nothing that waits on the reader is drawn.
|
|
436
459
|
|
|
437
460
|
The package carries the types of the routes it calls (`PwCodePaths`), generated
|
|
438
461
|
from the platform's OpenAPI spec. A client whose own API types lack one of
|
|
@@ -629,9 +652,13 @@ and navigates nowhere. The host supplies each:
|
|
|
629
652
|
`useSessionActions`' `showStart` and `showSession`,
|
|
630
653
|
`usePwCodeConversation`'s `onCleared` and `onMoved`, `usePwCodeComposer`'s
|
|
631
654
|
`onCleared` and `onArchived`, `useSessionLink`'s `open`, `useSessionList`'s
|
|
632
|
-
`newSession`, `useModelPicker`'s `onAccounts
|
|
633
|
-
`useClaudeAccountPanel`'s `onClose`.
|
|
634
|
-
|
|
655
|
+
`newSession`, `useModelPicker`'s `onAccounts`,
|
|
656
|
+
`useClaudeAccountPanel`'s `onClose` and `useDismissSubagent`'s `showMain`.
|
|
657
|
+
Of these, `usePwCodeComposer`'s `onCleared` and `onArchived` and
|
|
658
|
+
`useDismissSubagent`'s `showMain` are not called once the screen that asked
|
|
659
|
+
has closed, so an answer that comes late leaves the reader where they went.
|
|
660
|
+
- What the reader is told and asked: `describeError`, `notify`,
|
|
661
|
+
`useClaudeAccountPanel`'s `onMovedOthers`, and
|
|
635
662
|
`useSessionActions`' `confirm`; Claude Code's sign-in runs in the host's
|
|
636
663
|
terminal, `useClaudeSignIn`'s `terminal`.
|
|
637
664
|
|
package/dist/agentSwitcher.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Schemas } from './apiClient.js';
|
|
2
2
|
import type { PwCodeSubagentUsage } from './types.js';
|
|
3
|
-
import type { PwCodeConversationState } from './useConversation.js';
|
|
3
|
+
import type { PwCodeConversation, PwCodeConversationState } from './useConversation.js';
|
|
4
4
|
/** One subagent as the switcher lists it. */
|
|
5
5
|
export interface PwCodeSwitcherAgent {
|
|
6
6
|
id: string;
|
|
@@ -45,12 +45,23 @@ export interface PwCodeAgentLine {
|
|
|
45
45
|
stateTone: PwCodeStateTone;
|
|
46
46
|
/** The state needs the reader, so it is said in words beside its mark. */
|
|
47
47
|
flagged: boolean;
|
|
48
|
-
/** Still running, so it can be stopped. */
|
|
48
|
+
/** Still running, so it can be stopped; once it is not, it can be taken off the list instead. */
|
|
49
49
|
stoppable: boolean;
|
|
50
50
|
/** Names the agent, for a stop button among others. */
|
|
51
51
|
stopLabel: string;
|
|
52
|
+
/** Names the agent, for a button among others that takes it off the list. */
|
|
53
|
+
dismissLabel: string;
|
|
52
54
|
}
|
|
53
55
|
export declare function usePwCodeAgentLine(): (agent: PwCodeSwitcherAgent) => PwCodeAgentLine;
|
|
56
|
+
/** Takes an agent that is not running off the session's list, resolving to
|
|
57
|
+
* whether it went. The main conversation comes back into view when the agent
|
|
58
|
+
* that went is the one in view by then, since the reader may have opened
|
|
59
|
+
* another meanwhile, and only while the screen that asked is still open. */
|
|
60
|
+
export declare function useDismissSubagent(conversation: Pick<PwCodeConversation, 'dismissSubagent'>, { viewing, showMain, }: {
|
|
61
|
+
/** The subagent in view; null for the main conversation. */
|
|
62
|
+
viewing: string | null;
|
|
63
|
+
showMain: () => void;
|
|
64
|
+
}): (id: string) => Promise<boolean>;
|
|
54
65
|
/** A subagent's row in the switcher's list. */
|
|
55
66
|
export interface PwCodeSwitcherRow extends PwCodeAgentLine {
|
|
56
67
|
/** How long it has run, or ran; null before it started. */
|
package/dist/agentSwitcher.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { usePwCodeTranslations } from "./messages.js";
|
|
2
2
|
import { turnDuration } from "./notices.js";
|
|
3
|
-
import {
|
|
3
|
+
import { useMounted } from "./useMounted.js";
|
|
4
|
+
import { useCallback, useMemo, useRef } from "react";
|
|
4
5
|
import { sanitizeLabel } from "@parallelworks/ui/ai/headless";
|
|
5
6
|
import { useFormatter } from "use-intl";
|
|
6
7
|
import { DateTime } from "luxon";
|
|
@@ -63,6 +64,10 @@ function usePwCodeAgentLine() {
|
|
|
63
64
|
const state = agentState(agent);
|
|
64
65
|
const type = typeLabel(agent.agentType);
|
|
65
66
|
const description = sanitizeLabel(agent.description);
|
|
67
|
+
const name = t("switcher.agentName", {
|
|
68
|
+
type,
|
|
69
|
+
description
|
|
70
|
+
});
|
|
66
71
|
return {
|
|
67
72
|
agent,
|
|
68
73
|
type,
|
|
@@ -72,13 +77,30 @@ function usePwCodeAgentLine() {
|
|
|
72
77
|
stateTone: stateTone(state),
|
|
73
78
|
flagged: flagged(state),
|
|
74
79
|
stoppable: agent.status === "running",
|
|
75
|
-
stopLabel: t("switcher.stop", { name
|
|
76
|
-
|
|
77
|
-
description
|
|
78
|
-
}) })
|
|
80
|
+
stopLabel: t("switcher.stop", { name }),
|
|
81
|
+
dismissLabel: t("switcher.dismiss", { name })
|
|
79
82
|
};
|
|
80
83
|
}, [t, typeLabel]);
|
|
81
84
|
}
|
|
85
|
+
/** Takes an agent that is not running off the session's list, resolving to
|
|
86
|
+
* whether it went. The main conversation comes back into view when the agent
|
|
87
|
+
* that went is the one in view by then, since the reader may have opened
|
|
88
|
+
* another meanwhile, and only while the screen that asked is still open. */
|
|
89
|
+
function useDismissSubagent(conversation, { viewing, showMain }) {
|
|
90
|
+
const inView = useRef(viewing);
|
|
91
|
+
inView.current = viewing;
|
|
92
|
+
const mounted = useMounted();
|
|
93
|
+
const { dismissSubagent } = conversation;
|
|
94
|
+
return useCallback(async (id) => {
|
|
95
|
+
const taken = await dismissSubagent(id);
|
|
96
|
+
if (taken && mounted.current && id === inView.current) showMain();
|
|
97
|
+
return taken;
|
|
98
|
+
}, [
|
|
99
|
+
dismissSubagent,
|
|
100
|
+
mounted,
|
|
101
|
+
showMain
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
82
104
|
function elapsedMs(agent, nowSeconds) {
|
|
83
105
|
if (!agent.startedAt) return null;
|
|
84
106
|
const started = DateTime.fromISO(agent.startedAt).toMillis();
|
|
@@ -162,4 +184,4 @@ function usePwCodeAgentSwitcher({ agents, mainState, viewing, open, earlierOpen
|
|
|
162
184
|
line
|
|
163
185
|
]);
|
|
164
186
|
}
|
|
165
|
-
export { agentMark, switcherAgent, useAgentTypeLabel, usePwCodeAgentLine, usePwCodeAgentSwitcher };
|
|
187
|
+
export { agentMark, switcherAgent, useAgentTypeLabel, useDismissSubagent, usePwCodeAgentLine, usePwCodeAgentSwitcher };
|
package/dist/ago.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/** "5m" since a time,
|
|
2
|
-
* than turning into a date as a compact RelativeTime does, and re-reads every
|
|
3
|
-
* 30 seconds. */
|
|
1
|
+
/** "5m" since a time, counting days where a compact RelativeTime shows a date. */
|
|
4
2
|
export declare function useCompactAgo(): {
|
|
5
3
|
now: number;
|
|
6
4
|
compact: (iso: string | undefined) => string;
|
package/dist/ago.js
CHANGED
|
@@ -3,9 +3,7 @@ import { useCallback, useMemo } from "react";
|
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
import { useClock } from "@parallelworks/ui/headless";
|
|
5
5
|
// src/ago.ts
|
|
6
|
-
/** "5m" since a time,
|
|
7
|
-
* than turning into a date as a compact RelativeTime does, and re-reads every
|
|
8
|
-
* 30 seconds. */
|
|
6
|
+
/** "5m" since a time, counting days where a compact RelativeTime shows a date. */
|
|
9
7
|
function useCompactAgo() {
|
|
10
8
|
const t = usePwCodeTranslations("agents");
|
|
11
9
|
const tick = useClock((current) => Math.floor(current / 3e4));
|
package/dist/api.d.ts
CHANGED
|
@@ -292,6 +292,28 @@ export interface paths {
|
|
|
292
292
|
patch?: never;
|
|
293
293
|
trace?: never;
|
|
294
294
|
};
|
|
295
|
+
"/api/code/machines/{machine}/claude-code/accounts/{name}/move": {
|
|
296
|
+
parameters: {
|
|
297
|
+
query?: never;
|
|
298
|
+
header?: never;
|
|
299
|
+
path?: never;
|
|
300
|
+
cookie?: never;
|
|
301
|
+
};
|
|
302
|
+
get?: never;
|
|
303
|
+
put?: never;
|
|
304
|
+
/**
|
|
305
|
+
* Move a Claude Code account's sessions to another account
|
|
306
|
+
* @description > This is a user-centric route, so the response will always be in the context of the currently authenticated user.
|
|
307
|
+
*
|
|
308
|
+
* Move a Claude Code account's sessions to another account. Switches every live session running Claude Code on the account to another, as the session settings route does for one: a turn waiting at the account's usage limit continues at once, and a running one switches after it. Every session on an account shares its usage limit, so this moves them off a spent one together. The daemon enforces each session's control policy.
|
|
309
|
+
*/
|
|
310
|
+
post: operations["move-agent-machine-claude-account-sessions"];
|
|
311
|
+
delete?: never;
|
|
312
|
+
options?: never;
|
|
313
|
+
head?: never;
|
|
314
|
+
patch?: never;
|
|
315
|
+
trace?: never;
|
|
316
|
+
};
|
|
295
317
|
"/api/code/machines/{machine}/claude-code/logins": {
|
|
296
318
|
parameters: {
|
|
297
319
|
query?: never;
|
|
@@ -1070,6 +1092,28 @@ export interface paths {
|
|
|
1070
1092
|
patch?: never;
|
|
1071
1093
|
trace?: never;
|
|
1072
1094
|
};
|
|
1095
|
+
"/api/code/machines/{machine}/sessions/{id}/subagents/{subId}/dismiss": {
|
|
1096
|
+
parameters: {
|
|
1097
|
+
query?: never;
|
|
1098
|
+
header?: never;
|
|
1099
|
+
path?: never;
|
|
1100
|
+
cookie?: never;
|
|
1101
|
+
};
|
|
1102
|
+
get?: never;
|
|
1103
|
+
put?: never;
|
|
1104
|
+
/**
|
|
1105
|
+
* Take a pw code subagent off the session's list
|
|
1106
|
+
* @description > This is a user-centric route, so the response will always be in the context of the currently authenticated user.
|
|
1107
|
+
*
|
|
1108
|
+
* Takes a subagent that is not running off the session's list for every window showing the session, and says so with a subagent_dismissed event on its feed. It is not deleted: its transcript still opens, a message or the session's model can still give it work, and running again lists it again. Refused with 409 while it runs; stop it first. Like stop, it is not held to the remote permission ceiling.
|
|
1109
|
+
*/
|
|
1110
|
+
post: operations["dismiss-agent-session-subagent"];
|
|
1111
|
+
delete?: never;
|
|
1112
|
+
options?: never;
|
|
1113
|
+
head?: never;
|
|
1114
|
+
patch?: never;
|
|
1115
|
+
trace?: never;
|
|
1116
|
+
};
|
|
1073
1117
|
"/api/code/machines/{machine}/sessions/{id}/subagents/{subId}/messages": {
|
|
1074
1118
|
parameters: {
|
|
1075
1119
|
query?: never;
|
|
@@ -1136,6 +1180,28 @@ export interface paths {
|
|
|
1136
1180
|
patch?: never;
|
|
1137
1181
|
trace?: never;
|
|
1138
1182
|
};
|
|
1183
|
+
"/api/code/machines/{machine}/sessions/{id}/transcript": {
|
|
1184
|
+
parameters: {
|
|
1185
|
+
query?: never;
|
|
1186
|
+
header?: never;
|
|
1187
|
+
path?: never;
|
|
1188
|
+
cookie?: never;
|
|
1189
|
+
};
|
|
1190
|
+
/**
|
|
1191
|
+
* Get a pw code session transcript, its end first
|
|
1192
|
+
* @description > This is a user-centric route, so the response will always be in the context of the currently authenticated user.
|
|
1193
|
+
*
|
|
1194
|
+
* Returns the session as get-agent-session does, with its history in two parts: tail holds the session and the end of its history, and older the history before it. The tail is written first, so a reader on a slow connection can show where the conversation stands while the rest arrives.
|
|
1195
|
+
*/
|
|
1196
|
+
get: operations["get-agent-session-transcript"];
|
|
1197
|
+
put?: never;
|
|
1198
|
+
post?: never;
|
|
1199
|
+
delete?: never;
|
|
1200
|
+
options?: never;
|
|
1201
|
+
head?: never;
|
|
1202
|
+
patch?: never;
|
|
1203
|
+
trace?: never;
|
|
1204
|
+
};
|
|
1139
1205
|
"/api/code/machines/{machine}/sessions/{id}/worktree": {
|
|
1140
1206
|
parameters: {
|
|
1141
1207
|
query?: never;
|
|
@@ -1230,6 +1296,7 @@ export interface components {
|
|
|
1230
1296
|
name: string;
|
|
1231
1297
|
plan?: string;
|
|
1232
1298
|
refreshing?: boolean;
|
|
1299
|
+
sessions?: string[] | null;
|
|
1233
1300
|
signInRequired?: boolean;
|
|
1234
1301
|
usage?: string;
|
|
1235
1302
|
/** Format: date-time */
|
|
@@ -1237,6 +1304,16 @@ export interface components {
|
|
|
1237
1304
|
/** Format: double */
|
|
1238
1305
|
weeklyUsedPercent?: number;
|
|
1239
1306
|
};
|
|
1307
|
+
AgentClaudeAccountMoveBody: {
|
|
1308
|
+
/** @description Session id to leave on its account, such as the one the caller switches itself. */
|
|
1309
|
+
except?: string;
|
|
1310
|
+
/** @description Claude Code account on the machine to move the sessions to. */
|
|
1311
|
+
to: string;
|
|
1312
|
+
};
|
|
1313
|
+
AgentClaudeAccountMoved: {
|
|
1314
|
+
/** @description Ids of the sessions now on the account moved to. A session the caller may not drive stays where it is. */
|
|
1315
|
+
moved: string[] | null;
|
|
1316
|
+
};
|
|
1240
1317
|
AgentClaudeLoginEvent: {
|
|
1241
1318
|
data?: string;
|
|
1242
1319
|
login: components["schemas"]["ClaudeLogin"];
|
|
@@ -1517,6 +1594,9 @@ export interface components {
|
|
|
1517
1594
|
turnStartedAt?: string;
|
|
1518
1595
|
/** Format: date-time */
|
|
1519
1596
|
updatedAt: string;
|
|
1597
|
+
/** Format: date-time */
|
|
1598
|
+
usageLimitResumeAt?: string;
|
|
1599
|
+
waitingForUsageLimit?: boolean;
|
|
1520
1600
|
workspace: string;
|
|
1521
1601
|
};
|
|
1522
1602
|
AgentSessionCleared: {
|
|
@@ -1690,6 +1770,12 @@ export interface components {
|
|
|
1690
1770
|
/** @description The session's subagents in the order they started. Their status is empty when the machine's pw code is too old to say how its subagents stand. */
|
|
1691
1771
|
subagents: components["schemas"]["Subagent"][] | null;
|
|
1692
1772
|
};
|
|
1773
|
+
AgentTranscript: {
|
|
1774
|
+
/** @description The history before the tail's, oldest first. The whole history is older followed by tail.history. */
|
|
1775
|
+
older: components["schemas"]["HistoryItem"][] | null;
|
|
1776
|
+
/** @description The session, with the end of its history: what a reader sees first. */
|
|
1777
|
+
tail: components["schemas"]["AgentSessionDetail"];
|
|
1778
|
+
};
|
|
1693
1779
|
AgentWorktreeLeft: {
|
|
1694
1780
|
/**
|
|
1695
1781
|
* @description left keeps the worktree on the machine; remove_failed is a session that left it, but whose worktree could not be removed and stays.
|
|
@@ -3017,6 +3103,42 @@ export interface operations {
|
|
|
3017
3103
|
};
|
|
3018
3104
|
};
|
|
3019
3105
|
};
|
|
3106
|
+
"move-agent-machine-claude-account-sessions": {
|
|
3107
|
+
parameters: {
|
|
3108
|
+
query?: never;
|
|
3109
|
+
header?: never;
|
|
3110
|
+
path: {
|
|
3111
|
+
machine: string;
|
|
3112
|
+
name: string;
|
|
3113
|
+
};
|
|
3114
|
+
cookie?: never;
|
|
3115
|
+
};
|
|
3116
|
+
requestBody: {
|
|
3117
|
+
content: {
|
|
3118
|
+
"application/json": components["schemas"]["AgentClaudeAccountMoveBody"];
|
|
3119
|
+
};
|
|
3120
|
+
};
|
|
3121
|
+
responses: {
|
|
3122
|
+
/** @description OK */
|
|
3123
|
+
200: {
|
|
3124
|
+
headers: {
|
|
3125
|
+
[name: string]: unknown;
|
|
3126
|
+
};
|
|
3127
|
+
content: {
|
|
3128
|
+
"application/json": components["schemas"]["AgentClaudeAccountMoved"];
|
|
3129
|
+
};
|
|
3130
|
+
};
|
|
3131
|
+
/** @description Error */
|
|
3132
|
+
default: {
|
|
3133
|
+
headers: {
|
|
3134
|
+
[name: string]: unknown;
|
|
3135
|
+
};
|
|
3136
|
+
content: {
|
|
3137
|
+
"application/json": components["schemas"]["Error"];
|
|
3138
|
+
};
|
|
3139
|
+
};
|
|
3140
|
+
};
|
|
3141
|
+
};
|
|
3020
3142
|
"start-agent-claude-login": {
|
|
3021
3143
|
parameters: {
|
|
3022
3144
|
query?: never;
|
|
@@ -4409,6 +4531,40 @@ export interface operations {
|
|
|
4409
4531
|
};
|
|
4410
4532
|
};
|
|
4411
4533
|
};
|
|
4534
|
+
"dismiss-agent-session-subagent": {
|
|
4535
|
+
parameters: {
|
|
4536
|
+
query?: never;
|
|
4537
|
+
header?: never;
|
|
4538
|
+
path: {
|
|
4539
|
+
/** @description Machine id from the machines list. */
|
|
4540
|
+
machine: string;
|
|
4541
|
+
/** @description Session id as the daemon reports it. */
|
|
4542
|
+
id: string;
|
|
4543
|
+
/** @description Subagent id from the session's subagents. */
|
|
4544
|
+
subId: string;
|
|
4545
|
+
};
|
|
4546
|
+
cookie?: never;
|
|
4547
|
+
};
|
|
4548
|
+
requestBody?: never;
|
|
4549
|
+
responses: {
|
|
4550
|
+
/** @description No Content */
|
|
4551
|
+
204: {
|
|
4552
|
+
headers: {
|
|
4553
|
+
[name: string]: unknown;
|
|
4554
|
+
};
|
|
4555
|
+
content?: never;
|
|
4556
|
+
};
|
|
4557
|
+
/** @description Error */
|
|
4558
|
+
default: {
|
|
4559
|
+
headers: {
|
|
4560
|
+
[name: string]: unknown;
|
|
4561
|
+
};
|
|
4562
|
+
content: {
|
|
4563
|
+
"application/json": components["schemas"]["Error"];
|
|
4564
|
+
};
|
|
4565
|
+
};
|
|
4566
|
+
};
|
|
4567
|
+
};
|
|
4412
4568
|
"send-agent-session-subagent-message": {
|
|
4413
4569
|
parameters: {
|
|
4414
4570
|
query?: never;
|
|
@@ -4521,6 +4677,50 @@ export interface operations {
|
|
|
4521
4677
|
};
|
|
4522
4678
|
};
|
|
4523
4679
|
};
|
|
4680
|
+
"get-agent-session-transcript": {
|
|
4681
|
+
parameters: {
|
|
4682
|
+
query?: {
|
|
4683
|
+
/** @description Set to refs, each image in the history that has a ref comes with empty data: its preview is read from the session's image route with preview=true. */
|
|
4684
|
+
previews?: "refs";
|
|
4685
|
+
/** @description About how many history items the tail holds. It is longer when no item that near the end starts cleanly: a tool result is never parted from its call. */
|
|
4686
|
+
tail?: number;
|
|
4687
|
+
};
|
|
4688
|
+
header?: {
|
|
4689
|
+
/** @description The ETag of a transcript you hold. While the session has not changed, the answer is 304 with no body, and its machine does not send the transcript again. */
|
|
4690
|
+
"If-None-Match"?: string;
|
|
4691
|
+
};
|
|
4692
|
+
path: {
|
|
4693
|
+
/** @description Machine id from the machines list. */
|
|
4694
|
+
machine: string;
|
|
4695
|
+
/** @description Session id as the daemon reports it. */
|
|
4696
|
+
id: string;
|
|
4697
|
+
};
|
|
4698
|
+
cookie?: never;
|
|
4699
|
+
};
|
|
4700
|
+
requestBody?: never;
|
|
4701
|
+
responses: {
|
|
4702
|
+
/** @description OK */
|
|
4703
|
+
200: {
|
|
4704
|
+
headers: {
|
|
4705
|
+
"Cache-Control"?: string;
|
|
4706
|
+
ETag?: string;
|
|
4707
|
+
[name: string]: unknown;
|
|
4708
|
+
};
|
|
4709
|
+
content: {
|
|
4710
|
+
"application/json": components["schemas"]["AgentTranscript"];
|
|
4711
|
+
};
|
|
4712
|
+
};
|
|
4713
|
+
/** @description Error */
|
|
4714
|
+
default: {
|
|
4715
|
+
headers: {
|
|
4716
|
+
[name: string]: unknown;
|
|
4717
|
+
};
|
|
4718
|
+
content: {
|
|
4719
|
+
"application/json": components["schemas"]["Error"];
|
|
4720
|
+
};
|
|
4721
|
+
};
|
|
4722
|
+
};
|
|
4723
|
+
};
|
|
4524
4724
|
"get-agent-session-worktree": {
|
|
4525
4725
|
parameters: {
|
|
4526
4726
|
query?: never;
|
package/dist/chatStrings.d.ts
CHANGED
package/dist/chatStrings.js
CHANGED
|
@@ -121,7 +121,8 @@ function chatStrings(t, tAgents, tools) {
|
|
|
121
121
|
},
|
|
122
122
|
input: {
|
|
123
123
|
stopGenerating: t("input.stopGenerating"),
|
|
124
|
-
loadingCommands: t("input.loadingCommands")
|
|
124
|
+
loadingCommands: t("input.loadingCommands"),
|
|
125
|
+
emoji: t("input.emoji")
|
|
125
126
|
},
|
|
126
127
|
thread: { jumpToPrompt: (text) => t("thread.jumpToPrompt", { text }) },
|
|
127
128
|
find: {
|
package/dist/claudeAccounts.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Schemas } from './apiClient.js';
|
|
|
3
3
|
import type { claudeApi } from './claudeApi.js';
|
|
4
4
|
export type ClaudeAccount = Schemas['AgentClaudeAccount'];
|
|
5
5
|
/** The account hooks of `createPwCodeApi`. */
|
|
6
|
-
export type ClaudeAccountCalls = Pick<ReturnType<typeof claudeApi>, 'useClaudeAccounts' | 'useRefreshClaudeModels' | 'useRemoveClaudeAccount'>;
|
|
6
|
+
export type ClaudeAccountCalls = Pick<ReturnType<typeof claudeApi>, 'useClaudeAccounts' | 'useRefreshClaudeModels' | 'useRemoveClaudeAccount' | 'useMoveClaudeAccountSessions'>;
|
|
7
7
|
/** What the account panel shows: the list, or one step taken from it. */
|
|
8
8
|
export type ClaudeAccountView = {
|
|
9
9
|
kind: 'list';
|
|
@@ -86,6 +86,15 @@ export interface ClaudeAccountPanelState {
|
|
|
86
86
|
/** Signs the account out and deletes it, then returns to the list. A
|
|
87
87
|
* selected account falls back to `default`. */
|
|
88
88
|
removeAccount: (name: string) => Promise<void>;
|
|
89
|
+
/** The session waits at its account's usage limit, so a pick continues it at once. */
|
|
90
|
+
handoff: boolean;
|
|
91
|
+
/** The other sessions on the selected account a pick in a handoff can take along, which share its limit. */
|
|
92
|
+
others: number;
|
|
93
|
+
/** The label of the option to take them along, offered with the list while
|
|
94
|
+
* the setting can change; null when it isn't. */
|
|
95
|
+
moveOthersLabel: string | null;
|
|
96
|
+
moveOthers: boolean;
|
|
97
|
+
setMoveOthers: (move: boolean) => void;
|
|
89
98
|
}
|
|
90
99
|
/** The refusal of a read that needs the account signed in first. */
|
|
91
100
|
export declare function claudeSignInRequired(error: unknown): boolean;
|
|
@@ -99,7 +108,7 @@ export declare function useClaudeAccountStartRow(panel: Pick<ClaudeAccountPanelS
|
|
|
99
108
|
/** The Claude Code accounts on a machine, and the steps a panel listing them
|
|
100
109
|
* takes: adding, signing in, removing after a confirmation the host shows,
|
|
101
110
|
* and choosing one for the `account` setting. */
|
|
102
|
-
export declare function useClaudeAccountPanel(calls: ClaudeAccountCalls, { machine, machineName, sessionId, claudeInstalled, claudeAllowed, claudeLogin, claudeAccountRemove, account, onClose, }: {
|
|
111
|
+
export declare function useClaudeAccountPanel(calls: ClaudeAccountCalls, { machine, machineName, sessionId, claudeInstalled, claudeAllowed, claudeLogin, claudeAccountRemove, waitingAtLimit, account, onClose, onMovedOthers, onMoveError, }: {
|
|
103
112
|
machine: string;
|
|
104
113
|
machineName: string;
|
|
105
114
|
sessionId?: string | undefined;
|
|
@@ -109,8 +118,15 @@ export declare function useClaudeAccountPanel(calls: ClaudeAccountCalls, { machi
|
|
|
109
118
|
claudeLogin?: boolean | undefined;
|
|
110
119
|
/** The machine can remove accounts from here. */
|
|
111
120
|
claudeAccountRemove?: boolean | undefined;
|
|
121
|
+
/** The session's turn waits at its account's usage limit, as
|
|
122
|
+
* `usePwCodeSessionScreen`'s `waitingAtLimit` says. */
|
|
123
|
+
waitingAtLimit?: boolean | undefined;
|
|
112
124
|
account: BoundSetting;
|
|
113
125
|
onClose: () => void;
|
|
126
|
+
/** Called once a pick has taken other sessions along, with the words to
|
|
127
|
+
* tell the reader, how many moved and the account they moved to. */
|
|
128
|
+
onMovedOthers?: ((message: string, moved: number, account: string) => void) | undefined;
|
|
129
|
+
onMoveError?: ((error: unknown) => void) | undefined;
|
|
114
130
|
}): ClaudeAccountPanelState;
|
|
115
131
|
/** The confirmation of a removal: whether it runs, and why it last failed. */
|
|
116
132
|
export declare function useClaudeAccountRemoval(remove: () => Promise<void>): {
|
|
@@ -123,6 +139,8 @@ export declare function useClaudeAccountRemoval(remove: () => Promise<void>): {
|
|
|
123
139
|
export declare function useClaudeAccountName(onContinue: (name: string) => void): {
|
|
124
140
|
name: string;
|
|
125
141
|
invalid: boolean;
|
|
142
|
+
/** The longest name Claude Code takes, for the field to stop at. */
|
|
143
|
+
maxLength: number;
|
|
126
144
|
change: (value: string) => void;
|
|
127
145
|
submit: () => void;
|
|
128
146
|
};
|