@sunasteriskrnd/takumi 1.0.0-dev.57 → 1.0.0-dev.59
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/dist/index.js +588 -236
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -19815,7 +19815,7 @@ var package_default;
|
|
|
19815
19815
|
var init_package = __esm(() => {
|
|
19816
19816
|
package_default = {
|
|
19817
19817
|
name: "@sunasteriskrnd/takumi",
|
|
19818
|
-
version: "1.0.0-dev.
|
|
19818
|
+
version: "1.0.0-dev.59",
|
|
19819
19819
|
description: "CLI tool for bootstrapping and managing Takumi projects",
|
|
19820
19820
|
type: "module",
|
|
19821
19821
|
repository: {
|
|
@@ -19836,6 +19836,7 @@ var init_package = __esm(() => {
|
|
|
19836
19836
|
scripts: {
|
|
19837
19837
|
tkm: "bun scripts/run-cli.ts --",
|
|
19838
19838
|
dev: "bun scripts/run-cli.ts --config src/lib/build-config/dev.json --",
|
|
19839
|
+
stg: "bun scripts/run-cli.ts --config src/lib/build-config/stg.json --",
|
|
19839
19840
|
build: "bun scripts/build-cli.ts",
|
|
19840
19841
|
"build:dev": "bun scripts/build-cli.ts --config src/lib/build-config/dev.json",
|
|
19841
19842
|
compile: "bun scripts/build-cli.ts --compile",
|
|
@@ -20011,7 +20012,7 @@ function getLegacyManifestPath(providerRoot) {
|
|
|
20011
20012
|
return join4(providerRoot, LEGACY_MANIFEST_FILENAME);
|
|
20012
20013
|
}
|
|
20013
20014
|
function getCliVersion() {
|
|
20014
|
-
return "1.0.0-dev.
|
|
20015
|
+
return "1.0.0-dev.59"?.trim() || process.env.npm_package_version?.trim() || "unknown";
|
|
20015
20016
|
}
|
|
20016
20017
|
function getCliUserAgent() {
|
|
20017
20018
|
return `${TAKUMI_CLI_NPM_PACKAGE_NAME}/${getCliVersion()}`;
|
|
@@ -51481,79 +51482,230 @@ var init_auth_command_help = __esm(() => {
|
|
|
51481
51482
|
};
|
|
51482
51483
|
});
|
|
51483
51484
|
|
|
51484
|
-
// src/domains/help/commands/artifact-
|
|
51485
|
-
var
|
|
51486
|
-
var
|
|
51487
|
-
|
|
51488
|
-
name: "artifact",
|
|
51489
|
-
description: "Upload
|
|
51490
|
-
usage: "tkm artifact
|
|
51485
|
+
// src/domains/help/commands/artifact-action-help.ts
|
|
51486
|
+
var artifactUploadHelp, artifactDownloadHelp, artifactDeleteHelp, listSearchOptionsGroup, orgVisibilityNote, artifactListHelp, artifactSearchHelp;
|
|
51487
|
+
var init_artifact_action_help = __esm(() => {
|
|
51488
|
+
artifactUploadHelp = {
|
|
51489
|
+
name: "artifact upload",
|
|
51490
|
+
description: "Upload a file or directory as a new artifact (or a new version with --id)",
|
|
51491
|
+
usage: "tkm artifact upload <file|dir> [options]",
|
|
51491
51492
|
examples: [
|
|
51492
51493
|
{
|
|
51493
51494
|
command: "tkm artifact upload ./report.html --title 'Weekly Report'",
|
|
51494
51495
|
description: "Upload a file (or directory) as a new artifact and print its share URL"
|
|
51495
51496
|
},
|
|
51496
51497
|
{
|
|
51497
|
-
command: "tkm artifact
|
|
51498
|
-
description: "
|
|
51498
|
+
command: "tkm artifact upload ./report.html --id <uuid|url> -m 'fix chart colors'",
|
|
51499
|
+
description: "Push a new version of an existing artifact with a change note"
|
|
51500
|
+
}
|
|
51501
|
+
],
|
|
51502
|
+
optionGroups: [
|
|
51503
|
+
{
|
|
51504
|
+
title: "Options",
|
|
51505
|
+
options: [
|
|
51506
|
+
{
|
|
51507
|
+
flags: "--id <uuid|url>",
|
|
51508
|
+
description: "Existing artifact (UUID or viewer URL) to overwrite with a new version"
|
|
51509
|
+
},
|
|
51510
|
+
{
|
|
51511
|
+
flags: "--title <title>",
|
|
51512
|
+
description: "Display title for the artifact (max 200 chars)"
|
|
51513
|
+
},
|
|
51514
|
+
{
|
|
51515
|
+
flags: "-m, --message <message>",
|
|
51516
|
+
description: "Short note describing this version's change (max 100 chars)"
|
|
51517
|
+
}
|
|
51518
|
+
]
|
|
51519
|
+
}
|
|
51520
|
+
]
|
|
51521
|
+
};
|
|
51522
|
+
artifactDownloadHelp = {
|
|
51523
|
+
name: "artifact download",
|
|
51524
|
+
description: "Download an artifact's files (latest version or --ver <n>)",
|
|
51525
|
+
usage: "tkm artifact download <uuid|url> [options]",
|
|
51526
|
+
examples: [
|
|
51527
|
+
{
|
|
51528
|
+
command: "tkm artifact download <uuid|url>",
|
|
51529
|
+
description: "Download the latest version into slug(title) or uuid in CWD"
|
|
51499
51530
|
},
|
|
51500
51531
|
{
|
|
51501
|
-
command: "tkm artifact
|
|
51502
|
-
description: "
|
|
51532
|
+
command: "tkm artifact download <uuid|url> -o ./out --ver 3",
|
|
51533
|
+
description: "Download a specific version's files into a directory"
|
|
51503
51534
|
}
|
|
51504
51535
|
],
|
|
51505
51536
|
optionGroups: [
|
|
51506
51537
|
{
|
|
51507
|
-
title: "
|
|
51538
|
+
title: "Options",
|
|
51508
51539
|
options: [
|
|
51509
51540
|
{
|
|
51510
|
-
flags: "
|
|
51511
|
-
description: "
|
|
51541
|
+
flags: "-o, --output <dir>",
|
|
51542
|
+
description: "Output directory; default: slug(title) or uuid in CWD"
|
|
51512
51543
|
},
|
|
51513
51544
|
{
|
|
51514
|
-
flags: "
|
|
51515
|
-
description: "
|
|
51545
|
+
flags: "--ver <n>",
|
|
51546
|
+
description: "Version to download. ?v=<n> in a pasted URL works too; --ver wins when both given"
|
|
51516
51547
|
},
|
|
51517
51548
|
{
|
|
51518
|
-
flags: "
|
|
51519
|
-
description: "
|
|
51549
|
+
flags: "--force",
|
|
51550
|
+
description: "Allow writing into a non-empty directory"
|
|
51520
51551
|
}
|
|
51521
51552
|
]
|
|
51553
|
+
}
|
|
51554
|
+
]
|
|
51555
|
+
};
|
|
51556
|
+
artifactDeleteHelp = {
|
|
51557
|
+
name: "artifact delete",
|
|
51558
|
+
description: "Soft-delete a whole artifact, or a single version with --ver <n>",
|
|
51559
|
+
usage: "tkm artifact delete <uuid|url> [options]",
|
|
51560
|
+
examples: [
|
|
51561
|
+
{
|
|
51562
|
+
command: "tkm artifact delete <uuid|url>",
|
|
51563
|
+
description: "Soft-delete the whole artifact after a confirmation prompt"
|
|
51522
51564
|
},
|
|
51565
|
+
{
|
|
51566
|
+
command: "tkm artifact delete <uuid|url> --ver 2",
|
|
51567
|
+
description: "Delete ONLY version 2 (soft delete; other versions stay). A pasted URL with ?v=2 does the same"
|
|
51568
|
+
}
|
|
51569
|
+
],
|
|
51570
|
+
optionGroups: [
|
|
51523
51571
|
{
|
|
51524
51572
|
title: "Options",
|
|
51525
51573
|
options: [
|
|
51526
51574
|
{
|
|
51527
|
-
flags: "--
|
|
51528
|
-
description: "
|
|
51575
|
+
flags: "--ver <n>",
|
|
51576
|
+
description: "Version to delete. ?v=<n> in a pasted URL works too; --ver wins when both given"
|
|
51529
51577
|
},
|
|
51530
51578
|
{
|
|
51531
|
-
flags: "--
|
|
51532
|
-
description: "
|
|
51533
|
-
}
|
|
51579
|
+
flags: "-y, --yes",
|
|
51580
|
+
description: "Skip the confirmation prompt"
|
|
51581
|
+
}
|
|
51582
|
+
]
|
|
51583
|
+
}
|
|
51584
|
+
]
|
|
51585
|
+
};
|
|
51586
|
+
listSearchOptionsGroup = {
|
|
51587
|
+
title: "Options",
|
|
51588
|
+
options: [
|
|
51589
|
+
{
|
|
51590
|
+
flags: "--access <level>",
|
|
51591
|
+
description: "Filter by access level: private (Only you) | restricted (Only people with access) | organization (Everyone at your org)"
|
|
51592
|
+
},
|
|
51593
|
+
{
|
|
51594
|
+
flags: "--page <n>",
|
|
51595
|
+
description: "Page number, 1-based (default: 1)"
|
|
51596
|
+
},
|
|
51597
|
+
{
|
|
51598
|
+
flags: "--limit <n>",
|
|
51599
|
+
description: "Rows per page, max 100 (default: 10)"
|
|
51600
|
+
},
|
|
51601
|
+
{
|
|
51602
|
+
flags: "--json",
|
|
51603
|
+
description: "Machine-readable JSON output"
|
|
51604
|
+
}
|
|
51605
|
+
]
|
|
51606
|
+
};
|
|
51607
|
+
orgVisibilityNote = {
|
|
51608
|
+
title: "Notes",
|
|
51609
|
+
content: "Org artifacts appear only after you have opened them at least once (same rule as the web dashboard)."
|
|
51610
|
+
};
|
|
51611
|
+
artifactListHelp = {
|
|
51612
|
+
name: "artifact list",
|
|
51613
|
+
description: "List every artifact you can see — the same rows as the web dashboard",
|
|
51614
|
+
usage: "tkm artifact list [options]",
|
|
51615
|
+
examples: [
|
|
51616
|
+
{
|
|
51617
|
+
command: "tkm artifact list --access organization --limit 25",
|
|
51618
|
+
description: "List up to 25 org-visible artifacts as a table"
|
|
51619
|
+
},
|
|
51620
|
+
{
|
|
51621
|
+
command: "tkm artifact list --json",
|
|
51622
|
+
description: "Print the first page as machine-readable JSON"
|
|
51623
|
+
}
|
|
51624
|
+
],
|
|
51625
|
+
optionGroups: [listSearchOptionsGroup],
|
|
51626
|
+
sections: [orgVisibilityNote]
|
|
51627
|
+
};
|
|
51628
|
+
artifactSearchHelp = {
|
|
51629
|
+
name: "artifact search",
|
|
51630
|
+
description: "List artifacts filtered by <term> (title or owner name, case-insensitive)",
|
|
51631
|
+
usage: "tkm artifact search <term> [options]",
|
|
51632
|
+
examples: [
|
|
51633
|
+
{
|
|
51634
|
+
command: "tkm artifact search roadmap --json",
|
|
51635
|
+
description: "Search titles/owners for 'roadmap' and print machine-readable JSON"
|
|
51636
|
+
},
|
|
51637
|
+
{
|
|
51638
|
+
command: "tkm artifact search 'kim' --access organization",
|
|
51639
|
+
description: "Search org-visible artifacts by owner name"
|
|
51640
|
+
}
|
|
51641
|
+
],
|
|
51642
|
+
optionGroups: [listSearchOptionsGroup],
|
|
51643
|
+
sections: [orgVisibilityNote]
|
|
51644
|
+
};
|
|
51645
|
+
});
|
|
51646
|
+
|
|
51647
|
+
// src/domains/help/commands/artifact-command-help.ts
|
|
51648
|
+
var artifactCommandHelp;
|
|
51649
|
+
var init_artifact_command_help = __esm(() => {
|
|
51650
|
+
init_artifact_action_help();
|
|
51651
|
+
artifactCommandHelp = {
|
|
51652
|
+
name: "artifact",
|
|
51653
|
+
description: "List, search, upload, download, and delete Takumi artifacts (list|search|upload|download|delete)",
|
|
51654
|
+
usage: "tkm artifact <list | search <term> | upload <file|dir> | download <uuid|url> | delete <uuid|url>>",
|
|
51655
|
+
examples: [
|
|
51656
|
+
{
|
|
51657
|
+
command: "tkm artifact upload ./report.html --title 'Weekly Report'",
|
|
51658
|
+
description: "Upload a file (or directory) as a new artifact and print its share URL"
|
|
51659
|
+
},
|
|
51660
|
+
{
|
|
51661
|
+
command: "tkm artifact list --access organization --limit 25",
|
|
51662
|
+
description: "List up to 25 org-visible artifacts as a table"
|
|
51663
|
+
},
|
|
51664
|
+
{
|
|
51665
|
+
command: "tkm artifact search roadmap --json",
|
|
51666
|
+
description: "Search titles/owners for 'roadmap' and print machine-readable JSON"
|
|
51667
|
+
}
|
|
51668
|
+
],
|
|
51669
|
+
optionGroups: [
|
|
51670
|
+
{
|
|
51671
|
+
title: "Actions",
|
|
51672
|
+
options: [
|
|
51534
51673
|
{
|
|
51535
|
-
flags: "
|
|
51536
|
-
description: "
|
|
51674
|
+
flags: "list",
|
|
51675
|
+
description: "List your artifacts (filterable, paginated table or --json)"
|
|
51537
51676
|
},
|
|
51538
51677
|
{
|
|
51539
|
-
flags: "
|
|
51540
|
-
description: "
|
|
51678
|
+
flags: "search <term>",
|
|
51679
|
+
description: "List filtered to <term> (title or owner name, case-insensitive)"
|
|
51541
51680
|
},
|
|
51542
51681
|
{
|
|
51543
|
-
flags: "
|
|
51544
|
-
description: "
|
|
51682
|
+
flags: "upload <file|dir>",
|
|
51683
|
+
description: "Upload a file or directory as a new artifact (or new version with --id)"
|
|
51545
51684
|
},
|
|
51546
51685
|
{
|
|
51547
|
-
flags: "
|
|
51548
|
-
description: "
|
|
51686
|
+
flags: "download <uuid|url>",
|
|
51687
|
+
description: "Download an artifact's files (latest or --ver <n>)"
|
|
51549
51688
|
},
|
|
51550
51689
|
{
|
|
51551
|
-
flags: "
|
|
51552
|
-
description: "
|
|
51690
|
+
flags: "delete <uuid|url>",
|
|
51691
|
+
description: "Soft-delete the whole artifact, or one version with --ver <n>"
|
|
51553
51692
|
}
|
|
51554
51693
|
]
|
|
51555
51694
|
}
|
|
51556
|
-
]
|
|
51695
|
+
],
|
|
51696
|
+
sections: [
|
|
51697
|
+
{
|
|
51698
|
+
title: "Learn More",
|
|
51699
|
+
content: "Run 'tkm artifact <action> --help' for action-specific options and examples."
|
|
51700
|
+
}
|
|
51701
|
+
],
|
|
51702
|
+
subcommands: {
|
|
51703
|
+
list: artifactListHelp,
|
|
51704
|
+
search: artifactSearchHelp,
|
|
51705
|
+
upload: artifactUploadHelp,
|
|
51706
|
+
download: artifactDownloadHelp,
|
|
51707
|
+
delete: artifactDeleteHelp
|
|
51708
|
+
}
|
|
51557
51709
|
};
|
|
51558
51710
|
});
|
|
51559
51711
|
|
|
@@ -51634,6 +51786,7 @@ var init_commands2 = __esm(() => {
|
|
|
51634
51786
|
init_config_command_help();
|
|
51635
51787
|
init_auth_command_help();
|
|
51636
51788
|
init_artifact_command_help();
|
|
51789
|
+
init_artifact_action_help();
|
|
51637
51790
|
init_mcp_command_help();
|
|
51638
51791
|
init_common_options();
|
|
51639
51792
|
});
|
|
@@ -51938,6 +52091,7 @@ var init_help_renderer = __esm(() => {
|
|
|
51938
52091
|
// src/domains/help/help-interceptor.ts
|
|
51939
52092
|
var exports_help_interceptor = {};
|
|
51940
52093
|
__export(exports_help_interceptor, {
|
|
52094
|
+
resolveHelpTarget: () => resolveHelpTarget,
|
|
51941
52095
|
isHelpRequested: () => isHelpRequested,
|
|
51942
52096
|
handleHelp: () => handleHelp
|
|
51943
52097
|
});
|
|
@@ -51955,30 +52109,28 @@ function getHelpOptions() {
|
|
|
51955
52109
|
noColor
|
|
51956
52110
|
};
|
|
51957
52111
|
}
|
|
51958
|
-
function
|
|
51959
|
-
const
|
|
51960
|
-
|
|
51961
|
-
|
|
51962
|
-
continue;
|
|
51963
|
-
}
|
|
51964
|
-
if (hasCommand(arg)) {
|
|
51965
|
-
return arg;
|
|
51966
|
-
}
|
|
52112
|
+
function resolveHelpTarget(argv) {
|
|
52113
|
+
const tokens = argv.filter((arg) => !arg.startsWith("-"));
|
|
52114
|
+
const [command, action] = tokens;
|
|
52115
|
+
if (command === undefined || !hasCommand(command)) {
|
|
51967
52116
|
return null;
|
|
51968
52117
|
}
|
|
51969
|
-
|
|
52118
|
+
const help = HELP_REGISTRY[command];
|
|
52119
|
+
if (action !== undefined && help.subcommands?.[action]) {
|
|
52120
|
+
return help.subcommands[action];
|
|
52121
|
+
}
|
|
52122
|
+
return help;
|
|
51970
52123
|
}
|
|
51971
52124
|
async function handleHelp(_args) {
|
|
51972
52125
|
try {
|
|
51973
52126
|
const options2 = getHelpOptions();
|
|
51974
|
-
const
|
|
52127
|
+
const help = resolveHelpTarget(process.argv.slice(2));
|
|
51975
52128
|
let output3;
|
|
51976
|
-
if (
|
|
52129
|
+
if (help === null) {
|
|
51977
52130
|
output3 = renderGlobalHelp(HELP_REGISTRY, options2);
|
|
51978
52131
|
} else {
|
|
51979
|
-
const help = HELP_REGISTRY[command];
|
|
51980
52132
|
output3 = renderHelp(help, {
|
|
51981
|
-
command,
|
|
52133
|
+
command: help.name,
|
|
51982
52134
|
globalHelp: false,
|
|
51983
52135
|
options: options2
|
|
51984
52136
|
});
|
|
@@ -53897,6 +54049,31 @@ async function presignDownload(token, uuid, version3, paths) {
|
|
|
53897
54049
|
}
|
|
53898
54050
|
return await res.json();
|
|
53899
54051
|
}
|
|
54052
|
+
async function listArtifacts(token, params = {}) {
|
|
54053
|
+
const base = getServerUrl();
|
|
54054
|
+
const qs = new URLSearchParams;
|
|
54055
|
+
if (params.q)
|
|
54056
|
+
qs.set("q", params.q);
|
|
54057
|
+
if (params.vis)
|
|
54058
|
+
qs.set("vis", params.vis);
|
|
54059
|
+
if (params.page !== undefined)
|
|
54060
|
+
qs.set("page", String(params.page));
|
|
54061
|
+
if (params.limit !== undefined)
|
|
54062
|
+
qs.set("limit", String(params.limit));
|
|
54063
|
+
const suffix = qs.toString() ? `?${qs}` : "";
|
|
54064
|
+
const res = await fetch(`${base}/api/v1/artifacts${suffix}`, {
|
|
54065
|
+
headers: { Authorization: `Bearer ${token}` }
|
|
54066
|
+
});
|
|
54067
|
+
if (!res.ok) {
|
|
54068
|
+
const msg = await parseErrorMessage(res);
|
|
54069
|
+
throw new ArtifactApiError(res.status, `List failed (HTTP ${res.status}): ${msg}`);
|
|
54070
|
+
}
|
|
54071
|
+
const payload = await res.json();
|
|
54072
|
+
if (!Array.isArray(payload?.artifacts) || payload?.pagination == null) {
|
|
54073
|
+
throw new ArtifactApiError(res.status, `List failed (HTTP ${res.status}): unexpected response shape from ${base}/api/v1/artifacts`);
|
|
54074
|
+
}
|
|
54075
|
+
return payload;
|
|
54076
|
+
}
|
|
53900
54077
|
|
|
53901
54078
|
// src/domains/artifact/manifest-store.ts
|
|
53902
54079
|
init_logger();
|
|
@@ -54356,6 +54533,162 @@ async function artifactDownload(ref, opts) {
|
|
|
54356
54533
|
console.log(` Total: ${humanizeBytes(total)}`);
|
|
54357
54534
|
}
|
|
54358
54535
|
|
|
54536
|
+
// src/commands/artifact/list-command.ts
|
|
54537
|
+
var import_picocolors17 = __toESM(require_picocolors(), 1);
|
|
54538
|
+
init_logger();
|
|
54539
|
+
|
|
54540
|
+
// src/shared/relative-time.ts
|
|
54541
|
+
function formatRelativeTime(iso, now = Date.now()) {
|
|
54542
|
+
const then = Date.parse(iso);
|
|
54543
|
+
if (Number.isNaN(then))
|
|
54544
|
+
return "—";
|
|
54545
|
+
const diffMs = Math.max(0, now - then);
|
|
54546
|
+
const diffSec = Math.floor(diffMs / 1000);
|
|
54547
|
+
if (diffSec < 60)
|
|
54548
|
+
return "just now";
|
|
54549
|
+
const diffMin = Math.floor(diffSec / 60);
|
|
54550
|
+
if (diffMin < 60)
|
|
54551
|
+
return `${diffMin}m ago`;
|
|
54552
|
+
const diffHour = Math.floor(diffMin / 60);
|
|
54553
|
+
if (diffHour < 24)
|
|
54554
|
+
return `${diffHour}h ago`;
|
|
54555
|
+
const diffDay = Math.floor(diffHour / 24);
|
|
54556
|
+
if (diffDay < 30)
|
|
54557
|
+
return `${diffDay}d ago`;
|
|
54558
|
+
const diffMonth = Math.floor(diffDay / 30);
|
|
54559
|
+
if (diffMonth < 12)
|
|
54560
|
+
return `${diffMonth}mo ago`;
|
|
54561
|
+
const diffYear = Math.floor(diffMonth / 12);
|
|
54562
|
+
return `${diffYear}y ago`;
|
|
54563
|
+
}
|
|
54564
|
+
|
|
54565
|
+
// src/shared/render-table.ts
|
|
54566
|
+
var import_picocolors16 = __toESM(require_picocolors(), 1);
|
|
54567
|
+
function renderTable(header, rows) {
|
|
54568
|
+
const lastCol = header.length - 1;
|
|
54569
|
+
const widths = header.map((h2, col) => Math.max(h2.length, ...rows.map((r2) => r2[col]?.value.length ?? 0)));
|
|
54570
|
+
const padPlain = (text, col) => col === lastCol ? text : text.padEnd(widths[col]);
|
|
54571
|
+
const headerLine = import_picocolors16.default.bold(header.map((h2, col) => padPlain(h2, col)).join(" ").trimEnd());
|
|
54572
|
+
const rowLine = (cells) => cells.map((cell, col) => {
|
|
54573
|
+
const padded = padPlain(cell.value, col);
|
|
54574
|
+
return cell.paint ? cell.paint(padded) : padded;
|
|
54575
|
+
}).join(" ").trimEnd();
|
|
54576
|
+
return [headerLine, ...rows.map(rowLine)].join(`
|
|
54577
|
+
`);
|
|
54578
|
+
}
|
|
54579
|
+
|
|
54580
|
+
// src/commands/artifact/list-command.ts
|
|
54581
|
+
var ACCESS_TO_VIS = {
|
|
54582
|
+
private: "private",
|
|
54583
|
+
restricted: "shared",
|
|
54584
|
+
organization: "org"
|
|
54585
|
+
};
|
|
54586
|
+
var ACCESS_VALUES = Object.keys(ACCESS_TO_VIS);
|
|
54587
|
+
var TITLE_MAX = 32;
|
|
54588
|
+
var OWNER_MAX = 18;
|
|
54589
|
+
function truncate(text, max) {
|
|
54590
|
+
const chars = Array.from(text);
|
|
54591
|
+
return chars.length <= max ? text : `${chars.slice(0, max - 1).join("")}…`;
|
|
54592
|
+
}
|
|
54593
|
+
function paintVis(vis) {
|
|
54594
|
+
if (vis === "shared")
|
|
54595
|
+
return import_picocolors17.default.cyan;
|
|
54596
|
+
if (vis === "org")
|
|
54597
|
+
return import_picocolors17.default.green;
|
|
54598
|
+
return import_picocolors17.default.dim;
|
|
54599
|
+
}
|
|
54600
|
+
function accessLabel(vis, viewerOrgName) {
|
|
54601
|
+
if (vis === "private")
|
|
54602
|
+
return "Only you";
|
|
54603
|
+
if (vis === "shared")
|
|
54604
|
+
return "Only people with access";
|
|
54605
|
+
if (vis === "org")
|
|
54606
|
+
return `Everyone at ${viewerOrgName ?? "org"}`;
|
|
54607
|
+
return vis;
|
|
54608
|
+
}
|
|
54609
|
+
function ownerCell(item) {
|
|
54610
|
+
return item.isOwner ? { value: "you", paint: import_picocolors17.default.dim } : { value: truncate(item.ownerName, OWNER_MAX) };
|
|
54611
|
+
}
|
|
54612
|
+
function threadsCell(item) {
|
|
54613
|
+
return item.openThreads !== null && item.openThreads > 0 ? { value: String(item.openThreads), paint: import_picocolors17.default.yellow } : { value: "—", paint: import_picocolors17.default.dim };
|
|
54614
|
+
}
|
|
54615
|
+
function buildRow(item, viewerOrgName, now) {
|
|
54616
|
+
return [
|
|
54617
|
+
{ value: truncate(item.title, TITLE_MAX) },
|
|
54618
|
+
ownerCell(item),
|
|
54619
|
+
{ value: accessLabel(item.visibility, viewerOrgName), paint: paintVis(item.visibility) },
|
|
54620
|
+
{ value: String(item.live_version) },
|
|
54621
|
+
threadsCell(item),
|
|
54622
|
+
{ value: formatRelativeTime(item.updated_at, now) },
|
|
54623
|
+
{ value: item.uuid }
|
|
54624
|
+
];
|
|
54625
|
+
}
|
|
54626
|
+
function describeFilters(q3, access) {
|
|
54627
|
+
const parts = [];
|
|
54628
|
+
if (q3)
|
|
54629
|
+
parts.push(`matching "${q3}"`);
|
|
54630
|
+
if (access)
|
|
54631
|
+
parts.push(`--access ${access}`);
|
|
54632
|
+
return parts.join(" ");
|
|
54633
|
+
}
|
|
54634
|
+
function footerLine(payload) {
|
|
54635
|
+
const { page, totalPages, totalFiltered, pageSize } = payload.pagination;
|
|
54636
|
+
const start = (page - 1) * pageSize + 1;
|
|
54637
|
+
const end = start + payload.artifacts.length - 1;
|
|
54638
|
+
const base = `Showing ${start}-${end} of ${totalFiltered} (page ${page}/${totalPages})`;
|
|
54639
|
+
return page < totalPages ? `${base} · use --page ${page + 1} for the next page` : base;
|
|
54640
|
+
}
|
|
54641
|
+
async function artifactList(term, opts) {
|
|
54642
|
+
if (opts.access !== undefined && !ACCESS_VALUES.includes(opts.access)) {
|
|
54643
|
+
console.error(`Invalid --access: ${opts.access}. Use one of: ${ACCESS_VALUES.join(", ")}`);
|
|
54644
|
+
process.exitCode = 1;
|
|
54645
|
+
return;
|
|
54646
|
+
}
|
|
54647
|
+
const token = await getToken(opts);
|
|
54648
|
+
if (!token)
|
|
54649
|
+
return;
|
|
54650
|
+
const params = {
|
|
54651
|
+
q: term,
|
|
54652
|
+
vis: opts.access !== undefined ? ACCESS_TO_VIS[opts.access] : undefined,
|
|
54653
|
+
page: opts.page,
|
|
54654
|
+
limit: opts.limit
|
|
54655
|
+
};
|
|
54656
|
+
let payload;
|
|
54657
|
+
try {
|
|
54658
|
+
payload = await listArtifacts(token, params);
|
|
54659
|
+
} catch (err) {
|
|
54660
|
+
if (err instanceof ArtifactApiError && err.status === 404) {
|
|
54661
|
+
console.error("Error: this Takumi server does not support artifact listing (needs a newer server version).");
|
|
54662
|
+
process.exitCode = 1;
|
|
54663
|
+
return;
|
|
54664
|
+
}
|
|
54665
|
+
printApiError(err);
|
|
54666
|
+
process.exitCode = 1;
|
|
54667
|
+
return;
|
|
54668
|
+
}
|
|
54669
|
+
if (opts.json) {
|
|
54670
|
+
process.stdout.write(`${JSON.stringify(payload)}
|
|
54671
|
+
`);
|
|
54672
|
+
return;
|
|
54673
|
+
}
|
|
54674
|
+
if (payload.artifacts.length === 0) {
|
|
54675
|
+
const { page, totalPages, totalFiltered } = payload.pagination;
|
|
54676
|
+
if (totalFiltered > 0 && page > totalPages) {
|
|
54677
|
+
logger.info(`Page ${page} is past the last page — ${totalFiltered} artifact(s) match across ${totalPages} page(s). Try --page 1.`);
|
|
54678
|
+
return;
|
|
54679
|
+
}
|
|
54680
|
+
const filters = describeFilters(params.q, opts.access);
|
|
54681
|
+
logger.info(filters ? `No artifacts found for ${filters}.` : "No artifacts found.");
|
|
54682
|
+
return;
|
|
54683
|
+
}
|
|
54684
|
+
const header = ["TITLE", "OWNER", "ACCESS", "VER", "THREADS", "UPDATED", "UUID"];
|
|
54685
|
+
const now = Date.now();
|
|
54686
|
+
const rows = payload.artifacts.map((item) => buildRow(item, payload.viewerOrgName, now));
|
|
54687
|
+
process.stdout.write(`${renderTable(header, rows)}
|
|
54688
|
+
`);
|
|
54689
|
+
logger.info(footerLine(payload));
|
|
54690
|
+
}
|
|
54691
|
+
|
|
54359
54692
|
// src/commands/artifact/upload-command.ts
|
|
54360
54693
|
init_dist2();
|
|
54361
54694
|
import { promises as fs13 } from "node:fs";
|
|
@@ -54690,6 +55023,17 @@ function usageError(hint) {
|
|
|
54690
55023
|
}
|
|
54691
55024
|
async function artifactCommand(action, target, opts) {
|
|
54692
55025
|
switch (action) {
|
|
55026
|
+
case "list":
|
|
55027
|
+
if (target) {
|
|
55028
|
+
return usageError(`tkm artifact search ${target} (list takes no search term)`);
|
|
55029
|
+
}
|
|
55030
|
+
await artifactList(undefined, opts);
|
|
55031
|
+
break;
|
|
55032
|
+
case "search":
|
|
55033
|
+
if (!target)
|
|
55034
|
+
return usageError("tkm artifact search <term>");
|
|
55035
|
+
await artifactList(target, opts);
|
|
55036
|
+
break;
|
|
54693
55037
|
case "upload":
|
|
54694
55038
|
if (!target)
|
|
54695
55039
|
return usageError("tkm artifact upload <file>");
|
|
@@ -54706,10 +55050,10 @@ async function artifactCommand(action, target, opts) {
|
|
|
54706
55050
|
await artifactDelete(target, opts);
|
|
54707
55051
|
break;
|
|
54708
55052
|
case undefined:
|
|
54709
|
-
usageError("tkm artifact <upload <file> | download <uuid|url> | delete <uuid|url> [--ver <n>]>");
|
|
55053
|
+
usageError("tkm artifact <list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url> [--ver <n>]>");
|
|
54710
55054
|
break;
|
|
54711
55055
|
default:
|
|
54712
|
-
console.error(`Unknown artifact action: ${action}. Available: upload, download, delete`);
|
|
55056
|
+
console.error(`Unknown artifact action: ${action}. Available: list, search, upload, download, delete`);
|
|
54713
55057
|
process.exitCode = 1;
|
|
54714
55058
|
}
|
|
54715
55059
|
}
|
|
@@ -70545,7 +70889,7 @@ class ReportGenerator {
|
|
|
70545
70889
|
}
|
|
70546
70890
|
// src/domains/health-checks/doctor-ui-renderer.ts
|
|
70547
70891
|
init_terminal_utils();
|
|
70548
|
-
var
|
|
70892
|
+
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
70549
70893
|
|
|
70550
70894
|
class DoctorUIRenderer {
|
|
70551
70895
|
symbols = getStatusSymbols();
|
|
@@ -70557,8 +70901,8 @@ class DoctorUIRenderer {
|
|
|
70557
70901
|
const groups = this.groupChecks(summary.checks);
|
|
70558
70902
|
for (const [groupName, checks] of groups) {
|
|
70559
70903
|
console.log("│");
|
|
70560
|
-
console.log(`│ ${
|
|
70561
|
-
console.log(`│ ${
|
|
70904
|
+
console.log(`│ ${import_picocolors18.default.bold(import_picocolors18.default.cyan(groupName.toUpperCase()))}`);
|
|
70905
|
+
console.log(`│ ${import_picocolors18.default.dim("─".repeat(50))}`);
|
|
70562
70906
|
const maxNameLen = Math.max(...checks.map((c2) => c2.name.length));
|
|
70563
70907
|
const maxMsgLen = Math.max(...checks.map((c2) => c2.message.length));
|
|
70564
70908
|
for (const check of checks) {
|
|
@@ -70570,55 +70914,55 @@ class DoctorUIRenderer {
|
|
|
70570
70914
|
}
|
|
70571
70915
|
renderCheck(check, maxNameLen, maxMsgLen) {
|
|
70572
70916
|
const symbol = this.getColoredSymbol(check.status);
|
|
70573
|
-
const name2 =
|
|
70917
|
+
const name2 = import_picocolors18.default.bold(check.name.padEnd(maxNameLen));
|
|
70574
70918
|
const paddedMsg = check.message.padEnd(maxMsgLen);
|
|
70575
70919
|
const value = this.colorizeValue(check.status, paddedMsg);
|
|
70576
70920
|
if (this.verbose && check.command) {
|
|
70577
|
-
console.log(`│ ${
|
|
70921
|
+
console.log(`│ ${import_picocolors18.default.dim(`Running: ${check.command}`)}`);
|
|
70578
70922
|
}
|
|
70579
70923
|
let line = `│ ${symbol} ${name2} ${value}`;
|
|
70580
70924
|
if (this.verbose && check.duration !== undefined) {
|
|
70581
|
-
line += ` ${
|
|
70925
|
+
line += ` ${import_picocolors18.default.dim(`(${check.duration}ms)`)}`;
|
|
70582
70926
|
}
|
|
70583
70927
|
if (check.details) {
|
|
70584
70928
|
const displayPath = this.verbose ? check.details : this.shortenPath(check.details);
|
|
70585
|
-
line += ` ${
|
|
70929
|
+
line += ` ${import_picocolors18.default.dim(displayPath)}`;
|
|
70586
70930
|
}
|
|
70587
70931
|
console.log(line);
|
|
70588
70932
|
if (this.verbose && check.status === "pass" && check.suggestion) {
|
|
70589
70933
|
const indent = " ".repeat(maxNameLen + 5);
|
|
70590
|
-
console.log(`│ ${indent}${
|
|
70934
|
+
console.log(`│ ${indent}${import_picocolors18.default.dim(`→ ${check.suggestion}`)}`);
|
|
70591
70935
|
}
|
|
70592
70936
|
if (check.status !== "pass" && check.suggestion) {
|
|
70593
70937
|
const indent = " ".repeat(maxNameLen + 5);
|
|
70594
|
-
console.log(`│ ${indent}${
|
|
70938
|
+
console.log(`│ ${indent}${import_picocolors18.default.dim(`→ ${check.suggestion}`)}`);
|
|
70595
70939
|
}
|
|
70596
70940
|
}
|
|
70597
70941
|
getColoredSymbol(status2) {
|
|
70598
70942
|
switch (status2) {
|
|
70599
70943
|
case "pass":
|
|
70600
|
-
return
|
|
70944
|
+
return import_picocolors18.default.green(this.symbols.pass);
|
|
70601
70945
|
case "warn":
|
|
70602
|
-
return
|
|
70946
|
+
return import_picocolors18.default.yellow(this.symbols.warn);
|
|
70603
70947
|
case "fail":
|
|
70604
|
-
return
|
|
70948
|
+
return import_picocolors18.default.red(this.symbols.fail);
|
|
70605
70949
|
default:
|
|
70606
|
-
return
|
|
70950
|
+
return import_picocolors18.default.blue(this.symbols.info);
|
|
70607
70951
|
}
|
|
70608
70952
|
}
|
|
70609
70953
|
renderHealingSummary(healSummary) {
|
|
70610
70954
|
console.log("│");
|
|
70611
|
-
console.log(`│ ${
|
|
70612
|
-
console.log(`│ ${
|
|
70955
|
+
console.log(`│ ${import_picocolors18.default.bold(import_picocolors18.default.cyan("AUTO-HEAL RESULTS"))}`);
|
|
70956
|
+
console.log(`│ ${import_picocolors18.default.dim("─".repeat(50))}`);
|
|
70613
70957
|
for (const fix of healSummary.fixes) {
|
|
70614
|
-
const symbol = fix.success ?
|
|
70615
|
-
console.log(`│ ${symbol} ${
|
|
70958
|
+
const symbol = fix.success ? import_picocolors18.default.green(this.symbols.pass) : import_picocolors18.default.red(this.symbols.fail);
|
|
70959
|
+
console.log(`│ ${symbol} ${import_picocolors18.default.bold(fix.checkName)} ${import_picocolors18.default.dim(fix.message)}`);
|
|
70616
70960
|
if (!fix.success && fix.error) {
|
|
70617
|
-
console.log(`│ ${
|
|
70961
|
+
console.log(`│ ${import_picocolors18.default.red(`Error: ${fix.error}`)}`);
|
|
70618
70962
|
}
|
|
70619
70963
|
}
|
|
70620
70964
|
console.log("│");
|
|
70621
|
-
console.log(`│ Fixed: ${
|
|
70965
|
+
console.log(`│ Fixed: ${import_picocolors18.default.green(String(healSummary.succeeded))}, Failed: ${import_picocolors18.default.red(String(healSummary.failed))}`);
|
|
70622
70966
|
}
|
|
70623
70967
|
groupChecks(checks) {
|
|
70624
70968
|
const groups = new Map;
|
|
@@ -70632,11 +70976,11 @@ class DoctorUIRenderer {
|
|
|
70632
70976
|
colorizeValue(status2, message) {
|
|
70633
70977
|
switch (status2) {
|
|
70634
70978
|
case "pass":
|
|
70635
|
-
return
|
|
70979
|
+
return import_picocolors18.default.green(message);
|
|
70636
70980
|
case "warn":
|
|
70637
|
-
return
|
|
70981
|
+
return import_picocolors18.default.yellow(message);
|
|
70638
70982
|
case "fail":
|
|
70639
|
-
return
|
|
70983
|
+
return import_picocolors18.default.red(message);
|
|
70640
70984
|
default:
|
|
70641
70985
|
return message;
|
|
70642
70986
|
}
|
|
@@ -70655,23 +70999,23 @@ class DoctorUIRenderer {
|
|
|
70655
70999
|
renderSummaryLine(summary) {
|
|
70656
71000
|
const parts = [];
|
|
70657
71001
|
if (summary.passed > 0) {
|
|
70658
|
-
parts.push(
|
|
71002
|
+
parts.push(import_picocolors18.default.green(`${summary.passed} ${this.symbols.pass}`));
|
|
70659
71003
|
}
|
|
70660
71004
|
if (summary.warnings > 0) {
|
|
70661
|
-
parts.push(
|
|
71005
|
+
parts.push(import_picocolors18.default.yellow(`${summary.warnings} ${this.symbols.warn}`));
|
|
70662
71006
|
}
|
|
70663
71007
|
if (summary.failed > 0) {
|
|
70664
|
-
parts.push(
|
|
71008
|
+
parts.push(import_picocolors18.default.red(`${summary.failed} ${this.symbols.fail}`));
|
|
70665
71009
|
}
|
|
70666
|
-
console.log(`│ ${
|
|
71010
|
+
console.log(`│ ${import_picocolors18.default.dim("─".repeat(50))}`);
|
|
70667
71011
|
console.log(`│ Summary: ${parts.join(" ")}`);
|
|
70668
71012
|
console.log("│");
|
|
70669
|
-
console.log(`│ ${
|
|
70670
|
-
console.log(`│ ${
|
|
70671
|
-
console.log(`│ ${
|
|
70672
|
-
console.log(`│ ${
|
|
70673
|
-
console.log(`│ ${
|
|
70674
|
-
console.log(`│ ${
|
|
71013
|
+
console.log(`│ ${import_picocolors18.default.dim("Quick Commands:")}`);
|
|
71014
|
+
console.log(`│ ${import_picocolors18.default.dim(" tkm init Install/update Takumi in project")}`);
|
|
71015
|
+
console.log(`│ ${import_picocolors18.default.dim(" tkm init -g Install/update Takumi globally")}`);
|
|
71016
|
+
console.log(`│ ${import_picocolors18.default.dim(" tkm update Update the CLI tool")}`);
|
|
71017
|
+
console.log(`│ ${import_picocolors18.default.dim(" tkm uninstall Remove Takumi from project/global")}`);
|
|
71018
|
+
console.log(`│ ${import_picocolors18.default.dim(" tkm --help Show all commands")}`);
|
|
70675
71019
|
}
|
|
70676
71020
|
}
|
|
70677
71021
|
// src/commands/doctor.ts
|
|
@@ -78792,7 +79136,7 @@ function releaseEntryToGitHubRelease(entry, kit) {
|
|
|
78792
79136
|
init_logger();
|
|
78793
79137
|
init_dist2();
|
|
78794
79138
|
init_release_filter();
|
|
78795
|
-
var
|
|
79139
|
+
var import_picocolors21 = __toESM(require_picocolors(), 1);
|
|
78796
79140
|
|
|
78797
79141
|
// src/domains/versioning/selection/version-filter.ts
|
|
78798
79142
|
var VERSION_PATTERN = /^v?\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?$/;
|
|
@@ -78810,36 +79154,36 @@ function normalizeVersionTag(version3) {
|
|
|
78810
79154
|
init_environment();
|
|
78811
79155
|
init_logger();
|
|
78812
79156
|
init_dist2();
|
|
78813
|
-
var
|
|
79157
|
+
var import_picocolors20 = __toESM(require_picocolors(), 1);
|
|
78814
79158
|
|
|
78815
79159
|
// src/domains/versioning/version-display.ts
|
|
78816
|
-
var
|
|
79160
|
+
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
78817
79161
|
|
|
78818
79162
|
class VersionDisplayFormatter {
|
|
78819
79163
|
static createBadges(release) {
|
|
78820
79164
|
const badges = [];
|
|
78821
79165
|
if (release.isLatestStable) {
|
|
78822
|
-
badges.push(
|
|
79166
|
+
badges.push(import_picocolors19.default.bold(import_picocolors19.default.yellow("[latest]")));
|
|
78823
79167
|
}
|
|
78824
79168
|
if (release.prerelease || release.isLatestBeta) {
|
|
78825
79169
|
if (release.isLatestBeta) {
|
|
78826
|
-
badges.push(
|
|
79170
|
+
badges.push(import_picocolors19.default.bold(import_picocolors19.default.magenta("[beta]")));
|
|
78827
79171
|
} else {
|
|
78828
|
-
badges.push(
|
|
79172
|
+
badges.push(import_picocolors19.default.magenta("[prerelease]"));
|
|
78829
79173
|
}
|
|
78830
79174
|
} else if (!release.draft) {
|
|
78831
|
-
badges.push(
|
|
79175
|
+
badges.push(import_picocolors19.default.blue("[stable]"));
|
|
78832
79176
|
}
|
|
78833
79177
|
if (release.draft) {
|
|
78834
|
-
badges.push(
|
|
79178
|
+
badges.push(import_picocolors19.default.gray("[draft]"));
|
|
78835
79179
|
}
|
|
78836
79180
|
return badges.length > 0 ? ` ${badges.join(" ")}` : "";
|
|
78837
79181
|
}
|
|
78838
79182
|
static formatChoiceLabel(release) {
|
|
78839
|
-
const version3 =
|
|
79183
|
+
const version3 = import_picocolors19.default.green(release.displayVersion);
|
|
78840
79184
|
const badges = VersionDisplayFormatter.createBadges(release);
|
|
78841
79185
|
const name2 = release.name || "Release";
|
|
78842
|
-
return `${version3}${badges} ${
|
|
79186
|
+
return `${version3}${badges} ${import_picocolors19.default.dim(name2)}`;
|
|
78843
79187
|
}
|
|
78844
79188
|
static formatChoiceHint(release) {
|
|
78845
79189
|
const parts = [];
|
|
@@ -78861,7 +79205,7 @@ class VersionDisplayFormatter {
|
|
|
78861
79205
|
if (latestStable) {
|
|
78862
79206
|
options2.push({
|
|
78863
79207
|
value: latestStable.tag_name,
|
|
78864
|
-
label: `${
|
|
79208
|
+
label: `${import_picocolors19.default.bold(import_picocolors19.default.green("Latest Stable"))} (${latestStable.displayVersion})`,
|
|
78865
79209
|
hint: "recommended version",
|
|
78866
79210
|
isLatest: true,
|
|
78867
79211
|
isPrerelease: false
|
|
@@ -78871,7 +79215,7 @@ class VersionDisplayFormatter {
|
|
|
78871
79215
|
if (latestBeta) {
|
|
78872
79216
|
options2.push({
|
|
78873
79217
|
value: latestBeta.tag_name,
|
|
78874
|
-
label: `${
|
|
79218
|
+
label: `${import_picocolors19.default.bold(import_picocolors19.default.magenta("Latest Beta"))} (${latestBeta.displayVersion})`,
|
|
78875
79219
|
hint: "latest features, may be unstable",
|
|
78876
79220
|
isLatest: false,
|
|
78877
79221
|
isPrerelease: true
|
|
@@ -78882,7 +79226,7 @@ class VersionDisplayFormatter {
|
|
|
78882
79226
|
static createSeparator() {
|
|
78883
79227
|
return {
|
|
78884
79228
|
value: "separator",
|
|
78885
|
-
label:
|
|
79229
|
+
label: import_picocolors19.default.dim("─".repeat(50)),
|
|
78886
79230
|
hint: undefined,
|
|
78887
79231
|
isLatest: false,
|
|
78888
79232
|
isPrerelease: false
|
|
@@ -78891,7 +79235,7 @@ class VersionDisplayFormatter {
|
|
|
78891
79235
|
static createCancelOption() {
|
|
78892
79236
|
return {
|
|
78893
79237
|
value: "cancel",
|
|
78894
|
-
label:
|
|
79238
|
+
label: import_picocolors19.default.red("Cancel"),
|
|
78895
79239
|
hint: "exit version selection",
|
|
78896
79240
|
isLatest: false,
|
|
78897
79241
|
isPrerelease: false
|
|
@@ -78943,15 +79287,15 @@ class VersionDisplayFormatter {
|
|
|
78943
79287
|
return value !== "separator" && value !== "cancel" && value.trim().length > 0;
|
|
78944
79288
|
}
|
|
78945
79289
|
static formatError(message, suggestion) {
|
|
78946
|
-
let output2 =
|
|
79290
|
+
let output2 = import_picocolors19.default.red(`Error: ${message}`);
|
|
78947
79291
|
if (suggestion) {
|
|
78948
79292
|
output2 += `
|
|
78949
|
-
${
|
|
79293
|
+
${import_picocolors19.default.dim(suggestion)}`;
|
|
78950
79294
|
}
|
|
78951
79295
|
return output2;
|
|
78952
79296
|
}
|
|
78953
79297
|
static formatSuccess(version3, kitName) {
|
|
78954
|
-
return `${
|
|
79298
|
+
return `${import_picocolors19.default.green("✓")} Selected ${import_picocolors19.default.bold(version3)} for ${import_picocolors19.default.bold(kitName)}`;
|
|
78955
79299
|
}
|
|
78956
79300
|
}
|
|
78957
79301
|
|
|
@@ -78961,7 +79305,7 @@ async function handleNoReleases(kit, allowManualEntry) {
|
|
|
78961
79305
|
This could be due to:
|
|
78962
79306
|
• No releases published yet
|
|
78963
79307
|
• Network connectivity issues
|
|
78964
|
-
• Repository access permissions`,
|
|
79308
|
+
• Repository access permissions`, import_picocolors20.default.yellow("No Releases Available"));
|
|
78965
79309
|
if (!allowManualEntry) {
|
|
78966
79310
|
throw new Error(`No releases available for ${kit.name}`);
|
|
78967
79311
|
}
|
|
@@ -79021,34 +79365,34 @@ async function createVersionPrompt(kit, choices, _defaultIndex, allowManualEntry
|
|
|
79021
79365
|
if (latestStable) {
|
|
79022
79366
|
clackChoices.push({
|
|
79023
79367
|
value: latestStable.tag_name,
|
|
79024
|
-
label: `${
|
|
79368
|
+
label: `${import_picocolors20.default.bold(import_picocolors20.default.green("Latest Stable"))} (${latestStable.displayVersion})`,
|
|
79025
79369
|
hint: "recommended"
|
|
79026
79370
|
});
|
|
79027
79371
|
}
|
|
79028
79372
|
if (allowManualEntry) {
|
|
79029
79373
|
clackChoices.push({
|
|
79030
79374
|
value: "manual-entry",
|
|
79031
|
-
label:
|
|
79375
|
+
label: import_picocolors20.default.cyan("↳ Enter Version Manually"),
|
|
79032
79376
|
hint: "for older versions"
|
|
79033
79377
|
});
|
|
79034
79378
|
}
|
|
79035
79379
|
clackChoices.push({
|
|
79036
79380
|
value: "cancel",
|
|
79037
|
-
label:
|
|
79381
|
+
label: import_picocolors20.default.red("✕ Cancel")
|
|
79038
79382
|
});
|
|
79039
79383
|
const versionChoices = choices.filter((choice) => choice.value !== "separator" && choice.value !== "cancel");
|
|
79040
79384
|
for (const choice of versionChoices) {
|
|
79041
79385
|
const isCurrentlyInstalled = currentVersion && (choice.value === currentVersion || choice.value === `v${currentVersion}`);
|
|
79042
|
-
const installedMarker = isCurrentlyInstalled ?
|
|
79386
|
+
const installedMarker = isCurrentlyInstalled ? import_picocolors20.default.cyan(" (installed)") : "";
|
|
79043
79387
|
clackChoices.push({
|
|
79044
79388
|
value: choice.value,
|
|
79045
79389
|
label: `${choice.label}${installedMarker}`,
|
|
79046
79390
|
hint: choice.hint
|
|
79047
79391
|
});
|
|
79048
79392
|
}
|
|
79049
|
-
const currentVersionHint = currentVersion ?
|
|
79393
|
+
const currentVersionHint = currentVersion ? import_picocolors20.default.dim(` (current: ${currentVersion})`) : "";
|
|
79050
79394
|
const selected = await ie({
|
|
79051
|
-
message: `Select version for ${
|
|
79395
|
+
message: `Select version for ${import_picocolors20.default.bold(kit.name)}${currentVersionHint}:`,
|
|
79052
79396
|
options: clackChoices,
|
|
79053
79397
|
initialValue: latestStable?.tag_name
|
|
79054
79398
|
});
|
|
@@ -79073,15 +79417,15 @@ async function createVersionPrompt(kit, choices, _defaultIndex, allowManualEntry
|
|
|
79073
79417
|
async function handleSelectionError(error, kit, allowManualEntry, retryCallback) {
|
|
79074
79418
|
logger.error(`Version selection error: ${error.message}`);
|
|
79075
79419
|
if (error.message.includes("401") || error.message.includes("403")) {
|
|
79076
|
-
le(VersionDisplayFormatter.formatError("Authentication failed", "Please check your GitHub token with: tkm auth"),
|
|
79420
|
+
le(VersionDisplayFormatter.formatError("Authentication failed", "Please check your GitHub token with: tkm auth"), import_picocolors20.default.red("Authentication Error"));
|
|
79077
79421
|
} else if (error.message.includes("404")) {
|
|
79078
|
-
le(VersionDisplayFormatter.formatError("Repository access denied", "Make sure you have access to the repository"),
|
|
79422
|
+
le(VersionDisplayFormatter.formatError("Repository access denied", "Make sure you have access to the repository"), import_picocolors20.default.red("Access Error"));
|
|
79079
79423
|
} else if (error.message.includes("rate limit") || error.message.includes("403")) {
|
|
79080
|
-
le(VersionDisplayFormatter.formatError("GitHub API rate limit exceeded", "Please wait a moment and try again"),
|
|
79424
|
+
le(VersionDisplayFormatter.formatError("GitHub API rate limit exceeded", "Please wait a moment and try again"), import_picocolors20.default.yellow("Rate Limited"));
|
|
79081
79425
|
} else if (error.message.includes("network") || error.message.includes("ENOTFOUND")) {
|
|
79082
|
-
le(VersionDisplayFormatter.formatError("Network connection failed", "Please check your internet connection"),
|
|
79426
|
+
le(VersionDisplayFormatter.formatError("Network connection failed", "Please check your internet connection"), import_picocolors20.default.yellow("Network Error"));
|
|
79083
79427
|
} else {
|
|
79084
|
-
le(VersionDisplayFormatter.formatError(error.message || "Unknown error occurred", "Please try again or contact support"),
|
|
79428
|
+
le(VersionDisplayFormatter.formatError(error.message || "Unknown error occurred", "Please try again or contact support"), import_picocolors20.default.red("Error"));
|
|
79085
79429
|
}
|
|
79086
79430
|
if (isNonInteractive()) {
|
|
79087
79431
|
logger.warning("Non-interactive mode: version selection failed, cannot retry");
|
|
@@ -79143,7 +79487,7 @@ class VersionSelector {
|
|
|
79143
79487
|
} = options2;
|
|
79144
79488
|
try {
|
|
79145
79489
|
const loadingSpinner = de();
|
|
79146
|
-
loadingSpinner.start(`Fetching versions for ${
|
|
79490
|
+
loadingSpinner.start(`Fetching versions for ${import_picocolors21.default.bold(kit.name)}...`);
|
|
79147
79491
|
let releases;
|
|
79148
79492
|
if (useGh) {
|
|
79149
79493
|
releases = await this.githubClient.listReleasesWithCache(kit, {
|
|
@@ -79780,12 +80124,12 @@ import * as path10 from "node:path";
|
|
|
79780
80124
|
// src/domains/github/auth-prompt.ts
|
|
79781
80125
|
init_dist2();
|
|
79782
80126
|
init_github_auth();
|
|
79783
|
-
var
|
|
80127
|
+
var import_picocolors22 = __toESM(require_picocolors(), 1);
|
|
79784
80128
|
async function promptForAuth() {
|
|
79785
80129
|
const hasGit = GitCloneManager.isGitInstalled();
|
|
79786
80130
|
const hasSshKeys = hasGit && GitCloneManager.hasSshKeys();
|
|
79787
80131
|
const hasGhCli = AuthManager.isGhCliInstalled();
|
|
79788
|
-
oe(
|
|
80132
|
+
oe(import_picocolors22.default.yellow("No GitHub authentication found"));
|
|
79789
80133
|
const options2 = [];
|
|
79790
80134
|
if (hasGit) {
|
|
79791
80135
|
const hint = hasSshKeys ? "SSH keys detected" : "Will use HTTPS";
|
|
@@ -79838,7 +80182,7 @@ async function promptForAuth() {
|
|
|
79838
80182
|
return { method: "cancel" };
|
|
79839
80183
|
}
|
|
79840
80184
|
if (typeof token === "string" && token.startsWith("github_pat_")) {
|
|
79841
|
-
le(
|
|
80185
|
+
le(import_picocolors22.default.yellow(`⚠️ Fine-grained PATs cannot access repos where you're a collaborator.
|
|
79842
80186
|
` + " If you encounter access issues, use a Classic PAT instead."));
|
|
79843
80187
|
}
|
|
79844
80188
|
return { method: "token", token };
|
|
@@ -79881,7 +80225,7 @@ import { join as join117 } from "node:path";
|
|
|
79881
80225
|
// src/shared/progress-bar.ts
|
|
79882
80226
|
init_output_manager();
|
|
79883
80227
|
init_terminal_utils();
|
|
79884
|
-
var
|
|
80228
|
+
var import_picocolors23 = __toESM(require_picocolors(), 1);
|
|
79885
80229
|
var BAR_CHARS = {
|
|
79886
80230
|
unicode: { filled: "█", empty: "░" },
|
|
79887
80231
|
ascii: { filled: "=", empty: "-" }
|
|
@@ -79939,7 +80283,7 @@ class ProgressBar {
|
|
|
79939
80283
|
this.clearLine();
|
|
79940
80284
|
if (message) {
|
|
79941
80285
|
const symbols = output.getSymbols();
|
|
79942
|
-
console.log(`${
|
|
80286
|
+
console.log(`${import_picocolors23.default.green(symbols.success)} ${message}`);
|
|
79943
80287
|
}
|
|
79944
80288
|
}
|
|
79945
80289
|
clearLine() {
|
|
@@ -85571,7 +85915,7 @@ function filterDeletionPaths(trackedFiles, deletions) {
|
|
|
85571
85915
|
}
|
|
85572
85916
|
// src/domains/sync/merge-ui.ts
|
|
85573
85917
|
init_dist2();
|
|
85574
|
-
var
|
|
85918
|
+
var import_picocolors24 = __toESM(require_picocolors(), 1);
|
|
85575
85919
|
var HUNK_SEPARATOR_WIDTH = 50;
|
|
85576
85920
|
var EXTENDED_CONTEXT_LINES = 10;
|
|
85577
85921
|
var MAX_LINE_DISPLAY_LENGTH = 120;
|
|
@@ -85590,21 +85934,21 @@ class MergeUI {
|
|
|
85590
85934
|
static async promptHunk(hunk, hunkIndex, totalHunks, _filename) {
|
|
85591
85935
|
requireTTY();
|
|
85592
85936
|
const lineRange = `${hunk.oldStart}-${hunk.oldStart + hunk.oldLines - 1}`;
|
|
85593
|
-
console.log(
|
|
85937
|
+
console.log(import_picocolors24.default.cyan(`
|
|
85594
85938
|
Hunk ${hunkIndex + 1}/${totalHunks}: Lines ${lineRange}`));
|
|
85595
|
-
console.log(
|
|
85939
|
+
console.log(import_picocolors24.default.dim("─".repeat(HUNK_SEPARATOR_WIDTH)));
|
|
85596
85940
|
for (const line of hunk.lines) {
|
|
85597
85941
|
const displayLine = truncateLine(line);
|
|
85598
85942
|
const prefix = line[0];
|
|
85599
85943
|
if (prefix === "+") {
|
|
85600
|
-
console.log(
|
|
85944
|
+
console.log(import_picocolors24.default.green(displayLine));
|
|
85601
85945
|
} else if (prefix === "-") {
|
|
85602
|
-
console.log(
|
|
85946
|
+
console.log(import_picocolors24.default.red(displayLine));
|
|
85603
85947
|
} else {
|
|
85604
|
-
console.log(
|
|
85948
|
+
console.log(import_picocolors24.default.dim(displayLine));
|
|
85605
85949
|
}
|
|
85606
85950
|
}
|
|
85607
|
-
console.log(
|
|
85951
|
+
console.log(import_picocolors24.default.dim("─".repeat(HUNK_SEPARATOR_WIDTH)));
|
|
85608
85952
|
const action = await ie({
|
|
85609
85953
|
message: "Action?",
|
|
85610
85954
|
options: [
|
|
@@ -85624,21 +85968,21 @@ Hunk ${hunkIndex + 1}/${totalHunks}: Lines ${lineRange}`));
|
|
|
85624
85968
|
`);
|
|
85625
85969
|
const startLine = Math.max(0, hunk.oldStart - 1 - contextLines);
|
|
85626
85970
|
const endLine = Math.min(lines.length, hunk.oldStart + hunk.oldLines - 1 + contextLines);
|
|
85627
|
-
console.log(
|
|
85971
|
+
console.log(import_picocolors24.default.cyan(`
|
|
85628
85972
|
Extended context (lines ${startLine + 1}-${endLine}):`));
|
|
85629
|
-
console.log(
|
|
85973
|
+
console.log(import_picocolors24.default.dim("─".repeat(HUNK_SEPARATOR_WIDTH)));
|
|
85630
85974
|
for (let i = startLine;i < endLine; i++) {
|
|
85631
85975
|
const lineNum = String(i + 1).padStart(4, " ");
|
|
85632
85976
|
const isInHunk = i >= hunk.oldStart - 1 && i < hunk.oldStart - 1 + hunk.oldLines;
|
|
85633
|
-
const prefix = isInHunk ?
|
|
85634
|
-
console.log(`${
|
|
85977
|
+
const prefix = isInHunk ? import_picocolors24.default.yellow("*") : " ";
|
|
85978
|
+
console.log(`${import_picocolors24.default.dim(lineNum)} ${prefix} ${lines[i]}`);
|
|
85635
85979
|
}
|
|
85636
|
-
console.log(
|
|
85980
|
+
console.log(import_picocolors24.default.dim("─".repeat(HUNK_SEPARATOR_WIDTH)));
|
|
85637
85981
|
}
|
|
85638
85982
|
static async mergeFile(filename, currentContent, _newContent, hunks) {
|
|
85639
|
-
console.log(
|
|
85983
|
+
console.log(import_picocolors24.default.bold(`
|
|
85640
85984
|
━━━ ${filename} ━━━`));
|
|
85641
|
-
console.log(
|
|
85985
|
+
console.log(import_picocolors24.default.dim(`${hunks.length} change${hunks.length === 1 ? "" : "s"} to review
|
|
85642
85986
|
`));
|
|
85643
85987
|
const decisions = [];
|
|
85644
85988
|
for (let i = 0;i < hunks.length; i++) {
|
|
@@ -85661,19 +86005,19 @@ Extended context (lines ${startLine + 1}-${endLine}):`));
|
|
|
85661
86005
|
}
|
|
85662
86006
|
static displayMergeSummary(filename, applied, rejected) {
|
|
85663
86007
|
if (applied > 0 && rejected > 0) {
|
|
85664
|
-
console.log(
|
|
86008
|
+
console.log(import_picocolors24.default.dim(` ${filename}: `) + import_picocolors24.default.green(`${applied} applied`) + import_picocolors24.default.dim(", ") + import_picocolors24.default.yellow(`${rejected} rejected`));
|
|
85665
86009
|
} else if (applied > 0) {
|
|
85666
|
-
console.log(
|
|
86010
|
+
console.log(import_picocolors24.default.dim(` ${filename}: `) + import_picocolors24.default.green(`${applied} applied`));
|
|
85667
86011
|
} else {
|
|
85668
|
-
console.log(
|
|
86012
|
+
console.log(import_picocolors24.default.dim(` ${filename}: `) + import_picocolors24.default.yellow(`${rejected} rejected`));
|
|
85669
86013
|
}
|
|
85670
86014
|
}
|
|
85671
86015
|
static displaySkipped(filename) {
|
|
85672
|
-
console.log(
|
|
86016
|
+
console.log(import_picocolors24.default.dim(` ${filename}: `) + import_picocolors24.default.yellow("skipped"));
|
|
85673
86017
|
}
|
|
85674
86018
|
}
|
|
85675
86019
|
// src/domains/sync/notification-display.ts
|
|
85676
|
-
var
|
|
86020
|
+
var import_picocolors25 = __toESM(require_picocolors(), 1);
|
|
85677
86021
|
import { stdout } from "node:process";
|
|
85678
86022
|
function createNotificationBox2(borderColor, boxWidth) {
|
|
85679
86023
|
const contentWidth = boxWidth - 2;
|
|
@@ -85697,19 +86041,19 @@ function displayConfigUpdateNotification(entries, isGlobal = false) {
|
|
|
85697
86041
|
const lines = entries.map(({ kit, currentVersion, latestVersion }) => {
|
|
85698
86042
|
const cur = currentVersion.replace(/^v/, "");
|
|
85699
86043
|
const latest = latestVersion.replace(/^v/, "");
|
|
85700
|
-
const text = `${
|
|
86044
|
+
const text = `${import_picocolors25.default.bold(kit)}: ${import_picocolors25.default.dim(cur)} ${import_picocolors25.default.white("→")} ${import_picocolors25.default.green(import_picocolors25.default.bold(latest))}`;
|
|
85701
86045
|
const visibleLen = kit.length + 2 + cur.length + 3 + latest.length;
|
|
85702
86046
|
return { text, visibleLen };
|
|
85703
86047
|
});
|
|
85704
86048
|
const updateCmd = isGlobal ? "tkm init -g --sync" : "tkm init --sync";
|
|
85705
|
-
const commandText = `Run: ${
|
|
86049
|
+
const commandText = `Run: ${import_picocolors25.default.cyan(import_picocolors25.default.bold(updateCmd))}`;
|
|
85706
86050
|
const commandLen = `Run: ${updateCmd}`.length;
|
|
85707
86051
|
const headerLabel = "\uD83D\uDCE6 Config Updates Available";
|
|
85708
|
-
const headerText =
|
|
86052
|
+
const headerText = import_picocolors25.default.bold(import_picocolors25.default.yellow(headerLabel));
|
|
85709
86053
|
const longestLine = Math.max(headerLabel.length, commandLen, ...lines.map((l2) => l2.visibleLen));
|
|
85710
86054
|
const terminalWidth = stdout.columns || 80;
|
|
85711
86055
|
const boxWidth = Math.min(Math.max(longestLine + 6, 52), terminalWidth - 4);
|
|
85712
|
-
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(
|
|
86056
|
+
const { topBorder, bottomBorder, emptyLine, padLine } = createNotificationBox2(import_picocolors25.default.cyan, boxWidth);
|
|
85713
86057
|
console.log("");
|
|
85714
86058
|
console.log(topBorder);
|
|
85715
86059
|
console.log(emptyLine);
|
|
@@ -85732,7 +86076,7 @@ init_manifest_reader();
|
|
|
85732
86076
|
init_logger();
|
|
85733
86077
|
init_path_resolver();
|
|
85734
86078
|
var import_fs_extra36 = __toESM(require_lib(), 1);
|
|
85735
|
-
var
|
|
86079
|
+
var import_picocolors26 = __toESM(require_picocolors(), 1);
|
|
85736
86080
|
async function handleSync(ctx) {
|
|
85737
86081
|
if (!ctx.options.sync) {
|
|
85738
86082
|
return ctx;
|
|
@@ -85917,7 +86261,7 @@ async function executeSyncMerge(ctx) {
|
|
|
85917
86261
|
}
|
|
85918
86262
|
const backupDir = PathResolver.getBackupDir();
|
|
85919
86263
|
await createBackup(ctx.claudeDir, trackedFiles, backupDir);
|
|
85920
|
-
logger.success(`Backup created at ${
|
|
86264
|
+
logger.success(`Backup created at ${import_picocolors26.default.dim(backupDir)}`);
|
|
85921
86265
|
if (plan.autoUpdate.length > 0) {
|
|
85922
86266
|
logger.info(`Auto-updating ${plan.autoUpdate.length} file(s)...`);
|
|
85923
86267
|
let updateSuccess = 0;
|
|
@@ -86027,22 +86371,22 @@ async function executeSyncMerge(ctx) {
|
|
|
86027
86371
|
totalRejected += result.rejected;
|
|
86028
86372
|
}
|
|
86029
86373
|
console.log("");
|
|
86030
|
-
console.log(
|
|
86031
|
-
console.log(
|
|
86374
|
+
console.log(import_picocolors26.default.bold("Sync Summary:"));
|
|
86375
|
+
console.log(import_picocolors26.default.dim("─".repeat(40)));
|
|
86032
86376
|
if (plan.autoUpdate.length > 0) {
|
|
86033
|
-
console.log(
|
|
86377
|
+
console.log(import_picocolors26.default.green(` ✓ ${plan.autoUpdate.length} file(s) auto-updated`));
|
|
86034
86378
|
}
|
|
86035
86379
|
if (totalApplied > 0) {
|
|
86036
|
-
console.log(
|
|
86380
|
+
console.log(import_picocolors26.default.green(` ✓ ${totalApplied} hunk(s) applied`));
|
|
86037
86381
|
}
|
|
86038
86382
|
if (totalRejected > 0) {
|
|
86039
|
-
console.log(
|
|
86383
|
+
console.log(import_picocolors26.default.yellow(` ○ ${totalRejected} hunk(s) rejected`));
|
|
86040
86384
|
}
|
|
86041
86385
|
if (skippedFiles > 0) {
|
|
86042
|
-
console.log(
|
|
86386
|
+
console.log(import_picocolors26.default.yellow(` ○ ${skippedFiles} file(s) skipped`));
|
|
86043
86387
|
}
|
|
86044
86388
|
if (plan.skipped.length > 0) {
|
|
86045
|
-
console.log(
|
|
86389
|
+
console.log(import_picocolors26.default.dim(` ─ ${plan.skipped.length} user-owned file(s) unchanged`));
|
|
86046
86390
|
}
|
|
86047
86391
|
} else if (plan.needsReview.length > 0 && ctx.isNonInteractive) {
|
|
86048
86392
|
logger.error(`Cannot complete sync: ${plan.needsReview.length} file(s) require interactive review`);
|
|
@@ -86065,30 +86409,30 @@ Options:
|
|
|
86065
86409
|
}
|
|
86066
86410
|
function displaySyncPlan(plan) {
|
|
86067
86411
|
console.log("");
|
|
86068
|
-
console.log(
|
|
86069
|
-
console.log(
|
|
86412
|
+
console.log(import_picocolors26.default.bold("Sync Plan:"));
|
|
86413
|
+
console.log(import_picocolors26.default.dim("─".repeat(40)));
|
|
86070
86414
|
if (plan.autoUpdate.length > 0) {
|
|
86071
|
-
console.log(
|
|
86415
|
+
console.log(import_picocolors26.default.green(` ${plan.autoUpdate.length} file(s) will be auto-updated`));
|
|
86072
86416
|
for (const file of plan.autoUpdate.slice(0, 5)) {
|
|
86073
|
-
console.log(
|
|
86417
|
+
console.log(import_picocolors26.default.dim(` • ${file.path}`));
|
|
86074
86418
|
}
|
|
86075
86419
|
if (plan.autoUpdate.length > 5) {
|
|
86076
|
-
console.log(
|
|
86420
|
+
console.log(import_picocolors26.default.dim(` ... and ${plan.autoUpdate.length - 5} more`));
|
|
86077
86421
|
}
|
|
86078
86422
|
}
|
|
86079
86423
|
if (plan.needsReview.length > 0) {
|
|
86080
|
-
console.log(
|
|
86424
|
+
console.log(import_picocolors26.default.yellow(` ${plan.needsReview.length} file(s) need interactive review`));
|
|
86081
86425
|
for (const file of plan.needsReview.slice(0, 5)) {
|
|
86082
|
-
console.log(
|
|
86426
|
+
console.log(import_picocolors26.default.dim(` • ${file.path}`));
|
|
86083
86427
|
}
|
|
86084
86428
|
if (plan.needsReview.length > 5) {
|
|
86085
|
-
console.log(
|
|
86429
|
+
console.log(import_picocolors26.default.dim(` ... and ${plan.needsReview.length - 5} more`));
|
|
86086
86430
|
}
|
|
86087
86431
|
}
|
|
86088
86432
|
if (plan.skipped.length > 0) {
|
|
86089
|
-
console.log(
|
|
86433
|
+
console.log(import_picocolors26.default.dim(` ${plan.skipped.length} user-owned file(s) will be skipped`));
|
|
86090
86434
|
}
|
|
86091
|
-
console.log(
|
|
86435
|
+
console.log(import_picocolors26.default.dim("─".repeat(40)));
|
|
86092
86436
|
}
|
|
86093
86437
|
async function createBackup(claudeDir, files, backupDir) {
|
|
86094
86438
|
await mkdir28(backupDir, { recursive: true });
|
|
@@ -87749,26 +88093,14 @@ async function addCommand(service, options2 = {}) {
|
|
|
87749
88093
|
}
|
|
87750
88094
|
// src/commands/mcp/list-command.ts
|
|
87751
88095
|
init_logger();
|
|
87752
|
-
var
|
|
88096
|
+
var import_picocolors27 = __toESM(require_picocolors(), 1);
|
|
87753
88097
|
function statusCell(configured) {
|
|
87754
|
-
return configured ? { value: "● configured", paint:
|
|
87755
|
-
}
|
|
87756
|
-
function renderTable(header, rows) {
|
|
87757
|
-
const lastCol = header.length - 1;
|
|
87758
|
-
const widths = header.map((h2, col) => Math.max(h2.length, ...rows.map((r2) => r2[col]?.value.length ?? 0)));
|
|
87759
|
-
const padPlain = (text, col) => col === lastCol ? text : text.padEnd(widths[col]);
|
|
87760
|
-
const headerLine = import_picocolors25.default.bold(header.map((h2, col) => padPlain(h2, col)).join(" ").trimEnd());
|
|
87761
|
-
const rowLine = (cells) => cells.map((cell, col) => {
|
|
87762
|
-
const padded = padPlain(cell.value, col);
|
|
87763
|
-
return cell.paint ? cell.paint(padded) : padded;
|
|
87764
|
-
}).join(" ").trimEnd();
|
|
87765
|
-
return [headerLine, ...rows.map(rowLine)].join(`
|
|
87766
|
-
`);
|
|
88098
|
+
return configured ? { value: "● configured", paint: import_picocolors27.default.green } : { value: "○ not set", paint: import_picocolors27.default.dim };
|
|
87767
88099
|
}
|
|
87768
|
-
async function listCommand(options2 = {}) {
|
|
88100
|
+
async function listCommand(options2 = {}, deps) {
|
|
87769
88101
|
let listed;
|
|
87770
88102
|
try {
|
|
87771
|
-
listed = await runList();
|
|
88103
|
+
listed = await runList(deps);
|
|
87772
88104
|
} catch (error) {
|
|
87773
88105
|
if (error instanceof RegistryUnavailableError) {
|
|
87774
88106
|
logger.error(error.message);
|
|
@@ -88606,7 +88938,7 @@ function buildPlanSummary(planFile) {
|
|
|
88606
88938
|
// src/commands/plan/plan-read-handlers.ts
|
|
88607
88939
|
init_logger();
|
|
88608
88940
|
init_output_manager();
|
|
88609
|
-
var
|
|
88941
|
+
var import_picocolors28 = __toESM(require_picocolors(), 1);
|
|
88610
88942
|
async function handleParse(target, options2) {
|
|
88611
88943
|
const planFile = resolvePlanFile(target);
|
|
88612
88944
|
if (!planFile) {
|
|
@@ -88629,7 +88961,7 @@ async function handleParse(target, options2) {
|
|
|
88629
88961
|
}
|
|
88630
88962
|
const title = typeof frontmatter.title === "string" ? frontmatter.title : basename21(dirname41(planFile));
|
|
88631
88963
|
console.log();
|
|
88632
|
-
console.log(
|
|
88964
|
+
console.log(import_picocolors28.default.bold(` Plan: ${title}`));
|
|
88633
88965
|
console.log(` File: ${planFile}`);
|
|
88634
88966
|
console.log(` Phases found: ${phases.length}`);
|
|
88635
88967
|
console.log();
|
|
@@ -88660,7 +88992,7 @@ async function handleValidate(target, options2) {
|
|
|
88660
88992
|
return;
|
|
88661
88993
|
}
|
|
88662
88994
|
console.log();
|
|
88663
|
-
console.log(
|
|
88995
|
+
console.log(import_picocolors28.default.bold(` Validating: ${planFile}`));
|
|
88664
88996
|
console.log();
|
|
88665
88997
|
if (result.issues.length === 0) {
|
|
88666
88998
|
console.log(` [OK] No issues found — ${result.phases.length} phases detected`);
|
|
@@ -88674,7 +89006,7 @@ async function handleValidate(target, options2) {
|
|
|
88674
89006
|
}
|
|
88675
89007
|
}
|
|
88676
89008
|
console.log();
|
|
88677
|
-
const validStr = result.valid ?
|
|
89009
|
+
const validStr = result.valid ? import_picocolors28.default.green("[OK] Valid") : import_picocolors28.default.red("[X] Invalid");
|
|
88678
89010
|
console.log(` ${validStr} — ${result.issues.filter((i) => i.severity === "error").length} errors, ${result.issues.filter((i) => i.severity === "warning").length} warnings`);
|
|
88679
89011
|
console.log();
|
|
88680
89012
|
if (!result.valid)
|
|
@@ -88701,14 +89033,14 @@ async function handleStatus(target, options2) {
|
|
|
88701
89033
|
return;
|
|
88702
89034
|
}
|
|
88703
89035
|
console.log();
|
|
88704
|
-
console.log(
|
|
89036
|
+
console.log(import_picocolors28.default.bold(` Plans in: ${plansDir}`));
|
|
88705
89037
|
console.log();
|
|
88706
89038
|
for (const pf of planFiles) {
|
|
88707
89039
|
try {
|
|
88708
89040
|
const s3 = buildPlanSummary(pf);
|
|
88709
89041
|
const bar = progressBar(s3.completed, s3.totalPhases);
|
|
88710
89042
|
const title2 = s3.title ?? basename21(dirname41(pf));
|
|
88711
|
-
console.log(` ${
|
|
89043
|
+
console.log(` ${import_picocolors28.default.bold(title2)}`);
|
|
88712
89044
|
console.log(` ${bar}`);
|
|
88713
89045
|
if (s3.inProgress > 0)
|
|
88714
89046
|
console.log(` [~] ${s3.inProgress} in progress`);
|
|
@@ -88740,7 +89072,7 @@ async function handleStatus(target, options2) {
|
|
|
88740
89072
|
}
|
|
88741
89073
|
const title = summary.title ?? basename21(dirname41(planFile));
|
|
88742
89074
|
console.log();
|
|
88743
|
-
console.log(
|
|
89075
|
+
console.log(import_picocolors28.default.bold(` ${title}`));
|
|
88744
89076
|
if (summary.status)
|
|
88745
89077
|
console.log(` Status: ${summary.status}`);
|
|
88746
89078
|
console.log();
|
|
@@ -88766,7 +89098,7 @@ async function handleKanban(target, _options) {
|
|
|
88766
89098
|
// src/commands/plan/plan-write-handlers.ts
|
|
88767
89099
|
import { basename as basename22, relative as relative22, resolve as resolve34 } from "node:path";
|
|
88768
89100
|
init_output_manager();
|
|
88769
|
-
var
|
|
89101
|
+
var import_picocolors29 = __toESM(require_picocolors(), 1);
|
|
88770
89102
|
async function handleCreate(target, options2) {
|
|
88771
89103
|
if (!options2.title) {
|
|
88772
89104
|
output.error("[X] --title is required for create");
|
|
@@ -88813,7 +89145,7 @@ async function handleCreate(target, options2) {
|
|
|
88813
89145
|
return;
|
|
88814
89146
|
}
|
|
88815
89147
|
console.log();
|
|
88816
|
-
console.log(
|
|
89148
|
+
console.log(import_picocolors29.default.bold(` [OK] Plan created: ${options2.title}`));
|
|
88817
89149
|
console.log(` Directory: ${resolve34(dir)}`);
|
|
88818
89150
|
console.log(` Phases: ${result.phaseFiles.length}`);
|
|
88819
89151
|
for (const f4 of result.phaseFiles) {
|
|
@@ -89972,7 +90304,7 @@ init_manifest_writer();
|
|
|
89972
90304
|
init_logger();
|
|
89973
90305
|
init_safe_prompts();
|
|
89974
90306
|
init_types2();
|
|
89975
|
-
var
|
|
90307
|
+
var import_picocolors31 = __toESM(require_picocolors(), 1);
|
|
89976
90308
|
|
|
89977
90309
|
// src/commands/uninstall/installation-detector.ts
|
|
89978
90310
|
init_paths();
|
|
@@ -90031,7 +90363,7 @@ init_ownership_checker();
|
|
|
90031
90363
|
init_logger();
|
|
90032
90364
|
init_safe_prompts();
|
|
90033
90365
|
init_takumi_constants();
|
|
90034
|
-
var
|
|
90366
|
+
var import_picocolors30 = __toESM(require_picocolors(), 1);
|
|
90035
90367
|
import { existsSync as existsSync70, readdirSync as readdirSync13, rmSync as rmSync10 } from "node:fs";
|
|
90036
90368
|
import { dirname as dirname43, join as join141 } from "node:path";
|
|
90037
90369
|
function listPresentManifestNames(installPath) {
|
|
@@ -90136,27 +90468,27 @@ async function analyzeInstallation(installation, forceOverwrite, kit) {
|
|
|
90136
90468
|
}
|
|
90137
90469
|
function displayDryRunPreview(analysis, installationType) {
|
|
90138
90470
|
console.log("");
|
|
90139
|
-
log.info(
|
|
90471
|
+
log.info(import_picocolors30.default.bold(`DRY RUN - Preview for ${installationType} installation:`));
|
|
90140
90472
|
console.log("");
|
|
90141
90473
|
if (analysis.toDelete.length > 0) {
|
|
90142
|
-
console.log(
|
|
90474
|
+
console.log(import_picocolors30.default.red(import_picocolors30.default.bold(`Files to DELETE (${analysis.toDelete.length}):`)));
|
|
90143
90475
|
const showDelete = analysis.toDelete.slice(0, 10);
|
|
90144
90476
|
for (const item of showDelete) {
|
|
90145
|
-
console.log(` ${
|
|
90477
|
+
console.log(` ${import_picocolors30.default.red("✖")} ${item.path}`);
|
|
90146
90478
|
}
|
|
90147
90479
|
if (analysis.toDelete.length > 10) {
|
|
90148
|
-
console.log(
|
|
90480
|
+
console.log(import_picocolors30.default.gray(` ... and ${analysis.toDelete.length - 10} more`));
|
|
90149
90481
|
}
|
|
90150
90482
|
console.log("");
|
|
90151
90483
|
}
|
|
90152
90484
|
if (analysis.toPreserve.length > 0) {
|
|
90153
|
-
console.log(
|
|
90485
|
+
console.log(import_picocolors30.default.green(import_picocolors30.default.bold(`Files to PRESERVE (${analysis.toPreserve.length}):`)));
|
|
90154
90486
|
const showPreserve = analysis.toPreserve.slice(0, 10);
|
|
90155
90487
|
for (const item of showPreserve) {
|
|
90156
|
-
console.log(` ${
|
|
90488
|
+
console.log(` ${import_picocolors30.default.green("✓")} ${item.path} ${import_picocolors30.default.gray(`(${item.reason})`)}`);
|
|
90157
90489
|
}
|
|
90158
90490
|
if (analysis.toPreserve.length > 10) {
|
|
90159
|
-
console.log(
|
|
90491
|
+
console.log(import_picocolors30.default.gray(` ... and ${analysis.toPreserve.length - 10} more`));
|
|
90160
90492
|
}
|
|
90161
90493
|
console.log("");
|
|
90162
90494
|
}
|
|
@@ -90278,15 +90610,15 @@ function displayInstallations(installations, scope) {
|
|
|
90278
90610
|
const hasLegacy = installations.some((i) => !i.hasMetadata);
|
|
90279
90611
|
const lines = installations.map((i) => {
|
|
90280
90612
|
const typeLabel = i.type === "local" ? "Local " : "Global";
|
|
90281
|
-
const legacyTag = !i.hasMetadata ?
|
|
90613
|
+
const legacyTag = !i.hasMetadata ? import_picocolors31.default.yellow(" [legacy]") : "";
|
|
90282
90614
|
const components = formatComponentSummary(i);
|
|
90283
90615
|
return ` ${typeLabel}: ${i.path}${legacyTag}${components}`;
|
|
90284
90616
|
});
|
|
90285
90617
|
prompts.note(lines.join(`
|
|
90286
90618
|
`), `Detected Takumi installations (${scopeLabel})`);
|
|
90287
90619
|
if (hasLegacy) {
|
|
90288
|
-
log.warn(
|
|
90289
|
-
`) +
|
|
90620
|
+
log.warn(import_picocolors31.default.yellow(`[!] Legacy installation(s) detected without metadata.json.
|
|
90621
|
+
`) + import_picocolors31.default.yellow(" These files cannot be selectively removed. Full directory cleanup will be performed."));
|
|
90290
90622
|
}
|
|
90291
90623
|
log.warn("[!] This will permanently delete Takumi files from the above paths.");
|
|
90292
90624
|
}
|
|
@@ -90346,7 +90678,7 @@ async function uninstallCommand(options2) {
|
|
|
90346
90678
|
}
|
|
90347
90679
|
const isAtHome = isLocalSameAsGlobal();
|
|
90348
90680
|
if (validOptions.local && !validOptions.global && isAtHome) {
|
|
90349
|
-
log.warn(
|
|
90681
|
+
log.warn(import_picocolors31.default.yellow("Cannot use --local at HOME directory (local path equals global path)."));
|
|
90350
90682
|
log.info("Use -g/--global or run from a project directory.");
|
|
90351
90683
|
return;
|
|
90352
90684
|
}
|
|
@@ -90358,7 +90690,7 @@ async function uninstallCommand(options2) {
|
|
|
90358
90690
|
} else if (validOptions.global) {
|
|
90359
90691
|
scope = "global";
|
|
90360
90692
|
} else if (isAtHome) {
|
|
90361
|
-
log.info(
|
|
90693
|
+
log.info(import_picocolors31.default.cyan("Running at HOME directory - targeting global installation"));
|
|
90362
90694
|
scope = "global";
|
|
90363
90695
|
} else {
|
|
90364
90696
|
const promptedScope = await promptScope(allInstallations);
|
|
@@ -90380,10 +90712,10 @@ async function uninstallCommand(options2) {
|
|
|
90380
90712
|
}
|
|
90381
90713
|
displayInstallations(installations, scope);
|
|
90382
90714
|
if (validOptions.kit) {
|
|
90383
|
-
log.info(
|
|
90715
|
+
log.info(import_picocolors31.default.cyan(`Kit-scoped uninstall: ${validOptions.kit} kit only`));
|
|
90384
90716
|
}
|
|
90385
90717
|
if (validOptions.dryRun) {
|
|
90386
|
-
log.info(
|
|
90718
|
+
log.info(import_picocolors31.default.yellow("DRY RUN MODE - No files will be deleted"));
|
|
90387
90719
|
await removeInstallations(installations, {
|
|
90388
90720
|
dryRun: true,
|
|
90389
90721
|
forceOverwrite: validOptions.forceOverwrite,
|
|
@@ -90393,8 +90725,8 @@ async function uninstallCommand(options2) {
|
|
|
90393
90725
|
return;
|
|
90394
90726
|
}
|
|
90395
90727
|
if (validOptions.forceOverwrite) {
|
|
90396
|
-
log.warn(`${
|
|
90397
|
-
${
|
|
90728
|
+
log.warn(`${import_picocolors31.default.yellow(import_picocolors31.default.bold("FORCE MODE ENABLED"))}
|
|
90729
|
+
${import_picocolors31.default.yellow("User modifications will be permanently deleted!")}`);
|
|
90398
90730
|
}
|
|
90399
90731
|
if (!validOptions.yes) {
|
|
90400
90732
|
const kitLabel = validOptions.kit ? ` (${validOptions.kit} kit only)` : "";
|
|
@@ -90847,8 +91179,8 @@ init_auth_client();
|
|
|
90847
91179
|
init_github_client();
|
|
90848
91180
|
init_logger();
|
|
90849
91181
|
init_types2();
|
|
90850
|
-
var
|
|
90851
|
-
function
|
|
91182
|
+
var import_picocolors32 = __toESM(require_picocolors(), 1);
|
|
91183
|
+
function formatRelativeTime2(dateString) {
|
|
90852
91184
|
if (!dateString)
|
|
90853
91185
|
return "Unknown";
|
|
90854
91186
|
const date = new Date(dateString);
|
|
@@ -90869,21 +91201,21 @@ function formatRelativeTime(dateString) {
|
|
|
90869
91201
|
}
|
|
90870
91202
|
function displayKitReleases(kitName, releases) {
|
|
90871
91203
|
console.log(`
|
|
90872
|
-
${
|
|
91204
|
+
${import_picocolors32.default.bold(import_picocolors32.default.cyan(kitName))} - Available Versions:
|
|
90873
91205
|
`);
|
|
90874
91206
|
if (releases.length === 0) {
|
|
90875
|
-
console.log(
|
|
91207
|
+
console.log(import_picocolors32.default.dim(" No releases found"));
|
|
90876
91208
|
return;
|
|
90877
91209
|
}
|
|
90878
91210
|
for (const release of releases) {
|
|
90879
|
-
const version3 =
|
|
90880
|
-
const publishedAt =
|
|
90881
|
-
const badge = release.prerelease ? ` ${
|
|
91211
|
+
const version3 = import_picocolors32.default.green(release.tag);
|
|
91212
|
+
const publishedAt = formatRelativeTime2(release.publishedAt);
|
|
91213
|
+
const badge = release.prerelease ? ` ${import_picocolors32.default.yellow("[prerelease]")}` : "";
|
|
90882
91214
|
const versionPart = version3.padEnd(20);
|
|
90883
|
-
const timePart =
|
|
91215
|
+
const timePart = import_picocolors32.default.dim(publishedAt.padEnd(20));
|
|
90884
91216
|
console.log(` ${versionPart} ${timePart}${badge}`);
|
|
90885
91217
|
}
|
|
90886
|
-
console.log(
|
|
91218
|
+
console.log(import_picocolors32.default.dim(`
|
|
90887
91219
|
Showing ${releases.length} ${releases.length === 1 ? "release" : "releases"}`));
|
|
90888
91220
|
}
|
|
90889
91221
|
async function fetchReleasesForKit(kitType, options2) {
|
|
@@ -90928,8 +91260,8 @@ async function versionCommand(options2) {
|
|
|
90928
91260
|
for (const result of results) {
|
|
90929
91261
|
if (result.error) {
|
|
90930
91262
|
console.log(`
|
|
90931
|
-
${
|
|
90932
|
-
console.log(
|
|
91263
|
+
${import_picocolors32.default.bold(import_picocolors32.default.cyan(result.kitConfig.name))} - ${import_picocolors32.default.red("Error")}`);
|
|
91264
|
+
console.log(import_picocolors32.default.dim(` ${result.error}`));
|
|
90933
91265
|
} else {
|
|
90934
91266
|
displayKitReleases(result.kitConfig.name, result.releases);
|
|
90935
91267
|
}
|
|
@@ -90951,6 +91283,23 @@ function normalizeSkillGroupFlag(value) {
|
|
|
90951
91283
|
}
|
|
90952
91284
|
|
|
90953
91285
|
// src/cli/command-registry.ts
|
|
91286
|
+
function parsePositiveIntFlag(raw, label, example, max) {
|
|
91287
|
+
if (raw === undefined)
|
|
91288
|
+
return;
|
|
91289
|
+
const value = Number(String(raw));
|
|
91290
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
91291
|
+
console.error(`Invalid ${label}: ${raw}. Use a positive integer, e.g. ${example}`);
|
|
91292
|
+
process.exitCode = 1;
|
|
91293
|
+
return null;
|
|
91294
|
+
}
|
|
91295
|
+
if (max !== undefined && value > max) {
|
|
91296
|
+
console.error(`Invalid ${label}: ${raw}. Maximum is ${max}, e.g. ${example}`);
|
|
91297
|
+
process.exitCode = 1;
|
|
91298
|
+
return null;
|
|
91299
|
+
}
|
|
91300
|
+
return value;
|
|
91301
|
+
}
|
|
91302
|
+
var ARTIFACT_LIST_LIMIT_MAX = 100;
|
|
90954
91303
|
function registerCommands(cli) {
|
|
90955
91304
|
cli.command("init", "Initialize or update Takumi project (with interactive version selection)").option("--dir <dir>", "Target directory (default: .)").option("--kit <kit>", "Kit(s) to install (core, extras). Repeat the flag to install multiple kits, e.g. --kit core --kit extras.").option("-r, --release <version>", "Skip version selection, use specific version (e.g., latest, v1.0.0)").option("--exclude <pattern>", "Exclude files matching glob pattern (can be used multiple times)").option("--only <pattern>", "Include only files matching glob pattern (can be used multiple times)").option("--skill-role <role>", "Install only skills tagged with these role(s) (comma-separated or repeatable). Combines with --skill-category as a union.").option("--skill-category <category>", "Install only skills in these categor(y/ies) (comma-separated or repeatable). Combines with --skill-role as a union.").option("-g, --global", "Use platform-specific user configuration directory").option("--fresh", "Full reset: remove takumi files, replace settings.json and CLAUDE.md, reinstall from scratch").option("--force", "Force reinstall even if already at latest version (use with --yes; re-onboards missing files without full reset)").option("--install-skills", "Install skills dependencies (non-interactive mode)").option("--install-hooks", "Install all agent hooks (guard, session, convention, extension). Default installs only telemetry hooks.").option("--with-sudo", "Include system packages requiring sudo (Linux: ffmpeg, imagemagick)").option("--prefix", "Add /tkm: prefix to all slash commands by moving them to commands/tkm/ subdirectory").option("--beta", "Show beta versions in selection prompt").option("--refresh", "Bypass release cache to fetch latest versions from GitHub").option("--dry-run", "Preview changes without applying them (requires --prefix)").option("--force-overwrite", "Override ownership protections and delete user-modified files (requires --prefix)").option("--force-overwrite-settings", "Fully replace settings.json instead of selective merge (destroys user customizations)").option("--docs-dir <name>", "Custom docs folder name (default: docs)").option("--plans-dir <name>", "Custom plans folder name (default: plans)").option("-y, --yes", "Non-interactive mode with sensible defaults (skip all prompts)").option("--sync", "Sync config files from upstream with interactive hunk-by-hunk merge").option("--use-git", "Use git clone instead of GitHub API (uses SSH/HTTPS credentials)").option("--archive <path>", "Use local archive file instead of downloading (zip/tar.gz)").option("--kit-path <path>", "Use local kit directory instead of downloading").option("--local", "Use local monorepo as kit source (auto-detects from CLI location)").option("--use-gh", "Force GitHub release source (bypass the Worker release distribution API; default uses Worker)").option("-a, --agent <agents...>", "Target agents (claude-code, codex). Default: claude-code").action(async (options2) => {
|
|
90956
91305
|
if (options2.exclude && !Array.isArray(options2.exclude)) {
|
|
@@ -91059,14 +91408,17 @@ function registerCommands(cli) {
|
|
|
91059
91408
|
cli.command("api [action] [service] [path]", "Interact with Takumi API and proxy services").option("--method <method>", "HTTP method for proxy requests (default: GET)").option("--body <json>", "Request body as JSON string (proxy only)").option("--query <json>", "Query params as JSON string (proxy only)").option("--key <key>", "API key to use (setup only)").option("--force", "Force re-setup even if key exists (setup only)").option("--json", "Output raw JSON instead of formatted display").option("--locale <locale>", "Locale for vidcap summary/caption (default: en)").option("--max-results <n>", "Max results for vidcap search").option("--second <s>", "Timestamp in seconds for vidcap screenshot").option("--order <order>", "Sort order for vidcap comments (time/relevance)").option("--format <fmt>", "Summary format for reviewweb (bullet/paragraph)").option("--max-length <n>", "Max summary length for reviewweb").option("--instructions <text>", "Extraction instructions for reviewweb extract").option("--template <json>", "JSON template for reviewweb extract").option("--type <type>", "Link type filter for reviewweb links (web/image/file/all)").option("--country <code>", "Country code for reviewweb SEO commands").action(async (action, service, path11, options2) => {
|
|
91060
91409
|
await apiCommand(action, service, path11, options2);
|
|
91061
91410
|
});
|
|
91062
|
-
cli.command("artifact [action] [target]", "Manage Takumi artifacts (upload <file> | download <uuid|url> | delete <uuid|url>)").option("--id <uuid|url>", "Existing artifact (UUID or viewer URL) to overwrite on upload").option("--title <title>", "Display title for the artifact (max 200 chars)").option("-m, --message <message>", "Short note describing this version's change (max 100 chars)").option("-o, --output <dir>", "(download) Output directory; default: slug(title) or uuid in CWD").option("--ver <n>", "Version number (download: download it; delete: delete only that version)").option("--force", "(download) Allow writing into a non-empty directory").option("-y, --yes", "Skip delete confirmation prompt").action(async (action, target, opts) => {
|
|
91063
|
-
const version3 = opts.ver
|
|
91064
|
-
if (version3
|
|
91065
|
-
console.error(`Invalid version: ${opts.ver}. Use a positive integer, e.g. --ver 2`);
|
|
91066
|
-
process.exitCode = 1;
|
|
91411
|
+
cli.command("artifact [action] [target]", "Manage Takumi artifacts (list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url>)").option("--id <uuid|url>", "Existing artifact (UUID or viewer URL) to overwrite on upload").option("--title <title>", "Display title for the artifact (max 200 chars)").option("-m, --message <message>", "Short note describing this version's change (max 100 chars)").option("-o, --output <dir>", "(download) Output directory; default: slug(title) or uuid in CWD").option("--ver <n>", "Version number (download: download it; delete: delete only that version)").option("--force", "(download) Allow writing into a non-empty directory").option("-y, --yes", "Skip delete confirmation prompt").option("--access <level>", "(list) Filter by access level: private | restricted | organization").option("--page <n>", "(list) Page number, 1-based (default: 1)").option("--limit <n>", "(list) Rows per page, max 100 (default: 10)").option("--json", "(list/search) Machine-readable JSON output").action(async (action, target, opts) => {
|
|
91412
|
+
const version3 = parsePositiveIntFlag(opts.ver, "version", "--ver 2");
|
|
91413
|
+
if (version3 === null)
|
|
91067
91414
|
return;
|
|
91068
|
-
|
|
91069
|
-
|
|
91415
|
+
const page = parsePositiveIntFlag(opts.page, "page", "--page 2");
|
|
91416
|
+
if (page === null)
|
|
91417
|
+
return;
|
|
91418
|
+
const limit = parsePositiveIntFlag(opts.limit, "limit", "--limit 25", ARTIFACT_LIST_LIMIT_MAX);
|
|
91419
|
+
if (limit === null)
|
|
91420
|
+
return;
|
|
91421
|
+
await artifactCommand(action, target, { ...opts, version: version3, page, limit });
|
|
91070
91422
|
});
|
|
91071
91423
|
cli.command("auth [action]", "Sign in/out, refresh, and check Takumi session (login|logout|refresh|status)").option("--json", "Machine-readable JSON output (status, refresh)").option("-f, --force", "Force a token refresh even when the current token is still valid (refresh only)").action(async (action, options2 = {}) => {
|
|
91072
91424
|
switch (action) {
|
|
@@ -91241,7 +91593,7 @@ function getPackageVersion3() {
|
|
|
91241
91593
|
|
|
91242
91594
|
// src/shared/logger.ts
|
|
91243
91595
|
init_output_manager();
|
|
91244
|
-
var
|
|
91596
|
+
var import_picocolors33 = __toESM(require_picocolors(), 1);
|
|
91245
91597
|
import { createWriteStream as createWriteStream4 } from "node:fs";
|
|
91246
91598
|
|
|
91247
91599
|
class Logger2 {
|
|
@@ -91250,23 +91602,23 @@ class Logger2 {
|
|
|
91250
91602
|
exitHandlerRegistered = false;
|
|
91251
91603
|
info(message) {
|
|
91252
91604
|
const symbols = output.getSymbols();
|
|
91253
|
-
console.log(
|
|
91605
|
+
console.log(import_picocolors33.default.blue(symbols.info), message);
|
|
91254
91606
|
}
|
|
91255
91607
|
success(message) {
|
|
91256
91608
|
const symbols = output.getSymbols();
|
|
91257
|
-
console.log(
|
|
91609
|
+
console.log(import_picocolors33.default.green(symbols.success), message);
|
|
91258
91610
|
}
|
|
91259
91611
|
warning(message) {
|
|
91260
91612
|
const symbols = output.getSymbols();
|
|
91261
|
-
console.log(
|
|
91613
|
+
console.log(import_picocolors33.default.yellow(symbols.warning), message);
|
|
91262
91614
|
}
|
|
91263
91615
|
error(message) {
|
|
91264
91616
|
const symbols = output.getSymbols();
|
|
91265
|
-
console.error(
|
|
91617
|
+
console.error(import_picocolors33.default.red(symbols.error), message);
|
|
91266
91618
|
}
|
|
91267
91619
|
debug(message) {
|
|
91268
91620
|
if (process.env.DEBUG) {
|
|
91269
|
-
console.log(
|
|
91621
|
+
console.log(import_picocolors33.default.gray("[DEBUG]"), message);
|
|
91270
91622
|
}
|
|
91271
91623
|
}
|
|
91272
91624
|
verbose(message, context) {
|
|
@@ -91275,7 +91627,7 @@ class Logger2 {
|
|
|
91275
91627
|
const timestamp = this.getTimestamp();
|
|
91276
91628
|
const sanitizedMessage = this.sanitize(message);
|
|
91277
91629
|
const formattedContext = context ? this.formatContext(context) : "";
|
|
91278
|
-
const logLine = `${timestamp} ${
|
|
91630
|
+
const logLine = `${timestamp} ${import_picocolors33.default.gray("[VERBOSE]")} ${sanitizedMessage}${formattedContext}`;
|
|
91279
91631
|
console.error(logLine);
|
|
91280
91632
|
if (this.logFileStream) {
|
|
91281
91633
|
const plainLogLine = `${timestamp} [VERBOSE] ${sanitizedMessage}${formattedContext}`;
|
|
@@ -91378,7 +91730,7 @@ var logger3 = new Logger2;
|
|
|
91378
91730
|
|
|
91379
91731
|
// src/shared/output-manager.ts
|
|
91380
91732
|
init_terminal_utils();
|
|
91381
|
-
var
|
|
91733
|
+
var import_picocolors34 = __toESM(require_picocolors(), 1);
|
|
91382
91734
|
var SYMBOLS2 = {
|
|
91383
91735
|
unicode: {
|
|
91384
91736
|
prompt: "◇",
|
|
@@ -91459,7 +91811,7 @@ class OutputManager2 {
|
|
|
91459
91811
|
if (this.config.quiet)
|
|
91460
91812
|
return;
|
|
91461
91813
|
const symbol = this.getSymbols().success;
|
|
91462
|
-
console.log(
|
|
91814
|
+
console.log(import_picocolors34.default.green(`${symbol} ${message}`));
|
|
91463
91815
|
}
|
|
91464
91816
|
error(message, data) {
|
|
91465
91817
|
if (this.config.json) {
|
|
@@ -91467,7 +91819,7 @@ class OutputManager2 {
|
|
|
91467
91819
|
return;
|
|
91468
91820
|
}
|
|
91469
91821
|
const symbol = this.getSymbols().error;
|
|
91470
|
-
console.error(
|
|
91822
|
+
console.error(import_picocolors34.default.red(`${symbol} ${message}`));
|
|
91471
91823
|
}
|
|
91472
91824
|
warning(message, data) {
|
|
91473
91825
|
if (this.config.json) {
|
|
@@ -91477,7 +91829,7 @@ class OutputManager2 {
|
|
|
91477
91829
|
if (this.config.quiet)
|
|
91478
91830
|
return;
|
|
91479
91831
|
const symbol = this.getSymbols().warning;
|
|
91480
|
-
console.log(
|
|
91832
|
+
console.log(import_picocolors34.default.yellow(`${symbol} ${message}`));
|
|
91481
91833
|
}
|
|
91482
91834
|
info(message, data) {
|
|
91483
91835
|
if (this.config.json) {
|
|
@@ -91487,7 +91839,7 @@ class OutputManager2 {
|
|
|
91487
91839
|
if (this.config.quiet)
|
|
91488
91840
|
return;
|
|
91489
91841
|
const symbol = this.getSymbols().info;
|
|
91490
|
-
console.log(
|
|
91842
|
+
console.log(import_picocolors34.default.blue(`${symbol} ${message}`));
|
|
91491
91843
|
}
|
|
91492
91844
|
verbose(message, data) {
|
|
91493
91845
|
if (!this.config.verbose)
|
|
@@ -91496,7 +91848,7 @@ class OutputManager2 {
|
|
|
91496
91848
|
this.addJsonEntry({ type: "info", message, data });
|
|
91497
91849
|
return;
|
|
91498
91850
|
}
|
|
91499
|
-
console.log(
|
|
91851
|
+
console.log(import_picocolors34.default.dim(` ${message}`));
|
|
91500
91852
|
}
|
|
91501
91853
|
indent(message) {
|
|
91502
91854
|
if (this.config.json)
|
|
@@ -91521,7 +91873,7 @@ class OutputManager2 {
|
|
|
91521
91873
|
return;
|
|
91522
91874
|
const symbols = this.getSymbols();
|
|
91523
91875
|
console.log();
|
|
91524
|
-
console.log(
|
|
91876
|
+
console.log(import_picocolors34.default.bold(import_picocolors34.default.cyan(`${symbols.line} ${title}`)));
|
|
91525
91877
|
}
|
|
91526
91878
|
addJsonEntry(entry) {
|
|
91527
91879
|
this.jsonBuffer.push({
|