@atolis-hq/wake 0.4.102 → 0.4.103

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 (38) hide show
  1. package/dist/src/activities/pr/policy.d.ts +2 -0
  2. package/dist/src/activities/pr/policy.js +9 -1
  3. package/dist/src/bootstrap/surface-api-delivery.js +6 -2
  4. package/dist/src/bootstrap/version.js +1 -1
  5. package/dist/src/integrations/application/delegation-outputs.js +41 -5
  6. package/dist/src/orchestration/application/delegated-work.d.ts +46 -2
  7. package/dist/src/orchestration/application/delegated-work.js +135 -21
  8. package/dist/src/orchestration/application/delegation-commands.d.ts +47 -0
  9. package/dist/src/orchestration/application/delegation-commands.js +4 -2
  10. package/dist/src/orchestration/application/delegation-gate.d.ts +5 -3
  11. package/dist/src/orchestration/application/delegation-gate.js +31 -9
  12. package/dist/src/orchestration/application/delegation-ledger.d.ts +2 -0
  13. package/dist/src/orchestration/application/delegation-ledger.js +8 -0
  14. package/dist/src/orchestration/application/delegation-prerequisites.d.ts +28 -0
  15. package/dist/src/orchestration/application/delegation-prerequisites.js +118 -0
  16. package/dist/src/orchestration/application/delegation-reservation.js +1 -1
  17. package/dist/src/orchestration/application/delegation-wait-graph.d.ts +7 -0
  18. package/dist/src/orchestration/application/delegation-wait-graph.js +122 -0
  19. package/dist/src/orchestration/application/orchestration-repository.d.ts +5 -0
  20. package/dist/src/orchestration/application/orchestration-repository.js +3 -0
  21. package/dist/src/orchestration/application/orchestration-service.d.ts +87 -0
  22. package/dist/src/orchestration/application/orchestration-service.js +3 -2
  23. package/dist/src/orchestration/application/prerequisite-readiness.d.ts +68 -0
  24. package/dist/src/orchestration/application/prerequisite-readiness.js +217 -0
  25. package/dist/src/orchestration/contracts/delegation-ports.d.ts +2 -1
  26. package/dist/src/orchestration/contracts/delegation.d.ts +88 -0
  27. package/dist/src/orchestration/contracts/delegation.js +36 -1
  28. package/dist/src/orchestration/contracts/event-decoder.js +8 -1
  29. package/dist/src/orchestration/contracts/event-factory.js +5 -4
  30. package/dist/src/orchestration/contracts/events.d.ts +13 -1
  31. package/dist/src/orchestration/contracts/events.js +3 -0
  32. package/dist/src/orchestration/contracts/vocabulary.d.ts +27 -0
  33. package/dist/src/orchestration/contracts/vocabulary.js +25 -0
  34. package/dist/src/orchestration/domain/workflow-instance-events.js +3 -0
  35. package/dist/src/orchestration/index.d.ts +2 -2
  36. package/dist/src/orchestration/index.js +1 -1
  37. package/dist/src/surfaces/mcp/delegation.js +18 -10
  38. package/package.json +1 -1
@@ -43,3 +43,28 @@ export const ConversationSurfaceCapability = defineClosedVocabulary({
43
43
  Operator: 'operator-surface',
44
44
  });
45
45
  export const DelegationOutputKind = defineClosedVocabulary({ Change: 'change' });
46
+ export const DelegationPrerequisiteCondition = defineClosedVocabulary({
47
+ AcceptedOutput: 'accepted-output',
48
+ PushedChange: 'pushed-change',
49
+ DeliveryReady: 'delivery-ready',
50
+ MergedChange: 'merged-change',
51
+ });
52
+ export const DelegationConflictCode = defineClosedVocabulary({
53
+ SelfDependency: 'self-dependency',
54
+ MissingTarget: 'missing-target',
55
+ MissingOutput: 'missing-output',
56
+ OutputKind: 'output-kind',
57
+ CrossRepositoryBase: 'cross-repository-base',
58
+ CrossRepositoryChange: 'cross-repository-change',
59
+ MultipleBases: 'multiple-bases',
60
+ WaitCycle: 'wait-cycle',
61
+ StalePlan: 'stale-plan',
62
+ });
63
+ export const PrerequisiteBlockCode = defineClosedVocabulary({
64
+ Waiting: 'prerequisite-waiting',
65
+ Changed: 'prerequisite-changed',
66
+ Failed: 'prerequisite-failed',
67
+ Unavailable: 'prerequisite-unavailable',
68
+ Cycle: 'prerequisite-cycle',
69
+ Blocked: 'prerequisite-blocked',
70
+ });
@@ -180,6 +180,9 @@ function applyCoordinationFact(state, event) {
180
180
  };
181
181
  return;
182
182
  case OrchestrationEventType.DelegationRegistered:
183
+ case OrchestrationEventType.DelegationInputsResolved:
184
+ case OrchestrationEventType.DelegationPrerequisiteBlocked:
185
+ case OrchestrationEventType.DelegationChildBlocked:
183
186
  case OrchestrationEventType.DelegationResultSelected:
184
187
  return;
185
188
  case OrchestrationEventType.DelegationWaitStarted:
@@ -33,7 +33,7 @@ export * from './domain/workflow-selector.js';
33
33
  export * from './application/work-completion-summary.js';
34
34
  export type { WorkflowCompileDiagnostic } from './domain/compile-diagnostics.js';
35
35
  export type { DelegationArtifacts, DelegationRepositories } from './contracts/delegation-ports.js';
36
- export { DelegationPendingError } from './contracts/delegation.js';
36
+ export { DelegationConflictError, DelegationPendingError } from './contracts/delegation.js';
37
37
  export type { DelegationAuthority } from './contracts/delegation-ports.js';
38
38
  export { delegationSubmissionSchema } from './contracts/delegation.js';
39
- export type { DelegationCaller, DelegationReservation, DelegationSubmission, } from './contracts/delegation.js';
39
+ export type { DelegationCaller, DelegationInputs, DelegationPrerequisite, DelegationReservation, DelegationResult, DelegationSubmission, } from './contracts/delegation.js';
@@ -31,5 +31,5 @@ export * from './domain/interpreter.js';
31
31
  export * from './domain/workflow-instance.js';
32
32
  export * from './domain/workflow-selector.js';
33
33
  export * from './application/work-completion-summary.js';
34
- export { DelegationPendingError } from './contracts/delegation.js';
34
+ export { DelegationConflictError, DelegationPendingError } from './contracts/delegation.js';
35
35
  export { delegationSubmissionSchema } from './contracts/delegation.js';
@@ -1,17 +1,25 @@
1
- import { delegationSubmissionSchema, } from '../../orchestration/index.js';
1
+ import { DelegationConflictError, delegationSubmissionSchema, } from '../../orchestration/index.js';
2
2
  /** The bound caller is never accepted as a tool argument. */
3
3
  export function registerDelegationTools(server, input) {
4
4
  server.registerTool('wake_delegation_submit', {
5
- description: 'Submit independent child work under this workflow delegation policy. End the current activity normally after submission; Wake waits and resumes it with joined results.',
5
+ description: 'Submit child work with optional queued named-output prerequisites under this workflow delegation policy. Use expectedPlanRevision from inspection; useAsBase selects only a same-repository upstream change. End the current activity normally after submission; Wake waits and resumes it with joined results or terminal failure facts. Inspect failureReason and blockers before submitting replacement assignments in a new cohort; existing receipts remain immutable.',
6
6
  inputSchema: delegationSubmissionSchema,
7
- }, async (command) => ({
8
- content: [
9
- {
10
- type: 'text',
11
- text: JSON.stringify(await input.orchestration.submitDelegation(await input.caller(), command, input.commandContext())),
12
- },
13
- ],
14
- }));
7
+ }, async (command) => {
8
+ try {
9
+ const reservation = await input.orchestration.submitDelegation(await input.caller(), command, input.commandContext());
10
+ return { content: [{ type: 'text', text: JSON.stringify(reservation) }] };
11
+ }
12
+ catch (error) {
13
+ if (!(error instanceof DelegationConflictError))
14
+ throw error;
15
+ return {
16
+ isError: true,
17
+ content: [
18
+ { type: 'text', text: JSON.stringify({ code: error.code, message: error.message }) },
19
+ ],
20
+ };
21
+ }
22
+ });
15
23
  server.registerTool('wake_delegation_inspect', {
16
24
  description: 'Inspect this delivery tree, child workflows, results and blockers, and the Repository Resource IDs an explicit repository selection may name.',
17
25
  }, async () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atolis-hq/wake",
3
- "version": "0.4.102",
3
+ "version": "0.4.103",
4
4
  "description": "Local autonomous agent control plane for software development",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {