harnesstap 1.3.2 → 1.4.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 +2 -0
- package/dist/apply-SUNDXRJ3.js +54 -0
- package/dist/{approve-L7IFSYBO.js → approve-FBGYQGWN.js} +14 -15
- package/dist/{approve-L7IFSYBO.js.map → approve-FBGYQGWN.js.map} +1 -1
- package/dist/{audit-PBJDK7A4.js → audit-VI4QZ6X2.js} +30 -39
- package/dist/{audit-PBJDK7A4.js.map → audit-VI4QZ6X2.js.map} +1 -1
- package/dist/{auth-OM73RLNS.js → auth-4CQCDS2W.js} +17 -19
- package/dist/{auth-OM73RLNS.js.map → auth-4CQCDS2W.js.map} +1 -1
- package/dist/bin.js +3 -3
- package/dist/{chunk-YRGM7RAD.js → chunk-23XSG7LI.js} +7 -11
- package/dist/{chunk-YRGM7RAD.js.map → chunk-23XSG7LI.js.map} +1 -1
- package/dist/{chunk-LDVXYN6F.js → chunk-2A36HWDE.js} +63 -13
- package/dist/chunk-2A36HWDE.js.map +1 -0
- package/dist/{chunk-QNAIDM6W.js → chunk-3FS775NP.js} +51 -4
- package/dist/chunk-3FS775NP.js.map +1 -0
- package/dist/{chunk-XCPWLGPB.js → chunk-3P6BWL5F.js} +2 -2
- package/dist/{chunk-JJJJ2RAD.js → chunk-43BDGVN3.js} +19 -6
- package/dist/chunk-43BDGVN3.js.map +1 -0
- package/dist/{chunk-CZ4T75PP.js → chunk-4ZQ2SCGY.js} +146 -78
- package/dist/chunk-4ZQ2SCGY.js.map +1 -0
- package/dist/{chunk-ZVANUFPF.js → chunk-6LTLYV5D.js} +353 -267
- package/dist/chunk-6LTLYV5D.js.map +1 -0
- package/dist/{chunk-OPVIX7E4.js → chunk-73OJQTBW.js} +6 -2
- package/dist/chunk-73OJQTBW.js.map +1 -0
- package/dist/{chunk-WXRPQICX.js → chunk-7HP6AAI3.js} +2 -2
- package/dist/{chunk-ENHDEB7Z.js → chunk-BPWFQKI5.js} +5 -7
- package/dist/{chunk-ENHDEB7Z.js.map → chunk-BPWFQKI5.js.map} +1 -1
- package/dist/{chunk-64R32MG2.js → chunk-D432JAXV.js} +44 -19
- package/dist/chunk-D432JAXV.js.map +1 -0
- package/dist/chunk-DF4Z7LAD.js +3463 -0
- package/dist/chunk-DF4Z7LAD.js.map +1 -0
- package/dist/{chunk-FUV7QYBS.js → chunk-EOPFER6N.js} +71 -318
- package/dist/chunk-EOPFER6N.js.map +1 -0
- package/dist/chunk-G6WKY2W4.js +389 -0
- package/dist/chunk-G6WKY2W4.js.map +1 -0
- package/dist/{chunk-IHW4PCDT.js → chunk-GRASK6M6.js} +5 -5
- package/dist/{chunk-R4PTE774.js → chunk-IE7B6Q5K.js} +33 -39
- package/dist/chunk-IE7B6Q5K.js.map +1 -0
- package/dist/{chunk-UNRR4KH5.js → chunk-IMROMZ2K.js} +6 -5
- package/dist/{chunk-UNRR4KH5.js.map → chunk-IMROMZ2K.js.map} +1 -1
- package/dist/{chunk-G5RWVZZ7.js → chunk-L6YZE5MY.js} +3 -3
- package/dist/{chunk-SNVAMWB7.js → chunk-M2U3J7UX.js} +7 -1
- package/dist/chunk-M2U3J7UX.js.map +1 -0
- package/dist/{chunk-AFKCNFPP.js → chunk-M4KLHJ6U.js} +16 -13
- package/dist/chunk-M4KLHJ6U.js.map +1 -0
- package/dist/{chunk-XRXFJTAT.js → chunk-MR7IOHSX.js} +16 -19
- package/dist/chunk-MR7IOHSX.js.map +1 -0
- package/dist/{chunk-UEHDEADL.js → chunk-N3VGY3T3.js} +15 -15
- package/dist/chunk-N3VGY3T3.js.map +1 -0
- package/dist/{chunk-IKAGGJEO.js → chunk-N3ZCH64F.js} +496 -10
- package/dist/chunk-N3ZCH64F.js.map +1 -0
- package/dist/{chunk-U472S6IB.js → chunk-OML4HXKT.js} +20 -22
- package/dist/chunk-OML4HXKT.js.map +1 -0
- package/dist/{chunk-3EGM4IUI.js → chunk-P2C7JPLD.js} +3 -3
- package/dist/{chunk-MFCZN253.js → chunk-PCMON7Y2.js} +7 -7
- package/dist/{chunk-FBYAIBHP.js → chunk-PNGF5EV2.js} +2 -2
- package/dist/{chunk-6JMVGKMD.js → chunk-QA5U36JN.js} +187 -203
- package/dist/chunk-QA5U36JN.js.map +1 -0
- package/dist/{chunk-AVZOFMJX.js → chunk-R7ZOYVN3.js} +241 -126
- package/dist/chunk-R7ZOYVN3.js.map +1 -0
- package/dist/{chunk-YVJQ2QDG.js → chunk-RDG5DT7S.js} +45 -49
- package/dist/{chunk-YVJQ2QDG.js.map → chunk-RDG5DT7S.js.map} +1 -1
- package/dist/{chunk-VQVUJYYY.js → chunk-REHRUNBB.js} +8 -3
- package/dist/chunk-REHRUNBB.js.map +1 -0
- package/dist/{chunk-Y2JGMICO.js → chunk-RFQ3N7FB.js} +19 -29
- package/dist/chunk-RFQ3N7FB.js.map +1 -0
- package/dist/{chunk-EY4ES5MG.js → chunk-RVEXPMM3.js} +3 -3
- package/dist/{chunk-6I3RY6R5.js → chunk-TPEJFLV7.js} +13 -15
- package/dist/{chunk-6I3RY6R5.js.map → chunk-TPEJFLV7.js.map} +1 -1
- package/dist/{chunk-IAZNF35S.js → chunk-U6DXASQP.js} +2 -2
- package/dist/{chunk-OQ4KBUN2.js → chunk-ULCD6DJE.js} +30 -8
- package/dist/chunk-ULCD6DJE.js.map +1 -0
- package/dist/{chunk-BXSS2S4W.js → chunk-UVVZHWD2.js} +2 -2
- package/dist/{chunk-24V5ZSIF.js → chunk-WG5A6EAU.js} +269 -13
- package/dist/chunk-WG5A6EAU.js.map +1 -0
- package/dist/{chunk-LGWUTV5Q.js → chunk-WGP4GUYZ.js} +10 -10
- package/dist/{chunk-GWQVYGRD.js → chunk-XTVGCVU4.js} +124 -83
- package/dist/chunk-XTVGCVU4.js.map +1 -0
- package/dist/{chunk-YX7MVSDA.js → chunk-XUJKZQZA.js} +8 -8
- package/dist/chunk-XUJKZQZA.js.map +1 -0
- package/dist/chunk-ZUASVASP.js +30317 -0
- package/dist/chunk-ZUASVASP.js.map +1 -0
- package/dist/{compile-SDOASKGL.js → compile-GXADKGH5.js} +37 -50
- package/dist/{compile-SDOASKGL.js.map → compile-GXADKGH5.js.map} +1 -1
- package/dist/{config-4VZTVZKF.js → config-JMHNA2U5.js} +22 -35
- package/dist/{config-4VZTVZKF.js.map → config-JMHNA2U5.js.map} +1 -1
- package/dist/cursor-local-install-46RWRBDT.js +98 -0
- package/dist/cursor-local-install-46RWRBDT.js.map +1 -0
- package/dist/{doctor-HH6CFBRQ.js → doctor-N7ZULPOL.js} +18 -19
- package/dist/{doctor-HH6CFBRQ.js.map → doctor-N7ZULPOL.js.map} +1 -1
- package/dist/{environment-K7YMJJYN.js → environment-OBB3WU5B.js} +60 -71
- package/dist/{environment-K7YMJJYN.js.map → environment-OBB3WU5B.js.map} +1 -1
- package/dist/{github-A6TYG7WS.js → github-PBYBGOLH.js} +17 -17
- package/dist/{harness-772XBFZQ.js → harness-7KYATIV6.js} +56 -67
- package/dist/{harness-772XBFZQ.js.map → harness-7KYATIV6.js.map} +1 -1
- package/dist/{help-QR4VTJZU.js → help-EE3AJQD4.js} +48 -52
- package/dist/help-EE3AJQD4.js.map +1 -0
- package/dist/{help-TLHNRJJ6.js → help-VXWKLQ6A.js} +55 -15
- package/dist/help-VXWKLQ6A.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +16 -24
- package/dist/{init-AOKFPZHG.js → init-LBTMPDVJ.js} +43 -56
- package/dist/init-LBTMPDVJ.js.map +1 -0
- package/dist/live-read-cache-TUSP7U3D.js +10 -0
- package/dist/{lock-INAXNLMC.js → lock-WLJRXRVK.js} +16 -16
- package/dist/{marketplace-TUVLLPBG.js → marketplace-GXSV6QIY.js} +62 -28
- package/dist/marketplace-GXSV6QIY.js.map +1 -0
- package/dist/{mcp-MMWGRASN.js → mcp-XPDWWU75.js} +35 -48
- package/dist/{mcp-MMWGRASN.js.map → mcp-XPDWWU75.js.map} +1 -1
- package/dist/{migrate-55S4XODX.js → migrate-SBUIWN3U.js} +79 -64
- package/dist/migrate-SBUIWN3U.js.map +1 -0
- package/dist/open-HDGLYYVU.js +24 -0
- package/dist/{pack-VZIBS42E.js → pack-A73LDVOX.js} +16 -22
- package/dist/{pack-VZIBS42E.js.map → pack-A73LDVOX.js.map} +1 -1
- package/dist/plugin-CEO6ZJM5.js +51 -0
- package/dist/plugin-from-project-UK7VJVUP.js +18 -0
- package/dist/{policy-P3HGLEZS.js → policy-6VY3CMSU.js} +13 -14
- package/dist/{policy-P3HGLEZS.js.map → policy-6VY3CMSU.js.map} +1 -1
- package/dist/{profile-STS3CZUK.js → profile-YCKPMRRU.js} +96 -102
- package/dist/profile-YCKPMRRU.js.map +1 -0
- package/dist/{project-R4DGM3ZG.js → project-KHPPBKPN.js} +63 -77
- package/dist/{project-R4DGM3ZG.js.map → project-KHPPBKPN.js.map} +1 -1
- package/dist/{resource-GJVEDXVZ.js → resource-IJU3FAN5.js} +42 -49
- package/dist/{resource-GJVEDXVZ.js.map → resource-IJU3FAN5.js.map} +1 -1
- package/dist/{version-FUHV4O6U.js → version-Z66FWWMQ.js} +2 -2
- package/dist/version-Z66FWWMQ.js.map +1 -0
- package/package.json +3 -2
- package/dist/apply-Q5SFF3FY.js +0 -67
- package/dist/chunk-24V5ZSIF.js.map +0 -1
- package/dist/chunk-3JOPDYQD.js +0 -730
- package/dist/chunk-3JOPDYQD.js.map +0 -1
- package/dist/chunk-555XE3NJ.js +0 -60
- package/dist/chunk-555XE3NJ.js.map +0 -1
- package/dist/chunk-64R32MG2.js.map +0 -1
- package/dist/chunk-6JMVGKMD.js.map +0 -1
- package/dist/chunk-6ZWKF3YZ.js +0 -7795
- package/dist/chunk-6ZWKF3YZ.js.map +0 -1
- package/dist/chunk-AFKCNFPP.js.map +0 -1
- package/dist/chunk-AUWWL6KX.js +0 -296
- package/dist/chunk-AUWWL6KX.js.map +0 -1
- package/dist/chunk-AVZOFMJX.js.map +0 -1
- package/dist/chunk-CZ4T75PP.js.map +0 -1
- package/dist/chunk-FUV7QYBS.js.map +0 -1
- package/dist/chunk-GWQVYGRD.js.map +0 -1
- package/dist/chunk-HENOKIBB.js +0 -346
- package/dist/chunk-HENOKIBB.js.map +0 -1
- package/dist/chunk-HWL67OCJ.js +0 -238
- package/dist/chunk-HWL67OCJ.js.map +0 -1
- package/dist/chunk-IKAGGJEO.js.map +0 -1
- package/dist/chunk-JJJJ2RAD.js.map +0 -1
- package/dist/chunk-JRFUTIEH.js +0 -426
- package/dist/chunk-JRFUTIEH.js.map +0 -1
- package/dist/chunk-KJIFZLHN.js +0 -11066
- package/dist/chunk-KJIFZLHN.js.map +0 -1
- package/dist/chunk-LDVXYN6F.js.map +0 -1
- package/dist/chunk-MHOTXMD2.js +0 -430
- package/dist/chunk-MHOTXMD2.js.map +0 -1
- package/dist/chunk-NEPUP33Q.js +0 -35
- package/dist/chunk-NEPUP33Q.js.map +0 -1
- package/dist/chunk-OPVIX7E4.js.map +0 -1
- package/dist/chunk-OQ4KBUN2.js.map +0 -1
- package/dist/chunk-OXVCYRZB.js +0 -491
- package/dist/chunk-OXVCYRZB.js.map +0 -1
- package/dist/chunk-PJQAMC6L.js +0 -183
- package/dist/chunk-PJQAMC6L.js.map +0 -1
- package/dist/chunk-PW5QXRBA.js +0 -1173
- package/dist/chunk-PW5QXRBA.js.map +0 -1
- package/dist/chunk-QNAIDM6W.js.map +0 -1
- package/dist/chunk-R4PTE774.js.map +0 -1
- package/dist/chunk-S2E4KSYW.js +0 -610
- package/dist/chunk-S2E4KSYW.js.map +0 -1
- package/dist/chunk-SNVAMWB7.js.map +0 -1
- package/dist/chunk-U472S6IB.js.map +0 -1
- package/dist/chunk-UEHDEADL.js.map +0 -1
- package/dist/chunk-VQVUJYYY.js.map +0 -1
- package/dist/chunk-XRXFJTAT.js.map +0 -1
- package/dist/chunk-Y2JGMICO.js.map +0 -1
- package/dist/chunk-YX7MVSDA.js.map +0 -1
- package/dist/chunk-ZGRBIBO7.js +0 -681
- package/dist/chunk-ZGRBIBO7.js.map +0 -1
- package/dist/chunk-ZTBAMBAI.js +0 -6448
- package/dist/chunk-ZTBAMBAI.js.map +0 -1
- package/dist/chunk-ZVANUFPF.js.map +0 -1
- package/dist/help-QR4VTJZU.js.map +0 -1
- package/dist/help-TLHNRJJ6.js.map +0 -1
- package/dist/init-AOKFPZHG.js.map +0 -1
- package/dist/marketplace-TUVLLPBG.js.map +0 -1
- package/dist/migrate-55S4XODX.js.map +0 -1
- package/dist/open-SLFQV45J.js +0 -32
- package/dist/plugin-WLEFFBRY.js +0 -64
- package/dist/plugin-from-project-UV2O364T.js +0 -16
- package/dist/profile-STS3CZUK.js.map +0 -1
- /package/dist/{apply-Q5SFF3FY.js.map → apply-SUNDXRJ3.js.map} +0 -0
- /package/dist/{chunk-XCPWLGPB.js.map → chunk-3P6BWL5F.js.map} +0 -0
- /package/dist/{chunk-WXRPQICX.js.map → chunk-7HP6AAI3.js.map} +0 -0
- /package/dist/{chunk-IHW4PCDT.js.map → chunk-GRASK6M6.js.map} +0 -0
- /package/dist/{chunk-G5RWVZZ7.js.map → chunk-L6YZE5MY.js.map} +0 -0
- /package/dist/{chunk-3EGM4IUI.js.map → chunk-P2C7JPLD.js.map} +0 -0
- /package/dist/{chunk-MFCZN253.js.map → chunk-PCMON7Y2.js.map} +0 -0
- /package/dist/{chunk-FBYAIBHP.js.map → chunk-PNGF5EV2.js.map} +0 -0
- /package/dist/{chunk-EY4ES5MG.js.map → chunk-RVEXPMM3.js.map} +0 -0
- /package/dist/{chunk-IAZNF35S.js.map → chunk-U6DXASQP.js.map} +0 -0
- /package/dist/{chunk-BXSS2S4W.js.map → chunk-UVVZHWD2.js.map} +0 -0
- /package/dist/{chunk-LGWUTV5Q.js.map → chunk-WGP4GUYZ.js.map} +0 -0
- /package/dist/{github-A6TYG7WS.js.map → github-PBYBGOLH.js.map} +0 -0
- /package/dist/{open-SLFQV45J.js.map → live-read-cache-TUSP7U3D.js.map} +0 -0
- /package/dist/{lock-INAXNLMC.js.map → lock-WLJRXRVK.js.map} +0 -0
- /package/dist/{plugin-WLEFFBRY.js.map → open-HDGLYYVU.js.map} +0 -0
- /package/dist/{plugin-from-project-UV2O364T.js.map → plugin-CEO6ZJM5.js.map} +0 -0
- /package/dist/{version-FUHV4O6U.js.map → plugin-from-project-UK7VJVUP.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import { execFileSync } from "child_process";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "harnesstap",
|
|
9
|
-
version: "1.
|
|
9
|
+
version: "1.4.0",
|
|
10
10
|
description: "Agent harness configuration toolkit for Claude Code, Codex, Cursor, and other coding CLIs",
|
|
11
11
|
type: "module",
|
|
12
12
|
packageManager: "bun@1.3.9",
|
|
@@ -57,7 +57,7 @@ var package_default = {
|
|
|
57
57
|
"lint:css": "bun scripts/check-css-tokens.ts",
|
|
58
58
|
"check:cli-error-contract": "bun scripts/check-cli-error-contract.ts",
|
|
59
59
|
"check:copy": "bun scripts/check-copy.ts",
|
|
60
|
-
"check:agent-plugins-spec": "bun test test/services/agent-plugins/spec-schema-guard.test.ts test/services/agent-plugins/spec-mcp.test.ts",
|
|
60
|
+
"check:agent-plugins-spec": "bun test test/services/agent-plugins/spec-schema-guard.test.ts test/services/agent-plugins/spec-mcp.test.ts test/services/agent-plugins/spec-load.test.ts",
|
|
61
61
|
typecheck: "tsc --noEmit",
|
|
62
62
|
clean: "rm -rf dist && find . -maxdepth 1 -name '*.bun-build' -delete",
|
|
63
63
|
preflight: "bun run lint && bun run lint:css && bun run check:cli-error-contract && bun run check:copy && bun run typecheck && bun run test:run && bun run build",
|
|
@@ -115,6 +115,7 @@ var package_default = {
|
|
|
115
115
|
"@types/node": "^22.10.0",
|
|
116
116
|
"@types/semver": "^7.7.1",
|
|
117
117
|
ajv: "^8.20.0",
|
|
118
|
+
"happy-dom": "17.4.4",
|
|
118
119
|
tsup: "^8.3.5",
|
|
119
120
|
typescript: "^5.7.0"
|
|
120
121
|
}
|
|
@@ -169,8 +170,8 @@ function resolveBuildVersion(env = process.env) {
|
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
172
|
function resolvePackageVersion() {
|
|
172
|
-
if ("1.
|
|
173
|
-
return "1.
|
|
173
|
+
if ("1.4.0-dev+9dcdc1f".length > 0) {
|
|
174
|
+
return "1.4.0-dev+9dcdc1f";
|
|
174
175
|
}
|
|
175
176
|
return resolveBuildVersion();
|
|
176
177
|
}
|
|
@@ -183,4 +184,4 @@ export {
|
|
|
183
184
|
resolveBuildVersion,
|
|
184
185
|
PACKAGE_VERSION
|
|
185
186
|
};
|
|
186
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-IMROMZ2K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/version.ts","../package.json"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\ndeclare const __HT_VERSION__: string | undefined;\n\nconst GIT_SHA = /^[0-9a-f]{7,40}$/i;\n\nexport interface DevBuildVersionOptions {\n isRelease?: boolean;\n gitSha?: string | null;\n}\n\nfunction compactGitSha(sha: string | null | undefined): string | undefined {\n const trimmed = sha?.trim().toLowerCase();\n if (!trimmed || !GIT_SHA.test(trimmed)) {\n return undefined;\n }\n return trimmed.slice(0, 7);\n}\n\n/** True when a release workflow baked a publishable version (no `-dev+sha`). */\nexport function isReleaseBuild(env: NodeJS.ProcessEnv = process.env): boolean {\n return env.HT_RELEASE === \"1\" || env.HARNESSTAP_RELEASE === \"1\";\n}\n\n/** Best-effort git SHA for the `-dev+sha` suffix. */\nexport function readGitSha(\n env: NodeJS.ProcessEnv = process.env,\n cwd: string = process.cwd(),\n): string | undefined {\n const fromEnv = compactGitSha(env.HT_GIT_SHA ?? env.GITHUB_SHA);\n if (fromEnv) {\n return fromEnv;\n }\n try {\n const sha = execFileSync(\"git\", [\"rev-parse\", \"HEAD\"], {\n cwd,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n return compactGitSha(sha);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Append `-dev+<sha>` on non-release builds so CLI and Desktop can tell a\n * local/CI binary from a published version. Release builds return `version`\n * unchanged. Desktop should call this helper when reporting a newer-schema DB.\n */\nexport function formatDevBuildVersion(\n version: string,\n options: DevBuildVersionOptions = {},\n): string {\n const trimmed = version.trim();\n if (options.isRelease) {\n return trimmed;\n }\n if (trimmed.includes(\"-dev+\")) {\n return trimmed;\n }\n const sha = compactGitSha(options.gitSha);\n if (!sha) {\n return `${trimmed}-dev`;\n }\n return `${trimmed}-dev+${sha}`;\n}\n\n/** Version baked into tsup and the compiled sidecar (`__HT_VERSION__`). */\nexport function resolveBuildVersion(env: NodeJS.ProcessEnv = process.env): string {\n return formatDevBuildVersion(packageJson.version, {\n isRelease: isReleaseBuild(env),\n gitSha: readGitSha(env),\n });\n}\n\nfunction resolvePackageVersion(): string {\n // tsup and the sidecar build define __HT_VERSION__; the JSON import is the\n // source/test fallback and is inlined by every bundler, never read at runtime.\n if (typeof __HT_VERSION__ === \"string\" && __HT_VERSION__.length > 0) {\n return __HT_VERSION__;\n }\n return resolveBuildVersion();\n}\n\nexport const PACKAGE_VERSION: string = resolvePackageVersion();\n","{\n \"name\": \"harnesstap\",\n \"version\": \"1.3.2\",\n \"description\": \"Agent harness configuration toolkit for Claude Code, Codex, Cursor, and other coding CLIs\",\n \"type\": \"module\",\n \"packageManager\": \"bun@1.3.9\",\n \"files\": [\n \"dist\",\n \"LICENSE\",\n \"README.md\",\n \"schemas\"\n ],\n \"bin\": {\n \"harnesstap\": \"./dist/bin.js\",\n \"ht\": \"./dist/bin.js\"\n },\n \"scripts\": {\n \"build\": \"bun scripts/generate-scenarios.ts && rm -rf dist && tsup\",\n \"generate:scenarios\": \"bun scripts/generate-scenarios.ts\",\n \"check:packaged-help\": \"bun scripts/check-packaged-help.ts\",\n \"snapshot:released-cli\": \"bun scripts/snapshot-released-cli.ts\",\n \"build:sidecar\": \"bash scripts/build-sidecar.sh\",\n \"check:compiled-sidecar\": \"bun scripts/check-compiled-sidecar.ts\",\n \"desktop:cleanup\": \"bash apps/desktop/scripts/cleanup-stale-dev.sh\",\n \"desktop:prepare-sidecar\": \"bash apps/desktop/scripts/prepare-sidecar.sh\",\n \"desktop:watch-sidecar\": \"bun apps/desktop/scripts/watch-sidecar.ts\",\n \"desktop:icons\": \"cd apps/desktop && bun run icons\",\n \"desktop:dev\": \"bash apps/desktop/scripts/desktop-dev.sh\",\n \"desktop:build\": \"bun run desktop:prepare-sidecar && cd apps/desktop && bun install && bun run tauri build && bash scripts/reseal-macos-app.sh\",\n \"desktop:install\": \"bun apps/desktop/scripts/install-local.ts\",\n \"desktop:e2e:build\": \"bash apps/desktop/scripts/e2e-build.sh\",\n \"desktop:e2e\": \"bash apps/desktop/scripts/e2e-run.sh\",\n \"desktop:demo-agent\": \"bash apps/desktop/scripts/demo-home.sh\",\n \"desktop:shots\": \"cd apps/desktop && bun run shots\",\n \"desktop:check\": \"bash apps/desktop/scripts/desktop-check.sh\",\n \"dev\": \"tsup --watch\",\n \"start\": \"bun src/bin.ts\",\n \"start:dist\": \"node dist/bin.js\",\n \"link\": \"bun run build && bun link\",\n \"unlink\": \"bun unlink\",\n \"test\": \"bun test --timeout 30000\",\n \"test:run\": \"bun test --dots --timeout 30000\",\n \"test:core\": \"bun test --dots test/models test/db test/config test/utils test/telemetry test/scripts\",\n \"test:platforms\": \"bun test --dots test/platforms\",\n \"test:plugins\": \"bun test --dots test/plugins\",\n \"test:services\": \"bun test --dots test/services test/integration test/agent/init-apply-noop.test.ts\",\n \"test:cli\": \"bun test --dots test/cli test/ui test/helpers\",\n \"test:docs\": \"bun test --dots test/docs\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write --unsafe .\",\n \"lint:css\": \"bun scripts/check-css-tokens.ts\",\n \"check:cli-error-contract\": \"bun scripts/check-cli-error-contract.ts\",\n \"check:copy\": \"bun scripts/check-copy.ts\",\n \"check:agent-plugins-spec\": \"bun test test/services/agent-plugins/spec-schema-guard.test.ts test/services/agent-plugins/spec-mcp.test.ts\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist && find . -maxdepth 1 -name '*.bun-build' -delete\",\n \"preflight\": \"bun run lint && bun run lint:css && bun run check:cli-error-contract && bun run check:copy && bun run typecheck && bun run test:run && bun run build\",\n \"prepublishOnly\": \"bun run build\",\n \"docs:vhs\": \"bash scripts/generate-vhs-scenarios.sh\",\n \"check:scenario-docs\": \"bash scripts/check-scenario-docs.sh\",\n \"check:scenario-smoke\": \"bun test test/cli/scenario-smoke.test.ts\",\n \"check:sqlite-wal-smoke\": \"bun scripts/sqlite-wal-write-smoke.ts\",\n \"sync:cloud-docs\": \"bash scripts/sync-cloud-cli-docs.sh\"\n },\n \"keywords\": [\n \"ai\",\n \"coding-assistant\",\n \"cli\",\n \"configuration\",\n \"claude-code\",\n \"cursor\",\n \"codex\",\n \"skills\",\n \"layers\"\n ],\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/harnesstap/harnesstap.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/harnesstap/harnesstap/issues\"\n },\n \"homepage\": \"https://github.com/harnesstap/harnesstap#readme\",\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@inquirer/core\": \"^10.3.2\",\n \"@inquirer/search\": \"^3.2.2\",\n \"better-sqlite3\": \"^12.11.1\",\n \"chalk\": \"^5.4.1\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^13.1.0\",\n \"gray-matter\": \"^4.0.3\",\n \"inquirer\": \"^12.3.0\",\n \"jsonc-parser\": \"^3.3.1\",\n \"ora\": \"^9.4.0\",\n \"picomatch\": \"^4.0.2\",\n \"semver\": \"^7.8.0\",\n \"smol-toml\": \"^1.3.1\",\n \"ulid\": \"^2.3.0\",\n \"yaml\": \"^2.7.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.4.10\",\n \"@inquirer/testing\": \"^3.3.8\",\n \"@types/better-sqlite3\": \"^7.6.12\",\n \"@types/node\": \"^22.10.0\",\n \"@types/semver\": \"^7.7.1\",\n \"ajv\": \"^8.20.0\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.7.0\"\n }\n}\n"],"mappings":";;;AAAA,SAAS,oBAAoB;;;ACA7B;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,gBAAkB;AAAA,EAClB,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,KAAO;AAAA,IACL,YAAc;AAAA,IACd,IAAM;AAAA,EACR;AAAA,EACA,SAAW;AAAA,IACT,OAAS;AAAA,IACT,sBAAsB;AAAA,IACtB,uBAAuB;AAAA,IACvB,yBAAyB;AAAA,IACzB,iBAAiB;AAAA,IACjB,0BAA0B;AAAA,IAC1B,mBAAmB;AAAA,IACnB,2BAA2B;AAAA,IAC3B,yBAAyB;AAAA,IACzB,iBAAiB;AAAA,IACjB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,eAAe;AAAA,IACf,sBAAsB;AAAA,IACtB,iBAAiB;AAAA,IACjB,iBAAiB;AAAA,IACjB,KAAO;AAAA,IACP,OAAS;AAAA,IACT,cAAc;AAAA,IACd,MAAQ;AAAA,IACR,QAAU;AAAA,IACV,MAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,MAAQ;AAAA,IACR,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,4BAA4B;AAAA,I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AGO,SAAS,eAAe,MAAyB,QAAQ,KAAc;AAC5E,SAAO,IAAI,eAAe,OAAO,IAAI,uBAAuB;AAC9D;AAGO,SAAS,WACd,MAAyB,QAAQ,KACjC,MAAc,QAAQ,IAAI,GACN;AACpB,QAAM,UAAU,cAAc,IAAI,cAAc,IAAI,UAAU;AAC9D,MAAI,SAAS;AACX,WAAO;AAAA,EACT;AACA,MAAI;AACF,UAAM,MAAM,aAAa,OAAO,CAAC,aAAa,MAAM,GAAG;AAAA,MACrD;AAAA,MACA,UAAU;AAAA,MACV,OAAO,CAAC,UAAU,QAAQ,QAAQ;AAAA,IACpC,CAAC,EAAE,KAAK;AACR,WAAO,cAAc,GAAG;AAAA,EAC1B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAOO,SAAS,sBACd,SACA,UAAkC,CAAC,GAC3B;AACR,QAAM,UAAU,QAAQ,KAAK;AAC7B,MAAI,QAAQ,WAAW;AACrB,WAAO;AAAA,EACT;AACA,MAAI,QAAQ,SAAS,OAAO,GAAG;AAC7B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,cAAc,QAAQ,MAAM;AACxC,MAAI,CAAC,KAAK;AACR,WAAO,GAAG,OAAO;AAAA,EACnB;AACA,SAAO,GAAG,OAAO,QAAQ,GAAG;AAC9B;AAGO,SAAS,oBAAoB,MAAyB,QAAQ,KAAa;AAChF,SAAO,sBAAsB,gBAAY,SAAS;AAAA,IAChD,WAAW,eAAe,GAAG;AAAA,IAC7B,QAAQ,WAAW,GAAG;AAAA,EACxB,CAAC;AACH;AAEA,SAAS,wBAAgC;AAGvC,MAA0C,oBAAe,SAAS,GAAG;AACnE,WAAO;AAAA,EACT;AACA,SAAO,oBAAoB;AAC7B;AAEO,IAAM,kBAA0B,sBAAsB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/version.ts","../package.json"],"sourcesContent":["import { execFileSync } from \"node:child_process\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\ndeclare const __HT_VERSION__: string | undefined;\n\nconst GIT_SHA = /^[0-9a-f]{7,40}$/i;\n\nexport interface DevBuildVersionOptions {\n isRelease?: boolean;\n gitSha?: string | null;\n}\n\nfunction compactGitSha(sha: string | null | undefined): string | undefined {\n const trimmed = sha?.trim().toLowerCase();\n if (!trimmed || !GIT_SHA.test(trimmed)) {\n return undefined;\n }\n return trimmed.slice(0, 7);\n}\n\n/** True when a release workflow baked a publishable version (no `-dev+sha`). */\nexport function isReleaseBuild(env: NodeJS.ProcessEnv = process.env): boolean {\n return env.HT_RELEASE === \"1\" || env.HARNESSTAP_RELEASE === \"1\";\n}\n\n/** Best-effort git SHA for the `-dev+sha` suffix. */\nexport function readGitSha(\n env: NodeJS.ProcessEnv = process.env,\n cwd: string = process.cwd(),\n): string | undefined {\n const fromEnv = compactGitSha(env.HT_GIT_SHA ?? env.GITHUB_SHA);\n if (fromEnv) {\n return fromEnv;\n }\n try {\n const sha = execFileSync(\"git\", [\"rev-parse\", \"HEAD\"], {\n cwd,\n encoding: \"utf8\",\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n }).trim();\n return compactGitSha(sha);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Append `-dev+<sha>` on non-release builds so CLI and Desktop can tell a\n * local/CI binary from a published version. Release builds return `version`\n * unchanged. Desktop should call this helper when reporting a newer-schema DB.\n */\nexport function formatDevBuildVersion(\n version: string,\n options: DevBuildVersionOptions = {},\n): string {\n const trimmed = version.trim();\n if (options.isRelease) {\n return trimmed;\n }\n if (trimmed.includes(\"-dev+\")) {\n return trimmed;\n }\n const sha = compactGitSha(options.gitSha);\n if (!sha) {\n return `${trimmed}-dev`;\n }\n return `${trimmed}-dev+${sha}`;\n}\n\n/** Version baked into tsup and the compiled sidecar (`__HT_VERSION__`). */\nexport function resolveBuildVersion(env: NodeJS.ProcessEnv = process.env): string {\n return formatDevBuildVersion(packageJson.version, {\n isRelease: isReleaseBuild(env),\n gitSha: readGitSha(env),\n });\n}\n\nfunction resolvePackageVersion(): string {\n // tsup and the sidecar build define __HT_VERSION__; the JSON import is the\n // source/test fallback and is inlined by every bundler, never read at runtime.\n if (typeof __HT_VERSION__ === \"string\" && __HT_VERSION__.length > 0) {\n return __HT_VERSION__;\n }\n return resolveBuildVersion();\n}\n\nexport const PACKAGE_VERSION: string = resolvePackageVersion();\n","{\n \"name\": \"harnesstap\",\n \"version\": \"1.4.0\",\n \"description\": \"Agent harness configuration toolkit for Claude Code, Codex, Cursor, and other coding CLIs\",\n \"type\": \"module\",\n \"packageManager\": \"bun@1.3.9\",\n \"files\": [\n \"dist\",\n \"LICENSE\",\n \"README.md\",\n \"schemas\"\n ],\n \"bin\": {\n \"harnesstap\": \"./dist/bin.js\",\n \"ht\": \"./dist/bin.js\"\n },\n \"scripts\": {\n \"build\": \"bun scripts/generate-scenarios.ts && rm -rf dist && tsup\",\n \"generate:scenarios\": \"bun scripts/generate-scenarios.ts\",\n \"check:packaged-help\": \"bun scripts/check-packaged-help.ts\",\n \"snapshot:released-cli\": \"bun scripts/snapshot-released-cli.ts\",\n \"build:sidecar\": \"bash scripts/build-sidecar.sh\",\n \"check:compiled-sidecar\": \"bun scripts/check-compiled-sidecar.ts\",\n \"desktop:cleanup\": \"bash apps/desktop/scripts/cleanup-stale-dev.sh\",\n \"desktop:prepare-sidecar\": \"bash apps/desktop/scripts/prepare-sidecar.sh\",\n \"desktop:watch-sidecar\": \"bun apps/desktop/scripts/watch-sidecar.ts\",\n \"desktop:icons\": \"cd apps/desktop && bun run icons\",\n \"desktop:dev\": \"bash apps/desktop/scripts/desktop-dev.sh\",\n \"desktop:build\": \"bun run desktop:prepare-sidecar && cd apps/desktop && bun install && bun run tauri build && bash scripts/reseal-macos-app.sh\",\n \"desktop:install\": \"bun apps/desktop/scripts/install-local.ts\",\n \"desktop:e2e:build\": \"bash apps/desktop/scripts/e2e-build.sh\",\n \"desktop:e2e\": \"bash apps/desktop/scripts/e2e-run.sh\",\n \"desktop:demo-agent\": \"bash apps/desktop/scripts/demo-home.sh\",\n \"desktop:shots\": \"cd apps/desktop && bun run shots\",\n \"desktop:check\": \"bash apps/desktop/scripts/desktop-check.sh\",\n \"dev\": \"tsup --watch\",\n \"start\": \"bun src/bin.ts\",\n \"start:dist\": \"node dist/bin.js\",\n \"link\": \"bun run build && bun link\",\n \"unlink\": \"bun unlink\",\n \"test\": \"bun test --timeout 30000\",\n \"test:run\": \"bun test --dots --timeout 30000\",\n \"test:core\": \"bun test --dots test/models test/db test/config test/utils test/telemetry test/scripts\",\n \"test:platforms\": \"bun test --dots test/platforms\",\n \"test:plugins\": \"bun test --dots test/plugins\",\n \"test:services\": \"bun test --dots test/services test/integration test/agent/init-apply-noop.test.ts\",\n \"test:cli\": \"bun test --dots test/cli test/ui test/helpers\",\n \"test:docs\": \"bun test --dots test/docs\",\n \"lint\": \"biome lint .\",\n \"lint:fix\": \"biome lint --write --unsafe .\",\n \"lint:css\": \"bun scripts/check-css-tokens.ts\",\n \"check:cli-error-contract\": \"bun scripts/check-cli-error-contract.ts\",\n \"check:copy\": \"bun scripts/check-copy.ts\",\n \"check:agent-plugins-spec\": \"bun test test/services/agent-plugins/spec-schema-guard.test.ts test/services/agent-plugins/spec-mcp.test.ts test/services/agent-plugins/spec-load.test.ts\",\n \"typecheck\": \"tsc --noEmit\",\n \"clean\": \"rm -rf dist && find . -maxdepth 1 -name '*.bun-build' -delete\",\n \"preflight\": \"bun run lint && bun run lint:css && bun run check:cli-error-contract && bun run check:copy && bun run typecheck && bun run test:run && bun run build\",\n \"prepublishOnly\": \"bun run build\",\n \"docs:vhs\": \"bash scripts/generate-vhs-scenarios.sh\",\n \"check:scenario-docs\": \"bash scripts/check-scenario-docs.sh\",\n \"check:scenario-smoke\": \"bun test test/cli/scenario-smoke.test.ts\",\n \"check:sqlite-wal-smoke\": \"bun scripts/sqlite-wal-write-smoke.ts\",\n \"sync:cloud-docs\": \"bash scripts/sync-cloud-cli-docs.sh\"\n },\n \"keywords\": [\n \"ai\",\n \"coding-assistant\",\n \"cli\",\n \"configuration\",\n \"claude-code\",\n \"cursor\",\n \"codex\",\n \"skills\",\n \"layers\"\n ],\n \"license\": \"Apache-2.0\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/harnesstap/harnesstap.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/harnesstap/harnesstap/issues\"\n },\n \"homepage\": \"https://github.com/harnesstap/harnesstap#readme\",\n \"engines\": {\n \"node\": \">=22.12.0\"\n },\n \"dependencies\": {\n \"@inquirer/core\": \"^10.3.2\",\n \"@inquirer/search\": \"^3.2.2\",\n \"better-sqlite3\": \"^12.11.1\",\n \"chalk\": \"^5.4.1\",\n \"cli-table3\": \"^0.6.5\",\n \"commander\": \"^13.1.0\",\n \"gray-matter\": \"^4.0.3\",\n \"inquirer\": \"^12.3.0\",\n \"jsonc-parser\": \"^3.3.1\",\n \"ora\": \"^9.4.0\",\n \"picomatch\": \"^4.0.2\",\n \"semver\": \"^7.8.0\",\n \"smol-toml\": \"^1.3.1\",\n \"ulid\": \"^2.3.0\",\n \"yaml\": \"^2.7.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.4.10\",\n \"@inquirer/testing\": \"^3.3.8\",\n \"@types/better-sqlite3\": \"^7.6.12\",\n \"@types/node\": \"^22.10.0\",\n \"@types/semver\": \"^7.7.1\",\n \"ajv\": \"^8.20.0\",\n \"happy-dom\": \"17.4.4\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.7.0\"\n }\n}\n"],"mappings":";;;AAAA,SAAS,oBAAoB;;;ACA7B;AAAA,EACE,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,gBAAkB;AAAA,EAClB,OAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA,KAAO;AAAA,IACL,YAAc;AAAA,IACd,IAAM;AAAA,EACR;AAAA,EACA,SAAW;AAAA,IACT,OAAS;AAAA,IACT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Q,WAAW;AACrB,WAAO;AAAA,EACT;AACA,MAAI,QAAQ,SAAS,OAAO,GAAG;AAC7B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,cAAc,QAAQ,MAAM;AACxC,MAAI,CAAC,KAAK;AACR,WAAO,GAAG,OAAO;AAAA,EACnB;AACA,SAAO,GAAG,OAAO,QAAQ,GAAG;AAC9B;AAGO,SAAS,oBAAoB,MAAyB,QAAQ,KAAa;AAChF,SAAO,sBAAsB,gBAAY,SAAS;AAAA,IAChD,WAAW,eAAe,GAAG;AAAA,IAC7B,QAAQ,WAAW,GAAG;AAAA,EACxB,CAAC;AACH;AAEA,SAAS,wBAAgC;AAGvC,MAA0C,oBAAe,SAAS,GAAG;AACnE,WAAO;AAAA,EACT;AACA,SAAO,oBAAoB;AAC7B;AAEO,IAAM,kBAA0B,sBAAsB;","names":[]}
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
normalizeRegisteredHarnesses,
|
|
6
6
|
registeredFromLegacyParts,
|
|
7
7
|
registeredHarnessesOf
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZUASVASP.js";
|
|
9
9
|
import {
|
|
10
10
|
getAllPlatforms,
|
|
11
11
|
getPlatformIds
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DF4Z7LAD.js";
|
|
13
13
|
|
|
14
14
|
// src/services/harness-config.ts
|
|
15
15
|
function unique(values) {
|
|
@@ -84,4 +84,4 @@ async function resolveHarnessSelection(options = {}) {
|
|
|
84
84
|
export {
|
|
85
85
|
resolveHarnessSelection
|
|
86
86
|
};
|
|
87
|
-
//# sourceMappingURL=chunk-
|
|
87
|
+
//# sourceMappingURL=chunk-L6YZE5MY.js.map
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
// src/copy/plurals.ts
|
|
4
|
+
function formatCount(count, noun, plural = `${noun}s`) {
|
|
5
|
+
return `${count} ${count === 1 ? noun : plural}`;
|
|
6
|
+
}
|
|
7
|
+
|
|
3
8
|
// src/copy/cli.ts
|
|
4
9
|
var NATIVE_MODULE_MISMATCH_MESSAGE = "HarnessTap was installed under a different Node.js version. Run: npm rebuild -g harnesstap";
|
|
5
10
|
function marketplaceUnreachableHint() {
|
|
@@ -35,6 +40,7 @@ var CLI_HINTS = {
|
|
|
35
40
|
};
|
|
36
41
|
|
|
37
42
|
export {
|
|
43
|
+
formatCount,
|
|
38
44
|
NATIVE_MODULE_MISMATCH_MESSAGE
|
|
39
45
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
46
|
+
//# sourceMappingURL=chunk-M2U3J7UX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/copy/plurals.ts","../src/copy/cli.ts"],"sourcesContent":["/**\n * Shared count/plural helper for CLI and Desktop (W3-2).\n * Desktop can import this module or mirror `apps/desktop/src/lib/plurals.ts`.\n */\n\nexport function formatCount(count: number, noun: string, plural = `${noun}s`): string {\n return `${count} ${count === 1 ? noun : plural}`;\n}\n\nexport function pluralNoun(count: number, noun: string, plural = `${noun}s`): string {\n return count === 1 ? noun : plural;\n}\n","/**\n * User-facing CLI copy. ASCII punctuation only (DS-6).\n * Command hints always start with `ht`.\n */\n\nimport { pluralNoun } from \"./plurals.js\";\n\nexport const DRY_RUN_NOTHING_CHANGED = \"Dry run. Nothing was changed.\";\n\nexport const NATIVE_MODULE_MISMATCH_MESSAGE =\n \"HarnessTap was installed under a different Node.js version. Run: npm rebuild -g harnesstap\";\n\n/** Quote a user-provided token so a pasted hint parses as one Commander argument. */\nexport function quoteCliArg(value: string): string {\n if (value.length === 0) {\n return '\"\"';\n }\n if (/^[A-Za-z0-9_./:@+=-]+$/.test(value)) {\n return value;\n }\n return `\"${value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"')}\"`;\n}\n\nexport function formatHtCommand(path: string): string {\n return `ht ${path}`.trim();\n}\n\nexport function quoted(name: string): string {\n return `\"${name}\"`;\n}\n\nexport function skippedInvalidPluginExport(name: string): string {\n return `Warning: Skipped plugin ${quoted(name)}. Its version is not valid semver.`;\n}\n\nexport function marketplaceUnreachable(source: string): string {\n return `Error: Couldn't reach ${source}.`;\n}\n\nexport function marketplaceUnreachableHint(): string {\n return \"Check the URL, or sign in with ht github login if it's private.\";\n}\n\nexport function marketplacePathMissing(path: string): string {\n return `Error: Couldn't find a marketplace at ${quoted(path)}.`;\n}\n\nexport function marketplacePathNotMarketplace(path: string): string {\n return `Error: ${quoted(path)} is not a marketplace. It needs a marketplace.json file.`;\n}\n\nexport function marketplaceAddFailedNothingSaved(): string {\n return \"Nothing was saved.\";\n}\n\nexport function installPinnedPluginsPrompt(names: string[]): string {\n if (names.length === 1) {\n const only = names[0];\n return `Install pinned plugin ${quoted(only ?? \"\")} into the package cache?`;\n }\n return `Install ${String(names.length)} pinned plugins into the package cache?`;\n}\n\nexport function installPinnedPluginsNeedsYes(): string {\n return \"Error: Pass --yes to install pinned plugins without a prompt.\";\n}\n\nexport function installPinnedPluginsHint(profileName?: string): string {\n if (profileName) {\n return `Run ht profile use ${quoted(profileName)} --yes to install them.`;\n }\n return \"Run ht profile use --yes to install them.\";\n}\n\nexport function missingMarketplacePluginHint(pluginName: string): string {\n return `Run ht profile use to install ${quoted(pluginName)}.`;\n}\n\nexport function skippedHostPluginHook(hookName: string): string {\n return `Skipped hook ${hookName}. It only works when the plugin is installed as a host plugin.`;\n}\n\nexport function skippedDuplicateCommand(name: string): string {\n return `Skipped command ${quoted(name)}. A skill already uses that name.`;\n}\n\n/** Quote a user-provided name in error text (DS-6). */\nexport function quoteName(name: string): string {\n return `\"${name.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll(\"\\\"\", \"\\\\\\\"\")}\"`;\n}\n\nfunction hintToken(value: string): string {\n if (/^[A-Za-z0-9_./:@+=,-]+$/.test(value)) {\n return value;\n }\n return quoteName(value);\n}\n\n/** `ht` plus shell-quoted arguments. Names with spaces stay one token. */\nexport function formatHtArgs(args: readonly string[]): string {\n return [\"ht\", ...args.map(hintToken)].join(\" \");\n}\n\n/** Turn markdown links into terminal text. Relative targets keep the label only. */\nexport function plainTerminalText(value: string): string {\n return value.replace(\n /\\[([^\\]]+)\\]\\(([^)]+)\\)/g,\n (_match, label: string, target: string) => {\n if (target.startsWith(\"http://\") || target.startsWith(\"https://\")) {\n return `${label} (${target})`;\n }\n return label;\n },\n );\n}\n\nexport function ensureErrorPrefix(message: string): string {\n const stripped = message.replace(/^error:\\s*/i, \"\").trim();\n if (stripped.length === 0) {\n return \"Error: Something went wrong.\";\n }\n const sentence = /[.!?]$/.test(stripped) ? stripped : `${stripped}.`;\n return `Error: ${sentence}`;\n}\n\nexport function ensureWarningPrefix(message: string): string {\n const stripped = message.replace(/^warning:\\s*/i, \"\").trim();\n const sentence = /[.!?]$/.test(stripped) ? stripped : `${stripped}.`;\n return `Warning: ${sentence}`;\n}\n\nexport const CLI_HINTS = {\n seeOptions: (commandPath: string): string =>\n commandPath.trim().length > 0\n ? `Run ht ${commandPath.trim()} --help to see the options.`\n : \"Run ht --help to see the options.\",\n pluginList: \"Run ht plugin list to see your plugins.\",\n resourceList: \"Run ht resource list to see your resources.\",\n profileUseExample: 'For example: ht profile use \"global default\"',\n authLogin: \"Run ht auth login to sign in.\",\n githubLogin: marketplaceUnreachableHint(),\n onConflictReplace: \"Use --on-conflict replace to replace it.\",\n unsavedChanges: \"Run again with --changes save, stash or discard.\",\n updateNpm: \"Update with: npm i -g harnesstap\",\n mcpSearch: (name: string): string => `Run ht mcp search ${hintToken(name)} to find it.`,\n scopeAdd: (name: string, harnesses: string): string =>\n `Run ht resource scope ${hintToken(name)} --add ${hintToken(harnesses)}.`,\n portableMcpTip: (name: string, harnessList: string, command: string): string =>\n `Tip: ${quoteName(name)} also works on ${harnessList}. Run ${command}.`,\n forceRemove: \"To remove them too, run: ht apply --force-remove\",\n revert: \"Snapshot saved. Undo with: ht revert\",\n stashPop: \"Bring them back with: ht profile stash pop\",\n harnessSet: \"Run ht harness set to pick your harnesses.\",\n harnessSetOrFlag: \"Run ht harness set, or pass --harness <slugs>.\",\n} as const;\n\nexport const CLI_ERRORS = {\n pluginNotFound: (name: string): string => `No plugin named ${quoteName(name)}.`,\n resourceNotFound: (name: string): string => `No resource named ${quoteName(name)}.`,\n invalidResourceType: (value: string, valid: readonly string[]): string =>\n `${quoteName(value)} isn't a resource type. Valid: ${valid.join(\", \")}.`,\n conflictingResourceTypes: (a: string, b: string): string =>\n `Conflicting type filters: ${quoteName(a)} and ${quoteName(b)}.`,\n pluginAlreadyExists: (name: string): string =>\n `A plugin named ${quoteName(name)} already exists.`,\n environmentAlreadyExists: (name: string): string =>\n `An environment named ${quoteName(name)} already exists.`,\n notAuthenticated: \"Not authenticated to HarnessTap Cloud.\",\n directoryNotFound: (path: string): string => `Directory not found: ${path}.`,\n fileNotFound: (path: string): string => `File not found: ${path}.`,\n gitUnreachable: (url: string): string => `Couldn't reach ${url}.`,\n gitUnreachableGeneric: \"Couldn't reach that git repository.\",\n uniqueConstraintGeneric: \"That name already exists.\",\n missingProfileName: \"Pass a profile name.\",\n noProfileNamed: (name: string): string => `No profile named ${quoteName(name)}.`,\n invalidPluginName: (name: string): string =>\n `${quoteName(name)} isn't a valid plugin name. Use a non-empty name without /, \\\\, .. or control characters.`,\n emptyPluginName: \"Pass a plugin name.\",\n invalidFormat: (value: string): string => `Invalid --format value: ${value}. Use human or json.`,\n mcpNotInLibrary: (name: string): string => `${quoteName(name)} isn't in your library.`,\n newerSchema: \"This data was saved by a newer HarnessTap.\",\n noHarnesses: \"Not set up for any harness yet.\",\n unsavedChanges: (name: string, count: number): string =>\n `${quoteName(name)} has ${count} unsaved change${count === 1 ? \"\" : \"s\"}.`,\n resourceSyncStale: (count: number): string =>\n `${count} linked resource${count === 1 ? \"\" : \"s\"} ${count === 1 ? \"is\" : \"are\"} stale.`,\n} as const;\n\nexport const SCOPE_COPY = {\n allHarnesses: \"Applies to all your harnesses\",\n notSetUp: \"Not set up for any harness yet\",\n} as const;\n\nexport const SWITCH_CHANGES_VALUES = [\"save\", \"stash\", \"discard\"] as const;\nexport type SwitchChangesValue = (typeof SWITCH_CHANGES_VALUES)[number];\n\nexport const SWITCH_CHANGES_FLAG_HELP =\n \"What to do with unsaved changes: save, stash or discard\";\n\nexport const DEVICE_LOGIN_WAITING =\n \"Waiting for you to approve in the browser. The code expires in 15 minutes. Press Ctrl+C to cancel.\";\n\nexport function initPickHarnessesLine(): string {\n return `Pick your harnesses: ${formatHtCommand(\"harness set\")}`;\n}\n\nexport function initCompletionHintLine(\n shell: \"bash\" | \"zsh\" | \"fish\" | undefined,\n): string {\n switch (shell) {\n case \"bash\":\n return `Enable tab completion: ${formatHtCommand(\"init completion bash >> ~/.bashrc\")}`;\n case \"zsh\":\n return `Enable tab completion: ${formatHtCommand(\"init completion zsh >> ~/.zshrc\")}`;\n case \"fish\":\n return `Enable tab completion: ${formatHtCommand(\"init completion fish > ~/.config/fish/completions/ht.fish\")}`;\n default:\n return `Enable tab completion: ${formatHtCommand(\"init completion <bash|zsh|fish>\")}`;\n }\n}\n\nexport const CLI_COPY = {\n dryRunNothingChanged: DRY_RUN_NOTHING_CHANGED,\n everythingUpToDate: \"Everything is up to date.\",\n snapshotSavedUndo: \"Snapshot saved. Undo with:\",\n forceRemoveHint: \"To remove them too, run:\",\n keptYouChanged: \"you changed it\",\n keptNotMade: \"not made by HarnessTap\",\n viewSnapshot: \"View snapshot\",\n keptFilesIntro:\n \"files you changed or that HarnessTap didn't create:\",\n} as const;\n\nexport function alreadyExistsOnConflictHint(kind: string, name: string): string {\n return `A ${kind} named \"${name}\" already exists. Use --on-conflict replace to replace it.`;\n}\n\n/**\n * Hint after a cancelled apply. One file says \"it\"; two or more say \"them\".\n */\nexport function onConflictReplaceHint(conflicts: readonly string[]): string {\n const count = new Set(\n conflicts.map((path) => path.trim()).filter((path) => path.length > 0),\n ).size;\n if (count > 1) {\n return \"Use --on-conflict replace to replace them.\";\n }\n return CLI_HINTS.onConflictReplace;\n}\n\n/**\n * Human line for a cancelled apply. Names every conflicting path.\n * Pair with onConflictReplaceHint.\n */\nexport function applyCancelledMessage(\n conflicts: readonly string[],\n scope: \"profile\" | \"apply\" = \"apply\",\n): string {\n const paths = [\n ...new Set(\n conflicts.map((path) => path.trim()).filter((path) => path.length > 0),\n ),\n ];\n const lead = scope === \"profile\" ? \"Profile apply cancelled.\" : \"Apply cancelled.\";\n if (paths.length === 0) {\n return lead;\n }\n const listed = paths.map((path) => quoteCliArg(path)).join(\", \");\n if (paths.length === 1) {\n return `${lead} ${listed} would change.`;\n }\n return `${lead} These files would change: ${listed}.`;\n}\n\nexport function unsavedChangesLine(profileName: string, count: number): string {\n return CLI_ERRORS.unsavedChanges(profileName, count);\n}\n\nexport function unsavedChangesFlagHint(): string {\n return CLI_HINTS.unsavedChanges;\n}\n\nexport function savedChangesLine(profileName: string, count: number): string {\n return `Saved ${count} ${pluralNoun(count, \"change\")} to ${quoteName(profileName)}.`;\n}\n\nexport function stashedChangesLine(count: number, popCommand: string): string {\n return `Stashed ${count} ${pluralNoun(count, \"change\")}. Bring them back with: ${popCommand}`;\n}\n\nexport function discardedChangesLine(count: number): string {\n return `Discarded ${count} ${pluralNoun(count, \"change\")}.`;\n}\n\nexport function discardConfirm(count: number): string {\n return `Discard ${count} ${pluralNoun(count, \"change\")}? A snapshot keeps a copy.`;\n}\n\nexport const PREVIEW_LABELS = {\n willWrite: \"Will write\",\n upToDate: \"Up to date\",\n notInProfile: \"Not in profile\",\n willRemove: \"Will remove\",\n keptChanged: \"Kept. You changed it.\",\n keptUnmanaged: \"Kept. Not made by HarnessTap.\",\n dryRunHeader: DRY_RUN_NOTHING_CHANGED,\n everythingUpToDate: (unchanged: number): string => `Everything is up to date. ${unchanged} unchanged.`,\n} as const;\n\nexport function applyWroteLine(input: {\n wrote: number;\n removed: number;\n kept: number;\n unchanged?: number;\n omitUnchanged?: boolean;\n}): string {\n if (input.wrote === 0 && input.removed === 0 && input.kept === 0) {\n return input.unchanged !== undefined\n ? `${CLI_COPY.everythingUpToDate} ${input.unchanged} unchanged.`\n : CLI_COPY.everythingUpToDate;\n }\n if (input.wrote === 0 && input.removed === 0) {\n const line = `Wrote 0, removed 0, kept ${input.kept}`;\n if (!input.omitUnchanged && input.unchanged !== undefined && input.unchanged > 0) {\n return `${line}, unchanged ${input.unchanged}.`;\n }\n return `${line}.`;\n }\n const parts: string[] = [];\n if (input.wrote > 0) parts.push(`Wrote ${input.wrote}`);\n if (input.removed > 0) parts.push(`removed ${input.removed}`);\n if (input.kept > 0) parts.push(`kept ${input.kept}`);\n if (parts.length === 0) {\n return input.unchanged !== undefined\n ? `${CLI_COPY.everythingUpToDate} ${input.unchanged} unchanged.`\n : CLI_COPY.everythingUpToDate;\n }\n if (!input.omitUnchanged && input.unchanged !== undefined && input.unchanged > 0) {\n parts.push(`unchanged ${input.unchanged}`);\n }\n const [first, ...rest] = parts;\n const head = first ?? \"\";\n if (rest.length === 0) {\n return `${head}.`;\n }\n return `${head}, ${rest.join(\", \")}.`;\n}\n\nexport function applyHeaderLine(profileName: string, harnessCount: number): string {\n const noun = harnessCount === 1 ? \"harness\" : \"harnesses\";\n return `Applied \"${profileName}\" to ${harnessCount} ${noun}.`;\n}\n\nexport function dryRunWouldLine(input: {\n write: number;\n remove: number;\n keep: number;\n unchanged: number;\n}): string {\n return `Would write ${input.write}, remove ${input.remove}, keep ${input.keep}. ${input.unchanged} unchanged.`;\n}\n\nexport function dryRunStashLine(count: number, profileName: string): string {\n return `Dry run. Would stash ${count} changes from \"${profileName}\".`;\n}\n\nexport function snapshotSavedUndoLine(revertCommand: string): string {\n return `${CLI_COPY.snapshotSavedUndo} ${revertCommand}`;\n}\n\nexport function keptFilesHeader(count: number): string {\n return `Kept ${count} ${CLI_COPY.keptFilesIntro}`;\n}\n\nexport function restoredRemovedLine(\n restored: number,\n removed: number,\n options: { dryRun?: boolean } = {},\n): string {\n if (options.dryRun) {\n return `Would restore ${restored}, would remove ${removed}.`;\n }\n return `Restored ${restored}, removed ${removed}.`;\n}\n\nexport function dryRunSectionHeader(\n kind: \"write\" | \"remove\" | \"keep\",\n count: number,\n): string {\n switch (kind) {\n case \"write\":\n return `Would write (${count})`;\n case \"remove\":\n return `Would remove (${count})`;\n case \"keep\":\n return `Would keep (${count})`;\n default: {\n const _exhaustive: never = kind;\n return _exhaustive;\n }\n }\n}\n\nexport function keptReasonLabel(reason: \"modified\" | \"unmanaged\"): string {\n switch (reason) {\n case \"modified\":\n return CLI_COPY.keptYouChanged;\n case \"unmanaged\":\n return CLI_COPY.keptNotMade;\n default: {\n const _exhaustive: never = reason;\n return _exhaustive;\n }\n }\n}\n"],"mappings":";;;AAKO,SAAS,YAAY,OAAe,MAAc,SAAS,GAAG,IAAI,KAAa;AACpF,SAAO,GAAG,KAAK,IAAI,UAAU,IAAI,OAAO,MAAM;AAChD;;;ACEO,IAAM,iCACX;AA6BK,SAAS,6BAAqC;AACnD,SAAO;AACT;AA8CO,SAAS,UAAU,MAAsB;AAC9C,SAAO,IAAI,KAAK,WAAW,MAAM,MAAM,EAAE,WAAW,KAAM,KAAM,CAAC;AACnE;AAEA,SAAS,UAAU,OAAuB;AACxC,MAAI,0BAA0B,KAAK,KAAK,GAAG;AACzC,WAAO;AAAA,EACT;AACA,SAAO,UAAU,KAAK;AACxB;AAmCO,IAAM,YAAY;AAAA,EACvB,YAAY,CAAC,gBACX,YAAY,KAAK,EAAE,SAAS,IACxB,UAAU,YAAY,KAAK,CAAC,gCAC5B;AAAA,EACN,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,aAAa,2BAA2B;AAAA,EACxC,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,WAAW,CAAC,SAAyB,qBAAqB,UAAU,IAAI,CAAC;AAAA,EACzE,UAAU,CAAC,MAAc,cACvB,yBAAyB,UAAU,IAAI,CAAC,UAAU,UAAU,SAAS,CAAC;AAAA,EACxE,gBAAgB,CAAC,MAAc,aAAqB,YAClD,QAAQ,UAAU,IAAI,CAAC,kBAAkB,WAAW,SAAS,OAAO;AAAA,EACtE,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,kBAAkB;AACpB;","names":[]}
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeProjectUse,
|
|
3
|
-
printApplyPayload
|
|
4
|
-
|
|
3
|
+
printApplyPayload,
|
|
4
|
+
reportApplyCancelled
|
|
5
|
+
} from "./chunk-R7ZOYVN3.js";
|
|
5
6
|
import {
|
|
6
7
|
MISSING_PROJECT_CONFIG_MESSAGE
|
|
7
8
|
} from "./chunk-VZQG2JDV.js";
|
|
8
9
|
import {
|
|
9
10
|
initializeSchema
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import {
|
|
12
|
-
findProjectConfig,
|
|
13
|
-
resolveProfileEnvironment
|
|
14
|
-
} from "./chunk-HENOKIBB.js";
|
|
11
|
+
} from "./chunk-3FS775NP.js";
|
|
15
12
|
import {
|
|
16
13
|
parseOutputFormat,
|
|
17
14
|
printJson
|
|
18
15
|
} from "./chunk-TQ2NA4Z4.js";
|
|
19
16
|
import {
|
|
20
|
-
|
|
17
|
+
findProjectConfig,
|
|
18
|
+
resolveProfileEnvironment
|
|
19
|
+
} from "./chunk-ZUASVASP.js";
|
|
20
|
+
import {
|
|
21
21
|
ui
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2A36HWDE.js";
|
|
23
23
|
import {
|
|
24
|
+
formatCount,
|
|
24
25
|
getDb
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-WG5A6EAU.js";
|
|
26
27
|
|
|
27
28
|
// src/services/use-command.ts
|
|
28
29
|
import { resolve } from "path";
|
|
@@ -87,8 +88,7 @@ function renderProjectUseHuman(result) {
|
|
|
87
88
|
return;
|
|
88
89
|
}
|
|
89
90
|
if (result.cancelled) {
|
|
90
|
-
|
|
91
|
-
ui.warn("Profile apply cancelled.");
|
|
91
|
+
reportApplyCancelled(result.conflicts, "profile");
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
94
|
if (result.environment_name) {
|
|
@@ -137,6 +137,9 @@ async function handleUseCommand(opts) {
|
|
|
137
137
|
const result = await executeProjectUse({
|
|
138
138
|
...toProjectUseOptions({ ...opts, project: projectPath })
|
|
139
139
|
});
|
|
140
|
+
if (!result.skipped && result.cancelled) {
|
|
141
|
+
process.exitCode = 1;
|
|
142
|
+
}
|
|
140
143
|
if (format === "json") {
|
|
141
144
|
printJson(result);
|
|
142
145
|
return;
|
|
@@ -169,4 +172,4 @@ export {
|
|
|
169
172
|
handleUseCommand,
|
|
170
173
|
mapProfileUseDelegationOptions
|
|
171
174
|
};
|
|
172
|
-
//# sourceMappingURL=chunk-
|
|
175
|
+
//# sourceMappingURL=chunk-M4KLHJ6U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/services/use-command.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport { getDb } from \"../db/connection.js\";\nimport { initializeSchema } from \"../db/schema.js\";\nimport { ui } from \"../ui/index.js\";\nimport { printApplyPayload } from \"../cli/print-apply-summary.js\";\nimport { formatCount } from \"../copy/plurals.js\";\nimport { parseOutputFormat, printJson } from \"../utils/output-format.js\";\nimport { reportApplyCancelled } from \"./materialization-conflicts.js\";\nimport { MISSING_PROJECT_CONFIG_MESSAGE } from \"./project-config-messages.js\";\nimport {\n executeProjectUse,\n type ProjectUseOptions,\n type ProjectUseResult,\n} from \"./project-config-use.js\";\nimport {\n findProjectConfig,\n resolveProfileEnvironment,\n type ProjectProfileEntry,\n type ResolvedProjectConfig,\n} from \"./project-config.js\";\n\nexport interface UseCommandOptions {\n profile?: string;\n project?: string;\n list?: boolean;\n dryRun?: boolean;\n force?: boolean;\n pull?: boolean;\n harness?: string;\n account?: string;\n baseUrl?: string;\n onConflict?: string;\n interactive?: boolean;\n noInteractive?: boolean;\n format?: string;\n}\n\ninterface ProjectProfileListRow {\n profile: string;\n source: string;\n target: string;\n environment: string;\n default: string;\n}\n\nfunction profileTarget(entry: ProjectProfileEntry): string {\n switch (entry.source) {\n case \"catalog\":\n case \"local\":\n return entry.selector ?? \"\";\n case \"inline\":\n return entry.plugin ?? \"\";\n default: {\n const unhandledSource: never = entry.source;\n throw new Error(`Unhandled profile source: ${unhandledSource}`);\n }\n }\n}\n\nfunction buildProjectProfileListRows(config: ResolvedProjectConfig): ProjectProfileListRow[] {\n return config.profiles.map((entry) => ({\n profile: entry.name,\n source: entry.source,\n target: profileTarget(entry),\n environment: resolveProfileEnvironment(config, entry) ?? \"\",\n default: entry.name === config.default_profile ? \"*\" : \"\",\n }));\n}\n\nfunction listProjectProfiles(config: ResolvedProjectConfig, format: \"human\" | \"json\"): void {\n const rows = buildProjectProfileListRows(config);\n\n if (format === \"json\") {\n printJson(\n rows.map((row) => ({\n profile: row.profile,\n source: row.source,\n selector_or_plugin: row.target,\n environment: row.environment || undefined,\n default: row.default === \"*\",\n })),\n );\n return;\n }\n\n if (rows.length === 0) {\n ui.dim(\"No profiles configured in project config.\");\n return;\n }\n\n ui.table.print({\n columns: [\n { key: \"profile\", header: \"PROFILE\", width: 16 },\n { key: \"source\", header: \"SOURCE\", width: 10 },\n { key: \"target\", header: \"SELECTOR/PLUGIN\", width: 24 },\n { key: \"environment\", header: \"ENVIRONMENT\", width: 16 },\n { key: \"default\", header: \"\", width: 2 },\n ],\n rows,\n summary: formatCount(rows.length, \"profile\"),\n });\n}\n\nexport function renderProjectUseHuman(result: ProjectUseResult): void {\n if (result.skipped) {\n const environmentSuffix = result.environment_name\n ? ` with environment ${ui.theme.accent(result.environment_name)}`\n : \"\";\n ui.info(\n `Profile ${ui.theme.accent(result.profile_key)} (${result.plugin_name}) is already active and in sync${environmentSuffix}.`,\n );\n return;\n }\n\n if (result.cancelled) {\n reportApplyCancelled(result.conflicts, \"profile\");\n return;\n }\n\n if (result.environment_name) {\n ui.info(`Environment: ${ui.theme.accent(result.environment_name)}`);\n }\n if ((result.pulled_plugins?.length ?? 0) > 0) {\n ui.info(`Pulled ${result.pulled_plugins?.length ?? 0} missing plugin dependencies:`);\n for (const pulled of result.pulled_plugins ?? []) {\n console.log(` - ${pulled.plugin_name} (${pulled.source})`);\n }\n }\n printApplyPayload(result);\n}\n\nfunction toProjectUseOptions(opts: UseCommandOptions): ProjectUseOptions {\n return {\n profile: opts.profile,\n project: opts.project,\n dryRun: opts.dryRun,\n force: opts.force,\n pull: opts.pull,\n harness: opts.harness,\n account: opts.account,\n baseUrl: opts.baseUrl,\n onConflict: opts.onConflict,\n format: opts.format,\n interactive: opts.interactive,\n noInteractive: opts.noInteractive,\n };\n}\n\nexport async function handleUseCommand(opts: UseCommandOptions): Promise<void> {\n const db = getDb();\n initializeSchema(db);\n const format = parseOutputFormat(opts.format);\n const projectPath = resolve(opts.project ?? process.cwd());\n\n if (opts.list) {\n const config = findProjectConfig(projectPath);\n if (!config) {\n process.exitCode = 1;\n ui.danger(MISSING_PROJECT_CONFIG_MESSAGE);\n return;\n }\n listProjectProfiles(config, format);\n return;\n }\n\n try {\n const result = await executeProjectUse({\n ...toProjectUseOptions({ ...opts, project: projectPath }),\n });\n if (!result.skipped && result.cancelled) {\n process.exitCode = 1;\n }\n if (format === \"json\") {\n printJson(result);\n return;\n }\n renderProjectUseHuman(result);\n } catch (err) {\n process.exitCode = 1;\n ui.danger(err instanceof Error ? err.message : String(err));\n }\n}\n\nexport function mapProfileUseDelegationOptions(opts: {\n profile?: string;\n project?: string;\n dryRun?: boolean;\n harness?: string;\n onConflict?: string;\n account?: string;\n baseUrl?: string;\n pull?: boolean;\n force?: boolean;\n interactive?: boolean;\n noInteractive?: boolean;\n format?: string;\n}): ProjectUseOptions {\n return {\n profile: opts.profile,\n project: opts.project,\n dryRun: opts.dryRun,\n force: opts.force,\n pull: opts.pull,\n harness: opts.harness,\n account: opts.account,\n baseUrl: opts.baseUrl,\n onConflict: opts.onConflict,\n format: opts.format,\n interactive: opts.interactive,\n noInteractive: opts.noInteractive,\n };\n}\n\nexport async function handleProfileUseProjectDelegation(\n opts: Parameters<typeof mapProfileUseDelegationOptions>[0],\n): Promise<boolean> {\n const config = findProjectConfig(resolve(opts.project ?? process.cwd()));\n if (!config) {\n return false;\n }\n\n const format = parseOutputFormat(opts.format);\n try {\n const result = await executeProjectUse(mapProfileUseDelegationOptions(opts));\n if (!result.skipped && result.cancelled) {\n process.exitCode = 1;\n }\n if (format === \"json\") {\n printJson(result);\n return true;\n }\n renderProjectUseHuman(result);\n return true;\n } catch (err) {\n process.exitCode = 1;\n ui.danger(err instanceof Error ? err.message : String(err));\n return true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AA6CxB,SAAS,cAAc,OAAoC;AACzD,UAAQ,MAAM,QAAQ;AAAA,IACpB,KAAK;AAAA,IACL,KAAK;AACH,aAAO,MAAM,YAAY;AAAA,IAC3B,KAAK;AACH,aAAO,MAAM,UAAU;AAAA,IACzB,SAAS;AACP,YAAM,kBAAyB,MAAM;AACrC,YAAM,IAAI,MAAM,6BAA6B,eAAe,EAAE;AAAA,IAChE;AAAA,EACF;AACF;AAEA,SAAS,4BAA4B,QAAwD;AAC3F,SAAO,OAAO,SAAS,IAAI,CAAC,WAAW;AAAA,IACrC,SAAS,MAAM;AAAA,IACf,QAAQ,MAAM;AAAA,IACd,QAAQ,cAAc,KAAK;AAAA,IAC3B,aAAa,0BAA0B,QAAQ,KAAK,KAAK;AAAA,IACzD,SAAS,MAAM,SAAS,OAAO,kBAAkB,MAAM;AAAA,EACzD,EAAE;AACJ;AAEA,SAAS,oBAAoB,QAA+B,QAAgC;AAC1F,QAAM,OAAO,4BAA4B,MAAM;AAE/C,MAAI,WAAW,QAAQ;AACrB;AAAA,MACE,KAAK,IAAI,CAAC,SAAS;A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C5D;AACF;AAEO,SAAS,+BAA+B,MAazB;AACpB,SAAO;AAAA,IACL,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,QAAQ,KAAK;AAAA,IACb,OAAO,KAAK;AAAA,IACZ,MAAM,KAAK;AAAA,IACX,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,SAAS,KAAK;AAAA,IACd,YAAY,KAAK;AAAA,IACjB,QAAQ,KAAK;AAAA,IACb,aAAa,KAAK;AAAA,IAClB,eAAe,KAAK;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
catalogPluginKey,
|
|
3
|
+
formatCatalogScopePath
|
|
4
|
+
} from "./chunk-XUJKZQZA.js";
|
|
1
5
|
import {
|
|
2
6
|
createTableBrowserPrompt
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P2C7JPLD.js";
|
|
4
8
|
import {
|
|
5
9
|
matchesListSearchQuery,
|
|
6
10
|
parseListSearchQuery
|
|
7
11
|
} from "./chunk-KRI4R7EM.js";
|
|
8
|
-
import {
|
|
9
|
-
catalogPluginKey,
|
|
10
|
-
formatCatalogScopePath
|
|
11
|
-
} from "./chunk-YX7MVSDA.js";
|
|
12
12
|
import {
|
|
13
13
|
VIEWPORT_CHROME_LINES,
|
|
14
14
|
computeMaxVisibleTableRows,
|
|
15
15
|
renderFoldedHintLine,
|
|
16
16
|
resolveSectionViewport
|
|
17
17
|
} from "./chunk-XGTTOO4R.js";
|
|
18
|
-
import {
|
|
19
|
-
getActiveProfileName
|
|
20
|
-
} from "./chunk-6ZWKF3YZ.js";
|
|
21
18
|
import {
|
|
22
19
|
resolveOrPrompt,
|
|
23
20
|
shouldUseWizard
|
|
24
21
|
} from "./chunk-NAGAJ5UM.js";
|
|
25
22
|
import {
|
|
26
|
-
|
|
27
|
-
} from "./chunk-
|
|
23
|
+
parseOutputFormat
|
|
24
|
+
} from "./chunk-TQ2NA4Z4.js";
|
|
28
25
|
import {
|
|
29
26
|
formatPluginVersionLabel,
|
|
27
|
+
isProfilePlugin,
|
|
30
28
|
listPlugins,
|
|
31
29
|
parseDependencyRef,
|
|
32
30
|
parseOriginLocator
|
|
33
|
-
} from "./chunk-
|
|
34
|
-
import {
|
|
35
|
-
parseOutputFormat
|
|
36
|
-
} from "./chunk-TQ2NA4Z4.js";
|
|
31
|
+
} from "./chunk-ZUASVASP.js";
|
|
37
32
|
import {
|
|
38
33
|
formatRelativeTime,
|
|
39
34
|
icons,
|
|
@@ -41,7 +36,10 @@ import {
|
|
|
41
36
|
resolveTableMaxWidth,
|
|
42
37
|
shortenId,
|
|
43
38
|
theme
|
|
44
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2A36HWDE.js";
|
|
40
|
+
import {
|
|
41
|
+
getActiveProfileName
|
|
42
|
+
} from "./chunk-DF4Z7LAD.js";
|
|
45
43
|
|
|
46
44
|
// src/ui/plugin-list-render.ts
|
|
47
45
|
import semver2 from "semver";
|
|
@@ -277,8 +275,7 @@ function makeLocalColumns(showId, profileMode) {
|
|
|
277
275
|
key: "description",
|
|
278
276
|
header: "DESCRIPTION",
|
|
279
277
|
width: 44,
|
|
280
|
-
truncate: true
|
|
281
|
-
transform: (value) => value || ": "
|
|
278
|
+
truncate: true
|
|
282
279
|
});
|
|
283
280
|
return columns;
|
|
284
281
|
}
|
|
@@ -305,7 +302,7 @@ function makeRemoteColumns(highlightSelection) {
|
|
|
305
302
|
header: "UPDATED",
|
|
306
303
|
width: 16,
|
|
307
304
|
fitContent: true,
|
|
308
|
-
transform: (value) => value ? formatRelativeTime(String(value)) :
|
|
305
|
+
transform: (value) => value ? formatRelativeTime(String(value)) : ""
|
|
309
306
|
}
|
|
310
307
|
];
|
|
311
308
|
}
|
|
@@ -511,4 +508,4 @@ export {
|
|
|
511
508
|
createLocalPluginPickAdapter,
|
|
512
509
|
resolvePluginMutationTarget
|
|
513
510
|
};
|
|
514
|
-
//# sourceMappingURL=chunk-
|
|
511
|
+
//# sourceMappingURL=chunk-MR7IOHSX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/plugin-list-render.ts","../src/ui/plugin-origin-display.ts","../src/ui/version-render.ts","../src/services/wizards/adapters/plugin-table-browser.ts","../src/services/wizards/plugin-show.ts","../src/cli/handlers/resolve-plugin-mutation-target.ts"],"sourcesContent":["import semver from \"semver\";\nimport { isProfilePlugin } from \"../constants/profile.js\";\nimport type { CatalogPlugin } from \"../services/catalog-types.js\";\nimport { formatPluginVersionLabel } from \"../services/plugin-versioning.js\";\nimport type { Plugin } from \"../types.js\";\nimport {\n catalogPluginKey,\n formatCatalogScopePath,\n formatCatalogSelectionLabel,\n} from \"./catalog-list-render.js\";\nimport * as format from \"./format.js\";\nimport { matchesListSearchQuery, parseListSearchQuery } from \"./list-search.js\";\nimport {\n computeMaxVisibleTableRows,\n renderFoldedHintLine,\n resolveSectionViewport,\n type SectionViewport,\n VIEWPORT_CHROME_LINES,\n} from \"./list-viewport.js\";\nimport { formatPluginOriginDisplay } from \"./plugin-origin-display.js\";\nimport { type Column, renderTable, resolveTableMaxWidth } from \"./table.js\";\nimport { icons, theme } from \"./theme.js\";\nimport { formatVersionWithDrift } from \"./version-render.js\";\n\nexport function formatLocalPluginListName(\n plugin: Pick<Plugin, \"name\" | \"tags\">,\n opts?: { selected?: boolean; static?: boolean },\n): string {\n const kind = isProfilePlugin(plugin)\n ? `${theme.accent(icons.profile)} `\n : opts?.static\n ? \"\"\n : \" \";\n if (opts?.static) {\n return `${kind}${plugin.name}`;\n }\n const cursor = opts?.selected ? \">\" : \" \";\n return `${cursor}${kind}${plugin.name}`;\n}\n\nexport function formatCatalogPluginListSlug(\n plugin: Pick<CatalogPlugin, \"slug\" | \"tags\">,\n opts?: { selected?: boolean },\n): string {\n const slug = isProfilePlugin(plugin)\n ? `${theme.accent(icons.profile)} ${plugin.slug}`\n : plugin.slug;\n if (opts?.selected) {\n return `> ${slug}`;\n }\n return opts === undefined ? slug : ` ${slug}`;\n}\n\nexport function formatCatalogPluginListName(plugin: Pick<CatalogPlugin, \"name\" | \"tags\">): string {\n if (!isProfilePlugin(plugin)) {\n return plugin.name;\n }\n return `${theme.accent(icons.profile)} ${plugin.name}`;\n}\n\nexport function formatCatalogPluginListSelector(\n plugin: CatalogPlugin,\n opts?: { selected?: boolean },\n): string {\n const listDisplayName = formatCatalogSelectionLabel(plugin);\n if (!isProfilePlugin(plugin)) {\n return opts?.selected ? `> ${listDisplayName}` : listDisplayName;\n }\n const marked = `${theme.accent(icons.profile)} ${listDisplayName}`;\n return opts?.selected ? `> ${marked}` : marked;\n}\n\nexport const PLUGIN_LIST_SECTIONS = [\"local\", \"remote\"] as const;\nexport type PluginListSection = (typeof PLUGIN_LIST_SECTIONS)[number];\n\nexport type PluginListBrowseRow =\n | { section: \"local\"; plugin: Plugin }\n | { section: \"remote\"; catalogPlugin: CatalogPlugin };\n\nexport function pluginListBrowseRowKey(row: PluginListBrowseRow): string {\n return row.section === \"local\"\n ? `local:${row.plugin.id}`\n : `remote:${catalogPluginKey(row.catalogPlugin)}`;\n}\n\nexport function toLocalBrowseRows(plugins: Plugin[]): PluginListBrowseRow[] {\n return plugins.map((plugin) => ({ section: \"local\", plugin }));\n}\n\nexport function toRemoteBrowseRows(plugins: CatalogPlugin[]): PluginListBrowseRow[] {\n return plugins.map((catalogPlugin) => ({ section: \"remote\", catalogPlugin }));\n}\n\nexport function filterLocalBrowseRows(\n plugins: Plugin[],\n search: string,\n): PluginListBrowseRow[] {\n const parsed = parseListSearchQuery(search);\n if (parsed.raw.length === 0) {\n return toLocalBrowseRows(plugins);\n }\n\n const sectionIsLocal = parsed.section === \"local\";\n const textQuery = parsed.section !== undefined && parsed.section !== \"local\"\n ? { section: undefined, text: parsed.raw, raw: parsed.raw }\n : parsed;\n\n if (parsed.section !== undefined && parsed.section !== \"local\" && !sectionIsLocal) {\n return [];\n }\n\n const filtered = plugins.filter((plugin) => {\n const haystack = [plugin.name, plugin.description, ...plugin.tags].join(\" \");\n return matchesListSearchQuery(haystack, textQuery);\n });\n return toLocalBrowseRows(filtered);\n}\n\nexport function listNavigablePluginListBrowseRows(\n local: PluginListBrowseRow[],\n remote: PluginListBrowseRow[],\n): PluginListBrowseRow[] {\n return [\n ...local.filter((row) => row.section === \"local\"),\n ...remote.filter((row) => row.section === \"remote\"),\n ];\n}\n\nexport type PluginListBrowseActiveSectionContext = {\n section: PluginListSection;\n indexInSection: number;\n sectionRows: PluginListBrowseRow[];\n prevSection?: { section: PluginListSection; count: number };\n nextSection?: { section: PluginListSection; count: number };\n};\n\nfunction sectionCount(\n navigable: PluginListBrowseRow[],\n section: PluginListSection,\n): number {\n return navigable.filter((row) => row.section === section).length;\n}\n\nfunction sectionLabel(section: PluginListSection, profileMode: boolean): string {\n if (section === \"local\") {\n return profileMode ? \"Local profiles\" : \"Local plugins\";\n }\n return \"Remote catalog\";\n}\n\nexport function resolvePluginListActiveSectionContext(\n navigable: PluginListBrowseRow[],\n active: number,\n): PluginListBrowseActiveSectionContext {\n const selected = navigable[active];\n if (!selected) {\n return { section: \"local\", indexInSection: 0, sectionRows: [] };\n }\n\n const section = selected.section;\n const sectionRows = navigable.filter((row) => row.section === section);\n const indexInSection = sectionRows.indexOf(selected);\n\n const sectionIndex = PLUGIN_LIST_SECTIONS.indexOf(section);\n const prevSection = PLUGIN_LIST_SECTIONS.slice(0, sectionIndex)\n .reverse()\n .map((prev) => ({\n section: prev,\n count: sectionCount(navigable, prev),\n }))\n .find((entry) => entry.count > 0);\n const nextSection = PLUGIN_LIST_SECTIONS.slice(sectionIndex + 1)\n .map((next) => ({\n section: next,\n count: sectionCount(navigable, next),\n }))\n .find((entry) => entry.count > 0);\n\n return { section, indexInSection, sectionRows, prevSection, nextSection };\n}\n\nfunction renderSectionSubheader(\n section: PluginListSection,\n count: number,\n profileMode: boolean,\n scopeLabel?: string,\n): string {\n const label = sectionLabel(section, profileMode);\n const suffix = section === \"remote\" && scopeLabel\n ? theme.muted(` · ${scopeLabel} (${count})`)\n : theme.muted(` (${count})`);\n return `${theme.accent(label)}${suffix}`;\n}\n\nexport function buildPluginViewportHintSegments(\n ctx: PluginListBrowseActiveSectionContext,\n viewport: SectionViewport,\n profileMode: boolean,\n scopeLabel?: string,\n): string[] {\n const segments: string[] = [];\n const hiddenBelow = ctx.sectionRows.length - viewport.end;\n const hiddenAbove = viewport.start;\n if (hiddenAbove > 0) {\n segments.push(`↑ ${hiddenAbove} above`);\n }\n if (hiddenBelow > 0) {\n segments.push(\n `↓ ${hiddenBelow} more in ${sectionLabel(ctx.section, profileMode).toLowerCase()}`,\n );\n }\n if (ctx.nextSection) {\n segments.push(\n `${sectionLabel(ctx.nextSection.section, profileMode)} (${ctx.nextSection.count})`,\n );\n segments.push(\"↓ next section\");\n }\n if (viewport.start === 0 && ctx.prevSection) {\n segments.push(\n `${sectionLabel(ctx.prevSection.section, profileMode)} (${ctx.prevSection.count})`,\n );\n segments.push(\"↑ prev section\");\n }\n if (ctx.section === \"remote\" && scopeLabel && ctx.sectionRows.length === 0) {\n segments.push(`Catalog: ${scopeLabel}`);\n }\n return segments;\n}\n\nfunction renderViewportOverflowHints(\n ctx: PluginListBrowseActiveSectionContext,\n viewport: SectionViewport,\n profileMode: boolean,\n maxWidth: number,\n scopeLabel?: string,\n): string {\n const folded = renderFoldedHintLine(\n buildPluginViewportHintSegments(ctx, viewport, profileMode, scopeLabel),\n maxWidth,\n );\n return folded.length > 0 ? theme.muted(folded) : \"\";\n}\n\ntype LocalTableRow = {\n id?: string;\n name: string;\n origin: string;\n version: string;\n active?: string;\n description: string;\n};\n\nfunction formatOriginCell(origin: string): string {\n if (origin === \"upstream\" || origin === \"catalog\") {\n return theme.muted(origin);\n }\n return origin || \"authored\";\n}\n\nfunction makeLocalColumns(showId: boolean, profileMode: boolean): Column[] {\n const columns: Column[] = [];\n if (showId) {\n columns.push({\n key: \"id\",\n header: \"ID\",\n width: 12,\n transform: (value: string) => format.shortenId(String(value)),\n });\n }\n columns.push(\n {\n key: \"name\",\n header: \"NAME\",\n width: 26,\n style: (value) => (value.startsWith(\">\") ? theme.accent(value) : value),\n },\n {\n key: \"origin\",\n header: \"ORIGIN\",\n width: 12,\n style: (value) => formatOriginCell(String(value)),\n },\n { key: \"version\", header: \"VERSION\", width: 12 },\n );\n if (profileMode) {\n columns.push({ key: \"active\", header: \"ACTIVE\", width: 8 });\n }\n columns.push({\n key: \"description\",\n header: \"DESCRIPTION\",\n width: 44,\n truncate: true,\n });\n return columns;\n}\n\nfunction makeRemoteColumns(highlightSelection: boolean): Column[] {\n return [\n {\n key: \"catalog\",\n header: \"CATALOG\",\n width: 28,\n },\n {\n key: \"slug\",\n header: \"PLUGIN\",\n width: 26,\n style: highlightSelection\n ? (value) => (value.startsWith(\">\") ? theme.accent(value) : value)\n : undefined,\n },\n {\n key: \"version\",\n header: \"VERSION\",\n width: 12,\n },\n {\n key: \"updatedAt\",\n header: \"UPDATED\",\n width: 16,\n fitContent: true,\n transform: (value) =>\n value ? format.formatRelativeTime(String(value)) : \"\",\n },\n ];\n}\n\nfunction findInstalledLocalPlugin(\n catalogPlugin: CatalogPlugin,\n localPlugins: Plugin[],\n): Plugin | undefined {\n const publishedMatches = localPlugins.filter(\n (plugin) =>\n plugin.org_slug === catalogPlugin.orgSlug\n && plugin.catalog_slug === catalogPlugin.catalogSlug\n && plugin.name === catalogPlugin.slug,\n );\n if (publishedMatches.length === 0) {\n return undefined;\n }\n return [...publishedMatches].sort((left, right) => semver.rcompare(left.version, right.version))[0];\n}\n\nfunction formatRemoteCatalogVersion(\n catalogPlugin: CatalogPlugin,\n localPlugins: Plugin[],\n): string {\n const latestVersion = catalogPlugin.latestVersion;\n if (!latestVersion) {\n return theme.muted(\": \");\n }\n\n const installed = findInstalledLocalPlugin(catalogPlugin, localPlugins);\n const displayVersion = installed?.version ?? latestVersion;\n return formatVersionWithDrift(displayVersion, latestVersion);\n}\n\nfunction tableLayout(maxWidth?: number): { maxWidth: number; wordWrap: true } {\n return {\n maxWidth: resolveTableMaxWidth(maxWidth),\n wordWrap: true,\n };\n}\n\nfunction renderLocalSectionTable(\n rows: PluginListBrowseRow[],\n activeRow: PluginListBrowseRow | undefined,\n opts: {\n showId: boolean;\n profileMode: boolean;\n activeProfileName?: string | null;\n maxWidth?: number;\n },\n): string {\n const localRows = rows.filter((row): row is Extract<PluginListBrowseRow, { section: \"local\" }> =>\n row.section === \"local\",\n );\n if (localRows.length === 0) {\n return theme.muted(opts.profileMode ? \"No profile plugins found.\" : \"No plugins found.\");\n }\n\n const activePluginId = activeRow?.section === \"local\" ? activeRow.plugin.id : undefined;\n const tableRows: LocalTableRow[] = localRows.map((row) => ({\n ...(opts.showId ? { id: row.plugin.id } : {}),\n name: formatLocalPluginListName(row.plugin, {\n selected: row.plugin.id === activePluginId,\n }),\n origin: formatPluginOriginDisplay(\n row.plugin.origin || \"authored\",\n row.plugin.origin_locator,\n ),\n version: formatPluginVersionLabel(row.plugin.version, row.plugin.dirty),\n ...(opts.profileMode\n ? {\n active: opts.activeProfileName === row.plugin.name ? \"yes\" : \"\",\n }\n : {}),\n description: row.plugin.description ?? \"\",\n }));\n\n return renderTable({\n columns: makeLocalColumns(opts.showId, opts.profileMode),\n rows: tableRows,\n ...tableLayout(opts.maxWidth),\n });\n}\n\nfunction renderRemoteSectionTable(\n rows: PluginListBrowseRow[],\n activeRow: PluginListBrowseRow | undefined,\n opts: { maxWidth?: number; localPlugins?: Plugin[] },\n): string {\n const remoteRows = rows.filter((row): row is Extract<PluginListBrowseRow, { section: \"remote\" }> =>\n row.section === \"remote\",\n );\n if (remoteRows.length === 0) {\n return theme.muted(\"No matching plugins.\");\n }\n\n const activeKey = activeRow?.section === \"remote\"\n ? catalogPluginKey(activeRow.catalogPlugin)\n : undefined;\n const localPlugins = opts.localPlugins ?? [];\n const tableRows = remoteRows.map((row) => {\n const isSelected = catalogPluginKey(row.catalogPlugin) === activeKey;\n return {\n catalog: formatCatalogScopePath(row.catalogPlugin),\n slug: formatCatalogPluginListSlug(row.catalogPlugin, { selected: isSelected }),\n version: formatRemoteCatalogVersion(row.catalogPlugin, localPlugins),\n updatedAt: row.catalogPlugin.updatedAt ?? \"\",\n };\n });\n\n return renderTable({\n columns: makeRemoteColumns(true),\n rows: tableRows,\n ...tableLayout(opts.maxWidth),\n });\n}\n\nexport type PluginListBrowseViewportOptions = {\n activeIndex: number;\n navigable: PluginListBrowseRow[];\n terminalRows: number;\n maxWidth?: number;\n showId?: boolean;\n profileMode?: boolean;\n activeProfileName?: string | null;\n scopeLabel?: string;\n localPlugins?: Plugin[];\n};\n\nexport function renderGroupedPluginListBrowseViewport(\n opts: PluginListBrowseViewportOptions,\n): string {\n if (opts.navigable.length === 0) {\n return theme.muted(\"No matching plugins.\");\n }\n\n const ctx = resolvePluginListActiveSectionContext(opts.navigable, opts.activeIndex);\n if (ctx.sectionRows.length === 0) {\n return theme.muted(\"No matching plugins.\");\n }\n\n const profileMode = Boolean(opts.profileMode);\n const maxWidth = resolveTableMaxWidth(opts.maxWidth);\n const maxVisibleRows = computeMaxVisibleTableRows(\n opts.terminalRows,\n VIEWPORT_CHROME_LINES.pluginListBrowse,\n { sectionOverhead: 6 },\n );\n const viewport = resolveSectionViewport(\n ctx.sectionRows.length,\n ctx.indexInSection,\n maxVisibleRows,\n );\n const visibleRows = ctx.sectionRows.slice(viewport.start, viewport.end);\n const activeRow = opts.navigable[opts.activeIndex];\n const table = ctx.section === \"local\"\n ? renderLocalSectionTable(visibleRows, activeRow, {\n showId: Boolean(opts.showId),\n profileMode,\n activeProfileName: opts.activeProfileName,\n maxWidth: opts.maxWidth,\n })\n : renderRemoteSectionTable(visibleRows, activeRow, {\n maxWidth: opts.maxWidth,\n localPlugins: opts.localPlugins,\n });\n\n return [\n renderSectionSubheader(\n ctx.section,\n ctx.sectionRows.length,\n profileMode,\n opts.scopeLabel,\n ),\n table,\n renderViewportOverflowHints(ctx, viewport, profileMode, maxWidth, opts.scopeLabel),\n ]\n .filter((line) => line.length > 0)\n .join(\"\\n\");\n}\n\nexport function formatPluginListBrowseSelectionLabel(row: PluginListBrowseRow): string {\n if (row.section === \"local\") {\n return isProfilePlugin(row.plugin)\n ? `${icons.profile} ${row.plugin.name}`\n : row.plugin.name;\n }\n return isProfilePlugin(row.catalogPlugin)\n ? `${icons.profile} ${formatCatalogSelectionLabel(row.catalogPlugin)}`\n : formatCatalogSelectionLabel(row.catalogPlugin);\n}\n","import type { PluginOrigin } from \"../types.js\";\nimport { parseDependencyRef } from \"../utils/plugin-dependency-ref.js\";\nimport { parseOriginLocator } from \"../utils/plugin-origin-locator.js\";\n\n/**\n * Human origin label for plugin packages.\n * Marketplace imports show the marketplace name, not the storage enum.\n */\nexport function formatPluginOriginDisplay(\n origin: PluginOrigin,\n originLocator?: string | null,\n): string {\n if (origin === \"authored\") {\n return \"authored\";\n }\n const locator = originLocator?.trim()\n ? parseOriginLocator(originLocator)\n : null;\n if (!locator) {\n return origin;\n }\n switch (locator.kind) {\n case \"marketplace\": {\n const parsed = parseDependencyRef(locator.ref);\n return parsed.namespace || locator.ref;\n }\n case \"git\":\n return locator.url;\n case \"catalog\":\n return `${locator.org}/${locator.catalog}`;\n default: {\n const _exhaustive: never = locator;\n return _exhaustive;\n }\n }\n}\n","import semver from \"semver\";\nimport { theme } from \"./theme.js\";\n\nfunction normalizeVersion(version: string): string {\n return version.startsWith(\"v\") ? version.slice(1) : version;\n}\n\nfunction parseCoreParts(version: string): [number, number, number] | null {\n const parsed = semver.parse(normalizeVersion(version), { loose: true });\n if (!parsed) {\n return null;\n }\n return [parsed.major, parsed.minor, parsed.patch];\n}\n\nexport function formatVersionWithDrift(current: string, latest: string | null): string {\n if (!current) {\n return theme.muted(\": \");\n }\n if (!latest) {\n return current;\n }\n\n const normalizedCurrent = normalizeVersion(current);\n const normalizedLatest = normalizeVersion(latest);\n\n if (normalizedCurrent === normalizedLatest) {\n return theme.success(normalizedCurrent);\n }\n\n const currentParts = parseCoreParts(normalizedCurrent);\n const latestParts = parseCoreParts(normalizedLatest);\n if (!currentParts || !latestParts) {\n if (semver.valid(normalizedCurrent) && semver.valid(normalizedLatest)) {\n return semver.gte(normalizedCurrent, normalizedLatest)\n ? theme.success(normalizedCurrent)\n : theme.danger(normalizedCurrent);\n }\n return normalizedCurrent;\n }\n\n if (semver.gte(normalizedCurrent, normalizedLatest)) {\n return theme.success(normalizedCurrent);\n }\n\n let firstDivergentIndex = 3;\n for (let index = 0; index < currentParts.length; index += 1) {\n if (currentParts[index] !== latestParts[index]) {\n firstDivergentIndex = index;\n break;\n }\n }\n\n const segments = normalizedCurrent.split(\".\");\n let rendered = \"\";\n for (let index = 0; index < segments.length; index += 1) {\n if (index > 0) {\n rendered += \".\";\n }\n const segment = segments[index] ?? \"\";\n rendered += index < firstDivergentIndex\n ? theme.success(segment)\n : theme.danger(segment);\n }\n return rendered;\n}\n","import type { Plugin } from \"../../../types.js\";\nimport {\n filterLocalBrowseRows,\n renderGroupedPluginListBrowseViewport,\n toLocalBrowseRows,\n type PluginListBrowseRow,\n} from \"../../../ui/plugin-list-render.js\";\nimport type {\n TableBrowserAdapter,\n ViewportRenderArgs,\n} from \"../prompts/table-browser-types.js\";\n\nexport function createLocalPluginPickAdapter(config: {\n plugins: Plugin[];\n profileMode?: boolean;\n showId?: boolean;\n activeProfileName?: string | null;\n onPick?: (plugin: Plugin) => string;\n}): TableBrowserAdapter<PluginListBrowseRow, string> {\n return {\n resolveItems: (query) => {\n const navigable = filterLocalBrowseRows(config.plugins, query);\n return { filtered: navigable, navigable };\n },\n renderViewport: (args: ViewportRenderArgs<PluginListBrowseRow>) =>\n renderGroupedPluginListBrowseViewport({\n activeIndex: args.active,\n navigable: args.navigable,\n terminalRows: args.terminalRows,\n maxWidth: args.terminalWidth,\n showId: config.showId,\n profileMode: config.profileMode,\n activeProfileName: config.activeProfileName,\n }),\n renderShow: (row) =>\n row.section === \"local\"\n ? `${row.plugin.name}@${row.plugin.version}`\n : \"\",\n onPick: (row) => {\n if (row.section !== \"local\") {\n return \"\";\n }\n return config.onPick?.(row.plugin) ?? row.plugin.name;\n },\n helpActions: [\n [\"↑↓\", \"select\"],\n [\"type\", \"search\"],\n [\"⏎\", \"select\"],\n [\"esc\", \"cancel\"],\n ],\n };\n}\n\nexport function toLocalPluginPickRows(plugins: Plugin[]): PluginListBrowseRow[] {\n return toLocalBrowseRows(plugins);\n}\n","import { listPlugins } from \"../../models/plugin-model.js\";\nimport { getActiveProfileName } from \"../active-profile.js\";\nimport { isProfilePlugin } from \"../../constants/profile.js\";\nimport { createLocalPluginPickAdapter } from \"./adapters/plugin-table-browser.js\";\nimport { createTableBrowserPrompt } from \"./prompts/create-table-browser-prompt.js\";\n\nexport async function runPluginShowWizard(input?: {\n message?: string;\n search?: string;\n profileMode?: boolean;\n}): Promise<string | undefined> {\n const plugins = listPlugins().filter((plugin) =>\n input?.profileMode ? isProfilePlugin(plugin) : true,\n );\n if (plugins.length === 0) {\n return undefined;\n }\n\n const result = await createTableBrowserPrompt({\n message:\n input?.message\n ?? (input?.profileMode\n ? \"Which profile do you want to show?\"\n : \"Which plugin do you want to show?\"),\n initialQuery: input?.search,\n intent: { kind: \"pick-one\", action: \"show\" },\n adapter: createLocalPluginPickAdapter({\n plugins,\n profileMode: input?.profileMode,\n activeProfileName: input?.profileMode ? getActiveProfileName() : null,\n onPick: (plugin) => plugin.name,\n }),\n });\n\n if (result.kind === \"pick-one\") {\n return result.value;\n }\n\n return undefined;\n}\n","import { runPluginShowWizard } from \"../../services/wizards/plugin-show.js\";\nimport { resolveOrPrompt, shouldUseWizard } from \"../../services/wizards/shared.js\";\nimport { parseOutputFormat } from \"../../utils/output-format.js\";\n\nexport async function resolvePluginMutationTarget(input: {\n pluginName?: string;\n interactive?: boolean;\n noInteractive?: boolean;\n format?: string;\n message: string;\n profileMode?: boolean;\n}): Promise<string | undefined> {\n const format = parseOutputFormat(input.format);\n\n return resolveOrPrompt({\n value: input.pluginName,\n shouldPrompt: shouldUseWizard({\n interactive: input.interactive,\n noInteractive: input.noInteractive,\n format,\n missingRequiredArgs: !input.pluginName,\n }),\n prompt: async () =>\n runPluginShowWizard({ message: input.message, profileMode: input.profileMode }),\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,aAAY;;;ACQZ,SAAS,0BACd,QACA,eACQ;AACR,MAAI,WAAW,YAAY;AACzB,WAAO;AAAA,EACT;AACA,QAAM,UAAU,eAAe,KAAK,IAChC,mBAAmB,aAAa,IAChC;AACJ,MAAI,CAAC,SAAS;AACZ,WAAO;AAAA,EACT;AACA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK,eAAe;AAClB,YAAM,SAAS,mBAAmB,QAAQ,GAAG;AAC7C,aAAO,OAAO,aAAa,QAAQ;AAAA,IACrC;AAAA,IACA,KAAK;AACH,aAAO,QAAQ;AAAA,IACjB,KAAK;AACH,aAAO,GAAG,QAAQ,GAAG,IAAI,QAAQ,OAAO;AAAA,IAC1C,SAAS;AACP,YAAM,cAAqB;AAC3B,aAAO;AAAA,IACT;AAAA,EACF;AACF;;;ACnCA,OAAO,YAAY;AAGnB,SAAS,iBAAiB,SAAyB;AACjD,SAAO,QAAQ,WAAW,GAAG,IAAI,QAAQ,MAAM,CAAC,IAAI;AACtD;AAEA,SAAS,eAAe,SAAkD;AACxE,QAAM,SAAS,OAAO,MAAM,iBAAiB,OAAO,GAAG,EAAE,OAAO,KAAK,CAAC;AACtE,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AACA,SAAO,CAAC,OAAO,OAAO,OAAO,OAAO,OAAO,KAAK;AAClD;AAEO,SAAS,uBAAuB,SAAiB,QAA+B;AACrF,MAAI,CAAC,SAAS;AACZ,WAAO,MAAM,MAAM,IAAI;AAAA,EACzB;AACA,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,EACT;AAEA,QAAM,oBAAoB,iBAAiB,OAAO;AAClD,QAAM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C9B,QAAM,SAAS,kBAAkB,MAAM,MAAM;AAE7C,SAAO,gBAAgB;AAAA,IACrB,OAAO,MAAM;AAAA,IACb,cAAc,gBAAgB;AAAA,MAC5B,aAAa,MAAM;AAAA,MACnB,eAAe,MAAM;AAAA,MACrB;AAAA,MACA,qBAAqB,CAAC,MAAM;AAAA,IAC9B,CAAC;AAAA,IACD,QAAQ,YACN,oBAAoB,EAAE,SAAS,MAAM,SAAS,aAAa,MAAM,YAAY,CAAC;AAAA,EAClF,CAAC;AACH;","names":["semver","semver"]}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listResourceTrackedDirectories
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
listProjects
|
|
6
|
-
} from "./chunk-AUWWL6KX.js";
|
|
3
|
+
} from "./chunk-GRASK6M6.js";
|
|
7
4
|
import {
|
|
5
|
+
listProjects,
|
|
8
6
|
resolveHomeRoot
|
|
9
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DF4Z7LAD.js";
|
|
10
8
|
import {
|
|
11
9
|
getHarnesstapDir
|
|
12
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WG5A6EAU.js";
|
|
13
11
|
|
|
14
12
|
// src/services/open-path.ts
|
|
15
|
-
import {
|
|
13
|
+
import { spawn } from "child_process";
|
|
16
14
|
import { existsSync, realpathSync, statSync } from "fs";
|
|
17
15
|
import { dirname, isAbsolute, join, relative, resolve, sep } from "path";
|
|
18
16
|
function runOpener(command, args, filePath) {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
const child = spawn(command, args, {
|
|
18
|
+
stdio: "ignore",
|
|
19
|
+
detached: true,
|
|
20
|
+
windowsHide: true
|
|
21
|
+
});
|
|
22
|
+
child.on("error", (error) => {
|
|
23
|
+
console.error(`[ht-agent] failed to open ${filePath}: ${error.message}`);
|
|
24
|
+
});
|
|
25
|
+
child.unref();
|
|
26
26
|
}
|
|
27
27
|
function openPathInSystemEditor(filePath) {
|
|
28
28
|
const platform = process.platform;
|
|
@@ -112,4 +112,4 @@ export {
|
|
|
112
112
|
openPathInSystemEditor,
|
|
113
113
|
resolveOpenableFilesystemPath
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=chunk-
|
|
115
|
+
//# sourceMappingURL=chunk-N3VGY3T3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/services/open-path.ts"],"sourcesContent":["import { spawn } from \"node:child_process\";\nimport { existsSync, realpathSync, statSync } from \"node:fs\";\nimport { dirname, isAbsolute, join, relative, resolve, sep } from \"node:path\";\nimport { getHarnesstapDir } from \"../db/connection.js\";\nimport { listProjects } from \"../models/project.js\";\nimport { listResourceTrackedDirectories } from \"./resource-tracked-directories.js\";\nimport { resolveHomeRoot } from \"../utils/home-root.js\";\n\n/** Start a file-manager opener and return. Do not wait for Finder, Explorer, or xdg-open. */\nfunction runOpener(command: string, args: string[], filePath: string): void {\n const child = spawn(command, args, {\n stdio: \"ignore\",\n detached: true,\n windowsHide: true,\n });\n child.on(\"error\", (error) => {\n console.error(`[ht-agent] failed to open ${filePath}: ${error.message}`);\n });\n child.unref();\n}\n\nexport function openPathInSystemEditor(filePath: string): void {\n const platform = process.platform;\n if (platform === \"darwin\") {\n runOpener(\"open\", [filePath], filePath);\n return;\n }\n if (platform === \"win32\") {\n runOpener(\"cmd\", [\"/c\", \"start\", \"\", filePath], filePath);\n return;\n }\n runOpener(\"xdg-open\", [filePath], filePath);\n}\n\n/** Reveal a file in Finder / Explorer, or open a directory in the file manager. */\nexport function revealPathInFileManager(filePath: string): void {\n let isDirectory = false;\n try {\n isDirectory = statSync(filePath).isDirectory();\n } catch {\n isDirectory = false;\n }\n if (isDirectory) {\n openPathInSystemEditor(filePath);\n return;\n }\n\n const platform = process.platform;\n if (platform === \"darwin\") {\n runOpener(\"open\", [\"-R\", filePath], filePath);\n return;\n }\n if (platform === \"win32\") {\n runOpener(\"explorer\", [\"/select,\", filePath], filePath);\n return;\n }\n runOpener(\"xdg-open\", [dirname(filePath)], filePath);\n}\n\nexport function expandUserPath(candidate: string): string {\n const trimmed = candidate.trim();\n if (trimmed.startsWith(\"~/\")) {\n return join(resolveHomeRoot(), trimmed.slice(2));\n }\n if (trimmed === \"~\") {\n return resolveHomeRoot();\n }\n return resolve(trimmed);\n}\n\nfunction realExistingPath(path: string): string | null {\n if (!existsSync(path)) {\n return null;\n }\n try {\n return realpathSync(path);\n } catch {\n return null;\n }\n}\n\nfunction isNestedOrEqual(root: string, target: string): boolean {\n if (target === root) {\n return true;\n }\n const rel = relative(root, target);\n return rel !== \"\" && rel !== \"..\" && !rel.startsWith(`..${sep}`) && !isAbsolute(rel);\n}\n\nfunction collectAllowedOpenRoots(): string[] {\n const candidates = [\n getHarnesstapDir(),\n resolveHomeRoot(),\n ...listProjects().map((project) => project.local_path),\n ...listResourceTrackedDirectories().map((entry) => entry.path),\n ];\n const roots: string[] = [];\n for (const candidate of candidates) {\n const real = realExistingPath(candidate);\n if (real) {\n roots.push(real);\n }\n }\n return roots;\n}\n\nexport function isPathUnderAllowedOpenRoots(realPath: string): boolean {\n return collectAllowedOpenRoots().some((root) => isNestedOrEqual(root, realPath));\n}\n\nexport function resolveOpenableFilesystemPath(candidate: string): string {\n const trimmed = candidate.trim();\n if (!trimmed) {\n throw new Error(\"Path is required\");\n }\n\n const expanded = expandUserPath(trimmed);\n const real = realExistingPath(expanded);\n if (!real) {\n throw new Error(`Path is not an openable file or directory: ${candidate}`);\n }\n\n let isFileOrDirectory = false;\n try {\n const stat = statSync(real);\n isFileOrDirectory = stat.isFile() || stat.isDirectory();\n } catch {\n isFileOrDirectory = false;\n }\n if (!isFileOrDirectory) {\n throw new Error(`Path is not an openable file or directory: ${candidate}`);\n }\n\n if (!isPathUnderAllowedOpenRoots(real)) {\n throw new Error(`Path is outside allowed roots: ${real}`);\n }\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