@ours.network/fleet 0.18.0-nightly.6 → 0.18.0

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 (67) hide show
  1. package/README.md +111 -43
  2. package/dist/application/fleet-query-service.js +12 -0
  3. package/dist/application/role-creation-service.js +3 -1
  4. package/dist/application/types.d.ts +11 -0
  5. package/dist/briefing.js +9 -2
  6. package/dist/build-info.json +7 -6
  7. package/dist/capabilities.d.ts +3 -1
  8. package/dist/capabilities.js +3 -0
  9. package/dist/cli.js +83 -7
  10. package/dist/config.d.ts +11 -3
  11. package/dist/config.js +40 -15
  12. package/dist/creation.d.ts +14 -15
  13. package/dist/creation.js +19 -13
  14. package/dist/docs.d.ts +1 -1
  15. package/dist/docs.js +117 -35
  16. package/dist/doctor.d.ts +1 -5
  17. package/dist/doctor.js +11 -18
  18. package/dist/fleet-proxy.d.ts +5 -0
  19. package/dist/harness/acp-agent.js +11 -6
  20. package/dist/harness/claude-code.js +204 -11
  21. package/dist/harness/codex.d.ts +4 -1
  22. package/dist/harness/codex.js +74 -12
  23. package/dist/harness/types.d.ts +54 -4
  24. package/dist/harness-plugins.d.ts +48 -0
  25. package/dist/harness-plugins.js +309 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/index.js +1 -0
  28. package/dist/loops/manager.d.ts +30 -1
  29. package/dist/loops/manager.js +69 -6
  30. package/dist/loops/state.d.ts +18 -0
  31. package/dist/loops/state.js +4 -0
  32. package/dist/model-env.d.ts +71 -0
  33. package/dist/model-env.js +106 -0
  34. package/dist/monitor.js +1 -1
  35. package/dist/ops.js +1 -1
  36. package/dist/owner-channel/attachments.d.ts +2 -25
  37. package/dist/owner-channel/attachments.js +5 -61
  38. package/dist/owner-channel/channel.d.ts +30 -29
  39. package/dist/owner-channel/channel.js +291 -291
  40. package/dist/owner-channel/mcp.d.ts +24 -0
  41. package/dist/owner-channel/mcp.js +145 -0
  42. package/dist/owner-channel/notices.d.ts +7 -0
  43. package/dist/owner-channel/notices.js +9 -0
  44. package/dist/resolved-plan.js +1 -0
  45. package/dist/runner.d.ts +48 -0
  46. package/dist/runner.js +237 -85
  47. package/dist/session/acp.d.ts +104 -0
  48. package/dist/session/acp.js +213 -10
  49. package/dist/session/activity.d.ts +31 -0
  50. package/dist/session/activity.js +48 -0
  51. package/dist/session/conversation-normalizer.d.ts +6 -0
  52. package/dist/session/conversation-normalizer.js +153 -10
  53. package/dist/session/conversation-types.d.ts +23 -4
  54. package/dist/session/types.d.ts +35 -0
  55. package/dist/spawn.js +29 -17
  56. package/dist/supervisor/systemd.js +2 -29
  57. package/dist/watchdog/briefing.js +7 -0
  58. package/dist/web-app/assets/{TerminalView-BAVk1Bot.js → TerminalView-C_G1ID2P.js} +1 -1
  59. package/dist/web-app/assets/{index-C3S-xFRU.js → index-BCBK78hw.js} +5 -5
  60. package/dist/web-app/index.html +1 -1
  61. package/dist/worklog.d.ts +7 -1
  62. package/dist/worklog.js +191 -39
  63. package/package.json +1 -3
  64. package/dist/owner-channel/message-recovery.d.ts +0 -25
  65. package/dist/owner-channel/message-recovery.js +0 -114
  66. package/dist/owner-channel/ours-client.d.ts +0 -148
  67. package/dist/owner-channel/ours-client.js +0 -231
@@ -1,8 +1,10 @@
1
+ import { type ChildProcessWithoutNullStreams } from 'node:child_process';
1
2
  import { type OwnerChannelConfig } from '../config.js';
3
+ import { type FetchLike } from '../monitor.js';
2
4
  import { type SessionHandle } from '../session/types.js';
3
5
  import { type OwnerFleetOps } from './commands.js';
4
6
  import type { ManagedFleetSpawnResult } from '../fleet-proxy.js';
5
- import { type OursOps } from './ours-client.js';
7
+ import { type OursToolClient } from './mcp.js';
6
8
  import { type OwnerUpdatePhase } from './notices.js';
7
9
  import { type OwnerEntry } from './state.js';
8
10
  import { type OwnerTaskPhase } from './tasks.js';
@@ -15,8 +17,15 @@ export interface OwnerChannelOptions {
15
17
  session: SessionHandle;
16
18
  stateDir: string;
17
19
  env?: Record<string, string>;
20
+ command?: string;
18
21
  log(line: string): void;
19
- client?: OursOps;
22
+ client?: OursToolClient;
23
+ /** Legacy child-process test seam; production uses the direct notification API. */
24
+ watch?: (identity: string) => ChildProcessWithoutNullStreams;
25
+ /** Test seam for the production direct notification long-poll. */
26
+ watchFetch?: FetchLike;
27
+ /** Test seam for the long-poll stall bound; production uses OWNER_WATCH_STALL_MS. */
28
+ watchStallMs?: number;
20
29
  /** Test seam; production uses the detached ours-fleet CLI (`fleetCliOps`). */
21
30
  fleet?: OwnerFleetOps;
22
31
  /** Forwarded to fleet CLI invocations spawned for owner commands. */
@@ -109,13 +118,7 @@ export type { OwnerUpdatePhase } from './notices.js';
109
118
  export interface OwnerContact {
110
119
  cid: string;
111
120
  name: string;
112
- /** Structural, from which daemon collection the row came: established or pending. */
113
121
  status: string;
114
- /**
115
- * Retained for the `ours-fleet owner contact list` column. The daemon's typed
116
- * contact view has no such field, so it is always absent; it is not inferred
117
- * from anything a contact controls.
118
- */
119
122
  kind?: string;
120
123
  human?: {
121
124
  cid?: string;
@@ -133,7 +136,6 @@ export declare class OwnerChannel implements OwnerChannelHandle {
133
136
  private readonly authorizations;
134
137
  private readonly conversations;
135
138
  private readonly tasks;
136
- private readonly messageRecovery;
137
139
  private readonly attachmentRecovery;
138
140
  private readonly attachmentConfig;
139
141
  private readonly attachmentRoot;
@@ -142,7 +144,7 @@ export declare class OwnerChannel implements OwnerChannelHandle {
142
144
  * (a crash must replay them) but must not be queued twice while live.
143
145
  */
144
146
  private readonly inFlight;
145
- /** Wires already NACKed to the managed agent, so a history replay stays quiet. */
147
+ /** Wires already NACKed to the managed agent, so a deferred replay stays quiet. */
146
148
  private readonly relayNacks;
147
149
  /**
148
150
  * fleet.yaml declares the restart baseline; `/comments on|off` changes only
@@ -153,6 +155,7 @@ export declare class OwnerChannel implements OwnerChannelHandle {
153
155
  private readonly commentsBaseline;
154
156
  private commentsEnabled;
155
157
  private stopping;
158
+ private watchProcess?;
156
159
  private watchTask?;
157
160
  private watchAbort?;
158
161
  private drainTask?;
@@ -171,12 +174,6 @@ export declare class OwnerChannel implements OwnerChannelHandle {
171
174
  manage(request: OwnerChannelManagementRequest): Promise<OwnerChannelManagementResult>;
172
175
  notifyFleetSpawn(event: ManagedFleetSpawnResult): Promise<void>;
173
176
  private manageNow;
174
- /**
175
- * The daemon reports established contacts and pending introductions as two
176
- * separate collections, so the status is structural rather than a word parsed
177
- * out of a rendered line. Nothing here can be spoofed by a contact's own
178
- * display name.
179
- */
180
177
  private contacts;
181
178
  private contact;
182
179
  private assertCid;
@@ -190,15 +187,6 @@ export declare class OwnerChannel implements OwnerChannelHandle {
190
187
  private safeTaskReport;
191
188
  private safeProactiveMessage;
192
189
  private drainAll;
193
- /**
194
- * Claim the exact oldest unread SQLite batch before marking it read.
195
- * The journal contains only wire IDs and sequence numbers; bodies remain in
196
- * the daemon's persistent history and are recovered with getHistoryItem.
197
- */
198
- private claimMessages;
199
- private messageClaim;
200
- private historyMessage;
201
- private attachmentMetadata;
202
190
  private attachmentGroups;
203
191
  private handleAttachmentGroup;
204
192
  private handle;
@@ -236,7 +224,7 @@ export declare class OwnerChannel implements OwnerChannelHandle {
236
224
  private managedAttachmentReplyWire;
237
225
  /**
238
226
  * One bounded NACK per wire: an unroutable or refused relay must be visible
239
- * to the authenticated agent, while its history replays stay quiet. NACK
227
+ * to the authenticated agent, while its deferred replays stay quiet. NACK
240
228
  * delivery is best-effort — it must never make the failure worse.
241
229
  */
242
230
  private nackManagedAgent;
@@ -250,6 +238,16 @@ export declare class OwnerChannel implements OwnerChannelHandle {
250
238
  private warnOwnerOfUnauthorizedSender;
251
239
  private effectiveOwners;
252
240
  private authorizationIntegrity;
241
+ /**
242
+ * Report what the session actually did with the prompt, not what the config
243
+ * asked for. `interrupt: true` used to be reported as "your request
244
+ * interrupted the previous task" unconditionally; the session now answers
245
+ * whether anything was cancelled, whether the request is queued behind
246
+ * earlier prompts, or whether it is held until the current task reaches a
247
+ * safe stopping point. Backends that report no delivery state keep the old
248
+ * queuedBehind-based wording.
249
+ */
250
+ private acceptanceNotice;
253
251
  private complete;
254
252
  private commentsState;
255
253
  /** Model-authored commentary only; raw protocol/tool data never reaches here. */
@@ -269,12 +267,15 @@ export declare class OwnerChannel implements OwnerChannelHandle {
269
267
  private progressPhase;
270
268
  private watchLoop;
271
269
  /**
272
- * `recovered` distinguishes a first-ever start from unreadable persisted
273
- * diagnostics. Notification correctness does not depend on this state: every
274
- * establishment drains and then replays SDK hints from offset zero.
270
+ * `recovered` distinguishes a first-ever start (no state, nothing lost) from a
271
+ * cursor we HAD and can no longer read. Only the latter is a recovery, and the
272
+ * caller needs to know because the reason it reports is the only evidence a
273
+ * durable cursor was ever lost.
275
274
  */
276
275
  private readWatchState;
277
276
  private writeWatchState;
277
+ /** Compatibility path for injected child-process tests; production is direct. */
278
+ private legacyWatchLoop;
278
279
  private errorText;
279
280
  private logError;
280
281
  }