@atolis-hq/wake 0.4.109 → 0.4.111

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 (70) hide show
  1. package/dist/src/bootstrap/analytics-reports.d.ts +2 -0
  2. package/dist/src/bootstrap/analytics-reports.js +14 -4
  3. package/dist/src/bootstrap/board-projection.d.ts +4 -0
  4. package/dist/src/bootstrap/board-projection.js +33 -19
  5. package/dist/src/bootstrap/composition-root.d.ts +3 -1
  6. package/dist/src/bootstrap/composition-root.js +21 -6
  7. package/dist/src/bootstrap/delegated-artifact-context.d.ts +15 -0
  8. package/dist/src/bootstrap/delegated-artifact-context.js +17 -0
  9. package/dist/src/bootstrap/initialise.js +20 -2
  10. package/dist/src/bootstrap/integration-runtime.js +1 -0
  11. package/dist/src/bootstrap/objective-title-context.d.ts +7 -0
  12. package/dist/src/bootstrap/objective-title-context.js +15 -0
  13. package/dist/src/bootstrap/surface-api-delivery.js +148 -56
  14. package/dist/src/bootstrap/surface-api-work-applications.js +39 -5
  15. package/dist/src/bootstrap/surface-api-workflow-diagrams.js +8 -4
  16. package/dist/src/bootstrap/version.js +1 -1
  17. package/dist/src/conversations/application/control-plane-entry.d.ts +14 -0
  18. package/dist/src/conversations/application/control-plane-entry.js +16 -0
  19. package/dist/src/conversations/index.d.ts +1 -0
  20. package/dist/src/conversations/index.js +1 -0
  21. package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +2 -1
  22. package/dist/src/integrations/application/agent-run-publication-reactor.js +6 -17
  23. package/dist/src/integrations/application/agent-run-publication-target.d.ts +12 -0
  24. package/dist/src/integrations/application/agent-run-publication-target.js +31 -0
  25. package/dist/src/integrations/application/artifact-registration-reactor.js +4 -2
  26. package/dist/src/integrations/contracts/provider.d.ts +5 -0
  27. package/dist/src/integrations/github/application/inbound-translator.d.ts +7 -0
  28. package/dist/src/integrations/github/application/inbound-translator.js +46 -0
  29. package/dist/src/integrations/github/provider.js +1 -0
  30. package/dist/src/orchestration/application/conversation-command-reactor.js +6 -25
  31. package/dist/src/orchestration/application/delegated-work.d.ts +12 -2
  32. package/dist/src/orchestration/application/delegated-work.js +30 -3
  33. package/dist/src/orchestration/application/delegation-attention-state.d.ts +2 -0
  34. package/dist/src/orchestration/application/delegation-attention-state.js +11 -1
  35. package/dist/src/orchestration/application/delegation-attention.d.ts +9 -11
  36. package/dist/src/orchestration/application/delegation-attention.js +42 -23
  37. package/dist/src/orchestration/application/delivery-activity-report.d.ts +13 -0
  38. package/dist/src/orchestration/application/delivery-activity-report.js +127 -0
  39. package/dist/src/orchestration/application/orchestration-service.d.ts +11 -4
  40. package/dist/src/orchestration/application/orchestration-service.js +22 -16
  41. package/dist/src/orchestration/application/prerequisite-readiness.d.ts +8 -0
  42. package/dist/src/orchestration/application/prerequisite-readiness.js +35 -0
  43. package/dist/src/orchestration/application/work-completion-summary.d.ts +10 -1
  44. package/dist/src/orchestration/application/work-completion-summary.js +8 -4
  45. package/dist/src/orchestration/contracts/delegation-ports.d.ts +16 -0
  46. package/dist/src/orchestration/contracts/delegation.d.ts +6 -4
  47. package/dist/src/orchestration/contracts/delegation.js +13 -3
  48. package/dist/src/orchestration/contracts/vocabulary.d.ts +1 -0
  49. package/dist/src/orchestration/contracts/vocabulary.js +1 -0
  50. package/dist/src/orchestration/domain/delegated-brief.d.ts +8 -0
  51. package/dist/src/orchestration/domain/delegated-brief.js +35 -0
  52. package/dist/src/orchestration/index.d.ts +2 -1
  53. package/dist/src/orchestration/index.js +1 -0
  54. package/dist/src/resources/contracts/events.js +1 -0
  55. package/dist/src/resources/contracts/vocabulary.d.ts +2 -0
  56. package/dist/src/resources/contracts/vocabulary.js +2 -0
  57. package/dist/src/surfaces/api/contracts/board.d.ts +4 -0
  58. package/dist/src/surfaces/api/contracts/observability.d.ts +2 -0
  59. package/dist/src/surfaces/api/contracts/work.d.ts +59 -0
  60. package/dist/src/surfaces/mcp/delegation.js +2 -2
  61. package/dist/src/surfaces/web-assets/assets/index-CHhBIiQQ.js +1192 -0
  62. package/dist/src/surfaces/web-assets/assets/index-DKNzCDQl.css +1 -0
  63. package/dist/src/surfaces/web-assets/index.html +2 -2
  64. package/docker/Dockerfile.runtime +10 -1
  65. package/docker/Dockerfile.runtime.packaged +10 -1
  66. package/package.json +1 -1
  67. package/dist/src/orchestration/application/delegation-attention-escalations.d.ts +0 -11
  68. package/dist/src/orchestration/application/delegation-attention-escalations.js +0 -36
  69. package/dist/src/surfaces/web-assets/assets/index-EVgZ9q9N.css +0 -1
  70. package/dist/src/surfaces/web-assets/assets/index-ih1h3dxC.js +0 -1192
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The text a delegated child is opened with. The objective stays a one-line summary and
3
+ * the work item's title; this is where the child reads what it was asked to do.
4
+ */
5
+ export function renderDelegatedBrief(child) {
6
+ return [
7
+ `Assignment from your delegating parent: ${child.objective}`,
8
+ '',
9
+ 'Acceptance criteria:',
10
+ ...child.criteria.map((criterion) => `- ${criterion}`),
11
+ ...outputLines(child.outputs),
12
+ ...contextLines(child.context),
13
+ ].join('\n');
14
+ }
15
+ function outputLines(outputs) {
16
+ if (outputs.length === 0)
17
+ return [];
18
+ return [
19
+ '',
20
+ 'Outputs to deliver:',
21
+ ...outputs.map((output) => {
22
+ const kind = 'kind' in output ? output.kind : 'artifact';
23
+ return `- ${output.name} (${kind}${output.required === false ? ', optional' : ''})`;
24
+ }),
25
+ ];
26
+ }
27
+ function contextLines(references) {
28
+ if (references.length === 0)
29
+ return [];
30
+ return [
31
+ '',
32
+ 'Artifacts granted to you (read each with wake_artifacts_read, passing its workItemId and revisionId; they are also in your artifact manifest):',
33
+ ...references.map((reference) => `- ${reference.workItemId} ${reference.revisionId}`),
34
+ ];
35
+ }
@@ -30,9 +30,10 @@ export * from './domain/dispatch-priority.js';
30
30
  export * from './domain/interpreter.js';
31
31
  export * from './domain/workflow-instance.js';
32
32
  export * from './domain/workflow-selector.js';
33
+ export * from './application/delivery-activity-report.js';
33
34
  export * from './application/work-completion-summary.js';
34
35
  export type { WorkflowCompileDiagnostic } from './domain/compile-diagnostics.js';
35
- export type { DelegationArtifacts, DelegationRepositories } from './contracts/delegation-ports.js';
36
+ export type { DelegationArtifacts, DelegationMessages, DelegationRepositories, DelegationResources, } from './contracts/delegation-ports.js';
36
37
  export { DelegationAttentionError, DelegationConflictError, DelegationPendingError, } from './contracts/delegation.js';
37
38
  export type { DelegationAuthority } from './contracts/delegation-ports.js';
38
39
  export type { DeliveryIntegration, DeliveryPullRequest } from './contracts/delivery-ports.js';
@@ -30,6 +30,7 @@ export * from './domain/dispatch-priority.js';
30
30
  export * from './domain/interpreter.js';
31
31
  export * from './domain/workflow-instance.js';
32
32
  export * from './domain/workflow-selector.js';
33
+ export * from './application/delivery-activity-report.js';
33
34
  export * from './application/work-completion-summary.js';
34
35
  export { DelegationAttentionError, DelegationConflictError, DelegationPendingError, } from './contracts/delegation.js';
35
36
  export { DeliveryRejectionError, deliveryCandidateCommandSchema, deliveryMaintenanceCommandSchema, deliveryQaCommandSchema, deliverySelectionCommandSchema, } from './contracts/delivery.js';
@@ -89,6 +89,7 @@ const eventSchema = eventEnvelopeSchema.extend({
89
89
  ResourceCorrelationProvenance.ProviderObserved,
90
90
  ResourceCorrelationProvenance.AgentReported,
91
91
  ResourceCorrelationProvenance.OperatorDeclared,
92
+ ResourceCorrelationProvenance.Delegated,
92
93
  ]),
93
94
  })
94
95
  .strict(),
@@ -25,6 +25,8 @@ export declare const ResourceCorrelationProvenance: {
25
25
  readonly ProviderObserved: "provider-observed";
26
26
  readonly AgentReported: "agent-reported";
27
27
  readonly OperatorDeclared: "operator-declared";
28
+ /** Wake related a delegated child to its parent's resource; never an ownership claim. */
29
+ readonly Delegated: "delegated";
28
30
  };
29
31
  export type ResourceCorrelationProvenance = ValueOf<typeof ResourceCorrelationProvenance>;
30
32
  export declare const ResourceExternalOutcome: {
@@ -25,6 +25,8 @@ export const ResourceCorrelationProvenance = defineClosedVocabulary({
25
25
  ProviderObserved: 'provider-observed',
26
26
  AgentReported: 'agent-reported',
27
27
  OperatorDeclared: 'operator-declared',
28
+ /** Wake related a delegated child to its parent's resource; never an ownership claim. */
29
+ Delegated: 'delegated',
28
30
  });
29
31
  export const ResourceExternalOutcome = defineClosedVocabulary({
30
32
  Completed: 'completed',
@@ -20,6 +20,10 @@ export interface BoardCardResponse {
20
20
  readonly workItemId: string;
21
21
  readonly objective: string;
22
22
  readonly condition: BoardCardCondition;
23
+ /** Present on delegated children: the work item that delegated this one. */
24
+ readonly parentWorkItemKey?: string;
25
+ /** Present on a delegating parent: how many child work items it created. */
26
+ readonly childCount?: number;
23
27
  readonly frozen?: boolean;
24
28
  readonly awaitingApproval?: boolean;
25
29
  /** Whether the primary workflow needs a gate-budget extension to continue. */
@@ -21,5 +21,7 @@ export interface AnalyticsSummaryResponse {
21
21
  readonly totalCostUsd: number;
22
22
  readonly medianRunDurationMs: number | null;
23
23
  readonly workItemsDone: number;
24
+ readonly acceptedChildResults: number;
25
+ readonly correctiveActivations: number;
24
26
  readonly medianEndToEndDurationMs: number | null;
25
27
  }
@@ -52,6 +52,12 @@ export interface DeliveryQaResponse {
52
52
  readonly revision: string;
53
53
  }[];
54
54
  readonly stale: readonly string[];
55
+ /** Why each stale selected output no longer counts as current evidence. */
56
+ readonly staleOutputs?: readonly {
57
+ readonly workItemKey: WorkItemKey;
58
+ readonly outputName: string;
59
+ readonly reason: string;
60
+ }[];
55
61
  readonly verdict?: string;
56
62
  readonly effective: boolean;
57
63
  readonly canComplete: boolean;
@@ -64,13 +70,60 @@ export interface WorkDetailResponse {
64
70
  readonly qa?: DeliveryQaResponse;
65
71
  readonly rootWorkItemKey: WorkItemKey;
66
72
  readonly parentWorkItemKey?: WorkItemKey;
73
+ /** Present while the parent is waiting on an assessment of blocked children. */
74
+ readonly attention?: {
75
+ readonly cohortId: string;
76
+ readonly revision: number;
77
+ readonly blockers: readonly {
78
+ readonly blockerId: string;
79
+ readonly workItemKey: WorkItemKey;
80
+ readonly kind: string;
81
+ readonly reason: string;
82
+ /** A parent reply has been accepted for this blocker. */
83
+ readonly answered: boolean;
84
+ }[];
85
+ };
86
+ readonly cohorts?: readonly {
87
+ readonly cohortId: string;
88
+ /** The join has resolved; an unsettled cohort is still waiting on required children. */
89
+ readonly settled: boolean;
90
+ readonly failureReason?: string;
91
+ }[];
67
92
  readonly children: readonly {
68
93
  readonly workItemKey: WorkItemKey;
94
+ readonly workItemId: string;
95
+ /** Provider reference of the child's primary resource (e.g. its PR), once it has one. */
96
+ readonly externalRef?: string;
69
97
  readonly parentWorkItemKey: WorkItemKey;
70
98
  readonly objective: string;
71
99
  readonly workflowName: string;
72
100
  readonly status: string;
101
+ readonly currentStage?: string;
73
102
  readonly cohortId: string;
103
+ readonly repository?: {
104
+ readonly resourceId: string;
105
+ readonly pullRequestBase: string;
106
+ };
107
+ readonly prerequisites?: readonly WorkItemKey[];
108
+ /** Set only while a prerequisite is actually holding this child back. */
109
+ readonly prerequisiteBlocker?: string;
110
+ /** Original required assignment this corrective child replaces. */
111
+ readonly replaces?: {
112
+ readonly cohortId: string;
113
+ readonly assignmentId: string;
114
+ };
115
+ readonly outputs?: readonly {
116
+ readonly name: string;
117
+ readonly kind: string;
118
+ readonly required: boolean;
119
+ readonly selected: boolean;
120
+ readonly stale: boolean;
121
+ /** Declared per-output repository and PR base, when it differs from the child's. */
122
+ readonly repository?: {
123
+ readonly resourceId: string;
124
+ readonly pullRequestBase: string;
125
+ };
126
+ }[];
74
127
  readonly blockReason?: string;
75
128
  readonly resources: readonly ResourceItemResponse[];
76
129
  }[];
@@ -101,6 +154,12 @@ export interface WorkDetailResponse {
101
154
  readonly byteLength?: number;
102
155
  readonly digest?: string;
103
156
  readonly href: string;
157
+ /** Set when another work item published this artifact and it is in this item's context. */
158
+ readonly source?: {
159
+ readonly workItemKey: WorkItemKey;
160
+ /** `granted` by a delegating parent, or `shared` through a trigger context. */
161
+ readonly relation: 'granted' | 'shared';
162
+ };
104
163
  }[];
105
164
  readonly conversation: {
106
165
  /** Whether this authenticated surface may create control-plane entries. */
@@ -2,7 +2,7 @@ import { DelegationAttentionError, DelegationConflictError, DeliveryRejectionErr
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 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.',
5
+ description: 'Submit child work with optional queued named-output prerequisites under this workflow delegation policy. An assignment objective is a one-line summary that titles the child work item; the child reads its objective and criteria as the opening message of its conversation, so put detail in criteria or a granted artifact. 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
7
  }, async (command) => {
8
8
  try {
@@ -21,7 +21,7 @@ export function registerDelegationTools(server, input) {
21
21
  }
22
22
  });
23
23
  server.registerTool('wake_delegation_respond', {
24
- description: 'Answer one assignment-context blocker from the attention request returned by wake_delegation_inspect. Name the child, blocker and expectedRevision, and list the exact accepted artifact revisions the child may read. Only a child blocked for assignment context can be resumed; failures need follow-up work in a new cohort and human review, consent or approval gates cannot be answered here. End the activity normally afterwards; unresolved reasons stay tracked and the cohort wait resumes.',
24
+ description: 'Answer one assignment-context blocker from the attention request returned by wake_delegation_inspect. Name the child, blocker and expectedRevision, then answer with a free-text `message` (posted to the conversation of the child, which it reads when it resumes), with accepted artifact `references` it may read, or both; a reply needs at least one. Only a child blocked for assignment context can be resumed; failures need follow-up work in a new cohort and human review, consent or approval gates cannot be answered here. End the activity normally afterwards; unresolved reasons stay tracked and the cohort wait resumes.',
25
25
  inputSchema: delegationAttentionReplySchema,
26
26
  }, async (reply) => {
27
27
  try {