@parallelworks/code 0.3.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 +625 -113
- package/dist/accountApi.d.ts +31 -0
- package/dist/accountApi.js +182 -0
- package/dist/agentSwitcher.d.ts +120 -0
- package/dist/agentSwitcher.js +187 -0
- package/dist/ago.d.ts +1 -3
- package/dist/ago.js +8 -10
- package/dist/allocations.d.ts +41 -0
- package/dist/allocations.js +76 -0
- package/dist/api.d.ts +1319 -50
- package/dist/chatStrings.d.ts +189 -0
- package/dist/chatStrings.js +218 -0
- package/dist/claudeAccounts.d.ts +57 -2
- package/dist/claudeAccounts.js +144 -6
- package/dist/claudeApi.d.ts +2 -1
- package/dist/claudeApi.js +50 -4
- package/dist/claudeSignIn.d.ts +19 -1
- package/dist/claudeSignIn.js +12 -2
- package/dist/command.d.ts +5 -1
- package/dist/command.js +6 -1
- package/dist/commandsApi.d.ts +11 -1
- package/dist/commandsApi.js +24 -5
- package/dist/createPwCodeApi.d.ts +114 -6
- package/dist/createPwCodeApi.js +21 -3
- package/dist/directories.d.ts +161 -0
- package/dist/directories.js +301 -0
- package/dist/goal.d.ts +89 -0
- package/dist/goal.js +164 -0
- package/dist/imageFit.d.ts +23 -0
- package/dist/imageFit.js +27 -0
- package/dist/images.d.ts +28 -0
- package/dist/images.js +38 -6
- package/dist/index.d.ts +31 -15
- package/dist/index.js +29 -14
- package/dist/loadError.d.ts +8 -0
- package/dist/loadError.js +19 -0
- package/dist/locales/en/agentTranscript.js +74 -12
- package/dist/locales/en/agents.js +86 -11
- package/dist/locales/en.d.ts +137 -8
- package/dist/locales/es/agentTranscript.js +74 -12
- package/dist/locales/es/agents.js +86 -11
- package/dist/locales/ja/agentTranscript.js +77 -15
- package/dist/locales/ja/agents.js +60 -122
- package/dist/locales/ko/agentTranscript.js +74 -12
- package/dist/locales/ko/agents.js +86 -11
- package/dist/locales/zh/agentTranscript.js +72 -10
- package/dist/locales/zh/agents.js +86 -11
- package/dist/machine.d.ts +2 -0
- package/dist/modelPicker.d.ts +79 -0
- package/dist/modelPicker.js +107 -0
- package/dist/notices.d.ts +2 -0
- package/dist/notices.js +67 -32
- package/dist/platformDefaults.d.ts +22 -0
- package/dist/platformDefaults.js +30 -0
- package/dist/preferences.d.ts +78 -0
- package/dist/preferences.js +128 -0
- package/dist/pullRequestList.d.ts +10 -2
- package/dist/pullRequestList.js +41 -22
- package/dist/query.d.ts +9 -2
- package/dist/query.js +91 -10
- package/dist/session.d.ts +11 -2
- package/dist/session.js +16 -8
- package/dist/sessionActions.d.ts +11 -1
- package/dist/sessionActions.js +14 -6
- package/dist/sessionEvents.d.ts +37 -5
- package/dist/sessionEvents.js +196 -77
- package/dist/sessionGroups.d.ts +5 -4
- package/dist/sessionGroups.js +6 -5
- package/dist/sessionHeader.js +6 -2
- package/dist/sessionList.d.ts +68 -15
- package/dist/sessionList.js +91 -19
- package/dist/sessionScreen.d.ts +197 -0
- package/dist/sessionScreen.js +218 -0
- package/dist/sessionsApi.d.ts +29 -3
- package/dist/sessionsApi.js +180 -33
- package/dist/sessionsFeed.d.ts +22 -0
- package/dist/sessionsFeed.js +125 -0
- package/dist/settingsApi.d.ts +3 -1
- package/dist/startPage.d.ts +153 -0
- package/dist/startPage.js +174 -0
- package/dist/startSession.d.ts +41 -7
- package/dist/startSession.js +26 -4
- package/dist/todos.d.ts +42 -0
- package/dist/todos.js +104 -0
- package/dist/transcript.d.ts +1 -2
- package/dist/transcript.js +111 -117
- package/dist/transcriptRead.d.ts +56 -0
- package/dist/transcriptRead.js +121 -0
- package/dist/types.d.ts +11 -1
- package/dist/useComposer.d.ts +39 -6
- package/dist/useComposer.js +73 -9
- package/dist/useComposerImages.d.ts +5 -0
- package/dist/useComposerImages.js +27 -5
- package/dist/useComposerPastes.d.ts +70 -0
- package/dist/useComposerPastes.js +125 -0
- package/dist/useConversation.d.ts +16 -1
- package/dist/useConversation.js +104 -10
- package/dist/useMounted.d.ts +3 -0
- package/dist/useMounted.js +14 -0
- package/dist/useSubagent.d.ts +51 -3
- package/dist/useSubagent.js +72 -7
- package/dist/useTranscript.d.ts +23 -3
- package/dist/useTranscript.js +76 -19
- package/dist/wording.d.ts +5 -2
- package/dist/wording.js +8 -6
- package/dist/workingDirectories.d.ts +31 -0
- package/dist/workingDirectories.js +25 -1
- package/locales/en/agentTranscript.json +68 -11
- package/locales/en/agents.json +82 -10
- package/locales/es/agentTranscript.json +68 -11
- package/locales/es/agents.json +82 -10
- package/locales/ja/agentTranscript.json +71 -14
- package/locales/ja/agents.json +82 -10
- package/locales/ko/agentTranscript.json +68 -11
- package/locales/ko/agents.json +82 -10
- package/locales/zh/agentTranscript.json +66 -9
- package/locales/zh/agents.json +82 -10
- package/package.json +6 -3
package/dist/useTranscript.js
CHANGED
|
@@ -34,7 +34,7 @@ function forgetPlaced(unechoed, detail) {
|
|
|
34
34
|
}
|
|
35
35
|
/** Holds the live transcript for one session. The host still owns the socket
|
|
36
36
|
* and the fetch: it feeds events to `onEvent` and posts through `send`. */
|
|
37
|
-
function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdraw, onEffect, goalNotice, compactionNotice, recapNotice, words, imageUrl }) {
|
|
37
|
+
function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdraw, withdrawDirection, onEffect, goalNotice, compactionNotice, recapNotice, words, imageUrl }) {
|
|
38
38
|
const [transcript, setTranscript] = useState(null);
|
|
39
39
|
const transcriptRef = useRef(null);
|
|
40
40
|
const [sending, setSending] = useState(false);
|
|
@@ -46,10 +46,12 @@ function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdra
|
|
|
46
46
|
const sendRef = useRef(send);
|
|
47
47
|
const steerRef = useRef(steer);
|
|
48
48
|
const withdrawRef = useRef(withdraw);
|
|
49
|
+
const withdrawDirectionRef = useRef(withdrawDirection);
|
|
49
50
|
const onEffectRef = useRef(onEffect);
|
|
50
51
|
sendRef.current = send;
|
|
51
52
|
steerRef.current = steer;
|
|
52
53
|
withdrawRef.current = withdraw;
|
|
54
|
+
withdrawDirectionRef.current = withdrawDirection;
|
|
53
55
|
onEffectRef.current = onEffect;
|
|
54
56
|
const goalNoticeRef = useRef(goalNotice);
|
|
55
57
|
goalNoticeRef.current = goalNotice;
|
|
@@ -153,26 +155,32 @@ function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdra
|
|
|
153
155
|
]);
|
|
154
156
|
/** True once the running turn took the text, or the refusal if it may have.
|
|
155
157
|
* Commands and shell escapes change the next turn, so like the TUI they wait. */
|
|
156
|
-
const trySteer = useCallback(async (text, { pastes, images, previews }) => {
|
|
158
|
+
const trySteer = useCallback(async (text, { typed, pastes, images, previews }) => {
|
|
157
159
|
const steerTo = steerRef.current;
|
|
158
160
|
if (!steerTo || !turnRunning(transcriptRef.current) || /^[/!]/.test(text.trimStart())) return false;
|
|
159
161
|
ownSeq.current += 1;
|
|
160
162
|
const localId = `own-${ownSeq.current}`;
|
|
161
163
|
unechoed.current.set(localId, {
|
|
162
164
|
text,
|
|
165
|
+
typed,
|
|
163
166
|
pastes,
|
|
167
|
+
images,
|
|
164
168
|
previews,
|
|
165
169
|
steered: true
|
|
166
170
|
});
|
|
167
171
|
apply((state) => appendSteeredMessage(state, text, localId, pastes, previews));
|
|
168
172
|
const result = await steerTo(text, pastes, images);
|
|
169
|
-
if ("delivered" in result && result.delivered)
|
|
173
|
+
if ("delivered" in result && result.delivered) {
|
|
174
|
+
const sent = unechoed.current.get(localId);
|
|
175
|
+
if (sent && result.id) sent.noteId = result.id;
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
170
178
|
unechoed.current.delete(localId);
|
|
171
179
|
apply((state) => dropMessage(state, localId));
|
|
172
180
|
return "lost" in result ? result.lost : false;
|
|
173
181
|
}, [apply]);
|
|
174
182
|
const sendMessage = useCallback(async (text, options = {}) => {
|
|
175
|
-
const { pastes, images, previews } = options;
|
|
183
|
+
const { typed, pastes, images, previews } = options;
|
|
176
184
|
setSending(true);
|
|
177
185
|
const steered = options.steer !== false && await trySteer(text, options);
|
|
178
186
|
if (steered) {
|
|
@@ -184,7 +192,9 @@ function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdra
|
|
|
184
192
|
const localId = `own-${ownSeq.current}`;
|
|
185
193
|
unechoed.current.set(localId, {
|
|
186
194
|
text,
|
|
195
|
+
typed,
|
|
187
196
|
pastes,
|
|
197
|
+
images,
|
|
188
198
|
previews
|
|
189
199
|
});
|
|
190
200
|
const append = subagent ? appendTurnMessage : appendOwnMessage;
|
|
@@ -213,11 +223,38 @@ function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdra
|
|
|
213
223
|
]);
|
|
214
224
|
const resolveApproval = useCallback((approvalId) => apply((state) => resolveApprovalEverywhere(state, approvalId)), [apply]);
|
|
215
225
|
const noteShellRun = useCallback((command, output) => apply((state) => appendShellRun(state, command, output)), [apply]);
|
|
216
|
-
|
|
226
|
+
/** Takes back a message queued as a turn of its own, or one steered into
|
|
227
|
+
* the turn that the model has not been handed yet. */
|
|
228
|
+
const withdrawal = (id) => {
|
|
217
229
|
const sent = unechoed.current.get(id);
|
|
218
|
-
const
|
|
219
|
-
|
|
230
|
+
const state = transcriptRef.current;
|
|
231
|
+
if (!sent || !state) return;
|
|
232
|
+
const { noteId, turnId } = sent;
|
|
233
|
+
if (sent.steered) {
|
|
234
|
+
const withdrawNote = withdrawDirectionRef.current;
|
|
235
|
+
return noteId && withdrawNote && state.steered.some((m) => m.id === id) ? () => withdrawNote(noteId) : void 0;
|
|
236
|
+
}
|
|
237
|
+
const withdrawTurn = withdrawRef.current;
|
|
238
|
+
return turnId && withdrawTurn && state.queued.some((m) => m.id === id) ? () => withdrawTurn(turnId) : void 0;
|
|
220
239
|
};
|
|
240
|
+
const canRemoveQueued = useCallback((id) => !!withdrawal(id), []);
|
|
241
|
+
/** The message as it was sent once the machine gave it back, or the refusal. */
|
|
242
|
+
const withdrawMessage = useCallback(async (id) => {
|
|
243
|
+
const withdrawIt = withdrawal(id);
|
|
244
|
+
const sent = unechoed.current.get(id);
|
|
245
|
+
if (!withdrawIt || !sent) return null;
|
|
246
|
+
const result = await withdrawIt();
|
|
247
|
+
if (result.error) return { refusal: result.error };
|
|
248
|
+
unechoed.current.delete(id);
|
|
249
|
+
if (sent.turnId) ownTurnIds.current.delete(sent.turnId);
|
|
250
|
+
apply((state) => dropMessage(state, id));
|
|
251
|
+
return { sent };
|
|
252
|
+
}, [apply]);
|
|
253
|
+
const removeQueued = useCallback(async (id) => {
|
|
254
|
+
const outcome = await withdrawMessage(id);
|
|
255
|
+
return outcome && "refusal" in outcome ? outcome.refusal : null;
|
|
256
|
+
}, [withdrawMessage]);
|
|
257
|
+
const takingBack = useRef(false);
|
|
221
258
|
return {
|
|
222
259
|
transcript,
|
|
223
260
|
sending,
|
|
@@ -225,18 +262,38 @@ function usePwCodeTranscript({ sessionId, subagent, detail, send, steer, withdra
|
|
|
225
262
|
sendMessage,
|
|
226
263
|
resolveApproval,
|
|
227
264
|
noteShellRun,
|
|
228
|
-
canRemoveQueued
|
|
229
|
-
removeQueued
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
265
|
+
canRemoveQueued,
|
|
266
|
+
removeQueued,
|
|
267
|
+
takeBackPending: useCallback(async () => {
|
|
268
|
+
if (takingBack.current) return {
|
|
269
|
+
taken: [],
|
|
270
|
+
refusal: null
|
|
271
|
+
};
|
|
272
|
+
takingBack.current = true;
|
|
273
|
+
try {
|
|
274
|
+
const state = transcriptRef.current;
|
|
275
|
+
const ids = state ? [...state.steered, ...state.queued].map((m) => m.id) : [];
|
|
276
|
+
const outcomes = [];
|
|
277
|
+
for (const id of ids.toReversed()) outcomes.unshift(await withdrawMessage(id));
|
|
278
|
+
const taken = [];
|
|
279
|
+
let refusal = null;
|
|
280
|
+
for (const outcome of outcomes) if (outcome && "sent" in outcome) {
|
|
281
|
+
const { text, typed, pastes, images, previews } = outcome.sent;
|
|
282
|
+
taken.push({
|
|
283
|
+
text: typed ?? text,
|
|
284
|
+
pastes,
|
|
285
|
+
images,
|
|
286
|
+
previews
|
|
287
|
+
});
|
|
288
|
+
} else if (outcome) refusal ??= outcome.refusal;
|
|
289
|
+
return {
|
|
290
|
+
taken,
|
|
291
|
+
refusal
|
|
292
|
+
};
|
|
293
|
+
} finally {
|
|
294
|
+
takingBack.current = false;
|
|
295
|
+
}
|
|
296
|
+
}, [withdrawMessage]),
|
|
240
297
|
cursor: useCallback(() => transcriptRef.current?.cursor ?? 0, [])
|
|
241
298
|
};
|
|
242
299
|
}
|
package/dist/wording.d.ts
CHANGED
|
@@ -10,13 +10,16 @@ export declare const IMAGE_PLACEHOLDER: RegExp;
|
|
|
10
10
|
export declare function rememberSentPrompt(machine: string, id: string, text: string): void;
|
|
11
11
|
/** The id is never a label: it is a timestamp the reader did not choose. */
|
|
12
12
|
export declare function sessionLabel(s: Pick<PwCodeSession, 'machineId' | 'id' | 'name' | 'autoName' | 'preview'>, t: Translate): string;
|
|
13
|
+
/** `resumeClock` writes when a usage limit resets, which is left out without it. */
|
|
13
14
|
export declare function sessionStatusText(s: {
|
|
14
15
|
status: PwCodeSessionStatus;
|
|
15
16
|
liveHost?: string | undefined;
|
|
16
17
|
approvals?: PwCodePendingApprovals;
|
|
17
|
-
|
|
18
|
+
waitingForUsageLimit?: boolean | undefined;
|
|
19
|
+
usageLimitResumeAt?: string | undefined;
|
|
20
|
+
}, t: Translate, resumeClock?: (at: string) => string): string;
|
|
18
21
|
/** A dropped machine outranks the session's own state. */
|
|
19
|
-
export declare function sessionStateText(s: Parameters<typeof sessionStatusText>[0], machine: Pick<PwCodeMachine, 'status'> | undefined, t: Translate): string;
|
|
22
|
+
export declare function sessionStateText(s: Parameters<typeof sessionStatusText>[0], machine: Pick<PwCodeMachine, 'status'> | undefined, t: Translate, resumeClock?: (at: string) => string): string;
|
|
20
23
|
export declare function machineHint(machine: Pick<PwCodeMachine, 'status' | 'error' | 'agentVersion'>, t: Translate): {
|
|
21
24
|
text: string;
|
|
22
25
|
detail?: string;
|
package/dist/wording.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isMachineDown } from "./machine.js";
|
|
2
|
-
import { sessionKey, waitsOnAnswer } from "./session.js";
|
|
2
|
+
import { sessionKey, waitsOnAnswer, waitsOnUsageLimit } from "./session.js";
|
|
3
3
|
import { nameToEmoji } from "gemoji";
|
|
4
4
|
// src/wording.ts
|
|
5
5
|
/** How a prompt refers to an image sent with it: `[Image #1]`. */
|
|
@@ -22,8 +22,10 @@ function sessionLabel(s, t) {
|
|
|
22
22
|
return Object.hasOwn(nameToEmoji, key) ? nameToEmoji[key] ?? match : match;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
/** `resumeClock` writes when a usage limit resets, which is left out without it. */
|
|
26
|
+
function sessionStatusText(s, t, resumeClock) {
|
|
26
27
|
if (s.status === "awaiting_approval" && waitsOnAnswer(s.approvals)) return t("status.awaiting_answer");
|
|
28
|
+
if (waitsOnUsageLimit(s)) return s.usageLimitResumeAt && resumeClock ? t("status.usage_limit_until", { time: resumeClock(s.usageLimitResumeAt) }) : t("status.usage_limit");
|
|
27
29
|
return t(`status.${s.status}`, { host: s.liveHost ?? "" });
|
|
28
30
|
}
|
|
29
31
|
var DOWN_STATUSES = [
|
|
@@ -36,8 +38,8 @@ function isDownStatus(status) {
|
|
|
36
38
|
return DOWN_STATUSES.includes(status);
|
|
37
39
|
}
|
|
38
40
|
/** A dropped machine outranks the session's own state. */
|
|
39
|
-
function sessionStateText(s, machine, t) {
|
|
40
|
-
if (!isMachineDown(machine)) return sessionStatusText(s, t);
|
|
41
|
+
function sessionStateText(s, machine, t, resumeClock) {
|
|
42
|
+
if (!isMachineDown(machine)) return sessionStatusText(s, t, resumeClock);
|
|
41
43
|
return t(`machine.${isDownStatus(machine.status) ? machine.status : "unreachable"}`);
|
|
42
44
|
}
|
|
43
45
|
function machineHint(machine, t) {
|
|
@@ -82,8 +84,8 @@ function composerState(args) {
|
|
|
82
84
|
if (status === "awaiting_approval") {
|
|
83
85
|
const answer = waitsOnAnswer(approvals);
|
|
84
86
|
return {
|
|
85
|
-
placeholder:
|
|
86
|
-
hint:
|
|
87
|
+
placeholder: answer ? t("detail.composerAwaitingAnswer") : t("detail.composerAwaiting"),
|
|
88
|
+
hint: answer ? t("detail.footerAwaitingAnswer") : t("detail.footerAwaiting"),
|
|
87
89
|
locked: true
|
|
88
90
|
};
|
|
89
91
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { PwCodeApi } from './createPwCodeApi.js';
|
|
2
|
+
import type { PwCodeTranslator } from './messages.js';
|
|
2
3
|
import type { PwCodeAddedDirectory, PwCodeAllowedDirectory } from './types.js';
|
|
4
|
+
type Translate = PwCodeTranslator<'agents'>;
|
|
3
5
|
/** Where a path's last segment starts, at its last separator. */
|
|
4
6
|
export declare const lastSegmentAt: (path: string) => number;
|
|
5
7
|
/** The path's segments, each with the separator that ends it. */
|
|
@@ -20,6 +22,35 @@ export declare function directoryScopes(dir: PwCodeAddedDirectory): PwCodeDirect
|
|
|
20
22
|
/** What an approval let the session do in a directory, and whether that
|
|
21
23
|
* reaches below it. */
|
|
22
24
|
export declare function allowedAccess({ edit, subtree, }: PwCodeAllowedDirectory): 'edit' | 'read' | 'editFolder' | 'readFolder';
|
|
25
|
+
/** A session's working directory as it is written, on its machine. */
|
|
26
|
+
export interface PwCodeWorkingDirectoryText {
|
|
27
|
+
/** Stays whole before the path, which may be cut from the middle. */
|
|
28
|
+
prefix: string;
|
|
29
|
+
text: string;
|
|
30
|
+
/** What a control that opens the session's directories is called. */
|
|
31
|
+
label: string;
|
|
32
|
+
}
|
|
33
|
+
export declare function workingDirectoryText(machineName: string, workspace: string, t: Translate): PwCodeWorkingDirectoryText;
|
|
34
|
+
export interface PwCodeAddedDirectoryRow {
|
|
35
|
+
path: string;
|
|
36
|
+
/** Where it is kept, a line each: the session alone, or each settings file it is saved in. */
|
|
37
|
+
scopes: string[];
|
|
38
|
+
/** Only one added for the session alone: one saved in settings outlives it. */
|
|
39
|
+
removable: boolean;
|
|
40
|
+
removeLabel: string;
|
|
41
|
+
}
|
|
42
|
+
export interface PwCodeAllowedDirectoryRow {
|
|
43
|
+
path: string;
|
|
44
|
+
access: string;
|
|
45
|
+
}
|
|
46
|
+
/** A session's added and allowed directories as they are listed. */
|
|
47
|
+
export interface PwCodeSessionDirectories {
|
|
48
|
+
added: PwCodeAddedDirectoryRow[];
|
|
49
|
+
/** How the ones saved in settings are removed instead, while one is listed. */
|
|
50
|
+
savedNote: string | undefined;
|
|
51
|
+
allowed: PwCodeAllowedDirectoryRow[];
|
|
52
|
+
}
|
|
53
|
+
export declare function sessionDirectories(added: readonly PwCodeAddedDirectory[], allowed: readonly PwCodeAllowedDirectory[], t: Translate): PwCodeSessionDirectories;
|
|
23
54
|
/** Removing the directories added for a session only, one request per path at
|
|
24
55
|
* a time. A refusal puts the path back, so it can be tried again. */
|
|
25
56
|
export declare function useRemoveSessionDirectory(api: Pick<PwCodeApi, 'removeSessionDirectory'>, machine: string, sessionId: string): {
|
|
@@ -43,6 +43,30 @@ function allowedAccess({ edit, subtree }) {
|
|
|
43
43
|
if (!subtree) return edit ? "editFolder" : "readFolder";
|
|
44
44
|
return edit ? "edit" : "read";
|
|
45
45
|
}
|
|
46
|
+
function workingDirectoryText(machineName, workspace, t) {
|
|
47
|
+
const prefix = `${machineName}:`;
|
|
48
|
+
const text = `${prefix}${workspace}`;
|
|
49
|
+
return {
|
|
50
|
+
prefix,
|
|
51
|
+
text,
|
|
52
|
+
label: t("detail.workingDirectory", { path: text })
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function sessionDirectories(added, allowed, t) {
|
|
56
|
+
return {
|
|
57
|
+
added: added.map((dir) => ({
|
|
58
|
+
path: dir.path,
|
|
59
|
+
scopes: isSavedDirectory(dir) ? directoryScopes(dir).map((scope) => t(`detail.directoryScope.${scope}`)) : [t("detail.directoryScope.session")],
|
|
60
|
+
removable: !isSavedDirectory(dir),
|
|
61
|
+
removeLabel: t("detail.removeDirectory", { path: dir.path })
|
|
62
|
+
})),
|
|
63
|
+
savedNote: added.some(isSavedDirectory) ? t("detail.savedDirectoriesNote") : void 0,
|
|
64
|
+
allowed: allowed.map((dir) => ({
|
|
65
|
+
path: dir.path,
|
|
66
|
+
access: t(`detail.allowedAccess.${allowedAccess(dir)}`)
|
|
67
|
+
}))
|
|
68
|
+
};
|
|
69
|
+
}
|
|
46
70
|
/** Removing the directories added for a session only, one request per path at
|
|
47
71
|
* a time. A refusal puts the path back, so it can be tried again. */
|
|
48
72
|
function useRemoveSessionDirectory(api, machine, sessionId) {
|
|
@@ -68,4 +92,4 @@ function useRemoveSessionDirectory(api, machine, sessionId) {
|
|
|
68
92
|
remove
|
|
69
93
|
};
|
|
70
94
|
}
|
|
71
|
-
export { allowedAccess, cutSpacing, cutToFit, directoryScopes, isSavedDirectory, lastSegmentAt, pathSegments, shortestPath, useRemoveSessionDirectory };
|
|
95
|
+
export { allowedAccess, cutSpacing, cutToFit, directoryScopes, isSavedDirectory, lastSegmentAt, pathSegments, sessionDirectories, shortestPath, useRemoveSessionDirectory, workingDirectoryText };
|
|
@@ -24,19 +24,21 @@
|
|
|
24
24
|
"denyPath": "No, deny",
|
|
25
25
|
"allowCall": "Yes, allow this call",
|
|
26
26
|
"denyCall": "No, deny this call",
|
|
27
|
-
"denyWithFeedback": "No, and
|
|
28
|
-
"feedbackPlaceholder": "Tell the
|
|
27
|
+
"denyWithFeedback": "No, and tell the assistant why",
|
|
28
|
+
"feedbackPlaceholder": "Tell the assistant what to do instead…",
|
|
29
29
|
"answered": "Answered",
|
|
30
|
-
"allowedBy": "
|
|
31
|
-
"
|
|
30
|
+
"allowedBy": "{name} approved",
|
|
31
|
+
"allowedWithChangesBy": "{name} approved with changes",
|
|
32
|
+
"deniedBy": "{name} denied",
|
|
32
33
|
"allowed": "Allowed",
|
|
34
|
+
"allowedWithChanges": "Allowed with changes",
|
|
33
35
|
"denied": "Denied",
|
|
34
|
-
"allowedByReviewer": "
|
|
35
|
-
"deniedByReviewer": "
|
|
36
|
+
"allowedByReviewer": "Auto-reviewer approved",
|
|
37
|
+
"deniedByReviewer": "Auto-reviewer denied",
|
|
36
38
|
"approvalExpired": "Expired without an answer",
|
|
37
39
|
"approvalTimedOut": "Denied: no answer in time",
|
|
38
|
-
"reviewTimedOut": "
|
|
39
|
-
"reviewFailed": "
|
|
40
|
+
"reviewTimedOut": "Auto-review timed out",
|
|
41
|
+
"reviewFailed": "Auto-review failed",
|
|
40
42
|
"writeOwnAnswer": "Write my own answer…",
|
|
41
43
|
"subagent": "Task",
|
|
42
44
|
"tasks": "Tasks",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"approvalDenied": "Declined",
|
|
49
51
|
"approvalRequestExpired": "This request expired. Ask again to run it.",
|
|
50
52
|
"approvalWaitingOn": "Waiting for {name} to answer",
|
|
51
|
-
"feedbackLabel": "Feedback for the
|
|
53
|
+
"feedbackLabel": "Feedback for the assistant",
|
|
52
54
|
"ownAnswerLabel": "Your answer",
|
|
53
55
|
"typeYourAnswer": "Type your answer…",
|
|
54
56
|
"questionsLabel": "Questions",
|
|
@@ -122,7 +124,10 @@
|
|
|
122
124
|
"remove": "Remove queued message",
|
|
123
125
|
"waiting": "Queued · sends when this reply finishes",
|
|
124
126
|
"waitingNextStep": "Queued · reaches the agent after its current step",
|
|
125
|
-
"handedOver": "Sent to the running turn"
|
|
127
|
+
"handedOver": "Sent to the running turn",
|
|
128
|
+
"edit": "Edit",
|
|
129
|
+
"editLabel": "Edit queued messages",
|
|
130
|
+
"editHint": "Press ↑ to edit queued messages"
|
|
126
131
|
},
|
|
127
132
|
"paste": {
|
|
128
133
|
"title": "Pasted text",
|
|
@@ -131,7 +136,59 @@
|
|
|
131
136
|
"remove": "Remove paste"
|
|
132
137
|
},
|
|
133
138
|
"thinking": {
|
|
134
|
-
"
|
|
139
|
+
"label": "Thinking",
|
|
140
|
+
"ellipsis": "Thinking…",
|
|
141
|
+
"thoughtFor": "Thought for {duration}",
|
|
142
|
+
"thoughtProcess": "Thought process",
|
|
143
|
+
"activity": "Activity",
|
|
144
|
+
"ranToolCalls": "{count, plural, one {Ran # tool call} other {Ran # tool calls}}",
|
|
145
|
+
"ranToolCallsAs": "{count, plural, one {Ran # tool call as {name}} other {Ran # tool calls as {name}}}"
|
|
146
|
+
},
|
|
147
|
+
"activity": {
|
|
148
|
+
"tokens": "↑{input} ↓{output} tokens",
|
|
149
|
+
"stop": "Stop"
|
|
150
|
+
},
|
|
151
|
+
"input": {
|
|
152
|
+
"stopGenerating": "Stop generating (Escape)",
|
|
153
|
+
"loadingCommands": "Loading commands…",
|
|
154
|
+
"emoji": "Emoji"
|
|
155
|
+
},
|
|
156
|
+
"thread": {
|
|
157
|
+
"jumpToPrompt": "Go to message: {text}"
|
|
158
|
+
},
|
|
159
|
+
"find": {
|
|
160
|
+
"label": "Find in conversation",
|
|
161
|
+
"count": "{current, number} of {total, number}",
|
|
162
|
+
"countCapped": "{current, number} of {total, number}+",
|
|
163
|
+
"none": "No results",
|
|
164
|
+
"previous": "Previous match",
|
|
165
|
+
"next": "Next match",
|
|
166
|
+
"close": "Close find"
|
|
167
|
+
},
|
|
168
|
+
"chrome": {
|
|
169
|
+
"jumpToLatest": "Jump to latest"
|
|
170
|
+
},
|
|
171
|
+
"messageMeta": {
|
|
172
|
+
"copyLabel": "message"
|
|
173
|
+
},
|
|
174
|
+
"attachmentManager": {
|
|
175
|
+
"unnamedImage": "Image attachment",
|
|
176
|
+
"unnamedFile": "File",
|
|
177
|
+
"open": "Open {name}",
|
|
178
|
+
"download": "Download {name}",
|
|
179
|
+
"previousImage": "Previous image",
|
|
180
|
+
"nextImage": "Next image",
|
|
181
|
+
"imagePosition": "{position, number} of {total, number}",
|
|
182
|
+
"fullImageFailed": "Couldn't load the full image. Showing a preview."
|
|
183
|
+
},
|
|
184
|
+
"markdownImage": {
|
|
185
|
+
"untitled": "Image",
|
|
186
|
+
"open": "Open {name} on GitHub"
|
|
187
|
+
},
|
|
188
|
+
"sidebar": {
|
|
189
|
+
"openSidebar": "Open sidebar",
|
|
190
|
+
"closeSidebar": "Close sidebar",
|
|
191
|
+
"manageProviders": "Manage providers"
|
|
135
192
|
},
|
|
136
193
|
"modelPicker": {
|
|
137
194
|
"choose": "Model",
|
package/locales/en/agents.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"title": "pw code",
|
|
3
|
+
"ago": {
|
|
4
|
+
"now": "now",
|
|
5
|
+
"minutes": "{n}m",
|
|
6
|
+
"hours": "{n}h",
|
|
7
|
+
"days": "{n}d"
|
|
8
|
+
},
|
|
3
9
|
"sidebar": {
|
|
4
10
|
"label": "Sessions",
|
|
5
11
|
"listNoun": "sessions",
|
|
@@ -7,6 +13,7 @@
|
|
|
7
13
|
"search": "Search sessions",
|
|
8
14
|
"find": "Find in this session",
|
|
9
15
|
"noSessions": "No sessions open yet",
|
|
16
|
+
"loading": "Loading sessions…",
|
|
10
17
|
"open": "Open sidebar",
|
|
11
18
|
"close": "Close sidebar",
|
|
12
19
|
"untitled": "Untitled",
|
|
@@ -29,7 +36,6 @@
|
|
|
29
36
|
"renameLabel": "Session name",
|
|
30
37
|
"renamePlaceholder": "Enter a new name",
|
|
31
38
|
"renameAction": "Rename",
|
|
32
|
-
"moreOptions": "More options",
|
|
33
39
|
"groupNeedsYou": "Needs you",
|
|
34
40
|
"groupActive": "Active",
|
|
35
41
|
"groupInactive": "Inactive",
|
|
@@ -45,8 +51,6 @@
|
|
|
45
51
|
"deleteGroupTitle": "Delete group",
|
|
46
52
|
"deleteGroupBody": "“{name}” will be removed. Its sessions stay in the list.",
|
|
47
53
|
"groupsNeedUpdate": "Update pw on {machine} to keep its sessions in groups",
|
|
48
|
-
"groupWaiting": "{count, plural, one {# session needs you} other {# sessions need you}}",
|
|
49
|
-
"groupRunning": "{count, plural, one {# session running} other {# sessions running}}",
|
|
50
54
|
"pin": "Pin",
|
|
51
55
|
"unpin": "Unpin",
|
|
52
56
|
"pinned": "Pinned",
|
|
@@ -72,9 +76,34 @@
|
|
|
72
76
|
"workspacePlaceholder": "/home/you/your-repo",
|
|
73
77
|
"startButton": "Start session",
|
|
74
78
|
"chooseMachine": "Choose a machine",
|
|
79
|
+
"findingMachines": "Finding your machines…",
|
|
75
80
|
"notAnswering": "Not answering ({count})",
|
|
76
81
|
"chooseDirectory": "Choose a directory",
|
|
77
|
-
"
|
|
82
|
+
"browse": "Browse",
|
|
83
|
+
"directorySuggestions": "Directories",
|
|
84
|
+
"useDirectory": "Use this directory",
|
|
85
|
+
"useTypedPath": "Use this path as typed",
|
|
86
|
+
"recentDirectories": "Recent",
|
|
87
|
+
"inThisDirectory": "In this directory",
|
|
88
|
+
"inHomeDirectory": "In the home directory",
|
|
89
|
+
"parentDirectory": "Parent directory",
|
|
90
|
+
"repository": "Git repository",
|
|
91
|
+
"openDirectory": "Open {name}",
|
|
92
|
+
"directoriesLoading": "Listing directories…",
|
|
93
|
+
"directoryUnlisted": "No directory at {path}, or this account cannot read it.",
|
|
94
|
+
"directoriesUnsupported": "pw code on this machine is too old to list its directories. Type a path, or update pw there.",
|
|
95
|
+
"noDirectories": "No directories in here.",
|
|
96
|
+
"noDirectoryMatches": "No directory here matches “{name}”.",
|
|
97
|
+
"directoriesCut": "More directories than fit here. Type a name to narrow them.",
|
|
98
|
+
"pathKeys": {
|
|
99
|
+
"move": "move",
|
|
100
|
+
"use": "use",
|
|
101
|
+
"open": "open",
|
|
102
|
+
"cancel": "cancel"
|
|
103
|
+
},
|
|
104
|
+
"browseTitle": "Choose a directory on {machine}",
|
|
105
|
+
"showHidden": "Show hidden directories",
|
|
106
|
+
"browseCancel": "Cancel",
|
|
78
107
|
"composerPlaceholder": "Describe a task or ask a question",
|
|
79
108
|
"choosePermission": "Choose what the agent may do",
|
|
80
109
|
"howTitle": "Sessions you open show up here",
|
|
@@ -102,7 +131,9 @@
|
|
|
102
131
|
"running": "running",
|
|
103
132
|
"awaiting_approval": "approval needed",
|
|
104
133
|
"awaiting_answer": "answer needed",
|
|
105
|
-
"live_elsewhere": "live on {host}"
|
|
134
|
+
"live_elsewhere": "live on {host}",
|
|
135
|
+
"usage_limit": "usage limit reached",
|
|
136
|
+
"usage_limit_until": "limit resets {time}"
|
|
106
137
|
},
|
|
107
138
|
"machine": {
|
|
108
139
|
"connected": "connected",
|
|
@@ -126,6 +157,7 @@
|
|
|
126
157
|
"archiveWhileRunning": "Wait for the turn to finish, then run /archive.",
|
|
127
158
|
"archived": "Archived “{name}”. Restore it from the Archived group to use it again.",
|
|
128
159
|
"steerUncertain": "No answer came back, so this may have reached the agent. Check the transcript before you send it again.",
|
|
160
|
+
"steerAlreadyRead": "The agent already read this message, so it can't be taken back.",
|
|
129
161
|
"shellStopped": "A hook stopped the agent from reacting: {reason}",
|
|
130
162
|
"backgroundHint": "({key} to run in background)",
|
|
131
163
|
"backgroundTitle": "The command keeps running, and the agent carries on without waiting for it",
|
|
@@ -158,7 +190,6 @@
|
|
|
158
190
|
"waitingForUsageLimit": "Waiting for the usage limit to reset",
|
|
159
191
|
"waitingForUsageLimitUntil": "Waiting for the usage limit to reset at {time}",
|
|
160
192
|
"switchClaudeAccount": "Switch account",
|
|
161
|
-
"loading": "Loading transcript…",
|
|
162
193
|
"cleared": "The session was cleared; showing the new session.",
|
|
163
194
|
"dismiss": "Dismiss",
|
|
164
195
|
"transcriptLabel": "Session transcript",
|
|
@@ -187,9 +218,30 @@
|
|
|
187
218
|
"goalAchieved": "✓ Goal achieved ({elapsed} · {turns, plural, one {# turn} other {# turns}} · {tokens} tokens)",
|
|
188
219
|
"goalContinuing": "○ Goal not yet met… continuing",
|
|
189
220
|
"goalCheckFailed": "Goal check failed: {error}. The goal is still set and is checked again after the next turn.",
|
|
221
|
+
"goalCheckin": "○ Goal check-in: background work still running ({waited})",
|
|
190
222
|
"goalUsageLimit": "Usage limit reached. The goal is checked again at {time}.",
|
|
191
223
|
"goalActive": "goal active",
|
|
192
224
|
"goalPaused": "goal paused",
|
|
225
|
+
"goalPanel": {
|
|
226
|
+
"title": "Goal",
|
|
227
|
+
"loading": "Reading the goal…",
|
|
228
|
+
"none": "This session has no goal now.",
|
|
229
|
+
"active": "Active",
|
|
230
|
+
"paused": "Paused",
|
|
231
|
+
"checking": "Checking",
|
|
232
|
+
"turns": "{count, plural, one {# turn checked} other {# turns checked}}",
|
|
233
|
+
"tokens": "{tokens} tokens",
|
|
234
|
+
"lastCheck": "Last check",
|
|
235
|
+
"pausedNote": "No turn starts toward it while it is paused. Resuming starts one right away.",
|
|
236
|
+
"edit": "Edit",
|
|
237
|
+
"pause": "Pause",
|
|
238
|
+
"resume": "Resume",
|
|
239
|
+
"clear": "Clear goal",
|
|
240
|
+
"conditionLabel": "Goal condition",
|
|
241
|
+
"editHint": "The run keeps its progress. Bound it in the condition itself, such as “or stop after 20 turns”.",
|
|
242
|
+
"cancel": "Cancel",
|
|
243
|
+
"save": "Save"
|
|
244
|
+
},
|
|
193
245
|
"addedDirectory": "Added working directory: {path}",
|
|
194
246
|
"addedDirectoryAndMore": "{path} and {count, plural, one {# more working directory} other {# more working directories}}",
|
|
195
247
|
"workingDirectory": "Working directory: {path}",
|
|
@@ -225,6 +277,11 @@
|
|
|
225
277
|
"subagentMessage": "Message from {name}",
|
|
226
278
|
"commandCompleted": "Background command \"{name}\" completed (exit code 0)",
|
|
227
279
|
"commandFailed": "Background command \"{name}\" failed with exit code {code}",
|
|
280
|
+
"monitorEvent": "Monitor event: {line} · {name}",
|
|
281
|
+
"monitorEnded": "Monitor \"{name}\" stream ended",
|
|
282
|
+
"monitorFailed": "Monitor \"{name}\" script failed (exit {code})",
|
|
283
|
+
"monitorExpired": "Monitor \"{name}\" expired after {elapsed} with {count, plural, =0 {no events} one {# event} other {# events}} delivered",
|
|
284
|
+
"monitorFlooded": "Monitor \"{name}\" stopped after {elapsed} of too much output",
|
|
228
285
|
"agentEnded": "Agent \"{name}\" {outcome, select, failed {failed} other {finished}}",
|
|
229
286
|
"agentEndedAfter": "Agent \"{name}\" {outcome, select, failed {failed} other {finished}} · {elapsed}",
|
|
230
287
|
"expandAll": "Expand all",
|
|
@@ -244,6 +301,7 @@
|
|
|
244
301
|
"hideEarlier": "{count, plural, one {Hide # earlier agent} other {Hide # earlier agents}}",
|
|
245
302
|
"agentName": "{type}: {description}",
|
|
246
303
|
"stop": "Stop {name}",
|
|
304
|
+
"dismiss": "Remove {name} from the list",
|
|
247
305
|
"stopThis": "Stop",
|
|
248
306
|
"back": "Back to main",
|
|
249
307
|
"tokens": "{tokens} tokens",
|
|
@@ -258,6 +316,12 @@
|
|
|
258
316
|
"commandsOnMain": "Commands and ! run in the main conversation. Go back to main to use them.",
|
|
259
317
|
"transcriptLabel": "Agent transcript"
|
|
260
318
|
},
|
|
319
|
+
"tasks": {
|
|
320
|
+
"progress": "{done} of {total} done",
|
|
321
|
+
"more": "+{count} more",
|
|
322
|
+
"moreCompleted": "+{count} completed",
|
|
323
|
+
"fewer": "Show fewer"
|
|
324
|
+
},
|
|
261
325
|
"effort": {
|
|
262
326
|
"label": "Effort",
|
|
263
327
|
"named": "Effort: {level}",
|
|
@@ -283,6 +347,14 @@
|
|
|
283
347
|
"plan": "The workspace is left unchanged while a plan is drafted."
|
|
284
348
|
}
|
|
285
349
|
},
|
|
350
|
+
"allocation": {
|
|
351
|
+
"notRatedInUsd": "Not rated in USD",
|
|
352
|
+
"noBudget": "No budget set",
|
|
353
|
+
"noActivePeriod": "No active period",
|
|
354
|
+
"budgetSpent": "Budget used up",
|
|
355
|
+
"noAccess": "Not shared with you to bill",
|
|
356
|
+
"budgetExceeded": "Budget exceeded"
|
|
357
|
+
},
|
|
286
358
|
"dash": {
|
|
287
359
|
"needsYou": "Needs you",
|
|
288
360
|
"waitingFor": "waiting {when}",
|
|
@@ -304,10 +376,7 @@
|
|
|
304
376
|
"loadingUsage": "Loading usage…",
|
|
305
377
|
"signedOut": "Not signed in",
|
|
306
378
|
"usageUnavailable": "Usage unavailable",
|
|
307
|
-
"current": "Selected account",
|
|
308
379
|
"loginOnHost": "To sign in, run /claude-code in pw code on this host.",
|
|
309
|
-
"fiveHour": "5h {percent} used",
|
|
310
|
-
"week": "Week {percent} used",
|
|
311
380
|
"resets": "resets {time}",
|
|
312
381
|
"platformModels": "Platform models",
|
|
313
382
|
"shortAccount": "Account",
|
|
@@ -349,7 +418,10 @@
|
|
|
349
418
|
"expired": "Sign-in expired. Try again."
|
|
350
419
|
},
|
|
351
420
|
"useAccount": "Use",
|
|
352
|
-
"accountActions": "Actions for {account}"
|
|
421
|
+
"accountActions": "Actions for {account}",
|
|
422
|
+
"continueOnAnother": "Continue on another account",
|
|
423
|
+
"moveOthers": "{count, plural, one {Also move # other session on {account}} other {Also move # other sessions on {account}}}",
|
|
424
|
+
"movedOthers": "{count, plural, =0 {No other session moved to {account}} one {Moved # other session to {account}} other {Moved # other sessions to {account}}}"
|
|
353
425
|
},
|
|
354
426
|
"terminal": {
|
|
355
427
|
"title": "Continue in a terminal",
|