harness-wingman 0.9.3 → 0.9.5
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/apps/cli/dist/main.js +540 -151
- package/apps/panel/dist/assets/index-A5vhRwQl.js +346 -0
- package/apps/panel/dist/assets/index-C6Jlk1OC.css +1 -0
- package/apps/panel/dist/index.html +2 -2
- package/package.json +2 -2
- package/apps/panel/dist/assets/index-CmiVDhjE.css +0 -1
- package/apps/panel/dist/assets/index-Dct9L9-w.js +0 -344
package/apps/cli/dist/main.js
CHANGED
|
@@ -224,7 +224,7 @@ var init_cli = __esm({
|
|
|
224
224
|
"cli.adapterFactoryMissing": "adapter-{harness} does not export createAdapter (M1 parallel work not merged?)",
|
|
225
225
|
"cli.adapterFeedbackMissing": "adapter-{harness} does not export feedbackSignals",
|
|
226
226
|
"cli.fixturesUnavailable": "--fixtures requires packages/fixtures data from the repository; release packages and npx distributions do not include samples",
|
|
227
|
-
"cli.help": "wingman \u2014 Not your copilot. Your wingman.\n\nUsage:\n wingman [--locale <tag>] <command> Interface language (e.g. zh, en)\n wingman scan --harness <cc|codex|dsh> [--json] Scan a harness and print UnifiedConfig\n wingman serve [--port 7333] [--fixtures] Start the local panel (127.0.0.1 only)\n [--panel-dist <dir>] Panel files (default: apps/panel/dist)\n wingman hook install <harness> [--port 7333] Install live hooks (backup first, idempotent)\n [--profile <p>] dsh: process only this profile\n wingman hook uninstall <harness> [--profile <p>] Remove hooks and restore configuration\n wingman protocol install|uninstall|status <harness> Manage user / project Plan protocol\n [--project <dir> | --user] [--dry-run] [--yes]\n wingman license status Show
|
|
227
|
+
"cli.help": "wingman \u2014 Not your copilot. Your wingman.\n\nUsage:\n wingman [--locale <tag>] <command> Interface language (e.g. zh, en)\n wingman scan --harness <cc|codex|dsh> [--json] Scan a harness and print UnifiedConfig\n wingman serve [--port 7333] [--fixtures] Start the local panel (127.0.0.1 only)\n [--panel-dist <dir>] Panel files (default: apps/panel/dist)\n wingman hook install <harness> [--port 7333] Install live hooks (backup first, idempotent)\n [--profile <p>] dsh: process only this profile\n wingman hook uninstall <harness> [--profile <p>] Remove hooks and restore configuration\n wingman protocol install|uninstall|status <harness> Manage user / project Plan protocol\n [--project <dir> | --user] [--dry-run] [--yes]\n wingman license status Show license status\n wingman license refresh Renew the license online\n wingman --version | -v | version Show version\n wingman help Show this help\n",
|
|
228
228
|
"cli.licenseUsage": "License usage: wingman license status|refresh",
|
|
229
229
|
"cli.unknownCommand": "Unknown command: {command}",
|
|
230
230
|
"cli.scanNotDetected": "wingman: {harness} was not detected; nothing to scan.\n",
|
|
@@ -278,19 +278,19 @@ var init_cli = __esm({
|
|
|
278
278
|
"cli.protocolFixtures": "protocol does not support --fixtures",
|
|
279
279
|
"cli.protocolTruncation": "Warning: Codex may truncate this block; AGENTS.md is near or above the default 32 KiB project_doc_max_bytes after installation.\n",
|
|
280
280
|
"cli.confirmWrite": "Confirm write? [y/N] ",
|
|
281
|
-
"cli.licenseMissing": "No license installed
|
|
282
|
-
"cli.licenseDevelopment": "Development build: no embedded public key;
|
|
281
|
+
"cli.licenseMissing": "No license installed; the free tier shows one tool. A trial or subscription unlocks all three tools, the project overview and config toggles.",
|
|
282
|
+
"cli.licenseDevelopment": "Development build: no embedded public key; all features are available",
|
|
283
283
|
"cli.licenseJson": "The license file is not valid JSON",
|
|
284
284
|
"cli.licenseFields": "The license file is missing token/signature fields",
|
|
285
285
|
"cli.licenseSignature": "License signature verification failed (modified content or issued for another product)",
|
|
286
286
|
"cli.licenseClaimsFields": "License payload fields are incomplete",
|
|
287
287
|
"cli.licenseClaimsDecode": "The license payload could not be decoded",
|
|
288
288
|
"cli.licenseValidUntil": "{plan} valid until {exp}",
|
|
289
|
-
"cli.trialExpired": "Your trial expired on {exp};
|
|
289
|
+
"cli.trialExpired": "Your trial expired on {exp}; the free tier shows one tool. A trial or subscription unlocks all three tools, the project overview and config toggles.",
|
|
290
290
|
"cli.licenseGrace": "Your subscription expired on {exp} and is within the {days}-day offline grace period (connect to renew)",
|
|
291
|
-
"cli.subscriptionExpired": "Your subscription expired on {exp} and its grace period has ended;
|
|
291
|
+
"cli.subscriptionExpired": "Your subscription expired on {exp} and its grace period has ended; the free tier shows one tool. A trial or subscription unlocks all three tools, the project overview and config toggles.",
|
|
292
292
|
"cli.licenseWriteFailed": "Could not write {path}: {message}",
|
|
293
|
-
"cli.refreshMissing": "Could not find {path}.
|
|
293
|
+
"cli.refreshMissing": "Could not find {path}. Import a trial or subscription license.json first.",
|
|
294
294
|
"cli.refreshNetwork": "Could not connect. Try again later; your current license is unchanged",
|
|
295
295
|
"cli.refreshHttp": "The license server returned HTTP {status}",
|
|
296
296
|
"cli.refreshRejected": "Renewal rejected: {detail}",
|
|
@@ -553,6 +553,7 @@ var init_panel = __esm({
|
|
|
553
553
|
"panel.live.disconnectedReconnectingAutomatically": "Disconnected \xB7 Reconnecting automatically",
|
|
554
554
|
"panel.live.connecting": "Connecting\u2026",
|
|
555
555
|
"panel.taskboard.waitingForYou": "Waiting for you",
|
|
556
|
+
"panel.taskboard.turnEnded": "Turn ended",
|
|
556
557
|
"panel.taskboard.ended": "Ended",
|
|
557
558
|
"panel.taskboard.inProgress": "In progress",
|
|
558
559
|
"panel.taskboard.dshHasNoObservedCommandTo": "dsh has no observed command to resume a specific session; continue in the original terminal",
|
|
@@ -618,6 +619,14 @@ var init_render = __esm({
|
|
|
618
619
|
"packages/i18n/dist/catalog/en/render.js"() {
|
|
619
620
|
"use strict";
|
|
620
621
|
render_default = {
|
|
622
|
+
"panel.render.originExec": "Codex CLI \xB7 exec",
|
|
623
|
+
"panel.render.originCli": "Codex CLI",
|
|
624
|
+
"panel.render.originDesktop": "Codex Desktop",
|
|
625
|
+
"panel.render.originSource": "Source: session_meta.originator / source",
|
|
626
|
+
"panel.render.chipNoInstruction": "No instruction yet \xB7 {p0}",
|
|
627
|
+
"panel.render.chipDirectory": "Directory: {p0}",
|
|
628
|
+
"panel.render.chipTitleSource": "Title source: {p0}",
|
|
629
|
+
"panel.render.chipTurnEnded": "Turn ended (no events or transcript activity since Stop)",
|
|
621
630
|
"panel.render.projectsPageTitle": "Project overview",
|
|
622
631
|
"panel.render.projectsPageHint": "Goals, progress and decisions across your coding apps.",
|
|
623
632
|
"panel.render.controlsPageHint": "Manage tools, preferences and how you return to a session.",
|
|
@@ -746,9 +755,6 @@ var init_render = __esm({
|
|
|
746
755
|
"panel.render.sourceClickToExpandThePanel": "{p0} \xB7 {p1}{p2}\nSource: {p3}; click to expand the panel",
|
|
747
756
|
"panel.render.compactPillSource": "{p0} \xB7 {p1}{p2}\nSource: {p3}",
|
|
748
757
|
"panel.render.project": "Project",
|
|
749
|
-
"panel.render.inTheLiveStream": "In the live stream",
|
|
750
|
-
"panel.render.events": "events",
|
|
751
|
-
"panel.render.entries": "entries",
|
|
752
758
|
"panel.render.residentTok": "Resident {p0} tok",
|
|
753
759
|
"panel.render.residentTotal": "Resident total",
|
|
754
760
|
"panel.render.totalResidentTokensOfEnabledItems": "Total = resident tokens of enabled items across all slots; ",
|
|
@@ -821,17 +827,21 @@ var init_render = __esm({
|
|
|
821
827
|
"panel.render.commonCausesFilesChangedAfterPlanning": "Common causes: files changed after planning (close and reopen the toggle to plan again), itemId is missing, or the target format is unknown and cannot be safely written.",
|
|
822
828
|
"panel.render.closeDialog": "Close dialog",
|
|
823
829
|
"panel.render.dayFreeTrialUntil": "30-day free trial until {p0}",
|
|
830
|
+
"panel.render.dayFreeTrialEnding": "30-day free trial until {p0} \xB7 then the free tier (one tool)",
|
|
831
|
+
"panel.render.freeTierOneHarness": "The free tier shows one tool",
|
|
832
|
+
"panel.render.freeTierHarness": "Free tier tool",
|
|
833
|
+
"panel.render.freeTierLock": "The free tier shows one tool; a trial or subscription shows them all.",
|
|
824
834
|
"panel.render.dayFreeTrialActive": "30-day free trial active",
|
|
825
|
-
"panel.render.freeTrialEndedRefreshOrSubscribe": "Free trial ended \xB7 refresh or subscribe",
|
|
835
|
+
"panel.render.freeTrialEndedRefreshOrSubscribe": "Free trial ended \xB7 the free tier shows one tool \xB7 refresh or subscribe",
|
|
826
836
|
"panel.render.subscriptionExpiredInGracePeriodRenew": "Subscription expired, in grace period \xB7 renew",
|
|
827
|
-
"panel.render.
|
|
837
|
+
"panel.render.subscriptionExpiredFreeTier": "Subscription expired \xB7 the free tier shows one tool \xB7 refresh or subscribe",
|
|
828
838
|
"panel.render.importLicenseJsonFromTheActivation": "Import license.json from the activation page (writes ~/.wingman/license.json and backs up the old file), or drag the file into this panel",
|
|
829
839
|
"panel.render.importLicense": "Import license",
|
|
830
840
|
"panel.render.cancelSubscriptionsOrChangePaymentMethods": "Cancel subscriptions or change payment methods through Stripe using the links in emails sent to your subscription address.",
|
|
831
841
|
"panel.render.manageSubscriptionCancelPaymentMethodInvoices": "Manage subscription (cancel / payment method / invoices)",
|
|
832
842
|
"panel.render.refreshLicense": "Refresh license",
|
|
833
843
|
"panel.render.afterPaymentOrWhileYourSubscription": "After payment, or while your subscription is active, refresh to restore the latest status. Only this button contacts the license service.",
|
|
834
|
-
"panel.render.keepUsingWriteFeatures": "
|
|
844
|
+
"panel.render.keepUsingWriteFeatures": "Unlock all three tools, the project overview and config toggles",
|
|
835
845
|
"panel.render.subscribeToWingman": "Subscribe to Wingman",
|
|
836
846
|
"panel.render.refreshing": "Refreshing\u2026",
|
|
837
847
|
"panel.render.freeTrial": "Free trial",
|
|
@@ -881,11 +891,12 @@ var init_render = __esm({
|
|
|
881
891
|
"panel.render.endedSessionEndOrNoEventsFor": "Ended (SessionEnd, or no events for 10 minutes after Stop)",
|
|
882
892
|
"panel.render.inProgress": "In progress",
|
|
883
893
|
"panel.render.waitingForYouAnOpenPermission": "Waiting for you: an open permission request or notification",
|
|
894
|
+
"panel.render.discoveredOnStartup": "Registered by the startup scan; no hook events yet",
|
|
884
895
|
"panel.render.newActivitySinceLastViewed": "New activity since last viewed",
|
|
885
|
-
"panel.render.newActivity": "New activity",
|
|
886
896
|
"panel.render.sinceWingmanStarted": "Since Wingman started (",
|
|
887
897
|
"panel.render.noHookEventsReceivedFrom": "), no hook events received from",
|
|
888
|
-
"panel.render.sessionsAreCreatedFromEventsOnly": ";
|
|
898
|
+
"panel.render.sessionsAreCreatedFromEventsOnly": "; startup only registers session transcripts updated in the last 30 minutes; older sessions are not restored.",
|
|
899
|
+
"panel.render.sessionsAreCreatedFromEventsOnlyDsh": "; sessions are created from events only, and history is not restored after restart.",
|
|
889
900
|
"panel.render.legacyHomeLevelWiringCouldNot": "Legacy home-level wiring could not be removed automatically; disconnect manually, then reconnect: ",
|
|
890
901
|
"panel.render.legacyHomeLevelWiringAndEarlier": "Legacy home-level wiring (0.6.0 and earlier) was removed to prevent dsh startup failures; reconnect: ",
|
|
891
902
|
"panel.render.evicted": "Evicted",
|
|
@@ -1176,12 +1187,17 @@ var init_render = __esm({
|
|
|
1176
1187
|
"panel.render.branchCurrentPointsSource": "Source: currentPoints within this top-level node subtree",
|
|
1177
1188
|
"panel.render.noCurrentBranchProvided": "No current branch provided",
|
|
1178
1189
|
"panel.render.currentTaskLabel": "Current task",
|
|
1190
|
+
"panel.render.morePoints": "{count} more items",
|
|
1191
|
+
"panel.render.oneMorePoint": "{count} more item",
|
|
1179
1192
|
"panel.render.sourceFirstScreenCurrentPointsLength": "Source: firstScreen.currentPoints.length",
|
|
1180
1193
|
"panel.render.parallel": "Parallel",
|
|
1181
1194
|
"panel.render.thePlanHasNoStepMarked": "The plan has no step marked in progress",
|
|
1182
1195
|
"panel.render.recentActivityLabel": "Recent activity",
|
|
1183
1196
|
"panel.render.thePlanHasNoSteps": "The plan has no steps",
|
|
1184
1197
|
"panel.render.planTree": "Plan tree",
|
|
1198
|
+
"panel.render.fullRecord": "Full record",
|
|
1199
|
+
"panel.render.completedMilestones": "{count} completed \xB7 Latest: {name}",
|
|
1200
|
+
"panel.render.completedMilestonesSource": "Source: completed or cancelled top-level plan.nodes; latest in document order",
|
|
1185
1201
|
"panel.render.sessionsNotLinkedToAStep": "Sessions not linked to a step",
|
|
1186
1202
|
"panel.render.sourcePlanLastGood": "Source: plan.lastGood",
|
|
1187
1203
|
"panel.render.lastReadableVersion": "Last readable version",
|
|
@@ -1206,6 +1222,7 @@ var init_render = __esm({
|
|
|
1206
1222
|
"panel.render.sourceRevisionMtimeLastWriter": "Source: revision / mtime / lastWriter",
|
|
1207
1223
|
"panel.render.all": "All",
|
|
1208
1224
|
"panel.render.waitingForYouLabel": "Waiting for you",
|
|
1225
|
+
"panel.render.turnEnded": "Turn ended",
|
|
1209
1226
|
"panel.render.ended": "Ended",
|
|
1210
1227
|
"panel.render.status": "Status",
|
|
1211
1228
|
"panel.render.dataTipSourceGETApiProjects": ' data-tip="Source: GET /api/projects request and payload validation"',
|
|
@@ -1239,7 +1256,7 @@ var init_server = __esm({
|
|
|
1239
1256
|
"cli.server.harnessRequired": "harness must be {ids}, received {harness}",
|
|
1240
1257
|
"cli.server.actionShape": 'action must have the shape {kind:"toggle", itemId, enable}',
|
|
1241
1258
|
"cli.server.fixturesAction": "Fixtures mode is read-only: actions stop at the plan and no files are written",
|
|
1242
|
-
"cli.server.subscriptionRequired": "
|
|
1259
|
+
"cli.server.subscriptionRequired": "A trial or active subscription is required to write configuration changes (the free tier shows one tool).",
|
|
1243
1260
|
"cli.server.planShape": "plan must be an ActionPlan object (returned by /api/action/plan)",
|
|
1244
1261
|
"cli.server.fixturesProtocol": "Fixtures mode is read-only: no preview or writing of the user-level protocol",
|
|
1245
1262
|
"cli.server.dshUserUnsupported": "unsupported: dsh has no user-level instruction file; install the plan protocol per project",
|
|
@@ -1261,7 +1278,8 @@ var init_server = __esm({
|
|
|
1261
1278
|
"cli.server.settingsFormat": "Cannot parse return settings or unknown version; refusing to overwrite. Check settings.json",
|
|
1262
1279
|
"cli.server.settingsWrite": "Could not back up or write return settings; settings were not overwritten. Check settings.json",
|
|
1263
1280
|
"cli.server.localeInvalid": "locale must be a registered language tag",
|
|
1264
|
-
"cli.server.settingsInvalid": "Settings require a registered locale
|
|
1281
|
+
"cli.server.settingsInvalid": "Settings require a registered locale, a valid island position and size, or a known freeHarness",
|
|
1282
|
+
"cli.server.freeHarnessNotDetected": "This tool has not been detected and cannot be selected for the free tier.",
|
|
1265
1283
|
"cli.server.fixturesSettings": "Fixtures mode is read-only: language settings are not saved",
|
|
1266
1284
|
"cli.server.settingsHome": "Language settings require homeDir"
|
|
1267
1285
|
};
|
|
@@ -1493,7 +1511,7 @@ var init_cli2 = __esm({
|
|
|
1493
1511
|
"cli.adapterFactoryMissing": "adapter-{harness} \u5C1A\u672A\u5BFC\u51FA createAdapter(M1 \u5E76\u884C\u7EBF\u672A\u5408\u5E76?)",
|
|
1494
1512
|
"cli.adapterFeedbackMissing": "adapter-{harness} \u5C1A\u672A\u5BFC\u51FA feedbackSignals",
|
|
1495
1513
|
"cli.fixturesUnavailable": "--fixtures \u9700\u8981\u4ED3\u5E93\u5185\u7684 packages/fixtures \u6570\u636E;\u53D1\u5E03\u5B89\u88C5\u5305/npx \u4EA7\u7269\u4E0D\u5305\u542B\u6837\u4F8B",
|
|
1496
|
-
"cli.help": "wingman \u2014 Not your copilot. Your wingman.\n\n\u7528\u6CD5:\n wingman [--locale <tag>] <command> \u754C\u9762\u8BED\u8A00(\u5982 zh\u3001en)\n wingman scan --harness <cc|codex|dsh> [--json] \u626B\u63CF\u4E00\u4E2A harness,\u8F93\u51FA UnifiedConfig\n wingman serve [--port 7333] [--fixtures] \u542F\u52A8\u672C\u5730\u9762\u677F(\u53EA\u7ED1 127.0.0.1)\n [--panel-dist <dir>] \u9762\u677F\u9759\u6001\u4EA7\u7269\u76EE\u5F55(\u9ED8\u8BA4\u4ED3\u5E93\u5E03\u5C40 apps/panel/dist)\n wingman hook install <harness> [--port 7333] \u5B9E\u51B5\u63A5\u7EBF(\u5199\u524D\u5907\u4EFD,\u5E42\u7B49)\n [--profile <p>] dsh:\u53EA\u5904\u7406\u6307\u5B9A profile\n wingman hook uninstall <harness> [--profile <p>] \u89E3\u7EBF(\u914D\u7F6E\u6062\u590D,\u5E42\u7B49)\n wingman protocol install|uninstall|status <harness> \u7BA1\u7406\u7528\u6237\u7EA7 / \u9879\u76EE\u7EA7 Plan Protocol\n [--project <dir> | --user] [--dry-run] [--yes]\n wingman license status \u67E5\u770B\
|
|
1514
|
+
"cli.help": "wingman \u2014 Not your copilot. Your wingman.\n\n\u7528\u6CD5:\n wingman [--locale <tag>] <command> \u754C\u9762\u8BED\u8A00(\u5982 zh\u3001en)\n wingman scan --harness <cc|codex|dsh> [--json] \u626B\u63CF\u4E00\u4E2A harness,\u8F93\u51FA UnifiedConfig\n wingman serve [--port 7333] [--fixtures] \u542F\u52A8\u672C\u5730\u9762\u677F(\u53EA\u7ED1 127.0.0.1)\n [--panel-dist <dir>] \u9762\u677F\u9759\u6001\u4EA7\u7269\u76EE\u5F55(\u9ED8\u8BA4\u4ED3\u5E93\u5E03\u5C40 apps/panel/dist)\n wingman hook install <harness> [--port 7333] \u5B9E\u51B5\u63A5\u7EBF(\u5199\u524D\u5907\u4EFD,\u5E42\u7B49)\n [--profile <p>] dsh:\u53EA\u5904\u7406\u6307\u5B9A profile\n wingman hook uninstall <harness> [--profile <p>] \u89E3\u7EBF(\u914D\u7F6E\u6062\u590D,\u5E42\u7B49)\n wingman protocol install|uninstall|status <harness> \u7BA1\u7406\u7528\u6237\u7EA7 / \u9879\u76EE\u7EA7 Plan Protocol\n [--project <dir> | --user] [--dry-run] [--yes]\n wingman license status \u67E5\u770B\u6388\u6743\u72B6\u6001\n wingman license refresh \u8054\u7F51\u5411\u7B7E\u53D1\u7AEF\u6362\u65B0 license(\u7EED\u671F)\n wingman --version | -v | version \u663E\u793A\u7248\u672C\n wingman help \u663E\u793A\u672C\u5E2E\u52A9\n",
|
|
1497
1515
|
"cli.licenseUsage": "license \u7528\u6CD5:wingman license status|refresh",
|
|
1498
1516
|
"cli.unknownCommand": "\u672A\u77E5\u547D\u4EE4:{command}",
|
|
1499
1517
|
"cli.scanNotDetected": "wingman:\u672A\u68C0\u6D4B\u5230 {harness},\u65E0\u4ECE\u626B\u63CF\u3002\n",
|
|
@@ -1547,19 +1565,19 @@ var init_cli2 = __esm({
|
|
|
1547
1565
|
"cli.protocolFixtures": "protocol \u4E0D\u652F\u6301 --fixtures",
|
|
1548
1566
|
"cli.protocolTruncation": "\u8B66\u544A:Codex \u53EF\u80FD\u622A\u65AD\u672C\u5757\uFF1BAGENTS.md \u88C5\u540E\u5DF2\u63A5\u8FD1\u6216\u8D85\u8FC7\u9ED8\u8BA4 32 KiB project_doc_max_bytes\u3002\n",
|
|
1549
1567
|
"cli.confirmWrite": "\u786E\u8BA4\u5199\u5165? [y/N] ",
|
|
1550
|
-
"cli.licenseMissing": "\u672A\u5B89\u88C5 license
|
|
1551
|
-
"cli.licenseDevelopment": "\u5F00\u53D1\u6784\u5EFA:\u672A\u5D4C\u5165\u516C\u94A5,\
|
|
1568
|
+
"cli.licenseMissing": "\u672A\u5B89\u88C5 license\uFF1B\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177\u3002\u8BD5\u7528\u6216\u8BA2\u9605\u53EF\u67E5\u770B\u5168\u90E8\u5DE5\u5177\u4E0E\u9879\u76EE\u603B\u89C8\uFF0C\u5E76\u4F7F\u7528\u914D\u7F6E\u5F00\u5173\u3002",
|
|
1569
|
+
"cli.licenseDevelopment": "\u5F00\u53D1\u6784\u5EFA:\u672A\u5D4C\u5165\u516C\u94A5,\u5168\u90E8\u529F\u80FD\u53EF\u7528",
|
|
1552
1570
|
"cli.licenseJson": "license \u6587\u4EF6\u4E0D\u662F\u5408\u6CD5 JSON",
|
|
1553
1571
|
"cli.licenseFields": "license \u6587\u4EF6\u7F3A token/signature \u5B57\u6BB5",
|
|
1554
1572
|
"cli.licenseSignature": "license \u9A8C\u7B7E\u5931\u8D25(\u5185\u5BB9\u88AB\u6539\u52A8\u6216\u975E\u672C\u4EA7\u54C1\u7B7E\u53D1)",
|
|
1555
1573
|
"cli.licenseClaimsFields": "license \u8F7D\u8377\u5B57\u6BB5\u4E0D\u5B8C\u6574",
|
|
1556
1574
|
"cli.licenseClaimsDecode": "license \u8F7D\u8377\u65E0\u6CD5\u89E3\u7801",
|
|
1557
1575
|
"cli.licenseValidUntil": "{plan}\u6709\u6548\u81F3 {exp}",
|
|
1558
|
-
"cli.trialExpired": "\u8BD5\u7528\u5DF2\u4E8E {exp} \u5230\u671F
|
|
1576
|
+
"cli.trialExpired": "\u8BD5\u7528\u5DF2\u4E8E {exp} \u5230\u671F\uFF1B\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177\u3002\u8BD5\u7528\u6216\u8BA2\u9605\u53EF\u67E5\u770B\u5168\u90E8\u5DE5\u5177\u4E0E\u9879\u76EE\u603B\u89C8\uFF0C\u5E76\u4F7F\u7528\u914D\u7F6E\u5F00\u5173\u3002",
|
|
1559
1577
|
"cli.licenseGrace": "\u8BA2\u9605\u5DF2\u4E8E {exp} \u5230\u671F,\u5904\u4E8E {days} \u5929\u79BB\u7EBF\u5BBD\u9650\u671F(\u8BF7\u8054\u7F51\u7EED\u671F)",
|
|
1560
|
-
"cli.subscriptionExpired": "\u8BA2\u9605\u5DF2\u4E8E {exp} \u5230\u671F\u4E14\u8D85\u51FA\u5BBD\u9650\u671F
|
|
1578
|
+
"cli.subscriptionExpired": "\u8BA2\u9605\u5DF2\u4E8E {exp} \u5230\u671F\u4E14\u8D85\u51FA\u5BBD\u9650\u671F\uFF1B\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177\u3002\u8BD5\u7528\u6216\u8BA2\u9605\u53EF\u67E5\u770B\u5168\u90E8\u5DE5\u5177\u4E0E\u9879\u76EE\u603B\u89C8\uFF0C\u5E76\u4F7F\u7528\u914D\u7F6E\u5F00\u5173\u3002",
|
|
1561
1579
|
"cli.licenseWriteFailed": "\u5199\u5165 {path} \u5931\u8D25:{message}",
|
|
1562
|
-
"cli.refreshMissing": "\u672A\u627E\u5230 {path}\
|
|
1580
|
+
"cli.refreshMissing": "\u672A\u627E\u5230 {path}\uFF1B\u8BF7\u5148\u5BFC\u5165\u8BD5\u7528\u6216\u8BA2\u9605\u7684 license.json\u3002",
|
|
1563
1581
|
"cli.refreshNetwork": "\u8054\u7F51\u5931\u8D25,\u7A0D\u540E\u518D\u8BD5;\u5F53\u524D\u6388\u6743\u72B6\u6001\u4FDD\u6301\u4E0D\u53D8",
|
|
1564
1582
|
"cli.refreshHttp": "\u7B7E\u53D1\u7AEF\u8FD4\u56DE HTTP {status}",
|
|
1565
1583
|
"cli.refreshRejected": "\u7EED\u671F\u88AB\u62D2:{detail}",
|
|
@@ -1822,6 +1840,7 @@ var init_panel2 = __esm({
|
|
|
1822
1840
|
"panel.live.disconnectedReconnectingAutomatically": "\u8FDE\u63A5\u65AD\u5F00 \xB7 \u81EA\u52A8\u91CD\u8FDE\u4E2D",
|
|
1823
1841
|
"panel.live.connecting": "\u8FDE\u63A5\u4E2D\u2026",
|
|
1824
1842
|
"panel.taskboard.waitingForYou": "\u7B49\u5F85",
|
|
1843
|
+
"panel.taskboard.turnEnded": "\u56DE\u5408\u7ED3\u675F",
|
|
1825
1844
|
"panel.taskboard.ended": "\u5DF2\u7ED3\u675F",
|
|
1826
1845
|
"panel.taskboard.inProgress": "\u8FDB\u884C\u4E2D",
|
|
1827
1846
|
"panel.taskboard.dshHasNoObservedCommandTo": "dsh \u672A\u63D0\u4F9B\u6309\u4F1A\u8BDD\u6062\u590D\u7684\u547D\u4EE4(\u672A\u89C2\u5BDF\u5230),\u8BF7\u5728\u539F\u7EC8\u7AEF\u7EE7\u7EED",
|
|
@@ -1887,6 +1906,14 @@ var init_render2 = __esm({
|
|
|
1887
1906
|
"packages/i18n/dist/catalog/zh/render.js"() {
|
|
1888
1907
|
"use strict";
|
|
1889
1908
|
render_default2 = {
|
|
1909
|
+
"panel.render.originExec": "Codex CLI \xB7 exec",
|
|
1910
|
+
"panel.render.originCli": "Codex CLI",
|
|
1911
|
+
"panel.render.originDesktop": "Codex \u684C\u9762\u7248",
|
|
1912
|
+
"panel.render.originSource": "\u6765\u6E90:session_meta.originator / source",
|
|
1913
|
+
"panel.render.chipNoInstruction": "\u5C1A\u65E0\u6307\u4EE4 \xB7 {p0}",
|
|
1914
|
+
"panel.render.chipDirectory": "\u76EE\u5F55:{p0}",
|
|
1915
|
+
"panel.render.chipTitleSource": "\u6807\u9898\u6765\u6E90:{p0}",
|
|
1916
|
+
"panel.render.chipTurnEnded": "\u56DE\u5408\u7ED3\u675F(Stop \u540E\u65E0\u65B0\u4E8B\u4EF6\u6216\u8BB0\u5F55\u6D3B\u52A8)",
|
|
1890
1917
|
"panel.render.projectsPageTitle": "\u9879\u76EE\u603B\u89C8",
|
|
1891
1918
|
"panel.render.projectsPageHint": "\u96C6\u4E2D\u67E5\u770B\u5404\u4E2A\u7F16\u7A0B\u5DE5\u5177\u4E2D\u7684\u76EE\u6807\u3001\u8FDB\u5EA6\u548C\u5F85\u51B3\u4E8B\u9879\u3002",
|
|
1892
1919
|
"panel.render.controlsPageHint": "\u7BA1\u7406\u5DE5\u5177\u3001\u504F\u597D\u8BBE\u7F6E\uFF0C\u4EE5\u53CA\u8FD4\u56DE\u4F1A\u8BDD\u7684\u65B9\u5F0F\u3002",
|
|
@@ -2015,9 +2042,6 @@ var init_render2 = __esm({
|
|
|
2015
2042
|
"panel.render.sourceClickToExpandThePanel": "{p0} \xB7 {p1}{p2}\n\u6765\u6E90:{p3};\u70B9\u51FB\u5C55\u5F00\u9762\u677F",
|
|
2016
2043
|
"panel.render.compactPillSource": "{p0} \xB7 {p1}{p2}\n\u6765\u6E90:{p3}",
|
|
2017
2044
|
"panel.render.project": "\u9879\u76EE",
|
|
2018
|
-
"panel.render.inTheLiveStream": "\u5B9E\u51B5\u6D41\u5185",
|
|
2019
|
-
"panel.render.events": "\u4E8B\u4EF6",
|
|
2020
|
-
"panel.render.entries": "\u6761",
|
|
2021
2045
|
"panel.render.residentTok": "\u5E38\u9A7B {p0} tok",
|
|
2022
2046
|
"panel.render.residentTotal": "\u5E38\u9A7B\u5408\u8BA1",
|
|
2023
2047
|
"panel.render.totalResidentTokensOfEnabledItems": "\u5408\u8BA1 = \u5404\u69FD\u4F4D\u542F\u7528\u6761\u76EE\u7684\u5E38\u9A7B token \u4E4B\u548C;",
|
|
@@ -2090,17 +2114,21 @@ var init_render2 = __esm({
|
|
|
2090
2114
|
"panel.render.commonCausesFilesChangedAfterPlanning": "\u5E38\u89C1\u539F\u56E0:\u6587\u4EF6\u5728 plan \u4E4B\u540E\u88AB\u5916\u90E8\u6539\u8FC7(\u5173\u95ED\u540E\u91CD\u65B0\u70B9\u5F00\u5173\u751F\u6210\u65B0 plan)\u3001itemId \u4E0D\u5B58\u5728\u3001\u6216\u76EE\u6807\u683C\u5F0F\u672A\u77E5\u88AB\u62D2\u5199(\u4E0D\u731C,\u5982\u5B9E\u62D2\u7EDD)\u3002",
|
|
2091
2115
|
"panel.render.closeDialog": "\u5173\u95ED\u5F39\u7A97",
|
|
2092
2116
|
"panel.render.dayFreeTrialUntil": "30 \u5929\u514D\u8D39\u8BD5\u7528\u81F3 {p0}",
|
|
2117
|
+
"panel.render.dayFreeTrialEnding": "30 \u5929\u514D\u8D39\u8BD5\u7528\u81F3 {p0} \xB7 \u5230\u671F\u540E\u8F6C\u4E3A\u514D\u8D39\u5C42(\u4E00\u4E2A\u5DE5\u5177)",
|
|
2118
|
+
"panel.render.freeTierOneHarness": "\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177",
|
|
2119
|
+
"panel.render.freeTierHarness": "\u514D\u8D39\u5C42\u5DE5\u5177",
|
|
2120
|
+
"panel.render.freeTierLock": "\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177;\u8BD5\u7528\u6216\u8BA2\u9605\u53EF\u770B\u5168\u90E8\u3002",
|
|
2093
2121
|
"panel.render.dayFreeTrialActive": "30 \u5929\u514D\u8D39\u8BD5\u7528\u4E2D",
|
|
2094
|
-
"panel.render.freeTrialEndedRefreshOrSubscribe": "\u514D\u8D39\u8BD5\u7528\u5DF2\u7ED3\u675F \xB7 \u5237\u65B0\u6216\u8BA2\u9605",
|
|
2122
|
+
"panel.render.freeTrialEndedRefreshOrSubscribe": "\u514D\u8D39\u8BD5\u7528\u5DF2\u7ED3\u675F \xB7 \u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177 \xB7 \u5237\u65B0\u6216\u8BA2\u9605",
|
|
2095
2123
|
"panel.render.subscriptionExpiredInGracePeriodRenew": "\u8BA2\u9605\u5DF2\u5230\u671F,\u5BBD\u9650\u671F\u5185 \xB7 \u70B9\u6B64\u7EED\u671F",
|
|
2096
|
-
"panel.render.
|
|
2124
|
+
"panel.render.subscriptionExpiredFreeTier": "\u8BA2\u9605\u5DF2\u5230\u671F \xB7 \u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177 \xB7 \u5237\u65B0\u6216\u8BA2\u9605",
|
|
2097
2125
|
"panel.render.importLicenseJsonFromTheActivation": "\u9009\u62E9\u6FC0\u6D3B\u9875\u4E0B\u8F7D\u7684 license.json \u5BFC\u5165(\u5199\u5165 ~/.wingman/license.json,\u65E7\u6587\u4EF6\u81EA\u52A8\u5907\u4EFD);\u4E5F\u53EF\u628A\u6587\u4EF6\u76F4\u63A5\u62D6\u8FDB\u672C\u9762\u677F",
|
|
2098
2126
|
"panel.render.importLicense": "\u5BFC\u5165 license",
|
|
2099
2127
|
"panel.render.cancelSubscriptionsOrChangePaymentMethods": "\u53D6\u6D88\u8BA2\u9605\u6216\u66F4\u6362\u4ED8\u6B3E\u65B9\u5F0F\u9700\u5728 Stripe \u4FA7\u64CD\u4F5C,\u5165\u53E3\u5728\u8BA2\u9605\u90AE\u7BB1\u6536\u5230\u7684 Stripe \u90AE\u4EF6\u91CC\u3002",
|
|
2100
2128
|
"panel.render.manageSubscriptionCancelPaymentMethodInvoices": "\u7BA1\u7406\u8BA2\u9605(\u53D6\u6D88/\u6362\u5361/\u53D1\u7968)",
|
|
2101
2129
|
"panel.render.refreshLicense": "\u5237\u65B0\u6388\u6743",
|
|
2102
2130
|
"panel.render.afterPaymentOrWhileYourSubscription": "\u4ED8\u6B3E\u6210\u529F\u6216\u8BA2\u9605\u4ECD\u6709\u6548\u65F6,\u70B9\u51FB\u5237\u65B0\u5373\u53EF\u6062\u590D\u6700\u65B0\u72B6\u6001\u3002\u4EC5\u6B64\u6309\u94AE\u4F1A\u8054\u7CFB\u6388\u6743\u670D\u52A1\u3002",
|
|
2103
|
-
"panel.render.keepUsingWriteFeatures": "\
|
|
2131
|
+
"panel.render.keepUsingWriteFeatures": "\u89E3\u9501\u4E09\u5BB6\u5DE5\u5177\u3001\u9879\u76EE\u603B\u89C8\u4E0E\u914D\u7F6E\u5F00\u5173",
|
|
2104
2132
|
"panel.render.subscribeToWingman": "\u8BA2\u9605 Wingman",
|
|
2105
2133
|
"panel.render.refreshing": "\u5237\u65B0\u4E2D\u2026",
|
|
2106
2134
|
"panel.render.freeTrial": "\u514D\u8D39\u8BD5\u7528",
|
|
@@ -2150,11 +2178,12 @@ var init_render2 = __esm({
|
|
|
2150
2178
|
"panel.render.endedSessionEndOrNoEventsFor": "\u5DF2\u7ED3\u675F(SessionEnd,\u6216 Stop \u540E 10 \u5206\u949F\u65E0\u4E8B\u4EF6)",
|
|
2151
2179
|
"panel.render.inProgress": "\u8FDB\u884C\u4E2D",
|
|
2152
2180
|
"panel.render.waitingForYouAnOpenPermission": "\u7B49\u5F85:\u6709\u672A\u51B3\u7684\u6743\u9650\u8BF7\u6C42/\u901A\u77E5",
|
|
2181
|
+
"panel.render.discoveredOnStartup": "\u7531\u542F\u52A8\u626B\u63CF\u767B\u8BB0,\u5C1A\u65E0 hook \u4E8B\u4EF6",
|
|
2153
2182
|
"panel.render.newActivitySinceLastViewed": "\u6709\u65B0\u6D3B\u52A8(\u4E0A\u6B21\u67E5\u770B\u540E)",
|
|
2154
|
-
"panel.render.newActivity": "\u65B0\u6D3B\u52A8",
|
|
2155
2183
|
"panel.render.sinceWingmanStarted": "Wingman \u542F\u52A8(",
|
|
2156
2184
|
"panel.render.noHookEventsReceivedFrom": ")\u540E\u5C1A\u672A\u6536\u5230",
|
|
2157
|
-
"panel.render.sessionsAreCreatedFromEventsOnly": "\u7684 hook \u4E8B\u4EF6;\
|
|
2185
|
+
"panel.render.sessionsAreCreatedFromEventsOnly": "\u7684 hook \u4E8B\u4EF6;\u542F\u52A8\u65F6\u53EA\u767B\u8BB0\u6700\u8FD1 30 \u5206\u949F\u5185\u6709\u66F4\u65B0\u7684\u4F1A\u8BDD\u8BB0\u5F55,\u66F4\u65E9\u7684\u4E0D\u6062\u590D\u3002",
|
|
2186
|
+
"panel.render.sessionsAreCreatedFromEventsOnlyDsh": "\u7684 hook \u4E8B\u4EF6;\u4F1A\u8BDD\u53EA\u7531\u4E8B\u4EF6\u5EFA\u7ACB,\u91CD\u542F\u4E0D\u6062\u590D\u5386\u53F2\u3002",
|
|
2158
2187
|
"panel.render.legacyHomeLevelWiringCouldNot": "\u65E7\u7248\u5BB6\u76EE\u5F55\u5C42\u63A5\u7EBF\u65E0\u6CD5\u81EA\u52A8\u89E3\u9664,\u8BF7\u624B\u52A8\u89E3\u7EBF\u540E\u91CD\u65B0\u63A5\u7EBF:",
|
|
2159
2188
|
"panel.render.legacyHomeLevelWiringAndEarlier": "\u65E7\u7248(0.6.0 \u53CA\u66F4\u65E9)\u5BB6\u76EE\u5F55\u5C42\u63A5\u7EBF\u5DF2\u89E3\u9664,\u907F\u514D dsh \u65E0\u6CD5\u542F\u52A8;\u91CD\u65B0\u63A5\u7EBF:",
|
|
2160
2189
|
"panel.render.evicted": "\u5DF2\u9A71\u9010",
|
|
@@ -2445,12 +2474,17 @@ var init_render2 = __esm({
|
|
|
2445
2474
|
"panel.render.branchCurrentPointsSource": "\u6765\u6E90:currentPoints \u4E2D\u5C5E\u4E8E\u8BE5\u9876\u5C42\u8282\u70B9\u5B50\u6811\u7684\u5F53\u524D\u70B9",
|
|
2446
2475
|
"panel.render.noCurrentBranchProvided": "\u5C1A\u672A\u63D0\u4F9B\u6240\u5728\u5206\u652F",
|
|
2447
2476
|
"panel.render.currentTaskLabel": "\u5F53\u524D\u4EFB\u52A1",
|
|
2477
|
+
"panel.render.morePoints": "\u8FD8\u6709 {count} \u9879",
|
|
2478
|
+
"panel.render.oneMorePoint": "\u8FD8\u6709 {count} \u9879",
|
|
2448
2479
|
"panel.render.sourceFirstScreenCurrentPointsLength": "\u6765\u6E90:firstScreen.currentPoints.length",
|
|
2449
2480
|
"panel.render.parallel": "\u5E76\u884C",
|
|
2450
2481
|
"panel.render.thePlanHasNoStepMarked": "\u8BA1\u5212\u672A\u6807\u8BB0\u8FDB\u884C\u4E2D\u6B65\u9AA4",
|
|
2451
2482
|
"panel.render.recentActivityLabel": "\u6700\u8FD1\u6D3B\u52A8",
|
|
2452
2483
|
"panel.render.thePlanHasNoSteps": "\u8BA1\u5212\u6CA1\u6709\u6B65\u9AA4",
|
|
2453
2484
|
"panel.render.planTree": "\u8BA1\u5212\u6811",
|
|
2485
|
+
"panel.render.fullRecord": "\u5B8C\u6574\u8BB0\u5F55",
|
|
2486
|
+
"panel.render.completedMilestones": "\u5DF2\u5B8C\u6210 {count} \u9879 \xB7 \u6700\u8FD1:{name}",
|
|
2487
|
+
"panel.render.completedMilestonesSource": "\u6765\u6E90:plan.nodes \u4E2D\u5DF2\u5B8C\u6210\u6216\u5DF2\u53D6\u6D88\u7684\u9876\u5C42\u8282\u70B9;\u6700\u8FD1\u9879\u6309\u6587\u6863\u987A\u5E8F",
|
|
2454
2488
|
"panel.render.sessionsNotLinkedToAStep": "\u672A\u5173\u8054\u5230\u6B65\u9AA4\u7684\u4F1A\u8BDD",
|
|
2455
2489
|
"panel.render.sourcePlanLastGood": "\u6765\u6E90:plan.lastGood",
|
|
2456
2490
|
"panel.render.lastReadableVersion": "\u4E0A\u6B21\u53EF\u89E3\u6790\u7248\u672C",
|
|
@@ -2475,6 +2509,7 @@ var init_render2 = __esm({
|
|
|
2475
2509
|
"panel.render.sourceRevisionMtimeLastWriter": "\u6765\u6E90:revision / mtime / lastWriter",
|
|
2476
2510
|
"panel.render.all": "\u5168\u90E8",
|
|
2477
2511
|
"panel.render.waitingForYouLabel": "\u7B49\u5F85",
|
|
2512
|
+
"panel.render.turnEnded": "\u56DE\u5408\u7ED3\u675F",
|
|
2478
2513
|
"panel.render.ended": "\u5DF2\u7ED3\u675F",
|
|
2479
2514
|
"panel.render.status": "\u72B6\u6001",
|
|
2480
2515
|
"panel.render.dataTipSourceGETApiProjects": ' data-tip="\u6765\u6E90:GET /api/projects \u8BF7\u6C42\u4E0E\u8F7D\u8377\u6821\u9A8C"',
|
|
@@ -2508,7 +2543,7 @@ var init_server2 = __esm({
|
|
|
2508
2543
|
"cli.server.harnessRequired": "harness \u9700\u8981 {ids},\u5F97\u5230 {harness}",
|
|
2509
2544
|
"cli.server.actionShape": 'action \u9700\u8981 {kind:"toggle", itemId, enable} \u5F62\u72B6',
|
|
2510
2545
|
"cli.server.fixturesAction": "fixtures \u6A21\u5F0F\u53EA\u8BFB:\u52A8\u4F5C\u53EA\u5230 plan \u4E3A\u6B62,\u4E0D\u5199\u4EFB\u4F55\u6587\u4EF6",
|
|
2511
|
-
"cli.server.subscriptionRequired": "\u9700\u8981\u6709\u6548\u8BA2\u9605\u624D\u80FD\
|
|
2546
|
+
"cli.server.subscriptionRequired": "\u9700\u8981\u8BD5\u7528\u6216\u6709\u6548\u8BA2\u9605\u624D\u80FD\u5199\u5165\u914D\u7F6E(\u514D\u8D39\u5C42\u53EA\u663E\u793A\u4E00\u4E2A\u5DE5\u5177)",
|
|
2512
2547
|
"cli.server.planShape": "plan \u9700\u8981 ActionPlan \u5BF9\u8C61(\u7531 /api/action/plan \u4EA7\u51FA)",
|
|
2513
2548
|
"cli.server.fixturesProtocol": "fixtures \u6A21\u5F0F\u53EA\u8BFB:\u4E0D\u9884\u89C8\u6216\u5199\u5165\u7528\u6237\u7EA7\u534F\u8BAE",
|
|
2514
2549
|
"cli.server.dshUserUnsupported": "unsupported: dsh \u65E0\u7528\u6237\u7EA7\u6307\u4EE4\u6587\u4EF6\uFF0C\u8BF7\u6309\u9879\u76EE\u5B89\u88C5\u8BA1\u5212\u534F\u8BAE",
|
|
@@ -2530,7 +2565,8 @@ var init_server2 = __esm({
|
|
|
2530
2565
|
"cli.server.settingsFormat": "\u56DE\u8DF3\u8BBE\u7F6E\u65E0\u6CD5\u89E3\u6790\u6216\u7248\u672C\u672A\u77E5,\u62D2\u7EDD\u8986\u76D6;\u8BF7\u4EBA\u5DE5\u68C0\u67E5 settings.json",
|
|
2531
2566
|
"cli.server.settingsWrite": "\u56DE\u8DF3\u8BBE\u7F6E\u5907\u4EFD\u6216\u5199\u5165\u5931\u8D25,\u672A\u8986\u76D6\u8BBE\u7F6E;\u8BF7\u4EBA\u5DE5\u68C0\u67E5 settings.json",
|
|
2532
2567
|
"cli.server.localeInvalid": "locale \u53EA\u63A5\u53D7\u5DF2\u6CE8\u518C\u8BED\u8A00\u6807\u7B7E",
|
|
2533
|
-
"cli.server.settingsInvalid": "\u8BBE\u7F6E\u53EA\u63A5\u53D7\u5DF2\u6CE8\u518C\u7684 locale
|
|
2568
|
+
"cli.server.settingsInvalid": "\u8BBE\u7F6E\u53EA\u63A5\u53D7\u5DF2\u6CE8\u518C\u7684 locale\u3001\u5408\u6CD5\u7684 island \u4F4D\u7F6E\u4E0E\u5927\u5C0F\u6216\u5DF2\u77E5\u7684 freeHarness",
|
|
2569
|
+
"cli.server.freeHarnessNotDetected": "\u5C1A\u672A\u63A2\u6D4B\u5230\u8FD9\u4E2A\u5DE5\u5177\uFF0C\u4E0D\u80FD\u8BBE\u4E3A\u514D\u8D39\u5DE5\u5177\u3002",
|
|
2534
2570
|
"cli.server.fixturesSettings": "fixtures \u6A21\u5F0F\u53EA\u8BFB:\u4E0D\u4FDD\u5B58\u8BED\u8A00\u8BBE\u7F6E",
|
|
2535
2571
|
"cli.server.settingsHome": "\u8BED\u8A00\u8BBE\u7F6E\u7F3A\u5C11 homeDir"
|
|
2536
2572
|
};
|
|
@@ -12229,11 +12265,12 @@ function recordWalkError(error, stats) {
|
|
|
12229
12265
|
if (stats && (code === void 0 || !TOLERATED_CODES.has(code)))
|
|
12230
12266
|
stats.unknownErrors += 1;
|
|
12231
12267
|
}
|
|
12232
|
-
function safeReaddir(dir, stats) {
|
|
12268
|
+
function safeReaddir(dir, stats, onError) {
|
|
12233
12269
|
try {
|
|
12234
12270
|
return readdirSync(dir, { withFileTypes: true });
|
|
12235
12271
|
} catch (e) {
|
|
12236
12272
|
recordWalkError(e, stats);
|
|
12273
|
+
onError?.(e);
|
|
12237
12274
|
return [];
|
|
12238
12275
|
}
|
|
12239
12276
|
}
|
|
@@ -13816,6 +13853,104 @@ var init_hooks2 = __esm({
|
|
|
13816
13853
|
}
|
|
13817
13854
|
});
|
|
13818
13855
|
|
|
13856
|
+
// packages/adapter-cc/dist/discover.js
|
|
13857
|
+
import { createReadStream, statSync as statSync3 } from "node:fs";
|
|
13858
|
+
import { join as join15 } from "node:path";
|
|
13859
|
+
import { createInterface } from "node:readline";
|
|
13860
|
+
async function readCwd(transcriptPath) {
|
|
13861
|
+
const input = createReadStream(transcriptPath, { encoding: "utf8", highWaterMark: 4096 });
|
|
13862
|
+
const lines2 = createInterface({ input, crlfDelay: Infinity });
|
|
13863
|
+
let count = 0;
|
|
13864
|
+
try {
|
|
13865
|
+
for await (const line of lines2) {
|
|
13866
|
+
count += 1;
|
|
13867
|
+
if (line.trim()) {
|
|
13868
|
+
const row = JSON.parse(line);
|
|
13869
|
+
if (typeof row?.cwd === "string" && row.cwd.length > 0)
|
|
13870
|
+
return row.cwd;
|
|
13871
|
+
}
|
|
13872
|
+
if (count >= 200)
|
|
13873
|
+
break;
|
|
13874
|
+
}
|
|
13875
|
+
throw new Error("Session cwd not found");
|
|
13876
|
+
} finally {
|
|
13877
|
+
lines2.close();
|
|
13878
|
+
input.destroy();
|
|
13879
|
+
}
|
|
13880
|
+
}
|
|
13881
|
+
async function discoverRecentSessions(homeDir, { now, windowMs, limit }, stats = newWalkStats()) {
|
|
13882
|
+
if (limit <= 0)
|
|
13883
|
+
return [];
|
|
13884
|
+
const candidates = [];
|
|
13885
|
+
const root = join15(homeDir, ".claude", "projects");
|
|
13886
|
+
let skipped = 0;
|
|
13887
|
+
const recordSkippedDirectory = () => {
|
|
13888
|
+
skipped += 1;
|
|
13889
|
+
};
|
|
13890
|
+
const rootEntries = safeReaddir(root, stats, (error) => {
|
|
13891
|
+
if (error.code !== "ENOENT")
|
|
13892
|
+
recordSkippedDirectory();
|
|
13893
|
+
});
|
|
13894
|
+
for (const entry of rootEntries) {
|
|
13895
|
+
if (stats.entriesLeft <= 0) {
|
|
13896
|
+
stats.truncated = true;
|
|
13897
|
+
break;
|
|
13898
|
+
}
|
|
13899
|
+
stats.entriesLeft -= 1;
|
|
13900
|
+
if (!entry.isDirectory())
|
|
13901
|
+
continue;
|
|
13902
|
+
const dir = join15(root, entry.name);
|
|
13903
|
+
for (const file of safeReaddir(dir, stats, recordSkippedDirectory)) {
|
|
13904
|
+
if (stats.entriesLeft <= 0) {
|
|
13905
|
+
stats.truncated = true;
|
|
13906
|
+
break;
|
|
13907
|
+
}
|
|
13908
|
+
stats.entriesLeft -= 1;
|
|
13909
|
+
if (!file.isFile() || !file.name.endsWith(".jsonl"))
|
|
13910
|
+
continue;
|
|
13911
|
+
const transcriptPath = join15(dir, file.name);
|
|
13912
|
+
try {
|
|
13913
|
+
const mtime = statSync3(transcriptPath).mtimeMs;
|
|
13914
|
+
if (mtime < now - windowMs || mtime > now)
|
|
13915
|
+
continue;
|
|
13916
|
+
const id = file.name.slice(0, -".jsonl".length);
|
|
13917
|
+
if (!id)
|
|
13918
|
+
throw new Error("Session id not found");
|
|
13919
|
+
candidates.push({ id, transcriptPath, mtime });
|
|
13920
|
+
} catch (error) {
|
|
13921
|
+
recordWalkError(error, stats);
|
|
13922
|
+
skipped += 1;
|
|
13923
|
+
}
|
|
13924
|
+
}
|
|
13925
|
+
if (stats.truncated)
|
|
13926
|
+
break;
|
|
13927
|
+
}
|
|
13928
|
+
candidates.sort((a, b) => b.mtime - a.mtime || a.transcriptPath.localeCompare(b.transcriptPath));
|
|
13929
|
+
const sessions = [];
|
|
13930
|
+
for (const candidate of candidates) {
|
|
13931
|
+
try {
|
|
13932
|
+
const cwd = await readCwd(candidate.transcriptPath);
|
|
13933
|
+
sessions.push({ ...candidate, cwd });
|
|
13934
|
+
if (sessions.length >= limit)
|
|
13935
|
+
break;
|
|
13936
|
+
} catch (error) {
|
|
13937
|
+
recordWalkError(error, stats);
|
|
13938
|
+
skipped += 1;
|
|
13939
|
+
}
|
|
13940
|
+
}
|
|
13941
|
+
if (skipped > 0) {
|
|
13942
|
+
process.stderr.write(`[wingman] cc startup discovery: skipped ${skipped} unreadable or invalid entries.
|
|
13943
|
+
`);
|
|
13944
|
+
}
|
|
13945
|
+
return sessions;
|
|
13946
|
+
}
|
|
13947
|
+
var init_discover = __esm({
|
|
13948
|
+
"packages/adapter-cc/dist/discover.js"() {
|
|
13949
|
+
"use strict";
|
|
13950
|
+
init_walk();
|
|
13951
|
+
}
|
|
13952
|
+
});
|
|
13953
|
+
|
|
13819
13954
|
// packages/adapter-cc/dist/generic-waiting.js
|
|
13820
13955
|
var GENERIC_WAITING_MESSAGES;
|
|
13821
13956
|
var init_generic_waiting = __esm({
|
|
@@ -13845,7 +13980,7 @@ var init_mcp_tools = __esm({
|
|
|
13845
13980
|
// packages/adapter-cc/dist/protocol.js
|
|
13846
13981
|
import { existsSync as existsSync10, mkdirSync as mkdirSync6, readdirSync as readdirSync3, readFileSync as readFileSync10, rmdirSync, rmSync as rmSync5, writeFileSync as writeFileSync7 } from "node:fs";
|
|
13847
13982
|
import { homedir as homedir10 } from "node:os";
|
|
13848
|
-
import { basename as basename7, dirname as dirname10, join as
|
|
13983
|
+
import { basename as basename7, dirname as dirname10, join as join16, resolve as resolve6 } from "node:path";
|
|
13849
13984
|
function protocolStatusCc(options) {
|
|
13850
13985
|
const paths3 = resolveOptions2(options);
|
|
13851
13986
|
if (!existsSync10(paths3.targetPath)) {
|
|
@@ -13875,7 +14010,7 @@ function installProtocolCc(options) {
|
|
|
13875
14010
|
const backupDir = nextBackupDir3(paths3.homeDir);
|
|
13876
14011
|
const installedSha256 = sha256Hex(PLAN_PROTOCOL_TEXT);
|
|
13877
14012
|
if (!paths3.dryRun) {
|
|
13878
|
-
const claudeDir =
|
|
14013
|
+
const claudeDir = join16(paths3.projectDir, ".claude");
|
|
13879
14014
|
const rulesDir = dirname10(paths3.targetPath);
|
|
13880
14015
|
const prior = readState4(paths3.statePath);
|
|
13881
14016
|
backupTarget3(backupDir, paths3.targetPath, existing?.bytes);
|
|
@@ -13940,14 +14075,14 @@ function uninstallProtocolCc(options) {
|
|
|
13940
14075
|
function resolveOptions2(options) {
|
|
13941
14076
|
const homeDir = resolve6(options?.homeDir ?? homedir10());
|
|
13942
14077
|
const projectDir = resolve6(options?.projectDir ?? process.cwd());
|
|
13943
|
-
const targetPath2 =
|
|
14078
|
+
const targetPath2 = join16(projectDir, ".claude", "rules", "wingman-plan-protocol.md");
|
|
13944
14079
|
const projectHash = sha256Hex(projectDir);
|
|
13945
14080
|
return {
|
|
13946
14081
|
homeDir,
|
|
13947
14082
|
projectDir,
|
|
13948
14083
|
dryRun: options?.dryRun ?? false,
|
|
13949
14084
|
targetPath: targetPath2,
|
|
13950
|
-
statePath:
|
|
14085
|
+
statePath: join16(homeDir, ".wingman", "state", `plan-protocol-cc-${projectHash}.json`)
|
|
13951
14086
|
};
|
|
13952
14087
|
}
|
|
13953
14088
|
function readExisting(targetPath2) {
|
|
@@ -13999,16 +14134,16 @@ function modifiedError2(targetPath2, operation) {
|
|
|
13999
14134
|
}
|
|
14000
14135
|
function nextBackupDir3(homeDir) {
|
|
14001
14136
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-");
|
|
14002
|
-
const root =
|
|
14003
|
-
let dir =
|
|
14137
|
+
const root = join16(homeDir, ".wingman", "backups");
|
|
14138
|
+
let dir = join16(root, stamp);
|
|
14004
14139
|
for (let n = 2; existsSync10(dir); n += 1)
|
|
14005
|
-
dir =
|
|
14140
|
+
dir = join16(root, `${stamp}-${n}`);
|
|
14006
14141
|
return dir;
|
|
14007
14142
|
}
|
|
14008
14143
|
function backupTarget3(backupDir, targetPath2, bytes) {
|
|
14009
14144
|
mkdirSync6(backupDir, { recursive: true });
|
|
14010
14145
|
if (bytes !== void 0)
|
|
14011
|
-
writeFileSync7(
|
|
14146
|
+
writeFileSync7(join16(backupDir, basename7(targetPath2)), bytes);
|
|
14012
14147
|
}
|
|
14013
14148
|
function readState4(statePath2) {
|
|
14014
14149
|
if (!existsSync10(statePath2))
|
|
@@ -14050,12 +14185,12 @@ var init_protocol2 = __esm({
|
|
|
14050
14185
|
|
|
14051
14186
|
// packages/adapter-cc/dist/protocol-user.js
|
|
14052
14187
|
import { homedir as homedir11 } from "node:os";
|
|
14053
|
-
import { join as
|
|
14188
|
+
import { join as join17, resolve as resolve7 } from "node:path";
|
|
14054
14189
|
function paths(options) {
|
|
14055
14190
|
const homeDir = resolve7(options?.homeDir ?? homedir11());
|
|
14056
14191
|
return {
|
|
14057
14192
|
homeDir,
|
|
14058
|
-
targetPath:
|
|
14193
|
+
targetPath: join17(homeDir, ".claude", "CLAUDE.md"),
|
|
14059
14194
|
dryRun: options?.dryRun ?? false
|
|
14060
14195
|
};
|
|
14061
14196
|
}
|
|
@@ -14081,6 +14216,7 @@ __export(dist_exports2, {
|
|
|
14081
14216
|
GENERIC_WAITING_MESSAGES: () => GENERIC_WAITING_MESSAGES,
|
|
14082
14217
|
WIRED_EVENTS: () => WIRED_EVENTS,
|
|
14083
14218
|
createAdapter: () => createAdapter2,
|
|
14219
|
+
discoverRecentSessions: () => discoverRecentSessions,
|
|
14084
14220
|
feedbackSignals: () => feedbackSignalsCc,
|
|
14085
14221
|
installProtocolCc: () => installProtocolCc,
|
|
14086
14222
|
installProtocolCcUser: () => installProtocolCcUser,
|
|
@@ -14108,6 +14244,7 @@ var init_dist4 = __esm({
|
|
|
14108
14244
|
init_detect();
|
|
14109
14245
|
init_hooks2();
|
|
14110
14246
|
init_scan();
|
|
14247
|
+
init_discover();
|
|
14111
14248
|
init_generic_waiting();
|
|
14112
14249
|
init_hooks2();
|
|
14113
14250
|
init_mcp_tools();
|
|
@@ -14827,14 +14964,14 @@ var init_dist5 = __esm({
|
|
|
14827
14964
|
|
|
14828
14965
|
// packages/adapter-codex/dist/shared.js
|
|
14829
14966
|
import { homedir as homedir12 } from "node:os";
|
|
14830
|
-
import { join as
|
|
14967
|
+
import { join as join18 } from "node:path";
|
|
14831
14968
|
function resolvePaths(options) {
|
|
14832
14969
|
const homeDir = options?.homeDir ?? homedir12();
|
|
14833
14970
|
const projectDir = options?.projectDir ?? process.cwd();
|
|
14834
|
-
return { homeDir, projectDir, codexHome:
|
|
14971
|
+
return { homeDir, projectDir, codexHome: join18(homeDir, ".codex") };
|
|
14835
14972
|
}
|
|
14836
14973
|
function wingmanStateRoot(paths3) {
|
|
14837
|
-
return
|
|
14974
|
+
return join18(paths3.homeDir, ".wingman");
|
|
14838
14975
|
}
|
|
14839
14976
|
function isTable(value) {
|
|
14840
14977
|
return typeof value === "object" && value !== null && !Array.isArray(value) && !(value instanceof Date);
|
|
@@ -15143,8 +15280,8 @@ var init_toml_edit = __esm({
|
|
|
15143
15280
|
});
|
|
15144
15281
|
|
|
15145
15282
|
// packages/adapter-codex/dist/actions.js
|
|
15146
|
-
import { existsSync as existsSync11, mkdirSync as mkdirSync7, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as
|
|
15147
|
-
import { basename as basename8, dirname as dirname11, join as
|
|
15283
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync7, readdirSync as readdirSync4, readFileSync as readFileSync11, statSync as statSync4, writeFileSync as writeFileSync8 } from "node:fs";
|
|
15284
|
+
import { basename as basename8, dirname as dirname11, join as join19 } from "node:path";
|
|
15148
15285
|
async function planAction(action, options) {
|
|
15149
15286
|
const paths3 = resolvePaths(options);
|
|
15150
15287
|
const resolved = resolveToggle(action, paths3);
|
|
@@ -15178,7 +15315,7 @@ async function applyAction(plan, options) {
|
|
|
15178
15315
|
error: t("adapter.codex.actions.planWritesDoesNotMatchThisAdapterSFormat")
|
|
15179
15316
|
};
|
|
15180
15317
|
}
|
|
15181
|
-
const backupsRoot =
|
|
15318
|
+
const backupsRoot = join19(wingmanStateRoot(paths3), "backups");
|
|
15182
15319
|
if (dirname11(plan.backupDir) !== backupsRoot) {
|
|
15183
15320
|
return {
|
|
15184
15321
|
ok: false,
|
|
@@ -15207,7 +15344,7 @@ async function applyAction(plan, options) {
|
|
|
15207
15344
|
};
|
|
15208
15345
|
}
|
|
15209
15346
|
mkdirSync7(plan.backupDir, { recursive: true });
|
|
15210
|
-
writeFileSync8(
|
|
15347
|
+
writeFileSync8(join19(plan.backupDir, basename8(write.file)), currentRaw);
|
|
15211
15348
|
writeFileSync8(write.file, write.after);
|
|
15212
15349
|
return { ok: true, backupDir: plan.backupDir };
|
|
15213
15350
|
} catch (error) {
|
|
@@ -15216,10 +15353,10 @@ async function applyAction(plan, options) {
|
|
|
15216
15353
|
}
|
|
15217
15354
|
function nextBackupDir4(paths3) {
|
|
15218
15355
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-");
|
|
15219
|
-
const base =
|
|
15220
|
-
let dir =
|
|
15356
|
+
const base = join19(wingmanStateRoot(paths3), "backups");
|
|
15357
|
+
let dir = join19(base, stamp);
|
|
15221
15358
|
for (let n = 1; existsSync11(dir); n += 1)
|
|
15222
|
-
dir =
|
|
15359
|
+
dir = join19(base, `${stamp}-${n}`);
|
|
15223
15360
|
return dir;
|
|
15224
15361
|
}
|
|
15225
15362
|
function resolveToggle(action, paths3) {
|
|
@@ -15237,7 +15374,7 @@ function resolveToggle(action, paths3) {
|
|
|
15237
15374
|
const slot = m[1];
|
|
15238
15375
|
const source = m[2];
|
|
15239
15376
|
const nativeName = m[3];
|
|
15240
|
-
const file = source === "user" ?
|
|
15377
|
+
const file = source === "user" ? join19(paths3.codexHome, "config.toml") : join19(paths3.projectDir, ".codex", "config.toml");
|
|
15241
15378
|
if (!existsSync11(file))
|
|
15242
15379
|
throw new Error(t("adapter.codex.actions.itemidNotFoundConfigurationFileDoesNotExist", { p0: String(file) }));
|
|
15243
15380
|
const before = readFileSync11(file, "utf8");
|
|
@@ -15515,18 +15652,18 @@ function verifyEdit(table, edit, file) {
|
|
|
15515
15652
|
}
|
|
15516
15653
|
function collectCorpus(paths3) {
|
|
15517
15654
|
const candidates = [
|
|
15518
|
-
|
|
15519
|
-
|
|
15520
|
-
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
...listFilesRecursive(
|
|
15655
|
+
join19(paths3.codexHome, "AGENTS.md"),
|
|
15656
|
+
join19(paths3.projectDir, "AGENTS.md"),
|
|
15657
|
+
join19(paths3.codexHome, "config.toml"),
|
|
15658
|
+
join19(paths3.projectDir, ".codex", "config.toml"),
|
|
15659
|
+
join19(paths3.codexHome, "hooks.json"),
|
|
15660
|
+
join19(paths3.projectDir, ".codex", "hooks.json"),
|
|
15661
|
+
...listFilesRecursive(join19(paths3.codexHome, "prompts"))
|
|
15525
15662
|
];
|
|
15526
15663
|
const sources = [];
|
|
15527
15664
|
for (const file of candidates) {
|
|
15528
15665
|
try {
|
|
15529
|
-
if (!
|
|
15666
|
+
if (!statSync4(file).isFile())
|
|
15530
15667
|
continue;
|
|
15531
15668
|
} catch {
|
|
15532
15669
|
continue;
|
|
@@ -15544,7 +15681,7 @@ function listFilesRecursive(dir) {
|
|
|
15544
15681
|
}
|
|
15545
15682
|
const files = [];
|
|
15546
15683
|
for (const entry of [...entries].sort((a, b) => a.name.localeCompare(b.name))) {
|
|
15547
|
-
const path =
|
|
15684
|
+
const path = join19(dir, entry.name);
|
|
15548
15685
|
if (entry.isDirectory())
|
|
15549
15686
|
files.push(...listFilesRecursive(path));
|
|
15550
15687
|
else if (entry.isFile())
|
|
@@ -15626,15 +15763,15 @@ var init_actions2 = __esm({
|
|
|
15626
15763
|
// packages/adapter-codex/dist/hooks.js
|
|
15627
15764
|
import { spawnSync } from "node:child_process";
|
|
15628
15765
|
import { existsSync as existsSync12, mkdirSync as mkdirSync8, readFileSync as readFileSync12, realpathSync, rmSync as rmSync6, writeFileSync as writeFileSync9 } from "node:fs";
|
|
15629
|
-
import { basename as basename9, dirname as dirname12, join as
|
|
15766
|
+
import { basename as basename9, dirname as dirname12, join as join20 } from "node:path";
|
|
15630
15767
|
async function installHooks(port, options) {
|
|
15631
15768
|
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
15632
15769
|
throw new Error(t("adapter.codex.hooks.invalidPort", { p0: String(port) }));
|
|
15633
15770
|
}
|
|
15634
15771
|
const paths3 = resolvePaths(options);
|
|
15635
15772
|
const root = wingmanStateRoot(paths3);
|
|
15636
|
-
const scriptPath =
|
|
15637
|
-
const configPath =
|
|
15773
|
+
const scriptPath = join20(root, FORWARD_SCRIPT_NAME);
|
|
15774
|
+
const configPath = join20(paths3.codexHome, "config.toml");
|
|
15638
15775
|
const raw = existsSync12(configPath) ? readFileSync12(configPath) : void 0;
|
|
15639
15776
|
const text = raw?.toString("utf8") ?? "";
|
|
15640
15777
|
const { before, after, remainder, block } = splitManagedBlock(text, configPath);
|
|
@@ -15698,9 +15835,9 @@ async function installHooks(port, options) {
|
|
|
15698
15835
|
async function uninstallHooks(options) {
|
|
15699
15836
|
const paths3 = resolvePaths(options);
|
|
15700
15837
|
const root = wingmanStateRoot(paths3);
|
|
15701
|
-
const scriptPath =
|
|
15838
|
+
const scriptPath = join20(root, FORWARD_SCRIPT_NAME);
|
|
15702
15839
|
const statePath2 = hooksStatePath(root);
|
|
15703
|
-
const configPath =
|
|
15840
|
+
const configPath = join20(paths3.codexHome, "config.toml");
|
|
15704
15841
|
const state = readState5(statePath2);
|
|
15705
15842
|
const raw = existsSync12(configPath) ? readFileSync12(configPath) : void 0;
|
|
15706
15843
|
if (raw !== void 0) {
|
|
@@ -15726,25 +15863,25 @@ async function uninstallHooks(options) {
|
|
|
15726
15863
|
rmSync6(statePath2, { force: true });
|
|
15727
15864
|
}
|
|
15728
15865
|
function hasManagedHooks2(paths3) {
|
|
15729
|
-
const configPath =
|
|
15866
|
+
const configPath = join20(paths3.codexHome, "config.toml");
|
|
15730
15867
|
if (!existsSync12(configPath))
|
|
15731
15868
|
return false;
|
|
15732
15869
|
try {
|
|
15733
15870
|
const { block } = splitManagedBlock(readFileSync12(configPath, "utf8"), configPath);
|
|
15734
|
-
return block !== void 0 && inspectManagedBlock(block,
|
|
15871
|
+
return block !== void 0 && inspectManagedBlock(block, join20(wingmanStateRoot(paths3), FORWARD_SCRIPT_NAME)) !== void 0;
|
|
15735
15872
|
} catch {
|
|
15736
15873
|
return false;
|
|
15737
15874
|
}
|
|
15738
15875
|
}
|
|
15739
15876
|
function feedbackSignalsCodex(options) {
|
|
15740
15877
|
const paths3 = resolvePaths(options);
|
|
15741
|
-
const configPath =
|
|
15878
|
+
const configPath = join20(paths3.codexHome, "config.toml");
|
|
15742
15879
|
const wiredEvents = [];
|
|
15743
15880
|
if (existsSync12(configPath)) {
|
|
15744
15881
|
try {
|
|
15745
15882
|
const { block } = splitManagedBlock(readFileSync12(configPath, "utf8"), configPath);
|
|
15746
15883
|
if (block !== void 0) {
|
|
15747
|
-
const knownBlock = inspectManagedBlock(block,
|
|
15884
|
+
const knownBlock = inspectManagedBlock(block, join20(wingmanStateRoot(paths3), FORWARD_SCRIPT_NAME));
|
|
15748
15885
|
const hooks = knownBlock === void 0 ? void 0 : parse3(normalizeLineEndings(knownBlock.managedBlock)).hooks;
|
|
15749
15886
|
if (isTable(hooks)) {
|
|
15750
15887
|
for (const [event, groups] of Object.entries(hooks)) {
|
|
@@ -16001,15 +16138,15 @@ function hasHooksState(text) {
|
|
|
16001
16138
|
}
|
|
16002
16139
|
function backupFile(root, filePath, contents) {
|
|
16003
16140
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-");
|
|
16004
|
-
let dir =
|
|
16141
|
+
let dir = join20(root, "backups", stamp);
|
|
16005
16142
|
for (let n = 1; existsSync12(dir); n += 1)
|
|
16006
|
-
dir =
|
|
16143
|
+
dir = join20(root, "backups", `${stamp}-${n}`);
|
|
16007
16144
|
mkdirSync8(dir, { recursive: true });
|
|
16008
|
-
writeFileSync9(
|
|
16145
|
+
writeFileSync9(join20(dir, basename9(filePath)), contents);
|
|
16009
16146
|
return dir;
|
|
16010
16147
|
}
|
|
16011
16148
|
function hooksStatePath(root) {
|
|
16012
|
-
return
|
|
16149
|
+
return join20(root, "state", "codex-hooks.json");
|
|
16013
16150
|
}
|
|
16014
16151
|
function readState5(statePath2) {
|
|
16015
16152
|
if (!existsSync12(statePath2))
|
|
@@ -16179,11 +16316,11 @@ process.stdin.on('end', async () => {
|
|
|
16179
16316
|
});
|
|
16180
16317
|
|
|
16181
16318
|
// packages/adapter-codex/dist/scan.js
|
|
16182
|
-
import { existsSync as existsSync13, readdirSync as readdirSync5, readFileSync as readFileSync13, realpathSync as realpathSync2, statSync as
|
|
16183
|
-
import { dirname as dirname13, isAbsolute as isAbsolute3, join as
|
|
16319
|
+
import { existsSync as existsSync13, readdirSync as readdirSync5, readFileSync as readFileSync13, realpathSync as realpathSync2, statSync as statSync5 } from "node:fs";
|
|
16320
|
+
import { dirname as dirname13, isAbsolute as isAbsolute3, join as join21, resolve as resolve8 } from "node:path";
|
|
16184
16321
|
function readCodexProjects(homeDir) {
|
|
16185
16322
|
try {
|
|
16186
|
-
const state = JSON.parse(readFileSync13(
|
|
16323
|
+
const state = JSON.parse(readFileSync13(join21(homeDir, ".codex", ".codex-global-state.json"), "utf8"));
|
|
16187
16324
|
if (!isTable(state))
|
|
16188
16325
|
return void 0;
|
|
16189
16326
|
const localProjects = state["local-projects"];
|
|
@@ -16260,8 +16397,8 @@ async function scan(options) {
|
|
|
16260
16397
|
}
|
|
16261
16398
|
function loadConfigLayers(paths3) {
|
|
16262
16399
|
const candidates = [
|
|
16263
|
-
["user",
|
|
16264
|
-
["project",
|
|
16400
|
+
["user", join21(paths3.codexHome, "config.toml")],
|
|
16401
|
+
["project", join21(paths3.projectDir, ".codex", "config.toml")]
|
|
16265
16402
|
];
|
|
16266
16403
|
const layers = [];
|
|
16267
16404
|
for (const [source, path] of candidates) {
|
|
@@ -16278,8 +16415,8 @@ function loadConfigLayers(paths3) {
|
|
|
16278
16415
|
}
|
|
16279
16416
|
function collectRules(out, paths3, layers) {
|
|
16280
16417
|
const agentsChain = [
|
|
16281
|
-
["user",
|
|
16282
|
-
["project",
|
|
16418
|
+
["user", join21(paths3.codexHome, "AGENTS.md")],
|
|
16419
|
+
["project", join21(paths3.projectDir, "AGENTS.md")]
|
|
16283
16420
|
];
|
|
16284
16421
|
for (const [source, file] of agentsChain) {
|
|
16285
16422
|
const size = fileSize(file);
|
|
@@ -16414,7 +16551,7 @@ function collectGates(out, layer) {
|
|
|
16414
16551
|
}
|
|
16415
16552
|
}
|
|
16416
16553
|
function collectHistory(out, paths3, layers) {
|
|
16417
|
-
const historyFile =
|
|
16554
|
+
const historyFile = join21(paths3.codexHome, "history.jsonl");
|
|
16418
16555
|
const historyBytes = fileSize(historyFile);
|
|
16419
16556
|
if (historyBytes !== void 0) {
|
|
16420
16557
|
out.push({
|
|
@@ -16429,7 +16566,7 @@ function collectHistory(out, paths3, layers) {
|
|
|
16429
16566
|
});
|
|
16430
16567
|
}
|
|
16431
16568
|
const configured = layers.find((layer) => layer.source === "user")?.table.log_dir;
|
|
16432
|
-
const logDir = typeof configured === "string" ? expandPath(configured, paths3) :
|
|
16569
|
+
const logDir = typeof configured === "string" ? expandPath(configured, paths3) : join21(paths3.codexHome, "log");
|
|
16433
16570
|
if (isDirectory(logDir)) {
|
|
16434
16571
|
out.push({
|
|
16435
16572
|
id: "codex:history:user:log_dir",
|
|
@@ -16445,7 +16582,7 @@ function collectHistory(out, paths3, layers) {
|
|
|
16445
16582
|
}
|
|
16446
16583
|
function expandPath(value, paths3) {
|
|
16447
16584
|
if (value === "~" || value.startsWith("~/"))
|
|
16448
|
-
return
|
|
16585
|
+
return join21(paths3.homeDir, value.slice(2));
|
|
16449
16586
|
return isAbsolute3(value) ? value : resolve8(paths3.codexHome, value);
|
|
16450
16587
|
}
|
|
16451
16588
|
function assertUniqueIds(slots) {
|
|
@@ -16461,7 +16598,7 @@ function assertUniqueIds(slots) {
|
|
|
16461
16598
|
}
|
|
16462
16599
|
function fileSize(path) {
|
|
16463
16600
|
try {
|
|
16464
|
-
const stats =
|
|
16601
|
+
const stats = statSync5(path);
|
|
16465
16602
|
return stats.isFile() ? stats.size : void 0;
|
|
16466
16603
|
} catch {
|
|
16467
16604
|
return void 0;
|
|
@@ -16469,7 +16606,7 @@ function fileSize(path) {
|
|
|
16469
16606
|
}
|
|
16470
16607
|
function isDirectory(path) {
|
|
16471
16608
|
try {
|
|
16472
|
-
return
|
|
16609
|
+
return statSync5(path).isDirectory();
|
|
16473
16610
|
} catch {
|
|
16474
16611
|
return false;
|
|
16475
16612
|
}
|
|
@@ -16477,11 +16614,11 @@ function isDirectory(path) {
|
|
|
16477
16614
|
function directoryBytes(dir) {
|
|
16478
16615
|
let total = 0;
|
|
16479
16616
|
for (const entry of readdirSync5(dir, { withFileTypes: true })) {
|
|
16480
|
-
const entryPath =
|
|
16617
|
+
const entryPath = join21(dir, entry.name);
|
|
16481
16618
|
if (entry.isDirectory())
|
|
16482
16619
|
total += directoryBytes(entryPath);
|
|
16483
16620
|
else if (entry.isFile())
|
|
16484
|
-
total +=
|
|
16621
|
+
total += statSync5(entryPath).size;
|
|
16485
16622
|
}
|
|
16486
16623
|
return total;
|
|
16487
16624
|
}
|
|
@@ -16498,6 +16635,128 @@ var init_scan2 = __esm({
|
|
|
16498
16635
|
}
|
|
16499
16636
|
});
|
|
16500
16637
|
|
|
16638
|
+
// packages/adapter-codex/dist/discover.js
|
|
16639
|
+
import { createReadStream as createReadStream2, readdirSync as readdirSync6, statSync as statSync6 } from "node:fs";
|
|
16640
|
+
import { join as join22 } from "node:path";
|
|
16641
|
+
import { createInterface as createInterface2 } from "node:readline";
|
|
16642
|
+
function recordWalkError2(error, stats) {
|
|
16643
|
+
const code = error.code;
|
|
16644
|
+
if (code === void 0 || !TOLERATED_CODES2.has(code))
|
|
16645
|
+
stats.unknownErrors += 1;
|
|
16646
|
+
}
|
|
16647
|
+
function safeReaddir2(dir, stats, onError) {
|
|
16648
|
+
try {
|
|
16649
|
+
return readdirSync6(dir, { withFileTypes: true });
|
|
16650
|
+
} catch (error) {
|
|
16651
|
+
recordWalkError2(error, stats);
|
|
16652
|
+
onError(error);
|
|
16653
|
+
return [];
|
|
16654
|
+
}
|
|
16655
|
+
}
|
|
16656
|
+
async function readMetadata(file) {
|
|
16657
|
+
const stream = createReadStream2(file, { encoding: "utf8", highWaterMark: 4096 });
|
|
16658
|
+
const lines2 = createInterface2({ input: stream, crlfDelay: Number.POSITIVE_INFINITY });
|
|
16659
|
+
let lineCount = 0;
|
|
16660
|
+
try {
|
|
16661
|
+
for await (const line of lines2) {
|
|
16662
|
+
lineCount += 1;
|
|
16663
|
+
if (line.trim()) {
|
|
16664
|
+
const row = JSON.parse(line);
|
|
16665
|
+
if (isTable(row) && row.type === "session_meta") {
|
|
16666
|
+
const payload = row.payload;
|
|
16667
|
+
if (!isTable(payload) || typeof payload.id !== "string" || !payload.id) {
|
|
16668
|
+
throw new Error("Invalid session metadata");
|
|
16669
|
+
}
|
|
16670
|
+
if (typeof payload.parent_thread_id === "string" && payload.parent_thread_id) {
|
|
16671
|
+
return void 0;
|
|
16672
|
+
}
|
|
16673
|
+
const result5 = { id: payload.id };
|
|
16674
|
+
if (typeof payload.cwd === "string" && payload.cwd)
|
|
16675
|
+
result5.cwd = payload.cwd;
|
|
16676
|
+
return result5;
|
|
16677
|
+
}
|
|
16678
|
+
}
|
|
16679
|
+
if (lineCount >= MAX_META_LINES)
|
|
16680
|
+
break;
|
|
16681
|
+
}
|
|
16682
|
+
throw new Error("No session metadata within the line limit");
|
|
16683
|
+
} finally {
|
|
16684
|
+
lines2.close();
|
|
16685
|
+
stream.destroy();
|
|
16686
|
+
}
|
|
16687
|
+
}
|
|
16688
|
+
async function discoverRecentSessions2(homeDir, { now, windowMs, limit }, stats = {
|
|
16689
|
+
unknownErrors: 0,
|
|
16690
|
+
truncated: false,
|
|
16691
|
+
entriesLeft: MAX_WALK_ENTRIES2
|
|
16692
|
+
}) {
|
|
16693
|
+
if (limit <= 0)
|
|
16694
|
+
return [];
|
|
16695
|
+
const candidates = [];
|
|
16696
|
+
let skipped = 0;
|
|
16697
|
+
const visit = (dir, depth) => {
|
|
16698
|
+
const entries = safeReaddir2(dir, stats, (error) => {
|
|
16699
|
+
if (depth !== 1 || error.code !== "ENOENT")
|
|
16700
|
+
skipped += 1;
|
|
16701
|
+
});
|
|
16702
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
16703
|
+
if (stats.entriesLeft <= 0) {
|
|
16704
|
+
stats.truncated = true;
|
|
16705
|
+
return;
|
|
16706
|
+
}
|
|
16707
|
+
stats.entriesLeft -= 1;
|
|
16708
|
+
const path = join22(dir, entry.name);
|
|
16709
|
+
if (entry.isDirectory()) {
|
|
16710
|
+
if (depth < MAX_WALK_DEPTH2 && !entry.name.startsWith("."))
|
|
16711
|
+
visit(path, depth + 1);
|
|
16712
|
+
if (stats.truncated)
|
|
16713
|
+
return;
|
|
16714
|
+
} else if (entry.isFile() && entry.name.startsWith("rollout-") && entry.name.endsWith(".jsonl")) {
|
|
16715
|
+
try {
|
|
16716
|
+
const mtime = statSync6(path).mtimeMs;
|
|
16717
|
+
if (mtime >= now - windowMs && mtime <= now) {
|
|
16718
|
+
candidates.push({ transcriptPath: path, mtime });
|
|
16719
|
+
}
|
|
16720
|
+
} catch (error) {
|
|
16721
|
+
recordWalkError2(error, stats);
|
|
16722
|
+
skipped += 1;
|
|
16723
|
+
}
|
|
16724
|
+
}
|
|
16725
|
+
}
|
|
16726
|
+
};
|
|
16727
|
+
visit(join22(homeDir, ".codex", "sessions"), 1);
|
|
16728
|
+
candidates.sort((a, b) => b.mtime - a.mtime);
|
|
16729
|
+
const sessions = [];
|
|
16730
|
+
for (const candidate of candidates) {
|
|
16731
|
+
try {
|
|
16732
|
+
const metadata = await readMetadata(candidate.transcriptPath);
|
|
16733
|
+
if (metadata)
|
|
16734
|
+
sessions.push({ ...metadata, ...candidate });
|
|
16735
|
+
} catch (error) {
|
|
16736
|
+
recordWalkError2(error, stats);
|
|
16737
|
+
skipped += 1;
|
|
16738
|
+
}
|
|
16739
|
+
if (sessions.length >= limit)
|
|
16740
|
+
break;
|
|
16741
|
+
}
|
|
16742
|
+
if (skipped > 0) {
|
|
16743
|
+
process.stderr.write(`[wingman] codex startup discovery: skipped ${skipped} unreadable or invalid entries.
|
|
16744
|
+
`);
|
|
16745
|
+
}
|
|
16746
|
+
return sessions;
|
|
16747
|
+
}
|
|
16748
|
+
var TOLERATED_CODES2, MAX_WALK_DEPTH2, MAX_WALK_ENTRIES2, MAX_META_LINES;
|
|
16749
|
+
var init_discover2 = __esm({
|
|
16750
|
+
"packages/adapter-codex/dist/discover.js"() {
|
|
16751
|
+
"use strict";
|
|
16752
|
+
init_shared();
|
|
16753
|
+
TOLERATED_CODES2 = /* @__PURE__ */ new Set(["EPERM", "EACCES", "ENOENT"]);
|
|
16754
|
+
MAX_WALK_DEPTH2 = 6;
|
|
16755
|
+
MAX_WALK_ENTRIES2 = 5e4;
|
|
16756
|
+
MAX_META_LINES = 200;
|
|
16757
|
+
}
|
|
16758
|
+
});
|
|
16759
|
+
|
|
16501
16760
|
// packages/adapter-codex/dist/plugin-tools.js
|
|
16502
16761
|
function recognizePluginTool(name, namespace, configuredPlugins) {
|
|
16503
16762
|
const fullName = name.startsWith("mcp__") ? name : namespace?.startsWith("mcp__") ? `${namespace}__${name}` : void 0;
|
|
@@ -16533,7 +16792,7 @@ var init_plugin_tools = __esm({
|
|
|
16533
16792
|
|
|
16534
16793
|
// packages/adapter-codex/dist/protocol.js
|
|
16535
16794
|
import { existsSync as existsSync14, mkdirSync as mkdirSync9, readFileSync as readFileSync14, rmSync as rmSync7, writeFileSync as writeFileSync10 } from "node:fs";
|
|
16536
|
-
import { basename as basename10, dirname as dirname14, join as
|
|
16795
|
+
import { basename as basename10, dirname as dirname14, join as join23, resolve as resolve9 } from "node:path";
|
|
16537
16796
|
function protocolStatusCodex(options) {
|
|
16538
16797
|
const paths3 = resolveOptions3(options);
|
|
16539
16798
|
if (!existsSync14(paths3.targetPath))
|
|
@@ -16629,8 +16888,8 @@ function resolveOptions3(options) {
|
|
|
16629
16888
|
const base = resolvePaths(options);
|
|
16630
16889
|
const homeDir = resolve9(base.homeDir);
|
|
16631
16890
|
const projectDir = resolve9(base.projectDir);
|
|
16632
|
-
const targetPath2 =
|
|
16633
|
-
const statePath2 =
|
|
16891
|
+
const targetPath2 = join23(projectDir, "AGENTS.md");
|
|
16892
|
+
const statePath2 = join23(wingmanStateRoot({ ...base, homeDir, projectDir }), "state", `plan-protocol-agents-${sha256Hex(projectDir)}.json`);
|
|
16634
16893
|
return { homeDir, projectDir, targetPath: targetPath2, statePath: statePath2, dryRun: options?.dryRun ?? false };
|
|
16635
16894
|
}
|
|
16636
16895
|
function readAgents2(targetPath2) {
|
|
@@ -16701,16 +16960,16 @@ function modifiedError3(targetPath2, operation) {
|
|
|
16701
16960
|
}
|
|
16702
16961
|
function nextBackupDir5(homeDir) {
|
|
16703
16962
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replaceAll(":", "-");
|
|
16704
|
-
const root =
|
|
16705
|
-
let dir =
|
|
16963
|
+
const root = join23(homeDir, ".wingman", "backups");
|
|
16964
|
+
let dir = join23(root, stamp);
|
|
16706
16965
|
for (let n = 2; existsSync14(dir); n += 1)
|
|
16707
|
-
dir =
|
|
16966
|
+
dir = join23(root, `${stamp}-${n}`);
|
|
16708
16967
|
return dir;
|
|
16709
16968
|
}
|
|
16710
16969
|
function backupTarget4(backupDir, targetPath2, bytes) {
|
|
16711
16970
|
mkdirSync9(backupDir, { recursive: true });
|
|
16712
16971
|
if (bytes !== void 0)
|
|
16713
|
-
writeFileSync10(
|
|
16972
|
+
writeFileSync10(join23(backupDir, basename10(targetPath2)), bytes);
|
|
16714
16973
|
}
|
|
16715
16974
|
function readState6(statePath2, targetPath2) {
|
|
16716
16975
|
if (!existsSync14(statePath2))
|
|
@@ -16741,14 +17000,33 @@ var init_protocol3 = __esm({
|
|
|
16741
17000
|
}
|
|
16742
17001
|
});
|
|
16743
17002
|
|
|
17003
|
+
// packages/adapter-codex/dist/session-origin.js
|
|
17004
|
+
function describeSessionOrigin(originator, source) {
|
|
17005
|
+
if (!originator)
|
|
17006
|
+
return void 0;
|
|
17007
|
+
const raw = source ? `${originator} / ${source}` : originator;
|
|
17008
|
+
let key = "other";
|
|
17009
|
+
if (originator === "codex_exec") {
|
|
17010
|
+
key = source === "exec" ? "exec" : "cli";
|
|
17011
|
+
} else if (originator === "codex_work_desktop" || originator === "Codex Desktop") {
|
|
17012
|
+
key = "desktop";
|
|
17013
|
+
}
|
|
17014
|
+
return { key, raw };
|
|
17015
|
+
}
|
|
17016
|
+
var init_session_origin = __esm({
|
|
17017
|
+
"packages/adapter-codex/dist/session-origin.js"() {
|
|
17018
|
+
"use strict";
|
|
17019
|
+
}
|
|
17020
|
+
});
|
|
17021
|
+
|
|
16744
17022
|
// packages/adapter-codex/dist/protocol-user.js
|
|
16745
17023
|
import { homedir as homedir13 } from "node:os";
|
|
16746
|
-
import { join as
|
|
17024
|
+
import { join as join24, resolve as resolve10 } from "node:path";
|
|
16747
17025
|
function paths2(options) {
|
|
16748
17026
|
const homeDir = resolve10(options?.homeDir ?? homedir13());
|
|
16749
17027
|
return {
|
|
16750
17028
|
homeDir,
|
|
16751
|
-
targetPath:
|
|
17029
|
+
targetPath: join24(homeDir, ".codex", "AGENTS.md"),
|
|
16752
17030
|
dryRun: options?.dryRun ?? false
|
|
16753
17031
|
};
|
|
16754
17032
|
}
|
|
@@ -16773,6 +17051,8 @@ var dist_exports3 = {};
|
|
|
16773
17051
|
__export(dist_exports3, {
|
|
16774
17052
|
HOOK_EVENTS: () => HOOK_EVENTS,
|
|
16775
17053
|
createAdapter: () => createAdapter3,
|
|
17054
|
+
describeSessionOrigin: () => describeSessionOrigin,
|
|
17055
|
+
discoverRecentSessions: () => discoverRecentSessions2,
|
|
16776
17056
|
feedbackSignals: () => feedbackSignalsCodex,
|
|
16777
17057
|
installProtocolCodex: () => installProtocolCodex,
|
|
16778
17058
|
installProtocolCodexUser: () => installProtocolCodexUser,
|
|
@@ -16801,10 +17081,12 @@ var init_dist6 = __esm({
|
|
|
16801
17081
|
init_actions2();
|
|
16802
17082
|
init_hooks3();
|
|
16803
17083
|
init_scan2();
|
|
17084
|
+
init_discover2();
|
|
16804
17085
|
init_hooks3();
|
|
16805
17086
|
init_plugin_tools();
|
|
16806
17087
|
init_protocol3();
|
|
16807
17088
|
init_scan2();
|
|
17089
|
+
init_session_origin();
|
|
16808
17090
|
init_protocol_user2();
|
|
16809
17091
|
}
|
|
16810
17092
|
});
|
|
@@ -17230,9 +17512,9 @@ init_dist6();
|
|
|
17230
17512
|
init_dist3();
|
|
17231
17513
|
init_dist2();
|
|
17232
17514
|
init_dist();
|
|
17233
|
-
import { realpathSync as realpathSync3, statSync as
|
|
17515
|
+
import { realpathSync as realpathSync3, statSync as statSync8 } from "node:fs";
|
|
17234
17516
|
import { readdir as readdir2 } from "node:fs/promises";
|
|
17235
|
-
import { isAbsolute as isAbsolute6, join as
|
|
17517
|
+
import { isAbsolute as isAbsolute6, join as join28, relative as relative4, resolve as resolve12 } from "node:path";
|
|
17236
17518
|
|
|
17237
17519
|
// packages/narrative/dist/attribute.js
|
|
17238
17520
|
function extractSteps(lines2) {
|
|
@@ -17361,6 +17643,8 @@ function parseSessionMeta(payload, timestamp) {
|
|
|
17361
17643
|
assignString(line, "cwd", optionalString(payload?.cwd));
|
|
17362
17644
|
assignString(line, "cliVersion", optionalString(payload?.cli_version));
|
|
17363
17645
|
assignString(line, "modelProvider", optionalString(payload?.model_provider));
|
|
17646
|
+
assignString(line, "originator", optionalString(payload?.originator));
|
|
17647
|
+
assignString(line, "source", optionalString(payload?.source));
|
|
17364
17648
|
return line;
|
|
17365
17649
|
}
|
|
17366
17650
|
function parseTurnContext(payload, timestamp) {
|
|
@@ -17568,10 +17852,16 @@ function isRecord2(value) {
|
|
|
17568
17852
|
}
|
|
17569
17853
|
|
|
17570
17854
|
// packages/narrative/dist/parse.js
|
|
17855
|
+
var IMAGE_CAPTION_LINE = /^\s*\[Image: original \d+x\d+, displayed at \d+x\d+\.[^\]]*\]\s*$/u;
|
|
17856
|
+
function stripImageCaptions(body) {
|
|
17857
|
+
return body.split(/\r?\n/u).filter((line) => !IMAGE_CAPTION_LINE.test(line)).join("\n").trim();
|
|
17858
|
+
}
|
|
17571
17859
|
function userRequestText(text) {
|
|
17572
17860
|
let body = text.trim();
|
|
17573
17861
|
if (/^<(task-notification|system-reminder)\b/u.test(body))
|
|
17574
17862
|
return "";
|
|
17863
|
+
if (IMAGE_CAPTION_LINE.test(body.split(/\r?\n/u, 1)[0] ?? ""))
|
|
17864
|
+
body = stripImageCaptions(body);
|
|
17575
17865
|
let browserEnvelope = false;
|
|
17576
17866
|
if (/^<in-app-browser-context\b/u.test(body)) {
|
|
17577
17867
|
const end = body.indexOf("</in-app-browser-context>");
|
|
@@ -17593,6 +17883,9 @@ function userRequestText(text) {
|
|
|
17593
17883
|
function isHarnessSystemNotice(text) {
|
|
17594
17884
|
if (/^\s*<in-app-browser-context\b/u.test(text))
|
|
17595
17885
|
return userRequestText(text) === "";
|
|
17886
|
+
if (IMAGE_CAPTION_LINE.test(text.trim().split(/\r?\n/u, 1)[0] ?? "")) {
|
|
17887
|
+
return userRequestText(text) === "";
|
|
17888
|
+
}
|
|
17596
17889
|
return /^\s*<(task-notification|system-reminder|in-app-browser-context)\b/u.test(text);
|
|
17597
17890
|
}
|
|
17598
17891
|
function parseTranscriptLine(line) {
|
|
@@ -18840,7 +19133,7 @@ function isRecord5(value) {
|
|
|
18840
19133
|
// apps/cli/dist/project-index.js
|
|
18841
19134
|
init_dist();
|
|
18842
19135
|
import { lstat, readFile as readFile3, realpath, stat as stat3 } from "node:fs/promises";
|
|
18843
|
-
import { dirname as dirname15, isAbsolute as isAbsolute4, join as
|
|
19136
|
+
import { dirname as dirname15, isAbsolute as isAbsolute4, join as join25, relative as relative3, resolve as resolve11 } from "node:path";
|
|
18844
19137
|
var PROJECT_ROOT_MAX_DIRECTORIES = 8;
|
|
18845
19138
|
var PROJECT_PLAN_POLL_MS = 2e3;
|
|
18846
19139
|
async function resolveProjectRoot(cwd, options) {
|
|
@@ -18852,8 +19145,8 @@ async function resolveProjectRoot(cwd, options) {
|
|
|
18852
19145
|
pathIdentity(homeDir),
|
|
18853
19146
|
boundaryDir === void 0 ? void 0 : pathIdentity(boundaryDir)
|
|
18854
19147
|
]);
|
|
18855
|
-
const wingmanHomeIdentity = await pathIdentity(
|
|
18856
|
-
const planPathIdentity = await pathIdentity(
|
|
19148
|
+
const wingmanHomeIdentity = await pathIdentity(join25(homeIdentity, ".wingman"));
|
|
19149
|
+
const planPathIdentity = await pathIdentity(join25(rootIdentity, ".wingman", "plan.md"));
|
|
18857
19150
|
if (rootIdentity === homeIdentity || rootIdentity === wingmanHomeIdentity || boundaryIdentity !== void 0 && !isWithin(boundaryIdentity, rootIdentity)) {
|
|
18858
19151
|
return {
|
|
18859
19152
|
root,
|
|
@@ -18874,7 +19167,7 @@ async function resolveProjectRoot(cwd, options) {
|
|
|
18874
19167
|
break;
|
|
18875
19168
|
if (boundaryIdentity !== void 0 && !isWithin(boundaryIdentity, currentIdentity))
|
|
18876
19169
|
break;
|
|
18877
|
-
const planPath =
|
|
19170
|
+
const planPath = join25(current, ".wingman", "plan.md");
|
|
18878
19171
|
lookedUp.push(planPath);
|
|
18879
19172
|
try {
|
|
18880
19173
|
await lstat(planPath);
|
|
@@ -18990,11 +19283,11 @@ function isWithin(parent, child) {
|
|
|
18990
19283
|
// apps/cli/dist/project-roots.js
|
|
18991
19284
|
init_dist();
|
|
18992
19285
|
import { randomBytes as randomBytes2 } from "node:crypto";
|
|
18993
|
-
import { closeSync, mkdirSync as mkdirSync10, openSync, readFileSync as readFileSync15, renameSync as renameSync3, rmSync as rmSync8, statSync as
|
|
18994
|
-
import { dirname as dirname16, isAbsolute as isAbsolute5, join as
|
|
19286
|
+
import { closeSync, mkdirSync as mkdirSync10, openSync, readFileSync as readFileSync15, renameSync as renameSync3, rmSync as rmSync8, statSync as statSync7, writeFileSync as writeFileSync11 } from "node:fs";
|
|
19287
|
+
import { dirname as dirname16, isAbsolute as isAbsolute5, join as join26 } from "node:path";
|
|
18995
19288
|
var PROJECT_ROOTS_MAX_ENTRIES = 200;
|
|
18996
19289
|
function projectRootsPath(homeDir) {
|
|
18997
|
-
return
|
|
19290
|
+
return join26(homeDir, ".wingman", "state", "projects.json");
|
|
18998
19291
|
}
|
|
18999
19292
|
function readProjectRoots(homeDir) {
|
|
19000
19293
|
const path = projectRootsPath(homeDir);
|
|
@@ -19054,7 +19347,7 @@ function pruneProjectRoots(homeDir) {
|
|
|
19054
19347
|
return current;
|
|
19055
19348
|
const roots = Object.fromEntries(Object.entries(current.roots).filter(([, entry]) => {
|
|
19056
19349
|
try {
|
|
19057
|
-
|
|
19350
|
+
statSync7(join26(entry.root, ".wingman", "plan.md"));
|
|
19058
19351
|
return true;
|
|
19059
19352
|
} catch (error) {
|
|
19060
19353
|
return !isErrno(error, "ENOENT") && !isErrno(error, "ENOTDIR");
|
|
@@ -19080,7 +19373,7 @@ function limitRoots(roots) {
|
|
|
19080
19373
|
}
|
|
19081
19374
|
function writeProjectRoots(homeDir, state) {
|
|
19082
19375
|
const path = projectRootsPath(homeDir);
|
|
19083
|
-
const tempPath =
|
|
19376
|
+
const tempPath = join26(dirname16(path), `.projects-${randomBytes2(8).toString("hex")}.tmp`);
|
|
19084
19377
|
let fd;
|
|
19085
19378
|
try {
|
|
19086
19379
|
mkdirSync10(dirname16(path), { recursive: true, mode: 448 });
|
|
@@ -19129,9 +19422,9 @@ function isErrno(error, code) {
|
|
|
19129
19422
|
init_dist();
|
|
19130
19423
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
19131
19424
|
import { closeSync as closeSync2, copyFileSync as copyFileSync2, mkdirSync as mkdirSync11, openSync as openSync2, readFileSync as readFileSync16, renameSync as renameSync4, rmSync as rmSync9, writeFileSync as writeFileSync12 } from "node:fs";
|
|
19132
|
-
import { dirname as dirname17, join as
|
|
19425
|
+
import { dirname as dirname17, join as join27 } from "node:path";
|
|
19133
19426
|
function taskOverlayPath(homeDir) {
|
|
19134
|
-
return
|
|
19427
|
+
return join27(homeDir, ".wingman", "state", "task-overlay.json");
|
|
19135
19428
|
}
|
|
19136
19429
|
function readTaskOverlay(homeDir) {
|
|
19137
19430
|
const path = taskOverlayPath(homeDir);
|
|
@@ -19254,7 +19547,7 @@ function patchProjectOverlay(homeDir, root, patch, now) {
|
|
|
19254
19547
|
}
|
|
19255
19548
|
function writeTaskOverlay(homeDir, overlay) {
|
|
19256
19549
|
const path = taskOverlayPath(homeDir);
|
|
19257
|
-
const tempPath =
|
|
19550
|
+
const tempPath = join27(dirname17(path), `.task-overlay-${randomBytes3(8).toString("hex")}.tmp`);
|
|
19258
19551
|
let fd;
|
|
19259
19552
|
try {
|
|
19260
19553
|
mkdirSync11(dirname17(path), { recursive: true, mode: 448 });
|
|
@@ -19335,7 +19628,7 @@ function resolveWingmanVersion({ defined, moduleUrl = import.meta.url, readPacka
|
|
|
19335
19628
|
return void 0;
|
|
19336
19629
|
}
|
|
19337
19630
|
function wingmanVersion() {
|
|
19338
|
-
const defined = false ? void 0 : "0.9.
|
|
19631
|
+
const defined = false ? void 0 : "0.9.5";
|
|
19339
19632
|
return resolveWingmanVersion({
|
|
19340
19633
|
defined,
|
|
19341
19634
|
readPackage: (url) => JSON.parse(readFileSync17(url, "utf8"))
|
|
@@ -19344,6 +19637,7 @@ function wingmanVersion() {
|
|
|
19344
19637
|
|
|
19345
19638
|
// apps/cli/dist/narrative-service.js
|
|
19346
19639
|
var MAX_SESSIONS = 8;
|
|
19640
|
+
var STARTUP_DISCOVERY_WINDOW_MS = 30 * 6e4;
|
|
19347
19641
|
var ENDED_AFTER_STOP_MS = 10 * 6e4;
|
|
19348
19642
|
var DETAIL_LIMIT = 80;
|
|
19349
19643
|
var QUOTE_LIMIT = 160;
|
|
@@ -19394,7 +19688,7 @@ function createNarrativeService(options = {}) {
|
|
|
19394
19688
|
return;
|
|
19395
19689
|
let signature = "missing";
|
|
19396
19690
|
try {
|
|
19397
|
-
const info =
|
|
19691
|
+
const info = statSync8(join28(options.homeDir, ".codex", ".codex-global-state.json"));
|
|
19398
19692
|
signature = `${info.mtimeMs}:${info.ctimeMs}:${info.size}:${info.mode}`;
|
|
19399
19693
|
} catch {
|
|
19400
19694
|
}
|
|
@@ -19549,7 +19843,7 @@ function createNarrativeService(options = {}) {
|
|
|
19549
19843
|
function watchResolution(resolution) {
|
|
19550
19844
|
if (resolution.lookedUp.length === 0)
|
|
19551
19845
|
return;
|
|
19552
|
-
const planPath = resolution.planPath ??
|
|
19846
|
+
const planPath = resolution.planPath ?? join28(resolution.root, ".wingman", "plan.md");
|
|
19553
19847
|
const planPathIdentity = resolution.planPathIdentity;
|
|
19554
19848
|
if (projectWatchers.has(planPathIdentity))
|
|
19555
19849
|
return;
|
|
@@ -19634,13 +19928,60 @@ function createNarrativeService(options = {}) {
|
|
|
19634
19928
|
});
|
|
19635
19929
|
}
|
|
19636
19930
|
}
|
|
19931
|
+
async function discoverStartupSessions() {
|
|
19932
|
+
const homeDir = options.homeDir;
|
|
19933
|
+
if (closed || homeDir === void 0)
|
|
19934
|
+
return;
|
|
19935
|
+
const scanAt = now().getTime();
|
|
19936
|
+
await Promise.all([
|
|
19937
|
+
["cc", discoverRecentSessions],
|
|
19938
|
+
["codex", discoverRecentSessions2]
|
|
19939
|
+
].map(async ([harness, discover]) => {
|
|
19940
|
+
const sessions = sessionsOf(harness);
|
|
19941
|
+
const limit = MAX_SESSIONS - sessions.size;
|
|
19942
|
+
if (limit <= 0)
|
|
19943
|
+
return;
|
|
19944
|
+
try {
|
|
19945
|
+
const recent = await discover(homeDir, {
|
|
19946
|
+
now: scanAt,
|
|
19947
|
+
windowMs: STARTUP_DISCOVERY_WINDOW_MS,
|
|
19948
|
+
limit
|
|
19949
|
+
});
|
|
19950
|
+
for (const record of recent) {
|
|
19951
|
+
if (closed || sessions.size >= MAX_SESSIONS)
|
|
19952
|
+
break;
|
|
19953
|
+
if (sessions.has(record.id))
|
|
19954
|
+
continue;
|
|
19955
|
+
const session = sessionOf(harness, record.id);
|
|
19956
|
+
if (record.cwd !== void 0) {
|
|
19957
|
+
anchorCwd(harness, session, record.cwd);
|
|
19958
|
+
const base = pathBasename(record.cwd);
|
|
19959
|
+
if (base !== "")
|
|
19960
|
+
session.label = base;
|
|
19961
|
+
}
|
|
19962
|
+
session.discoveredAt = startedAt;
|
|
19963
|
+
session.lastActivity = new Date(record.mtime).toISOString();
|
|
19964
|
+
resetTranscript(session, record.transcriptPath);
|
|
19965
|
+
if (follow) {
|
|
19966
|
+
startFollowing(harness, session, record.transcriptPath);
|
|
19967
|
+
if (harness === "cc")
|
|
19968
|
+
startSubagentDiscovery(harness, session, record.transcriptPath);
|
|
19969
|
+
}
|
|
19970
|
+
notify(harness);
|
|
19971
|
+
}
|
|
19972
|
+
} catch {
|
|
19973
|
+
process.stderr.write(`[wingman] ${harness} startup discovery failed; skipped this harness.
|
|
19974
|
+
`);
|
|
19975
|
+
}
|
|
19976
|
+
}));
|
|
19977
|
+
}
|
|
19637
19978
|
function projectChanged(planPathIdentity) {
|
|
19638
19979
|
for (const [harness, sessions] of harnesses) {
|
|
19639
19980
|
let changed = false;
|
|
19640
19981
|
for (const session of sessions.values()) {
|
|
19641
19982
|
const resolution = session.projectResolution;
|
|
19642
19983
|
if (resolution?.planPathIdentity === planPathIdentity) {
|
|
19643
|
-
const planPath = resolution.planPath ??
|
|
19984
|
+
const planPath = resolution.planPath ?? join28(resolution.root, ".wingman", "plan.md");
|
|
19644
19985
|
void applyPendingPlanWrites(session, planPath, planPathIdentity).then(() => {
|
|
19645
19986
|
session.dirty = true;
|
|
19646
19987
|
notify(harness);
|
|
@@ -19685,7 +20026,7 @@ function createNarrativeService(options = {}) {
|
|
|
19685
20026
|
}
|
|
19686
20027
|
const resolution = session.projectResolution;
|
|
19687
20028
|
if (resolution !== void 0) {
|
|
19688
|
-
const planPath = resolution.planPath ??
|
|
20029
|
+
const planPath = resolution.planPath ?? join28(resolution.root, ".wingman", "plan.md");
|
|
19689
20030
|
void applyPendingPlanWrites(session, planPath, resolution.planPathIdentity).then(() => {
|
|
19690
20031
|
session.dirty = true;
|
|
19691
20032
|
notify(harness);
|
|
@@ -19809,6 +20150,9 @@ function createNarrativeService(options = {}) {
|
|
|
19809
20150
|
if (parsed.kind !== "unknown")
|
|
19810
20151
|
timestamp = parsed.timestamp;
|
|
19811
20152
|
}
|
|
20153
|
+
if (session.discoveredAt !== void 0 && path === session.transcriptPath && timestamp !== void 0) {
|
|
20154
|
+
session.lastActivity = timestamp;
|
|
20155
|
+
}
|
|
19812
20156
|
const endedAt = session.endedAt ?? session.stopAt;
|
|
19813
20157
|
if (timestamp !== void 0 && endedAt !== void 0 && Date.parse(timestamp) > Date.parse(endedAt)) {
|
|
19814
20158
|
session.endedAt = void 0;
|
|
@@ -19823,7 +20167,7 @@ function createNarrativeService(options = {}) {
|
|
|
19823
20167
|
const sessionDir = transcriptPath.replace(/\.jsonl$/, "");
|
|
19824
20168
|
if (sessionDir === transcriptPath)
|
|
19825
20169
|
return;
|
|
19826
|
-
const subagentsDir =
|
|
20170
|
+
const subagentsDir = join28(sessionDir, "subagents");
|
|
19827
20171
|
const generation = session.generation;
|
|
19828
20172
|
const poll = async () => {
|
|
19829
20173
|
try {
|
|
@@ -19833,7 +20177,7 @@ function createNarrativeService(options = {}) {
|
|
|
19833
20177
|
}
|
|
19834
20178
|
for (const entry of entries) {
|
|
19835
20179
|
if (/^agent-.*\.jsonl$/.test(entry)) {
|
|
19836
|
-
startFollowing(harness, session,
|
|
20180
|
+
startFollowing(harness, session, join28(subagentsDir, entry), generation);
|
|
19837
20181
|
}
|
|
19838
20182
|
}
|
|
19839
20183
|
} catch {
|
|
@@ -19851,6 +20195,7 @@ function createNarrativeService(options = {}) {
|
|
|
19851
20195
|
const sessionId = typeof payload.session_id === "string" ? payload.session_id : void 0;
|
|
19852
20196
|
const key = sessionId ?? transcriptPath ?? "__nosession__";
|
|
19853
20197
|
const session = sessionOf(event.harness, key);
|
|
20198
|
+
session.discoveredAt = void 0;
|
|
19854
20199
|
session.lastActivity = event.received_at;
|
|
19855
20200
|
const cwd = typeof payload.cwd === "string" ? payload.cwd : void 0;
|
|
19856
20201
|
if (cwd !== void 0) {
|
|
@@ -20067,13 +20412,19 @@ function createNarrativeService(options = {}) {
|
|
|
20067
20412
|
const infos = [...sessions.values()].map((session) => {
|
|
20068
20413
|
const user = overlayEntries[`${harness}:${session.id}`];
|
|
20069
20414
|
const lastActivity = lastActivityOf(session);
|
|
20415
|
+
const state = deriveCached(harness, session, configuredPlugins, configuredMcpServers);
|
|
20416
|
+
const ended = isEnded(session, nowIso);
|
|
20417
|
+
const turnEnded = session.stopAt !== void 0 && !ended && state.waiting === null && feedbackView(harness, feedback, humanFeedbackState(harness, session)).state !== "needs_user";
|
|
20070
20418
|
return {
|
|
20071
20419
|
id: session.id,
|
|
20420
|
+
...session.discoveredAt === void 0 ? {} : { discovered: true },
|
|
20421
|
+
...state.origin === void 0 ? {} : { origin: state.origin },
|
|
20072
20422
|
label: session.projectResolution?.isHome ? t("narrative.homeDirectory") : session.label ?? shortSessionId(session.id),
|
|
20073
20423
|
...session.cwd === void 0 ? {} : { cwd: session.cwd },
|
|
20074
20424
|
lastActivity,
|
|
20075
|
-
waiting:
|
|
20076
|
-
ended
|
|
20425
|
+
waiting: state.waiting !== null,
|
|
20426
|
+
ended,
|
|
20427
|
+
...turnEnded ? { turnEnded: true } : {},
|
|
20077
20428
|
archived: user?.archived === true,
|
|
20078
20429
|
archivedHasNewActivity: user?.archived === true && user.archivedAt !== void 0 && Date.parse(lastActivity) > Date.parse(user.archivedAt),
|
|
20079
20430
|
...feedback === void 0 ? {} : { feedback }
|
|
@@ -20265,7 +20616,7 @@ function createNarrativeService(options = {}) {
|
|
|
20265
20616
|
continue;
|
|
20266
20617
|
const resolution = group.resolution;
|
|
20267
20618
|
const root = resolution?.root ?? (group.cardId === void 0 ? resolve12(members[0]?.session.cwd ?? rootIdentity) : rootIdentity);
|
|
20268
|
-
const planPath = resolution?.planPath ??
|
|
20619
|
+
const planPath = resolution?.planPath ?? join28(root, ".wingman", "plan.md");
|
|
20269
20620
|
const runtime = projectFiles.get(resolution?.planPathIdentity ?? planPath);
|
|
20270
20621
|
if (runtime?.current !== void 0 && runtime.readFailureKey === void 0 && runtime.parsedLocale !== getLocale()) {
|
|
20271
20622
|
runtime.parsed = parseProjectPlan(runtime.current.content, {
|
|
@@ -20294,8 +20645,11 @@ function createNarrativeService(options = {}) {
|
|
|
20294
20645
|
return {
|
|
20295
20646
|
harness,
|
|
20296
20647
|
id: session.id,
|
|
20648
|
+
...info?.discovered === void 0 ? {} : { discovered: true },
|
|
20297
20649
|
label,
|
|
20298
20650
|
ended: info?.ended ?? false,
|
|
20651
|
+
...info?.turnEnded === true ? { turnEnded: true } : {},
|
|
20652
|
+
...state?.origin === void 0 ? {} : { origin: state.origin },
|
|
20299
20653
|
...state?.skillsUsed === void 0 ? {} : { skillsUsed: state.skillsUsed },
|
|
20300
20654
|
title: attachedTitle !== void 0 ? { text: attachedTitle, source: "plan.md \u6B65\u9AA4" } : planInstruction !== void 0 ? { text: truncate(planInstruction, DETAIL_LIMIT), source: "\u8BA1\u5212\u6240\u5C5E\u6307\u4EE4" } : instructionTitle !== void 0 ? { text: truncate(instructionTitle, DETAIL_LIMIT), source: "\u6700\u65B0\u6307\u4EE4" } : { text: label, source: "\u5DE5\u4F5C\u76EE\u5F55" },
|
|
20301
20655
|
user: {
|
|
@@ -20479,6 +20833,8 @@ function createNarrativeService(options = {}) {
|
|
|
20479
20833
|
}
|
|
20480
20834
|
function close() {
|
|
20481
20835
|
closed = true;
|
|
20836
|
+
if (startupDiscovery !== void 0)
|
|
20837
|
+
clearImmediate(startupDiscovery);
|
|
20482
20838
|
for (const sessions of harnesses.values()) {
|
|
20483
20839
|
for (const session of sessions.values())
|
|
20484
20840
|
closeSession(session);
|
|
@@ -20505,6 +20861,7 @@ function createNarrativeService(options = {}) {
|
|
|
20505
20861
|
notify(changed);
|
|
20506
20862
|
}
|
|
20507
20863
|
loadRememberedProjectRoots();
|
|
20864
|
+
const startupDiscovery = options.discoverOnStart === false ? void 0 : setImmediate(() => void discoverStartupSessions());
|
|
20508
20865
|
return {
|
|
20509
20866
|
setCodexPluginsProvider(provider) {
|
|
20510
20867
|
codexPluginsProvider = provider;
|
|
@@ -21040,9 +21397,16 @@ function derive(harness, session, nowIso, configuredPlugins, configuredMcpServer
|
|
|
21040
21397
|
const skillsUsed = harness === "cc" ? observedSkills(lines2) : [];
|
|
21041
21398
|
const mcpUsed = harness === "cc" ? observedMcpServers(lines2, configuredMcpServers) : [];
|
|
21042
21399
|
const pluginsUsed = harness === "codex" ? observedPlugins(codexLines, configuredPlugins) : [];
|
|
21400
|
+
const meta = session.codexLines.find((line) => line.kind === "session_meta");
|
|
21043
21401
|
return {
|
|
21044
21402
|
harness,
|
|
21045
21403
|
sessionId: session.id,
|
|
21404
|
+
...harness !== "codex" || !meta?.originator ? {} : {
|
|
21405
|
+
origin: {
|
|
21406
|
+
originator: meta.originator,
|
|
21407
|
+
...meta.source === void 0 ? {} : { source: meta.source }
|
|
21408
|
+
}
|
|
21409
|
+
},
|
|
21046
21410
|
transcriptPath: session.transcriptPath ?? null,
|
|
21047
21411
|
...skillsUsed.length === 0 ? {} : { skillsUsed },
|
|
21048
21412
|
...mcpUsed.length === 0 ? {} : { mcpUsed },
|
|
@@ -21628,7 +21992,7 @@ init_dist6();
|
|
|
21628
21992
|
init_dist3();
|
|
21629
21993
|
init_dist();
|
|
21630
21994
|
import { homedir as homedir14 } from "node:os";
|
|
21631
|
-
import { createInterface } from "node:readline/promises";
|
|
21995
|
+
import { createInterface as createInterface3 } from "node:readline/promises";
|
|
21632
21996
|
var ProtocolUsageError = class extends Error {
|
|
21633
21997
|
};
|
|
21634
21998
|
async function runProtocolCli(args, options = { homeDir: homedir14() }) {
|
|
@@ -21785,7 +22149,7 @@ function lines(text) {
|
|
|
21785
22149
|
return values;
|
|
21786
22150
|
}
|
|
21787
22151
|
async function confirmWrite() {
|
|
21788
|
-
const prompt =
|
|
22152
|
+
const prompt = createInterface3({ input: process.stdin, output: process.stdout });
|
|
21789
22153
|
try {
|
|
21790
22154
|
const answer = await prompt.question(t("cli.confirmWrite"));
|
|
21791
22155
|
return answer.trim().toLowerCase() === "y" || answer.trim().toLowerCase() === "yes";
|
|
@@ -21846,10 +22210,14 @@ async function loadHarness(harness, mode) {
|
|
|
21846
22210
|
}
|
|
21847
22211
|
|
|
21848
22212
|
// apps/cli/dist/return-target.js
|
|
22213
|
+
init_dist2();
|
|
21849
22214
|
init_dist();
|
|
21850
22215
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
21851
|
-
import { closeSync as closeSync3, copyFileSync as copyFileSync3, mkdirSync as mkdirSync12, openSync as openSync3, readFileSync as readFileSync18, renameSync as renameSync5, rmSync as rmSync10, statSync as
|
|
21852
|
-
import { dirname as dirname18, join as
|
|
22216
|
+
import { closeSync as closeSync3, copyFileSync as copyFileSync3, mkdirSync as mkdirSync12, openSync as openSync3, readFileSync as readFileSync18, renameSync as renameSync5, rmSync as rmSync10, statSync as statSync9, writeFileSync as writeFileSync13 } from "node:fs";
|
|
22217
|
+
import { dirname as dirname18, join as join29, resolve as resolve13 } from "node:path";
|
|
22218
|
+
function isHarnessId3(value) {
|
|
22219
|
+
return typeof value === "string" && HARNESS_IDS.includes(value);
|
|
22220
|
+
}
|
|
21853
22221
|
function isIslandSetting(value) {
|
|
21854
22222
|
return isRecord8(value) && Object.keys(value).every((key) => ["edge", "offset", "screen", "size"].includes(key)) && ["top", "bottom", "left", "right"].includes(value.edge) && typeof value.offset === "number" && Number.isFinite(value.offset) && value.offset >= 0 && value.offset <= 1 && (value.screen === void 0 || typeof value.screen === "string") && (value.size === "compact" || value.size === "standard");
|
|
21855
22223
|
}
|
|
@@ -21863,13 +22231,13 @@ var BUNDLES = [
|
|
|
21863
22231
|
["kitty", "kitty.app"],
|
|
21864
22232
|
["VS Code", "Visual Studio Code.app"]
|
|
21865
22233
|
];
|
|
21866
|
-
function detectReturnTargets(homeDir, roots = ["/Applications",
|
|
22234
|
+
function detectReturnTargets(homeDir, roots = ["/Applications", join29(homeDir, "Applications")]) {
|
|
21867
22235
|
const available = [];
|
|
21868
22236
|
for (const [name, bundle] of BUNDLES) {
|
|
21869
22237
|
for (const root of new Set(roots.map((root2) => resolve13(root2)))) {
|
|
21870
|
-
const bundlePath =
|
|
22238
|
+
const bundlePath = join29(root, bundle);
|
|
21871
22239
|
try {
|
|
21872
|
-
if (
|
|
22240
|
+
if (statSync9(bundlePath).isDirectory())
|
|
21873
22241
|
available.push({ name, bundlePath });
|
|
21874
22242
|
} catch {
|
|
21875
22243
|
}
|
|
@@ -21878,7 +22246,7 @@ function detectReturnTargets(homeDir, roots = ["/Applications", join27(homeDir,
|
|
|
21878
22246
|
return available;
|
|
21879
22247
|
}
|
|
21880
22248
|
function settingsPath(homeDir) {
|
|
21881
|
-
return
|
|
22249
|
+
return join29(homeDir, ".wingman", "state", "settings.json");
|
|
21882
22250
|
}
|
|
21883
22251
|
function readReturnTargetSettings(homeDir) {
|
|
21884
22252
|
let raw;
|
|
@@ -21908,12 +22276,15 @@ function saveSettings(homeDir, patch) {
|
|
|
21908
22276
|
if (patch.island !== void 0 && !isIslandSetting(patch.island)) {
|
|
21909
22277
|
return { unavailable: t("cli.server.settingsInvalid") };
|
|
21910
22278
|
}
|
|
22279
|
+
if (patch.freeHarness !== void 0 && !isHarnessId3(patch.freeHarness)) {
|
|
22280
|
+
return { unavailable: t("cli.server.settingsInvalid") };
|
|
22281
|
+
}
|
|
21911
22282
|
const current = readReturnTargetSettings(homeDir);
|
|
21912
22283
|
if ("unavailable" in current)
|
|
21913
22284
|
return current;
|
|
21914
22285
|
const settings = { ...current, ...patch };
|
|
21915
22286
|
const path = settingsPath(homeDir);
|
|
21916
|
-
const tempPath =
|
|
22287
|
+
const tempPath = join29(dirname18(path), `.settings-${randomBytes4(8).toString("hex")}.tmp`);
|
|
21917
22288
|
let fd;
|
|
21918
22289
|
try {
|
|
21919
22290
|
mkdirSync12(dirname18(path), { recursive: true, mode: 448 });
|
|
@@ -21946,10 +22317,10 @@ function saveSettings(homeDir, patch) {
|
|
|
21946
22317
|
}
|
|
21947
22318
|
}
|
|
21948
22319
|
function isSettings(value) {
|
|
21949
|
-
if (!isRecord8(value) || value.version !== 1 || !Object.keys(value).every((key) => ["version", "returnTarget", "locale", "island"].includes(key))) {
|
|
22320
|
+
if (!isRecord8(value) || value.version !== 1 || !Object.keys(value).every((key) => ["version", "returnTarget", "locale", "island", "freeHarness"].includes(key))) {
|
|
21950
22321
|
return false;
|
|
21951
22322
|
}
|
|
21952
|
-
return (value.island === void 0 || isIslandSetting(value.island)) && (value.returnTarget === void 0 || isRecord8(value.returnTarget) && Object.keys(value.returnTarget).every((key) => key === "bundlePath") && typeof value.returnTarget.bundlePath === "string" && value.returnTarget.bundlePath.startsWith("/"));
|
|
22323
|
+
return (value.island === void 0 || isIslandSetting(value.island)) && (value.freeHarness === void 0 || isHarnessId3(value.freeHarness)) && (value.returnTarget === void 0 || isRecord8(value.returnTarget) && Object.keys(value.returnTarget).every((key) => key === "bundlePath") && typeof value.returnTarget.bundlePath === "string" && value.returnTarget.bundlePath.startsWith("/"));
|
|
21953
22324
|
}
|
|
21954
22325
|
function isRecord8(value) {
|
|
21955
22326
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -21959,7 +22330,7 @@ function isRecord8(value) {
|
|
|
21959
22330
|
import { randomBytes as randomBytes5 } from "node:crypto";
|
|
21960
22331
|
import { closeSync as closeSync4, mkdirSync as mkdirSync13, openSync as openSync4, readFileSync as readFileSync19, renameSync as renameSync6, rmSync as rmSync11, writeFileSync as writeFileSync14 } from "node:fs";
|
|
21961
22332
|
import { homedir as homedir16 } from "node:os";
|
|
21962
|
-
import { dirname as dirname19, join as
|
|
22333
|
+
import { dirname as dirname19, join as join30 } from "node:path";
|
|
21963
22334
|
function createHookToken() {
|
|
21964
22335
|
return randomBytes5(32).toString("base64url");
|
|
21965
22336
|
}
|
|
@@ -21970,8 +22341,8 @@ function writeServeRuntimeState(port, token, options = {}) {
|
|
|
21970
22341
|
const pid = options.pid ?? process.pid;
|
|
21971
22342
|
const suffix = randomBytes5(8).toString("base64url");
|
|
21972
22343
|
const owner = `serve-${startedAtMs}-${pid}-${suffix}`;
|
|
21973
|
-
const path =
|
|
21974
|
-
const tempPath =
|
|
22344
|
+
const path = join30(options.homeDir ?? homedir16(), ".wingman", "state", "serve", `${owner}.json`);
|
|
22345
|
+
const tempPath = join30(dirname19(path), `.${owner}.tmp`);
|
|
21975
22346
|
const contents = Buffer.from(`${JSON.stringify({ version: 2, owner, pid, port, startedAtMs, token })}
|
|
21976
22347
|
`, "utf8");
|
|
21977
22348
|
let fd;
|
|
@@ -22375,7 +22746,17 @@ async function handle(req, res, options, warn, runtime) {
|
|
|
22375
22746
|
return;
|
|
22376
22747
|
}
|
|
22377
22748
|
if (url.pathname === "/api/license") {
|
|
22378
|
-
|
|
22749
|
+
const body = publicLicenseStatus(licenseStatus(options.licenseOptions));
|
|
22750
|
+
body.tier = checkLicense(options.licenseOptions) ? "full" : "free";
|
|
22751
|
+
if (body.tier === "free") {
|
|
22752
|
+
const cached = runtime.anatomy?.configs;
|
|
22753
|
+
const detected = new Set((cached ?? []).map((config) => config.harness));
|
|
22754
|
+
const homeDir = options.homeDir ?? options.licenseOptions?.homeDir;
|
|
22755
|
+
const settings = homeDir === void 0 ? void 0 : readReturnTargetSettings(homeDir);
|
|
22756
|
+
const selected = settings && !("unavailable" in settings) ? settings.freeHarness : void 0;
|
|
22757
|
+
body.freeHarness = selected !== void 0 && (cached === void 0 || detected.has(selected)) ? selected : HARNESS_IDS.find((harness) => detected.has(harness)) ?? HARNESS_IDS[0];
|
|
22758
|
+
}
|
|
22759
|
+
sendJson2(res, 200, body);
|
|
22379
22760
|
return;
|
|
22380
22761
|
}
|
|
22381
22762
|
if (url.pathname === "/api/projects") {
|
|
@@ -22582,10 +22963,6 @@ async function handleActionApply(req, res, options, runtime) {
|
|
|
22582
22963
|
sendJson2(res, 403, { error: t("cli.server.fixturesAction") });
|
|
22583
22964
|
return;
|
|
22584
22965
|
}
|
|
22585
|
-
if (!checkLicense(options.licenseOptions)) {
|
|
22586
|
-
sendJson2(res, 403, { error: t("cli.server.subscriptionRequired") });
|
|
22587
|
-
return;
|
|
22588
|
-
}
|
|
22589
22966
|
const body = await readJsonBody(req);
|
|
22590
22967
|
if (body === void 0) {
|
|
22591
22968
|
sendJson2(res, 400, { error: t("cli.server.jsonBody") });
|
|
@@ -22595,6 +22972,10 @@ async function handleActionApply(req, res, options, runtime) {
|
|
|
22595
22972
|
handleProtocolUserAction(body, res, options, runtime);
|
|
22596
22973
|
return;
|
|
22597
22974
|
}
|
|
22975
|
+
if (!checkLicense(options.licenseOptions)) {
|
|
22976
|
+
sendJson2(res, 403, { error: t("cli.server.subscriptionRequired") });
|
|
22977
|
+
return;
|
|
22978
|
+
}
|
|
22598
22979
|
const { harness, plan } = body;
|
|
22599
22980
|
const loaded = pickHarness(options, harness);
|
|
22600
22981
|
if (!loaded) {
|
|
@@ -22688,13 +23069,18 @@ async function handleSettings(req, res, options, runtime) {
|
|
|
22688
23069
|
}
|
|
22689
23070
|
if (req.method === "POST") {
|
|
22690
23071
|
const body = await readJsonBody(req);
|
|
22691
|
-
if (!isRecord9(body) || Object.keys(body).length === 0 || Object.keys(body).some((key) =>
|
|
23072
|
+
if (!isRecord9(body) || Object.keys(body).length === 0 || Object.keys(body).some((key) => !["locale", "island", "freeHarness"].includes(key)) || body.locale !== void 0 && !locales().some(({ tag }) => tag === body.locale) || body.island !== void 0 && !isIslandSetting(body.island) || body.freeHarness !== void 0 && !isHarnessId4(body.freeHarness)) {
|
|
22692
23073
|
sendJson2(res, 400, { error: t("cli.server.settingsInvalid") });
|
|
22693
23074
|
return;
|
|
22694
23075
|
}
|
|
23076
|
+
if (isHarnessId4(body.freeHarness) && runtime.anatomy !== null && !runtime.anatomy.configs.some((config) => config.harness === body.freeHarness)) {
|
|
23077
|
+
sendJson2(res, 400, { error: t("cli.server.freeHarnessNotDetected") });
|
|
23078
|
+
return;
|
|
23079
|
+
}
|
|
22695
23080
|
const result5 = saveSettings(options.homeDir, {
|
|
22696
23081
|
...body.locale === void 0 ? {} : { locale: body.locale },
|
|
22697
|
-
...isIslandSetting(body.island) ? { island: body.island } : {}
|
|
23082
|
+
...isIslandSetting(body.island) ? { island: body.island } : {},
|
|
23083
|
+
...isHarnessId4(body.freeHarness) ? { freeHarness: body.freeHarness } : {}
|
|
22698
23084
|
});
|
|
22699
23085
|
if ("unavailable" in result5) {
|
|
22700
23086
|
sendJson2(res, 409, { error: result5.unavailable });
|
|
@@ -22715,7 +23101,8 @@ async function handleSettings(req, res, options, runtime) {
|
|
|
22715
23101
|
sendJson2(res, 200, {
|
|
22716
23102
|
...resolved,
|
|
22717
23103
|
available: locales(),
|
|
22718
|
-
..."unavailable" in settings || settings.island === void 0 ? {} : { island: settings.island }
|
|
23104
|
+
..."unavailable" in settings || settings.island === void 0 ? {} : { island: settings.island },
|
|
23105
|
+
..."unavailable" in settings || settings.freeHarness === void 0 ? {} : { freeHarness: settings.freeHarness }
|
|
22719
23106
|
});
|
|
22720
23107
|
}
|
|
22721
23108
|
async function handleReturn(req, res, options, activate) {
|
|
@@ -22816,7 +23203,7 @@ async function handleLicenseInstall(req, res, options) {
|
|
|
22816
23203
|
sendJson2(res, 400, { error: result5.error });
|
|
22817
23204
|
return;
|
|
22818
23205
|
}
|
|
22819
|
-
sendJson2(res, 200, publicLicenseStatus(result5.status));
|
|
23206
|
+
sendJson2(res, 200, { ...publicLicenseStatus(result5.status), tier: "full" });
|
|
22820
23207
|
}
|
|
22821
23208
|
async function handleLicenseRefresh(res, options) {
|
|
22822
23209
|
const homeDir = options.licenseRefreshOptions?.homeDir ?? options.licenseOptions?.homeDir;
|
|
@@ -22844,6 +23231,7 @@ async function handleLicenseRefresh(res, options) {
|
|
|
22844
23231
|
};
|
|
22845
23232
|
sendJson2(res, 200, {
|
|
22846
23233
|
...publicLicenseStatus(licenseStatus(statusOptions)),
|
|
23234
|
+
tier: "full",
|
|
22847
23235
|
message: result5.message
|
|
22848
23236
|
});
|
|
22849
23237
|
}
|
|
@@ -22885,7 +23273,7 @@ function isToggleRequest(value) {
|
|
|
22885
23273
|
return o.kind === "toggle" && typeof o.itemId === "string" && typeof o.enable === "boolean";
|
|
22886
23274
|
}
|
|
22887
23275
|
function isTaskOverlayRequest(value) {
|
|
22888
|
-
if (!isRecord9(value) || !
|
|
23276
|
+
if (!isRecord9(value) || !isHarnessId4(value.harness))
|
|
22889
23277
|
return false;
|
|
22890
23278
|
if ("root" in value)
|
|
22891
23279
|
return false;
|
|
@@ -22909,7 +23297,7 @@ function isProjectOverlayRequest(value) {
|
|
|
22909
23297
|
const keys = Object.keys(value.patch);
|
|
22910
23298
|
return keys.length > 0 && keys.every((key) => ["pinned", "order", "hidden", "archived"].includes(key)) && (value.patch.pinned === void 0 || typeof value.patch.pinned === "boolean") && (value.patch.hidden === void 0 || typeof value.patch.hidden === "boolean") && (value.patch.archived === void 0 || typeof value.patch.archived === "boolean") && (value.patch.order === void 0 || typeof value.patch.order === "number" && Number.isSafeInteger(value.patch.order) && value.patch.order >= 0);
|
|
22911
23299
|
}
|
|
22912
|
-
function
|
|
23300
|
+
function isHarnessId4(value) {
|
|
22913
23301
|
return typeof value === "string" && HARNESS_IDS.includes(value);
|
|
22914
23302
|
}
|
|
22915
23303
|
function isRecord9(value) {
|
|
@@ -23107,6 +23495,7 @@ async function runServe(args) {
|
|
|
23107
23495
|
}
|
|
23108
23496
|
const panelDistDir = panelDist === void 0 ? resolve15(dirname20(fileURLToPath2(import.meta.url)), "../../panel/dist") : resolve15(panelDist);
|
|
23109
23497
|
const narrative = createNarrativeService({
|
|
23498
|
+
discoverOnStart: !fixtures,
|
|
23110
23499
|
followTranscripts: !fixtures,
|
|
23111
23500
|
homeDir,
|
|
23112
23501
|
...fixtures ? { projectBoundaryDir: fixturesRoot } : {},
|
|
@@ -23161,7 +23550,7 @@ async function runHook(args) {
|
|
|
23161
23550
|
if (action !== "install" && action !== "uninstall" || harness === void 0) {
|
|
23162
23551
|
throw new UsageError(t("cli.hookUsage"));
|
|
23163
23552
|
}
|
|
23164
|
-
if (!
|
|
23553
|
+
if (!isHarnessId5(harness)) {
|
|
23165
23554
|
throw new UsageError(t("cli.hookHarness", { ids: HARNESS_IDS.join("|"), harness }));
|
|
23166
23555
|
}
|
|
23167
23556
|
let port = 7333;
|
|
@@ -23271,7 +23660,7 @@ function parseScanArgs(args) {
|
|
|
23271
23660
|
json = true;
|
|
23272
23661
|
} else if (arg === "--harness") {
|
|
23273
23662
|
const value = rest.shift();
|
|
23274
|
-
if (value === void 0 || !
|
|
23663
|
+
if (value === void 0 || !isHarnessId5(value)) {
|
|
23275
23664
|
throw new UsageError(t("cli.scanHarness", {
|
|
23276
23665
|
ids: HARNESS_IDS.join("|"),
|
|
23277
23666
|
value: value ?? t("cli.missingArgument")
|
|
@@ -23318,7 +23707,7 @@ function parseServeArgs(args) {
|
|
|
23318
23707
|
}
|
|
23319
23708
|
return { port, fixtures, panelDist, locale };
|
|
23320
23709
|
}
|
|
23321
|
-
function
|
|
23710
|
+
function isHarnessId5(value) {
|
|
23322
23711
|
return HARNESS_IDS.includes(value);
|
|
23323
23712
|
}
|
|
23324
23713
|
main(process.argv.slice(2)).then((code) => {
|