@atolis-hq/wake 0.4.110 → 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.
- package/dist/src/bootstrap/board-projection.d.ts +4 -0
- package/dist/src/bootstrap/board-projection.js +33 -19
- package/dist/src/bootstrap/composition-root.d.ts +3 -1
- package/dist/src/bootstrap/composition-root.js +21 -6
- package/dist/src/bootstrap/delegated-artifact-context.d.ts +15 -0
- package/dist/src/bootstrap/delegated-artifact-context.js +17 -0
- package/dist/src/bootstrap/initialise.js +20 -2
- package/dist/src/bootstrap/integration-runtime.js +1 -0
- package/dist/src/bootstrap/objective-title-context.d.ts +7 -0
- package/dist/src/bootstrap/objective-title-context.js +15 -0
- package/dist/src/bootstrap/surface-api-delivery.js +6 -1
- package/dist/src/bootstrap/surface-api-work-applications.js +39 -5
- package/dist/src/bootstrap/surface-api-workflow-diagrams.js +8 -4
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/conversations/application/control-plane-entry.d.ts +14 -0
- package/dist/src/conversations/application/control-plane-entry.js +16 -0
- package/dist/src/conversations/index.d.ts +1 -0
- package/dist/src/conversations/index.js +1 -0
- package/dist/src/integrations/application/agent-run-publication-reactor.d.ts +2 -1
- package/dist/src/integrations/application/agent-run-publication-reactor.js +6 -17
- package/dist/src/integrations/application/agent-run-publication-target.d.ts +12 -0
- package/dist/src/integrations/application/agent-run-publication-target.js +31 -0
- package/dist/src/integrations/application/artifact-registration-reactor.js +4 -2
- package/dist/src/integrations/contracts/provider.d.ts +5 -0
- package/dist/src/integrations/github/application/inbound-translator.d.ts +7 -0
- package/dist/src/integrations/github/application/inbound-translator.js +46 -0
- package/dist/src/integrations/github/provider.js +1 -0
- package/dist/src/orchestration/application/conversation-command-reactor.js +6 -25
- package/dist/src/orchestration/application/delegated-work.d.ts +12 -2
- package/dist/src/orchestration/application/delegated-work.js +30 -3
- package/dist/src/orchestration/application/delegation-attention-state.d.ts +2 -0
- package/dist/src/orchestration/application/delegation-attention-state.js +11 -1
- package/dist/src/orchestration/application/delegation-attention.d.ts +9 -11
- package/dist/src/orchestration/application/delegation-attention.js +42 -23
- package/dist/src/orchestration/application/orchestration-service.d.ts +11 -4
- package/dist/src/orchestration/application/orchestration-service.js +22 -16
- package/dist/src/orchestration/application/prerequisite-readiness.d.ts +8 -0
- package/dist/src/orchestration/application/prerequisite-readiness.js +35 -0
- package/dist/src/orchestration/contracts/delegation-ports.d.ts +16 -0
- package/dist/src/orchestration/contracts/delegation.d.ts +6 -4
- package/dist/src/orchestration/contracts/delegation.js +13 -3
- package/dist/src/orchestration/contracts/vocabulary.d.ts +1 -0
- package/dist/src/orchestration/contracts/vocabulary.js +1 -0
- package/dist/src/orchestration/domain/delegated-brief.d.ts +8 -0
- package/dist/src/orchestration/domain/delegated-brief.js +35 -0
- package/dist/src/orchestration/index.d.ts +1 -1
- package/dist/src/resources/contracts/events.js +1 -0
- package/dist/src/resources/contracts/vocabulary.d.ts +2 -0
- package/dist/src/resources/contracts/vocabulary.js +2 -0
- package/dist/src/surfaces/api/contracts/board.d.ts +4 -0
- package/dist/src/surfaces/api/contracts/work.d.ts +9 -0
- package/dist/src/surfaces/mcp/delegation.js +2 -2
- package/dist/src/surfaces/web-assets/assets/index-CHhBIiQQ.js +1192 -0
- package/dist/src/surfaces/web-assets/assets/index-DKNzCDQl.css +1 -0
- package/dist/src/surfaces/web-assets/index.html +2 -2
- package/docker/Dockerfile.runtime +10 -1
- package/docker/Dockerfile.runtime.packaged +10 -1
- package/package.json +1 -1
- package/dist/src/orchestration/application/delegation-attention-escalations.d.ts +0 -11
- package/dist/src/orchestration/application/delegation-attention-escalations.js +0 -36
- package/dist/src/surfaces/web-assets/assets/index-CJVgp3N-.js +0 -1192
- package/dist/src/surfaces/web-assets/assets/index-EVgZ9q9N.css +0 -1
|
@@ -288,20 +288,22 @@ export declare const delegationAttentionReplySchema: z.ZodObject<{
|
|
|
288
288
|
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
289
289
|
blockerId: z.ZodString;
|
|
290
290
|
expectedRevision: z.ZodNumber;
|
|
291
|
-
references: z.ZodArray<z.ZodObject<{
|
|
291
|
+
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
292
292
|
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
293
293
|
revisionId: z.ZodString;
|
|
294
|
-
}, z.core.$strict
|
|
294
|
+
}, z.core.$strict>>>;
|
|
295
|
+
message: z.ZodOptional<z.ZodString>;
|
|
295
296
|
}, z.core.$strict>;
|
|
296
297
|
export type DelegationAttentionReply = z.infer<typeof delegationAttentionReplySchema>;
|
|
297
298
|
export declare const delegationAttentionResponseSchema: z.ZodObject<{
|
|
298
299
|
childWorkItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
299
300
|
blockerId: z.ZodString;
|
|
300
301
|
expectedRevision: z.ZodNumber;
|
|
301
|
-
references: z.ZodArray<z.ZodObject<{
|
|
302
|
+
references: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
302
303
|
workItemId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../work/index.js").WorkItemId, string>>;
|
|
303
304
|
revisionId: z.ZodString;
|
|
304
|
-
}, z.core.$strict
|
|
305
|
+
}, z.core.$strict>>>;
|
|
306
|
+
message: z.ZodOptional<z.ZodString>;
|
|
305
307
|
cohortId: z.ZodString;
|
|
306
308
|
attentionKey: z.ZodString;
|
|
307
309
|
}, z.core.$strict>;
|
|
@@ -33,8 +33,15 @@ export const repositoryAssignmentRequestSchema = z
|
|
|
33
33
|
export const delegatedAssignmentSchema = z
|
|
34
34
|
.object({
|
|
35
35
|
assignmentId: z.string().min(1),
|
|
36
|
-
objective: z
|
|
37
|
-
|
|
36
|
+
objective: z
|
|
37
|
+
.string()
|
|
38
|
+
.trim()
|
|
39
|
+
.min(1)
|
|
40
|
+
.describe('A one-line summary of the task. It becomes the child work item title, so keep it short and put instructions in criteria or a granted artifact.'),
|
|
41
|
+
criteria: z
|
|
42
|
+
.array(z.string().trim().min(1))
|
|
43
|
+
.min(1)
|
|
44
|
+
.describe('The specific, checkable requirements. They are delivered to the child, with the objective, as the opening message of its conversation.'),
|
|
38
45
|
workflowName: brandedStringSchema(workflowName),
|
|
39
46
|
repositoryResourceIds: z.array(z.string().min(1)).optional(),
|
|
40
47
|
workflowFingerprint: z.string().min(1),
|
|
@@ -178,7 +185,10 @@ export const delegationAttentionReplySchema = z
|
|
|
178
185
|
childWorkItemId: brandedStringSchema(workItemId),
|
|
179
186
|
blockerId: z.string().min(1),
|
|
180
187
|
expectedRevision: z.number().int().positive(),
|
|
181
|
-
|
|
188
|
+
/** Accepted artifact revisions the child may read from now on. */
|
|
189
|
+
references: z.array(delegationRevisionReferenceSchema).default([]),
|
|
190
|
+
/** Free-text answer, posted to the child's conversation. */
|
|
191
|
+
message: z.string().trim().min(1).max(20_000).optional(),
|
|
182
192
|
})
|
|
183
193
|
.strict();
|
|
184
194
|
export const delegationAttentionResponseSchema = delegationAttentionReplySchema
|
|
@@ -73,6 +73,7 @@ export declare const DelegationAttentionRejection: {
|
|
|
73
73
|
readonly StaleRevision: "stale-revision";
|
|
74
74
|
readonly NotBlocked: "not-blocked";
|
|
75
75
|
readonly Duplicate: "duplicate";
|
|
76
|
+
readonly EmptyReply: "empty-reply";
|
|
76
77
|
};
|
|
77
78
|
export type DelegationAttentionRejection = ValueOf<typeof DelegationAttentionRejection>;
|
|
78
79
|
export declare const DelegationConflictCode: {
|
|
@@ -65,6 +65,7 @@ export const DelegationAttentionRejection = defineClosedVocabulary({
|
|
|
65
65
|
StaleRevision: 'stale-revision',
|
|
66
66
|
NotBlocked: 'not-blocked',
|
|
67
67
|
Duplicate: 'duplicate',
|
|
68
|
+
EmptyReply: 'empty-reply',
|
|
68
69
|
});
|
|
69
70
|
export const DelegationConflictCode = defineClosedVocabulary({
|
|
70
71
|
SelfDependency: 'self-dependency',
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DelegationReservation } from '../contracts/delegation.js';
|
|
2
|
+
type Child = Pick<DelegationReservation['children'][number], 'objective' | 'criteria' | 'outputs' | 'context'>;
|
|
3
|
+
/**
|
|
4
|
+
* The text a delegated child is opened with. The objective stays a one-line summary and
|
|
5
|
+
* the work item's title; this is where the child reads what it was asked to do.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderDelegatedBrief(child: Child): string;
|
|
8
|
+
export {};
|
|
@@ -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
|
+
}
|
|
@@ -33,7 +33,7 @@ export * from './domain/workflow-selector.js';
|
|
|
33
33
|
export * from './application/delivery-activity-report.js';
|
|
34
34
|
export * from './application/work-completion-summary.js';
|
|
35
35
|
export type { WorkflowCompileDiagnostic } from './domain/compile-diagnostics.js';
|
|
36
|
-
export type { DelegationArtifacts, DelegationRepositories } from './contracts/delegation-ports.js';
|
|
36
|
+
export type { DelegationArtifacts, DelegationMessages, DelegationRepositories, DelegationResources, } from './contracts/delegation-ports.js';
|
|
37
37
|
export { DelegationAttentionError, DelegationConflictError, DelegationPendingError, } from './contracts/delegation.js';
|
|
38
38
|
export type { DelegationAuthority } from './contracts/delegation-ports.js';
|
|
39
39
|
export type { DeliveryIntegration, DeliveryPullRequest } from './contracts/delivery-ports.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. */
|
|
@@ -91,6 +91,9 @@ export interface WorkDetailResponse {
|
|
|
91
91
|
}[];
|
|
92
92
|
readonly children: readonly {
|
|
93
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;
|
|
94
97
|
readonly parentWorkItemKey: WorkItemKey;
|
|
95
98
|
readonly objective: string;
|
|
96
99
|
readonly workflowName: string;
|
|
@@ -151,6 +154,12 @@ export interface WorkDetailResponse {
|
|
|
151
154
|
readonly byteLength?: number;
|
|
152
155
|
readonly digest?: string;
|
|
153
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
|
+
};
|
|
154
163
|
}[];
|
|
155
164
|
readonly conversation: {
|
|
156
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,
|
|
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 {
|