@fbincon/claude-code-statusline 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -75
- package/candidate.json +392 -297
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js +2 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/profiles.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +5 -3
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js +24 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/diagnostics/service.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +8 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.d.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.js +168 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup-service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.js +64 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/setup.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +24 -4
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +46 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js +117 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js +118 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/providers.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js +359 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/sources/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +2 -2
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +31 -1
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +5 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +15 -5
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +14 -7
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +6 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +24 -6
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/profile-manager.ts +21 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/quick-setup.ts +14 -11
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/setup.ts +60 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-manager.ts +301 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/source-validation.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +577 -10
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +1164 -6
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +2 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +21 -18
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +6 -2
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +1 -1
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +3 -3
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +91 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +250 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +5 -2
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +21 -12
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +7 -10
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +15 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +4 -2
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +7 -2
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +37 -3
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js +2 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/profiles.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +5 -3
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +26 -2
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +3 -3
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +263 -6
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +486 -3
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +4 -2
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +29 -6
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +16 -7
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js +26 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/profile-manager.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.d.ts +4 -4
- package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js +16 -9
- package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.d.ts +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.js +96 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/setup.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.d.ts +39 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js +270 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-manager.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js +45 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/source-validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/extensions/portable.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +1158 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +1164 -6
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-HK.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js +27 -1
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-TW.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +25 -3
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +18 -5
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/diagnose.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js +35 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/extensions.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +12 -6
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +30 -9
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +15 -5
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +78 -48
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +3 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +2 -2
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +15 -4
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -1
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/links.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +194 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +194 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +194 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +194 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +194 -1
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +194 -1
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js +26 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/posix-source-exec.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js +37 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.d.ts +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js +122 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/source-process.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js +61 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.d.ts +3 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js +61 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/windows-source-job.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js +3 -2
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/canvas.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +6 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +2 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +2 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +6 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.d.ts +12 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.js +75 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/setup.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +1 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +12 -1
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
- package/package.json +1 -1
|
@@ -1632,5 +1632,198 @@
|
|
|
1632
1632
|
"task.value.stop_pending": "等待停止確認",
|
|
1633
1633
|
"task.value.queued": "排隊中",
|
|
1634
1634
|
"task.value.waiting agents": "等待代理",
|
|
1635
|
-
"task.value.main wrap-up": "主任務收尾"
|
|
1635
|
+
"task.value.main wrap-up": "主任務收尾",
|
|
1636
|
+
"errors.powerline.value": "無效的 Powerline 選項:{field}",
|
|
1637
|
+
"fields.global.powerline.padding.label": "色塊留白(每側一個空格)",
|
|
1638
|
+
"fields.global.powerline.separator.label": "色塊分隔形狀",
|
|
1639
|
+
"fields.global.powerline.start_cap.label": "首端裝飾",
|
|
1640
|
+
"fields.global.powerline.end_cap.label": "尾端裝飾",
|
|
1641
|
+
"fields.global.powerline.color_mode.label": "跨行色塊配色",
|
|
1642
|
+
"quick.copy": "另存為命名方案",
|
|
1643
|
+
"quick.purpose.daily-development": "日常開發 — 完整精簡方案",
|
|
1644
|
+
"quick.purpose.agent-focus": "多代理任務 — 保留失敗狀態",
|
|
1645
|
+
"quick.purpose.quota-watch": "額度監控 — 用量與重設視窗",
|
|
1646
|
+
"quick.requirements.daily-development": "使用 Claude 輸入、本機 Git 與任務計時。費用可在第二行開啟。選擇方案不會啟用收集。",
|
|
1647
|
+
"quick.requirements.agent-focus": "代理行需要受支援的 Claude 輸入。執行狀態、進度與數量需要另行啟用即時指標;任務計時與代理耗時範圍不同。隱藏已完成代理,保留失敗代理。",
|
|
1648
|
+
"quick.requirements.quota-watch": "需要已觀測的額度與重設欄位。缺失或過期視窗不顯示,絕不當作零。費用與快取僅在有資料時顯示。選擇方案不會啟用收集。",
|
|
1649
|
+
"values.left": "左",
|
|
1650
|
+
"values.right": "右",
|
|
1651
|
+
"values.both": "兩側",
|
|
1652
|
+
"values.arrow": "箭頭",
|
|
1653
|
+
"values.slash": "斜線",
|
|
1654
|
+
"values.bar": "直線",
|
|
1655
|
+
"values.semantic": "依元件含義",
|
|
1656
|
+
"values.continuous": "跨行連續",
|
|
1657
|
+
"values.restart": "每行重設",
|
|
1658
|
+
"cli.help.guided_setup": "檢查、預覽並接入狀態列",
|
|
1659
|
+
"setup.title": "狀態列設定精靈",
|
|
1660
|
+
"setup.checks": "1. 環境與設定檢查",
|
|
1661
|
+
"setup.choice": "2. 選擇顯示設定",
|
|
1662
|
+
"setup.quick": "3. 方案與外觀",
|
|
1663
|
+
"setup.review": "4. 套用前檢閱",
|
|
1664
|
+
"setup.continue": "繼續",
|
|
1665
|
+
"setup.blocked": "儲存前請解決錯誤;Esc 結束",
|
|
1666
|
+
"setup.integration_blocked": "暫不能接入 — 請先解決檢查問題",
|
|
1667
|
+
"setup.keep": "保留目前顯示 / 內建預設值",
|
|
1668
|
+
"setup.choose": "選擇並預覽方案",
|
|
1669
|
+
"setup.integrate": "儲存顯示並接入 Claude",
|
|
1670
|
+
"setup.save": "僅儲存顯示",
|
|
1671
|
+
"setup.cancel": "取消",
|
|
1672
|
+
"setup.sample": "固定範例 — 尚未驗證實際工作階段顯示",
|
|
1673
|
+
"setup.resource": "計畫變更資源",
|
|
1674
|
+
"setup.keys": "上下選擇 · Enter 繼續 · 退格返回 · PgUp/PgDn 詳情 · Tab 預覽 · L 語言(即時儲存) · Esc 取消",
|
|
1675
|
+
"setup.small": "請擴大至至少 64 欄 × 18 行;Esc 取消。",
|
|
1676
|
+
"setup.review_note": "顯示儲存與接入是獨立提交;保留宿主偏好與收集選擇。捲動檢視變更與資源。",
|
|
1677
|
+
"setup.language_failed": "無法儲存語言,已保留原語言。",
|
|
1678
|
+
"setup.node": "Node {version};支援範圍:{supported}",
|
|
1679
|
+
"setup.host": "Claude {version};精靈接入需要已知版本 >= 2.1.205。不支援的功能保持暫停。",
|
|
1680
|
+
"setup.directory": "設定位置可存取:{path}(唯讀權限檢查)",
|
|
1681
|
+
"setup.target": "目標:{path} 中的使用者預設;保留 {profiles} 個方案及 {bindings} 個專案繫結。",
|
|
1682
|
+
"setup.bound_project": "目前專案使用 {path} 的 {name};修改使用者預設不會替換該繫結。",
|
|
1683
|
+
"setup.display_valid": "顯示、設定與方案檔案有效",
|
|
1684
|
+
"setup.preferences": "保留選項:原生編輯器 {native};外部編輯器 {external};原生計時 {timing};即時指標 {live}。",
|
|
1685
|
+
"setup.plugins": "原生編輯器接入:{native}。官方外掛操作僅在套用後執行;重新啟動驗證仍待完成。",
|
|
1686
|
+
"setup.ownership": "安裝預檢通過;未變更資源",
|
|
1687
|
+
"setup.conflict": "設定在檢閱後發生變更。請重新執行 setup 並檢閱新狀態。",
|
|
1688
|
+
"setup.integration_failed": "接入未完成,請檢查報告的外掛狀態。",
|
|
1689
|
+
"setup.verification_failed": "寫入的資源未通過全部安裝檢查。",
|
|
1690
|
+
"setup.tty": "互動設定需要終端機。使用 setup --dry-run 進行唯讀檢查,或使用以下現有命令:",
|
|
1691
|
+
"setup.dry_run": "唯讀設定檢查。未選擇方案,未建立檔案。",
|
|
1692
|
+
"setup.steps": "步驟:檢查 → 保留/選擇 → 預覽 → 檢閱 → 明確儲存/接入 → 驗證資源 → 重新啟動 Claude 檢查實際顯示。",
|
|
1693
|
+
"setup.cancelled": "已在套用前取消。顯示與接入未變更;明確儲存的介面語言仍保留。",
|
|
1694
|
+
"setup.committed_display": "顯示儲存完成。",
|
|
1695
|
+
"setup.committed_integration": "接入操作已返回;正在檢查資源。",
|
|
1696
|
+
"setup.stage_review": "顯示儲存前",
|
|
1697
|
+
"setup.stage_display": "顯示已儲存;接入可能未完成",
|
|
1698
|
+
"setup.stage_integration": "接入操作已返回",
|
|
1699
|
+
"setup.stage_verified": "資源已驗證",
|
|
1700
|
+
"setup.partial": "停止階段:{stage}。未執行整個流程回復。請檢查 doctor;有待處理交易時先執行 recover,再重試 setup。",
|
|
1701
|
+
"setup.success": "資源已驗證。請重新啟動 Claude 驗證實際顯示;使用 /statusline-config 或 configure 繼續調整。",
|
|
1702
|
+
"setup.saved_only": "顯示已儲存;尚未套用接入。準備接入 Claude 時請再次執行 setup。",
|
|
1703
|
+
"setup.value.requested": "要求啟用",
|
|
1704
|
+
"setup.value.disabled": "已關閉",
|
|
1705
|
+
"setup.value.suspended": "已暫停",
|
|
1706
|
+
"setup.value.unknown": "未知",
|
|
1707
|
+
"sources.title": "資料來源",
|
|
1708
|
+
"sources.separate_save": "資料來源獨立儲存;顯示綁定仍需儲存顯示設定。",
|
|
1709
|
+
"sources.add": "新增資料來源",
|
|
1710
|
+
"sources.edit": "編輯(停用資料來源)",
|
|
1711
|
+
"sources.review": "檢視並啟用",
|
|
1712
|
+
"sources.disable": "停用",
|
|
1713
|
+
"sources.enabled": "已啟用",
|
|
1714
|
+
"sources.disabled": "已停用",
|
|
1715
|
+
"sources.remove": "刪除資料來源",
|
|
1716
|
+
"sources.bind": "綁定至元件",
|
|
1717
|
+
"sources.unbind": "解除元件繫結",
|
|
1718
|
+
"sources.refresh": "立即重新整理",
|
|
1719
|
+
"sources.status": "重新整理狀態",
|
|
1720
|
+
"sources.cancel": "取消執行中的重新整理",
|
|
1721
|
+
"sources.diagnose": "檢視來源與觀測",
|
|
1722
|
+
"sources.json": "本機 JSON 檔案",
|
|
1723
|
+
"sources.github": "GitHub PR 與檢查",
|
|
1724
|
+
"sources.command": "指定程式與參數",
|
|
1725
|
+
"sources.save": "儲存資料來源",
|
|
1726
|
+
"sources.reload": "重新載入資料來源",
|
|
1727
|
+
"sources.empty": "尚未註冊本機資料來源。",
|
|
1728
|
+
"sources.saved": "資料來源已儲存;變更後須重新檢視才能啟用。",
|
|
1729
|
+
"sources.bound": "已綁定至顯示草稿;儲存顯示設定後生效。",
|
|
1730
|
+
"sources.failed": "資料來源操作失敗;請檢查欄位或重新載入目前狀態。",
|
|
1731
|
+
"sources.refresh_started": "已開始重新整理。可檢視狀態或取消;關閉會取消未完成的工作。",
|
|
1732
|
+
"sources.form_help": "Tab/Enter:下一欄位 · Ctrl+S:儲存為停用狀態",
|
|
1733
|
+
"sources.no_components": "請先在主狀態列或子代理頁新增外部元件。",
|
|
1734
|
+
"sources.remove_confirm": "Enter 刪除此本機資料來源與綁定:",
|
|
1735
|
+
"sources.enable_review": "請檢視全部欄位。Enter 啟用此修訂;Esc 取消。",
|
|
1736
|
+
"sources.help": "管理本機明確啟用的資料來源。手動重新整理;繪製不執行命令或網路查詢。",
|
|
1737
|
+
"sources.field.id": "資料來源 ID",
|
|
1738
|
+
"sources.field.name": "名稱",
|
|
1739
|
+
"sources.field.project": "專案 / worktree 路徑",
|
|
1740
|
+
"sources.field.session": "工作階段 ID(選填)",
|
|
1741
|
+
"sources.field.agent": "子代理 ID(選填)",
|
|
1742
|
+
"sources.field.ttl_seconds": "有效期限(秒)",
|
|
1743
|
+
"sources.field.path": "JSON 檔案路徑",
|
|
1744
|
+
"sources.field.pointer": "數值 JSON Pointer",
|
|
1745
|
+
"sources.field.observed_at_pointer": "觀察時間 JSON Pointer",
|
|
1746
|
+
"sources.field.unit": "單位(選填)",
|
|
1747
|
+
"sources.field.host": "GitHub 主機名稱",
|
|
1748
|
+
"sources.field.repository": "儲存庫(owner/name)",
|
|
1749
|
+
"sources.field.branch": "分支",
|
|
1750
|
+
"sources.field.account": "GitHub 帳號",
|
|
1751
|
+
"sources.field.pr": "PR 編號(選填)",
|
|
1752
|
+
"sources.field.executable": "可執行程式",
|
|
1753
|
+
"sources.field.args": "參數(JSON 陣列)",
|
|
1754
|
+
"sources.field.cwd": "工作目錄",
|
|
1755
|
+
"sources.field.input": "輸入欄位(JSON 對應)",
|
|
1756
|
+
"sources.field.output": "輸出:json / text",
|
|
1757
|
+
"sources.field.timeout_ms": "逾時(毫秒)",
|
|
1758
|
+
"statusline.source.value": "外部值",
|
|
1759
|
+
"statusline.source.unbound": "未綁定",
|
|
1760
|
+
"statusline.source.disabled": "已停用",
|
|
1761
|
+
"statusline.source.mismatch": "範圍不符",
|
|
1762
|
+
"statusline.source.missing": "缺少",
|
|
1763
|
+
"statusline.source.partial": "部分結果",
|
|
1764
|
+
"statusline.source.error": "錯誤",
|
|
1765
|
+
"statusline.source.unsupported": "不支援",
|
|
1766
|
+
"statusline.source.stale": "已過期",
|
|
1767
|
+
"statusline.source.unknown": "時間未知",
|
|
1768
|
+
"statusline.source.unknown_checks": "檢查未知",
|
|
1769
|
+
"statusline.source.no_pr": "無 PR",
|
|
1770
|
+
"statusline.source.no_checks": "無檢查",
|
|
1771
|
+
"statusline.source.failure": "失敗",
|
|
1772
|
+
"statusline.source.pending": "等待中",
|
|
1773
|
+
"statusline.source.success": "通過",
|
|
1774
|
+
"statusline.source.cancelled": "已取消",
|
|
1775
|
+
"statusline.source.skipped": "已略過",
|
|
1776
|
+
"sources.error.invalid": "資料來源設定無效",
|
|
1777
|
+
"sources.error.pointer": "JSON Pointer 無效",
|
|
1778
|
+
"sources.error.input": "不支援的輸入對應",
|
|
1779
|
+
"sources.error.scope": "資料來源範圍不符",
|
|
1780
|
+
"sources.error.version": "不支援的觀測版本",
|
|
1781
|
+
"sources.error.time": "觀察時間無效",
|
|
1782
|
+
"sources.error.type": "需要純量值",
|
|
1783
|
+
"sources.error.not_found": "找不到資料來源或重新整理工作",
|
|
1784
|
+
"sources.error.conflict": "資料來源設定已變更,請重新載入",
|
|
1785
|
+
"sources.error.review": "啟用前請檢視此修訂",
|
|
1786
|
+
"sources.error.binding": "請選擇相容的外部元件",
|
|
1787
|
+
"sources.error.disabled": "資料來源已停用",
|
|
1788
|
+
"sources.error.busy": "已有重新整理工作執行中",
|
|
1789
|
+
"sources.error.output_limit": "輸出超過 1 MiB",
|
|
1790
|
+
"sources.error.missing_program": "找不到可執行程式",
|
|
1791
|
+
"sources.error.missing_file": "找不到 JSON 檔案",
|
|
1792
|
+
"sources.error.timeout": "重新整理逾時",
|
|
1793
|
+
"sources.error.cancelled": "重新整理已取消",
|
|
1794
|
+
"sources.error.identity": "儲存庫、帳號、分支或 HEAD 已變更",
|
|
1795
|
+
"sources.error.account": "目前 GitHub 帳號不符",
|
|
1796
|
+
"sources.error.ambiguous": "請明確選擇 PR 編號",
|
|
1797
|
+
"sources.error.lookup_failed": "GitHub 查詢失敗",
|
|
1798
|
+
"sources.error.invalid_output": "資料來源輸出無效",
|
|
1799
|
+
"sources.error.read_error": "無法讀取資料來源檔案",
|
|
1800
|
+
"sources.error.refresh_failed": "重新整理失敗",
|
|
1801
|
+
"sources.error.authentication": "GitHub 認證無法使用",
|
|
1802
|
+
"sources.error.permission": "GitHub 存取遭拒",
|
|
1803
|
+
"sources.error.network": "GitHub 網路要求失敗",
|
|
1804
|
+
"sources.error.rate_limit": "GitHub 請求次數超限",
|
|
1805
|
+
"fields.item.link.label": "連結",
|
|
1806
|
+
"settings.sources": "資料來源",
|
|
1807
|
+
"native.settings.sources": "資料來源",
|
|
1808
|
+
"ui.actions.sources": "資料來源",
|
|
1809
|
+
"cli.help.source_management": "資料來源",
|
|
1810
|
+
"catalog.categories.extensions": "資料來源",
|
|
1811
|
+
"items.main.external-value.label": "外部值",
|
|
1812
|
+
"items.main.external-value.description": "管理本機明確啟用的資料來源。手動重新整理;繪製不執行命令或網路查詢。",
|
|
1813
|
+
"statusline.prefix.main.external-value": "外部值",
|
|
1814
|
+
"statusline.short.main.external-value": "外部值",
|
|
1815
|
+
"items.subagent.external-value.label": "外部值",
|
|
1816
|
+
"items.subagent.external-value.description": "管理本機明確啟用的資料來源。手動重新整理;繪製不執行命令或網路查詢。",
|
|
1817
|
+
"statusline.prefix.subagent.external-value": "外部值",
|
|
1818
|
+
"statusline.short.subagent.external-value": "外部值",
|
|
1819
|
+
"items.main.github-pr.label": "GitHub PR",
|
|
1820
|
+
"items.main.github-pr.description": "管理本機明確啟用的資料來源。手動重新整理;繪製不執行命令或網路查詢。",
|
|
1821
|
+
"statusline.prefix.main.github-pr": "GitHub PR",
|
|
1822
|
+
"statusline.short.main.github-pr": "GitHub PR",
|
|
1823
|
+
"items.main.github-ci.label": "GitHub CI",
|
|
1824
|
+
"items.main.github-ci.description": "管理本機明確啟用的資料來源。手動重新整理;繪製不執行命令或網路查詢。",
|
|
1825
|
+
"statusline.prefix.main.github-ci": "GitHub CI",
|
|
1826
|
+
"statusline.short.main.github-ci": "GitHub CI",
|
|
1827
|
+
"explain.reason.source_bound": "已綁定本機資料來源;啟用狀態與實際可用性須另外檢查。",
|
|
1828
|
+
"explain.reason.source_unbound": "請明確綁定本機資料來源;範例不代表實際資料。"
|
|
1636
1829
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function execSource(): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A short-lived execve handoff: unlike execvp, it never retries ENOEXEC in sh. */
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { nativeFunction } from './native.js';
|
|
4
|
+
export function execSource() {
|
|
5
|
+
try {
|
|
6
|
+
const spec = JSON.parse(process.env.STATUSLINE_SOURCE_LAUNCH ?? 'null');
|
|
7
|
+
if (process.platform === 'win32' || !spec || typeof spec.executable !== 'string' || !Array.isArray(spec.args) || spec.args.some((arg) => typeof arg !== 'string') || !spec.environment || typeof spec.environment !== 'object')
|
|
8
|
+
throw new Error('Invalid source handoff');
|
|
9
|
+
const environment = Object.entries(spec.environment).filter((entry) => typeof entry[1] === 'string').map(([key, value]) => key + '=' + value);
|
|
10
|
+
const library = process.platform === 'darwin' ? '/usr/lib/libSystem.B.dylib' : 'libc.so.6';
|
|
11
|
+
const fcntl = nativeFunction(library, 'int fcntl(int fd, int command, ...)');
|
|
12
|
+
// Node marks inherited stdio close-on-exec during startup. Preserve only
|
|
13
|
+
// the three pipes explicitly provided by the source process adapter.
|
|
14
|
+
for (const fd of [0, 1, 2])
|
|
15
|
+
if (fcntl(fd, 2, 'int', 0) < 0)
|
|
16
|
+
throw new Error('Cannot preserve source pipes');
|
|
17
|
+
// execve replaces this process, preserving its process group and pipes.
|
|
18
|
+
// https://man7.org/linux/man-pages/man2/execve.2.html
|
|
19
|
+
nativeFunction(library, 'int execve(const char *file, const char **argv, const char **envp)')(spec.executable, [spec.executable, ...spec.args, null], [...environment, null]);
|
|
20
|
+
}
|
|
21
|
+
catch { /* Handoff errors must never disclose the command environment. */ }
|
|
22
|
+
process.exitCode = 126;
|
|
23
|
+
}
|
|
24
|
+
if (process.argv[1] === fileURLToPath(import.meta.url))
|
|
25
|
+
execSource();
|
|
26
|
+
//# sourceMappingURL=posix-source-exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix-source-exec.js","sourceRoot":"","sources":["../../src/posix-source-exec.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,UAAU,UAAU;IACtB,IAAI,CAAC;QACD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,MAAM,CAAC,CAAC;QACxE,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAY,EAAE,EAAE,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,OAAO,IAAI,CAAC,WAAW,KAAK,QAAQ;YACnO,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC9C,MAAM,WA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lstatSync } from 'node:fs';
|
|
2
|
+
import { MAX_SOURCE_BYTES } from '@fbincon/statusline-core/extensions/model';
|
|
3
|
+
import { isLinkOrReparse, fileIdentity, sameFileIdentity } from './files.js';
|
|
4
|
+
/** Reject devices/FIFOs and links before reading; bound growth during the read too. */
|
|
5
|
+
export function readSourceFile(path) {
|
|
6
|
+
let fd;
|
|
7
|
+
try {
|
|
8
|
+
const before = lstatSync(path, { bigint: true });
|
|
9
|
+
if (!before.isFile() || isLinkOrReparse(path))
|
|
10
|
+
throw new Error('file_type');
|
|
11
|
+
const identity = fileIdentity(path, before);
|
|
12
|
+
fd = openSync(path, constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
13
|
+
const stat = fstatSync(fd, { bigint: true });
|
|
14
|
+
if (!stat.isFile() || stat.size > MAX_SOURCE_BYTES || !sameFileIdentity(identity, stat))
|
|
15
|
+
throw new Error('file_size_or_type');
|
|
16
|
+
const bytes = Buffer.alloc(MAX_SOURCE_BYTES + 1);
|
|
17
|
+
let size = 0, count;
|
|
18
|
+
while (size < bytes.length && (count = readSync(fd, bytes, size, bytes.length - size, null)) > 0)
|
|
19
|
+
size += count;
|
|
20
|
+
if (size > MAX_SOURCE_BYTES)
|
|
21
|
+
throw new Error('output_limit');
|
|
22
|
+
const after = fstatSync(fd, { bigint: true });
|
|
23
|
+
if (after.mtimeNs !== stat.mtimeNs || after.size !== stat.size)
|
|
24
|
+
throw new Error('file_changed');
|
|
25
|
+
return bytes.subarray(0, size);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (error.code === 'ENOENT')
|
|
29
|
+
return null;
|
|
30
|
+
throw error;
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
if (fd !== undefined)
|
|
34
|
+
closeSync(fd);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=source-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,EAAE,KAAa,CAAC;QAC5B,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,CAAC,GAAG,CAAC;YAC5F,IAAI,IAAI,KAAK,CAAC;QAClB,IAAI,IAAI,GAAG,gBAAgB;YACvB,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,SAAS,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;YAC1D,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,KAAK,EAAE,CAAC;QACX,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ;YAClD,OAAO,IAAI,CAAC;QAChB,MAAM,KAAK,CAAC;IAChB,CAAC;YACO,CAAC;QACL,IAAI,EAAE,KAAK,SAAS;YAChB,SAAS,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SourceProcessOptions {
|
|
2
|
+
executable: string;
|
|
3
|
+
args: readonly string[];
|
|
4
|
+
cwd: string;
|
|
5
|
+
input: string;
|
|
6
|
+
timeoutMs: number;
|
|
7
|
+
signal?: AbortSignal;
|
|
8
|
+
environment?: NodeJS.ProcessEnv;
|
|
9
|
+
}
|
|
10
|
+
export interface SourceProcessResult {
|
|
11
|
+
code: number | null;
|
|
12
|
+
stdout: string;
|
|
13
|
+
errorKind?: 'authentication' | 'permission' | 'network' | 'rate_limit' | 'no_checks';
|
|
14
|
+
reason: 'completed' | 'exit' | 'missing_program' | 'timeout' | 'cancelled' | 'output_limit' | 'io_error' | 'invalid_output';
|
|
15
|
+
}
|
|
16
|
+
/** User commands inherit only the OS essentials, never model/forge credentials. */
|
|
17
|
+
export declare function sourceEnvironment(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
18
|
+
/** Bound the entire tree, both output streams and the final pipe drain. No shell. */
|
|
19
|
+
export declare function runSourceProcess(options: SourceProcessOptions): Promise<SourceProcessResult>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { which } from './commands.js';
|
|
5
|
+
import { windowsJobScript } from './windows-source-job.js';
|
|
6
|
+
import { windowsSourceEnvironment, WINDOWS_RUNTIME_FOLDERS } from './windows-source-environment.js';
|
|
7
|
+
import { decodeUtf8 } from './utf8.js';
|
|
8
|
+
/** User commands inherit only the OS essentials, never model/forge credentials. */
|
|
9
|
+
export function sourceEnvironment(env = process.env) {
|
|
10
|
+
const allowed = new Set(['PATH', 'HOME', 'USER', 'LOGNAME', 'USERPROFILE', 'SYSTEMROOT', 'WINDIR', 'COMSPEC', 'PATHEXT', 'TEMP', 'TMP', 'TMPDIR', 'LANG', 'LC_ALL', 'LC_CTYPE', ...(process.platform === 'win32' ? WINDOWS_RUNTIME_FOLDERS : [])]);
|
|
11
|
+
return Object.fromEntries(Object.entries(env).filter(([key]) => allowed.has(key.toUpperCase())));
|
|
12
|
+
}
|
|
13
|
+
/** Bound the entire tree, both output streams and the final pipe drain. No shell. */
|
|
14
|
+
export function runSourceProcess(options) {
|
|
15
|
+
if (options.signal?.aborted)
|
|
16
|
+
return Promise.resolve({ code: null, stdout: '', reason: 'cancelled' });
|
|
17
|
+
return new Promise(resolve => {
|
|
18
|
+
const started = performance.now(), windows = process.platform === 'win32', commandEnvironment = { ...(options.environment ?? sourceEnvironment()) };
|
|
19
|
+
let environment = commandEnvironment;
|
|
20
|
+
const lookupEnvironment = windows ? Object.fromEntries(Object.entries(commandEnvironment).map(([key, value]) => [key.toUpperCase(), value])) : commandEnvironment;
|
|
21
|
+
const found = which(options.executable, lookupEnvironment);
|
|
22
|
+
if (!found) {
|
|
23
|
+
resolve({ code: null, stdout: '', reason: 'missing_program' });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let executable = found, args = [...options.args];
|
|
27
|
+
if (windows) {
|
|
28
|
+
try {
|
|
29
|
+
environment = windowsSourceEnvironment(commandEnvironment);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
resolve({ code: null, stdout: '', reason: 'io_error' });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
environment.STATUSLINE_SOURCE_LAUNCH = JSON.stringify({ executable, args, cwd: options.cwd, environment: commandEnvironment });
|
|
36
|
+
executable = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32/WindowsPowerShell/v1.0/powershell.exe');
|
|
37
|
+
args = ['-NoLogo', '-NoProfile', '-NonInteractive', '-EncodedCommand', Buffer.from(windowsJobScript, 'utf16le').toString('base64')];
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// Node/libuv uses execvp, whose ENOEXEC fallback can run plain text
|
|
41
|
+
// in /bin/sh even with shell:false. Hand off through execve instead.
|
|
42
|
+
// Bootstrap Node without applying target-only NODE_OPTIONS/LD_*.
|
|
43
|
+
environment = sourceEnvironment(commandEnvironment);
|
|
44
|
+
environment.STATUSLINE_SOURCE_LAUNCH = JSON.stringify({ executable, args, environment: commandEnvironment });
|
|
45
|
+
executable = process.execPath;
|
|
46
|
+
args = [fileURLToPath(new URL('./posix-source-exec.js', import.meta.url))];
|
|
47
|
+
}
|
|
48
|
+
const child = spawn(executable, args, { cwd: options.cwd, env: environment, shell: false, detached: !windows, windowsHide: true, stdio: ['pipe', 'pipe', 'pipe'] });
|
|
49
|
+
let reason = 'completed', code = null, bytes = 0, done = false;
|
|
50
|
+
const chunks = [], errors = [];
|
|
51
|
+
let drain;
|
|
52
|
+
const kill = () => {
|
|
53
|
+
try {
|
|
54
|
+
if (!windows && child.pid)
|
|
55
|
+
process.kill(-child.pid, 'SIGKILL');
|
|
56
|
+
else
|
|
57
|
+
child.kill('SIGKILL');
|
|
58
|
+
}
|
|
59
|
+
catch { /* Already exited. */ }
|
|
60
|
+
};
|
|
61
|
+
const finish = () => {
|
|
62
|
+
if (done)
|
|
63
|
+
return;
|
|
64
|
+
done = true;
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
if (drain)
|
|
67
|
+
clearTimeout(drain);
|
|
68
|
+
options.signal?.removeEventListener('abort', cancel);
|
|
69
|
+
child.stdin.destroy();
|
|
70
|
+
child.stdout.destroy();
|
|
71
|
+
child.stderr.destroy();
|
|
72
|
+
const detail = Buffer.concat(errors).toString('utf8');
|
|
73
|
+
const errorKind = /^no checks reported on the '[^\r\n]*' branch\s*$/u.test(detail) ? 'no_checks' : /rate limit|HTTP 429/iu.test(detail) ? 'rate_limit' : /HTTP 403|forbidden|not accessible|permission denied/iu.test(detail) ? 'permission' : /HTTP 401|auth login|not logged|authentication/iu.test(detail) ? 'authentication' : /timeout|connection|resolve host|network|TLS|dial tcp|\bEOF\b/iu.test(detail) ? 'network' : undefined;
|
|
74
|
+
let stdout = '';
|
|
75
|
+
try {
|
|
76
|
+
stdout = decodeUtf8(Buffer.concat(chunks));
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
if (reason === 'completed')
|
|
80
|
+
reason = 'invalid_output';
|
|
81
|
+
}
|
|
82
|
+
resolve({ code, stdout, ...(errorKind ? { errorKind } : {}), reason: reason === 'completed' && code !== 0 ? 'exit' : reason });
|
|
83
|
+
};
|
|
84
|
+
const stop = (why) => {
|
|
85
|
+
if (done || reason !== 'completed')
|
|
86
|
+
return;
|
|
87
|
+
reason = why;
|
|
88
|
+
kill();
|
|
89
|
+
drain = setTimeout(finish, 500);
|
|
90
|
+
};
|
|
91
|
+
const cancel = () => stop('cancelled');
|
|
92
|
+
const timer = setTimeout(() => stop('timeout'), Math.max(1, options.timeoutMs - (performance.now() - started)));
|
|
93
|
+
options.signal?.addEventListener('abort', cancel, { once: true });
|
|
94
|
+
const output = (data, stdout) => {
|
|
95
|
+
bytes += data.length;
|
|
96
|
+
if (bytes > 1048576) {
|
|
97
|
+
stop('output_limit');
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (stdout)
|
|
101
|
+
chunks.push(data);
|
|
102
|
+
else
|
|
103
|
+
errors.push(data);
|
|
104
|
+
};
|
|
105
|
+
child.stdout.on('data', data => output(data, true));
|
|
106
|
+
child.stderr.on('data', data => output(data, false));
|
|
107
|
+
child.stdin.on('error', error => {
|
|
108
|
+
if (error.code !== 'EPIPE')
|
|
109
|
+
stop('io_error');
|
|
110
|
+
});
|
|
111
|
+
child.once('error', error => { reason = error.code === 'ENOENT' ? 'missing_program' : 'io_error'; finish(); });
|
|
112
|
+
child.once('exit', status => {
|
|
113
|
+
code = status;
|
|
114
|
+
kill(); // Also terminate descendants after their parent exits normally.
|
|
115
|
+
if (!done)
|
|
116
|
+
drain = setTimeout(finish, 500);
|
|
117
|
+
});
|
|
118
|
+
child.once('close', finish);
|
|
119
|
+
child.stdin.end(options.input, 'utf8');
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=source-process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-process.js","sourceRoot":"","sources":["../../src/source-process.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBA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static supervisor with valid .NET known folders. The tool
|
|
3
|
+
* receives the original, separately serialized minimum environment instead. */
|
|
4
|
+
export declare function windowsSourceEnvironment(command: NodeJS.ProcessEnv, folders?: Record<string, string>): NodeJS.ProcessEnv;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { nativeApi, nativeFunction, winError } from './native.js';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
export const WINDOWS_RUNTIME_FOLDERS = ['USERPROFILE', 'HOME', 'HOMEDRIVE', 'HOMEPATH', 'APPDATA', 'LOCALAPPDATA', 'SYSTEMDRIVE', 'PROGRAMDATA', 'PROGRAMFILES', 'PROGRAMFILES(X86)', 'PROGRAMW6432', 'COMMONPROGRAMFILES', 'COMMONPROGRAMFILES(X86)', 'COMMONPROGRAMW6432'];
|
|
4
|
+
/** Recover the loaded Windows profile independently of a caller's isolated HOME.
|
|
5
|
+
* Only OS folder variables leave this adapter; registry credentials never do.
|
|
6
|
+
* https://learn.microsoft.com/windows/win32/api/userenv/nf-userenv-createenvironmentblock
|
|
7
|
+
*/
|
|
8
|
+
function operatingSystemFolders() {
|
|
9
|
+
const api = nativeApi(), tokenBytes = Buffer.alloc(api.sizeof('void *'));
|
|
10
|
+
const directory = Buffer.alloc(65536);
|
|
11
|
+
const length = nativeFunction('kernel32.dll', 'uint32_t GetSystemDirectoryW(_Out_ void *buffer, uint32_t size)')(directory, directory.length / 2);
|
|
12
|
+
if (!length || length >= directory.length / 2)
|
|
13
|
+
throw winError('GetSystemDirectoryW');
|
|
14
|
+
// Never resolve this newly loaded DLL relative to a project directory.
|
|
15
|
+
const userenv = join(directory.toString('utf16le', 0, length * 2), 'userenv.dll');
|
|
16
|
+
const current = nativeFunction('kernel32.dll', 'void *GetCurrentProcess()')();
|
|
17
|
+
if (!nativeFunction('advapi32.dll', 'bool OpenProcessToken(void *process, uint32_t access, _Out_ void *token)')(current, 0x000a, tokenBytes))
|
|
18
|
+
throw winError('OpenProcessToken');
|
|
19
|
+
const token = api.decode(tokenBytes, 'void *');
|
|
20
|
+
let block;
|
|
21
|
+
try {
|
|
22
|
+
const pointer = Buffer.alloc(api.sizeof('void *'));
|
|
23
|
+
if (!nativeFunction(userenv, 'bool CreateEnvironmentBlock(_Out_ void *environment, void *token, bool inherit)')(pointer, token, false))
|
|
24
|
+
throw winError('CreateEnvironmentBlock');
|
|
25
|
+
block = api.decode(pointer, 'void *');
|
|
26
|
+
const result = {};
|
|
27
|
+
let entry = '';
|
|
28
|
+
for (let offset = 0; offset < 1024 * 1024; offset += 2) {
|
|
29
|
+
const character = api.decode(block, offset, 'uint16_t');
|
|
30
|
+
if (character) {
|
|
31
|
+
entry += String.fromCharCode(character);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (!entry)
|
|
35
|
+
return result;
|
|
36
|
+
const equals = entry.indexOf('='), name = entry.slice(0, equals).toUpperCase();
|
|
37
|
+
if (equals > 0 && WINDOWS_RUNTIME_FOLDERS.includes(name))
|
|
38
|
+
result[name] = entry.slice(equals + 1);
|
|
39
|
+
entry = '';
|
|
40
|
+
}
|
|
41
|
+
throw new Error('Windows environment block exceeds its bound');
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
if (block)
|
|
45
|
+
nativeFunction(userenv, 'bool DestroyEnvironmentBlock(void *environment)')(block);
|
|
46
|
+
nativeFunction('kernel32.dll', 'bool CloseHandle(void *handle)')(token);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/** Bootstrap only the static supervisor with valid .NET known folders. The tool
|
|
50
|
+
* receives the original, separately serialized minimum environment instead. */
|
|
51
|
+
export function windowsSourceEnvironment(command, folders = operatingSystemFolders()) {
|
|
52
|
+
const result = { ...command };
|
|
53
|
+
for (const name of Object.keys(result))
|
|
54
|
+
if (WINDOWS_RUNTIME_FOLDERS.includes(name.toUpperCase()) || name.toUpperCase() === 'PSMODULEPATH')
|
|
55
|
+
delete result[name];
|
|
56
|
+
for (const [name, value] of Object.entries(folders))
|
|
57
|
+
if (WINDOWS_RUNTIME_FOLDERS.includes(name.toUpperCase()))
|
|
58
|
+
result[name] = value;
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=windows-source-environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-source-environment.js","sourceRoot":"","sources":["../../src/windows-source-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,mBAAmB,EAAE,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,oBAAoB,CAAC,CAAC;AAE7Q;;;GAGG;AACH,SAAS,sBAAsB;IAC3B,MAAM,GAAG,GAAG,SAAS,EAAE,EAAE,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACzE,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,cAAc,CAAC,cAAc,EAAE,iEAAiE,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAW,CAAC;IAC5J,IAAI,CAAC,MAAM,IAAI,MAAM,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,QAAQ,CAAC,qBAAqB,CAAC,CAAC;IACrF,uEAAuE;IACvE,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;IAClF,MAA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CAAC;YAC/E,IAAI,MAAM,GAAG,CAAC,IAAI,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACjG,KAAK,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACnE,CAAC;YAAS,CAAC;QACP,IAAI,KAAK;YAAE,cAAc,CAAC,OAAO,EAAE,iDAAiD,CAAC,CAAC,KAAK,CAAC,CAAC;QAC7F,cAAc,CAAC,cAAc,EAAE,gCAAgC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC;AACL,CAAC;AAED;+EAC+E;AAC/E,MAAM,UAAU,wBAAwB,CAAC,OAA0B,EAAE,OAAO,GAAG,sBAAsB,EAAE;IACnG,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IAC9B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,IAAI,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,cAAc;YAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/J,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;QAAE,IAAI,uBAAuB,CAAC,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACpI,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/** Static supervisor: assign a suspended process to a kill-on-close Windows Job.
|
|
2
|
+
* Values cross JSON/argv boundaries, never PowerShell source interpolation. */
|
|
3
|
+
export const windowsJobScript = String.raw `
|
|
4
|
+
$ErrorActionPreference = 'Stop'
|
|
5
|
+
$ProgressPreference = 'SilentlyContinue'
|
|
6
|
+
$PSModuleAutoLoadingPreference = 'None'
|
|
7
|
+
Import-Module ($PSHOME + '\Modules\Microsoft.PowerShell.Management\Microsoft.PowerShell.Management.psd1') -ErrorAction Stop
|
|
8
|
+
Import-Module ($PSHOME + '\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psd1') -ErrorAction Stop
|
|
9
|
+
$spec = $env:STATUSLINE_SOURCE_LAUNCH | ConvertFrom-Json
|
|
10
|
+
$env:STATUSLINE_SOURCE_LAUNCH = $null
|
|
11
|
+
Add-Type -TypeDefinition @'
|
|
12
|
+
using System;
|
|
13
|
+
using System.Text;
|
|
14
|
+
using System.Runtime.InteropServices;
|
|
15
|
+
public static class StatuslineSourceJob {
|
|
16
|
+
[StructLayout(LayoutKind.Sequential)] struct Basic { public long a,b; public uint flags; public UIntPtr min,max; public uint count; public UIntPtr affinity; public uint priority,scheduling; }
|
|
17
|
+
[StructLayout(LayoutKind.Sequential)] struct IO { public ulong a,b,c,d,e,f; }
|
|
18
|
+
[StructLayout(LayoutKind.Sequential)] struct Limits { public Basic basic; public IO io; public UIntPtr process,job,peakProcess,peakJob; }
|
|
19
|
+
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Unicode)] struct Startup { public uint cb; public string reserved,desktop,title; public uint x,y,xs,ys,xc,yc,fill,flags; public ushort show,reserved2; public IntPtr extra,input,output,error; }
|
|
20
|
+
[StructLayout(LayoutKind.Sequential)] struct ProcessInfo { public IntPtr process,thread; public uint pid,tid; }
|
|
21
|
+
[DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern IntPtr CreateJobObject(IntPtr security,string name);
|
|
22
|
+
[DllImport("kernel32.dll", SetLastError=true)] static extern bool SetInformationJobObject(IntPtr job,int kind,ref Limits value,uint size);
|
|
23
|
+
[DllImport("kernel32.dll", CharSet=CharSet.Unicode, SetLastError=true)] static extern bool CreateProcess(string app,StringBuilder command,IntPtr ps,IntPtr ts,bool inherit,uint flags,IntPtr env,string cwd,ref Startup startup,out ProcessInfo info);
|
|
24
|
+
[DllImport("kernel32.dll", SetLastError=true)] static extern bool AssignProcessToJobObject(IntPtr job,IntPtr process);
|
|
25
|
+
[DllImport("kernel32.dll")] static extern uint ResumeThread(IntPtr thread);
|
|
26
|
+
[DllImport("kernel32.dll")] static extern uint WaitForSingleObject(IntPtr value,uint timeout);
|
|
27
|
+
[DllImport("kernel32.dll")] static extern bool GetExitCodeProcess(IntPtr process,out uint code);
|
|
28
|
+
[DllImport("kernel32.dll")] static extern bool TerminateProcess(IntPtr process,uint code);
|
|
29
|
+
[DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr value);
|
|
30
|
+
[DllImport("kernel32.dll")] static extern IntPtr GetStdHandle(int kind);
|
|
31
|
+
[DllImport("kernel32.dll")] static extern bool SetHandleInformation(IntPtr value,uint mask,uint flags);
|
|
32
|
+
static string Quote(string value) {
|
|
33
|
+
var b=new StringBuilder("\""); int slashes=0;
|
|
34
|
+
foreach(char c in value) { if(c=='\\') { slashes++; continue; } if(c=='"') b.Append('\\',slashes*2+1); else b.Append('\\',slashes); b.Append(c); slashes=0; }
|
|
35
|
+
return b.Append('\\',slashes*2).Append('"').ToString();
|
|
36
|
+
}
|
|
37
|
+
public static int Run(string exe,string[] args,string cwd,string[] environment) {
|
|
38
|
+
IntPtr job=CreateJobObject(IntPtr.Zero,null); ProcessInfo info=new ProcessInfo();
|
|
39
|
+
IntPtr block=IntPtr.Zero;
|
|
40
|
+
try {
|
|
41
|
+
if(job==IntPtr.Zero) return 125;
|
|
42
|
+
Limits limits=new Limits(); limits.basic.flags=0x2000;
|
|
43
|
+
if(!SetInformationJobObject(job,9,ref limits,(uint)Marshal.SizeOf(limits))) return 125;
|
|
44
|
+
Startup s=new Startup(); s.cb=(uint)Marshal.SizeOf(s); s.flags=0x100;
|
|
45
|
+
s.input=GetStdHandle(-10); s.output=GetStdHandle(-11); s.error=GetStdHandle(-12);
|
|
46
|
+
SetHandleInformation(s.input,1,1); SetHandleInformation(s.output,1,1); SetHandleInformation(s.error,1,1);
|
|
47
|
+
var line=new StringBuilder(Quote(exe)); foreach(string arg in args) line.Append(' ').Append(Quote(arg));
|
|
48
|
+
Array.Sort(environment,StringComparer.OrdinalIgnoreCase);
|
|
49
|
+
block=Marshal.StringToHGlobalUni(String.Join("\0",environment)+"\0\0");
|
|
50
|
+
if(!CreateProcess(exe,line,IntPtr.Zero,IntPtr.Zero,true,0x08000404,block,cwd,ref s,out info)) return 126;
|
|
51
|
+
if(!AssignProcessToJobObject(job,info.process)) { TerminateProcess(info.process,125); return 125; }
|
|
52
|
+
if(ResumeThread(info.thread)==0xffffffff) { TerminateProcess(info.process,125); return 125; }
|
|
53
|
+
WaitForSingleObject(info.process,0xffffffff); uint code; GetExitCodeProcess(info.process,out code); return unchecked((int)code);
|
|
54
|
+
} finally { if(block!=IntPtr.Zero) Marshal.FreeHGlobal(block); if(job!=IntPtr.Zero) CloseHandle(job); if(info.thread!=IntPtr.Zero) CloseHandle(info.thread); if(info.process!=IntPtr.Zero) CloseHandle(info.process); }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
'@
|
|
58
|
+
$environment = @($spec.environment.PSObject.Properties | ForEach-Object { $_.Name + '=' + [string]$_.Value })
|
|
59
|
+
exit [StatuslineSourceJob]::Run([string]$spec.executable,[string[]]$spec.args,[string]$spec.cwd,[string[]]$environment)
|
|
60
|
+
`;
|
|
61
|
+
//# sourceMappingURL=windows-source-job.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"windows-source-job.js","sourceRoot":"","sources":["../../src/windows-source-job.ts"],"names":[],"mappings":"AAAA;+EAC+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD1C,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { safeLink, linkSequence, CLOSE_LINK } from '@fbincon/statusline-core/terminal/links';
|
|
1
2
|
/** Bounded terminal cells and ANSI serialization, independent of editor state. */
|
|
2
3
|
import { clip, clusterWidth, displayWidth } from '@fbincon/statusline-core/unicode/index';
|
|
3
4
|
import { clipSpans, clusterSpans } from '@fbincon/statusline-core/terminal/spans';
|
|
@@ -68,7 +69,7 @@ export class Canvas {
|
|
|
68
69
|
continue;
|
|
69
70
|
}
|
|
70
71
|
const last = spans.at(-1);
|
|
71
|
-
if (last && last.bold === cell.bold && last.reverse === cell.reverse &&
|
|
72
|
+
if (last && last.link === cell.link && last.bold === cell.bold && last.reverse === cell.reverse &&
|
|
72
73
|
last.foreground === cell.foreground && last.background === cell.background) {
|
|
73
74
|
last.text += cell.text;
|
|
74
75
|
}
|
|
@@ -109,7 +110,7 @@ export function ansiFrame(value, colors = 256) {
|
|
|
109
110
|
typeof foreground.value === 'number' && foreground.value >= 8 && foreground.value < 16;
|
|
110
111
|
output += '\x1b[0m' + (span.bold || bright ? '\x1b[1m' : '') +
|
|
111
112
|
(span.reverse ? '\x1b[7m' : '') + color(foreground, false) +
|
|
112
|
-
color(span.background, true) + safe(span.text);
|
|
113
|
+
color(span.background, true) + (safeLink(span.link) ? linkSequence(safeLink(span.link)) : '') + safe(span.text) + (safeLink(span.link) ? CLOSE_LINK : '');
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
116
|
return output + '\x1b[0m';
|