@atolis-hq/wake 0.4.66 → 0.4.68

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 (86) hide show
  1. package/dist/src/artifacts/application/artifact-context-service.js +1 -0
  2. package/dist/src/artifacts/application/artifact-service.js +9 -4
  3. package/dist/src/artifacts/application/operator-instructions-projection.d.ts +4 -0
  4. package/dist/src/artifacts/application/operator-instructions-projection.js +19 -0
  5. package/dist/src/artifacts/application/operator-instructions-service.d.ts +25 -0
  6. package/dist/src/artifacts/application/operator-instructions-service.js +110 -0
  7. package/dist/src/artifacts/contracts/context-event-factory.js +2 -0
  8. package/dist/src/artifacts/contracts/context-events.d.ts +5 -1
  9. package/dist/src/artifacts/contracts/context-events.js +17 -2
  10. package/dist/src/artifacts/contracts/context.d.ts +17 -0
  11. package/dist/src/artifacts/contracts/context.js +11 -0
  12. package/dist/src/artifacts/contracts/paths.d.ts +3 -0
  13. package/dist/src/artifacts/contracts/paths.js +10 -0
  14. package/dist/src/artifacts/index.d.ts +2 -0
  15. package/dist/src/artifacts/index.js +2 -0
  16. package/dist/src/artifacts/infrastructure/file-artifact-store.d.ts +6 -0
  17. package/dist/src/artifacts/infrastructure/file-artifact-store.js +12 -5
  18. package/dist/src/artifacts/infrastructure/mcp-server.d.ts +2 -1
  19. package/dist/src/artifacts/infrastructure/mcp-server.js +22 -0
  20. package/dist/src/artifacts/infrastructure/mcp-session-store.d.ts +2 -1
  21. package/dist/src/artifacts/infrastructure/mcp-session-store.js +5 -1
  22. package/dist/src/bootstrap/artifact-mcp.d.ts +4 -2
  23. package/dist/src/bootstrap/artifact-mcp.js +53 -3
  24. package/dist/src/bootstrap/composition-root.d.ts +2 -1
  25. package/dist/src/bootstrap/composition-root.js +5 -1
  26. package/dist/src/bootstrap/initialise.js +63 -0
  27. package/dist/src/bootstrap/integration-runtime.js +17 -2
  28. package/dist/src/bootstrap/persistence-composition.js +4 -1
  29. package/dist/src/bootstrap/projection-runtime.js +2 -1
  30. package/dist/src/bootstrap/surface-api-execution-applications.js +16 -1
  31. package/dist/src/bootstrap/surface-api-trigger-applications.js +77 -4
  32. package/dist/src/bootstrap/surface-api-work-applications.js +38 -3
  33. package/dist/src/bootstrap/surface-cli-applications.js +1 -0
  34. package/dist/src/bootstrap/version.js +1 -1
  35. package/dist/src/conversations/contracts/events.js +2 -0
  36. package/dist/src/conversations/contracts/views.d.ts +5 -1
  37. package/dist/src/execution/application/execution-activity.d.ts +4 -0
  38. package/dist/src/execution/application/execution-activity.js +19 -0
  39. package/dist/src/execution/contracts/event-factory.js +2 -0
  40. package/dist/src/execution/contracts/events.d.ts +5 -0
  41. package/dist/src/execution/contracts/events.js +7 -0
  42. package/dist/src/execution/contracts/views.d.ts +4 -0
  43. package/dist/src/execution/domain/run.js +3 -0
  44. package/dist/src/integrations/application/conversation-command-feedback.d.ts +11 -0
  45. package/dist/src/integrations/application/conversation-command-feedback.js +36 -0
  46. package/dist/src/integrations/delivery/application/delivery-intent-lookup.d.ts +4 -0
  47. package/dist/src/integrations/delivery/application/delivery-intent-lookup.js +23 -0
  48. package/dist/src/integrations/delivery/application/delivery-outcome-reactor.js +4 -11
  49. package/dist/src/integrations/delivery/application/delivery-projector.js +7 -1
  50. package/dist/src/integrations/delivery/contracts/intents.d.ts +3 -1
  51. package/dist/src/integrations/delivery/contracts/intents.js +1 -1
  52. package/dist/src/integrations/delivery/contracts/views.d.ts +1 -0
  53. package/dist/src/integrations/github/application/agent-run-comment.js +7 -9
  54. package/dist/src/integrations/github/application/inbound-translator.js +13 -1
  55. package/dist/src/integrations/github/application/work-control-authorization.d.ts +6 -0
  56. package/dist/src/integrations/github/application/work-control-authorization.js +10 -0
  57. package/dist/src/integrations/index.d.ts +1 -0
  58. package/dist/src/integrations/index.js +1 -0
  59. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts +5 -1
  60. package/dist/src/node_modules/@atolis-hq/eventing/dist/store/event-journal.d.ts.map +1 -1
  61. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts +2 -2
  62. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.d.ts.map +1 -1
  63. package/dist/src/node_modules/@atolis-hq/eventing-filesystem/dist/file-event-journal.js +3 -1
  64. package/dist/src/orchestration/application/conversation-command-reactor.d.ts +16 -1
  65. package/dist/src/orchestration/application/conversation-command-reactor.js +34 -5
  66. package/dist/src/orchestration/application/conversation-command.d.ts +27 -4
  67. package/dist/src/orchestration/application/conversation-command.js +60 -22
  68. package/dist/src/orchestration/application/orchestration-service.d.ts +5 -8
  69. package/dist/src/orchestration/application/orchestration-service.js +93 -34
  70. package/dist/src/orchestration/domain/interpreter.d.ts +1 -1
  71. package/dist/src/orchestration/domain/interpreter.js +1 -1
  72. package/dist/src/orchestration/domain/operator-retry-policy.d.ts +2 -0
  73. package/dist/src/orchestration/domain/operator-retry-policy.js +24 -1
  74. package/dist/src/surfaces/api/contracts/execution.d.ts +7 -0
  75. package/dist/src/surfaces/api/contracts/triggers.d.ts +14 -0
  76. package/dist/src/surfaces/api/contracts/work.d.ts +3 -0
  77. package/dist/src/surfaces/api/http-server.d.ts +1 -0
  78. package/dist/src/surfaces/api/http-server.js +6 -2
  79. package/dist/src/surfaces/api/presenters/execution.js +3 -0
  80. package/dist/src/surfaces/api/routes/applications.d.ts +8 -2
  81. package/dist/src/surfaces/api/routes/commands.js +55 -12
  82. package/dist/src/surfaces/web-assets/assets/index-DVapiQjj.js +1192 -0
  83. package/dist/src/surfaces/web-assets/index.html +1 -1
  84. package/package.json +1 -1
  85. package/prompts/triage-assign.md +4 -0
  86. package/dist/src/surfaces/web-assets/assets/index-9IfrHvBo.js +0 -1192
@@ -3,9 +3,9 @@ import { z } from 'zod';
3
3
  import { activationId, ActivityOutcomeKind } from '../../../activities/index.js';
4
4
  import { brandedStringSchema, offsetIsoTimestampSchema } from '../../../kernel/index.js';
5
5
  import { ActivityActivationStatus, workflowInstanceId, } from '../../../orchestration/index.js';
6
- import { IntegrationStreamKind } from '../../contracts/streams.js';
7
6
  import { DeliveryEventType, selectDeliveryEvent, } from '../contracts/events.js';
8
- import { DeliveryIntentKind, DeliveryResultKind } from '../contracts/vocabulary.js';
7
+ import { DeliveryResultKind } from '../contracts/vocabulary.js';
8
+ import { conversationDeliveryIntent, isPublicationOnlyDelivery } from './delivery-intent-lookup.js';
9
9
  const deliveryResultSignalKind = 'delivery-result';
10
10
  export const DeliveryOutcomeProcessorConsumer = 'reactor:delivery-outcomes';
11
11
  const pendingConsumer = DeliveryOutcomeProcessorConsumer;
@@ -120,6 +120,8 @@ export class DeliveryOutcomeReactor {
120
120
  // Optional conversation provenance must not block delivery reconciliation.
121
121
  console.error(`Conversation provenance recording failed for ${delivery.eventId}`, error);
122
122
  }
123
+ if (await isPublicationOnlyDelivery(this.projections, delivery.payload.intentEventId))
124
+ return true;
123
125
  const command = {
124
126
  workflowInstanceId: workflowInstanceId(delivery.payload.workflowInstanceId),
125
127
  activationId: activationId(delivery.payload.activationId),
@@ -224,12 +226,3 @@ function isConfirmedDelivery(delivery) {
224
226
  function confirmedExternalId(delivery) {
225
227
  return delivery.eventType === DeliveryEventType.Failed ? undefined : delivery.payload.externalId;
226
228
  }
227
- async function conversationDeliveryIntent(projections, intentEventId) {
228
- const intent = (await projections.list(IntegrationStreamKind.Delivery)).find((candidate) => candidate.value.intentEventId === intentEventId)?.value;
229
- if (intent?.payload.kind !== DeliveryIntentKind.AgentRunPublish ||
230
- !('conversationId' in intent.payload) ||
231
- intent.payload.conversationId === undefined ||
232
- intent.payload.conversationEntryId === undefined)
233
- return undefined;
234
- return intent;
235
- }
@@ -141,7 +141,13 @@ function integrationIntentView(integrationIntent) {
141
141
  resourceId: integrationIntent.event.payload.resourceId,
142
142
  payload: status
143
143
  ? { kind: DeliveryIntentKind.StatusPublish, body: integrationIntent.event.payload.body }
144
- : { kind: DeliveryIntentKind.ReplyPublish, body: integrationIntent.event.payload.body },
144
+ : {
145
+ kind: DeliveryIntentKind.ReplyPublish,
146
+ body: integrationIntent.event.payload.body,
147
+ ...(integrationIntent.event.payload.publicationOnly === true
148
+ ? { publicationOnly: true }
149
+ : {}),
150
+ },
145
151
  state: DeliveryState.Pending,
146
152
  attempts: 0,
147
153
  occurrenceOrdinal: 0,
@@ -44,7 +44,9 @@ interface AgentRunPublishRequestedPayload {
44
44
  }
45
45
  export interface DeliveryIntentEventPayloads {
46
46
  readonly [DeliveryIntentEventType.StatusPublishRequested]: PublishRequestedPayload;
47
- readonly [DeliveryIntentEventType.ReplyPublishRequested]: PublishRequestedPayload;
47
+ readonly [DeliveryIntentEventType.ReplyPublishRequested]: PublishRequestedPayload & {
48
+ readonly publicationOnly?: true | undefined;
49
+ };
48
50
  readonly [DeliveryIntentEventType.AgentRunPublishRequested]: AgentRunPublishRequestedPayload;
49
51
  }
50
52
  export type DeliveryIntentEvent = EventUnion<DeliveryIntentEventPayloads, ResourceStreamRef>;
@@ -63,7 +63,7 @@ const intentEventSchema = z
63
63
  eventEnvelopeSchema.extend({
64
64
  event: eventDataSchema.extend({
65
65
  eventType: z.literal(DeliveryIntentEventType.ReplyPublishRequested),
66
- payload: publishSchema,
66
+ payload: publishSchema.extend({ publicationOnly: z.literal(true).optional() }),
67
67
  }),
68
68
  stream: resourceStreamSchema,
69
69
  }),
@@ -28,6 +28,7 @@ export interface DeliveryIntentView {
28
28
  } | {
29
29
  readonly kind: typeof DeliveryIntentKind.ReplyPublish;
30
30
  readonly body: string;
31
+ readonly publicationOnly?: true;
31
32
  } | {
32
33
  readonly kind: typeof DeliveryIntentKind.AgentRunPublish;
33
34
  readonly report: AgentRunPublicationReport;
@@ -8,9 +8,13 @@ export function formatAgentRunComment(value) {
8
8
  value.displayBody.trim() || fallback(value.outcome),
9
9
  ];
10
10
  if (value.awaitingApproval === true)
11
- sections.push('_To approve this work, reply with /approved. To request changes, reply with /changes followed by your feedback. To ask a question without requesting changes, reply with /ask followed by your question._');
11
+ sections.push('_An authorized independent reviewer can reply with /approved or /changes followed by feedback. Approval of your own work is not permitted. To ask a question, reply with /ask followed by your question._');
12
12
  if (value.outcome === 'BLOCKED' || value.outcome === 'NEEDS_CLARIFICATION')
13
- sections.push('_Reply on this thread to continue. To request changes instead, reply with /changes followed by your feedback._');
13
+ sections.push(value.outcome === 'NEEDS_CLARIFICATION'
14
+ ? '_Reply with the requested clarification. A maintainer with repository write, maintain, or admin permission can also use /changes followed by instructions to continue eligible blocked work._'
15
+ : '_A maintainer with repository write, maintain, or admin permission can continue eligible blocked work with /changes followed by instructions, including on an issue they authored. The authenticated UI also offers Continue with instructions. /retry is for eligible failed stages._');
16
+ if (value.outcome === 'FAILED')
17
+ sections.push('_An authorized maintainer can use /retry for an eligible failed stage, or /restart for a fresh session. These commands do not continue a blocked outcome._');
14
18
  const session = sessionSection(value);
15
19
  if (session !== undefined)
16
20
  sections.push(session);
@@ -59,13 +63,7 @@ function sessionSection(value) {
59
63
  const resume = value.workspacePath === undefined
60
64
  ? `codex resume ${value.sessionId}`
61
65
  : `cd "${value.workspacePath}"\ncodex resume ${value.sessionId}`;
62
- return [
63
- '---',
64
- '_Next steps: reply on this thread to continue, or resume this exact Wake session locally:_',
65
- '```',
66
- resume,
67
- '```',
68
- ].join('\n');
66
+ return ['---', '_To inspect this exact Wake session locally:_', '```', resume, '```'].join('\n');
69
67
  }
70
68
  function outcome(value) {
71
69
  return {
@@ -13,11 +13,13 @@ import { DeliveryEventType, selectDeliveryEvent } from '../../delivery/contracts
13
13
  import { createGitHubEventData } from '../contracts/event-factory.js';
14
14
  import { GitHubEventType, selectGitHubAdapterEvent } from '../contracts/events.js';
15
15
  import { GitHubAdapter, UnknownGitHubIdentity } from '../contracts/vocabulary.js';
16
+ import { isHumanNonWakeReply } from './inbound-comment-syntax.js';
16
17
  import { commandContext } from './inbound-context.js';
17
18
  import { applyReviewSignal } from './inbound-review-signals.js';
18
19
  import { applyWatchGateVerdictSignal } from './inbound-watch-gate-signals.js';
19
20
  import { gitHubIntakeFacts, gitHubIntakeRules } from './intake-policy.js';
20
21
  import { observePullRequest } from './pull-request-translation.js';
22
+ import { isWorkControlAuthorized } from './work-control-authorization.js';
21
23
  export class InboundTranslator {
22
24
  journal;
23
25
  work;
@@ -248,7 +250,9 @@ export class InboundTranslator {
248
250
  resourceId: resource.resourceId,
249
251
  threadId: resource.externalKey.key,
250
252
  messageId: externalId,
251
- authorized: isAuthorizedConversationActor(event),
253
+ authorized: isAuthorizedWorkControlActor(event),
254
+ reviewAuthorized: isAuthorizedConversationActor(event),
255
+ canClarify: isHumanNonWakeReply(event.event.payload.actor.kind, event.event.payload.body),
252
256
  capabilities: this.conversationCapabilities,
253
257
  ...(event.event.payload.reviewKind !== 'issue' ||
254
258
  event.event.payload.location === undefined
@@ -730,3 +734,11 @@ function observedCommentExternalId(event) {
730
734
  function isGitHubAdapterEventType(event, eventType) {
731
735
  return event.event.eventType === eventType;
732
736
  }
737
+ function isAuthorizedWorkControlActor(event) {
738
+ return isWorkControlAuthorized({
739
+ actorKind: event.event.payload.actor.kind,
740
+ authorization: event.event.payload.authorization ?? {
741
+ source: ReviewerAuthorizationSource.None,
742
+ },
743
+ });
744
+ }
@@ -0,0 +1,6 @@
1
+ import { type ReviewerAuthorizationEvidence } from '../../../activities/index.js';
2
+ /** Repository control permits an issue author to clarify their own work. */
3
+ export declare function isWorkControlAuthorized(input: {
4
+ readonly actorKind: string;
5
+ readonly authorization: ReviewerAuthorizationEvidence;
6
+ }): boolean;
@@ -0,0 +1,10 @@
1
+ import { ProviderPermission, ReviewActorKind, ReviewerAuthorizationSource, } from '../../../activities/index.js';
2
+ /** Repository control permits an issue author to clarify their own work. */
3
+ export function isWorkControlAuthorized(input) {
4
+ if (input.actorKind !== ReviewActorKind.Human ||
5
+ input.authorization.source !== ReviewerAuthorizationSource.ProviderPermission)
6
+ return false;
7
+ return (input.authorization.permission === ProviderPermission.Write ||
8
+ input.authorization.permission === ProviderPermission.Maintain ||
9
+ input.authorization.permission === ProviderPermission.Admin);
10
+ }
@@ -31,3 +31,4 @@ export * from './fake/external-sink.js';
31
31
  export * from './fake/external-source.js';
32
32
  export * from './fake/provider.js';
33
33
  export * from './github/infrastructure/oversight-mcp.js';
34
+ export * from './application/conversation-command-feedback.js';
@@ -31,3 +31,4 @@ export * from './fake/external-sink.js';
31
31
  export * from './fake/external-source.js';
32
32
  export * from './fake/provider.js';
33
33
  export * from './github/infrastructure/oversight-mcp.js';
34
+ export * from './application/conversation-command-feedback.js';
@@ -2,9 +2,13 @@ import type { EventData, EventEnvelope, StreamRef } from '../contracts/events.js
2
2
  import type { JournalChangeSignal } from '../subscriptions/journal-change-signal.js';
3
3
  export declare class WrongExpectedSequenceError extends Error {
4
4
  }
5
+ export interface JournalReadOptions {
6
+ /** Observe committed appends from other hosts without using a bounded freshness cache. */
7
+ readonly fresh?: boolean;
8
+ }
5
9
  export interface EventJournal {
6
10
  appendToStream(stream: StreamRef, expectedSequence: number, events: readonly EventData[]): Promise<readonly EventEnvelope[]>;
7
- readStream(stream: StreamRef): Promise<readonly EventEnvelope[]>;
11
+ readStream(stream: StreamRef, options?: JournalReadOptions): Promise<readonly EventEnvelope[]>;
8
12
  /** Optional bounded, cancellable snapshot reader for adapters with a streaming source. */
9
13
  scanAll?(signal?: AbortSignal): AsyncIterable<EventEnvelope>;
10
14
  readAll(afterGlobalPosition: number, limit?: number): Promise<readonly EventEnvelope[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"event-journal.d.ts","sourceRoot":"","sources":["../../src/store/event-journal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAErF,qBAAa,0BAA2B,SAAQ,KAAK;CAAG;AAExD,MAAM,WAAW,YAAY;IAC3B,cAAc,CACZ,MAAM,EAAE,SAAS,EACjB,gBAAgB,EAAE,MA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GAC3B,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IACrC,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAC/F,0FAA0F;IAC1F,OAAO,CAAC,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC,aAAa,CAAC,CAAC;IAC7D,OAAO,CAAC,mBAAmB,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IACxF,UAAU,CAAC,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAI9F,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,kBAAkB,CAChB,mBAAmB,EAAE,MAAM,EAC3B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;IAGjB,QAAQ,CAAC,YAAY,EAAE,mBAAmB,CAAC;CAC5C"}
@@ -1,4 +1,4 @@
1
- import type { EventData, EventEnvelope, EventingClock, EventJournal, JournalChangeSignal, StreamRef } from '@atolis-hq/eventing';
1
+ import type { EventData, EventEnvelope, EventingClock, EventJournal, JournalChangeSignal, JournalReadOptions, StreamRef } from '@atolis-hq/eventing';
2
2
  export interface FileEventJournalWatcher {
3
3
  unref(): void;
4
4
  close(): void;
@@ -27,7 +27,7 @@ export declare class FileEventJournal implements EventJournal {
27
27
  private entryValidationGeneration;
28
28
  appendToStream(stream: StreamRef, expectedSequence: number, drafts: readonly EventData[]): Promise<readonly EventEnvelope[]>;
29
29
  private nextSegmentFile;
30
- readStream(stream: StreamRef): Promise<readonly EventEnvelope<EventData<string, unknown>, StreamRef<string, string>>[]>;
30
+ readStream(stream: StreamRef, options?: JournalReadOptions): Promise<readonly EventEnvelope<EventData<string, unknown>, StreamRef<string, string>>[]>;
31
31
  /** Live readers bypass the full-history cache and stop at captured segment sizes. */
32
32
  scanAll(signal?: AbortSignal): AsyncIterable<EventEnvelope>;
33
33
  private scanSegment;
@@ -1 +1 @@
1
- {"version":3,"file":"file-event-journal.d.ts","sourceRoot":"","sources":["../src/file-event-journal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACV,MAAM,qBAAqB,CAAC;AAW7B,MAAM,WAAW,uBAAuB;IACtC,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CACrD;AAED,MAAM,MAAM,8BAA8B,GAAG,CAC3C,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,IAAI,KACf,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,cAAc,CAAC,EAAE,8BAA8B,CAAC;IACzD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CACvC;AAOD,qBAAa,gBAAiB,YAAW,YAAY;IAIjD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;gBAG1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,aAAa,EACpB,OAAO,GAAE,uBAA4B;IAKxD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAsC;IACzE,OAAO,CAAC,aAAa,CAAsC;IAC3D,OAAO,CAAC,qBAAqB,CAA4B;IAEzD,IAAI,YAAY,IAAI,mBAAmB,CAEtC;I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AAS,SAAS,EAAE,GAC3B,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC;YAwCtB,eAAe;IAsBvB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,kBAAuB;IA6BpE,qFAAqF;IAC9E,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC,aAAa,CAAC;YAcnD,WAAW;IAgC1B,OAAO,CAAC,gBAAgB;IAoBlB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAA2B;IAyBvD,UAAU,CAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,KAAK,SAA2B;IAW1E,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC;IAKvC,kBAAkB,CACtB,mBAAmB,EAAE,MAAM,EAC3B,MAAM,EAAE,WAAW,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;IAWhB,OAAO,CAAC,mBAAmB;YAUb,kBAAkB;YA4BlB,WAAW;IAkDzB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,qBAAqB;YAQf,eAAe;YAMf,YAAY;YAYZ,IAAI;YAYJ,kBAAkB;YAmBlB,kBAAkB;IAkBhC,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,0BAA0B;YAQpB,mBAAmB;IA0BjC,OAAO,CAAC,mBAAmB;YAwBb,eAAe;CAkD9B"}
@@ -91,8 +91,10 @@ export class FileEventJournal {
91
91
  // the entire history. A missing or stale manifest degrades to scan()'s
92
92
  // full parse rather than to incorrect data. The next successful append
93
93
  // rebuilds the derived manifest.
94
- async readStream(stream) {
94
+ async readStream(stream, options = {}) {
95
95
  const streamKey = key(stream);
96
+ if (options.fresh === true)
97
+ this.invalidateValidatedEntries();
96
98
  const entries = await this.readEntriesForRead();
97
99
  if (this.cached !== undefined) {
98
100
  if (sameEntries(this.cached.entries, entries))
@@ -1,6 +1,21 @@
1
+ import type { CommandContext } from '@atolis-hq/eventing';
1
2
  import { type EventProcessor } from '@atolis-hq/eventing';
3
+ import type { ConversationService } from '../../conversations/index.js';
4
+ import { ConversationEventType, workItemIdForConversation, type ConversationEventPayloads } from '../../conversations/index.js';
2
5
  import type { OrchestrationService } from './orchestration-service.js';
6
+ type ConversationCommandMessage = {
7
+ readonly conversationId: Parameters<typeof workItemIdForConversation>[0];
8
+ readonly eventId: string;
9
+ readonly correlationId: string;
10
+ readonly occurredAt: string;
11
+ readonly entry: ConversationEventPayloads[typeof ConversationEventType.EntryRecorded];
12
+ };
13
+ interface ConversationCommandFeedback {
14
+ readonly conversations: ConversationService;
15
+ readonly publish: (event: ConversationCommandMessage, body: string, context: CommandContext) => Promise<void>;
16
+ }
3
17
  /** Applies human commands only after their external message is canonical conversation history. */
4
- export declare function createConversationCommandReactor(orchestration: OrchestrationService): {
18
+ export declare function createConversationCommandReactor(orchestration: OrchestrationService, feedback?: ConversationCommandFeedback): {
5
19
  readonly processor: EventProcessor;
6
20
  };
21
+ export {};
@@ -2,7 +2,7 @@ import { EventActorKind, EventProcessorCategory, EventProcessorReplayPolicy, cor
2
2
  import { ConversationEventType, ConversationOriginKind, selectConversationEvent, workItemIdForConversation, } from '../../conversations/index.js';
3
3
  import { conversationCommand } from './conversation-command.js';
4
4
  /** Applies human commands only after their external message is canonical conversation history. */
5
- export function createConversationCommandReactor(orchestration) {
5
+ export function createConversationCommandReactor(orchestration, feedback) {
6
6
  return {
7
7
  processor: defineEventProcessor({
8
8
  consumer: 'reactor:orchestration.conversation-command',
@@ -34,20 +34,26 @@ export function createConversationCommandReactor(orchestration) {
34
34
  actorId: entry.origin.actorId,
35
35
  capabilities: (entry.origin.capabilities ?? []),
36
36
  authorized: entry.origin.authorized === true,
37
+ // Legacy entries authorized commands only after enforcing review independence.
38
+ reviewAuthorized: entry.origin.reviewAuthorized ?? entry.origin.authorized === true,
37
39
  };
38
- await orchestration.applyConversationCommand(workItemId, input, {
40
+ const context = {
39
41
  commandId: `${event.eventId}:conversation-command`,
40
42
  correlationId: correlationId(event.correlationId),
41
43
  occurredAt: event.occurredAt,
42
44
  actor: { kind: EventActorKind.Integration, id: entry.origin.adapter },
43
- });
44
- if (conversationCommand(entry.body) !== null)
45
+ };
46
+ if (conversationCommand(entry.body) !== null) {
47
+ await applyExternalCommand(orchestration, feedback, event, input, context);
48
+ return;
49
+ }
50
+ if (entry.origin.canClarify === false)
45
51
  return;
46
52
  for (const workflow of await orchestration.listAll()) {
47
53
  if (workflow.workItemId !== workItemId)
48
54
  continue;
49
55
  const resume = input.authorized
50
- ? orchestration.resumeBlockedStageForChanges.bind(orchestration)
56
+ ? orchestration.resumeBlockedStageForReply.bind(orchestration)
51
57
  : orchestration.resumeNeedsClarificationStage.bind(orchestration);
52
58
  await resume(workflow.workflowInstanceId, {
53
59
  commandId: `${event.eventId}:conversation-reply`,
@@ -60,3 +66,26 @@ export function createConversationCommandReactor(orchestration) {
60
66
  }),
61
67
  };
62
68
  }
69
+ async function applyExternalCommand(orchestration, feedback, event, input, context) {
70
+ const entryId = context.commandId + ':feedback';
71
+ const canPublish = input.authorized || input.reviewAuthorized === true;
72
+ const prior = (await feedback?.conversations.get(event.conversationId))?.entries.find((entry) => entry.entryId === entryId);
73
+ // A recorded receipt fixes the result even if publication retries after the workflow changes.
74
+ if (prior !== undefined && feedback !== undefined) {
75
+ if (canPublish)
76
+ await feedback.publish(event, prior.body, context);
77
+ return;
78
+ }
79
+ const result = await orchestration.applyConversationCommandWithFeedback(workItemIdForConversation(event.conversationId), input, context);
80
+ if (feedback === undefined)
81
+ return;
82
+ const body = result.applied ? 'Command applied.' : 'Command not applied: ' + result.reason;
83
+ await feedback.conversations.record({
84
+ conversationId: event.conversationId,
85
+ entryId,
86
+ body,
87
+ origin: { kind: ConversationOriginKind.ControlPlane, actorId: 'wake' },
88
+ }, context);
89
+ if (canPublish)
90
+ await feedback.publish(event, body, context);
91
+ }
@@ -8,15 +8,38 @@ export type SurfaceCapability = ConversationSurfaceCapability;
8
8
  export type ConversationCommandSurface = {
9
9
  readonly capabilities: readonly SurfaceCapability[];
10
10
  };
11
+ export interface ConversationCommandInput {
12
+ readonly body: string;
13
+ readonly actorId: string;
14
+ readonly capabilities: readonly SurfaceCapability[];
15
+ /** Verified work-control authority. */
16
+ readonly authorized: boolean;
17
+ /** Independent-review authority must be supplied explicitly. */
18
+ readonly reviewAuthorized?: boolean;
19
+ /** Explicit continuation reenters the agent stage without a review decision. */
20
+ readonly continuation?: boolean;
21
+ }
22
+ export type ConversationCommandResult = {
23
+ readonly applied: true;
24
+ } | {
25
+ readonly applied: false;
26
+ readonly reason: string;
27
+ };
11
28
  export declare function conversationCommand(body: string): string | null;
12
- export declare function applyBuiltInConversationCommand(input: {
29
+ interface BuiltInConversationCommandInput {
13
30
  readonly command: string;
14
31
  readonly capabilities: readonly SurfaceCapability[];
32
+ readonly reviewAuthorized: boolean;
15
33
  readonly workflows: readonly WorkflowInstanceView[];
16
34
  readonly context: CommandContext;
17
- readonly acceptSignal: (id: WorkflowInstanceId, outcome: typeof ActivityOutcomeKind.Done | typeof ActivityOutcomeKind.Rejected) => Promise<unknown>;
35
+ readonly acceptSignal: (id: WorkflowInstanceId, outcome: typeof ActivityOutcomeKind.Done | typeof ActivityOutcomeKind.Rejected) => Promise<boolean>;
18
36
  readonly retry: (id: WorkflowInstanceId) => Promise<unknown>;
19
37
  readonly restart: (id: WorkflowInstanceId) => Promise<unknown>;
20
38
  readonly extend: (id: WorkflowInstanceId) => Promise<unknown>;
21
- readonly resumeChanges: (id: WorkflowInstanceId) => Promise<unknown>;
22
- }): Promise<boolean>;
39
+ readonly resumeChanges: (id: WorkflowInstanceId) => Promise<boolean>;
40
+ readonly workAuthorized: boolean;
41
+ readonly continuation: boolean;
42
+ }
43
+ export declare function applyBuiltInConversationCommand(input: BuiltInConversationCommandInput): Promise<ConversationCommandResult>;
44
+ export declare function continuationCommandRejection(input: ConversationCommandInput, command: string): string | null;
45
+ export {};
@@ -1,46 +1,84 @@
1
1
  import { ActivityOutcomeKind } from '../../activities/index.js';
2
2
  import { ConversationBuiltInCommand, ConversationSurfaceCapability, } from '../contracts/vocabulary.js';
3
- import { isGroupBudgetExtensionEligible, isOperatorRetryEligible, selectOperatorRetryTarget, } from '../domain/operator-retry-policy.js';
3
+ import { isGroupBudgetExtensionEligible, isOperatorRetryEligible, selectChangesResumeTargets, selectOperatorRetryTarget, } from '../domain/operator-retry-policy.js';
4
4
  export const BuiltInConversationCommands = Object.values(ConversationBuiltInCommand);
5
5
  export function conversationCommand(body) {
6
6
  const line = body.trim().split('\n', 1)[0]?.trim().toLowerCase() ?? '';
7
7
  return /^\/[a-z][a-z0-9-]*(?:\s.*)?$/.test(line) ? line.split(/\s/, 1)[0] : null;
8
8
  }
9
- // The command matrix is intentionally explicit so future built-ins cannot silently inherit power.
9
+ // The command matrix is explicit so new built-ins cannot silently inherit power.
10
10
  // eslint-disable-next-line complexity
11
11
  export async function applyBuiltInConversationCommand(input) {
12
+ const denied = (reason) => ({ applied: false, reason });
12
13
  if (!BuiltInConversationCommands.includes(input.command))
13
- return false;
14
+ return denied('Unknown command. Use /changes with instructions to continue eligible blocked work, or /retry for a failed stage.');
14
15
  if (!input.capabilities.includes(ConversationSurfaceCapability.Review) &&
15
16
  !input.capabilities.includes(ConversationSurfaceCapability.Operator))
16
- return false;
17
- if (input.command === ConversationBuiltInCommand.Approved ||
18
- input.command === ConversationBuiltInCommand.Accepted ||
19
- input.command === ConversationBuiltInCommand.Changes) {
20
- const outcome = input.command === ConversationBuiltInCommand.Changes
21
- ? ActivityOutcomeKind.Rejected
22
- : ActivityOutcomeKind.Done;
17
+ return denied('This conversation surface does not permit work-control or review commands.');
18
+ if (input.command === ConversationBuiltInCommand.Changes) {
19
+ let applied = false;
20
+ const continuationTargets = new Set(selectChangesResumeTargets(input.workflows));
23
21
  for (const workflow of input.workflows) {
24
- if (workflow.waitingFor !== undefined)
25
- await input.acceptSignal(workflow.workflowInstanceId, outcome);
26
- else if (input.command === ConversationBuiltInCommand.Changes)
27
- await input.resumeChanges(workflow.workflowInstanceId);
22
+ if (isOperatorRetryEligible(workflow) || isGroupBudgetExtensionEligible(workflow))
23
+ continue;
24
+ const reviewed = !input.continuation && input.reviewAuthorized && workflow.waitingFor !== undefined
25
+ ? await input.acceptSignal(workflow.workflowInstanceId, ActivityOutcomeKind.Rejected)
26
+ : false;
27
+ if (reviewed)
28
+ applied = true;
29
+ else if (input.workAuthorized && continuationTargets.has(workflow))
30
+ applied = (await input.resumeChanges(workflow.workflowInstanceId)) || applied;
28
31
  }
29
- return true;
32
+ return applied ? { applied: true } : denied(changesDeniedReason(input.workAuthorized));
33
+ }
34
+ if (input.command === ConversationBuiltInCommand.Approved ||
35
+ input.command === ConversationBuiltInCommand.Accepted) {
36
+ if (!input.reviewAuthorized)
37
+ return denied('Independent-review authority is required. An author cannot approve their own work; clarification uses /changes with instructions.');
38
+ let applied = false;
39
+ for (const workflow of input.workflows)
40
+ if (workflow.waitingFor !== undefined)
41
+ applied =
42
+ (await input.acceptSignal(workflow.workflowInstanceId, ActivityOutcomeKind.Done)) ||
43
+ applied;
44
+ return applied
45
+ ? { applied: true }
46
+ : denied('No wait accepted this review decision. Check the configured authority and current revision.');
30
47
  }
31
48
  if (input.command === ConversationBuiltInCommand.Retry) {
32
49
  const target = selectOperatorRetryTarget(input.workflows);
33
- if (target !== undefined)
34
- await input.retry(target.workflowInstanceId);
35
- return true;
50
+ if (target === undefined)
51
+ return denied('No retry-eligible failed stage. To continue eligible blocked agent work, use /changes followed by instructions.');
52
+ await input.retry(target.workflowInstanceId);
53
+ return { applied: true };
36
54
  }
37
55
  const primary = input.workflows.find((workflow) => workflow.parentWorkflowInstanceId === undefined);
38
56
  if (primary === undefined)
39
- return true;
40
- if (input.command === ConversationBuiltInCommand.Restart && isOperatorRetryEligible(primary))
57
+ return denied('Work item has no primary workflow.');
58
+ if (input.command === ConversationBuiltInCommand.Restart && isOperatorRetryEligible(primary)) {
41
59
  await input.restart(primary.workflowInstanceId);
60
+ return { applied: true };
61
+ }
42
62
  if (input.command === ConversationBuiltInCommand.Extend &&
43
- isGroupBudgetExtensionEligible(primary))
63
+ isGroupBudgetExtensionEligible(primary)) {
44
64
  await input.extend(primary.workflowInstanceId);
45
- return true;
65
+ return { applied: true };
66
+ }
67
+ return denied('Command is inapplicable: restart requires a failed stage; extend requires an exhausted watch-group budget.');
68
+ }
69
+ function changesDeniedReason(workAuthorized) {
70
+ return workAuthorized
71
+ ? 'No eligible blocked agent stage or authorized review wait. Use /retry for an eligible failed stage; watch gates require their configured authority.'
72
+ : 'No review wait accepted this decision. Continuing blocked work requires verified repository write, maintain, or admin permission; watch gates retain their configured authority.';
73
+ }
74
+ export function continuationCommandRejection(input, command) {
75
+ if (!input.continuation)
76
+ return null;
77
+ if (command !== ConversationBuiltInCommand.Changes)
78
+ return 'Continuation must use /changes followed by instructions.';
79
+ if (!input.authorized)
80
+ return 'Continuation requires verified work-control authority.';
81
+ if (input.body.trim().slice(command.length).trim() === '')
82
+ return 'Supply instructions after /changes to continue the blocked stage.';
83
+ return null;
46
84
  }
@@ -8,7 +8,7 @@ import type { ChildWorkflowRequest, OrchestrationSignal, SignalExpectation, Supp
8
8
  import { type SignalName, type WorkflowInstanceId } from '../contracts/identifiers.js';
9
9
  import type { WorkflowInstanceView } from '../contracts/views.js';
10
10
  import { AdvanceWorkflow } from './advance-workflow.js';
11
- import { type SurfaceCapability } from './conversation-command.js';
11
+ import { type ConversationCommandInput, type ConversationCommandResult } from './conversation-command.js';
12
12
  export declare class OrchestrationService {
13
13
  private readonly startWorkflow;
14
14
  private readonly acceptActivityOutcome;
@@ -38,13 +38,9 @@ export declare class OrchestrationService {
38
38
  setAcceptSignalOperationCoordinator(coordinator: OperationCoordinator): void;
39
39
  setWatchChildCancellation(cancellation: WatchChildCancellation): void;
40
40
  requestSupplementalActivity(workflowInstanceId: WorkflowInstanceId, request: SupplementalActivityRequest, context: CommandContext): Promise<WorkflowInstanceView>;
41
- applyConversationCommand(workItemId: WorkItemId, input: {
42
- readonly body: string;
43
- readonly actorId: string;
44
- readonly capabilities: readonly SurfaceCapability[];
45
- /** The adapter authenticated and authorized the actor for command control. */
46
- readonly authorized: boolean;
47
- }, context: CommandContext): Promise<boolean>;
41
+ applyConversationCommand(workItemId: WorkItemId, input: ConversationCommandInput, context: CommandContext): Promise<boolean>;
42
+ applyConversationCommandWithFeedback(workItemId: WorkItemId, input: ConversationCommandInput, context: CommandContext): Promise<ConversationCommandResult>;
43
+ private applyConfiguredConversationCommands;
48
44
  markActivationStarted(workflowInstanceId: WorkflowInstanceId, activationId: ActivationId, context: CommandContext): Promise<WorkflowInstanceView | null>;
49
45
  validateActivationDispatch(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<boolean>;
50
46
  block(workflowInstanceId: WorkflowInstanceId, reason: string, context: CommandContext): Promise<WorkflowInstanceView | null>;
@@ -62,6 +58,7 @@ export declare class OrchestrationService {
62
58
  retryBlockedFailedStage(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<WorkflowInstanceView>;
63
59
  restartBlockedFailedStage(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<WorkflowInstanceView>;
64
60
  resumeBlockedStageForChanges(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<WorkflowInstanceView | null>;
61
+ resumeBlockedStageForReply(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<WorkflowInstanceView | null>;
65
62
  resumeNeedsClarificationStage(workflowInstanceId: WorkflowInstanceId, context: CommandContext): Promise<WorkflowInstanceView | null>;
66
63
  extendBlockedGroupBudget(workflowInstanceId: WorkflowInstanceId, authority: {
67
64
  readonly kind: string;