viveworker 0.6.2 → 0.6.4
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 +23 -0
- package/package.json +1 -1
- package/scripts/viveworker-bridge.mjs +1853 -121
- package/web/app.css +228 -9
- package/web/app.js +878 -26
- package/web/i18n.js +114 -0
- package/web/sw.js +33 -15
package/web/i18n.js
CHANGED
|
@@ -135,6 +135,26 @@ const translations = {
|
|
|
135
135
|
"detail.planReady": "Plan is ready.",
|
|
136
136
|
"detail.previousMessage": "Previous message",
|
|
137
137
|
"detail.interruptedTask": "Interrupted task",
|
|
138
|
+
"detail.autoPilotManualEyebrow": "Auto Pilot",
|
|
139
|
+
"detail.autoPilot.manualTitle": "Why this stayed manual",
|
|
140
|
+
"detail.autoPilot.writeDisabled": "Low-risk writes is off right now, so file changes still wait for manual approval.",
|
|
141
|
+
"detail.autoPilot.writeMissingWorkspace": "Auto Pilot could not confirm a current workspace for this file change.",
|
|
142
|
+
"detail.autoPilot.writeMissingDiff": "The file change did not include a usable diff, so Auto Pilot left it for manual review.",
|
|
143
|
+
"detail.autoPilot.writeMissingFiles": "The file change did not include any referenced files for Auto Pilot to check.",
|
|
144
|
+
"detail.autoPilot.writeInvalidFiles": "The referenced files were outside the current workspace or matched a protected path.",
|
|
145
|
+
"detail.autoPilot.writeDiffTooLarge": "This diff is larger than the current low-risk write limits.",
|
|
146
|
+
"detail.autoPilot.writeDiffUnreadable": "Auto Pilot could not parse the diff into a safe file-level change.",
|
|
147
|
+
"detail.autoPilot.writeDangerousDiff": "This diff included create, delete, rename, mode, or binary markers that stay manual.",
|
|
148
|
+
"detail.autoPilot.writeDiffMismatch": "The diff headers did not line up cleanly with the referenced files, so Auto Pilot left it for manual review.",
|
|
149
|
+
"detail.autoPilot.writeContentDisabled": "This looks like a Content & copy change, but that lane is currently off.",
|
|
150
|
+
"detail.autoPilot.writeUiDisabled": "This looks like a UI & tests change, but that lane is currently off.",
|
|
151
|
+
"detail.autoPilot.writeUiUnsafe": "This UI/test diff added imports or higher-risk APIs, so it stayed manual.",
|
|
152
|
+
"detail.autoPilot.writeUiTooLarge": "UI & tests only covers small diffs, and this one was larger than that lane allows.",
|
|
153
|
+
"detail.autoPilot.writeSourceDisabled": "This looks like a Small code patch, but that beta lane is currently off.",
|
|
154
|
+
"detail.autoPilot.writeSourceUnsafe": "This source diff added a higher-risk API or secret-like token, so it stayed manual.",
|
|
155
|
+
"detail.autoPilot.writeSourceTooLarge": "Small code patches only covers very small single-file diffs.",
|
|
156
|
+
"detail.autoPilot.writeSourceContinuity": "Small code patches needs a recent read of the same file in this thread before Auto Pilot will approve it.",
|
|
157
|
+
"detail.autoPilot.writeNoLaneMatch": "This change did not fit any enabled low-risk write lane in the current workspace.",
|
|
138
158
|
"detail.imageAlt": ({ index }) => `Attached image ${index}`,
|
|
139
159
|
"detail.filesTitle": "Files",
|
|
140
160
|
"detail.diffTitle": "Diff",
|
|
@@ -312,6 +332,35 @@ const translations = {
|
|
|
312
332
|
"settings.awayMode.title": "Sync mode",
|
|
313
333
|
"settings.awayMode.copy": "Let Claude's plan approvals and questions be answered from either your PC browser or any paired device, whichever you reach first.",
|
|
314
334
|
"settings.awayMode.codexNote": "Codex requires no configuration: approvals and prompts can already be handled from either the desktop or any paired device.",
|
|
335
|
+
"settings.autoPilot.title": "Auto Pilot",
|
|
336
|
+
"settings.autoPilot.copy": "Choose which safe approvals viveworker can handle for you in the current workspace.",
|
|
337
|
+
"settings.autoPilot.trustedReadsTitle": "Safe reads",
|
|
338
|
+
"settings.autoPilot.trustedReadsDescription": "Auto-approve workspace-only reads such as rg, find, git diff, git show, and sed -n.",
|
|
339
|
+
"settings.autoPilot.trustedWritesTitle": "Low-risk writes",
|
|
340
|
+
"settings.autoPilot.trustedWritesDescription": "Choose which write lanes Auto Pilot can handle in the current workspace.",
|
|
341
|
+
"settings.autoPilot.writeLaneContentTitle": "Content & copy",
|
|
342
|
+
"settings.autoPilot.writeLaneContentDescription": "Docs, markdown, and i18n/copy files.",
|
|
343
|
+
"settings.autoPilot.writeLaneUiTestsTitle": "UI & tests",
|
|
344
|
+
"settings.autoPilot.writeLaneUiTestsDescription": "Small CSS, web/component UI changes, and test-only diffs.",
|
|
345
|
+
"settings.autoPilot.writeLaneSourceTitle": "Small code patches (beta)",
|
|
346
|
+
"settings.autoPilot.writeLaneSourceDescription": "Single-file source edits with tighter diff and safety rules.",
|
|
347
|
+
"settings.autoPilot.scopeNote": "Secrets, config, deploy, auth, payments, networked changes, and anything outside the current workspace still require manual approval.",
|
|
348
|
+
"settings.autoPilot.recentTitle": "Recent auto-approved actions",
|
|
349
|
+
"settings.autoPilot.recentEmpty": "Nothing has been auto-approved yet. Recent reads and writes will appear here once Auto Pilot starts handling them.",
|
|
350
|
+
"settings.autoPilot.recentRead": "Read",
|
|
351
|
+
"settings.autoPilot.recentWrite": "Write",
|
|
352
|
+
"settings.autoPilot.recentContent": "Content & copy",
|
|
353
|
+
"settings.autoPilot.recentUiTests": "UI & tests",
|
|
354
|
+
"settings.autoPilot.recentSource": "Small code patch",
|
|
355
|
+
"settings.autoPilot.suggestionsTitle": "Suggested next",
|
|
356
|
+
"settings.autoPilot.suggestionsEmpty": "Keep using viveworker normally. Suggestions will appear here once repeated manual approvals show a clear pattern.",
|
|
357
|
+
"settings.autoPilot.suggestionEnable": "Enable",
|
|
358
|
+
"settings.autoPilot.suggestionContentTitle": "Turn on Content & copy",
|
|
359
|
+
"settings.autoPilot.suggestionContentBody": ({ count }) => `${count} recent manual approvals matched docs, markdown, or i18n/copy edits.`,
|
|
360
|
+
"settings.autoPilot.suggestionUiTestsTitle": "Turn on UI & tests",
|
|
361
|
+
"settings.autoPilot.suggestionUiTestsBody": ({ count }) => `${count} recent manual approvals matched small UI or test diffs.`,
|
|
362
|
+
"settings.autoPilot.suggestionSourceTitle": "Turn on Small code patches (beta)",
|
|
363
|
+
"settings.autoPilot.suggestionSourceBody": ({ count }) => `${count} recent manual approvals matched small single-file source patches.`,
|
|
315
364
|
"settings.notifications.copy":
|
|
316
365
|
"Keep approvals, plans, questions, and completions within reach even when viveworker is in the background.",
|
|
317
366
|
"settings.notifications.serverDisabled": "Web Push is not enabled on the server yet.",
|
|
@@ -543,6 +592,14 @@ const translations = {
|
|
|
543
592
|
"server.action.implement": "Implement",
|
|
544
593
|
"server.message.commandApprovalNeeded": "Command approval needed.",
|
|
545
594
|
"server.message.commandLabel": "Command",
|
|
595
|
+
"server.message.filesLabel": "Files",
|
|
596
|
+
"server.message.diffSummaryLabel": "Diff summary:",
|
|
597
|
+
"server.message.autoPilotTrustedReadApproved": "Auto Pilot approved this trusted read command.",
|
|
598
|
+
"server.message.autoPilotTrustedReadSummary": "Auto Pilot approved a trusted read command.",
|
|
599
|
+
"server.message.autoPilotTrustedReadReason": "Auto-approved by viveworker Auto Pilot because it matched the trusted read policy.",
|
|
600
|
+
"server.message.autoPilotTrustedWriteApproved": "Auto Pilot approved this low-risk file change.",
|
|
601
|
+
"server.message.autoPilotTrustedWriteSummary": "Auto Pilot approved a low-risk file change.",
|
|
602
|
+
"server.message.autoPilotTrustedWriteReason": "Auto-approved by viveworker Auto Pilot because it matched the low-risk write policy for the current workspace.",
|
|
546
603
|
"server.message.fileApprovalNeeded": "File changes need approval.",
|
|
547
604
|
"server.message.commandPrefix": ({ command }) => `Command: ${command}`,
|
|
548
605
|
"server.message.pathPrefix": ({ path }) => `Path: ${path}`,
|
|
@@ -916,6 +973,26 @@ const translations = {
|
|
|
916
973
|
"detail.planReady": "プランの確認が必要です。",
|
|
917
974
|
"detail.previousMessage": "ひとつ前のメッセージ",
|
|
918
975
|
"detail.interruptedTask": "中断されたタスク",
|
|
976
|
+
"detail.autoPilotManualEyebrow": "Auto Pilot",
|
|
977
|
+
"detail.autoPilot.manualTitle": "手動承認になった理由",
|
|
978
|
+
"detail.autoPilot.writeDisabled": "いまは低リスクな書き込みが OFF なので、ファイル変更は手動承認のままです。",
|
|
979
|
+
"detail.autoPilot.writeMissingWorkspace": "このファイル変更に対して、現在のワークスペースを確認できませんでした。",
|
|
980
|
+
"detail.autoPilot.writeMissingDiff": "使える diff が含まれていなかったため、Auto Pilot は手動承認へ回しました。",
|
|
981
|
+
"detail.autoPilot.writeMissingFiles": "Auto Pilot が確認するための対象ファイルが含まれていませんでした。",
|
|
982
|
+
"detail.autoPilot.writeInvalidFiles": "対象ファイルが現在のワークスペース外か、保護されたパスに当たっていました。",
|
|
983
|
+
"detail.autoPilot.writeDiffTooLarge": "この diff は、現在の低リスク書き込みの上限を超えています。",
|
|
984
|
+
"detail.autoPilot.writeDiffUnreadable": "diff を安全なファイル単位の変更として解釈できませんでした。",
|
|
985
|
+
"detail.autoPilot.writeDangerousDiff": "作成・削除・rename・mode 変更・binary を含むため、手動承認のままです。",
|
|
986
|
+
"detail.autoPilot.writeDiffMismatch": "diff のファイルヘッダと対象ファイルがきれいに一致しなかったため、手動承認へ回しました。",
|
|
987
|
+
"detail.autoPilot.writeContentDisabled": "文書・文言に見える変更ですが、そのレーンは現在 OFF です。",
|
|
988
|
+
"detail.autoPilot.writeUiDisabled": "UI・テストに見える変更ですが、そのレーンは現在 OFF です。",
|
|
989
|
+
"detail.autoPilot.writeUiUnsafe": "この UI / テスト差分には import や高リスク API の追加が含まれていたため、手動承認のままです。",
|
|
990
|
+
"detail.autoPilot.writeUiTooLarge": "UI・テストは小さな差分だけが対象で、今回はその範囲を超えています。",
|
|
991
|
+
"detail.autoPilot.writeSourceDisabled": "小さなコード修正に見える変更ですが、そのベータレーンは現在 OFF です。",
|
|
992
|
+
"detail.autoPilot.writeSourceUnsafe": "このソース差分には高リスク API または secret に近い追加が含まれていたため、手動承認のままです。",
|
|
993
|
+
"detail.autoPilot.writeSourceTooLarge": "小さなコード修正は、ごく小さい単一ファイル差分だけが対象です。",
|
|
994
|
+
"detail.autoPilot.writeSourceContinuity": "小さなコード修正は、このスレッド内で同じファイルを直前に読んでいることが必要です。",
|
|
995
|
+
"detail.autoPilot.writeNoLaneMatch": "この変更は、現在のワークスペースで有効な低リスク書き込みレーンに当てはまりませんでした。",
|
|
919
996
|
"detail.imageAlt": ({ index }) => `添付画像 ${index}`,
|
|
920
997
|
"detail.filesTitle": "関連ファイル",
|
|
921
998
|
"detail.diffTitle": "差分",
|
|
@@ -1090,6 +1167,35 @@ const translations = {
|
|
|
1090
1167
|
"settings.awayMode.title": "同期モード",
|
|
1091
1168
|
"settings.awayMode.copy": "Claude のプラン承認・質問を PC ブラウザとペアリング端末の両方から回答できるようにします。先に回答した方が有効です。",
|
|
1092
1169
|
"settings.awayMode.codexNote": "Codex は設定不要です。承認や質問は PC とペアリング端末のどちらからでも操作できます。",
|
|
1170
|
+
"settings.autoPilot.title": "承認の自動化",
|
|
1171
|
+
"settings.autoPilot.copy": "現在のワークスペース内で、viveworker に任せる安全な承認の範囲を選べます。",
|
|
1172
|
+
"settings.autoPilot.trustedReadsTitle": "安全な読み取り",
|
|
1173
|
+
"settings.autoPilot.trustedReadsDescription": "rg、find、git diff、git show、sed -n など、ワークスペース内の読み取りを自動承認します。",
|
|
1174
|
+
"settings.autoPilot.trustedWritesTitle": "低リスクな書き込み",
|
|
1175
|
+
"settings.autoPilot.trustedWritesDescription": "現在のワークスペース内で、自動承認する書き込みレーンを選べます。",
|
|
1176
|
+
"settings.autoPilot.writeLaneContentTitle": "文書・文言",
|
|
1177
|
+
"settings.autoPilot.writeLaneContentDescription": "README、Markdown、i18n などの文書や文言の更新。",
|
|
1178
|
+
"settings.autoPilot.writeLaneUiTestsTitle": "UI・テスト",
|
|
1179
|
+
"settings.autoPilot.writeLaneUiTestsDescription": "小さな CSS、web/components の UI 変更、テスト差分。",
|
|
1180
|
+
"settings.autoPilot.writeLaneSourceTitle": "小さなコード修正(ベータ)",
|
|
1181
|
+
"settings.autoPilot.writeLaneSourceDescription": "既存ソースへの小さな単一ファイル修正。より厳しい条件で判定します。",
|
|
1182
|
+
"settings.autoPilot.scopeNote": "秘密情報、設定・デプロイ、認証・決済、ネットワークを伴う変更、ワークスペース外へのアクセスは引き続き手動承認になります。",
|
|
1183
|
+
"settings.autoPilot.recentTitle": "最近の自動承認",
|
|
1184
|
+
"settings.autoPilot.recentEmpty": "まだ自動承認はありません。承認の自動化が動くと、最近の読み取りや書き込みがここに表示されます。",
|
|
1185
|
+
"settings.autoPilot.recentRead": "読み取り",
|
|
1186
|
+
"settings.autoPilot.recentWrite": "書き込み",
|
|
1187
|
+
"settings.autoPilot.recentContent": "文書・文言",
|
|
1188
|
+
"settings.autoPilot.recentUiTests": "UI・テスト",
|
|
1189
|
+
"settings.autoPilot.recentSource": "小さなコード修正",
|
|
1190
|
+
"settings.autoPilot.suggestionsTitle": "おすすめ",
|
|
1191
|
+
"settings.autoPilot.suggestionsEmpty": "普段どおり使っていれば大丈夫です。手動承認が繰り返されると、ここにおすすめが表示されます。",
|
|
1192
|
+
"settings.autoPilot.suggestionEnable": "有効化",
|
|
1193
|
+
"settings.autoPilot.suggestionContentTitle": "文書・文言を有効化",
|
|
1194
|
+
"settings.autoPilot.suggestionContentBody": ({ count }) => `最近の手動承認 ${count} 件が、文書・Markdown・i18n の更新に一致しています。`,
|
|
1195
|
+
"settings.autoPilot.suggestionUiTestsTitle": "UI・テストを有効化",
|
|
1196
|
+
"settings.autoPilot.suggestionUiTestsBody": ({ count }) => `最近の手動承認 ${count} 件が、小さな UI 変更やテスト差分に一致しています。`,
|
|
1197
|
+
"settings.autoPilot.suggestionSourceTitle": "小さなコード修正(ベータ)を有効化",
|
|
1198
|
+
"settings.autoPilot.suggestionSourceBody": ({ count }) => `最近の手動承認 ${count} 件が、小さな単一ファイルのソース修正に一致しています。`,
|
|
1093
1199
|
"settings.notifications.copy":
|
|
1094
1200
|
"viveworker がバックグラウンドでも、承認、プラン、質問、完了を確認しやすくします。",
|
|
1095
1201
|
"settings.notifications.serverDisabled": "サーバー側で Web Push がまだ有効化されていません。",
|
|
@@ -1321,6 +1427,14 @@ const translations = {
|
|
|
1321
1427
|
"server.action.implement": "実装する",
|
|
1322
1428
|
"server.message.commandApprovalNeeded": "コマンド実行の承認が必要です。",
|
|
1323
1429
|
"server.message.commandLabel": "コマンド",
|
|
1430
|
+
"server.message.filesLabel": "Files",
|
|
1431
|
+
"server.message.diffSummaryLabel": "差分サマリ:",
|
|
1432
|
+
"server.message.autoPilotTrustedReadApproved": "Auto Pilot がこの Trusted Read コマンドを自動承認しました。",
|
|
1433
|
+
"server.message.autoPilotTrustedReadSummary": "Auto Pilot が Trusted Read コマンドを自動承認しました。",
|
|
1434
|
+
"server.message.autoPilotTrustedReadReason": "viveworker Auto Pilot が Trusted Read ポリシーに一致したため自動承認しました。",
|
|
1435
|
+
"server.message.autoPilotTrustedWriteApproved": "承認の自動化がこの低リスクなファイル変更を自動承認しました。",
|
|
1436
|
+
"server.message.autoPilotTrustedWriteSummary": "承認の自動化が低リスクなファイル変更を自動承認しました。",
|
|
1437
|
+
"server.message.autoPilotTrustedWriteReason": "viveworker が現在のワークスペース向け低リスク書き込みポリシーに一致したため自動承認しました。",
|
|
1324
1438
|
"server.message.fileApprovalNeeded": "ファイル変更の承認が必要です。",
|
|
1325
1439
|
"server.message.commandPrefix": ({ command }) => `Command: ${command}`,
|
|
1326
1440
|
"server.message.pathPrefix": ({ path }) => `Path: ${path}`,
|
package/web/sw.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const CACHE_NAME = "viveworker-
|
|
1
|
+
const CACHE_NAME = "viveworker-v32";
|
|
2
2
|
const NOTIFICATION_INTENT_CACHE = "viveworker-notification-intent-v1";
|
|
3
3
|
const NOTIFICATION_INTENT_PATH = "/__viveworker_notification_intent__";
|
|
4
4
|
const APP_ASSETS = ["/app.css", "/app.js", "/i18n.js"];
|
|
@@ -44,12 +44,12 @@ self.addEventListener("fetch", (event) => {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (APP_ROUTES.has(url.pathname)) {
|
|
47
|
-
event.respondWith(
|
|
47
|
+
event.respondWith(staleWhileRevalidate(event, "/app"));
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
if (CACHED_PATHS.has(url.pathname)) {
|
|
52
|
-
event.respondWith(
|
|
52
|
+
event.respondWith(staleWhileRevalidate(event, url.pathname));
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
|
|
@@ -182,19 +182,37 @@ async function notifyClients(type) {
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
// Cache-first with background revalidation. Flips the previous networkFirst
|
|
186
|
+
// strategy: instead of blocking first paint on a fresh fetch of the ~450KB
|
|
187
|
+
// app shell (HTML + app.js + app.css + i18n.js) every launch, we serve the
|
|
188
|
+
// cached copy immediately and refresh it in the background for the next
|
|
189
|
+
// visit. Updates still land quickly because the SW itself is served fresh
|
|
190
|
+
// from the bridge (`/sw.js` is excluded from this handler above), and a new
|
|
191
|
+
// SW's `install` event pre-populates the cache with the latest assets
|
|
192
|
+
// before `activate`/`clients.claim()` triggers a reload in page script.
|
|
193
|
+
async function staleWhileRevalidate(event, cacheKey) {
|
|
186
194
|
const cache = await caches.open(CACHE_NAME);
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
195
|
+
const cached = await cache.match(cacheKey);
|
|
196
|
+
|
|
197
|
+
const networkPromise = fetch(event.request, { cache: "no-store" })
|
|
198
|
+
.then(async (response) => {
|
|
199
|
+
if (response && response.ok) {
|
|
200
|
+
await cache.put(cacheKey, response.clone());
|
|
201
|
+
}
|
|
202
|
+
return response;
|
|
203
|
+
})
|
|
204
|
+
.catch(() => null);
|
|
205
|
+
|
|
206
|
+
if (cached) {
|
|
207
|
+
// Keep the SW alive long enough to persist the background refresh even
|
|
208
|
+
// if the page navigates away right after first paint.
|
|
209
|
+
event.waitUntil(networkPromise);
|
|
210
|
+
return cached;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const response = await networkPromise;
|
|
214
|
+
if (response) {
|
|
192
215
|
return response;
|
|
193
|
-
} catch {
|
|
194
|
-
const cached = await cache.match(cacheKey);
|
|
195
|
-
if (cached) {
|
|
196
|
-
return cached;
|
|
197
|
-
}
|
|
198
|
-
return Response.error();
|
|
199
216
|
}
|
|
217
|
+
return Response.error();
|
|
200
218
|
}
|