@parallelworks/code 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -10
- package/dist/ago.d.ts +8 -0
- package/dist/ago.js +26 -0
- package/dist/api.d.ts +78 -0
- package/dist/base64.d.ts +3 -0
- package/dist/base64.js +15 -0
- package/dist/chatHandoff.d.ts +12 -0
- package/dist/chatHandoff.js +27 -0
- package/dist/claudeAccounts.d.ts +112 -0
- package/dist/claudeAccounts.js +234 -0
- package/dist/claudeSignIn.d.ts +62 -0
- package/dist/claudeSignIn.js +239 -0
- package/dist/contextRow.d.ts +25 -0
- package/dist/contextRow.js +16 -0
- package/dist/createPwCodeApi.d.ts +8 -0
- package/dist/createPwCodeApi.js +2 -0
- package/dist/howSessionsAppear.d.ts +12 -0
- package/dist/howSessionsAppear.js +24 -0
- package/dist/index.d.ts +24 -1
- package/dist/index.js +24 -2
- package/dist/locales/en/agentTranscript.js +2 -10
- package/dist/locales/en/agents.js +5 -5
- package/dist/locales/en.d.ts +5 -13
- package/dist/locales/es/agentTranscript.js +2 -10
- package/dist/locales/es/agents.js +5 -5
- package/dist/locales/ja/agentTranscript.js +2 -10
- package/dist/locales/ja/agents.js +5 -5
- package/dist/locales/ko/agentTranscript.js +2 -10
- package/dist/locales/ko/agents.js +5 -5
- package/dist/locales/zh/agentTranscript.js +2 -10
- package/dist/locales/zh/agents.js +5 -5
- package/dist/machine.d.ts +2 -0
- package/dist/models.d.ts +47 -0
- package/dist/models.js +49 -0
- package/dist/notices.d.ts +2 -1
- package/dist/notices.js +29 -3
- package/dist/pullRequestList.d.ts +52 -0
- package/dist/pullRequestList.js +106 -0
- package/dist/session.d.ts +5 -0
- package/dist/sessionActions.d.ts +105 -0
- package/dist/sessionActions.js +178 -0
- package/dist/sessionGroups.d.ts +49 -0
- package/dist/sessionGroups.js +72 -0
- package/dist/sessionHeader.d.ts +14 -0
- package/dist/sessionHeader.js +16 -0
- package/dist/sessionList.d.ts +134 -0
- package/dist/sessionList.js +271 -0
- package/dist/sessionsApi.js +2 -4
- package/dist/settingsApi.d.ts +36 -0
- package/dist/settingsApi.js +151 -0
- package/dist/startSession.d.ts +138 -0
- package/dist/startSession.js +234 -0
- package/dist/terminalHandoffPanel.d.ts +30 -0
- package/dist/terminalHandoffPanel.js +33 -0
- package/dist/transcript.d.ts +2 -0
- package/dist/transcript.js +15 -12
- package/dist/usageLimit.d.ts +8 -0
- package/dist/usageLimit.js +13 -0
- package/dist/useAwayRecap.d.ts +30 -0
- package/dist/useAwayRecap.js +75 -0
- package/dist/useComposer.d.ts +121 -0
- package/dist/useComposer.js +244 -0
- package/dist/useComposerImages.d.ts +66 -0
- package/dist/useComposerImages.js +195 -0
- package/dist/useConversation.d.ts +190 -0
- package/dist/useConversation.js +287 -0
- package/dist/useSubagent.d.ts +58 -0
- package/dist/useSubagent.js +149 -0
- package/dist/workingDirectories.d.ts +32 -0
- package/dist/workingDirectories.js +71 -0
- package/dist/worktreeChoice.d.ts +31 -0
- package/dist/worktreeChoice.js +38 -0
- package/locales/en/agentTranscript.json +2 -10
- package/locales/en/agents.json +5 -5
- package/locales/es/agentTranscript.json +2 -10
- package/locales/es/agents.json +5 -5
- package/locales/ja/agentTranscript.json +2 -10
- package/locales/ja/agents.json +5 -5
- package/locales/ko/agentTranscript.json +2 -10
- package/locales/ko/agents.json +5 -5
- package/locales/zh/agentTranscript.json +2 -10
- package/locales/zh/agents.json +5 -5
- package/package.json +3 -3
|
@@ -138,11 +138,7 @@ var modelPicker = {
|
|
|
138
138
|
"loading": "Cargando modelos…",
|
|
139
139
|
"failed": "No se pudieron cargar los modelos",
|
|
140
140
|
"none": "No hay modelos disponibles",
|
|
141
|
-
"sharedBy": "Compartido por {owner}"
|
|
142
|
-
"connecting": "Conectando…",
|
|
143
|
-
"notResponding": "No responde",
|
|
144
|
-
"manageProvider": "Gestionar proveedor",
|
|
145
|
-
"selectFirst": "Selecciona primero un modelo"
|
|
141
|
+
"sharedBy": "Compartido por {owner}"
|
|
146
142
|
};
|
|
147
143
|
var allocationPicker = {
|
|
148
144
|
"choose": "Asignación",
|
|
@@ -151,11 +147,7 @@ var allocationPicker = {
|
|
|
151
147
|
};
|
|
152
148
|
var providerIssue = {
|
|
153
149
|
"keyRejected": "Clave de API rechazada",
|
|
154
|
-
"unreachable": "Endpoint inaccesible"
|
|
155
|
-
"keyRejectedHint": "El proveedor rechazó la clave de API de esta conexión. Actualiza la clave en la configuración del proveedor para continuar.",
|
|
156
|
-
"unreachableHint": "El endpoint del proveedor no respondió. Comprueba la URL del endpoint y el acceso de red.",
|
|
157
|
-
"bannerKeyRejected": "Clave de API rechazada para «{provider}»",
|
|
158
|
-
"bannerUnreachable": "«{provider}» no está accesible"
|
|
150
|
+
"unreachable": "Endpoint inaccesible"
|
|
159
151
|
};
|
|
160
152
|
var agentTranscript_default = {
|
|
161
153
|
transcript,
|
|
@@ -44,7 +44,6 @@ var sidebar = {
|
|
|
44
44
|
"groupNamePlaceholder": "Introduce un nombre",
|
|
45
45
|
"deleteGroupTitle": "Eliminar grupo",
|
|
46
46
|
"deleteGroupBody": "Se eliminará «{name}». Sus sesiones siguen en la lista.",
|
|
47
|
-
"groupActions": "Acciones de {name}",
|
|
48
47
|
"groupsNeedUpdate": "Actualiza pw en {machine} para organizar sus sesiones en grupos",
|
|
49
48
|
"groupWaiting": "{count, plural, one {# sesión requiere tu atención} other {# sesiones requieren tu atención}}",
|
|
50
49
|
"groupRunning": "{count, plural, one {# sesión en ejecución} other {# sesiones en ejecución}}",
|
|
@@ -128,7 +127,7 @@ var detail = {
|
|
|
128
127
|
"archived": "Se archivó “{name}”. Restáurala desde el grupo Archivadas para volver a usarla.",
|
|
129
128
|
"steerUncertain": "No llegó ninguna respuesta, así que es posible que esto haya llegado al agente. Revisa la transcripción antes de volver a enviarlo.",
|
|
130
129
|
"shellStopped": "Un hook impidió que el agente reaccionara: {reason}",
|
|
131
|
-
"
|
|
130
|
+
"backgroundHint": "({key} para ejecutar en segundo plano)",
|
|
132
131
|
"backgroundTitle": "El comando sigue ejecutándose y el agente continúa sin esperarlo",
|
|
133
132
|
"liveOn": "Activa en {host}",
|
|
134
133
|
"pullRequest": "{kind, select, mergeRequest {Merge request} other {Pull request}} {pr}, abierto por esta sesión",
|
|
@@ -234,13 +233,13 @@ var detail = {
|
|
|
234
233
|
var switcher = {
|
|
235
234
|
"title": "Agentes",
|
|
236
235
|
"main": "Conversación principal",
|
|
237
|
-
"
|
|
236
|
+
"runningCount": "{count} en ejecución",
|
|
237
|
+
"doneCount": "{count, plural, one {# terminado} other {# terminados}}",
|
|
238
|
+
"stoppedCount": "{count, plural, one {# detenido} other {# detenidos}}",
|
|
238
239
|
"earlierOnly": "{count, plural, one {# agente anterior} other {# agentes anteriores}}",
|
|
239
240
|
"approvals": "{count, plural, one {# aprobación pendiente} other {# aprobaciones pendientes}}",
|
|
240
241
|
"failedCount": "{count, plural, one {# falló} other {# fallaron}}",
|
|
241
242
|
"stopAll": "Detener todos",
|
|
242
|
-
"show": "Mostrar agentes",
|
|
243
|
-
"hide": "Ocultar agentes",
|
|
244
243
|
"showEarlier": "{count, plural, one {Mostrar # agente anterior} other {Mostrar # agentes anteriores}}",
|
|
245
244
|
"hideEarlier": "{count, plural, one {Ocultar # agente anterior} other {Ocultar # agentes anteriores}}",
|
|
246
245
|
"agentName": "{type}: {description}",
|
|
@@ -261,6 +260,7 @@ var switcher = {
|
|
|
261
260
|
};
|
|
262
261
|
var effort = {
|
|
263
262
|
"label": "Esfuerzo",
|
|
263
|
+
"named": "Esfuerzo: {level}",
|
|
264
264
|
"low": "bajo",
|
|
265
265
|
"medium": "medio",
|
|
266
266
|
"high": "alto",
|
|
@@ -138,11 +138,7 @@ var modelPicker = {
|
|
|
138
138
|
"loading": "モデルを読み込み中…",
|
|
139
139
|
"failed": "モデルを読み込めませんでした",
|
|
140
140
|
"none": "利用できるモデルがありません",
|
|
141
|
-
"sharedBy": "{owner} さんが共有"
|
|
142
|
-
"connecting": "接続中…",
|
|
143
|
-
"notResponding": "応答なし",
|
|
144
|
-
"manageProvider": "プロバイダーを管理",
|
|
145
|
-
"selectFirst": "先にモデルを選択してください"
|
|
141
|
+
"sharedBy": "{owner} さんが共有"
|
|
146
142
|
};
|
|
147
143
|
var allocationPicker = {
|
|
148
144
|
"choose": "割り当て",
|
|
@@ -151,11 +147,7 @@ var allocationPicker = {
|
|
|
151
147
|
};
|
|
152
148
|
var providerIssue = {
|
|
153
149
|
"keyRejected": "API キーが拒否されました",
|
|
154
|
-
"unreachable": "エンドポイントに接続できません"
|
|
155
|
-
"keyRejectedHint": "プロバイダーがこの接続の API キーを拒否しました。再開するにはプロバイダー設定でキーを更新してください。",
|
|
156
|
-
"unreachableHint": "プロバイダーのエンドポイントが応答しませんでした。エンドポイントの URL とネットワークアクセスを確認してください。",
|
|
157
|
-
"bannerKeyRejected": "「{provider}」の API キーが拒否されました",
|
|
158
|
-
"bannerUnreachable": "「{provider}」に接続できません"
|
|
150
|
+
"unreachable": "エンドポイントに接続できません"
|
|
159
151
|
};
|
|
160
152
|
var agentTranscript_default = {
|
|
161
153
|
transcript,
|
|
@@ -44,7 +44,6 @@ var sidebar = {
|
|
|
44
44
|
"groupNamePlaceholder": "名前を入力",
|
|
45
45
|
"deleteGroupTitle": "グループを削除",
|
|
46
46
|
"deleteGroupBody": "「{name}」を削除します。セッションはリストに残ります。",
|
|
47
|
-
"groupActions": "{name} の操作",
|
|
48
47
|
"groupsNeedUpdate": "{machine} の pw を更新すると、セッションをグループに入れられます",
|
|
49
48
|
"groupWaiting": "{count, plural, other {# 件のセッションが要対応}}",
|
|
50
49
|
"groupRunning": "{count, plural, other {# 件のセッションが実行中}}",
|
|
@@ -128,7 +127,7 @@ var detail = {
|
|
|
128
127
|
"archived": "「{name}」をアーカイブしました。再び使うには「アーカイブ済み」グループから復元してください。",
|
|
129
128
|
"steerUncertain": "応答が返ってこなかったため、エージェントに届いている可能性があります。もう一度送信する前にトランスクリプトを確認してください。",
|
|
130
129
|
"shellStopped": "フックによりエージェントの応答が止められました: {reason}",
|
|
131
|
-
"
|
|
130
|
+
"backgroundHint": "({key} でバックグラウンド実行)",
|
|
132
131
|
"backgroundTitle": "コマンドは実行を続け、エージェントは完了を待たずに作業を続けます",
|
|
133
132
|
"liveOn": "{host} で稼働中",
|
|
134
133
|
"pullRequest": "このセッションが作成した{kind, select, mergeRequest {マージリクエスト} other {プルリクエスト}} {pr}",
|
|
@@ -234,13 +233,13 @@ var detail = {
|
|
|
234
233
|
var switcher = {
|
|
235
234
|
"title": "エージェント",
|
|
236
235
|
"main": "メインの会話",
|
|
237
|
-
"
|
|
236
|
+
"runningCount": "{count}件実行中",
|
|
237
|
+
"doneCount": "{count}件完了",
|
|
238
|
+
"stoppedCount": "{count}件停止",
|
|
238
239
|
"earlierOnly": "以前のエージェント{count}件",
|
|
239
240
|
"approvals": "承認待ち{count}件",
|
|
240
241
|
"failedCount": "{count}件失敗",
|
|
241
242
|
"stopAll": "すべて停止",
|
|
242
|
-
"show": "エージェントを表示",
|
|
243
|
-
"hide": "エージェントを隠す",
|
|
244
243
|
"showEarlier": "以前のエージェント{count}件を表示",
|
|
245
244
|
"hideEarlier": "以前のエージェント{count}件を隠す",
|
|
246
245
|
"agentName": "{type}: {description}",
|
|
@@ -261,6 +260,7 @@ var switcher = {
|
|
|
261
260
|
};
|
|
262
261
|
var effort = {
|
|
263
262
|
"label": "推論の強度",
|
|
263
|
+
"named": "推論の強度:{level}",
|
|
264
264
|
"low": "低",
|
|
265
265
|
"medium": "中",
|
|
266
266
|
"high": "高",
|
|
@@ -138,11 +138,7 @@ var modelPicker = {
|
|
|
138
138
|
"loading": "모델을 불러오는 중…",
|
|
139
139
|
"failed": "모델을 불러오지 못했습니다",
|
|
140
140
|
"none": "사용 가능한 모델이 없습니다",
|
|
141
|
-
"sharedBy": "{owner} 님이 공유함"
|
|
142
|
-
"connecting": "연결 중…",
|
|
143
|
-
"notResponding": "응답 없음",
|
|
144
|
-
"manageProvider": "공급자 관리",
|
|
145
|
-
"selectFirst": "먼저 모델을 선택하세요"
|
|
141
|
+
"sharedBy": "{owner} 님이 공유함"
|
|
146
142
|
};
|
|
147
143
|
var allocationPicker = {
|
|
148
144
|
"choose": "할당",
|
|
@@ -151,11 +147,7 @@ var allocationPicker = {
|
|
|
151
147
|
};
|
|
152
148
|
var providerIssue = {
|
|
153
149
|
"keyRejected": "API 키가 거부됨",
|
|
154
|
-
"unreachable": "엔드포인트에 연결할 수 없음"
|
|
155
|
-
"keyRejectedHint": "공급자가 이 연결의 API 키를 거부했습니다. 계속하려면 공급자 설정에서 키를 업데이트하세요.",
|
|
156
|
-
"unreachableHint": "공급자의 엔드포인트가 응답하지 않았습니다. 엔드포인트 URL과 네트워크 접근을 확인하세요.",
|
|
157
|
-
"bannerKeyRejected": "“{provider}”의 API 키가 거부됨",
|
|
158
|
-
"bannerUnreachable": "“{provider}”에 연결할 수 없음"
|
|
150
|
+
"unreachable": "엔드포인트에 연결할 수 없음"
|
|
159
151
|
};
|
|
160
152
|
var agentTranscript_default = {
|
|
161
153
|
transcript,
|
|
@@ -44,7 +44,6 @@ var sidebar = {
|
|
|
44
44
|
"groupNamePlaceholder": "이름을 입력하세요",
|
|
45
45
|
"deleteGroupTitle": "그룹 삭제",
|
|
46
46
|
"deleteGroupBody": "“{name}” 그룹이 삭제됩니다. 세션은 목록에 그대로 남습니다.",
|
|
47
|
-
"groupActions": "{name} 작업",
|
|
48
47
|
"groupsNeedUpdate": "{machine}의 pw를 업데이트해야 세션을 그룹에 넣을 수 있습니다",
|
|
49
48
|
"groupWaiting": "{count, plural, other {세션 #개 확인 필요}}",
|
|
50
49
|
"groupRunning": "{count, plural, other {세션 #개 실행 중}}",
|
|
@@ -128,7 +127,7 @@ var detail = {
|
|
|
128
127
|
"archived": "“{name}” 세션을 보관했습니다. 다시 사용하려면 보관됨 그룹에서 복원하세요.",
|
|
129
128
|
"steerUncertain": "응답이 오지 않아 에이전트에 이미 전달되었을 수 있습니다. 다시 보내기 전에 기록을 확인하세요.",
|
|
130
129
|
"shellStopped": "훅이 에이전트의 응답을 중지했습니다: {reason}",
|
|
131
|
-
"
|
|
130
|
+
"backgroundHint": "({key} 키로 백그라운드에서 실행)",
|
|
132
131
|
"backgroundTitle": "명령은 계속 실행되고, 에이전트는 기다리지 않고 작업을 이어갑니다",
|
|
133
132
|
"liveOn": "{host}에서 실행 중",
|
|
134
133
|
"pullRequest": "이 세션이 연 {kind, select, mergeRequest {머지 리퀘스트} other {풀 리퀘스트}} {pr}",
|
|
@@ -234,13 +233,13 @@ var detail = {
|
|
|
234
233
|
var switcher = {
|
|
235
234
|
"title": "에이전트",
|
|
236
235
|
"main": "메인 대화",
|
|
237
|
-
"
|
|
236
|
+
"runningCount": "{count}개 실행 중",
|
|
237
|
+
"doneCount": "{count}개 완료",
|
|
238
|
+
"stoppedCount": "{count}개 중지됨",
|
|
238
239
|
"earlierOnly": "이전 에이전트 {count}개",
|
|
239
240
|
"approvals": "승인 필요 {count}건",
|
|
240
241
|
"failedCount": "{count}개 실패",
|
|
241
242
|
"stopAll": "모두 중지",
|
|
242
|
-
"show": "에이전트 표시",
|
|
243
|
-
"hide": "에이전트 숨기기",
|
|
244
243
|
"showEarlier": "이전 에이전트 {count}개 표시",
|
|
245
244
|
"hideEarlier": "이전 에이전트 {count}개 숨기기",
|
|
246
245
|
"agentName": "{type}: {description}",
|
|
@@ -261,6 +260,7 @@ var switcher = {
|
|
|
261
260
|
};
|
|
262
261
|
var effort = {
|
|
263
262
|
"label": "추론 강도",
|
|
263
|
+
"named": "추론 강도: {level}",
|
|
264
264
|
"low": "낮음",
|
|
265
265
|
"medium": "중간",
|
|
266
266
|
"high": "높음",
|
|
@@ -138,11 +138,7 @@ var modelPicker = {
|
|
|
138
138
|
"loading": "正在加载模型…",
|
|
139
139
|
"failed": "无法加载模型",
|
|
140
140
|
"none": "没有可用的模型",
|
|
141
|
-
"sharedBy": "由 {owner} 共享"
|
|
142
|
-
"connecting": "正在连接…",
|
|
143
|
-
"notResponding": "无响应",
|
|
144
|
-
"manageProvider": "管理提供商",
|
|
145
|
-
"selectFirst": "请先选择模型"
|
|
141
|
+
"sharedBy": "由 {owner} 共享"
|
|
146
142
|
};
|
|
147
143
|
var allocationPicker = {
|
|
148
144
|
"choose": "配额",
|
|
@@ -151,11 +147,7 @@ var allocationPicker = {
|
|
|
151
147
|
};
|
|
152
148
|
var providerIssue = {
|
|
153
149
|
"keyRejected": "API 密钥被拒绝",
|
|
154
|
-
"unreachable": "无法访问端点"
|
|
155
|
-
"keyRejectedHint": "提供商拒绝了此连接的 API 密钥。请在提供商设置中更新密钥以继续。",
|
|
156
|
-
"unreachableHint": "提供商的端点没有响应。请检查端点 URL 和网络访问。",
|
|
157
|
-
"bannerKeyRejected": "“{provider}”的 API 密钥被拒绝",
|
|
158
|
-
"bannerUnreachable": "无法访问“{provider}”"
|
|
150
|
+
"unreachable": "无法访问端点"
|
|
159
151
|
};
|
|
160
152
|
var agentTranscript_default = {
|
|
161
153
|
transcript,
|
|
@@ -44,7 +44,6 @@ var sidebar = {
|
|
|
44
44
|
"groupNamePlaceholder": "输入名称",
|
|
45
45
|
"deleteGroupTitle": "删除分组",
|
|
46
46
|
"deleteGroupBody": "将删除“{name}”。其中的会话仍保留在列表中。",
|
|
47
|
-
"groupActions": "{name} 的操作",
|
|
48
47
|
"groupsNeedUpdate": "请更新 {machine} 上的 pw,才能将其会话放入分组",
|
|
49
48
|
"groupWaiting": "{count, plural, other {# 个会话需要你处理}}",
|
|
50
49
|
"groupRunning": "{count, plural, other {# 个会话正在运行}}",
|
|
@@ -128,7 +127,7 @@ var detail = {
|
|
|
128
127
|
"archived": "已归档“{name}”。要再次使用,请从“已归档”分组中恢复。",
|
|
129
128
|
"steerUncertain": "没有收到回应,这条消息可能已送达智能体。再次发送前请先查看记录。",
|
|
130
129
|
"shellStopped": "钩子阻止了智能体作出回应:{reason}",
|
|
131
|
-
"
|
|
130
|
+
"backgroundHint": "(按 {key} 在后台运行)",
|
|
132
131
|
"backgroundTitle": "命令继续运行,智能体无需等待它即可继续工作",
|
|
133
132
|
"liveOn": "在 {host} 上运行",
|
|
134
133
|
"pullRequest": "此会话创建的{kind, select, mergeRequest {合并请求} other {拉取请求}} {pr}",
|
|
@@ -234,13 +233,13 @@ var detail = {
|
|
|
234
233
|
var switcher = {
|
|
235
234
|
"title": "代理",
|
|
236
235
|
"main": "主对话",
|
|
237
|
-
"
|
|
236
|
+
"runningCount": "{count} 个运行中",
|
|
237
|
+
"doneCount": "{count} 个已完成",
|
|
238
|
+
"stoppedCount": "{count} 个已停止",
|
|
238
239
|
"earlierOnly": "{count} 个较早的代理",
|
|
239
240
|
"approvals": "{count} 项待批准",
|
|
240
241
|
"failedCount": "{count} 个失败",
|
|
241
242
|
"stopAll": "全部停止",
|
|
242
|
-
"show": "显示代理",
|
|
243
|
-
"hide": "隐藏代理",
|
|
244
243
|
"showEarlier": "显示 {count} 个较早的代理",
|
|
245
244
|
"hideEarlier": "隐藏 {count} 个较早的代理",
|
|
246
245
|
"agentName": "{type}: {description}",
|
|
@@ -261,6 +260,7 @@ var switcher = {
|
|
|
261
260
|
};
|
|
262
261
|
var effort = {
|
|
263
262
|
"label": "推理强度",
|
|
263
|
+
"named": "推理强度:{level}",
|
|
264
264
|
"low": "低",
|
|
265
265
|
"medium": "中",
|
|
266
266
|
"high": "高",
|
package/dist/machine.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export interface PwCodeMachine {
|
|
|
15
15
|
hostname?: string | undefined;
|
|
16
16
|
daemonId?: string | undefined;
|
|
17
17
|
storeId?: string | undefined;
|
|
18
|
+
/** The daemon stores which of the reader's groups a session is in. */
|
|
19
|
+
sessionGroups?: boolean | undefined;
|
|
18
20
|
remoteStart?: boolean | undefined;
|
|
19
21
|
}
|
|
20
22
|
/** A computer's daemon connected itself; every other machine is a resource
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PwCodeApiError, Schemas } from './apiClient.js';
|
|
2
|
+
import type { PwCodeApi } from './createPwCodeApi.js';
|
|
3
|
+
/** A Claude Code subscription model, which bills no allocation. */
|
|
4
|
+
export declare const isClaudeModel: (model: string | null | undefined) => boolean;
|
|
5
|
+
/** Claude Code runs only where it is installed and its owner allows it. */
|
|
6
|
+
export declare function runsClaude(machine: {
|
|
7
|
+
claudeInstalled?: boolean | undefined;
|
|
8
|
+
claudeCodeAllowed?: boolean | undefined;
|
|
9
|
+
} | undefined): boolean;
|
|
10
|
+
/** Whether `model` is one the session could start on. A list still loading,
|
|
11
|
+
* or one that failed to load, is passed as undefined and keeps it. */
|
|
12
|
+
export declare function canRunModel(model: string | undefined, claudeReady: boolean, platformModels: readonly {
|
|
13
|
+
id: string;
|
|
14
|
+
}[] | undefined, claudeModels: readonly {
|
|
15
|
+
id: string;
|
|
16
|
+
}[] | undefined): boolean;
|
|
17
|
+
/** A model's name, or its id without the provider when it has none. */
|
|
18
|
+
export declare function modelLabel(id: string, name?: string, fallback?: string): string;
|
|
19
|
+
/** The picker a composer opens in place of sending: the model picker, or the
|
|
20
|
+
* Claude Code accounts. */
|
|
21
|
+
export type PwCodePicker = 'models' | 'claude' | null;
|
|
22
|
+
/** The picker a prompt typed as a command opens instead of being sent. */
|
|
23
|
+
export declare function pickerCommand(text: string): PwCodePicker;
|
|
24
|
+
/** The Claude models a model picker offers on a machine, and how their list stands. */
|
|
25
|
+
export interface PwCodeModelCatalog {
|
|
26
|
+
models: Schemas['AgentClaudeModel'][];
|
|
27
|
+
error: PwCodeApiError | undefined;
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
/** Asks for the list once the picker is opened, and keeps it after. */
|
|
30
|
+
request: () => void;
|
|
31
|
+
/** Asks the machine for its list again rather than the copy it keeps. */
|
|
32
|
+
refresh: () => void;
|
|
33
|
+
}
|
|
34
|
+
/** The machine's Claude models for a model picker. A session's own list is
|
|
35
|
+
* read only once the picker opens, since reading it adopts the session, which
|
|
36
|
+
* viewing it must not do; until then a Claude model chosen where a session
|
|
37
|
+
* could start reads the machine's. */
|
|
38
|
+
export declare function useModelCatalog(api: Pick<PwCodeApi, 'useClaudeModels'>, { machine, sessionId, claudeReady, canStart, model, account, open, }: {
|
|
39
|
+
machine: string;
|
|
40
|
+
sessionId?: string | undefined;
|
|
41
|
+
claudeReady: boolean;
|
|
42
|
+
canStart: boolean;
|
|
43
|
+
model: string | null | undefined;
|
|
44
|
+
account: string | undefined;
|
|
45
|
+
/** The picker is showing. */
|
|
46
|
+
open: boolean;
|
|
47
|
+
}): PwCodeModelCatalog;
|
package/dist/models.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
// src/models.ts
|
|
3
|
+
/** A Claude Code subscription model, which bills no allocation. */
|
|
4
|
+
var isClaudeModel = (model) => !!model?.startsWith("claude-code/");
|
|
5
|
+
/** Claude Code runs only where it is installed and its owner allows it. */
|
|
6
|
+
function runsClaude(machine) {
|
|
7
|
+
return machine?.claudeInstalled === true && machine.claudeCodeAllowed === true;
|
|
8
|
+
}
|
|
9
|
+
/** Whether `model` is one the session could start on. A list still loading,
|
|
10
|
+
* or one that failed to load, is passed as undefined and keeps it. */
|
|
11
|
+
function canRunModel(model, claudeReady, platformModels, claudeModels) {
|
|
12
|
+
if (isClaudeModel(model) && !claudeReady) return false;
|
|
13
|
+
const offered = isClaudeModel(model) ? claudeModels : platformModels;
|
|
14
|
+
return !offered || offered.some((m) => m.id === model);
|
|
15
|
+
}
|
|
16
|
+
/** A model's name, or its id without the provider when it has none. */
|
|
17
|
+
function modelLabel(id, name, fallback = "") {
|
|
18
|
+
return name || id.slice(id.indexOf("/") + 1) || fallback;
|
|
19
|
+
}
|
|
20
|
+
/** The picker a prompt typed as a command opens instead of being sent. */
|
|
21
|
+
function pickerCommand(text) {
|
|
22
|
+
switch (text.trim()) {
|
|
23
|
+
case "/model": return "models";
|
|
24
|
+
case "/claude-code":
|
|
25
|
+
case "/claude-code use": return "claude";
|
|
26
|
+
default: return null;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** The machine's Claude models for a model picker. A session's own list is
|
|
30
|
+
* read only once the picker opens, since reading it adopts the session, which
|
|
31
|
+
* viewing it must not do; until then a Claude model chosen where a session
|
|
32
|
+
* could start reads the machine's. */
|
|
33
|
+
function useModelCatalog(api, { machine, sessionId, claudeReady, canStart, model, account, open }) {
|
|
34
|
+
const [requested, setRequested] = useState(false);
|
|
35
|
+
const [forceRefresh, setForceRefresh] = useState(false);
|
|
36
|
+
const hostCatalog = api.useClaudeModels(machine, void 0, account, claudeReady && canStart && isClaudeModel(model));
|
|
37
|
+
const local = api.useClaudeModels(machine, sessionId, account, claudeReady && (requested || open), forceRefresh);
|
|
38
|
+
return {
|
|
39
|
+
models: local.data ?? hostCatalog.data ?? [],
|
|
40
|
+
error: local.error,
|
|
41
|
+
isLoading: local.isLoading,
|
|
42
|
+
request: () => setRequested(true),
|
|
43
|
+
refresh: () => {
|
|
44
|
+
if (forceRefresh) local.mutate();
|
|
45
|
+
else setForceRefresh(true);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export { canRunModel, isClaudeModel, modelLabel, pickerCommand, runsClaude, useModelCatalog };
|
package/dist/notices.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type PwCodeTranslator } from './messages.js';
|
|
2
|
-
import type { CompactionNotice, RecapNotice, TranscriptWords } from './transcript.js';
|
|
2
|
+
import type { CompactionNotice, GoalNotice, RecapNotice, TranscriptWords } from './transcript.js';
|
|
3
3
|
/** When a usage limit resets, as a session's notices name it. */
|
|
4
4
|
export declare function useResumeTime(): (at: string) => string;
|
|
5
|
+
export declare function useGoalNotice(): GoalNotice;
|
|
5
6
|
export declare function useCompactionNotice(): CompactionNotice;
|
|
6
7
|
export declare function useRecapNotice(): RecapNotice;
|
|
7
8
|
/** How long a turn took, as the terminal says it: 42s, 2m 5s, 1h 4m. */
|
package/dist/notices.js
CHANGED
|
@@ -2,7 +2,8 @@ import { usePwCodeTranslations } from "./messages.js";
|
|
|
2
2
|
import { useCallback, useMemo } from "react";
|
|
3
3
|
import { DateTime } from "luxon";
|
|
4
4
|
import { sanitizeLabel } from "@parallelworks/ui/ai/headless";
|
|
5
|
-
import { useFormatter } from "use-intl";
|
|
5
|
+
import { useFormatter, useLocale } from "use-intl";
|
|
6
|
+
import { formatDuration } from "@parallelworks/ui/headless";
|
|
6
7
|
// src/notices.ts
|
|
7
8
|
/** When a usage limit resets, as a session's notices name it. */
|
|
8
9
|
function useResumeTime() {
|
|
@@ -12,6 +13,30 @@ function useResumeTime() {
|
|
|
12
13
|
timeStyle: "short"
|
|
13
14
|
}), [format]);
|
|
14
15
|
}
|
|
16
|
+
function useGoalNotice() {
|
|
17
|
+
const t = usePwCodeTranslations("agents");
|
|
18
|
+
const format = useFormatter();
|
|
19
|
+
const locale = useLocale();
|
|
20
|
+
const resumeTime = useResumeTime();
|
|
21
|
+
return useCallback((p) => {
|
|
22
|
+
if (p.resumeAt) return t("detail.goalUsageLimit", { time: resumeTime(p.resumeAt) });
|
|
23
|
+
if (p.err) return t("detail.goalCheckFailed", { error: p.err });
|
|
24
|
+
if (p.outcome === "achieved") return t("detail.goalAchieved", {
|
|
25
|
+
elapsed: formatDuration(Math.floor((p.elapsedMs ?? 0) / 1e3) * 1e3, locale),
|
|
26
|
+
turns: p.turns ?? 0,
|
|
27
|
+
tokens: format.number(p.tokens ?? 0, {
|
|
28
|
+
notation: "compact",
|
|
29
|
+
maximumFractionDigits: 1
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
return t("detail.goalContinuing");
|
|
33
|
+
}, [
|
|
34
|
+
t,
|
|
35
|
+
format,
|
|
36
|
+
locale,
|
|
37
|
+
resumeTime
|
|
38
|
+
]);
|
|
39
|
+
}
|
|
15
40
|
function useCompactionNotice() {
|
|
16
41
|
const t = usePwCodeTranslations("agents");
|
|
17
42
|
return useMemo(() => ({
|
|
@@ -84,11 +109,12 @@ function useTranscriptWords() {
|
|
|
84
109
|
outcome
|
|
85
110
|
});
|
|
86
111
|
},
|
|
87
|
-
allowDirectory: ({ path, subtree }) => subtree ? tTranscript("transcript.allowDirectoryTree", { path }) : tTranscript("transcript.allowDirectoryOnly", { path })
|
|
112
|
+
allowDirectory: ({ path, subtree }) => subtree ? tTranscript("transcript.allowDirectoryTree", { path }) : tTranscript("transcript.allowDirectoryOnly", { path }),
|
|
113
|
+
mainConversation: t("switcher.main")
|
|
88
114
|
}), [
|
|
89
115
|
t,
|
|
90
116
|
tTranscript,
|
|
91
117
|
format
|
|
92
118
|
]);
|
|
93
119
|
}
|
|
94
|
-
export { turnDuration, useCompactionNotice, useRecapNotice, useResumeTime, useTranscriptWords };
|
|
120
|
+
export { turnDuration, useCompactionNotice, useGoalNotice, useRecapNotice, useResumeTime, useTranscriptWords };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { PwCodeTranslator } from './messages.js';
|
|
2
|
+
export type PullRequestState = 'open' | 'draft' | 'merged' | 'closed';
|
|
3
|
+
export declare function isPullRequestState(state: string | undefined): state is PullRequestState;
|
|
4
|
+
/** A pull or merge request's link and its `pullRequestLabel`. */
|
|
5
|
+
export type LabeledPullRequest = {
|
|
6
|
+
url: string;
|
|
7
|
+
pr: string;
|
|
8
|
+
};
|
|
9
|
+
/** The URLs that are plain GitHub pull requests or GitLab merge requests, each with its `pullRequestLabel`. */
|
|
10
|
+
export declare function labeledPullRequests(urls: readonly string[] | null | undefined): LabeledPullRequest[];
|
|
11
|
+
/** A pull request's state by its URL; undefined until one is read. */
|
|
12
|
+
export type PullRequestStateOf = (url: string) => string | undefined;
|
|
13
|
+
/** Reads a state from a session's pull request reads, or from the
|
|
14
|
+
* `pullRequestStates` a listed session carries. */
|
|
15
|
+
export declare function pullRequestStateOf(states: readonly {
|
|
16
|
+
url: string;
|
|
17
|
+
state?: string | undefined;
|
|
18
|
+
}[] | Readonly<Record<string, string>> | null | undefined): PullRequestStateOf;
|
|
19
|
+
/** Drafts, then open, merged and closed pull requests, the newest first within each; one whose state is unknown counts as open. */
|
|
20
|
+
export declare function orderPullRequests(pullRequests: readonly LabeledPullRequest[], stateOf: PullRequestStateOf): LabeledPullRequest[];
|
|
21
|
+
/** Whether each pull request folds into the merged-or-closed count rather than the open one. */
|
|
22
|
+
export declare function pullRequestFoldGroups(ordered: readonly LabeledPullRequest[], stateOf: PullRequestStateOf): boolean[];
|
|
23
|
+
/** How many of `ordered` fold whether or not they fit: its merged and closed ones, which come last, once there are `from` of them to fold; the first stays when every one is merged or closed. */
|
|
24
|
+
export declare function donePullRequestsToFold(ordered: readonly LabeledPullRequest[], stateOf: PullRequestStateOf, from: number): number;
|
|
25
|
+
/** Folded pull requests count apart while open or draft and once merged or closed; `all` counts every one, for a line with room for nothing else. */
|
|
26
|
+
export type PullRequestFoldGroup = 'open' | 'done' | 'all';
|
|
27
|
+
export type PullRequestFold = {
|
|
28
|
+
shown: LabeledPullRequest[];
|
|
29
|
+
groups: {
|
|
30
|
+
group: Exclude<PullRequestFoldGroup, 'all'>;
|
|
31
|
+
pullRequests: LabeledPullRequest[];
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
/** `ordered` but its last `folded`, which fold into an open count and a merged-or-closed one; a group with none is left out. */
|
|
35
|
+
export declare function foldPullRequests(ordered: readonly LabeledPullRequest[], folded: number, stateOf: PullRequestStateOf): PullRequestFold;
|
|
36
|
+
/** The state a folded group shows: open over draft, and merged over closed. */
|
|
37
|
+
export declare function pullRequestGroupState(group: readonly LabeledPullRequest[], stateOf: PullRequestStateOf): PullRequestState | undefined;
|
|
38
|
+
/** Whether each pull request's state differs from the one before it, where a list marks the change. */
|
|
39
|
+
export declare function pullRequestStateBreaks(pullRequests: readonly LabeledPullRequest[], stateOf: PullRequestStateOf): boolean[];
|
|
40
|
+
export interface PullRequestWords {
|
|
41
|
+
/** A pull request's tooltip, naming its state once it is known. */
|
|
42
|
+
title: (pr: string, state: string | undefined) => string;
|
|
43
|
+
/** A known state's name, which its icon is labeled with. */
|
|
44
|
+
state: (state: PullRequestState) => string;
|
|
45
|
+
/** How many pull requests a count folds away. */
|
|
46
|
+
more: (count: number) => string;
|
|
47
|
+
/** What a folded group's list is called. */
|
|
48
|
+
groupTitle: (group: PullRequestFoldGroup, count: number) => string;
|
|
49
|
+
/** The control that lists a folded group. */
|
|
50
|
+
showGroup: (group: Exclude<PullRequestFoldGroup, 'all'>, count: number) => string;
|
|
51
|
+
}
|
|
52
|
+
export declare function pullRequestWords(t: PwCodeTranslator<'agents'>): PullRequestWords;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { pullRequestKind, pullRequestLabel } from "./pullRequest.js";
|
|
2
|
+
// src/pullRequestList.ts
|
|
3
|
+
var stateOrder = {
|
|
4
|
+
draft: 0,
|
|
5
|
+
open: 1,
|
|
6
|
+
merged: 2,
|
|
7
|
+
closed: 3
|
|
8
|
+
};
|
|
9
|
+
function isPullRequestState(state) {
|
|
10
|
+
return state !== void 0 && Object.hasOwn(stateOrder, state);
|
|
11
|
+
}
|
|
12
|
+
/** The URLs that are plain GitHub pull requests or GitLab merge requests, each with its `pullRequestLabel`. */
|
|
13
|
+
function labeledPullRequests(urls) {
|
|
14
|
+
return (urls ?? []).flatMap((url) => {
|
|
15
|
+
const pr = pullRequestLabel(url);
|
|
16
|
+
return pr ? [{
|
|
17
|
+
url,
|
|
18
|
+
pr
|
|
19
|
+
}] : [];
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** Reads a state from a session's pull request reads, or from the
|
|
23
|
+
* `pullRequestStates` a listed session carries. */
|
|
24
|
+
function pullRequestStateOf(states) {
|
|
25
|
+
if (Array.isArray(states)) return (url) => states.find((s) => s.url === url)?.state;
|
|
26
|
+
const byUrl = states;
|
|
27
|
+
return (url) => byUrl?.[url];
|
|
28
|
+
}
|
|
29
|
+
var stateRank = (state) => isPullRequestState(state) ? stateOrder[state] : stateOrder.open;
|
|
30
|
+
/** Drafts, then open, merged and closed pull requests, the newest first within each; one whose state is unknown counts as open. */
|
|
31
|
+
function orderPullRequests(pullRequests, stateOf) {
|
|
32
|
+
return pullRequests.map((pr, i) => ({
|
|
33
|
+
pr,
|
|
34
|
+
i,
|
|
35
|
+
rank: stateRank(stateOf(pr.url))
|
|
36
|
+
})).sort((a, b) => a.rank - b.rank || b.i - a.i).map(({ pr }) => pr);
|
|
37
|
+
}
|
|
38
|
+
var isDone = (state) => state === "merged" || state === "closed";
|
|
39
|
+
/** Whether each pull request folds into the merged-or-closed count rather than the open one. */
|
|
40
|
+
function pullRequestFoldGroups(ordered, stateOf) {
|
|
41
|
+
return ordered.map(({ url }) => isDone(stateOf(url)));
|
|
42
|
+
}
|
|
43
|
+
/** How many of `ordered` fold whether or not they fit: its merged and closed ones, which come last, once there are `from` of them to fold; the first stays when every one is merged or closed. */
|
|
44
|
+
function donePullRequestsToFold(ordered, stateOf, from) {
|
|
45
|
+
const done = ordered.filter(({ url }) => isDone(stateOf(url))).length;
|
|
46
|
+
const foldable = done === ordered.length ? done - 1 : done;
|
|
47
|
+
return foldable >= from ? foldable : 0;
|
|
48
|
+
}
|
|
49
|
+
/** `ordered` but its last `folded`, which fold into an open count and a merged-or-closed one; a group with none is left out. */
|
|
50
|
+
function foldPullRequests(ordered, folded, stateOf) {
|
|
51
|
+
const rest = ordered.slice(ordered.length - folded);
|
|
52
|
+
const groups = [{
|
|
53
|
+
group: "open",
|
|
54
|
+
pullRequests: rest.filter(({ url }) => !isDone(stateOf(url)))
|
|
55
|
+
}, {
|
|
56
|
+
group: "done",
|
|
57
|
+
pullRequests: rest.filter(({ url }) => isDone(stateOf(url)))
|
|
58
|
+
}];
|
|
59
|
+
return {
|
|
60
|
+
shown: ordered.slice(0, ordered.length - folded),
|
|
61
|
+
groups: groups.filter(({ pullRequests }) => pullRequests.length > 0)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
var groupPrecedence = [
|
|
65
|
+
"open",
|
|
66
|
+
"draft",
|
|
67
|
+
"merged",
|
|
68
|
+
"closed"
|
|
69
|
+
];
|
|
70
|
+
/** The state a folded group shows: open over draft, and merged over closed. */
|
|
71
|
+
function pullRequestGroupState(group, stateOf) {
|
|
72
|
+
const states = new Set(group.map(({ url }) => stateOf(url)));
|
|
73
|
+
return groupPrecedence.find((state) => states.has(state));
|
|
74
|
+
}
|
|
75
|
+
/** Whether each pull request's state differs from the one before it, where a list marks the change. */
|
|
76
|
+
function pullRequestStateBreaks(pullRequests, stateOf) {
|
|
77
|
+
return pullRequests.map(({ url }, i) => i > 0 && stateRank(stateOf(url)) !== stateRank(stateOf(pullRequests[i - 1]?.url ?? "")));
|
|
78
|
+
}
|
|
79
|
+
var stateTitles = {
|
|
80
|
+
open: "detail.pullRequestOpen",
|
|
81
|
+
draft: "detail.pullRequestDraft",
|
|
82
|
+
merged: "detail.pullRequestMerged",
|
|
83
|
+
closed: "detail.pullRequestClosed"
|
|
84
|
+
};
|
|
85
|
+
var groupTitles = {
|
|
86
|
+
open: "detail.pullRequestsMoreOpenTitle",
|
|
87
|
+
done: "detail.pullRequestsMoreDoneTitle",
|
|
88
|
+
all: "detail.pullRequestsMoreAllTitle"
|
|
89
|
+
};
|
|
90
|
+
var groupLabels = {
|
|
91
|
+
open: "detail.pullRequestsShowMoreOpen",
|
|
92
|
+
done: "detail.pullRequestsShowMoreDone"
|
|
93
|
+
};
|
|
94
|
+
function pullRequestWords(t) {
|
|
95
|
+
return {
|
|
96
|
+
title: (pr, state) => t(isPullRequestState(state) ? stateTitles[state] : "detail.pullRequest", {
|
|
97
|
+
pr,
|
|
98
|
+
kind: pullRequestKind(pr)
|
|
99
|
+
}),
|
|
100
|
+
state: (state) => t(`detail.pullRequestState.${state}`),
|
|
101
|
+
more: (count) => t("detail.pullRequestsMore", { count }),
|
|
102
|
+
groupTitle: (group, count) => t(groupTitles[group], { count }),
|
|
103
|
+
showGroup: (group, count) => t(groupLabels[group], { count })
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export { donePullRequestsToFold, foldPullRequests, isPullRequestState, labeledPullRequests, orderPullRequests, pullRequestFoldGroups, pullRequestGroupState, pullRequestStateBreaks, pullRequestStateOf, pullRequestWords };
|
package/dist/session.d.ts
CHANGED
|
@@ -15,6 +15,11 @@ export interface PwCodeSession {
|
|
|
15
15
|
/** The host whose client holds the session, while one does. */
|
|
16
16
|
liveHost?: string | undefined;
|
|
17
17
|
archivedAt?: string | undefined;
|
|
18
|
+
pinnedAt?: string | undefined;
|
|
19
|
+
/** The id of the reader's group the session is in. */
|
|
20
|
+
group?: string | undefined;
|
|
21
|
+
/** Links to the pull requests the session opened or was pointed at. */
|
|
22
|
+
pullRequests?: string[] | null | undefined;
|
|
18
23
|
updatedAt?: string | undefined;
|
|
19
24
|
turnStartedAt?: string | undefined;
|
|
20
25
|
workspace?: string | undefined;
|