@codetreker/daynight 0.32.1 → 0.37.2

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 (79) hide show
  1. package/README.md +156 -29
  2. package/dist/api/client.d.ts +7 -1
  3. package/dist/api/client.js +117 -21
  4. package/dist/api/client.js.map +1 -1
  5. package/dist/api/json-source.d.ts +3 -0
  6. package/dist/api/json-source.js +113 -0
  7. package/dist/api/json-source.js.map +1 -0
  8. package/dist/api/parse.d.ts +2 -1
  9. package/dist/api/parse.js +16 -1
  10. package/dist/api/parse.js.map +1 -1
  11. package/dist/api/thread.d.ts +6 -0
  12. package/dist/api/thread.js +79 -0
  13. package/dist/api/thread.js.map +1 -0
  14. package/dist/api/types.d.ts +50 -0
  15. package/dist/cli/application.js +12 -2
  16. package/dist/cli/application.js.map +1 -1
  17. package/dist/cli/context.d.ts +9 -1
  18. package/dist/cli/context.js +3 -1
  19. package/dist/cli/context.js.map +1 -1
  20. package/dist/cli/schema.js +10 -10
  21. package/dist/cli/schema.js.map +1 -1
  22. package/dist/commands/controller/providers/projection.js +12 -0
  23. package/dist/commands/controller/providers/projection.js.map +1 -1
  24. package/dist/commands/server/runtime.d.ts +10 -1
  25. package/dist/commands/server/runtime.js +24 -7
  26. package/dist/commands/server/runtime.js.map +1 -1
  27. package/dist/commands/skill/skills/using-daynight/SKILL.md +4 -2
  28. package/dist/commands/skill/skills/using-daynight/references/authorization.md +1 -1
  29. package/dist/commands/skill/skills/using-daynight/references/handbook.md +4 -1
  30. package/dist/commands/skill/skills/using-daynight/references/task-content.md +7 -4
  31. package/dist/commands/skill/skills/using-daynight/references/task-management.md +56 -6
  32. package/dist/commands/skill/skills/using-daynight/references/write-safety.md +22 -3
  33. package/dist/commands/skill/usage.md +82 -7
  34. package/dist/commands/task/command.js +26 -3
  35. package/dist/commands/task/command.js.map +1 -1
  36. package/dist/commands/task/definition.js +40 -6
  37. package/dist/commands/task/definition.js.map +1 -1
  38. package/dist/commands/task/rendering.js +4 -0
  39. package/dist/commands/task/rendering.js.map +1 -1
  40. package/dist/commands/task/thread-diagnostics.d.ts +5 -0
  41. package/dist/commands/task/thread-diagnostics.js +32 -0
  42. package/dist/commands/task/thread-diagnostics.js.map +1 -0
  43. package/dist/commands/task/thread-rendering.d.ts +8 -0
  44. package/dist/commands/task/thread-rendering.js +80 -0
  45. package/dist/commands/task/thread-rendering.js.map +1 -0
  46. package/dist/commands/task/thread.d.ts +11 -0
  47. package/dist/commands/task/thread.js +74 -0
  48. package/dist/commands/task/thread.js.map +1 -0
  49. package/dist/commands/worker/coordinator.js +14 -0
  50. package/dist/commands/worker/coordinator.js.map +1 -1
  51. package/dist/commands/worker/remote.js +3 -4
  52. package/dist/commands/worker/remote.js.map +1 -1
  53. package/dist/commands/worker/remove-worktree-contents.d.ts +3 -0
  54. package/dist/commands/worker/remove-worktree-contents.js +106 -0
  55. package/dist/commands/worker/remove-worktree-contents.js.map +1 -0
  56. package/dist/commands/worker/worktrees.js +69 -23
  57. package/dist/commands/worker/worktrees.js.map +1 -1
  58. package/dist/platform/diagnostics.d.ts +5 -0
  59. package/dist/platform/diagnostics.js +12 -0
  60. package/dist/platform/diagnostics.js.map +1 -1
  61. package/dist/session/codex-subagent-activity.d.ts +4 -0
  62. package/dist/session/codex-subagent-activity.js +13 -0
  63. package/dist/session/codex-subagent-activity.js.map +1 -0
  64. package/dist/session/v2/archive.d.ts +6 -0
  65. package/dist/session/v2/archive.js +163 -0
  66. package/dist/session/v2/archive.js.map +1 -0
  67. package/dist/session/v2/protocol.d.ts +19 -0
  68. package/dist/session/v2/protocol.js +260 -0
  69. package/dist/session/v2/protocol.js.map +1 -0
  70. package/dist/session/v2/responsibility.d.ts +3 -0
  71. package/dist/session/v2/responsibility.js +12 -0
  72. package/dist/session/v2/responsibility.js.map +1 -0
  73. package/dist/session/v2/types.d.ts +293 -0
  74. package/dist/session/v2/types.js +2 -0
  75. package/dist/session/v2/types.js.map +1 -0
  76. package/dist/session/v2/values.d.ts +59 -0
  77. package/dist/session/v2/values.js +201 -0
  78. package/dist/session/v2/values.js.map +1 -0
  79. package/package.json +5 -3
package/README.md CHANGED
@@ -1,15 +1,24 @@
1
1
  # Daynight CLI
2
2
 
3
3
  The `@codetreker/daynight` package provides the `daynight` command and its `dn`
4
- alias. Use it to manage server-backed projects, tasks and attachments, install
5
- the `using-daynight` skill for coding agents, run foreground task workers through
4
+ alias. Use it to manage server-backed projects, tasks, discussion threads and
5
+ attachments, install the `using-daynight` skill for coding agents, run foreground
6
+ task workers through
6
7
  Herdr or browser-connected native Controllers, and run a local GitHub PR reviewer through Copilot CLI. Both command names
7
- share configuration and behavior.
8
+ share configuration and behavior. Supported native platforms are Linux, Windows
9
+ and Apple Silicon (ARM64) macOS. Intel macOS is unsupported.
8
10
 
9
11
  See the [project overview](../../README.md) for the browser workspace and service,
10
12
  and the [development guide](../../docs/development.md) for source builds,
11
- validation, package versions and npm publication. Each command's `--help` owns
12
- its exact usage. Review execution additionally requires Git, an authenticated
13
+ validation, package versions and npm publication. Ordinary test and installed
14
+ acceptance suites exclude stress workloads. From this package, `pnpm test:stress`
15
+ builds the CLI and runs the rendering and full Session-v2 `.stress.ts` suites;
16
+ `pnpm test:stress:budgets` runs the server validation gate with the four full
17
+ 128 MiB/256 MiB installed-CLI byte probes. The latter requires an isolated
18
+ `DAYNIGHT_TEST_DATABASE_URL` and the [server validation prerequisites](../daynight-server/README.md#validate).
19
+ Both commands are explicit local-only validation and refuse CI. The
20
+ [local stress guide](../../docs/development.md#local-stress-validation) owns
21
+ selection and receipt interpretation. Each command's `--help` owns its exact usage. Review execution additionally requires Git, an authenticated
13
22
  GitHub CLI and Copilot CLI on `PATH`.
14
23
 
15
24
  - [Install and update](#install-and-update)
@@ -22,6 +31,7 @@ GitHub CLI and Copilot CLI on `PATH`.
22
31
  - [Project management](#project-management)
23
32
  - [Task management](#task-management)
24
33
  - [Task deletion](#task-deletion)
34
+ - [Task discussion threads](#task-discussion-threads)
25
35
  - [Task attachments](#task-attachments)
26
36
  - [Worker configuration and startup](#worker-configuration-and-startup)
27
37
  - [Worker manual management](#worker-manual-management)
@@ -148,13 +158,15 @@ daynight project list [--json]
148
158
  daynight project show <project-id> [--json]
149
159
  daynight task
150
160
  daynight task create --title <title> [options]
151
- daynight task list [--all | --status <status>] [--ready] [--json] [--project <project-id>]
161
+ daynight task list [--all | --status <status>] [--ready] [--assigned-to <assignee>] [--json] [--project <project-id>]
152
162
  daynight task ready [--limit <N>] [--json] [--project <project-id>]
153
163
  daynight task show <task-id> [--json] [--project <project-id>]
154
164
  daynight task update <task-id> [options]
155
165
  daynight task set-status <task-id> <status> [--claim-id <claim-id>] [--if-version <version>] [--project <project-id>]
156
166
  daynight task delete <task-id> [--remove-depends] [--if-version <version>] [--project <project-id>]
157
167
  daynight task graph <task-id> [--depends-only] [--json] [--project <project-id>]
168
+ daynight task thread read <task-id> [--before-id <message-id> | --after-id <message-id>] [--count=N] [--details] [--project <project-id>]
169
+ daynight task thread post <task-id> --body <text> [--reply-to <message-id>] [--claim-id <claim-id>] [--project <project-id>]
158
170
  daynight task attachment
159
171
  daynight task attachment put <task-id> <file> [--path <relative-path>] [--project <project-id>]
160
172
  daynight task attachment list <task-id> [--tree | --json] [--project <project-id>]
@@ -417,9 +429,7 @@ keep the credential name within 100 characters. The credential never expires by
417
429
  The Web account's token manager can set a future expiration, restore “Never expires”, or
418
430
  revoke it. Changing expiration keeps the same credential, so the saved CLI login
419
431
  continues without replacing its secret. Expired or revoked credentials cannot be
420
- revived. The [token manager mockup](../../packages/daynight-web/tests/mockups/tokens.html)
421
- shares the production components and styles for creating tokens and editing
422
- expiration, including conflict and uncertain-result states. A credential
432
+ revived. A credential
423
433
  represents the account's current project permissions. `daynight logout` revokes the current credential and removes
424
434
  its local value after a confirmed response; an already invalid credential is
425
435
  removed locally. Network or unconfirmed failures remain visible. Configuration
@@ -553,6 +563,8 @@ daynight task list --allow-agents false --ready
553
563
  daynight task list --ready
554
564
  daynight task list --all --json
555
565
  daynight task list --status in_progress --json
566
+ daynight task list --ready --assigned-to me --json
567
+ daynight task list --assigned-to unassigned --json
556
568
  daynight task show <task-id> --json
557
569
  daynight task properties <task-id> --json
558
570
  daynight task properties --schema --json
@@ -563,6 +575,9 @@ daynight task update <task-id> --allow-agents true --if-version <version>
563
575
  daynight task create --title "Check Windows build" --required-platform windows
564
576
  daynight task update <task-id> --required-platform macos --if-version <version>
565
577
  daynight task update <task-id> --clear-required-platform --if-version <version>
578
+ daynight task create --title "Review installation" --assigned-to <user-uuid>
579
+ daynight task update <task-id> --assigned-to <user-uuid> --if-version <version>
580
+ daynight task update <task-id> --clear-assigned-to --if-version <version>
566
581
  daynight task set-status <task-id> <status> [--claim-id <claim-id>] [--if-version <version>] [--project <project-id>]
567
582
  daynight task update <task-id> --depends-on <task-a> --depends-on <task-b>
568
583
  daynight task update <task-id> --clear-dependencies
@@ -600,7 +615,7 @@ in the root `.gitignore`. A cached binding is verified against the server on eac
600
615
  use and remains stable if another project later shares that repository.
601
616
 
602
617
  Creation starts in `todo` with `allowAgents=false` and unrestricted
603
- `requiredPlatform=null` unless explicitly set. Unset properties remain absent;
618
+ `requiredPlatform=null` and `assignedTo=null` unless explicitly set. Unset properties remain absent;
604
619
  creation does not inject a PR array or worker null. `task set-status <id> <status>`
605
620
  sets `todo`, `in_progress` or `done`, including reopening and direct completion.
606
621
  Every project member may use ordinary status setting. Active worker completion
@@ -622,7 +637,7 @@ Entering in_progress or done requires all direct prerequisites, ordinary and
622
637
  external, to be done. Reopening done requires no direct in-progress or done
623
638
  dependents. Refusals return sorted blocking task IDs without cascading changes.
624
639
  The project transaction serializes status and dependency writes and preserves
625
- materials, properties/PRs, permission, both dependency sets and attachments.
640
+ materials, assignedTo, properties/PRs, permission, both dependency sets and attachments.
626
641
 
627
642
  Migration `014_task_status_assignment.sql` converts historical proposed rows
628
643
  to todo, increments only those versions and updates their update time while
@@ -728,7 +743,26 @@ service order across all pages. This order applies to human and JSON results.
728
743
  `task ready` accepts neither `--status` nor `--cursor`. `task list` supports the
729
744
  same permission and compatibility filters across every matching page. Both are
730
745
  automatic-selection conditions independent of readiness; explicitly designated
731
- execution retains the manual exception.
746
+ execution retains the manual exception. List also accepts
747
+ `--assigned-to <user-uuid|me|unassigned>`, combined with its other filters and
748
+ preserved across every page. `task ready` has no assignee option; use
749
+ `task list --ready --assigned-to me` for that intersection. Automatic acquisition
750
+ requires the task to be assigned to the worker's authenticated account, in addition
751
+ to permission and other eligibility checks. Existing claim inventory and manual
752
+ control remain execution-based; the
753
+ [self-assigned acquisition decision](../../.agents/notes/implemented/architecture/2026-11-03-worker-self-assigned-claims.md)
754
+ owns the runtime rule.
755
+
756
+ For `me`, each successful task-page response must carry one canonical
757
+ Daynight-User-ID, even when its items array is empty. A complete list traversal
758
+ binds its first successful page to that identity and rejects a different later
759
+ principal or a task assigned to someone else. The binding is per traversal, not
760
+ a global client cache. UUID and unassigned filters also verify every result;
761
+ mismatches are protocol errors, not locally discarded rows. No extra `/me`
762
+ request is issued. Non-me requests without a configured expectedUserId retain
763
+ their existing optional-header behavior. Error responses retain the existing
764
+ service-error and configured-principal admission behavior; me adds no new
765
+ error-response header requirement.
732
766
 
733
767
  Updates preserve omitted fields; an empty description clears it. Repeated
734
768
  `--depends-on` and `--external-depends-on` declare the complete ordinary and
@@ -738,8 +772,18 @@ only those external edges. IDs are canonicalized and sorted; malformed and
738
772
  case-equivalent duplicate/cross-declared UUIDs fail before configuration or
739
773
  network access. `--clear-dependencies` sends two empty sets and conflicts with
740
774
  either dependency option. An update needs at least one mutable
741
- field. `--allow-agents true|false` explicitly changes automatic-execution
742
- permission; omitted preserves it. Creation rejects the option. Existing tasks
775
+ field. Create/update accept `--assigned-to <user-uuid>`; update also accepts
776
+ `--clear-assigned-to` to send null. Omission preserves an existing assignee; the
777
+ set/clear options conflict, and invalid UUIDs or combinations fail before
778
+ configuration, Git or HTTP access. Writes accept UUIDs, not the list tokens
779
+ me/unassigned. A real assignment change atomically sets allowAgents=false; an
780
+ equal assignment causes no permission reset; a pure equal update preserves
781
+ version and timestamps. Other supplied fields keep their ordinary mutation
782
+ rules. Actual changes are refused while in_progress. Assignment grants neither project access nor
783
+ control of another worker, Session or archive.
784
+
785
+ `--allow-agents true|false` explicitly changes automatic-execution permission;
786
+ omission preserves it when assignment does not change. Creation rejects the option. Existing tasks
743
787
  receive true through migration without changing versions or business timestamps.
744
788
  A matching same-value permission PATCH retains version and time, while a stale
745
789
  version still conflicts and an actual in-progress toggle fails atomically.
@@ -752,8 +796,12 @@ are refused atomically. Explicit manual status setting remains available for eve
752
796
  requirement. The query platform selects candidates; it does not configure or
753
797
  prove the environment of a future worker.
754
798
  By default the CLI reads the task version before PATCH; `--if-version <n>`
755
- uses that exact positive int64 version. Conflicts and failed writes are reported
756
- without automatic retries.
799
+ uses that exact positive int64 version without a task pre-read. Existing project
800
+ resolution/admission still applies. Null clearing is serialized literally; only
801
+ undefined fields are omitted. A normal write consumes the full Task response
802
+ without a post-write GET or a name lookup. A combined update may advance its
803
+ version for other fields, so v+1 alone does not establish an assignee change.
804
+ Conflicts and failed writes are reported without automatic retries.
757
805
 
758
806
  Text options accept both separated values and `--option=value`. Inline assignment
759
807
  splits at the first equals sign and supports leading dashes, such as
@@ -764,29 +812,35 @@ inline assignment. Attachment `put` declares its `--path` as text, accepting
764
812
  paths starting with a dash. Property set/remove also accept this terminator for
765
813
  literal property/value positionals; other operations retain their declared syntax.
766
814
 
767
- The internal typed ApiClient accepts optional `workerId` on TaskFilters and
768
- TaskPageQuery. It requests only the authenticated user/worker active claims and
769
- validates active state and matching worker ID in responses. `listTasks` returns
815
+ The internal typed ApiClient accepts optional `assignedTo` and `workerId` on
816
+ TaskFilters and TaskPageQuery. Assignment selectors accept `me`, `unassigned` or
817
+ a user UUID; the worker uses `me` for new candidates across every page. With
818
+ workerId, the client requests only the authenticated user/worker active claims
819
+ and validates active state and matching worker ID in responses. `listTasks` returns
770
820
  only after every page succeeds; `listTaskPage` remains partial. A workerId-only
771
821
  traversal across all relevant projects provides ownership inventory; extra filters
772
- or incomplete pages cannot authorize cleanup. This field is not a public task CLI
773
- option.
822
+ or incomplete pages cannot authorize cleanup. These filters are not public task
823
+ CLI options.
774
824
 
775
825
  Human task lists use labeled blocks containing ID, project, title, complete
776
826
  properties, status, readiness, automatic-execution permission, required platform,
777
- dependencies and blocking. Property rows are ordered by name and rendered as
827
+ assignee, dependencies and blocking. Property rows are ordered by name and rendered as
778
828
  terminal-safe JSON; missing keys are not replaced with default values.
779
829
  Description, version and timestamps
780
830
  remain available in show, ready, create and update output. Graph nodes include
781
- state, permission, required platform, dependencies, blocking and title-preview truncation flags.
831
+ state, permission, required platform, assignee, dependencies, blocking and
832
+ title-preview truncation flags.
782
833
  Task and graph decoders require a boolean `allowAgents`; missing, null or
783
834
  nonboolean values are protocol errors. They also require `requiredPlatform`
784
835
  as null or one of the three platform enums; missing keys or other values fail
785
836
  without a runtime default. Human output uses `Required platform: any` for null
786
- and the enum otherwise. Queries support
837
+ and the enum otherwise. `assignedTo` is also required as null or a canonical
838
+ local user UUID on every Task and graph node; missing, malformed or noncanonical
839
+ values fail instead of defaulting. Human output adds `Assigned to: USER_UUID` or
840
+ `Assigned to: unassigned`, with no profile request or rule narration. Task metadata queries support
787
841
  `--json`: task `list` returns every matching task in one array, omitting only
788
- `description` while retaining every other API field, including raw PR strings,
789
- version and timestamps. This applies to the default list and every filter,
842
+ `description` while retaining every other API field, including explicit nullable
843
+ assignedTo, raw PR strings, version and timestamps. This applies to the default list and every filter,
790
844
  including `--all`. Project lists retain all API fields. Task `ready` returns its
791
845
  selected full tasks as an array, details return one full resource, and graphs
792
846
  return the selected task-chain API object unless `--depends-only` projects the
@@ -904,6 +958,68 @@ outcome unknown. The [deletion requirements](../../docs/spec/daynight-task-delet
904
958
  and [design](../../docs/design/daynight-task-deletion.md) own retained history,
905
959
  reference removal and cache invalidation.
906
960
 
961
+ ## Task discussion threads
962
+
963
+ ```bash
964
+ daynight task thread read <task-id>
965
+ daynight task thread read <task-id> --after-id <last-read-message-id> --count=20
966
+ daynight task thread read <task-id> --before-id <first-shown-message-id> --count=20
967
+ daynight task thread read <task-id> --details --project <project-id>
968
+ daynight task thread post <task-id> --body 'What should the retry policy be?'
969
+ daynight task thread post <task-id> --body 'Use an explicit retry decision.' --reply-to <message-id>
970
+ daynight task thread post <task-id> --body 'The check passed.' --claim-id <active-claim-id>
971
+ ```
972
+
973
+ A Thread holds durable discussion independently of task execution. Reads and
974
+ posts work before execution, while its original environment is offline, and
975
+ after completion. Messages are immutable and replies refer to messages in the
976
+ selected task. Posting neither changes task metadata nor wakes an Agent.
977
+ Descriptions and attachments remain the owners of effective requirements,
978
+ solutions and formal results; Sessions hold execution content.
979
+
980
+ Read fetches one page, defaulting to the latest messages. `--count=N` accepts
981
+ 1 through 100 and defaults to 20; the CLI always sends that value explicitly.
982
+ `--before-id` and `--after-id` are mutually exclusive. Messages display from old
983
+ to new with complete Id, Author and account Id, millisecond UTC CreatedAt,
984
+ optional ReplyTo, and complete Message. Agent authors also have `Agent: True`.
985
+ `--details` expands verified claim, worker and provider attribution. Thread
986
+ commands provide readable text and do not accept `--json`.
987
+
988
+ `... Has more messages before` appears above a page with earlier messages;
989
+ `Has more messages after...` appears below a page with later messages. Continue
990
+ history with the first displayed Id and incremental reading with the last
991
+ fully consumed displayed Id. The 256 KiB output budget can reduce the page
992
+ below its requested count; complete messages remain contiguous and bodies are
993
+ never truncated. A post receipt cannot advance the read position: after reading
994
+ A, another person's B and a local post C must still be read from A.
995
+
996
+ Post requires nonblank `--body`, preserving its original whitespace. For text
997
+ beginning with a dash, use `--body=-example`. The service generates the message
998
+ Id and authenticates the author. Omit `--claim-id` for an ordinary account post;
999
+ provide a current claim explicitly for verified Agent attribution. The CLI does
1000
+ not infer a claim or accept a client message Id, version or submission token.
1001
+ `--reply-to` is optional and must identify a message in the same task.
1002
+
1003
+ Terminal text escapes dangerous controls. Multiline Message lines are indented,
1004
+ retain LF and TAB, and encode literal backslashes before visible control
1005
+ escapes; DEL is `\x7f`, CR is `\r`, and other unsafe controls use `\uXXXX`.
1006
+ The representation preserves the full body without executing terminal escapes.
1007
+ Success prints `Message posted.`, the complete Id and optional ReplyTo, without
1008
+ repeating the body. An uncertain post exits with a clear unknown-outcome message.
1009
+ Read the Thread before deciding whether to send again; equal text cannot prove
1010
+ that a particular request succeeded. The CLI never automatically repeats POST.
1011
+
1012
+ The [Thread requirements](../../docs/spec/daynight-task-thread.md) own the
1013
+ service contract; the [CLI design](../../docs/design/task-thread-cli.md) owns
1014
+ source validation, rendering and submission confirmation. Explicit `--project`
1015
+ uses the supplied UUID directly for the Thread request; otherwise the existing
1016
+ Git binding resolves the project. Origin and credential remain fixed for one
1017
+ invocation. Argument errors exit 2 before configuration or network access;
1018
+ other failures exit 1. Diagnostics remain on stderr and exclude message bodies
1019
+ and untrusted server text. A confirmed post followed by a local receipt-output
1020
+ or cleanup failure retains its confirmed message Id and is not reported as an
1021
+ unknown remote result.
1022
+
907
1023
  ## Task attachments
908
1024
 
909
1025
  Attachment commands use the existing project selection and server configuration:
@@ -951,10 +1067,11 @@ records binary transport and output ownership.
951
1067
  ## Worker configuration and startup
952
1068
 
953
1069
  `daynight worker run` is a foreground reconciler. It claims eligible ready tasks
954
- across configured repositories, runs native agents through the claim's Herdr or
1070
+ assigned to its authenticated account across configured repositories, runs native agents through the claim's Herdr or
955
1071
  Web backend, and cleans resources when the original claim leaves its complete
956
1072
  inventory. The agent owns delivery, acceptance, evidence and final claim-bound
957
- completion.
1073
+ completion. Worker follows the CLI platform support policy: Linux, Windows and
1074
+ Apple Silicon (ARM64) macOS.
958
1075
 
959
1076
  The running worker reports an account-owned runtime snapshot immediately after
960
1077
  identity and authentication are ready, every 30 seconds, and after complete task
@@ -1229,7 +1346,13 @@ its migration sequence; the [SQLite migration requirements](../../docs/spec/cli-
1229
1346
  define atomicity, ownership blockers and supported starting formats.
1230
1347
 
1231
1348
  Each reconciliation obtains the complete own-claim inventory for configured and
1232
- saved Projects. Still-owned local active tasks are queued for fresh target
1349
+ saved Projects using only workerId. Assignment does not filter this inventory:
1350
+ existing executions retain their recovery and cleanup authority. New candidates
1351
+ combine assignedTo=me, ready, automatic permission and actual platform before
1352
+ server pagination; the claim transaction rechecks the assignee against the
1353
+ authenticated user ID. Unassigned tasks and tasks assigned to another account
1354
+ are ineligible for automatic acquisition. Explicit manual resume retains its
1355
+ original execution-owner/admin rules. Still-owned local active tasks are queued for fresh target
1233
1356
  observation and recovery before global Git discovery, so a sibling checkout's
1234
1357
  filesystem error does not block an already-reserved task. New pending startup
1235
1358
  and new claims still require complete global resource discovery. Failed or
@@ -1594,6 +1717,10 @@ daynight worker resume <task-id> --claim-id <released-claim-id> --if-version <ve
1594
1717
  ```
1595
1718
 
1596
1719
  Resume requires the previous released claim, ready task and original owner/admin.
1720
+ Remote Worker control reads the caller's current `/projects/{id}/access`
1721
+ projection for administrator authority and verifies its project/principal binding;
1722
+ member profile reads retain their separate directory responsibility. Grant
1723
+ versions preserve the full positive int64 range.
1597
1724
  It preserves the explicit manual permission/platform exception, obtains fresh
1598
1725
  claim/worktree identities with current settings, and registers pending with a
1599
1726
  NULL native session ID. Start run to execute it.
@@ -1,5 +1,6 @@
1
+ import type { ThreadReadQuery, PostThreadMessageInput, ThreadMessage, ThreadPage } from "./types.js";
1
2
  import type { Operation } from "./operation.js";
2
- import type { AttachmentConsumer, CreateProjectInput, CreateTaskInput, DeleteTaskInput, ErrorDetails, Project, ProjectMember, PutTaskAttachmentInput, ReadyTaskFilters, ServerError, Task, SetTaskStatusInput, TaskAttachment, TaskFilters, TaskGraph, UpdateTaskInput, ClaimWorkerTaskInput, CompleteWorkerTaskInput, ReleaseWorkerClaimInput, ResumeWorkerTaskInput, WithdrawWorkerClaimInput, UpdateWorkerClaimInput, User, Page, TaskPageQuery, WorkerReport, WorkerReportReceipt, TaskPropertyResource, TaskPropertySchema, SetTaskPropertyInput, RemoveTaskPropertyInput } from "./types.js";
3
+ import type { AttachmentConsumer, CreateProjectInput, CreateTaskInput, DeleteTaskInput, ErrorDetails, Project, ProjectAccess, ProjectMember, PutTaskAttachmentInput, ReadyTaskFilters, ServerError, Task, SetTaskStatusInput, TaskAttachment, TaskFilters, TaskGraph, UpdateTaskInput, ClaimWorkerTaskInput, CompleteWorkerTaskInput, ReleaseWorkerClaimInput, ResumeWorkerTaskInput, WithdrawWorkerClaimInput, UpdateWorkerClaimInput, User, Page, TaskPageQuery, WorkerReport, WorkerReportReceipt, TaskPropertyResource, TaskPropertySchema, SetTaskPropertyInput, RemoveTaskPropertyInput } from "./types.js";
3
4
  type Context = {
4
5
  readonly operation: string;
5
6
  readonly projectId?: string;
@@ -17,19 +18,24 @@ export declare class ApiError extends Error {
17
18
  readonly details?: ErrorDetails;
18
19
  readonly outcomeUnconfirmed: boolean;
19
20
  readonly confirmedRefusal: boolean;
21
+ readonly confirmedMessageId?: string;
20
22
  constructor(context: Context, phase: ApiPhase, options: {
21
23
  readonly cause: unknown;
22
24
  readonly status?: number;
23
25
  readonly serverError?: ServerError;
24
26
  readonly outcomeUnconfirmed?: boolean;
25
27
  readonly confirmedRefusal?: boolean;
28
+ readonly confirmedMessageId?: string;
26
29
  });
27
30
  }
28
31
  export type ApiClient = {
32
+ readTaskThread(projectId: string, taskId: string, query: ThreadReadQuery): Promise<ThreadPage>;
33
+ postTaskThreadMessage(projectId: string, taskId: string, input: PostThreadMessageInput): Promise<ThreadMessage>;
29
34
  getCurrentUser(): Promise<User>;
30
35
  reportWorker(workerId: string, input: WorkerReport): Promise<WorkerReportReceipt>;
31
36
  createProject(input: CreateProjectInput): Promise<Project>;
32
37
  getProject(projectId: string): Promise<Project>;
38
+ getProjectAccess(projectId: string): Promise<ProjectAccess>;
33
39
  listProjects(): Promise<readonly Project[]>;
34
40
  listProjectMembers(projectId: string): Promise<readonly ProjectMember[]>;
35
41
  createTask(projectId: string, input: CreateTaskInput): Promise<Task>;