@sunasteriskrnd/takumi 1.0.0-dev.64 → 1.0.0-dev.65
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 +276 -38
- package/package.json +1 -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.65",
|
|
19819
19819
|
description: "CLI tool for bootstrapping and managing Takumi projects",
|
|
19820
19820
|
type: "module",
|
|
19821
19821
|
repository: {
|
|
@@ -20012,7 +20012,7 @@ function getLegacyManifestPath(providerRoot) {
|
|
|
20012
20012
|
return join4(providerRoot, LEGACY_MANIFEST_FILENAME);
|
|
20013
20013
|
}
|
|
20014
20014
|
function getCliVersion() {
|
|
20015
|
-
return "1.0.0-dev.
|
|
20015
|
+
return "1.0.0-dev.65"?.trim() || process.env.npm_package_version?.trim() || "unknown";
|
|
20016
20016
|
}
|
|
20017
20017
|
function getCliUserAgent() {
|
|
20018
20018
|
return `${TAKUMI_CLI_NPM_PACKAGE_NAME}/${getCliVersion()}`;
|
|
@@ -51450,6 +51450,10 @@ var init_artifact_action_help = __esm(() => {
|
|
|
51450
51450
|
{
|
|
51451
51451
|
flags: "-m, --message <message>",
|
|
51452
51452
|
description: "Short note describing this version's change (max 100 chars)"
|
|
51453
|
+
},
|
|
51454
|
+
{
|
|
51455
|
+
flags: "--open",
|
|
51456
|
+
description: "Open the artifact in the browser after a successful upload"
|
|
51453
51457
|
}
|
|
51454
51458
|
]
|
|
51455
51459
|
}
|
|
@@ -51692,15 +51696,65 @@ var init_artifact_comments_help = __esm(() => {
|
|
|
51692
51696
|
};
|
|
51693
51697
|
});
|
|
51694
51698
|
|
|
51699
|
+
// src/domains/help/commands/artifact-open-help.ts
|
|
51700
|
+
var artifactOpenHelp;
|
|
51701
|
+
var init_artifact_open_help = __esm(() => {
|
|
51702
|
+
artifactOpenHelp = {
|
|
51703
|
+
name: "artifact open",
|
|
51704
|
+
description: "Open the artifact viewer (or the dashboard with no ref) in the browser",
|
|
51705
|
+
usage: "tkm artifact open [uuid|url] [options]",
|
|
51706
|
+
examples: [
|
|
51707
|
+
{
|
|
51708
|
+
command: "tkm artifact open",
|
|
51709
|
+
description: "Open the artifacts dashboard (no artifact reference)"
|
|
51710
|
+
},
|
|
51711
|
+
{
|
|
51712
|
+
command: "tkm artifact open <uuid|url>",
|
|
51713
|
+
description: "Open the latest version of an artifact in the viewer"
|
|
51714
|
+
},
|
|
51715
|
+
{
|
|
51716
|
+
command: "tkm artifact open <uuid|url> --ver 3 --file README.md",
|
|
51717
|
+
description: "Deep-link to version 3 and a specific file inside the artifact"
|
|
51718
|
+
}
|
|
51719
|
+
],
|
|
51720
|
+
optionGroups: [
|
|
51721
|
+
{
|
|
51722
|
+
title: "Options",
|
|
51723
|
+
options: [
|
|
51724
|
+
{
|
|
51725
|
+
flags: "--ver <n>",
|
|
51726
|
+
description: "Version to open. ?v=<n> in a pasted URL works too; --ver wins when both given"
|
|
51727
|
+
},
|
|
51728
|
+
{
|
|
51729
|
+
flags: "--file <path>",
|
|
51730
|
+
description: "Deep-link to a file INSIDE the artifact (not a local file — contrast with `comments reply --file`, which reads a local file's contents)"
|
|
51731
|
+
},
|
|
51732
|
+
{
|
|
51733
|
+
flags: "--thread <uuid>",
|
|
51734
|
+
description: "Deep-link to a comment thread by id"
|
|
51735
|
+
}
|
|
51736
|
+
]
|
|
51737
|
+
}
|
|
51738
|
+
],
|
|
51739
|
+
sections: [
|
|
51740
|
+
{
|
|
51741
|
+
title: "Notes",
|
|
51742
|
+
content: "Makes no API calls — an invalid reference is rejected locally, and a valid-looking but nonexistent artifact simply 404s in the browser."
|
|
51743
|
+
}
|
|
51744
|
+
]
|
|
51745
|
+
};
|
|
51746
|
+
});
|
|
51747
|
+
|
|
51695
51748
|
// src/domains/help/commands/artifact-command-help.ts
|
|
51696
51749
|
var artifactCommandHelp;
|
|
51697
51750
|
var init_artifact_command_help = __esm(() => {
|
|
51698
51751
|
init_artifact_action_help();
|
|
51699
51752
|
init_artifact_comments_help();
|
|
51753
|
+
init_artifact_open_help();
|
|
51700
51754
|
artifactCommandHelp = {
|
|
51701
51755
|
name: "artifact",
|
|
51702
|
-
description: "List, search, upload, download, and
|
|
51703
|
-
usage: "tkm artifact <list | search <term> | upload <file|dir> | download <uuid|url> | delete <uuid|url> | comments <verb> <uuid|url> [id]>",
|
|
51756
|
+
description: "List, search, upload, download, delete, and open Takumi artifacts, and work with their review comments",
|
|
51757
|
+
usage: "tkm artifact <list | search <term> | upload <file|dir> | download <uuid|url> | delete <uuid|url> | open [uuid|url] | comments <verb> <uuid|url> [id]>",
|
|
51704
51758
|
examples: [
|
|
51705
51759
|
{
|
|
51706
51760
|
command: "tkm artifact upload ./report.html --title 'Weekly Report'",
|
|
@@ -51739,6 +51793,10 @@ var init_artifact_command_help = __esm(() => {
|
|
|
51739
51793
|
flags: "delete <uuid|url>",
|
|
51740
51794
|
description: "Soft-delete the whole artifact, or one version with --ver <n>"
|
|
51741
51795
|
},
|
|
51796
|
+
{
|
|
51797
|
+
flags: "open [uuid|url]",
|
|
51798
|
+
description: "Open the viewer (or dashboard with no ref) in the browser"
|
|
51799
|
+
},
|
|
51742
51800
|
{
|
|
51743
51801
|
flags: "comments <verb> <uuid|url> [id]",
|
|
51744
51802
|
description: "Read and act on review comments (list|reply|solve|reopen|delete)"
|
|
@@ -51758,6 +51816,7 @@ var init_artifact_command_help = __esm(() => {
|
|
|
51758
51816
|
upload: artifactUploadHelp,
|
|
51759
51817
|
download: artifactDownloadHelp,
|
|
51760
51818
|
delete: artifactDeleteHelp,
|
|
51819
|
+
open: artifactOpenHelp,
|
|
51761
51820
|
comments: artifactCommentsHelp
|
|
51762
51821
|
}
|
|
51763
51822
|
};
|
|
@@ -51842,6 +51901,7 @@ var init_commands2 = __esm(() => {
|
|
|
51842
51901
|
init_artifact_command_help();
|
|
51843
51902
|
init_artifact_comments_help();
|
|
51844
51903
|
init_artifact_action_help();
|
|
51904
|
+
init_artifact_open_help();
|
|
51845
51905
|
init_mcp_command_help();
|
|
51846
51906
|
init_common_options();
|
|
51847
51907
|
});
|
|
@@ -53967,38 +54027,83 @@ function showApiHelp() {
|
|
|
53967
54027
|
console.log(" takumi api reviewweb seo-backlinks <domain> SEO backlinks");
|
|
53968
54028
|
console.log();
|
|
53969
54029
|
}
|
|
54030
|
+
// src/commands/artifact/action-flag-scope.ts
|
|
54031
|
+
var ACTION_SCOPED_FLAGS = {
|
|
54032
|
+
comments: ["status", "author", "cursor", "quiet", "file"],
|
|
54033
|
+
open: ["file", "thread"],
|
|
54034
|
+
upload: ["open", "id"]
|
|
54035
|
+
};
|
|
54036
|
+
var ALL_SCOPED_FLAGS = Array.from(new Set(Object.values(ACTION_SCOPED_FLAGS).flat()));
|
|
54037
|
+
function owningActions(flag) {
|
|
54038
|
+
return Object.entries(ACTION_SCOPED_FLAGS).filter(([, flags]) => flags.includes(flag)).map(([owner]) => `\`artifact ${owner}\``);
|
|
54039
|
+
}
|
|
54040
|
+
function strayFlagDetail(action, opts) {
|
|
54041
|
+
const allowed = ACTION_SCOPED_FLAGS[action] ?? [];
|
|
54042
|
+
const stray = ALL_SCOPED_FLAGS.filter((flag) => !allowed.includes(flag) && opts[flag] !== undefined && opts[flag] !== false);
|
|
54043
|
+
if (stray.length === 0)
|
|
54044
|
+
return null;
|
|
54045
|
+
return stray.map((flag) => `--${flag} (only ${owningActions(flag).join(" or ")})`).join(", ");
|
|
54046
|
+
}
|
|
54047
|
+
|
|
53970
54048
|
// src/commands/artifact/refs.ts
|
|
53971
54049
|
init_auth_client();
|
|
53972
54050
|
var UUID_V4_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
53973
54051
|
function isArtifactUuid(id) {
|
|
53974
|
-
return UUID_V4_RE.test(id.trim());
|
|
54052
|
+
return UUID_V4_RE.test(String(id).trim());
|
|
53975
54053
|
}
|
|
53976
54054
|
function parseArtifactRef(input) {
|
|
53977
|
-
const s = input.trim();
|
|
54055
|
+
const s = String(input).trim();
|
|
53978
54056
|
if (UUID_V4_RE.test(s))
|
|
53979
54057
|
return s.toLowerCase();
|
|
53980
54058
|
const m2 = s.match(/\/artifacts\/([^/?#]+)/i);
|
|
53981
54059
|
const candidate = m2?.[1] ?? "";
|
|
53982
54060
|
return UUID_V4_RE.test(candidate) ? candidate.toLowerCase() : null;
|
|
53983
54061
|
}
|
|
53984
|
-
|
|
53985
|
-
|
|
53986
|
-
const url = new URL(ref.trim());
|
|
53987
|
-
const v2 = url.searchParams.get("v");
|
|
53988
|
-
if (v2 !== null) {
|
|
53989
|
-
const n = Number.parseInt(v2, 10);
|
|
53990
|
-
return Number.isFinite(n) && n > 0 ? n : undefined;
|
|
53991
|
-
}
|
|
53992
|
-
} catch {}
|
|
53993
|
-
return;
|
|
53994
|
-
}
|
|
53995
|
-
function warnIfHostMismatch(input) {
|
|
53996
|
-
let inputUrl;
|
|
54062
|
+
var HOST_FIRST_RE = /^[a-z0-9][a-z0-9.-]*(:\d+)?\//i;
|
|
54063
|
+
function tryUrl(s) {
|
|
53997
54064
|
try {
|
|
53998
|
-
|
|
54065
|
+
return new URL(s);
|
|
53999
54066
|
} catch {
|
|
54067
|
+
return null;
|
|
54068
|
+
}
|
|
54069
|
+
}
|
|
54070
|
+
function toUrl(ref) {
|
|
54071
|
+
const s = String(ref).trim();
|
|
54072
|
+
if (!s.includes("/"))
|
|
54073
|
+
return null;
|
|
54074
|
+
const direct = tryUrl(s);
|
|
54075
|
+
if (direct && /^https?:$/.test(direct.protocol))
|
|
54076
|
+
return direct;
|
|
54077
|
+
return HOST_FIRST_RE.test(s) ? tryUrl(`https://${s}`) : null;
|
|
54078
|
+
}
|
|
54079
|
+
function extractVersionFromRef(ref) {
|
|
54080
|
+
const url = toUrl(ref);
|
|
54081
|
+
if (!url)
|
|
54000
54082
|
return;
|
|
54083
|
+
const v2 = url.searchParams.get("v");
|
|
54084
|
+
if (v2 === null || !/^[1-9]\d*$/.test(v2.trim()))
|
|
54085
|
+
return;
|
|
54086
|
+
return Number(v2);
|
|
54087
|
+
}
|
|
54088
|
+
function extractDeepLinkFromRef(ref) {
|
|
54089
|
+
const url = toUrl(ref);
|
|
54090
|
+
if (!url)
|
|
54091
|
+
return {};
|
|
54092
|
+
const parts = {};
|
|
54093
|
+
const file = url.searchParams.get("file");
|
|
54094
|
+
if (file !== null && file.trim() !== "") {
|
|
54095
|
+
parts.file = file;
|
|
54001
54096
|
}
|
|
54097
|
+
const thread = url.searchParams.get("thread");
|
|
54098
|
+
if (thread !== null && thread.trim() !== "") {
|
|
54099
|
+
parts.thread = thread;
|
|
54100
|
+
}
|
|
54101
|
+
return parts;
|
|
54102
|
+
}
|
|
54103
|
+
function warnIfHostMismatch(input) {
|
|
54104
|
+
const inputUrl = toUrl(input);
|
|
54105
|
+
if (!inputUrl)
|
|
54106
|
+
return;
|
|
54002
54107
|
let serverHost;
|
|
54003
54108
|
try {
|
|
54004
54109
|
serverHost = new URL(getServerUrl()).host;
|
|
@@ -55140,6 +55245,100 @@ async function artifactList(term, opts) {
|
|
|
55140
55245
|
logger.info(footerLine2(payload));
|
|
55141
55246
|
}
|
|
55142
55247
|
|
|
55248
|
+
// src/domains/sessions/browser-open.ts
|
|
55249
|
+
init_open();
|
|
55250
|
+
function tryOpenBrowser(target) {
|
|
55251
|
+
open_default(target).catch(() => {});
|
|
55252
|
+
}
|
|
55253
|
+
|
|
55254
|
+
// src/commands/artifact/open-in-browser.ts
|
|
55255
|
+
init_environment();
|
|
55256
|
+
function openOrPrint(url, opts) {
|
|
55257
|
+
console.log(url);
|
|
55258
|
+
if (isNonInteractive()) {
|
|
55259
|
+
return;
|
|
55260
|
+
}
|
|
55261
|
+
(opts?._openBrowser ?? tryOpenBrowser)(url);
|
|
55262
|
+
}
|
|
55263
|
+
|
|
55264
|
+
// src/commands/artifact/viewer-url.ts
|
|
55265
|
+
init_auth_client();
|
|
55266
|
+
function buildViewerUrl(parts) {
|
|
55267
|
+
const base = getServerUrl();
|
|
55268
|
+
if (!parts.uuid) {
|
|
55269
|
+
return `${base}/app/artifacts`;
|
|
55270
|
+
}
|
|
55271
|
+
const params = new URLSearchParams;
|
|
55272
|
+
const entries = [
|
|
55273
|
+
["v", parts.version],
|
|
55274
|
+
["file", parts.file],
|
|
55275
|
+
["thread", parts.thread]
|
|
55276
|
+
];
|
|
55277
|
+
for (const [key, value] of entries) {
|
|
55278
|
+
if (value !== undefined && String(value) !== "") {
|
|
55279
|
+
params.set(key, String(value));
|
|
55280
|
+
}
|
|
55281
|
+
}
|
|
55282
|
+
const query = params.toString();
|
|
55283
|
+
return `${base}/app/artifacts/${parts.uuid}${query ? `?${query}` : ""}`;
|
|
55284
|
+
}
|
|
55285
|
+
|
|
55286
|
+
// src/commands/artifact/open-command.ts
|
|
55287
|
+
function singleValue(label, value) {
|
|
55288
|
+
if (Array.isArray(value)) {
|
|
55289
|
+
console.error(`${label} may only be given once`);
|
|
55290
|
+
process.exitCode = 1;
|
|
55291
|
+
return null;
|
|
55292
|
+
}
|
|
55293
|
+
return String(value).trim();
|
|
55294
|
+
}
|
|
55295
|
+
function normalizeFilePath(file) {
|
|
55296
|
+
return file.replace(/\\/g, "/").replace(/^(\.\/|\/)+/, "");
|
|
55297
|
+
}
|
|
55298
|
+
async function artifactOpen(ref, opts) {
|
|
55299
|
+
if (ref === undefined) {
|
|
55300
|
+
if (opts.version !== undefined || opts.file !== undefined || opts.thread !== undefined) {
|
|
55301
|
+
console.error("tkm artifact open — --ver/--file/--thread require an artifact reference");
|
|
55302
|
+
process.exitCode = 1;
|
|
55303
|
+
return;
|
|
55304
|
+
}
|
|
55305
|
+
openOrPrint(buildViewerUrl({}), opts);
|
|
55306
|
+
return;
|
|
55307
|
+
}
|
|
55308
|
+
const uuid = parseArtifactRef(ref);
|
|
55309
|
+
if (!uuid) {
|
|
55310
|
+
console.error(`Invalid artifact id or URL: ${ref}`);
|
|
55311
|
+
process.exitCode = 1;
|
|
55312
|
+
return;
|
|
55313
|
+
}
|
|
55314
|
+
const version3 = opts.version ?? extractVersionFromRef(ref);
|
|
55315
|
+
const deep = extractDeepLinkFromRef(ref);
|
|
55316
|
+
const rawFile = opts.file ?? deep.file;
|
|
55317
|
+
let file;
|
|
55318
|
+
if (rawFile !== undefined) {
|
|
55319
|
+
const single = singleValue("--file", rawFile);
|
|
55320
|
+
if (single === null)
|
|
55321
|
+
return;
|
|
55322
|
+
file = normalizeFilePath(single);
|
|
55323
|
+
}
|
|
55324
|
+
const rawThread = opts.thread ?? deep.thread;
|
|
55325
|
+
let thread;
|
|
55326
|
+
if (rawThread !== undefined) {
|
|
55327
|
+
const single = singleValue("--thread", rawThread);
|
|
55328
|
+
if (single === null)
|
|
55329
|
+
return;
|
|
55330
|
+
if (!isArtifactUuid(single)) {
|
|
55331
|
+
console.error(`Invalid thread id (must be a UUID): ${single}`);
|
|
55332
|
+
process.exitCode = 1;
|
|
55333
|
+
return;
|
|
55334
|
+
}
|
|
55335
|
+
thread = single.toLowerCase();
|
|
55336
|
+
}
|
|
55337
|
+
warnIfHostMismatch(ref);
|
|
55338
|
+
const url = buildViewerUrl({ uuid, version: version3, file, thread });
|
|
55339
|
+
openOrPrint(url, opts);
|
|
55340
|
+
}
|
|
55341
|
+
|
|
55143
55342
|
// src/commands/artifact/upload-command.ts
|
|
55144
55343
|
init_dist2();
|
|
55145
55344
|
import { promises as fs14 } from "node:fs";
|
|
@@ -55273,6 +55472,13 @@ async function artifactUpload(filePath, opts) {
|
|
|
55273
55472
|
process.exitCode = 1;
|
|
55274
55473
|
}
|
|
55275
55474
|
}
|
|
55475
|
+
function printResultUrl(url, opts) {
|
|
55476
|
+
if (opts.open) {
|
|
55477
|
+
openOrPrint(url, opts);
|
|
55478
|
+
} else {
|
|
55479
|
+
console.log(url);
|
|
55480
|
+
}
|
|
55481
|
+
}
|
|
55276
55482
|
async function uploadFile(absPath, displayPath, size, token, opts) {
|
|
55277
55483
|
const ext = extname6(absPath).toLowerCase().slice(1);
|
|
55278
55484
|
if (!ALLOWED_EXTENSIONS.has(ext)) {
|
|
@@ -55349,7 +55555,7 @@ async function uploadFile(absPath, displayPath, size, token, opts) {
|
|
|
55349
55555
|
await upsertFolderEntry(absPath, result.uuid, result.version, folderHash);
|
|
55350
55556
|
spinner.stop("Uploaded.");
|
|
55351
55557
|
printUploadSummary(summary);
|
|
55352
|
-
|
|
55558
|
+
printResultUrl(result.url, opts);
|
|
55353
55559
|
}
|
|
55354
55560
|
async function uploadFolder(absPath, displayPath, token, opts) {
|
|
55355
55561
|
const spinner = de();
|
|
@@ -55464,15 +55670,23 @@ async function uploadFolder(absPath, displayPath, token, opts) {
|
|
|
55464
55670
|
await upsertFolderEntry(absPath, result.uuid, result.version, folderHash);
|
|
55465
55671
|
spinner.stop("Uploaded.");
|
|
55466
55672
|
printUploadSummary(summary);
|
|
55467
|
-
|
|
55673
|
+
printResultUrl(result.url, opts);
|
|
55468
55674
|
}
|
|
55469
55675
|
|
|
55470
55676
|
// src/commands/artifact/artifact-command.ts
|
|
55677
|
+
var ARTIFACT_ACTIONS = new Set([
|
|
55678
|
+
"list",
|
|
55679
|
+
"search",
|
|
55680
|
+
"upload",
|
|
55681
|
+
"download",
|
|
55682
|
+
"delete",
|
|
55683
|
+
"open",
|
|
55684
|
+
"comments"
|
|
55685
|
+
]);
|
|
55471
55686
|
function usageError2(hint) {
|
|
55472
55687
|
console.error(`Usage: ${hint}`);
|
|
55473
55688
|
process.exitCode = 1;
|
|
55474
55689
|
}
|
|
55475
|
-
var COMMENTS_ONLY_FLAGS = ["status", "author", "cursor", "quiet", "file"];
|
|
55476
55690
|
async function artifactCommand(action, target, ...rest) {
|
|
55477
55691
|
if (rest.length !== 1 && rest.length !== 3) {
|
|
55478
55692
|
throw new TypeError(`artifactCommand: expected 3 or 5 arguments, received ${rest.length + 2}`);
|
|
@@ -55480,13 +55694,13 @@ async function artifactCommand(action, target, ...rest) {
|
|
|
55480
55694
|
const opts = rest[rest.length - 1];
|
|
55481
55695
|
const arg3 = rest.length === 3 ? rest[0] : undefined;
|
|
55482
55696
|
const arg4 = rest.length === 3 ? rest[1] : undefined;
|
|
55483
|
-
if (action !== undefined && action
|
|
55484
|
-
if (arg3 !== undefined && arg3 !== null) {
|
|
55697
|
+
if (action !== undefined && ARTIFACT_ACTIONS.has(action)) {
|
|
55698
|
+
if (action !== "comments" && arg3 !== undefined && arg3 !== null) {
|
|
55485
55699
|
return usageError2(`tkm artifact ${action} — unexpected extra argument "${arg3}"`);
|
|
55486
55700
|
}
|
|
55487
|
-
const
|
|
55488
|
-
if (
|
|
55489
|
-
return usageError2(`tkm artifact ${action} — ${
|
|
55701
|
+
const detail = strayFlagDetail(action, opts);
|
|
55702
|
+
if (detail !== null) {
|
|
55703
|
+
return usageError2(`tkm artifact ${action} — ${detail}`);
|
|
55490
55704
|
}
|
|
55491
55705
|
}
|
|
55492
55706
|
switch (action) {
|
|
@@ -55522,11 +55736,14 @@ async function artifactCommand(action, target, ...rest) {
|
|
|
55522
55736
|
}
|
|
55523
55737
|
await commentsCommand(target, arg3, arg4, opts);
|
|
55524
55738
|
break;
|
|
55739
|
+
case "open":
|
|
55740
|
+
await artifactOpen(target, opts);
|
|
55741
|
+
break;
|
|
55525
55742
|
case undefined:
|
|
55526
|
-
usageError2("tkm artifact <list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url> [--ver <n>] | comments <verb> <ref> [id]>");
|
|
55743
|
+
usageError2("tkm artifact <list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url> [--ver <n>] | open [uuid|url] | comments <verb> <ref> [id]>");
|
|
55527
55744
|
break;
|
|
55528
55745
|
default:
|
|
55529
|
-
console.error(`Unknown artifact action: ${action}. Available: list, search, upload, download, delete, comments`);
|
|
55746
|
+
console.error(`Unknown artifact action: ${action}. Available: list, search, upload, download, delete, open, comments`);
|
|
55530
55747
|
process.exitCode = 1;
|
|
55531
55748
|
}
|
|
55532
55749
|
}
|
|
@@ -56146,12 +56363,6 @@ async function configCommand(action, keyOrOptions, valueOrOptions, options2) {
|
|
|
56146
56363
|
};
|
|
56147
56364
|
return configUICommand(uiOpts);
|
|
56148
56365
|
}
|
|
56149
|
-
// src/domains/sessions/browser-open.ts
|
|
56150
|
-
init_open();
|
|
56151
|
-
function tryOpenBrowser(target) {
|
|
56152
|
-
open_default(target).catch(() => {});
|
|
56153
|
-
}
|
|
56154
|
-
|
|
56155
56366
|
// src/domains/sessions/server.ts
|
|
56156
56367
|
init_logger();
|
|
56157
56368
|
import * as http from "node:http";
|
|
@@ -92358,6 +92569,27 @@ function normalizeSkillGroupFlag(value) {
|
|
|
92358
92569
|
}
|
|
92359
92570
|
|
|
92360
92571
|
// src/cli/command-registry.ts
|
|
92572
|
+
var ARTIFACT_STRING_FLAGS = [
|
|
92573
|
+
"id",
|
|
92574
|
+
"title",
|
|
92575
|
+
"message",
|
|
92576
|
+
"output",
|
|
92577
|
+
"access",
|
|
92578
|
+
"status",
|
|
92579
|
+
"author",
|
|
92580
|
+
"cursor",
|
|
92581
|
+
"file",
|
|
92582
|
+
"thread"
|
|
92583
|
+
];
|
|
92584
|
+
function stringifyFlags(opts, keys) {
|
|
92585
|
+
const out = {};
|
|
92586
|
+
for (const key of keys) {
|
|
92587
|
+
const value = opts[key];
|
|
92588
|
+
if (value !== undefined && !Array.isArray(value))
|
|
92589
|
+
out[key] = String(value);
|
|
92590
|
+
}
|
|
92591
|
+
return out;
|
|
92592
|
+
}
|
|
92361
92593
|
function parsePositiveIntFlag(raw, label, example, max) {
|
|
92362
92594
|
if (raw === undefined)
|
|
92363
92595
|
return;
|
|
@@ -92488,7 +92720,7 @@ function registerCommands(cli) {
|
|
|
92488
92720
|
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) => {
|
|
92489
92721
|
await apiCommand(action, service, path11, options2);
|
|
92490
92722
|
});
|
|
92491
|
-
cli.command("artifact [action] [target] [arg3] [arg4]", "Manage Takumi artifacts (list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url> | comments <verb> <ref> [id])").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>", "(upload) Version note, max 100 chars · (comments reply) Comment body").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 · (comments list) Threads per page · max 100").option("--json", "Machine-readable JSON output (list/search/comments)").option("--status <status>", "(comments list) Filter by status: open | solved | all (default: open)").option("--author <author>", "(comments list) Filter by author name, email, or user id").option("--cursor <cursor>", "(comments list) Pagination cursor from a previous page").option("--quiet", "Print only ids, one per line (comments)").option("--file <path>", "(comments reply) Read the message body from this file").action(async (action, target, arg3, arg4, opts) => {
|
|
92723
|
+
cli.command("artifact [action] [target] [arg3] [arg4]", "Manage Takumi artifacts (list | search <term> | upload <file> | download <uuid|url> | delete <uuid|url> | open [uuid|url] | comments <verb> <ref> [id])").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>", "(upload) Version note, max 100 chars · (comments reply) Comment body").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; open: deep-link)").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 · (comments list) Threads per page · max 100").option("--json", "Machine-readable JSON output (list/search/comments)").option("--status <status>", "(comments list) Filter by status: open | solved | all (default: open)").option("--author <author>", "(comments list) Filter by author name, email, or user id").option("--cursor <cursor>", "(comments list) Pagination cursor from a previous page").option("--quiet", "Print only ids, one per line (comments)").option("--file <path>", "(open) Deep-link to a file · (comments reply) Read the message body from this file").option("--thread <uuid>", "(open) Deep-link to a comment thread").option("--open", "(upload) Open the artifact in the browser after a successful upload").action(async (action, target, arg3, arg4, opts) => {
|
|
92492
92724
|
const version3 = parsePositiveIntFlag(opts.ver, "version", "--ver 2");
|
|
92493
92725
|
if (version3 === null)
|
|
92494
92726
|
return;
|
|
@@ -92498,7 +92730,13 @@ function registerCommands(cli) {
|
|
|
92498
92730
|
const limit = parsePositiveIntFlag(opts.limit, "limit", "--limit 25", ARTIFACT_LIST_LIMIT_MAX);
|
|
92499
92731
|
if (limit === null)
|
|
92500
92732
|
return;
|
|
92501
|
-
await artifactCommand(action, target, arg3, arg4, {
|
|
92733
|
+
await artifactCommand(action, target, arg3, arg4, {
|
|
92734
|
+
...opts,
|
|
92735
|
+
...stringifyFlags(opts, ARTIFACT_STRING_FLAGS),
|
|
92736
|
+
version: version3,
|
|
92737
|
+
page,
|
|
92738
|
+
limit
|
|
92739
|
+
});
|
|
92502
92740
|
});
|
|
92503
92741
|
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 = {}) => {
|
|
92504
92742
|
switch (action) {
|