@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
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { ToolStrings } from '@parallelworks/ui/ai/headless';
|
|
2
|
+
import { type PwCodeTranslator } from './messages.js';
|
|
3
|
+
declare function chatStrings(t: PwCodeTranslator<'agentTranscript'>, tAgents: PwCodeTranslator<'agents'>, tools: ToolStrings): {
|
|
4
|
+
agentTranscript: {
|
|
5
|
+
running: string;
|
|
6
|
+
done: string;
|
|
7
|
+
failed: string;
|
|
8
|
+
failedWith: (reason: string) => string;
|
|
9
|
+
callGroup: (tool: string, count: number) => string;
|
|
10
|
+
editGroup: (count: number) => string;
|
|
11
|
+
writeGroup: (files: number) => string;
|
|
12
|
+
failedGroup: (tool: string, count: number) => string;
|
|
13
|
+
failedCount: (count: number) => string;
|
|
14
|
+
interrupted: string;
|
|
15
|
+
interruptedReason: string;
|
|
16
|
+
reviewing: (count: number) => string;
|
|
17
|
+
backgroundLaunched: (count: number) => string;
|
|
18
|
+
argsRewritten: string;
|
|
19
|
+
noOutput: string;
|
|
20
|
+
diffTruncated: string;
|
|
21
|
+
moreLines: (count: number) => string;
|
|
22
|
+
allowOnce: string;
|
|
23
|
+
allowDirectory: string;
|
|
24
|
+
deny: string;
|
|
25
|
+
allowCode: string;
|
|
26
|
+
denyCode: string;
|
|
27
|
+
allowPath: string;
|
|
28
|
+
denyPath: string;
|
|
29
|
+
allowCall: string;
|
|
30
|
+
denyCall: string;
|
|
31
|
+
denyWithFeedback: string;
|
|
32
|
+
feedbackPlaceholder: string;
|
|
33
|
+
answered: string;
|
|
34
|
+
allowedBy: (name: string) => string;
|
|
35
|
+
allowedWithChangesBy: (name: string) => string;
|
|
36
|
+
deniedBy: (name: string) => string;
|
|
37
|
+
allowed: string;
|
|
38
|
+
allowedWithChanges: string;
|
|
39
|
+
denied: string;
|
|
40
|
+
allowedByReviewer: string;
|
|
41
|
+
deniedByReviewer: string;
|
|
42
|
+
approvalExpired: string;
|
|
43
|
+
approvalTimedOut: string;
|
|
44
|
+
reviewTimedOut: string;
|
|
45
|
+
reviewFailed: string;
|
|
46
|
+
writeOwnAnswer: string;
|
|
47
|
+
subagent: string;
|
|
48
|
+
tasks: string;
|
|
49
|
+
planPending: string;
|
|
50
|
+
approvalPending: string;
|
|
51
|
+
approvalOptions: string;
|
|
52
|
+
approvalLabel: string;
|
|
53
|
+
approvalAllowed: string;
|
|
54
|
+
approvalDenied: string;
|
|
55
|
+
approvalRequestExpired: string;
|
|
56
|
+
approvalWaitingOn: (name: string) => string;
|
|
57
|
+
feedbackLabel: string;
|
|
58
|
+
ownAnswerLabel: string;
|
|
59
|
+
typeYourAnswer: string;
|
|
60
|
+
questionsLabel: string;
|
|
61
|
+
questionTab: (n: number) => string;
|
|
62
|
+
answeredCount: (answered: number, total: number) => string;
|
|
63
|
+
submitAnswers: string;
|
|
64
|
+
chatAboutThis: string;
|
|
65
|
+
noAnswer: string;
|
|
66
|
+
noPreview: string;
|
|
67
|
+
previewOf: (label: string) => string;
|
|
68
|
+
notesLabel: string;
|
|
69
|
+
notesPlaceholder: string;
|
|
70
|
+
notesOnly: string;
|
|
71
|
+
todoPending: string;
|
|
72
|
+
todoInProgress: string;
|
|
73
|
+
todoCompleted: string;
|
|
74
|
+
};
|
|
75
|
+
tools: ToolStrings;
|
|
76
|
+
queue: {
|
|
77
|
+
remove: string;
|
|
78
|
+
waiting: string;
|
|
79
|
+
waitingNextStep: string;
|
|
80
|
+
handedOver: string;
|
|
81
|
+
edit: string;
|
|
82
|
+
editLabel: string;
|
|
83
|
+
editHint: string;
|
|
84
|
+
};
|
|
85
|
+
paste: {
|
|
86
|
+
title: string;
|
|
87
|
+
lines: (count: number) => string;
|
|
88
|
+
saving: string;
|
|
89
|
+
remove: string;
|
|
90
|
+
};
|
|
91
|
+
thinking: {
|
|
92
|
+
label: string;
|
|
93
|
+
ellipsis: string;
|
|
94
|
+
thoughtFor: (duration: string) => string;
|
|
95
|
+
thoughtProcess: string;
|
|
96
|
+
activity: string;
|
|
97
|
+
ranToolCalls: (count: number) => string;
|
|
98
|
+
ranToolCallsAs: (count: number, name: string) => string;
|
|
99
|
+
};
|
|
100
|
+
activity: {
|
|
101
|
+
tokens: (input: string, output: string) => string;
|
|
102
|
+
stop: string;
|
|
103
|
+
};
|
|
104
|
+
input: {
|
|
105
|
+
stopGenerating: string;
|
|
106
|
+
loadingCommands: string;
|
|
107
|
+
emoji: string;
|
|
108
|
+
};
|
|
109
|
+
thread: {
|
|
110
|
+
jumpToPrompt: (text: string) => string;
|
|
111
|
+
};
|
|
112
|
+
find: {
|
|
113
|
+
label: string;
|
|
114
|
+
count: (current: number, total: number) => string;
|
|
115
|
+
countCapped: (current: number, total: number) => string;
|
|
116
|
+
none: string;
|
|
117
|
+
previous: string;
|
|
118
|
+
next: string;
|
|
119
|
+
close: string;
|
|
120
|
+
};
|
|
121
|
+
chrome: {
|
|
122
|
+
jumpToLatest: string;
|
|
123
|
+
};
|
|
124
|
+
messageMeta: {
|
|
125
|
+
copyLabel: string;
|
|
126
|
+
};
|
|
127
|
+
attachmentManager: {
|
|
128
|
+
unnamedImage: string;
|
|
129
|
+
unnamedFile: string;
|
|
130
|
+
open: (name: string) => string;
|
|
131
|
+
download: (name: string) => string;
|
|
132
|
+
previousImage: string;
|
|
133
|
+
nextImage: string;
|
|
134
|
+
imagePosition: (position: number, total: number) => string;
|
|
135
|
+
fullImageFailed: string;
|
|
136
|
+
};
|
|
137
|
+
sidebar: {
|
|
138
|
+
openSidebar: string;
|
|
139
|
+
closeSidebar: string;
|
|
140
|
+
manageProviders: string;
|
|
141
|
+
};
|
|
142
|
+
modelPicker: {
|
|
143
|
+
choose: string;
|
|
144
|
+
select: string;
|
|
145
|
+
search: string;
|
|
146
|
+
loading: string;
|
|
147
|
+
failed: string;
|
|
148
|
+
none: string;
|
|
149
|
+
sharedBy: (owner: string) => string;
|
|
150
|
+
};
|
|
151
|
+
allocationPicker: {
|
|
152
|
+
choose: string;
|
|
153
|
+
placeholder: string;
|
|
154
|
+
search: string;
|
|
155
|
+
};
|
|
156
|
+
providerIssue: {
|
|
157
|
+
keyRejected: string;
|
|
158
|
+
unreachable: string;
|
|
159
|
+
};
|
|
160
|
+
permissions: {
|
|
161
|
+
choose: string;
|
|
162
|
+
readOnly: string;
|
|
163
|
+
acceptEdits: string;
|
|
164
|
+
auto: string;
|
|
165
|
+
bypassPermissions: string;
|
|
166
|
+
plan: string;
|
|
167
|
+
readOnlyHint: string;
|
|
168
|
+
acceptEditsHint: string;
|
|
169
|
+
autoHint: string;
|
|
170
|
+
bypassPermissionsHint: string;
|
|
171
|
+
planHint: string;
|
|
172
|
+
};
|
|
173
|
+
effort: {
|
|
174
|
+
choose: string;
|
|
175
|
+
named: (level: string) => string;
|
|
176
|
+
low: string;
|
|
177
|
+
medium: string;
|
|
178
|
+
high: string;
|
|
179
|
+
xhigh: string;
|
|
180
|
+
max: string;
|
|
181
|
+
faster: string;
|
|
182
|
+
smarter: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
/** pw code's words for `@parallelworks/ui`'s chat, by its `ChatStrings` sections. */
|
|
186
|
+
export type PwCodeChatStrings = ReturnType<typeof chatStrings>;
|
|
187
|
+
/** Every word of `@parallelworks/ui`'s chat a pw code page shows, in the reader's language. */
|
|
188
|
+
export declare function usePwCodeChatStrings(): PwCodeChatStrings;
|
|
189
|
+
export {};
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { usePwCodeTranslations } from "./messages.js";
|
|
2
|
+
import { useToolStrings } from "./toolStrings.js";
|
|
3
|
+
import { useMemo } from "react";
|
|
4
|
+
// src/chatStrings.ts
|
|
5
|
+
function chatStrings(t, tAgents, tools) {
|
|
6
|
+
return {
|
|
7
|
+
agentTranscript: {
|
|
8
|
+
running: t("transcript.running"),
|
|
9
|
+
done: t("transcript.done"),
|
|
10
|
+
failed: t("transcript.failed"),
|
|
11
|
+
failedWith: (reason) => t("transcript.failedWith", { reason }),
|
|
12
|
+
callGroup: (tool, count) => t("transcript.callGroup", {
|
|
13
|
+
tool,
|
|
14
|
+
count
|
|
15
|
+
}),
|
|
16
|
+
editGroup: (count) => t("transcript.editGroup", { count }),
|
|
17
|
+
writeGroup: (files) => t("transcript.writeGroup", { count: files }),
|
|
18
|
+
failedGroup: (tool, count) => t("transcript.failedGroup", {
|
|
19
|
+
tool,
|
|
20
|
+
count
|
|
21
|
+
}),
|
|
22
|
+
failedCount: (count) => t("transcript.failedCount", { count }),
|
|
23
|
+
interrupted: t("transcript.interrupted"),
|
|
24
|
+
interruptedReason: t("transcript.interruptedReason"),
|
|
25
|
+
reviewing: (count) => t("transcript.reviewing", { count }),
|
|
26
|
+
backgroundLaunched: (count) => t("transcript.backgroundLaunched", { count }),
|
|
27
|
+
argsRewritten: t("transcript.argsRewritten"),
|
|
28
|
+
noOutput: t("transcript.noOutput"),
|
|
29
|
+
diffTruncated: t("transcript.diffTruncated"),
|
|
30
|
+
moreLines: (count) => t("transcript.moreLines", { count }),
|
|
31
|
+
allowOnce: t("transcript.allowOnce"),
|
|
32
|
+
allowDirectory: t("transcript.allowDirectory"),
|
|
33
|
+
deny: t("transcript.deny"),
|
|
34
|
+
allowCode: t("transcript.allowCode"),
|
|
35
|
+
denyCode: t("transcript.denyCode"),
|
|
36
|
+
allowPath: t("transcript.allowPath"),
|
|
37
|
+
denyPath: t("transcript.denyPath"),
|
|
38
|
+
allowCall: t("transcript.allowCall"),
|
|
39
|
+
denyCall: t("transcript.denyCall"),
|
|
40
|
+
denyWithFeedback: t("transcript.denyWithFeedback"),
|
|
41
|
+
feedbackPlaceholder: t("transcript.feedbackPlaceholder"),
|
|
42
|
+
answered: t("transcript.answered"),
|
|
43
|
+
allowedBy: (name) => t("transcript.allowedBy", { name }),
|
|
44
|
+
allowedWithChangesBy: (name) => t("transcript.allowedWithChangesBy", { name }),
|
|
45
|
+
deniedBy: (name) => t("transcript.deniedBy", { name }),
|
|
46
|
+
allowed: t("transcript.allowed"),
|
|
47
|
+
allowedWithChanges: t("transcript.allowedWithChanges"),
|
|
48
|
+
denied: t("transcript.denied"),
|
|
49
|
+
allowedByReviewer: t("transcript.allowedByReviewer"),
|
|
50
|
+
deniedByReviewer: t("transcript.deniedByReviewer"),
|
|
51
|
+
approvalExpired: t("transcript.approvalExpired"),
|
|
52
|
+
approvalTimedOut: t("transcript.approvalTimedOut"),
|
|
53
|
+
reviewTimedOut: t("transcript.reviewTimedOut"),
|
|
54
|
+
reviewFailed: t("transcript.reviewFailed"),
|
|
55
|
+
writeOwnAnswer: t("transcript.writeOwnAnswer"),
|
|
56
|
+
subagent: t("transcript.subagent"),
|
|
57
|
+
tasks: t("transcript.tasks"),
|
|
58
|
+
planPending: t("transcript.planPending"),
|
|
59
|
+
approvalPending: t("transcript.approvalPending"),
|
|
60
|
+
approvalOptions: t("transcript.approvalOptions"),
|
|
61
|
+
approvalLabel: t("transcript.approvalLabel"),
|
|
62
|
+
approvalAllowed: t("transcript.approvalAllowed"),
|
|
63
|
+
approvalDenied: t("transcript.approvalDenied"),
|
|
64
|
+
approvalRequestExpired: t("transcript.approvalRequestExpired"),
|
|
65
|
+
approvalWaitingOn: (name) => t("transcript.approvalWaitingOn", { name }),
|
|
66
|
+
feedbackLabel: t("transcript.feedbackLabel"),
|
|
67
|
+
ownAnswerLabel: t("transcript.ownAnswerLabel"),
|
|
68
|
+
typeYourAnswer: t("transcript.typeYourAnswer"),
|
|
69
|
+
questionsLabel: t("transcript.questionsLabel"),
|
|
70
|
+
questionTab: (n) => t("transcript.questionTab", { n }),
|
|
71
|
+
answeredCount: (answered, total) => t("transcript.answeredCount", {
|
|
72
|
+
answered,
|
|
73
|
+
total
|
|
74
|
+
}),
|
|
75
|
+
submitAnswers: t("transcript.submitAnswers"),
|
|
76
|
+
chatAboutThis: t("transcript.chatAboutThis"),
|
|
77
|
+
noAnswer: t("transcript.noAnswer"),
|
|
78
|
+
noPreview: t("transcript.noPreview"),
|
|
79
|
+
previewOf: (label) => t("transcript.previewOf", { label }),
|
|
80
|
+
notesLabel: t("transcript.notesLabel"),
|
|
81
|
+
notesPlaceholder: t("transcript.notesPlaceholder"),
|
|
82
|
+
notesOnly: t("transcript.notesOnly"),
|
|
83
|
+
todoPending: t("transcript.todoPending"),
|
|
84
|
+
todoInProgress: t("transcript.todoInProgress"),
|
|
85
|
+
todoCompleted: t("transcript.todoCompleted")
|
|
86
|
+
},
|
|
87
|
+
tools,
|
|
88
|
+
queue: {
|
|
89
|
+
remove: t("queue.remove"),
|
|
90
|
+
waiting: t("queue.waiting"),
|
|
91
|
+
waitingNextStep: t("queue.waitingNextStep"),
|
|
92
|
+
handedOver: t("queue.handedOver"),
|
|
93
|
+
edit: t("queue.edit"),
|
|
94
|
+
editLabel: t("queue.editLabel"),
|
|
95
|
+
editHint: t("queue.editHint")
|
|
96
|
+
},
|
|
97
|
+
paste: {
|
|
98
|
+
title: t("paste.title"),
|
|
99
|
+
lines: (count) => t("paste.lines", { count }),
|
|
100
|
+
saving: t("paste.saving"),
|
|
101
|
+
remove: t("paste.remove")
|
|
102
|
+
},
|
|
103
|
+
thinking: {
|
|
104
|
+
label: t("thinking.label"),
|
|
105
|
+
ellipsis: t("thinking.ellipsis"),
|
|
106
|
+
thoughtFor: (duration) => t("thinking.thoughtFor", { duration }),
|
|
107
|
+
thoughtProcess: t("thinking.thoughtProcess"),
|
|
108
|
+
activity: t("thinking.activity"),
|
|
109
|
+
ranToolCalls: (count) => t("thinking.ranToolCalls", { count }),
|
|
110
|
+
ranToolCallsAs: (count, name) => t("thinking.ranToolCallsAs", {
|
|
111
|
+
count,
|
|
112
|
+
name
|
|
113
|
+
})
|
|
114
|
+
},
|
|
115
|
+
activity: {
|
|
116
|
+
tokens: (input, output) => t("activity.tokens", {
|
|
117
|
+
input,
|
|
118
|
+
output
|
|
119
|
+
}),
|
|
120
|
+
stop: t("activity.stop")
|
|
121
|
+
},
|
|
122
|
+
input: {
|
|
123
|
+
stopGenerating: t("input.stopGenerating"),
|
|
124
|
+
loadingCommands: t("input.loadingCommands"),
|
|
125
|
+
emoji: t("input.emoji")
|
|
126
|
+
},
|
|
127
|
+
thread: { jumpToPrompt: (text) => t("thread.jumpToPrompt", { text }) },
|
|
128
|
+
find: {
|
|
129
|
+
label: t("find.label"),
|
|
130
|
+
count: (current, total) => t("find.count", {
|
|
131
|
+
current,
|
|
132
|
+
total
|
|
133
|
+
}),
|
|
134
|
+
countCapped: (current, total) => t("find.countCapped", {
|
|
135
|
+
current,
|
|
136
|
+
total
|
|
137
|
+
}),
|
|
138
|
+
none: t("find.none"),
|
|
139
|
+
previous: t("find.previous"),
|
|
140
|
+
next: t("find.next"),
|
|
141
|
+
close: t("find.close")
|
|
142
|
+
},
|
|
143
|
+
chrome: { jumpToLatest: t("chrome.jumpToLatest") },
|
|
144
|
+
messageMeta: { copyLabel: t("messageMeta.copyLabel") },
|
|
145
|
+
attachmentManager: {
|
|
146
|
+
unnamedImage: t("attachmentManager.unnamedImage"),
|
|
147
|
+
unnamedFile: t("attachmentManager.unnamedFile"),
|
|
148
|
+
open: (name) => t("attachmentManager.open", { name }),
|
|
149
|
+
download: (name) => t("attachmentManager.download", { name }),
|
|
150
|
+
previousImage: t("attachmentManager.previousImage"),
|
|
151
|
+
nextImage: t("attachmentManager.nextImage"),
|
|
152
|
+
imagePosition: (position, total) => t("attachmentManager.imagePosition", {
|
|
153
|
+
position,
|
|
154
|
+
total
|
|
155
|
+
}),
|
|
156
|
+
fullImageFailed: t("attachmentManager.fullImageFailed")
|
|
157
|
+
},
|
|
158
|
+
sidebar: {
|
|
159
|
+
openSidebar: t("sidebar.openSidebar"),
|
|
160
|
+
closeSidebar: t("sidebar.closeSidebar"),
|
|
161
|
+
manageProviders: t("sidebar.manageProviders")
|
|
162
|
+
},
|
|
163
|
+
modelPicker: {
|
|
164
|
+
choose: t("modelPicker.choose"),
|
|
165
|
+
select: t("modelPicker.select"),
|
|
166
|
+
search: t("modelPicker.search"),
|
|
167
|
+
loading: t("modelPicker.loading"),
|
|
168
|
+
failed: t("modelPicker.failed"),
|
|
169
|
+
none: t("modelPicker.none"),
|
|
170
|
+
sharedBy: (owner) => t("modelPicker.sharedBy", { owner })
|
|
171
|
+
},
|
|
172
|
+
allocationPicker: {
|
|
173
|
+
choose: t("allocationPicker.choose"),
|
|
174
|
+
placeholder: t("allocationPicker.placeholder"),
|
|
175
|
+
search: t("allocationPicker.search")
|
|
176
|
+
},
|
|
177
|
+
providerIssue: {
|
|
178
|
+
keyRejected: t("providerIssue.keyRejected"),
|
|
179
|
+
unreachable: t("providerIssue.unreachable")
|
|
180
|
+
},
|
|
181
|
+
permissions: {
|
|
182
|
+
choose: tAgents("start.choosePermission"),
|
|
183
|
+
readOnly: tAgents("permission.read-only"),
|
|
184
|
+
acceptEdits: tAgents("permission.accept-edits"),
|
|
185
|
+
auto: tAgents("permission.auto"),
|
|
186
|
+
bypassPermissions: tAgents("permission.bypass-permissions"),
|
|
187
|
+
plan: tAgents("permission.plan"),
|
|
188
|
+
readOnlyHint: tAgents("permission.hint.read-only"),
|
|
189
|
+
acceptEditsHint: tAgents("permission.hint.accept-edits"),
|
|
190
|
+
autoHint: tAgents("permission.hint.auto"),
|
|
191
|
+
bypassPermissionsHint: tAgents("permission.hint.bypass-permissions"),
|
|
192
|
+
planHint: tAgents("permission.hint.plan")
|
|
193
|
+
},
|
|
194
|
+
effort: {
|
|
195
|
+
choose: tAgents("effort.label"),
|
|
196
|
+
named: (level) => tAgents("effort.named", { level }),
|
|
197
|
+
low: tAgents("effort.low"),
|
|
198
|
+
medium: tAgents("effort.medium"),
|
|
199
|
+
high: tAgents("effort.high"),
|
|
200
|
+
xhigh: tAgents("effort.xhigh"),
|
|
201
|
+
max: tAgents("effort.max"),
|
|
202
|
+
faster: tAgents("effort.faster"),
|
|
203
|
+
smarter: tAgents("effort.smarter")
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
/** Every word of `@parallelworks/ui`'s chat a pw code page shows, in the reader's language. */
|
|
208
|
+
function usePwCodeChatStrings() {
|
|
209
|
+
const t = usePwCodeTranslations("agentTranscript");
|
|
210
|
+
const tAgents = usePwCodeTranslations("agents");
|
|
211
|
+
const tools = useToolStrings();
|
|
212
|
+
return useMemo(() => chatStrings(t, tAgents, tools), [
|
|
213
|
+
t,
|
|
214
|
+
tAgents,
|
|
215
|
+
tools
|
|
216
|
+
]);
|
|
217
|
+
}
|
|
218
|
+
export { usePwCodeChatStrings };
|
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';
|
|
@@ -22,10 +22,29 @@ export interface ClaudeAccountAction {
|
|
|
22
22
|
destructive: boolean;
|
|
23
23
|
run: () => void;
|
|
24
24
|
}
|
|
25
|
+
/** The line under an account's name: its email, or, for a signed-out account
|
|
26
|
+
* the machine can't sign in from here, how to sign it in on the machine. */
|
|
27
|
+
export interface ClaudeAccountDetail {
|
|
28
|
+
kind: 'email' | 'signInHint';
|
|
29
|
+
text: string;
|
|
30
|
+
}
|
|
25
31
|
export interface ClaudeAccountPanelState {
|
|
26
32
|
/** Claude Code is allowed and installed on the machine. */
|
|
27
33
|
available: boolean;
|
|
34
|
+
/** Why Claude Code can't run on the machine, shown in place of the view;
|
|
35
|
+
* null when it can. */
|
|
36
|
+
notice: string | null;
|
|
28
37
|
view: ClaudeAccountView;
|
|
38
|
+
title: string;
|
|
39
|
+
/** The machine, or the account on it that the view acts on. */
|
|
40
|
+
description: string;
|
|
41
|
+
/** Where signing in happens, beside the list's description; null on the
|
|
42
|
+
* other views. */
|
|
43
|
+
signInNote: string | null;
|
|
44
|
+
/** The question a removal is confirmed with; null on the other views. */
|
|
45
|
+
removeBody: string | null;
|
|
46
|
+
/** Said under an empty list when the machine can't sign in from here. */
|
|
47
|
+
emptyHint: string | null;
|
|
29
48
|
accounts: ClaudeAccount[];
|
|
30
49
|
loading: boolean;
|
|
31
50
|
loadedUsage: boolean;
|
|
@@ -35,7 +54,20 @@ export interface ClaudeAccountPanelState {
|
|
|
35
54
|
empty: boolean;
|
|
36
55
|
refreshing: boolean;
|
|
37
56
|
canAdd: boolean;
|
|
57
|
+
/** The list is shown and an account can be added from it. */
|
|
58
|
+
showAdd: boolean;
|
|
59
|
+
/** The list is shown on a machine that runs Claude Code. */
|
|
60
|
+
showRefresh: boolean;
|
|
61
|
+
/** The row a list starts on: the selected account's, else the first that
|
|
62
|
+
* is signed in or can sign in from here; -1 when there is none. */
|
|
63
|
+
startIndex: number;
|
|
64
|
+
/** The selected account's row; -1 when it isn't listed. */
|
|
65
|
+
selectedIndex: number;
|
|
66
|
+
/** The first row that is signed in or can sign in from here, whether or
|
|
67
|
+
* not the setting can change now; -1 when there is none. */
|
|
68
|
+
firstEnabledIndex: number;
|
|
38
69
|
isDisabled: (account: ClaudeAccount) => boolean;
|
|
70
|
+
detail: (account: ClaudeAccount) => ClaudeAccountDetail | null;
|
|
39
71
|
/** Picks a row: an account that needs signing in opens its sign-in. */
|
|
40
72
|
choose: (account: ClaudeAccount) => void;
|
|
41
73
|
/** Makes the account the setting's value and closes the panel. */
|
|
@@ -54,17 +86,31 @@ export interface ClaudeAccountPanelState {
|
|
|
54
86
|
/** Signs the account out and deletes it, then returns to the list. A
|
|
55
87
|
* selected account falls back to `default`. */
|
|
56
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;
|
|
57
98
|
}
|
|
58
99
|
/** The refusal of a read that needs the account signed in first. */
|
|
59
100
|
export declare function claudeSignInRequired(error: unknown): boolean;
|
|
60
101
|
/** The account name `input` gives once trimmed, or null when Claude Code
|
|
61
102
|
* can't take it. */
|
|
62
103
|
export declare function claudeAccountName(input: string): string | null;
|
|
104
|
+
/** Moves a host's highlight to the list's start row, then back to it each
|
|
105
|
+
* time the selected or first enabled row changes, such as when the
|
|
106
|
+
* accounts' sign-in states arrive. */
|
|
107
|
+
export declare function useClaudeAccountStartRow(panel: Pick<ClaudeAccountPanelState, 'selectedIndex' | 'firstEnabledIndex'>, setActive: (index: number) => void): void;
|
|
63
108
|
/** The Claude Code accounts on a machine, and the steps a panel listing them
|
|
64
109
|
* takes: adding, signing in, removing after a confirmation the host shows,
|
|
65
110
|
* and choosing one for the `account` setting. */
|
|
66
|
-
export declare function useClaudeAccountPanel(calls: ClaudeAccountCalls, { machine, 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, }: {
|
|
67
112
|
machine: string;
|
|
113
|
+
machineName: string;
|
|
68
114
|
sessionId?: string | undefined;
|
|
69
115
|
claudeInstalled: boolean;
|
|
70
116
|
claudeAllowed: boolean;
|
|
@@ -72,8 +118,15 @@ export declare function useClaudeAccountPanel(calls: ClaudeAccountCalls, { machi
|
|
|
72
118
|
claudeLogin?: boolean | undefined;
|
|
73
119
|
/** The machine can remove accounts from here. */
|
|
74
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;
|
|
75
124
|
account: BoundSetting;
|
|
76
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;
|
|
77
130
|
}): ClaudeAccountPanelState;
|
|
78
131
|
/** The confirmation of a removal: whether it runs, and why it last failed. */
|
|
79
132
|
export declare function useClaudeAccountRemoval(remove: () => Promise<void>): {
|
|
@@ -86,6 +139,8 @@ export declare function useClaudeAccountRemoval(remove: () => Promise<void>): {
|
|
|
86
139
|
export declare function useClaudeAccountName(onContinue: (name: string) => void): {
|
|
87
140
|
name: string;
|
|
88
141
|
invalid: boolean;
|
|
142
|
+
/** The longest name Claude Code takes, for the field to stop at. */
|
|
143
|
+
maxLength: number;
|
|
89
144
|
change: (value: string) => void;
|
|
90
145
|
submit: () => void;
|
|
91
146
|
};
|