harnesstap 1.4.0 → 1.6.1
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 +3 -1
- package/dist/apply-ZGEAY6YZ.js +50 -0
- package/dist/{approve-FBGYQGWN.js → approve-VPVMU2MM.js} +10 -13
- package/dist/{approve-FBGYQGWN.js.map → approve-VPVMU2MM.js.map} +1 -1
- package/dist/{audit-VI4QZ6X2.js → audit-AO7AGET3.js} +11 -15
- package/dist/{audit-VI4QZ6X2.js.map → audit-AO7AGET3.js.map} +1 -1
- package/dist/{auth-4CQCDS2W.js → auth-7YRIJNXU.js} +10 -12
- package/dist/{auth-4CQCDS2W.js.map → auth-7YRIJNXU.js.map} +1 -1
- package/dist/bin.js +13 -34
- package/dist/bin.js.map +1 -1
- package/dist/{chunk-OML4HXKT.js → chunk-262KZULH.js} +16 -22
- package/dist/chunk-262KZULH.js.map +1 -0
- package/dist/{chunk-ZUASVASP.js → chunk-26QGX47N.js} +26097 -16881
- package/dist/chunk-26QGX47N.js.map +1 -0
- package/dist/{chunk-3P6BWL5F.js → chunk-27IPOVKQ.js} +2 -2
- package/dist/{chunk-M4KLHJ6U.js → chunk-2BESDRYP.js} +8 -10
- package/dist/{chunk-M4KLHJ6U.js.map → chunk-2BESDRYP.js.map} +1 -1
- package/dist/{chunk-PCMON7Y2.js → chunk-2BWIEB2G.js} +8 -10
- package/dist/{chunk-PCMON7Y2.js.map → chunk-2BWIEB2G.js.map} +1 -1
- package/dist/{chunk-XTVGCVU4.js → chunk-2NMLWSUH.js} +41 -42
- package/dist/chunk-2NMLWSUH.js.map +1 -0
- package/dist/{chunk-TQ2NA4Z4.js → chunk-4E3G4H5B.js} +8 -2
- package/dist/chunk-4E3G4H5B.js.map +1 -0
- package/dist/chunk-4QCGTUTM.js +61 -0
- package/dist/chunk-4QCGTUTM.js.map +1 -0
- package/dist/{chunk-TPEJFLV7.js → chunk-6RKJZW2N.js} +4 -6
- package/dist/{chunk-TPEJFLV7.js.map → chunk-6RKJZW2N.js.map} +1 -1
- package/dist/{chunk-JQOKQKQT.js → chunk-7IBFH736.js} +2 -2
- package/dist/{chunk-P2C7JPLD.js → chunk-CKJIS2FM.js} +6 -6
- package/dist/{chunk-R7ZOYVN3.js → chunk-CUOEQQFI.js} +187 -59
- package/dist/chunk-CUOEQQFI.js.map +1 -0
- package/dist/{chunk-REHRUNBB.js → chunk-CWXCZBJR.js} +70 -5
- package/dist/chunk-CWXCZBJR.js.map +1 -0
- package/dist/{chunk-4ZQ2SCGY.js → chunk-FLYQEB6D.js} +509 -207
- package/dist/chunk-FLYQEB6D.js.map +1 -0
- package/dist/{chunk-U6DXASQP.js → chunk-HC7IZY75.js} +2 -2
- package/dist/{chunk-UVVZHWD2.js → chunk-I4DKV63E.js} +2 -2
- package/dist/{chunk-PNGF5EV2.js → chunk-JEC5PWNH.js} +2 -2
- package/dist/{chunk-MR7IOHSX.js → chunk-KFIRABC7.js} +16 -22
- package/dist/{chunk-MR7IOHSX.js.map → chunk-KFIRABC7.js.map} +1 -1
- package/dist/{chunk-6LTLYV5D.js → chunk-LGWFLVZQ.js} +1064 -265
- package/dist/chunk-LGWFLVZQ.js.map +1 -0
- package/dist/{chunk-RDG5DT7S.js → chunk-LX6PMOOC.js} +54 -40
- package/dist/chunk-LX6PMOOC.js.map +1 -0
- package/dist/{chunk-WGP4GUYZ.js → chunk-MILGCNBK.js} +9 -11
- package/dist/{chunk-WGP4GUYZ.js.map → chunk-MILGCNBK.js.map} +1 -1
- package/dist/chunk-MKLJBW5N.js +14 -0
- package/dist/{chunk-N3ZCH64F.js → chunk-MSKTWYHG.js} +86 -32
- package/dist/chunk-MSKTWYHG.js.map +1 -0
- package/dist/{chunk-WG5A6EAU.js → chunk-MTCCUYBZ.js} +821 -28
- package/dist/chunk-MTCCUYBZ.js.map +1 -0
- package/dist/{chunk-BPWFQKI5.js → chunk-NIFKCS7J.js} +2 -2
- package/dist/{chunk-43BDGVN3.js → chunk-NWOYPK2O.js} +56 -9
- package/dist/chunk-NWOYPK2O.js.map +1 -0
- package/dist/{chunk-3FS775NP.js → chunk-NXILQDJG.js} +85 -4
- package/dist/chunk-NXILQDJG.js.map +1 -0
- package/dist/chunk-QF73VLAW.js +31673 -0
- package/dist/chunk-QF73VLAW.js.map +1 -0
- package/dist/{chunk-RFQ3N7FB.js → chunk-QHCGA6LC.js} +11 -19
- package/dist/chunk-QHCGA6LC.js.map +1 -0
- package/dist/{chunk-L6YZE5MY.js → chunk-QPJZKWML.js} +5 -7
- package/dist/{chunk-L6YZE5MY.js.map → chunk-QPJZKWML.js.map} +1 -1
- package/dist/{chunk-ULCD6DJE.js → chunk-RM7VP6ID.js} +24 -61
- package/dist/chunk-RM7VP6ID.js.map +1 -0
- package/dist/{chunk-7HP6AAI3.js → chunk-SMLO5YPI.js} +2 -2
- package/dist/{chunk-73OJQTBW.js → chunk-T2JBSRGG.js} +2 -2
- package/dist/{chunk-IE7B6Q5K.js → chunk-U5Y6WKKT.js} +17 -18
- package/dist/chunk-U5Y6WKKT.js.map +1 -0
- package/dist/chunk-UEA4NCY2.js +106 -0
- package/dist/chunk-UEA4NCY2.js.map +1 -0
- package/dist/chunk-VAPCU2FX.js +70 -0
- package/dist/chunk-VAPCU2FX.js.map +1 -0
- package/dist/{chunk-RVEXPMM3.js → chunk-WEJVFNRO.js} +3 -5
- package/dist/{chunk-RVEXPMM3.js.map → chunk-WEJVFNRO.js.map} +1 -1
- package/dist/{chunk-IMROMZ2K.js → chunk-WWFVMCTR.js} +19 -14
- package/dist/chunk-WWFVMCTR.js.map +1 -0
- package/dist/chunk-XPONNOBR.js +102 -0
- package/dist/chunk-XPONNOBR.js.map +1 -0
- package/dist/{chunk-N3VGY3T3.js → chunk-Y3HJ2F2W.js} +7 -5
- package/dist/{chunk-N3VGY3T3.js.map → chunk-Y3HJ2F2W.js.map} +1 -1
- package/dist/{chunk-2A36HWDE.js → chunk-Y4I7ZCAE.js} +129 -136
- package/dist/chunk-Y4I7ZCAE.js.map +1 -0
- package/dist/{chunk-GRASK6M6.js → chunk-ZREU2UHM.js} +5 -5
- package/dist/{chunk-QA5U36JN.js → chunk-ZT7ANP3H.js} +774 -364
- package/dist/chunk-ZT7ANP3H.js.map +1 -0
- package/dist/{chunk-EOPFER6N.js → chunk-ZUXFPAVX.js} +19 -5
- package/dist/chunk-ZUXFPAVX.js.map +1 -0
- package/dist/{chunk-D432JAXV.js → chunk-ZWB6YXVQ.js} +153 -25
- package/dist/chunk-ZWB6YXVQ.js.map +1 -0
- package/dist/{chunk-23XSG7LI.js → chunk-ZZQDJGWX.js} +4 -4
- package/dist/{compile-GXADKGH5.js → compile-IMJHVXQO.js} +33 -37
- package/dist/{compile-GXADKGH5.js.map → compile-IMJHVXQO.js.map} +1 -1
- package/dist/{config-JMHNA2U5.js → config-FVVN3NWL.js} +16 -21
- package/dist/{config-JMHNA2U5.js.map → config-FVVN3NWL.js.map} +1 -1
- package/dist/cursor-local-install-JS5KSOES.js +94 -0
- package/dist/{cursor-local-install-46RWRBDT.js.map → cursor-local-install-JS5KSOES.js.map} +1 -1
- package/dist/{cursor-local-install-46RWRBDT.js → cursor-local-install-QU5R2FV5.js} +8 -12
- package/dist/cursor-local-install-QU5R2FV5.js.map +1 -0
- package/dist/{doctor-N7ZULPOL.js → doctor-A7VUJSCP.js} +14 -17
- package/dist/doctor-A7VUJSCP.js.map +1 -0
- package/dist/{environment-OBB3WU5B.js → environment-6INIUBNC.js} +42 -50
- package/dist/environment-6INIUBNC.js.map +1 -0
- package/dist/{github-PBYBGOLH.js → github-TFJT3P53.js} +9 -10
- package/dist/{github-PBYBGOLH.js.map → github-TFJT3P53.js.map} +1 -1
- package/dist/{harness-7KYATIV6.js → harness-WQNC5HPZ.js} +46 -84
- package/dist/harness-WQNC5HPZ.js.map +1 -0
- package/dist/{help-EE3AJQD4.js → help-NMS3EXJB.js} +15 -20
- package/dist/{help-EE3AJQD4.js.map → help-NMS3EXJB.js.map} +1 -1
- package/dist/{help-VXWKLQ6A.js → help-VW4RIICD.js} +57 -575
- package/dist/help-VW4RIICD.js.map +1 -0
- package/dist/host-plugin-view-kept-HYCHDB4D.js +139 -0
- package/dist/host-plugin-view-kept-HYCHDB4D.js.map +1 -0
- package/dist/index.js +12 -16
- package/dist/{init-LBTMPDVJ.js → init-RXYL5ZUE.js} +33 -41
- package/dist/{init-LBTMPDVJ.js.map → init-RXYL5ZUE.js.map} +1 -1
- package/dist/live-read-cache-BHU6L7MA.js +13 -0
- package/dist/live-read-cache-NQU7M2C7.js +12 -0
- package/dist/{lock-WLJRXRVK.js → lock-3H3Z65DS.js} +9 -12
- package/dist/{lock-WLJRXRVK.js.map → lock-3H3Z65DS.js.map} +1 -1
- package/dist/{marketplace-GXSV6QIY.js → marketplace-KW35PJCY.js} +26 -79
- package/dist/marketplace-KW35PJCY.js.map +1 -0
- package/dist/{mcp-XPDWWU75.js → mcp-2HUGVDJ5.js} +33 -37
- package/dist/{mcp-XPDWWU75.js.map → mcp-2HUGVDJ5.js.map} +1 -1
- package/dist/{migrate-SBUIWN3U.js → migrate-6VAPYNXI.js} +93 -34
- package/dist/migrate-6VAPYNXI.js.map +1 -0
- package/dist/notifications-Y7KQCN6K.js +154 -0
- package/dist/notifications-Y7KQCN6K.js.map +1 -0
- package/dist/open-FADABB2S.js +20 -0
- package/dist/{pack-A73LDVOX.js → pack-NTECD3BZ.js} +10 -14
- package/dist/{pack-A73LDVOX.js.map → pack-NTECD3BZ.js.map} +1 -1
- package/dist/plugin-T2YFCYIO.js +47 -0
- package/dist/plugin-from-project-FGX5AHW6.js +15 -0
- package/dist/{policy-6VY3CMSU.js → policy-3FOWB4GR.js} +9 -12
- package/dist/{policy-6VY3CMSU.js.map → policy-3FOWB4GR.js.map} +1 -1
- package/dist/{profile-YCKPMRRU.js → profile-HM3ROXXB.js} +108 -78
- package/dist/profile-HM3ROXXB.js.map +1 -0
- package/dist/{project-KHPPBKPN.js → project-3DTXKMI6.js} +512 -119
- package/dist/project-3DTXKMI6.js.map +1 -0
- package/dist/{resource-IJU3FAN5.js → resource-TZDZAVZ6.js} +55 -45
- package/dist/resource-TZDZAVZ6.js.map +1 -0
- package/dist/status-refresh-worker.js +1155 -0
- package/dist/status-refresh-worker.js.map +1 -0
- package/dist/{version-Z66FWWMQ.js → version-AMZJHJIB.js} +3 -3
- package/dist/version-AMZJHJIB.js.map +1 -0
- package/package.json +16 -11
- package/dist/apply-SUNDXRJ3.js +0 -54
- package/dist/chunk-2A36HWDE.js.map +0 -1
- package/dist/chunk-2H7UOFLK.js +0 -11
- package/dist/chunk-3FS775NP.js.map +0 -1
- package/dist/chunk-43BDGVN3.js.map +0 -1
- package/dist/chunk-4ZQ2SCGY.js.map +0 -1
- package/dist/chunk-6LTLYV5D.js.map +0 -1
- package/dist/chunk-D432JAXV.js.map +0 -1
- package/dist/chunk-DF4Z7LAD.js +0 -3463
- package/dist/chunk-DF4Z7LAD.js.map +0 -1
- package/dist/chunk-EOPFER6N.js.map +0 -1
- package/dist/chunk-G6WKY2W4.js +0 -389
- package/dist/chunk-G6WKY2W4.js.map +0 -1
- package/dist/chunk-IE7B6Q5K.js.map +0 -1
- package/dist/chunk-IMROMZ2K.js.map +0 -1
- package/dist/chunk-M2U3J7UX.js +0 -46
- package/dist/chunk-M2U3J7UX.js.map +0 -1
- package/dist/chunk-N3ZCH64F.js.map +0 -1
- package/dist/chunk-NAGAJ5UM.js +0 -145
- package/dist/chunk-NAGAJ5UM.js.map +0 -1
- package/dist/chunk-OML4HXKT.js.map +0 -1
- package/dist/chunk-QA5U36JN.js.map +0 -1
- package/dist/chunk-R7ZOYVN3.js.map +0 -1
- package/dist/chunk-RDG5DT7S.js.map +0 -1
- package/dist/chunk-REHRUNBB.js.map +0 -1
- package/dist/chunk-RFQ3N7FB.js.map +0 -1
- package/dist/chunk-TQ2NA4Z4.js.map +0 -1
- package/dist/chunk-ULCD6DJE.js.map +0 -1
- package/dist/chunk-WG5A6EAU.js.map +0 -1
- package/dist/chunk-XGTTOO4R.js +0 -84
- package/dist/chunk-XGTTOO4R.js.map +0 -1
- package/dist/chunk-XTVGCVU4.js.map +0 -1
- package/dist/chunk-XUJKZQZA.js +0 -235
- package/dist/chunk-XUJKZQZA.js.map +0 -1
- package/dist/chunk-ZUASVASP.js.map +0 -1
- package/dist/doctor-N7ZULPOL.js.map +0 -1
- package/dist/environment-OBB3WU5B.js.map +0 -1
- package/dist/harness-7KYATIV6.js.map +0 -1
- package/dist/help-VXWKLQ6A.js.map +0 -1
- package/dist/live-read-cache-TUSP7U3D.js +0 -10
- package/dist/marketplace-GXSV6QIY.js.map +0 -1
- package/dist/migrate-SBUIWN3U.js.map +0 -1
- package/dist/open-HDGLYYVU.js +0 -24
- package/dist/plugin-CEO6ZJM5.js +0 -51
- package/dist/plugin-from-project-UK7VJVUP.js +0 -18
- package/dist/profile-YCKPMRRU.js.map +0 -1
- package/dist/project-KHPPBKPN.js.map +0 -1
- package/dist/resource-IJU3FAN5.js.map +0 -1
- /package/dist/{apply-SUNDXRJ3.js.map → apply-ZGEAY6YZ.js.map} +0 -0
- /package/dist/{chunk-3P6BWL5F.js.map → chunk-27IPOVKQ.js.map} +0 -0
- /package/dist/{chunk-JQOKQKQT.js.map → chunk-7IBFH736.js.map} +0 -0
- /package/dist/{chunk-P2C7JPLD.js.map → chunk-CKJIS2FM.js.map} +0 -0
- /package/dist/{chunk-U6DXASQP.js.map → chunk-HC7IZY75.js.map} +0 -0
- /package/dist/{chunk-UVVZHWD2.js.map → chunk-I4DKV63E.js.map} +0 -0
- /package/dist/{chunk-PNGF5EV2.js.map → chunk-JEC5PWNH.js.map} +0 -0
- /package/dist/{chunk-2H7UOFLK.js.map → chunk-MKLJBW5N.js.map} +0 -0
- /package/dist/{chunk-BPWFQKI5.js.map → chunk-NIFKCS7J.js.map} +0 -0
- /package/dist/{chunk-7HP6AAI3.js.map → chunk-SMLO5YPI.js.map} +0 -0
- /package/dist/{chunk-73OJQTBW.js.map → chunk-T2JBSRGG.js.map} +0 -0
- /package/dist/{chunk-GRASK6M6.js.map → chunk-ZREU2UHM.js.map} +0 -0
- /package/dist/{chunk-23XSG7LI.js.map → chunk-ZZQDJGWX.js.map} +0 -0
- /package/dist/{live-read-cache-TUSP7U3D.js.map → live-read-cache-BHU6L7MA.js.map} +0 -0
- /package/dist/{open-HDGLYYVU.js.map → live-read-cache-NQU7M2C7.js.map} +0 -0
- /package/dist/{plugin-CEO6ZJM5.js.map → open-FADABB2S.js.map} +0 -0
- /package/dist/{plugin-from-project-UK7VJVUP.js.map → plugin-T2YFCYIO.js.map} +0 -0
- /package/dist/{version-Z66FWWMQ.js.map → plugin-from-project-FGX5AHW6.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listPlugins
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-26QGX47N.js";
|
|
4
4
|
|
|
5
5
|
// src/services/completion/choices.ts
|
|
6
6
|
function toPluginChoices() {
|
|
@@ -14,4 +14,4 @@ function toPluginChoices() {
|
|
|
14
14
|
export {
|
|
15
15
|
toPluginChoices
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-27IPOVKQ.js.map
|
|
@@ -2,28 +2,26 @@ import {
|
|
|
2
2
|
executeProjectUse,
|
|
3
3
|
printApplyPayload,
|
|
4
4
|
reportApplyCancelled
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CUOEQQFI.js";
|
|
6
6
|
import {
|
|
7
7
|
MISSING_PROJECT_CONFIG_MESSAGE
|
|
8
8
|
} from "./chunk-VZQG2JDV.js";
|
|
9
9
|
import {
|
|
10
10
|
initializeSchema
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NXILQDJG.js";
|
|
12
12
|
import {
|
|
13
13
|
parseOutputFormat,
|
|
14
14
|
printJson
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4E3G4H5B.js";
|
|
16
16
|
import {
|
|
17
17
|
findProjectConfig,
|
|
18
18
|
resolveProfileEnvironment
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
ui
|
|
22
|
-
} from "./chunk-2A36HWDE.js";
|
|
19
|
+
} from "./chunk-26QGX47N.js";
|
|
23
20
|
import {
|
|
24
21
|
formatCount,
|
|
25
|
-
getDb
|
|
26
|
-
|
|
22
|
+
getDb,
|
|
23
|
+
ui
|
|
24
|
+
} from "./chunk-MTCCUYBZ.js";
|
|
27
25
|
|
|
28
26
|
// src/services/use-command.ts
|
|
29
27
|
import { resolve } from "path";
|
|
@@ -172,4 +170,4 @@ export {
|
|
|
172
170
|
handleUseCommand,
|
|
173
171
|
mapProfileUseDelegationOptions
|
|
174
172
|
};
|
|
175
|
-
//# sourceMappingURL=chunk-
|
|
173
|
+
//# sourceMappingURL=chunk-2BESDRYP.js.map
|
|
@@ -1 +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":"
|
|
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;AAAA,QACjB,SAAS,IAAI;AAAA,QACb,QAAQ,IAAI;AAAA,QACZ,oBAAoB,IAAI;AAAA,QACxB,aAAa,IAAI,eAAe;AAAA,QAChC,SAAS,IAAI,YAAY;AAAA,MAC3B,EAAE;AAAA,IACJ;AACA;AAAA,EACF;AAEA,MAAI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A,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":[]}
|
|
@@ -3,27 +3,25 @@ import {
|
|
|
3
3
|
listResourceTrackedDirectories,
|
|
4
4
|
removeResourceTrackedDirectory,
|
|
5
5
|
rescanResourceTrackedDirectories
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZREU2UHM.js";
|
|
7
7
|
import {
|
|
8
8
|
initializeSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NXILQDJG.js";
|
|
10
10
|
import {
|
|
11
11
|
COMMAND_HELP_REGISTRY,
|
|
12
12
|
configureCommandGroup
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-NWOYPK2O.js";
|
|
14
14
|
import {
|
|
15
15
|
parseOutputFormat,
|
|
16
16
|
printJson
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4E3G4H5B.js";
|
|
18
18
|
import {
|
|
19
19
|
fail
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QHCGA6LC.js";
|
|
21
21
|
import {
|
|
22
|
+
getDb,
|
|
22
23
|
ui
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
getDb
|
|
26
|
-
} from "./chunk-WG5A6EAU.js";
|
|
24
|
+
} from "./chunk-MTCCUYBZ.js";
|
|
27
25
|
|
|
28
26
|
// src/cli/commands/resource-directories.ts
|
|
29
27
|
import { resolve } from "path";
|
|
@@ -183,4 +181,4 @@ export {
|
|
|
183
181
|
printResourceTrackedDirectoriesList,
|
|
184
182
|
registerResourceDirectoriesCommand
|
|
185
183
|
};
|
|
186
|
-
//# sourceMappingURL=chunk-
|
|
184
|
+
//# sourceMappingURL=chunk-2BWIEB2G.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/commands/resource-directories.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport type { Command } from \"commander\";\nimport { getDb } from \"../../db/connection.js\";\nimport { initializeSchema } from \"../../db/schema.js\";\nimport { COMMAND_HELP_REGISTRY } from \"../../services/cli-help-registry.js\";\nimport {\n addResourceTrackedDirectory,\n listResourceTrackedDirectories,\n removeResourceTrackedDirectory,\n rescanResourceTrackedDirectories,\n type ResourceTrackedDirectoryEntry,\n} from \"../../services/resource-tracked-directories.js\";\nimport { ui } from \"../../ui/index.js\";\nimport { parseOutputFormat, printJson } from \"../../utils/output-format.js\";\nimport { configureCommandGroup } from \"../help.js\";\nimport { fail } from \"../shared.js\";\n\nfunction ensureLibraryDb(): void {\n initializeSchema(getDb());\n}\n\nfunction formatDirectoryCount(count: number): string {\n return `${count} tracked director${count === 1 ? \"y\" : \"ies\"}`;\n}\n\nfunction formatImportedCount(count: number): string {\n return `${count} resource${count === 1 ? \"\" : \"s\"} imported`;\n}\n\nfunction kindLabel(kind: ResourceTrackedDirectoryEntry[\"kind\"]): string {\n switch (kind) {\n case \"home_default\":\n return \"home\";\n case \"custom\":\n return \"custom\";\n default: {\n const _exhaustive: never = kind;\n throw _exhaustive;\n }\n }\n}\n\nfunction platformsCell(platformIds: string[]): string {\n return platformIds.length > 0 ? platformIds.join(\", \") : \": \";\n}\n\nasync function withCommandErrors(run: () => Promise<void>): Promise<void> {\n try {\n ensureLibraryDb();\n await run();\n } catch (error) {\n process.exitCode = 1;\n fail(error instanceof Error ? error.message : String(error));\n }\n}\n\nfunction printResourceTrackedDirectoriesTable(\n directories: ResourceTrackedDirectoryEntry[],\n): void {\n ui.table.print({\n columns: [\n { key: \"path\", header: \"PATH\", width: 40 },\n { key: \"resources\", header: \"RESOURCES\", width: 11 },\n { key: \"folders\", header: \"FOLDERS\", width: 9 },\n { key: \"kind\", header: \"KIND\", width: 8 },\n { key: \"platforms\", header: \"PLATFORMS\", width: 24 },\n ],\n rows: directories.map((entry) => ({\n path: entry.display_path ?? entry.path,\n resources: String(entry.resource_count),\n folders: String(entry.folders.length),\n kind: kindLabel(entry.kind),\n platforms: platformsCell(entry.platform_ids),\n })),\n summary: formatDirectoryCount(directories.length),\n });\n}\n\nexport function printResourceTrackedDirectoriesList(): void {\n printResourceTrackedDirectoriesTable(listResourceTrackedDirectories());\n}\n\nasync function handleList(opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const directories = listResourceTrackedDirectories();\n if (format === \"json\") {\n printJson(directories);\n return;\n }\n printResourceTrackedDirectoriesTable(directories);\n });\n}\n\nasync function handleAdd(path: string, opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const result = await addResourceTrackedDirectory(path);\n if (format === \"json\") {\n printJson(result);\n return;\n }\n ui.success(\n `Tracking ${result.directory.path} · ${formatImportedCount(result.imported_count)}`,\n { hint: \"Rescan later with ht resource directories rescan.\" },\n );\n });\n}\n\nasync function handleRemove(path: string, opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const resolved = resolve(path);\n removeResourceTrackedDirectory(path);\n if (format === \"json\") {\n printJson({ removed: true, path: resolved });\n return;\n }\n ui.success(`Stopped tracking ${resolved}`, {\n hint: \"Library resources from this path were not deleted.\",\n });\n });\n}\n\nasync function handleRescan(opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const result = await rescanResourceTrackedDirectories();\n if (format === \"json\") {\n printJson(result);\n return;\n }\n for (const row of result.rescanned) {\n if (!row.skipped) {\n continue;\n }\n ui.warn(`${row.path}: ${row.error ?? \"skipped\"}`);\n }\n const dirCount = result.directories.length;\n ui.success(\n `Rescanned ${dirCount} director${dirCount === 1 ? \"y\" : \"ies\"} · ${formatImportedCount(result.imported_count)}`,\n );\n });\n}\n\nexport function registerResourceDirectoriesCommand(resourceCmd: Command): void {\n const directoriesCmd = configureCommandGroup(\n resourceCmd\n .command(\"directories\")\n .description(\"Manage directories scanned into the resource library\"),\n );\n\n directoriesCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"List directories tracked for resource import\")\n .action(handleList);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.list\"] = {\n description: \"List directories tracked for resource import\",\n examples: [\n \"resource directories list\",\n \"resource directories list --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"add\")\n .argument(\"<path>\", \"Directory to track and import\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Track a directory and import resources (skip existing)\")\n .action(handleAdd);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.add\"] = {\n description: \"Track a directory and import resources (skip existing)\",\n examples: [\n \"resource directories add ./my-project\",\n \"resource directories add ./my-project --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"remove\")\n .alias(\"rm\")\n .argument(\"<path>\", \"Tracked directory to stop watching\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Stop tracking a directory (library resources stay)\")\n .action(handleRemove);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.remove\"] = {\n description: \"Stop tracking a directory (library resources stay)\",\n examples: [\n \"resource directories remove ./my-project\",\n \"resource directories rm ./my-project --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"rescan\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Re-scan home defaults and every tracked directory\")\n .action(handleRescan);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.rescan\"] = {\n description: \"Re-scan home defaults and every tracked directory\",\n examples: [\n \"resource directories rescan\",\n \"resource directories rescan --format json\",\n ],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAiBxB,SAAS,kBAAwB;AAC/B,mBAAiB,MAAM,CAAC;AAC1B;AAEA,SAAS,qBAAqB,OAAuB;AACnD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AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/resource-directories.ts"],"sourcesContent":["import { resolve } from \"node:path\";\nimport type { Command } from \"commander\";\nimport { getDb } from \"../../db/connection.js\";\nimport { initializeSchema } from \"../../db/schema.js\";\nimport { COMMAND_HELP_REGISTRY } from \"../../services/cli-help-registry.js\";\nimport {\n addResourceTrackedDirectory,\n listResourceTrackedDirectories,\n removeResourceTrackedDirectory,\n rescanResourceTrackedDirectories,\n type ResourceTrackedDirectoryEntry,\n} from \"../../services/resource-tracked-directories.js\";\nimport { ui } from \"../../ui/index.js\";\nimport { parseOutputFormat, printJson } from \"../../utils/output-format.js\";\nimport { configureCommandGroup } from \"../help.js\";\nimport { fail } from \"../shared.js\";\n\nfunction ensureLibraryDb(): void {\n initializeSchema(getDb());\n}\n\nfunction formatDirectoryCount(count: number): string {\n return `${count} tracked director${count === 1 ? \"y\" : \"ies\"}`;\n}\n\nfunction formatImportedCount(count: number): string {\n return `${count} resource${count === 1 ? \"\" : \"s\"} imported`;\n}\n\nfunction kindLabel(kind: ResourceTrackedDirectoryEntry[\"kind\"]): string {\n switch (kind) {\n case \"home_default\":\n return \"home\";\n case \"custom\":\n return \"custom\";\n default: {\n const _exhaustive: never = kind;\n throw _exhaustive;\n }\n }\n}\n\nfunction platformsCell(platformIds: string[]): string {\n return platformIds.length > 0 ? platformIds.join(\", \") : \": \";\n}\n\nasync function withCommandErrors(run: () => Promise<void>): Promise<void> {\n try {\n ensureLibraryDb();\n await run();\n } catch (error) {\n process.exitCode = 1;\n fail(error instanceof Error ? error.message : String(error));\n }\n}\n\nfunction printResourceTrackedDirectoriesTable(\n directories: ResourceTrackedDirectoryEntry[],\n): void {\n ui.table.print({\n columns: [\n { key: \"path\", header: \"PATH\", width: 40 },\n { key: \"resources\", header: \"RESOURCES\", width: 11 },\n { key: \"folders\", header: \"FOLDERS\", width: 9 },\n { key: \"kind\", header: \"KIND\", width: 8 },\n { key: \"platforms\", header: \"PLATFORMS\", width: 24 },\n ],\n rows: directories.map((entry) => ({\n path: entry.display_path ?? entry.path,\n resources: String(entry.resource_count),\n folders: String(entry.folders.length),\n kind: kindLabel(entry.kind),\n platforms: platformsCell(entry.platform_ids),\n })),\n summary: formatDirectoryCount(directories.length),\n });\n}\n\nexport function printResourceTrackedDirectoriesList(): void {\n printResourceTrackedDirectoriesTable(listResourceTrackedDirectories());\n}\n\nasync function handleList(opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const directories = listResourceTrackedDirectories();\n if (format === \"json\") {\n printJson(directories);\n return;\n }\n printResourceTrackedDirectoriesTable(directories);\n });\n}\n\nasync function handleAdd(path: string, opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const result = await addResourceTrackedDirectory(path);\n if (format === \"json\") {\n printJson(result);\n return;\n }\n ui.success(\n `Tracking ${result.directory.path} · ${formatImportedCount(result.imported_count)}`,\n { hint: \"Rescan later with ht resource directories rescan.\" },\n );\n });\n}\n\nasync function handleRemove(path: string, opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const resolved = resolve(path);\n removeResourceTrackedDirectory(path);\n if (format === \"json\") {\n printJson({ removed: true, path: resolved });\n return;\n }\n ui.success(`Stopped tracking ${resolved}`, {\n hint: \"Library resources from this path were not deleted.\",\n });\n });\n}\n\nasync function handleRescan(opts: { format?: string }): Promise<void> {\n await withCommandErrors(async () => {\n const format = parseOutputFormat(opts.format);\n const result = await rescanResourceTrackedDirectories();\n if (format === \"json\") {\n printJson(result);\n return;\n }\n for (const row of result.rescanned) {\n if (!row.skipped) {\n continue;\n }\n ui.warn(`${row.path}: ${row.error ?? \"skipped\"}`);\n }\n const dirCount = result.directories.length;\n ui.success(\n `Rescanned ${dirCount} director${dirCount === 1 ? \"y\" : \"ies\"} · ${formatImportedCount(result.imported_count)}`,\n );\n });\n}\n\nexport function registerResourceDirectoriesCommand(resourceCmd: Command): void {\n const directoriesCmd = configureCommandGroup(\n resourceCmd\n .command(\"directories\")\n .description(\"Manage directories scanned into the resource library\"),\n );\n\n directoriesCmd\n .command(\"list\")\n .alias(\"ls\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"List directories tracked for resource import\")\n .action(handleList);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.list\"] = {\n description: \"List directories tracked for resource import\",\n examples: [\n \"resource directories list\",\n \"resource directories list --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"add\")\n .argument(\"<path>\", \"Directory to track and import\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Track a directory and import resources (skip existing)\")\n .action(handleAdd);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.add\"] = {\n description: \"Track a directory and import resources (skip existing)\",\n examples: [\n \"resource directories add ./my-project\",\n \"resource directories add ./my-project --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"remove\")\n .alias(\"rm\")\n .argument(\"<path>\", \"Tracked directory to stop watching\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Stop tracking a directory (library resources stay)\")\n .action(handleRemove);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.remove\"] = {\n description: \"Stop tracking a directory (library resources stay)\",\n examples: [\n \"resource directories remove ./my-project\",\n \"resource directories rm ./my-project --format json\",\n ],\n };\n\n directoriesCmd\n .command(\"rescan\")\n .option(\"--format <mode>\", \"Output format: human or json\", \"human\")\n .description(\"Re-scan home defaults and every tracked directory\")\n .action(handleRescan);\n\n COMMAND_HELP_REGISTRY[\"resource.directories.rescan\"] = {\n description: \"Re-scan home defaults and every tracked directory\",\n examples: [\n \"resource directories rescan\",\n \"resource directories rescan --format json\",\n ],\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AAiBxB,SAAS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,mDAAmD,EAC/D,OAAO,YAAY;AAEtB,wBAAsB,6BAA6B,IAAI;AAAA,IACrD,aAAa;AAAA,IACb,UAAU;AAAA,MACR;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerResourceDirectoriesCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2BWIEB2G.js";
|
|
4
4
|
import {
|
|
5
5
|
resolvePluginMutationTarget
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-KFIRABC7.js";
|
|
7
7
|
import {
|
|
8
8
|
buildUnifiedDiffLines,
|
|
9
9
|
isTransparentCrossHarnessGap,
|
|
@@ -11,29 +11,24 @@ import {
|
|
|
11
11
|
scopeHostConfigToResource,
|
|
12
12
|
scopeMcpConfigToServer,
|
|
13
13
|
withAffectedResources
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZUXFPAVX.js";
|
|
15
15
|
import {
|
|
16
16
|
renderCliError
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import {
|
|
19
|
-
isPromptCancellationError,
|
|
20
|
-
promptForConfirmation,
|
|
21
|
-
shouldUseBrowsePicker
|
|
22
|
-
} from "./chunk-NAGAJ5UM.js";
|
|
17
|
+
} from "./chunk-LX6PMOOC.js";
|
|
23
18
|
import {
|
|
24
19
|
initializeSchema
|
|
25
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NXILQDJG.js";
|
|
26
21
|
import {
|
|
27
22
|
COMMAND_HELP_REGISTRY
|
|
28
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NWOYPK2O.js";
|
|
29
24
|
import {
|
|
30
25
|
parseOutputFormat,
|
|
31
26
|
printJson
|
|
32
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-4E3G4H5B.js";
|
|
33
28
|
import {
|
|
34
29
|
fail,
|
|
35
30
|
formatCommand
|
|
36
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-QHCGA6LC.js";
|
|
37
32
|
import {
|
|
38
33
|
MATERIAL_RESOURCE_TYPES,
|
|
39
34
|
SingletonConflictError,
|
|
@@ -41,34 +36,48 @@ import {
|
|
|
41
36
|
addAllUntrackedResourcesToProfile,
|
|
42
37
|
addResourceToProfile,
|
|
43
38
|
applyProfilePlugin,
|
|
39
|
+
binaryExpectedFileMatchesDisk,
|
|
40
|
+
buildHarnessLiveStatusMap,
|
|
44
41
|
buildHostManagedStatus,
|
|
45
42
|
buildProfileContents,
|
|
46
43
|
clearGlobalProfileApply,
|
|
47
44
|
collectProfilePluginIds,
|
|
48
45
|
commitManagedPathFromLive,
|
|
49
46
|
commitManagedResourceFromLive,
|
|
47
|
+
declaredMcpFromExpectedFiles,
|
|
50
48
|
detectNotStagedProfileResources,
|
|
51
49
|
detectPlatforms,
|
|
50
|
+
driftChangeIsKept,
|
|
52
51
|
emptyPlannedRemovals,
|
|
53
52
|
fileContentsEquivalentForDrift,
|
|
53
|
+
findProjectForRoot,
|
|
54
54
|
findResourceByKey,
|
|
55
55
|
generateFiles,
|
|
56
|
+
getActiveProfileName,
|
|
56
57
|
getHarnessPreference,
|
|
58
|
+
getLatestSnapshot,
|
|
59
|
+
getPlatform,
|
|
57
60
|
getPluginResources,
|
|
61
|
+
getProjectByLocalPath,
|
|
58
62
|
getResource,
|
|
59
63
|
groupPlannedRemovals,
|
|
64
|
+
hostPluginPinIsInstalled,
|
|
60
65
|
isEmptyBuiltinProfile,
|
|
61
66
|
isMcpConfigManagedPath,
|
|
62
67
|
isMergeableHostConfigPath,
|
|
63
68
|
isNativeAgentPluginCachePath,
|
|
64
69
|
isPortableMcpResource,
|
|
65
70
|
isProfilePlugin,
|
|
71
|
+
listHostNativeMcpNames,
|
|
66
72
|
markPluginDirty,
|
|
73
|
+
mcpConfigContentsEquivalent,
|
|
67
74
|
mergePluginsForApply,
|
|
68
75
|
normalizeManagedPath,
|
|
76
|
+
parseMcpServersDocument,
|
|
69
77
|
parseResourceSelector,
|
|
70
78
|
planSafeFileRemovals,
|
|
71
79
|
profileSkillNameMap,
|
|
80
|
+
registeredHarnessIds,
|
|
72
81
|
registeredHarnessesOf,
|
|
73
82
|
removeResourceFromPlugin,
|
|
74
83
|
resolvePluginSelector,
|
|
@@ -77,33 +86,20 @@ import {
|
|
|
77
86
|
resourceKeyFromManagedPath,
|
|
78
87
|
toContentsResource,
|
|
79
88
|
touchPluginUpdatedAt
|
|
80
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-26QGX47N.js";
|
|
90
|
+
import {
|
|
91
|
+
isPromptCancellationError,
|
|
92
|
+
promptForConfirmation,
|
|
93
|
+
resolveHomeRoot,
|
|
94
|
+
shouldUseBrowsePicker
|
|
95
|
+
} from "./chunk-LGWFLVZQ.js";
|
|
81
96
|
import {
|
|
82
97
|
CliUsageError,
|
|
98
|
+
formatCount,
|
|
99
|
+
getDb,
|
|
83
100
|
missingRequiredArg,
|
|
84
101
|
ui
|
|
85
|
-
} from "./chunk-
|
|
86
|
-
import {
|
|
87
|
-
buildHarnessLiveStatusMap,
|
|
88
|
-
declaredMcpFromExpectedFiles,
|
|
89
|
-
driftChangeIsKept,
|
|
90
|
-
getActiveProfileName,
|
|
91
|
-
getGitOrigin,
|
|
92
|
-
getLatestSnapshot,
|
|
93
|
-
getPlatform,
|
|
94
|
-
getProjectByLocalPath,
|
|
95
|
-
getProjectByOrigin,
|
|
96
|
-
hostPluginPinIsInstalled,
|
|
97
|
-
listHostNativeMcpNames,
|
|
98
|
-
mcpConfigContentsEquivalent,
|
|
99
|
-
normalizeGitUrl,
|
|
100
|
-
parseMcpServersDocument,
|
|
101
|
-
resolveHomeRoot
|
|
102
|
-
} from "./chunk-DF4Z7LAD.js";
|
|
103
|
-
import {
|
|
104
|
-
formatCount,
|
|
105
|
-
getDb
|
|
106
|
-
} from "./chunk-WG5A6EAU.js";
|
|
102
|
+
} from "./chunk-MTCCUYBZ.js";
|
|
107
103
|
|
|
108
104
|
// src/copy/scope.ts
|
|
109
105
|
var SCOPE_COPY = {
|
|
@@ -385,6 +381,7 @@ function compareExpectedFiles(rootPath, expectedFiles) {
|
|
|
385
381
|
const homeRoot = resolveHomeRoot();
|
|
386
382
|
for (const file of uniqueExpectedFiles(expectedFiles)) {
|
|
387
383
|
if (isNativeAgentPluginCachePath(file.path)) continue;
|
|
384
|
+
if (binaryExpectedFileMatchesDisk(join(rootPath, file.path), file)) continue;
|
|
388
385
|
const current = readRootFile(rootPath, file.path);
|
|
389
386
|
if (expectedFileMatchesLiveForPreview(homeRoot, file, current)) {
|
|
390
387
|
continue;
|
|
@@ -676,9 +673,7 @@ async function collectHomeExpectedManagedFiles(profile, harness) {
|
|
|
676
673
|
}
|
|
677
674
|
}
|
|
678
675
|
function snapshotPreviousPaths(resolvedRoot) {
|
|
679
|
-
const
|
|
680
|
-
const gitOrigin = gitOriginRaw ? normalizeGitUrl(gitOriginRaw) : null;
|
|
681
|
-
const project = getProjectByLocalPath(resolvedRoot) ?? (gitOrigin ? getProjectByOrigin(gitOrigin) : void 0) ?? null;
|
|
676
|
+
const project = findProjectForRoot(resolvedRoot) ?? getProjectByLocalPath(resolvedRoot) ?? null;
|
|
682
677
|
const snapshot = project ? getLatestSnapshot(project.id) : null;
|
|
683
678
|
return snapshot ? Object.values(snapshot.state.platform_files).flatMap(
|
|
684
679
|
(files) => Object.keys(files)
|
|
@@ -865,6 +860,7 @@ async function previewProfileApply(input) {
|
|
|
865
860
|
const profile = input.profile.trim();
|
|
866
861
|
const contents = buildProfileContents(profile);
|
|
867
862
|
const relativeToActive = getActiveProfileName() === profile;
|
|
863
|
+
const notSetUpFields = !input.harness?.trim() && registeredHarnessIds().length === 0 ? { not_set_up: true } : {};
|
|
868
864
|
const notStaged = await detectNotStagedProfileResources({
|
|
869
865
|
profileSelector: profile,
|
|
870
866
|
scope: input.scope,
|
|
@@ -886,7 +882,8 @@ async function previewProfileApply(input) {
|
|
|
886
882
|
files: projectPreview.files,
|
|
887
883
|
removals: projectPreview.removals,
|
|
888
884
|
relative_to_active: relativeToActive,
|
|
889
|
-
...spreadWarningFields(projectPreview)
|
|
885
|
+
...spreadWarningFields(projectPreview),
|
|
886
|
+
...notSetUpFields
|
|
890
887
|
};
|
|
891
888
|
}
|
|
892
889
|
const homePreview = await previewHomeApply(profile, input.harness);
|
|
@@ -904,7 +901,8 @@ async function previewProfileApply(input) {
|
|
|
904
901
|
homeRoot: homePreview.files.root_path,
|
|
905
902
|
profileSkills: profileSkillNameMap(contents?.resources ?? [])
|
|
906
903
|
}),
|
|
907
|
-
...spreadWarningFields(homePreview)
|
|
904
|
+
...spreadWarningFields(homePreview),
|
|
905
|
+
...notSetUpFields
|
|
908
906
|
};
|
|
909
907
|
}
|
|
910
908
|
|
|
@@ -1793,8 +1791,9 @@ function registerResourceParityCommands(resourceCmd) {
|
|
|
1793
1791
|
}
|
|
1794
1792
|
|
|
1795
1793
|
export {
|
|
1794
|
+
harnessDisplayName,
|
|
1796
1795
|
scopeLine,
|
|
1797
1796
|
registerProfileParityCommands,
|
|
1798
1797
|
registerResourceParityCommands
|
|
1799
1798
|
};
|
|
1800
|
-
//# sourceMappingURL=chunk-
|
|
1799
|
+
//# sourceMappingURL=chunk-2NMLWSUH.js.map
|