@getpochi/cli 0.5.23 → 0.5.24
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/cli.js +58 -20
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -345418,6 +345418,8 @@ class VendorBase {
|
|
|
345418
345418
|
vendorId;
|
|
345419
345419
|
constructor(vendorId) {
|
|
345420
345420
|
this.vendorId = vendorId;
|
|
345421
|
+
this.getCredentials = this.getCredentials.bind(this);
|
|
345422
|
+
this.getUserInfo = this.getUserInfo.bind(this);
|
|
345421
345423
|
}
|
|
345422
345424
|
getCredentials = runExclusive.buildMethod(async () => {
|
|
345423
345425
|
const { credentials } = this.getVendorConfig();
|
|
@@ -352308,7 +352310,7 @@ var {
|
|
|
352308
352310
|
// package.json
|
|
352309
352311
|
var package_default = {
|
|
352310
352312
|
name: "@getpochi/cli",
|
|
352311
|
-
version: "0.5.
|
|
352313
|
+
version: "0.5.24",
|
|
352312
352314
|
type: "module",
|
|
352313
352315
|
bin: {
|
|
352314
352316
|
pochi: "src/cli.ts"
|
|
@@ -365689,7 +365691,7 @@ var createStorePromise = async ({ signal, otelOptions, ...options4 }) => exports
|
|
|
365689
365691
|
return yield* createStore2({ ...options4 }).pipe(exports_Scope.extend(scope5));
|
|
365690
365692
|
}).pipe(exports_Effect2.withSpan("createStore", {
|
|
365691
365693
|
attributes: { storeId: options4.storeId, disableDevtools: options4.disableDevtools }
|
|
365692
|
-
}), provideOtel(omitUndefineds({ parentSpanContext: otelOptions?.rootSpanContext, otelTracer: otelOptions?.tracer })), exports_Effect2.tapCauseLogPretty, exports_Effect2.annotateLogs({ thread: "window" }), exports_Effect2.provide(exports_Logger2.prettyWithThread("window")), exports_Logger2.withMinimumLogLevel(exports_LogLevel.
|
|
365694
|
+
}), provideOtel(omitUndefineds({ parentSpanContext: otelOptions?.rootSpanContext, otelTracer: otelOptions?.tracer })), exports_Effect2.tapCauseLogPretty, exports_Effect2.annotateLogs({ thread: "window" }), exports_Effect2.provide(exports_Logger2.prettyWithThread("window")), exports_Logger2.withMinimumLogLevel(exports_LogLevel.Error), exports_Effect2.runPromise);
|
|
365693
365695
|
var createStore2 = ({ schema: schema5, adapter: adapter4, storeId, context: context15 = {}, boot, batchUpdates, disableDevtools, onBootStatus, shutdownDeferred, params: params2, debug: debug3, confirmUnsavedChanges = true, syncPayload }) => exports_Effect2.gen(function* () {
|
|
365694
365696
|
const lifetimeScope = yield* exports_Scope.make();
|
|
365695
365697
|
yield* validateStoreId(storeId);
|
|
@@ -387500,7 +387502,7 @@ class Chat extends AbstractChat {
|
|
|
387500
387502
|
}
|
|
387501
387503
|
// src/task/list.ts
|
|
387502
387504
|
function registerTaskListCommand(taskCommand) {
|
|
387503
|
-
taskCommand.command("list", { isDefault: true }).description("List all recent tasks, showing their status and IDs.").option("-n, --limit <number>", "The maximum number of tasks to display.", "
|
|
387505
|
+
taskCommand.command("list", { isDefault: true }).description("List all recent tasks, showing their status and IDs.").option("-n, --limit <number>", "The maximum number of tasks to display.", "100").action(async (options4) => {
|
|
387504
387506
|
const limit = Number.parseInt(options4.limit, 10);
|
|
387505
387507
|
if (Number.isNaN(limit) || limit <= 0) {
|
|
387506
387508
|
return taskCommand.error("Limit must be a positive number");
|
|
@@ -387517,28 +387519,59 @@ function registerTaskListCommand(taskCommand) {
|
|
|
387517
387519
|
console.log(source_default2.white(` pochi -p "<your task description>"`));
|
|
387518
387520
|
return;
|
|
387519
387521
|
}
|
|
387520
|
-
|
|
387521
|
-
|
|
387522
|
-
|
|
387523
|
-
|
|
387524
|
-
|
|
387525
|
-
|
|
387526
|
-
|
|
387527
|
-
|
|
387528
|
-
|
|
387529
|
-
|
|
387530
|
-
|
|
387531
|
-
|
|
387522
|
+
const taskId = await esm_default3({
|
|
387523
|
+
message: `Showing the last ${source_default2.bold(limit)} tasks:`,
|
|
387524
|
+
choices: tasks.map((task2) => ({
|
|
387525
|
+
name: formatTaskForSelect(task2),
|
|
387526
|
+
short: task2.id,
|
|
387527
|
+
value: task2.id,
|
|
387528
|
+
description: formatTaskDescription(task2),
|
|
387529
|
+
disabled: !task2.shareId
|
|
387530
|
+
})),
|
|
387531
|
+
pageSize: 10,
|
|
387532
|
+
theme: {
|
|
387533
|
+
style: {
|
|
387534
|
+
description: (text12) => text12
|
|
387535
|
+
},
|
|
387536
|
+
helpMode: "never",
|
|
387537
|
+
indexMode: "number"
|
|
387532
387538
|
}
|
|
387533
|
-
|
|
387539
|
+
});
|
|
387540
|
+
const task = tasks.find((t8) => t8.id === taskId);
|
|
387541
|
+
if (task) {
|
|
387542
|
+
console.log(`
|
|
387543
|
+
${formatTaskForSelect(task)}
|
|
387544
|
+
${formatTaskDescription(task, false)}`);
|
|
387534
387545
|
}
|
|
387535
387546
|
} catch (error44) {
|
|
387536
|
-
|
|
387547
|
+
if (error44 instanceof Error && error44.message.includes("SIGINT")) {} else {
|
|
387548
|
+
return taskCommand.error(`Failed to list tasks: ${error44 instanceof Error ? error44.message : "Unknown error"}`);
|
|
387549
|
+
}
|
|
387537
387550
|
} finally {
|
|
387538
387551
|
await store.shutdown();
|
|
387539
387552
|
}
|
|
387540
387553
|
});
|
|
387541
387554
|
}
|
|
387555
|
+
function formatTaskForSelect(task) {
|
|
387556
|
+
const statusColor = getStatusColor(task.status);
|
|
387557
|
+
const title = clipTitle(task.title || task.id.substring(0, 8), 75);
|
|
387558
|
+
return `${statusColor(getStatusIcon(task.status))} ${source_default2.bold(title)}`;
|
|
387559
|
+
}
|
|
387560
|
+
function formatTaskDescription(task, includeID = true) {
|
|
387561
|
+
const timeAgo = getTimeAgo(task.updatedAt);
|
|
387562
|
+
let description = "";
|
|
387563
|
+
if (includeID) {
|
|
387564
|
+
description += `
|
|
387565
|
+
ID: ${source_default2.cyan(task.id)}`;
|
|
387566
|
+
}
|
|
387567
|
+
description += `
|
|
387568
|
+
Last Updated: ${source_default2.gray(timeAgo)}`;
|
|
387569
|
+
if (task.shareId) {
|
|
387570
|
+
description += `
|
|
387571
|
+
Share URL: ${source_default2.underline(`https://app.getpochi.com/share/${task.shareId}`)}`;
|
|
387572
|
+
}
|
|
387573
|
+
return description;
|
|
387574
|
+
}
|
|
387542
387575
|
function getStatusColor(status3) {
|
|
387543
387576
|
switch (status3) {
|
|
387544
387577
|
case "completed":
|
|
@@ -387583,19 +387616,24 @@ function getTimeAgo(date8) {
|
|
|
387583
387616
|
return `${diffDays}d ago`;
|
|
387584
387617
|
return date8.toLocaleDateString();
|
|
387585
387618
|
}
|
|
387619
|
+
function clipTitle(title, maxLength2) {
|
|
387620
|
+
if (title.length <= maxLength2)
|
|
387621
|
+
return title;
|
|
387622
|
+
return `${title.substring(0, maxLength2 - 3)}...`;
|
|
387623
|
+
}
|
|
387586
387624
|
|
|
387587
387625
|
// src/task/share.ts
|
|
387588
387626
|
function registerTaskShareCommand(taskCommand) {
|
|
387589
387627
|
taskCommand.command("get-share-url").description("Get the shareable URL for a specific task by its ID.").argument("<task-id>", "The ID of the task to get the share URL for.").action(async (taskId) => {
|
|
387590
387628
|
const store = await createStore4(process.cwd());
|
|
387591
|
-
const shareId = store.query(exports_livestore.queries.makeTaskQuery(taskId))
|
|
387629
|
+
const { shareId } = store.query(exports_livestore.queries.makeTaskQuery(taskId)) || {};
|
|
387592
387630
|
if (shareId) {
|
|
387593
387631
|
const shareUrl = `https://app.getpochi.com/share/${shareId}`;
|
|
387594
387632
|
console.log(`${source_default2.bold("\uD83D\uDCCE Share URL:")} ${source_default2.underline(shareUrl)}`);
|
|
387595
387633
|
} else {
|
|
387596
387634
|
console.log(source_default2.red("❌ No share URL found for this task"));
|
|
387597
387635
|
}
|
|
387598
|
-
store.shutdown();
|
|
387636
|
+
await store.shutdown();
|
|
387599
387637
|
});
|
|
387600
387638
|
}
|
|
387601
387639
|
|
|
@@ -390948,7 +390986,7 @@ function toError2(e11) {
|
|
|
390948
390986
|
// package.json
|
|
390949
390987
|
var package_default2 = {
|
|
390950
390988
|
name: "@getpochi/cli",
|
|
390951
|
-
version: "0.5.
|
|
390989
|
+
version: "0.5.24",
|
|
390952
390990
|
type: "module",
|
|
390953
390991
|
bin: {
|
|
390954
390992
|
pochi: "src/cli.ts"
|