@codetreker/daynight 0.8.5 → 0.8.13

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.
Files changed (77) hide show
  1. package/dist/api/client.d.ts +5 -1
  2. package/dist/api/client.js +104 -24
  3. package/dist/api/client.js.map +1 -1
  4. package/dist/api/index.d.ts +1 -1
  5. package/dist/api/index.js +1 -1
  6. package/dist/api/index.js.map +1 -1
  7. package/dist/api/parse.d.ts +4 -4
  8. package/dist/api/parse.js +28 -4
  9. package/dist/api/parse.js.map +1 -1
  10. package/dist/api/types.d.ts +23 -1
  11. package/dist/cli/byte-output-helper.d.ts +1 -0
  12. package/dist/cli/byte-output-helper.js +48 -0
  13. package/dist/cli/byte-output-helper.js.map +1 -0
  14. package/dist/cli/byte-output.d.ts +7 -0
  15. package/dist/cli/byte-output.js +199 -0
  16. package/dist/cli/byte-output.js.map +1 -0
  17. package/dist/cli/context.d.ts +2 -0
  18. package/dist/cli/context.js +15 -9
  19. package/dist/cli/context.js.map +1 -1
  20. package/dist/cli/schema.js +6 -6
  21. package/dist/cli/schema.js.map +1 -1
  22. package/dist/commands/review/adapters/copilot.d.ts +3 -0
  23. package/dist/commands/review/adapters/copilot.js +16 -7
  24. package/dist/commands/review/adapters/copilot.js.map +1 -1
  25. package/dist/commands/review/adapters/github-review-state.d.ts +21 -0
  26. package/dist/commands/review/adapters/github-review-state.js +144 -0
  27. package/dist/commands/review/adapters/github-review-state.js.map +1 -0
  28. package/dist/commands/review/adapters/github.d.ts +2 -1
  29. package/dist/commands/review/adapters/github.js +31 -4
  30. package/dist/commands/review/adapters/github.js.map +1 -1
  31. package/dist/commands/review/coordinator.js +134 -7
  32. package/dist/commands/review/coordinator.js.map +1 -1
  33. package/dist/commands/review/model.d.ts +21 -0
  34. package/dist/commands/review/publication.d.ts +14 -0
  35. package/dist/commands/review/publication.js +47 -0
  36. package/dist/commands/review/publication.js.map +1 -0
  37. package/dist/commands/review/skills/daynight-review/SKILL.md +59 -20
  38. package/dist/commands/review/store.d.ts +20 -0
  39. package/dist/commands/review/store.js +134 -5
  40. package/dist/commands/review/store.js.map +1 -1
  41. package/dist/commands/server/runtime.d.ts +1 -1
  42. package/dist/commands/server/runtime.js +8 -1
  43. package/dist/commands/server/runtime.js.map +1 -1
  44. package/dist/commands/skill/agents.d.ts +1 -1
  45. package/dist/commands/skill/agents.js +1 -1
  46. package/dist/commands/skill/agents.js.map +1 -1
  47. package/dist/commands/skill/command.js +7 -5
  48. package/dist/commands/skill/command.js.map +1 -1
  49. package/dist/commands/skill/definition.js +3 -3
  50. package/dist/commands/skill/definition.js.map +1 -1
  51. package/dist/commands/skill/install.d.ts +2 -1
  52. package/dist/commands/skill/install.js +13 -5
  53. package/dist/commands/skill/install.js.map +1 -1
  54. package/dist/commands/skill/skills/using-daynight/SKILL.md +56 -0
  55. package/dist/commands/skill/skills/using-daynight/references/autopilot.md +71 -0
  56. package/dist/commands/skill/skills/using-daynight/references/create-task.md +103 -0
  57. package/dist/commands/skill/skills/using-daynight/references/handbook.md +72 -0
  58. package/dist/commands/skill/skills/using-daynight/references/run-task.md +80 -0
  59. package/dist/commands/skill/targets.d.ts +1 -0
  60. package/dist/commands/skill/targets.js +9 -2
  61. package/dist/commands/skill/targets.js.map +1 -1
  62. package/dist/commands/task/attachment-rendering.d.ts +5 -0
  63. package/dist/commands/task/attachment-rendering.js +38 -0
  64. package/dist/commands/task/attachment-rendering.js.map +1 -0
  65. package/dist/commands/task/attachment.d.ts +6 -0
  66. package/dist/commands/task/attachment.js +91 -0
  67. package/dist/commands/task/attachment.js.map +1 -0
  68. package/dist/commands/task/command.js +26 -6
  69. package/dist/commands/task/command.js.map +1 -1
  70. package/dist/commands/task/definition.js +53 -8
  71. package/dist/commands/task/definition.js.map +1 -1
  72. package/dist/commands/task/rendering.d.ts +1 -0
  73. package/dist/commands/task/rendering.js +25 -4
  74. package/dist/commands/task/rendering.js.map +1 -1
  75. package/package.json +3 -2
  76. package/dist/commands/skill/skills/daynight/SKILL.md +0 -95
  77. package/dist/commands/skill/skills/daynight/references/commands.md +0 -155
@@ -0,0 +1,72 @@
1
+ # Daynight handbook
2
+
3
+ Use the installed `daynight` CLI. Discover command groups with `daynight --help`
4
+ and read the relevant command's `--help` for arguments, options, and output
5
+ formats. This reference indexes project/task commands and explains the context
6
+ needed to use them correctly.
7
+
8
+ ## Command index
9
+
10
+ | Command | Purpose |
11
+ |---|---|
12
+ | `setup` | Configure access to the Daynight service. |
13
+ | `project create` | Register a repository as a project or find its existing project. |
14
+ | `project list` | Find projects on the configured service. |
15
+ | `project show` | Inspect a project's details. |
16
+ | `task create` | Register a todo task. |
17
+ | `task ready` | Get a bounded set of tasks whose prerequisites are complete. |
18
+ | `task list` | Read every matching page; defaults to unfinished tasks. |
19
+ | `task show` | Read one task's complete details and version. |
20
+ | `task update` | Change a task's fields, dependencies, or PR references. |
21
+ | `task graph` | Inspect the project's dependency graph and summary. |
22
+ | `task attachment put` | Upload or replace one attachment file. |
23
+ | `task attachment list` | Read a task's attachment inventory and metadata. |
24
+ | `task attachment read` | Retrieve an attachment's original bytes. |
25
+ | `task attachment remove` | Delete one attachment file. |
26
+
27
+ ## Operational context
28
+
29
+ **Project discovery.** Inside a Git worktree, task commands can omit `--project`:
30
+ the CLI matches the origin repository URL to a project on the configured
31
+ service. An explicit project overrides discovery for that invocation. Resolve
32
+ missing or ambiguous matches rather than guessing an ID or creating a project
33
+ to make a query succeed.
34
+
35
+ **Read scope.** Ready is a candidate page, ordered by creation rather than
36
+ relevance. An empty page does not rule out in-progress or dependency-blocked
37
+ work. List traverses every matching page but excludes `done` by default; include
38
+ completed tasks explicitly when checking the full backlog or prior registrations.
39
+ Its status/readiness grouping does not rank relevance. Human lists are summaries;
40
+ JSON preserves full task fields. Graph provides compact
41
+ dependency context without full descriptions, PR properties, or versions. Read
42
+ the selected task's details before acting. A graph-limit error still permits
43
+ bounded candidate and individual task reads.
44
+
45
+ **Task concurrency.** The states are `todo`, `in_progress`, and `done`; ready
46
+ means todo with completed direct prerequisites. These facts grant no ownership
47
+ or lock. Bind each update to the exact version read for that decision using
48
+ `--if-version`; the CLI's default pre-submit read cannot protect an earlier
49
+ decision. Preserve full int64 decimal digits without numeric rounding. On a
50
+ conflict, reread and reconsider rather than merely swapping in a newer version.
51
+
52
+ **Replacement fields.** Descriptions, dependency sets, and PR reference lists
53
+ replace the whole supplied field. Preserve every still-needed value. Omitted
54
+ fields stay unchanged; clearing and option-pairing syntax is in command help.
55
+
56
+ **Attachment independence.** Task reads contain no attachment inventory.
57
+ Attachments use case-sensitive relative paths; uploads to the same path replace
58
+ that file, so keep mock UI resources at their referenced relative locations.
59
+ Attachment changes do not change the task's version, status, or update timestamp.
60
+ Task versions therefore cannot protect attachment writes. Multiple file
61
+ operations are independent, and file bytes and metadata can change partially;
62
+ confirm actual contents as well as metadata when reconciling a write.
63
+
64
+ **Unconfirmed writes.** A timeout or lost response may follow an applied change.
65
+ Read back task fields or attachment contents before another mutation. For an
66
+ unconfirmed create, establish identity from complete fields and operation
67
+ context; a matching title or an empty lookup alone is insufficient. Preserve
68
+ actual errors and resource IDs rather than reporting success or blindly
69
+ resending a write.
70
+
71
+ Task registration, execution, and selection follow [create-task](create-task.md),
72
+ [run-task](run-task.md), and [autopilot](autopilot.md), respectively.
@@ -0,0 +1,80 @@
1
+ # Run one task
2
+
3
+ Execute exactly one specified task ID within the user's authorized scope. Read
4
+ [the handbook](handbook.md) for CLI operations, data semantics, and failures.
5
+ This mode owns execution and completion; it returns without choosing a successor
6
+ or activating autopilot.
7
+
8
+ ## Establish the task
9
+
10
+ Read the complete task with `daynight task show <task-id> --json`. Resolve its
11
+ actual attachment references and read the primary Markdown's solution and
12
+ acceptance criteria. Equivalent headings in the task's language are valid.
13
+ Frontend tasks also require viewing the interactive mock UI and the resources
14
+ needed to render it. Filenames are not fixed, and a task read alone does not
15
+ load its attachments.
16
+
17
+ Check the task's state, direct prerequisites, authorized scope, and required
18
+ artifacts before starting. A missing or unreadable primary Markdown, missing
19
+ solution or acceptance criteria, or absent required mock UI leaves execution
20
+ unready. Resolve the missing requirement within the authorized scope or return
21
+ the concrete issue; do not silently invent acceptance criteria or move the plan
22
+ into the description. Do not execute prerequisites as an implicit expansion of
23
+ the requested task.
24
+
25
+ For `todo`, begin only when dependencies are done and the work is authorized,
26
+ then set `in_progress`. For `in_progress`, recover existing work and coordinate
27
+ using the project's established mechanisms; the status is not an ownership
28
+ claim. A task already `done` is reported as such; reopening needs explicit
29
+ intent. Preserve the requested task ID through recovery and waiting.
30
+
31
+ ## Execute and maintain continuity
32
+
33
+ Follow the target repository's instructions for worktrees, implementation,
34
+ review, validation, and delivery. Use the attachment solution and acceptance
35
+ criteria to guide the work, including the frontend mock UI's final styling and
36
+ interactions. Material changes to the agreed solution or acceptance require
37
+ resolution within the current authorization and coherent updates to the owning
38
+ attachment; do not silently weaken requirements to obtain completion.
39
+
40
+ Advance only this task. Subagents collaborate on it, and waiting for CI, review,
41
+ approval, or merge remains part of it. Keep all required delivery PR URLs and
42
+ titles in the complete `properties.pullRequests` list. Preserve existing entries
43
+ when updating that list.
44
+
45
+ Keep the problem and actual attachment references in the description. Record
46
+ acceptance results and necessary delivery evidence, including merge commit
47
+ references, with the Markdown attachment's corresponding acceptance criteria.
48
+ Rewrite the current evidence coherently rather than accumulating an execution
49
+ log. Keep operational progress, blockers, waiting items, and the next action in
50
+ the conversation or the project's existing execution checkpoint, retaining the
51
+ task ID and any necessary PR and workspace references.
52
+
53
+ ## Confirm completion or return waiting
54
+
55
+ Development tasks and design or documentation tasks delivered through PRs remain
56
+ `in_progress` until the hosting platform confirms **every necessary delivery PR
57
+ is merged** and all acceptance criteria are satisfied. Code completion, passing
58
+ CI, approved review, and an open PR do not satisfy this condition. Verify actual
59
+ merge state through the hosting platform's native client or API; do not assume
60
+ a particular host.
61
+
62
+ Completion rules grant no merge, deployment, external communication, or mainline
63
+ push permission. Follow the user's existing authorization without asking again
64
+ for actions it already covers. If the user requests an open PR for their review
65
+ or forbids merging, deliver the reviewable PR, keep the task `in_progress`, save
66
+ the waiting checkpoint, and return with its URL and the required user action.
67
+ Do not enable auto-merge. Missing permission, unavailable merge visibility, or
68
+ an unmet merge check likewise keeps completion pending.
69
+
70
+ For tasks with no development or PR delivery path, use their stated acceptance
71
+ criteria. In all cases, confirm the required evidence is recorded and readable,
72
+ then reread the complete task and set `done` with the exact observed version.
73
+ Only service confirmation establishes the status update; reconcile an uncertain
74
+ result before reporting it.
75
+
76
+ Continue ordinary CI and review waits as the current task. If progress requires
77
+ external intervention, preserve the current target, actual task state, concrete
78
+ blocker, existing work, and next action in the checkpoint, then return that
79
+ waiting result. An unstarted task stays `todo`; a started task stays
80
+ `in_progress`. Do not declare completion or select other work to bypass a wait.
@@ -2,6 +2,7 @@ import type { SkillAgent } from "./agents.js";
2
2
  export type SkillScope = "user" | "project";
3
3
  export type SkillTarget = {
4
4
  path: string;
5
+ legacyPath: string;
5
6
  parent: string;
6
7
  ancestor: string;
7
8
  missingParents: readonly string[];
@@ -10,12 +10,12 @@ export const planSkillTargets = async (base, agents) => {
10
10
  for (const agent of agents) {
11
11
  const parent = await resolvePhysicalDirectory(path.join(base, agent.directory, "skills"));
12
12
  const physicalParent = path.join(parent.ancestorPath, ...parent.missingComponents);
13
- const targetPath = path.join(physicalParent, "daynight");
13
+ const targetPath = path.join(physicalParent, "using-daynight");
14
14
  const existing = targets.find((target) => comparisonPath(target.path) === comparisonPath(targetPath));
15
15
  if (existing !== undefined)
16
16
  existing.agents.push(agent);
17
17
  else
18
- targets.push({ path: targetPath, parent: physicalParent, ancestor: parent.ancestorPath, missingParents: parent.missingComponents, agents: [agent] });
18
+ targets.push({ path: targetPath, legacyPath: path.join(physicalParent, "daynight"), parent: physicalParent, ancestor: parent.ancestorPath, missingParents: parent.missingComponents, agents: [agent] });
19
19
  }
20
20
  for (const [index, first] of targets.entries()) {
21
21
  for (const second of targets.slice(index + 1)) {
@@ -24,6 +24,13 @@ export const planSkillTargets = async (base, agents) => {
24
24
  }
25
25
  }
26
26
  }
27
+ for (const legacy of targets) {
28
+ for (const target of targets) {
29
+ if (comparisonPath(legacy.legacyPath) === comparisonPath(target.path) || contains(legacy.legacyPath, target.path)) {
30
+ throw new Error(`Cannot remove legacy daynight skill at ${legacy.legacyPath}: it contains the using-daynight installation at ${target.path}. Change the parent skill-directory links so legacy cleanup cannot remove a selected installation.`);
31
+ }
32
+ }
33
+ }
27
34
  return targets;
28
35
  };
29
36
  //# sourceMappingURL=targets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../src/commands/skill/targets.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAYxE,MAAM,cAAc,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC7G,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,KAAa,EAAW,EAAE;IAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9E,OAAO,QAAQ,KAAK,EAAE,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;AACrH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,IAAY,EAAE,MAA6B,EAA0B,EAAE;IAC5G,MAAM,OAAO,GAAkB,EAAE,CAAC;IAClC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAA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,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,IAAI,iFAAiF,CAAC,CAAC;YACzR,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC7B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;gBAClH,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,CAAC,UAAU,oDAAoD,MAAM,CAAC,IAAI,oGAAoG,CAAC,CAAC;YAClP,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { TaskAttachment } from "../../api/types.js";
2
+ export declare const renderAttachment: (attachment: TaskAttachment) => string;
3
+ export declare const renderAttachmentList: (attachments: readonly TaskAttachment[]) => string;
4
+ export declare const renderAttachmentTree: (attachments: readonly TaskAttachment[]) => string;
5
+ export declare const renderAttachmentJson: (attachments: readonly TaskAttachment[]) => string;
@@ -0,0 +1,38 @@
1
+ import { stringifyApiJson } from "../../api/json.js";
2
+ import { terminalText } from "../../platform/terminal.js";
3
+ export const renderAttachment = (attachment) => [
4
+ `Path: ${terminalText(attachment.path)}`,
5
+ `Content type: ${terminalText(attachment.contentType)}`,
6
+ `Size: ${attachment.sizeBytes} bytes`,
7
+ `Created: ${terminalText(attachment.createdAt)}`,
8
+ `Updated: ${terminalText(attachment.updatedAt)}`,
9
+ "",
10
+ ].join("\n");
11
+ export const renderAttachmentList = (attachments) => attachments.length === 0 ? "No attachments.\n" : attachments.map(renderAttachment).join("\n");
12
+ export const renderAttachmentTree = (attachments) => {
13
+ if (attachments.length === 0)
14
+ return "No attachments.\n";
15
+ const root = { children: new Map(), file: false };
16
+ for (const attachment of attachments) {
17
+ let node = root;
18
+ for (const segment of attachment.path.split("/")) {
19
+ let child = node.children.get(segment);
20
+ if (child === undefined) {
21
+ child = { children: new Map(), file: false };
22
+ node.children.set(segment, child);
23
+ }
24
+ node = child;
25
+ }
26
+ node.file = true;
27
+ }
28
+ const render = (node, prefix) => {
29
+ const entries = [...node.children].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
30
+ return entries.flatMap(([name, child], index) => {
31
+ const last = index === entries.length - 1;
32
+ return [`${prefix}${last ? "└── " : "├── "}${terminalText(name)}${child.file ? "" : "/"}`, ...render(child, `${prefix}${last ? " " : "│ "}`)];
33
+ });
34
+ };
35
+ return `${render(root, "").join("\n")}\n`;
36
+ };
37
+ export const renderAttachmentJson = (attachments) => `${stringifyApiJson(attachments)}\n`;
38
+ //# sourceMappingURL=attachment-rendering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment-rendering.js","sourceRoot":"","sources":["../../../src/commands/task/attachment-rendering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,UAA0B,EAAU,EAAE,CAAC;IACtE,SAAS,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;IACxC,iBAAiB,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE;IACvD,SAAS,UAAU,CAAC,SAAS,QAAQ;IACrC,YAAY,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE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AAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvG,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,EAAE;YAC9C,MAAM,IAAI,GAAG,KAAK,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YAC1C,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC,KAAK,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACrJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;IACF,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAsC,EAAU,EAAE,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { CliContext } from "../../cli/context.js";
2
+ import type { ParsedCommand } from "../../cli/schema.js";
3
+ import type { TaskCommandDependencies } from "./command.js";
4
+ export declare const runTaskAttachmentCommand: (command: Extract<ParsedCommand, {
5
+ kind: "run";
6
+ }>, context: CliContext, dependencies: TaskCommandDependencies) => Promise<void>;
@@ -0,0 +1,91 @@
1
+ import { constants } from "node:fs";
2
+ import { open } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import mime from "mime";
5
+ import { canonicalId, validateAttachmentPath } from "../../api/parse.js";
6
+ import { UsageError } from "../../cli/context.js";
7
+ import { renderAttachment, renderAttachmentJson, renderAttachmentList, renderAttachmentTree } from "./attachment-rendering.js";
8
+ const sourceBody = (file) => new ReadableStream({
9
+ async pull(controller) {
10
+ const buffer = new Uint8Array(64 * 1024);
11
+ const { bytesRead } = await file.read(buffer);
12
+ if (bytesRead === 0)
13
+ controller.close();
14
+ else
15
+ controller.enqueue(buffer.subarray(0, bytesRead));
16
+ },
17
+ });
18
+ export const runTaskAttachmentCommand = async (command, context, dependencies) => {
19
+ const help = `${command.path.join(" ")} --help`;
20
+ const taskId = canonicalId(command.values[0]);
21
+ if (taskId === null)
22
+ throw new UsageError("task-id must be a hyphenated UUID.", help);
23
+ const rawProjectId = command.options.get("--project");
24
+ const projectId = rawProjectId === undefined ? undefined : canonicalId(rawProjectId);
25
+ if (projectId === null)
26
+ throw new UsageError("project-id must be a hyphenated UUID.", help);
27
+ if (command.options.has("--tree") && command.options.has("--json"))
28
+ throw new UsageError("--tree and --json are mutually exclusive.", help);
29
+ const name = command.command.name;
30
+ const source = name === "put" ? command.values[1] : undefined;
31
+ const rawPath = name === "put" ? command.options.get("--path") ?? path.basename(source) : command.values[1];
32
+ let attachmentPath;
33
+ if (rawPath !== undefined) {
34
+ try {
35
+ attachmentPath = validateAttachmentPath(rawPath);
36
+ }
37
+ catch (cause) {
38
+ throw new UsageError(cause instanceof Error ? cause.message : String(cause), help);
39
+ }
40
+ }
41
+ let file;
42
+ let failure;
43
+ try {
44
+ if (source !== undefined) {
45
+ file = await open(source, constants.O_RDONLY | constants.O_NONBLOCK);
46
+ if (!(await file.stat()).isFile())
47
+ throw new UsageError("Attachment source must be a regular file.", help);
48
+ }
49
+ await dependencies.runServerCommand(context, async ({ api, operation, serverUrl }) => {
50
+ operation.check();
51
+ const project = projectId === undefined
52
+ ? await dependencies.resolveProject({ serverUrl, operation, api, workingDirectory: context.workingDirectory() })
53
+ : await api.getProject(projectId);
54
+ operation.check();
55
+ if (name === "put") {
56
+ const contentType = mime.getType(attachmentPath) ?? "application/octet-stream";
57
+ const attachment = await api.putTaskAttachment(project.id, taskId, attachmentPath, { body: sourceBody(file), contentType });
58
+ operation.check();
59
+ return `Attachment uploaded.\n${renderAttachment(attachment)}`;
60
+ }
61
+ if (name === "list") {
62
+ const attachments = await api.listTaskAttachments(project.id, taskId);
63
+ operation.check();
64
+ return command.options.has("--json") ? renderAttachmentJson(attachments) : command.options.has("--tree") ? renderAttachmentTree(attachments) : renderAttachmentList(attachments);
65
+ }
66
+ if (name === "read") {
67
+ await api.readTaskAttachment(project.id, taskId, attachmentPath, (chunk, signal) => context.stdoutBytes(chunk, signal));
68
+ operation.check();
69
+ return;
70
+ }
71
+ await api.removeTaskAttachment(project.id, taskId, attachmentPath);
72
+ operation.check();
73
+ return "Attachment removed.\n";
74
+ });
75
+ }
76
+ catch (cause) {
77
+ failure = cause;
78
+ throw cause;
79
+ }
80
+ finally {
81
+ try {
82
+ await file?.close();
83
+ }
84
+ catch (cause) {
85
+ if (failure !== undefined)
86
+ throw new AggregateError([failure, cause], "Attachment operation and source cleanup failed.", { cause: failure });
87
+ throw cause;
88
+ }
89
+ }
90
+ };
91
+ //# sourceMappingURL=attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.js","sourceRoot":"","sources":["../../../src/commands/task/attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEzE,OAAO,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,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;YACnL,CAAC;YACD,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;gBACpB,MAAM,GAAG,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,cAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;gBACzH,SAAS,CAAC,KAAK,EAAE,CAAC;gBAClB,OAAO;YACT,CAAC;YACD,MAAM,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,cAAe,CAAC,CAAC;YACpE,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,GAAG,KAAK,CAAC;QAChB,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YAAC,MAAM,IAAI,EAAE,KAAK,EAAE,CAAC;QAAC,CAAC;QAC5B,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,OAAO,KAAK,SAAS;gBAAE,MAAM,IAAI,cAAc,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,iDAAiD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;YAC7I,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -6,18 +6,35 @@ const defaultDependencies = {
6
6
  runServerCommand: async (...args) => (await import("../server/runtime.js")).runServerCommand(...args),
7
7
  resolveProject: async (...args) => (await import("../../repository/index.js")).resolveProject(...args),
8
8
  };
9
+ const taskPriority = (task) => task.status === "in_progress" ? 0 : task.ready ? 1 : task.status === "todo" ? 2 : 3;
9
10
  export const runTaskCommand = async (args, context, dependencies = defaultDependencies) => {
10
11
  const command = parseCommand(taskDefinition, args, ["daynight", "task"], "daynight task --help");
11
12
  if (command.kind !== "run") {
12
13
  context.stdout(renderCommandHelp(command.command, command.path));
13
14
  return;
14
15
  }
15
- const help = `daynight task ${command.command.name} --help`;
16
+ if (command.path[2] === "attachment") {
17
+ const { runTaskAttachmentCommand } = await import("./attachment.js");
18
+ await runTaskAttachmentCommand(command, context, dependencies);
19
+ return;
20
+ }
21
+ const help = `${command.path.join(" ")} --help`;
16
22
  const title = command.options.get("--title");
17
23
  const description = command.options.get("--description");
18
24
  const status = command.options.get("--status");
25
+ const all = command.options.has("--all");
26
+ if (all && status !== undefined)
27
+ throw new UsageError("--all conflicts with --status.", help);
19
28
  const dependsOn = command.options.get("--depends-on");
20
29
  const clearDependencies = command.options.has("--clear-dependencies");
30
+ const pullRequestUrls = command.options.get("--pull-request-url");
31
+ const pullRequestTitles = command.options.get("--pull-request-title");
32
+ const clearPullRequests = command.options.has("--clear-pull-requests");
33
+ if (clearPullRequests && (pullRequestUrls !== undefined || pullRequestTitles !== undefined))
34
+ throw new UsageError("--clear-pull-requests conflicts with --pull-request-url and --pull-request-title.", help);
35
+ if (pullRequestUrls?.length !== pullRequestTitles?.length)
36
+ throw new UsageError("Provide the same number of --pull-request-url and --pull-request-title values.", help);
37
+ const properties = clearPullRequests ? { pullRequests: [] } : pullRequestUrls === undefined ? undefined : { pullRequests: pullRequestUrls.map((url, index) => ({ url, title: pullRequestTitles[index] })) };
21
38
  const limitArgument = command.options.get("--limit");
22
39
  const readyLimit = limitArgument === undefined ? 10 : Number(limitArgument);
23
40
  if (limitArgument !== undefined && (!/^[0-9]+$/.test(limitArgument) || !Number.isInteger(readyLimit) || readyLimit < 1 || readyLimit > 100))
@@ -36,9 +53,10 @@ export const runTaskCommand = async (args, context, dependencies = defaultDepend
36
53
  ...(status === undefined ? {} : { status }),
37
54
  ...(dependsOn === undefined ? {} : { dependsOn }),
38
55
  ...(clearDependencies ? { dependsOn: [] } : {}),
56
+ ...(properties === undefined ? {} : { properties }),
39
57
  };
40
58
  if (command.command.name === "update" && Object.keys(changes).length === 0)
41
- throw new UsageError("Task update requires a title, description, status, or dependency change.", help);
59
+ throw new UsageError("Task update requires a title, description, status, dependency, or PR reference change.", help);
42
60
  const rawProjectId = command.options.get("--project");
43
61
  let projectId;
44
62
  let taskId;
@@ -76,19 +94,21 @@ export const runTaskCommand = async (args, context, dependencies = defaultDepend
76
94
  project = await dependencies.resolveProject({ serverUrl, operation, api, workingDirectory: context.workingDirectory() });
77
95
  }
78
96
  operation.check();
79
- const { renderTask, renderTaskGraph, renderTaskJson, renderTaskList } = await import("./rendering.js");
97
+ const { renderTask, renderTaskGraph, renderTaskJson, renderTaskList, renderTaskSummaryList } = await import("./rendering.js");
80
98
  operation.check();
81
99
  if (command.command.name === "create") {
82
- const input = { title: title, ...(description === undefined ? {} : { description }), ...(dependsOn === undefined ? {} : { dependsOn }) };
100
+ const input = { title: title, ...(description === undefined ? {} : { description }), ...(dependsOn === undefined ? {} : { dependsOn }), ...(properties === undefined ? {} : { properties }) };
83
101
  const task = await api.createTask(project.id, input);
84
102
  operation.check();
85
103
  return `Task created.\n${renderTask(task)}`;
86
104
  }
87
105
  if (command.command.name === "list") {
88
106
  const filters = { ...(status === undefined ? {} : { status }), ...(command.options.has("--ready") ? { ready: true } : {}) };
89
- const tasks = await api.listTasks(project.id, filters);
107
+ const tasks = (await api.listTasks(project.id, filters))
108
+ .filter((task) => all || status !== undefined || task.status !== "done")
109
+ .toSorted((left, right) => taskPriority(left) - taskPriority(right));
90
110
  operation.check();
91
- return command.options.has("--json") ? renderTaskJson(tasks) : renderTaskList(tasks);
111
+ return command.options.has("--json") ? renderTaskJson(tasks) : renderTaskSummaryList(tasks);
92
112
  }
93
113
  if (command.command.name === "ready") {
94
114
  const tasks = await api.listReadyTasks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AC;YAClB,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;QACxF,CAAC;QACD,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YACpC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,MAAO,CAAC,CAAC;YACpD,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,OAAO,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACjF,CAAC;QACD,MAAM,OAAO,GAAG,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,MAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACnH,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,MAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QAChF,SAAS,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,kBAAkB,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;IAC9C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -5,6 +5,10 @@ const titleOption = { names: ["--title"], description: "Task title", value: { na
5
5
  const descriptionOption = { names: ["--description"], description: "Task description; an empty value clears it", value: { name: "description", kind: "text", allowEmpty: true } };
6
6
  const dependencyOption = { names: ["--depends-on"], description: "Direct dependency task UUID; repeat to supply the full set", value: { name: "task-id", kind: "text" }, repeatable: true };
7
7
  const statusOption = { names: ["--status"], description: "Task status", value: { name: "status", kind: "text", choices: ["todo", "in_progress", "done"] } };
8
+ const pullRequestOptions = [
9
+ { names: ["--pull-request-url"], description: "PR URL text; repeat for the complete list", value: { name: "text", kind: "text", allowEmpty: true }, repeatable: true },
10
+ { names: ["--pull-request-title"], description: "PR title text; pair by position with each URL", value: { name: "text", kind: "text", allowEmpty: true }, repeatable: true },
11
+ ];
8
12
  const taskArgument = { name: "task-id", description: "Task UUID" };
9
13
  export const taskDefinition = {
10
14
  name: "task",
@@ -12,15 +16,15 @@ export const taskDefinition = {
12
16
  commands: [
13
17
  {
14
18
  name: "create",
15
- description: "Create a todo task with optional dependencies",
16
- options: [{ ...titleOption, required: true }, descriptionOption, dependencyOption, projectOption, helpOption],
17
- details: "New tasks start in todo. Repeated --depends-on values preserve the supplied dependency set.",
19
+ description: "Create a todo task with optional dependencies and PR references",
20
+ options: [{ ...titleOption, required: true }, descriptionOption, dependencyOption, ...pullRequestOptions, projectOption, helpOption],
21
+ details: "New tasks start in todo. Repeated --depends-on values preserve the supplied dependency set.\nPR URL and title counts must match; the nth URL pairs with the nth title. Empty values are accepted, and all text is stored as supplied.",
18
22
  },
19
23
  {
20
24
  name: "list",
21
- description: "List all matching tasks in the project",
22
- options: [statusOption, { names: ["--ready"], description: "Include only tasks ready to start" }, projectOption, jsonOption, helpOption],
23
- details: "Combine --status and --ready with AND. Read every page before printing the complete result.",
25
+ description: "List unfinished tasks, with in-progress and ready tasks first",
26
+ options: [{ names: ["--all"], description: "Include completed tasks; conflicts with --status" }, statusOption, { names: ["--ready"], description: "Include only tasks ready to start" }, projectOption, jsonOption, helpOption],
27
+ details: "By default, exclude done tasks. Use --all for every status or --status for a specific status.\nCombine --ready with the selected statuses using AND. Read every page before printing.\nOrder in_progress first, then ready tasks, then remaining tasks; preserve server order within each group.\nText lists omit description, version, and timestamps. --json preserves every task field with the same filtering and ordering.",
24
28
  },
25
29
  {
26
30
  name: "ready",
@@ -36,19 +40,60 @@ export const taskDefinition = {
36
40
  },
37
41
  {
38
42
  name: "update",
39
- description: "Atomically update task fields and dependencies",
43
+ description: "Atomically update task fields, dependencies, and PR references",
40
44
  arguments: [taskArgument],
41
45
  options: [titleOption, descriptionOption, statusOption, dependencyOption,
42
46
  { names: ["--clear-dependencies"], description: "Clear the complete dependency set" },
47
+ ...pullRequestOptions,
48
+ { names: ["--clear-pull-requests"], description: "Clear the complete PR reference list" },
43
49
  { names: ["--if-version"], description: "Use this expected task version without reading a newer version", value: { name: "version", kind: "text" } },
44
50
  projectOption, helpOption],
45
- details: "Provide at least one changed field. --depends-on replaces all dependencies; it conflicts with --clear-dependencies.\nWithout --if-version, read the current version before submitting the update. Conflicts are not retried.",
51
+ details: "Provide at least one changed field. --depends-on replaces all dependencies; it conflicts with --clear-dependencies.\nPR URL and title counts must match; the nth URL pairs with the nth title. Pairs replace the complete list; empty values are accepted. --clear-pull-requests conflicts with either PR option. Omitted PR options preserve the current list.\nWithout --if-version, read the current version before submitting the update. Conflicts are not retried.",
46
52
  },
47
53
  {
48
54
  name: "graph",
49
55
  description: "Show the complete task graph and summary",
50
56
  options: [projectOption, jsonOption, helpOption],
51
57
  },
58
+ {
59
+ name: "attachment",
60
+ description: "Manage files attached to a task",
61
+ commands: [
62
+ {
63
+ name: "put",
64
+ description: "Upload one local regular file, replacing the same attachment path",
65
+ arguments: [taskArgument, { name: "file", description: "Local regular file to upload" }],
66
+ options: [{ names: ["--path"], description: "Attachment relative path (default: source basename)", value: { name: "relative-path", kind: "text" } }, projectOption, helpOption],
67
+ allowOptionsTerminator: true,
68
+ details: "Infer the content type from the attachment path. Unknown extensions use application/octet-stream.\nUse -- before a file name starting with a dash, or --path=value for a dash-prefixed target path. Writes are not retried; an interrupted operation may already have taken effect.",
69
+ },
70
+ {
71
+ name: "list",
72
+ description: "List every attachment and its metadata",
73
+ arguments: [taskArgument],
74
+ options: [{ names: ["--tree"], description: "Display attachment paths as a directory tree" }, projectOption, jsonOption, helpOption],
75
+ details: "Read every page before printing. --tree and --json are mutually exclusive.",
76
+ },
77
+ {
78
+ name: "read",
79
+ description: "Write the attachment's original bytes to stdout",
80
+ arguments: [taskArgument, { name: "relative-path", description: "Complete attachment relative path" }],
81
+ options: [projectOption, helpOption],
82
+ allowOptionsTerminator: true,
83
+ details: "Output contains only the original bytes, with no labels or extra newline. Diagnostics go to stderr.\nA failed read may leave incomplete content on stdout. Use -- before a path starting with a dash.",
84
+ },
85
+ {
86
+ name: "remove",
87
+ description: "Remove one attachment by its complete relative path",
88
+ arguments: [taskArgument, { name: "relative-path", description: "Complete attachment relative path" }],
89
+ options: [projectOption, helpOption],
90
+ allowOptionsTerminator: true,
91
+ details: "Use -- before a path starting with a dash. Deletes are not retried; an interrupted operation may already have taken effect.",
92
+ },
93
+ ],
94
+ options: [helpOption],
95
+ details: "Paths are case-sensitive, use / separators, and preserve Unicode spelling.\nWithout --project, resolve the current Git origin to its project.\nRun daynight task attachment <command> --help for command usage.",
96
+ },
52
97
  ],
53
98
  options: [helpOption],
54
99
  details: "Without --project, resolve the current Git origin to its project using the repository binding.\nText options also accept --option=value; use this form for values starting with a dash.\nServer: serverUrl in ~/.daynight/config.yml\nRun daynight task <command> --help for command usage.",
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../../src/commands/task/definition.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAkB,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7G,MAAM,aAAa,GAAkB,EAAE,KAAK,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;AACrK,MAAM,UAAU,GAAkB,EAAE,KAAK,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW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AAa,EAAE,UAAU,CAAC;oBACpC,sBAAsB,EAAE,IAAI;oBAC5B,OAAO,EAAE,6HAA6H;iBACvI;aACF;YACD,OAAO,EAAE,CAAC,UAAU,CAAC;YACrB,OAAO,EAAE,iNAAiN;SAC3N;KACF;IACD,OAAO,EAAE,CAAC,UAAU,CAAC;IACrB,OAAO,EAAE,6RAA6R;CACvS,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Task, TaskGraph } from "../../api/types.js";
2
2
  export declare const renderTask: (task: Task) => string;
3
3
  export declare const renderTaskList: (tasks: readonly Task[]) => string;
4
+ export declare const renderTaskSummaryList: (tasks: readonly Task[]) => string;
4
5
  export declare const renderTaskGraph: (graph: TaskGraph) => string;
5
6
  export declare const renderTaskJson: (value: Task | readonly Task[] | TaskGraph) => string;