@h-rig/task-cli-plugin 0.0.6-alpha.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @h-rig/task-cli-plugin
@@ -0,0 +1,5 @@
1
+ import { type RigPluginWithRuntime } from "@rig/core/config";
2
+ export declare const STANDARD_TASK_CLI_PLUGIN_NAME = "@rig/task-cli-plugin";
3
+ export declare const STANDARD_TASK_CLI_ID = "@rig/task-cli-plugin:task";
4
+ export declare function createStandardTaskCliPlugin(): RigPluginWithRuntime;
5
+ export declare const standardTaskCliPlugin: RigPluginWithRuntime;
@@ -0,0 +1,73 @@
1
+ // @bun
2
+ var __require = import.meta.require;
3
+
4
+ // packages/task-cli-plugin/src/plugin.ts
5
+ import { definePlugin } from "@rig/core/config";
6
+ var STANDARD_TASK_CLI_PLUGIN_NAME = "@rig/task-cli-plugin";
7
+ var STANDARD_TASK_CLI_ID = "@rig/task-cli-plugin:task";
8
+ function taskListTitle(task) {
9
+ const title = typeof task.title === "string" && task.title.trim().length > 0 ? task.title.trim() : "(untitled)";
10
+ const status = typeof task.status === "string" && task.status.trim().length > 0 ? ` [${task.status.trim()}]` : "";
11
+ const source = typeof task.source === "string" && task.source.trim().length > 0 ? ` (${task.source.trim()})` : "";
12
+ return `${task.id}${status}${source} ${title}`;
13
+ }
14
+ function createStandardTaskCliCommand() {
15
+ return {
16
+ id: STANDARD_TASK_CLI_ID,
17
+ family: "task",
18
+ description: "List and inspect task-source tasks.",
19
+ usage: "rig task list",
20
+ projectRequired: true,
21
+ run: async (context, args) => {
22
+ const [command = "help", ...rest] = [...args];
23
+ if (command === "help" || command === "--help" || command === "-h") {
24
+ if (context.outputMode === "text")
25
+ console.log("Usage: rig task list");
26
+ return { ok: true, group: "task", command: "help" };
27
+ }
28
+ if (command !== "list") {
29
+ throw new Error(`Unsupported standard task command: ${command}. Use 'rig task list'.`);
30
+ }
31
+ if (rest.length > 0) {
32
+ throw new Error(`Unsupported arguments for rig task list: ${rest.join(" ")}`);
33
+ }
34
+ const { listTasks } = await import("@rig/client");
35
+ const tasks = await listTasks(context.projectRoot);
36
+ if (context.outputMode === "text") {
37
+ if (tasks.length === 0) {
38
+ console.log("No tasks found.");
39
+ } else {
40
+ console.log(tasks.map(taskListTitle).join(`
41
+ `));
42
+ }
43
+ }
44
+ return { ok: true, group: "task", command: "list", details: { tasks, count: tasks.length } };
45
+ }
46
+ };
47
+ }
48
+ function createStandardTaskCliPlugin() {
49
+ return definePlugin({
50
+ name: STANDARD_TASK_CLI_PLUGIN_NAME,
51
+ version: "0.1.0",
52
+ contributes: {
53
+ cliCommands: [
54
+ {
55
+ id: STANDARD_TASK_CLI_ID,
56
+ family: "task",
57
+ description: "List and inspect task-source tasks.",
58
+ usage: "rig task list",
59
+ projectRequired: true
60
+ }
61
+ ]
62
+ }
63
+ }, {
64
+ cliCommands: [createStandardTaskCliCommand()]
65
+ });
66
+ }
67
+ var standardTaskCliPlugin = createStandardTaskCliPlugin();
68
+ export {
69
+ standardTaskCliPlugin,
70
+ createStandardTaskCliPlugin,
71
+ STANDARD_TASK_CLI_PLUGIN_NAME,
72
+ STANDARD_TASK_CLI_ID
73
+ };
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@h-rig/task-cli-plugin",
3
+ "version": "0.0.6-alpha.145",
4
+ "type": "module",
5
+ "description": "Standard Rig task CLI plugin boundary backed by the Rig client runtime.",
6
+ "license": "UNLICENSED",
7
+ "files": [
8
+ "dist",
9
+ "README.md"
10
+ ],
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/src/plugin.d.ts",
14
+ "import": "./dist/src/plugin.js"
15
+ },
16
+ "./plugin": {
17
+ "types": "./dist/src/plugin.d.ts",
18
+ "import": "./dist/src/plugin.js"
19
+ }
20
+ },
21
+ "engines": {
22
+ "bun": ">=1.3.11"
23
+ },
24
+ "dependencies": {
25
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.145",
26
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.145"
27
+ }
28
+ }