@xemahq/kernel-contracts 0.42.0 → 0.43.1
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/workflow/lib/workflow-control.d.ts +32 -2
- package/dist/workflow/lib/workflow-control.d.ts.map +1 -1
- package/dist/workflow/lib/workflow-control.js +17 -0
- package/dist/workflow/lib/workflow-control.js.map +1 -1
- package/package.json +1 -1
- package/src/connector/lib/connector-adapter-kind.ts +1 -1
- package/src/connector/lib/connector-descriptor.ts +1 -1
- package/src/connector/lib/envelope-schema.ts +1 -1
- package/src/connector/lib/onboarding-manifest.ts +2 -2
- package/src/workflow/lib/workflow-control.ts +40 -4
|
@@ -3,7 +3,9 @@ import { DecisionVerdict } from '../../decision-gate/lib/decision-gate';
|
|
|
3
3
|
export declare enum WorkflowControlAction {
|
|
4
4
|
DECIDE_GATE = "decide_gate",
|
|
5
5
|
ANSWER_INQUIRY = "answer_inquiry",
|
|
6
|
-
SET_RUN_STATUS = "set_run_status"
|
|
6
|
+
SET_RUN_STATUS = "set_run_status",
|
|
7
|
+
REFINE_PHASE = "refine_phase",
|
|
8
|
+
RESTART_PHASE = "restart_phase"
|
|
7
9
|
}
|
|
8
10
|
export declare enum WorkflowRunStatusTarget {
|
|
9
11
|
PAUSED = "paused",
|
|
@@ -23,7 +25,9 @@ export declare enum WorkflowControlRejectionCode {
|
|
|
23
25
|
INQUIRY_NOT_PENDING = "INQUIRY_NOT_PENDING",
|
|
24
26
|
RECIPIENT_NOT_FOUND = "RECIPIENT_NOT_FOUND",
|
|
25
27
|
RECIPIENT_NOT_AGENT = "RECIPIENT_NOT_AGENT",
|
|
26
|
-
RECIPIENT_ALREADY_REPLIED = "RECIPIENT_ALREADY_REPLIED"
|
|
28
|
+
RECIPIENT_ALREADY_REPLIED = "RECIPIENT_ALREADY_REPLIED",
|
|
29
|
+
PHASE_NOT_FOUND = "PHASE_NOT_FOUND",
|
|
30
|
+
PHASE_NOT_REFINABLE = "PHASE_NOT_REFINABLE"
|
|
27
31
|
}
|
|
28
32
|
declare const DecideGateRequestSchema: z.ZodObject<{
|
|
29
33
|
action: z.ZodLiteral<WorkflowControlAction.DECIDE_GATE>;
|
|
@@ -49,6 +53,19 @@ declare const SetRunStatusRequestSchema: z.ZodObject<{
|
|
|
49
53
|
runId: z.ZodString;
|
|
50
54
|
orgId: z.ZodString;
|
|
51
55
|
}, z.core.$strip>;
|
|
56
|
+
declare const RefinePhaseRequestSchema: z.ZodObject<{
|
|
57
|
+
action: z.ZodLiteral<WorkflowControlAction.REFINE_PHASE>;
|
|
58
|
+
phaseKey: z.ZodString;
|
|
59
|
+
feedback: z.ZodOptional<z.ZodString>;
|
|
60
|
+
runId: z.ZodString;
|
|
61
|
+
orgId: z.ZodString;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
declare const RestartPhaseRequestSchema: z.ZodObject<{
|
|
64
|
+
action: z.ZodLiteral<WorkflowControlAction.RESTART_PHASE>;
|
|
65
|
+
phaseKey: z.ZodString;
|
|
66
|
+
runId: z.ZodString;
|
|
67
|
+
orgId: z.ZodString;
|
|
68
|
+
}, z.core.$strip>;
|
|
52
69
|
export declare const WorkflowControlRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
53
70
|
action: z.ZodLiteral<WorkflowControlAction.DECIDE_GATE>;
|
|
54
71
|
inquiryId: z.ZodString;
|
|
@@ -70,11 +87,24 @@ export declare const WorkflowControlRequestSchema: z.ZodDiscriminatedUnion<[z.Zo
|
|
|
70
87
|
reason: z.ZodOptional<z.ZodString>;
|
|
71
88
|
runId: z.ZodString;
|
|
72
89
|
orgId: z.ZodString;
|
|
90
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
91
|
+
action: z.ZodLiteral<WorkflowControlAction.REFINE_PHASE>;
|
|
92
|
+
phaseKey: z.ZodString;
|
|
93
|
+
feedback: z.ZodOptional<z.ZodString>;
|
|
94
|
+
runId: z.ZodString;
|
|
95
|
+
orgId: z.ZodString;
|
|
96
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
+
action: z.ZodLiteral<WorkflowControlAction.RESTART_PHASE>;
|
|
98
|
+
phaseKey: z.ZodString;
|
|
99
|
+
runId: z.ZodString;
|
|
100
|
+
orgId: z.ZodString;
|
|
73
101
|
}, z.core.$strip>], "action">;
|
|
74
102
|
export type WorkflowControlRequest = z.infer<typeof WorkflowControlRequestSchema>;
|
|
75
103
|
export type DecideGateRequest = z.infer<typeof DecideGateRequestSchema>;
|
|
76
104
|
export type AnswerInquiryRequest = z.infer<typeof AnswerInquiryRequestSchema>;
|
|
77
105
|
export type SetRunStatusRequest = z.infer<typeof SetRunStatusRequestSchema>;
|
|
106
|
+
export type RefinePhaseRequest = z.infer<typeof RefinePhaseRequestSchema>;
|
|
107
|
+
export type RestartPhaseRequest = z.infer<typeof RestartPhaseRequestSchema>;
|
|
78
108
|
export declare const WorkflowControlResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
79
109
|
ok: z.ZodLiteral<true>;
|
|
80
110
|
detail: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-control.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/workflow-control.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-control.d.ts","sourceRoot":"","sources":["../../../src/workflow/lib/workflow-control.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AA0BxE,oBAAY,qBAAqB;IAC/B,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;CAChC;AAcD,oB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AK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E,eAAO,MAAM,2BAA2B;;;;;;;yBAWtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAGhF,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,qBAAqB,CAE9E;AAGD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,4BAA4B,EAClC,OAAO,EAAE,MAAM,GACd,qBAAqB,CAEvB;AAOD,eAAO,MAAM,+BAA+B,uBAAuB,CAAC"}
|
|
@@ -10,6 +10,8 @@ var WorkflowControlAction;
|
|
|
10
10
|
WorkflowControlAction["DECIDE_GATE"] = "decide_gate";
|
|
11
11
|
WorkflowControlAction["ANSWER_INQUIRY"] = "answer_inquiry";
|
|
12
12
|
WorkflowControlAction["SET_RUN_STATUS"] = "set_run_status";
|
|
13
|
+
WorkflowControlAction["REFINE_PHASE"] = "refine_phase";
|
|
14
|
+
WorkflowControlAction["RESTART_PHASE"] = "restart_phase";
|
|
13
15
|
})(WorkflowControlAction || (exports.WorkflowControlAction = WorkflowControlAction = {}));
|
|
14
16
|
var WorkflowRunStatusTarget;
|
|
15
17
|
(function (WorkflowRunStatusTarget) {
|
|
@@ -32,6 +34,8 @@ var WorkflowControlRejectionCode;
|
|
|
32
34
|
WorkflowControlRejectionCode["RECIPIENT_NOT_FOUND"] = "RECIPIENT_NOT_FOUND";
|
|
33
35
|
WorkflowControlRejectionCode["RECIPIENT_NOT_AGENT"] = "RECIPIENT_NOT_AGENT";
|
|
34
36
|
WorkflowControlRejectionCode["RECIPIENT_ALREADY_REPLIED"] = "RECIPIENT_ALREADY_REPLIED";
|
|
37
|
+
WorkflowControlRejectionCode["PHASE_NOT_FOUND"] = "PHASE_NOT_FOUND";
|
|
38
|
+
WorkflowControlRejectionCode["PHASE_NOT_REFINABLE"] = "PHASE_NOT_REFINABLE";
|
|
35
39
|
})(WorkflowControlRejectionCode || (exports.WorkflowControlRejectionCode = WorkflowControlRejectionCode = {}));
|
|
36
40
|
const RunBindingShape = {
|
|
37
41
|
runId: zod_1.z.string().min(1),
|
|
@@ -58,10 +62,23 @@ const SetRunStatusRequestSchema = zod_1.z.object({
|
|
|
58
62
|
status: zod_1.z.nativeEnum(WorkflowRunStatusTarget),
|
|
59
63
|
reason: zod_1.z.string().optional(),
|
|
60
64
|
});
|
|
65
|
+
const RefinePhaseRequestSchema = zod_1.z.object({
|
|
66
|
+
...RunBindingShape,
|
|
67
|
+
action: zod_1.z.literal(WorkflowControlAction.REFINE_PHASE),
|
|
68
|
+
phaseKey: zod_1.z.string().min(1),
|
|
69
|
+
feedback: zod_1.z.string().optional(),
|
|
70
|
+
});
|
|
71
|
+
const RestartPhaseRequestSchema = zod_1.z.object({
|
|
72
|
+
...RunBindingShape,
|
|
73
|
+
action: zod_1.z.literal(WorkflowControlAction.RESTART_PHASE),
|
|
74
|
+
phaseKey: zod_1.z.string().min(1),
|
|
75
|
+
});
|
|
61
76
|
exports.WorkflowControlRequestSchema = zod_1.z.discriminatedUnion('action', [
|
|
62
77
|
DecideGateRequestSchema,
|
|
63
78
|
AnswerInquiryRequestSchema,
|
|
64
79
|
SetRunStatusRequestSchema,
|
|
80
|
+
RefinePhaseRequestSchema,
|
|
81
|
+
RestartPhaseRequestSchema,
|
|
65
82
|
]);
|
|
66
83
|
exports.WorkflowControlResultSchema = zod_1.z.discriminatedUnion('ok', [
|
|
67
84
|
zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-control.js","sourceRoot":"","sources":["../../../src/workflow/lib/workflow-control.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"workflow-control.js","sourceRoot":"","sources":["../../../src/workflow/lib/workflow-control.ts"],"names":[],"mappings":";;;AAwNA,0DAEC;AAGD,0DAKC;AA1MD,6BAAwB;AAExB,yEAAwE;AA0BxE,IAAY,qBAMX;AAND,WAA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S kernel wire contracts — pure types + zod schemas for the kernel protocol surfaces. One package, one npm scope, wildcard per-surface subpath exports. No framework/runtime deps.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Neuralchowder Inc. <developer@xema.dev> (https://xema.dev)",
|
|
@@ -15,7 +15,7 @@ import { z } from 'zod';
|
|
|
15
15
|
* ONE Connector concept. See
|
|
16
16
|
* `.claude/plans/connector-architecture-convergence.md`.
|
|
17
17
|
*
|
|
18
|
-
* - `native-provider` — a biome-shipped `
|
|
18
|
+
* - `native-provider` — a biome-shipped `ConnectorAdapterModule` executes
|
|
19
19
|
* the operation directly (the curated, code-capable connector: Gmail
|
|
20
20
|
* module, an SCM connector, …). This is the CODE escape hatch, hosted by
|
|
21
21
|
* `biome-adapter-host`.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* connectors.
|
|
11
11
|
*
|
|
12
12
|
* This descriptor is the connector-registry face of an
|
|
13
|
-
* `
|
|
13
|
+
* `ConnectorAdapterModule`: the module carries the executable
|
|
14
14
|
* webhook/action/resource handlers; this descriptor carries the
|
|
15
15
|
* *catalog + connect* metadata the framework needs
|
|
16
16
|
* to render the provider-grouped catalog, drive consent with the right scopes,
|
|
@@ -31,7 +31,7 @@ import { BuiltInAdapterKind, type AdapterKindRef } from './adapter-kind';
|
|
|
31
31
|
*/
|
|
32
32
|
export const UNION_ENTITY_KIND = '*';
|
|
33
33
|
|
|
34
|
-
/** Inherited base envelope fields (defined on `
|
|
34
|
+
/** Inherited base envelope fields (defined on `ConnectorWebhookEnvelopeDto`). */
|
|
35
35
|
const BASE_ENVELOPE_PATHS = [
|
|
36
36
|
'provider',
|
|
37
37
|
'adapterKey',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ─────────────────────────────────────────────────────────────────────────
|
|
3
3
|
* Provider onboarding manifest — install-wizard UX contract
|
|
4
4
|
*
|
|
5
|
-
* Each `
|
|
5
|
+
* Each `ConnectorAdapterModule` declares an `onboarding` manifest so the
|
|
6
6
|
* frontend can render the "Connect <provider>" surface generically from the
|
|
7
7
|
* registry instead of carrying a hardcoded provider catalogue.
|
|
8
8
|
*
|
|
@@ -137,7 +137,7 @@ export const CredentialFieldSpecSchema = z.strictObject({
|
|
|
137
137
|
* state.
|
|
138
138
|
*/
|
|
139
139
|
export interface ProviderOnboardingManifest {
|
|
140
|
-
/** Provider slug (same as `
|
|
140
|
+
/** Provider slug (same as `ConnectorAdapterModule.provider`). */
|
|
141
141
|
readonly provider: string;
|
|
142
142
|
/** Human-readable provider name (e.g. `GitHub`, `Atlassian Cloud`). */
|
|
143
143
|
readonly displayName: string;
|
|
@@ -37,16 +37,25 @@ import { DecisionVerdict } from '../../decision-gate/lib/decision-gate';
|
|
|
37
37
|
* (`AGENT_TOOL_INQUIRY` / `REVIEW`) belonging to the run.
|
|
38
38
|
* - `SET_RUN_STATUS` — request a run-status transition (pause / resume /
|
|
39
39
|
* cancel) via the existing run signal.
|
|
40
|
+
* - `REFINE_PHASE` — re-run a completed phase of the run incorporating
|
|
41
|
+
* `feedback`, via the `controlPhase` run signal. A
|
|
42
|
+
* "phase" is addressed by its `phaseKey` (the run's
|
|
43
|
+
* job/stage key). Only a COMPLETED phase is refinable.
|
|
44
|
+
* - `RESTART_PHASE` — re-run a completed phase from scratch (no feedback),
|
|
45
|
+
* via the same `controlPhase` run signal.
|
|
40
46
|
*
|
|
41
|
-
*
|
|
42
|
-
* server-side phase-refinement mechanism to reuse
|
|
43
|
-
* affordance is UI-metadata only).
|
|
44
|
-
*
|
|
47
|
+
* REFINE/RESTART are a net-new engine+worker phase-control primitive (there
|
|
48
|
+
* was no server-side phase-refinement mechanism to reuse — the run-level
|
|
49
|
+
* "redo" affordance is UI-metadata only). They route through the SAME
|
|
50
|
+
* governed control surface + the SAME run-signal plumbing as the other
|
|
51
|
+
* actions — no second control path.
|
|
45
52
|
*/
|
|
46
53
|
export enum WorkflowControlAction {
|
|
47
54
|
DECIDE_GATE = 'decide_gate',
|
|
48
55
|
ANSWER_INQUIRY = 'answer_inquiry',
|
|
49
56
|
SET_RUN_STATUS = 'set_run_status',
|
|
57
|
+
REFINE_PHASE = 'refine_phase',
|
|
58
|
+
RESTART_PHASE = 'restart_phase',
|
|
50
59
|
}
|
|
51
60
|
|
|
52
61
|
/**
|
|
@@ -100,6 +109,13 @@ export enum WorkflowControlRejectionCode {
|
|
|
100
109
|
RECIPIENT_NOT_AGENT = 'RECIPIENT_NOT_AGENT',
|
|
101
110
|
/** The targeted recipient has already replied (idempotent-safe rejection). */
|
|
102
111
|
RECIPIENT_ALREADY_REPLIED = 'RECIPIENT_ALREADY_REPLIED',
|
|
112
|
+
/** No phase with the given `phaseKey` exists on the run (a "phase" is a
|
|
113
|
+
* run job/stage key). Uniform with a phase that never ran. */
|
|
114
|
+
PHASE_NOT_FOUND = 'PHASE_NOT_FOUND',
|
|
115
|
+
/** The phase exists but is not in a state that can be refined/restarted —
|
|
116
|
+
* only a COMPLETED phase is refinable (a still-running or skipped phase
|
|
117
|
+
* is not). */
|
|
118
|
+
PHASE_NOT_REFINABLE = 'PHASE_NOT_REFINABLE',
|
|
103
119
|
}
|
|
104
120
|
|
|
105
121
|
// ─── Request (engine-internal wire shape) ────────────────────────────────────
|
|
@@ -146,6 +162,22 @@ const SetRunStatusRequestSchema = z.object({
|
|
|
146
162
|
reason: z.string().optional(),
|
|
147
163
|
});
|
|
148
164
|
|
|
165
|
+
const RefinePhaseRequestSchema = z.object({
|
|
166
|
+
...RunBindingShape,
|
|
167
|
+
action: z.literal(WorkflowControlAction.REFINE_PHASE),
|
|
168
|
+
/** The phase to re-run — the run's job/stage key. Must be a COMPLETED phase. */
|
|
169
|
+
phaseKey: z.string().min(1),
|
|
170
|
+
/** Optional refinement feedback folded into the re-run of the phase. */
|
|
171
|
+
feedback: z.string().optional(),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
const RestartPhaseRequestSchema = z.object({
|
|
175
|
+
...RunBindingShape,
|
|
176
|
+
action: z.literal(WorkflowControlAction.RESTART_PHASE),
|
|
177
|
+
/** The phase to re-run from scratch — the run's job/stage key. Must be COMPLETED. */
|
|
178
|
+
phaseKey: z.string().min(1),
|
|
179
|
+
});
|
|
180
|
+
|
|
149
181
|
/**
|
|
150
182
|
* The engine-internal control request. Discriminated on `action`; every member
|
|
151
183
|
* carries the server-derived `runId` + `orgId` binding.
|
|
@@ -154,12 +186,16 @@ export const WorkflowControlRequestSchema = z.discriminatedUnion('action', [
|
|
|
154
186
|
DecideGateRequestSchema,
|
|
155
187
|
AnswerInquiryRequestSchema,
|
|
156
188
|
SetRunStatusRequestSchema,
|
|
189
|
+
RefinePhaseRequestSchema,
|
|
190
|
+
RestartPhaseRequestSchema,
|
|
157
191
|
]);
|
|
158
192
|
export type WorkflowControlRequest = z.infer<typeof WorkflowControlRequestSchema>;
|
|
159
193
|
|
|
160
194
|
export type DecideGateRequest = z.infer<typeof DecideGateRequestSchema>;
|
|
161
195
|
export type AnswerInquiryRequest = z.infer<typeof AnswerInquiryRequestSchema>;
|
|
162
196
|
export type SetRunStatusRequest = z.infer<typeof SetRunStatusRequestSchema>;
|
|
197
|
+
export type RefinePhaseRequest = z.infer<typeof RefinePhaseRequestSchema>;
|
|
198
|
+
export type RestartPhaseRequest = z.infer<typeof RestartPhaseRequestSchema>;
|
|
163
199
|
|
|
164
200
|
// ─── Result (first-class structured accepted/rejected outcome) ───────────────
|
|
165
201
|
|