@leitwerk-dev/process-sdk 0.1.8 → 0.2.0
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/{chunk-TRQJ5PRM.js → chunk-TA4KO53Q.js} +1 -5
- package/dist/chunk-TA4KO53Q.js.map +1 -0
- package/dist/{chunk-5RJZ2E7D.js → chunk-WFY2WWZE.js} +2 -6
- package/dist/{chunk-5RJZ2E7D.js.map → chunk-WFY2WWZE.js.map} +1 -1
- package/dist/core-capabilities.d.ts +76 -34
- package/dist/core-capabilities.d.ts.map +1 -1
- package/dist/define-process.d.ts +36 -55
- package/dist/define-process.d.ts.map +1 -1
- package/dist/{extension-api-CqPGRqc9.d.ts → extension-api-CcqZCYJx.d.ts} +160 -74
- package/dist/extension-api.d.ts +120 -5
- package/dist/extension-api.d.ts.map +1 -1
- package/dist/external-action-source.d.ts +7 -0
- package/dist/external-action-source.d.ts.map +1 -0
- package/dist/external-source-poll.d.ts +15 -0
- package/dist/external-source-poll.d.ts.map +1 -0
- package/dist/flow.d.ts +92 -110
- package/dist/flow.d.ts.map +1 -1
- package/dist/fs-utils.d.ts +2 -0
- package/dist/fs-utils.d.ts.map +1 -1
- package/dist/git-binary.js +25 -33
- package/dist/git-binary.js.map +1 -1
- package/dist/index.d.ts +21 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4694 -29
- package/dist/index.js.map +1 -1
- package/dist/integration-http.d.ts +21 -0
- package/dist/integration-http.d.ts.map +1 -0
- package/dist/json-data.d.ts +3 -0
- package/dist/json-data.d.ts.map +1 -0
- package/dist/leaf-outcome-renderer.js +74 -64
- package/dist/leaf-outcome-renderer.js.map +1 -1
- package/dist/leaf-outcomes.d.ts.map +1 -1
- package/dist/model-provider.d.ts.map +1 -1
- package/dist/pi-config.d.ts +1 -5
- package/dist/pi-config.d.ts.map +1 -1
- package/dist/pi-config.js +20 -180
- package/dist/pi-config.js.map +1 -1
- package/dist/process-flow-view.d.ts.map +1 -1
- package/dist/process-graph.d.ts +1 -2
- package/dist/process-graph.d.ts.map +1 -1
- package/dist/process-watcher-source.d.ts +3 -1
- package/dist/process-watcher-source.d.ts.map +1 -1
- package/dist/project-binding.d.ts +9 -0
- package/dist/project-binding.d.ts.map +1 -0
- package/dist/registry-utils.d.ts.map +1 -1
- package/dist/repository-feedback.d.ts +29 -0
- package/dist/repository-feedback.d.ts.map +1 -0
- package/dist/repository-git-env.d.ts +2 -0
- package/dist/repository-git-env.d.ts.map +1 -1
- package/dist/repository-http.d.ts +19 -0
- package/dist/repository-http.d.ts.map +1 -0
- package/dist/repository-https.d.ts +3 -0
- package/dist/repository-https.d.ts.map +1 -0
- package/dist/repository-issue-watcher.d.ts +31 -0
- package/dist/repository-issue-watcher.d.ts.map +1 -0
- package/dist/repository-source-config.d.ts +32 -0
- package/dist/repository-source-config.d.ts.map +1 -0
- package/dist/repository-types.d.ts +36 -0
- package/dist/repository-types.d.ts.map +1 -0
- package/dist/review-flow.js +12 -43
- package/dist/review-flow.js.map +1 -1
- package/dist/runtime-internals.js +18 -2
- package/dist/runtime-internals.js.map +1 -1
- package/dist/state-helpers.d.ts +3 -2
- package/dist/state-helpers.d.ts.map +1 -1
- package/dist/subprocess-env.d.ts +1 -0
- package/dist/subprocess-env.d.ts.map +1 -1
- package/dist/tool-arguments.d.ts +7 -0
- package/dist/tool-arguments.d.ts.map +1 -0
- package/dist/turn-semantics.d.ts +5 -6
- package/dist/turn-semantics.d.ts.map +1 -1
- package/dist/types.d.ts +5 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/core-capabilities.ts +90 -37
- package/src/define-process.ts +231 -277
- package/src/extension-api.ts +148 -4
- package/src/external-action-source.ts +12 -0
- package/src/external-source-poll.ts +49 -0
- package/src/flow.ts +427 -646
- package/src/fs-utils.ts +17 -2
- package/src/index.ts +56 -13
- package/src/integration-http.ts +58 -0
- package/src/json-data.ts +25 -0
- package/src/leaf-outcomes.ts +1 -9
- package/src/model-provider.ts +10 -23
- package/src/pi-config.ts +1 -6
- package/src/process-flow-view.ts +32 -88
- package/src/process-graph.ts +25 -54
- package/src/process-watcher-source.ts +13 -8
- package/src/project-binding.ts +36 -0
- package/src/registry-utils.ts +1 -5
- package/src/repository-feedback.ts +59 -0
- package/src/repository-git-env.ts +34 -0
- package/src/repository-http.ts +71 -0
- package/src/repository-https.ts +22 -0
- package/src/repository-issue-watcher.ts +92 -0
- package/src/repository-source-config.ts +60 -0
- package/src/repository-types.ts +25 -0
- package/src/state-helpers.ts +8 -9
- package/src/subprocess-env.ts +6 -0
- package/src/tool-arguments.ts +37 -0
- package/src/turn-semantics.ts +31 -75
- package/src/types.ts +5 -15
- package/dist/browser-ui-extension.js +0 -2
- package/dist/browser-ui-extension.js.map +0 -1
- package/dist/capabilities.js +0 -7
- package/dist/capabilities.js.map +0 -1
- package/dist/chunk-TRQJ5PRM.js.map +0 -1
- package/dist/codecs.js +0 -9
- package/dist/codecs.js.map +0 -1
- package/dist/commit-message.js +0 -3
- package/dist/commit-message.js.map +0 -1
- package/dist/core-capabilities.js +0 -6
- package/dist/core-capabilities.js.map +0 -1
- package/dist/define-process.js +0 -1040
- package/dist/define-process.js.map +0 -1
- package/dist/event-bus.js +0 -31
- package/dist/event-bus.js.map +0 -1
- package/dist/extension-api.js +0 -5
- package/dist/extension-api.js.map +0 -1
- package/dist/flow.js +0 -1565
- package/dist/flow.js.map +0 -1
- package/dist/form-contract.js +0 -2
- package/dist/form-contract.js.map +0 -1
- package/dist/fs-utils.js +0 -23
- package/dist/fs-utils.js.map +0 -1
- package/dist/graph-fragments.js +0 -57
- package/dist/graph-fragments.js.map +0 -1
- package/dist/host-capabilities.js +0 -42
- package/dist/host-capabilities.js.map +0 -1
- package/dist/launcher-contract.js +0 -2
- package/dist/launcher-contract.js.map +0 -1
- package/dist/leaf-outcomes.js +0 -52
- package/dist/leaf-outcomes.js.map +0 -1
- package/dist/model-provider.js +0 -171
- package/dist/model-provider.js.map +0 -1
- package/dist/process-definition-internals.js +0 -25
- package/dist/process-definition-internals.js.map +0 -1
- package/dist/process-flow-view.js +0 -418
- package/dist/process-flow-view.js.map +0 -1
- package/dist/process-graph.js +0 -213
- package/dist/process-graph.js.map +0 -1
- package/dist/process-launcher-builder.js +0 -43
- package/dist/process-launcher-builder.js.map +0 -1
- package/dist/process-watcher-builder.js +0 -40
- package/dist/process-watcher-builder.js.map +0 -1
- package/dist/process-watcher-source.js +0 -45
- package/dist/process-watcher-source.js.map +0 -1
- package/dist/registry-utils.js +0 -18
- package/dist/registry-utils.js.map +0 -1
- package/dist/repository-git-env.js +0 -26
- package/dist/repository-git-env.js.map +0 -1
- package/dist/server-events.js +0 -2
- package/dist/server-events.js.map +0 -1
- package/dist/server-process-builder.js +0 -52
- package/dist/server-process-builder.js.map +0 -1
- package/dist/state-helpers.js +0 -20
- package/dist/state-helpers.js.map +0 -1
- package/dist/subprocess-env.js +0 -34
- package/dist/subprocess-env.js.map +0 -1
- package/dist/tool-renderers.js +0 -63
- package/dist/tool-renderers.js.map +0 -1
- package/dist/turn-semantics.js +0 -365
- package/dist/turn-semantics.js.map +0 -1
- package/dist/types.js +0 -23
- package/dist/types.js.map +0 -1
- package/dist/ui-process-builder.js +0 -30
- package/dist/ui-process-builder.js.map +0 -1
- package/dist/worker-process-builder.js +0 -22
- package/dist/worker-process-builder.js.map +0 -1
package/src/core-capabilities.ts
CHANGED
|
@@ -24,6 +24,7 @@ import type {
|
|
|
24
24
|
ExternalActionSource,
|
|
25
25
|
FormDefinition,
|
|
26
26
|
LauncherContext,
|
|
27
|
+
LaunchPreparationCheck,
|
|
27
28
|
ProcessLaunchConfig,
|
|
28
29
|
ProcessLauncherService,
|
|
29
30
|
ProcessLaunchPlan,
|
|
@@ -51,6 +52,15 @@ export interface ProcessRepoLike {
|
|
|
51
52
|
create(input: ProcessCreateInputLike): ProcessInstance;
|
|
52
53
|
getById(id: string): ProcessInstance | null;
|
|
53
54
|
listAll(): ProcessInstance[];
|
|
55
|
+
/** Startup-only compatibility migrations may rewrite persisted process position and state. */
|
|
56
|
+
update(
|
|
57
|
+
id: string,
|
|
58
|
+
input: {
|
|
59
|
+
selectedTurnId?: TurnId | null;
|
|
60
|
+
currentExecution?: ProcessInstance["currentExecution"];
|
|
61
|
+
stateJson?: string | null;
|
|
62
|
+
},
|
|
63
|
+
): ProcessInstance | null;
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
export interface ProcessProjectRepoLike {
|
|
@@ -294,6 +304,20 @@ export interface ProcessActionServiceLike {
|
|
|
294
304
|
): Promise<ActionExecutionResultLike>;
|
|
295
305
|
}
|
|
296
306
|
|
|
307
|
+
export interface ExternalObservationInput {
|
|
308
|
+
instanceId: string;
|
|
309
|
+
armingId: string;
|
|
310
|
+
generation: string;
|
|
311
|
+
observation?: {
|
|
312
|
+
summary: string;
|
|
313
|
+
links?: import("@leitwerk-dev/domain").TurnProgressLink[];
|
|
314
|
+
observedAt: string;
|
|
315
|
+
subject: string;
|
|
316
|
+
revision: string;
|
|
317
|
+
};
|
|
318
|
+
refreshError?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
297
321
|
export interface ExternalSourceArmingLike {
|
|
298
322
|
/** Process-local arming id. Durable arming identity is { instanceId, id }. */
|
|
299
323
|
id: string;
|
|
@@ -303,11 +327,15 @@ export interface ExternalSourceArmingLike {
|
|
|
303
327
|
externalActionId: string;
|
|
304
328
|
source: ExternalActionSource;
|
|
305
329
|
resolved: unknown;
|
|
330
|
+
/** Opaque identity of this resolved subscription. */
|
|
331
|
+
generation?: string;
|
|
306
332
|
}
|
|
307
333
|
|
|
308
334
|
export interface ExternalSourceFireInput {
|
|
309
335
|
instanceId: string;
|
|
310
336
|
armingId: string;
|
|
337
|
+
/** Reject a superseded subscription instead of queuing its event for a later turn. */
|
|
338
|
+
generation?: string;
|
|
311
339
|
input?: Record<string, unknown>;
|
|
312
340
|
event?: Record<string, unknown>;
|
|
313
341
|
mergeKey?: string | null;
|
|
@@ -316,42 +344,8 @@ export interface ExternalSourceFireInput {
|
|
|
316
344
|
export interface ExternalSourceServiceLike {
|
|
317
345
|
listArmed(kind: string): readonly ExternalSourceArmingLike[];
|
|
318
346
|
fire(input: ExternalSourceFireInput): Promise<ActionExecutionResultLike>;
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
export type ProcessLaunchFailureStageLike = "pre_commit" | "post_commit";
|
|
322
|
-
|
|
323
|
-
export type ProcessLaunchExecutionResultLike =
|
|
324
|
-
| { ok: true; process: ProcessInstance; projects: ProcessProject[]; reused: boolean }
|
|
325
|
-
| {
|
|
326
|
-
ok: false;
|
|
327
|
-
stage: "pre_commit";
|
|
328
|
-
status: number;
|
|
329
|
-
body: Record<string, unknown>;
|
|
330
|
-
}
|
|
331
|
-
| {
|
|
332
|
-
ok: false;
|
|
333
|
-
stage: "post_commit";
|
|
334
|
-
status: number;
|
|
335
|
-
body: Record<string, unknown>;
|
|
336
|
-
process: ProcessInstance;
|
|
337
|
-
projects: ProcessProject[];
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
export interface ProcessLaunchConfigExecutionInput {
|
|
341
|
-
launcherId: string;
|
|
342
|
-
launchConfig: ProcessLaunchConfig;
|
|
343
|
-
handoffDedupKey?: string | null;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export interface ProcessLaunchExecutorLike {
|
|
347
|
-
createProcessFromLaunchConfig(
|
|
348
|
-
input: ProcessLaunchConfigExecutionInput,
|
|
349
|
-
opts?: { actor?: Actor },
|
|
350
|
-
): Promise<ProcessLaunchExecutionResultLike>;
|
|
351
|
-
createProcessFromLaunchPlan(
|
|
352
|
-
launchPlan: ProcessLaunchPlan,
|
|
353
|
-
opts?: { actor?: Actor },
|
|
354
|
-
): Promise<ProcessLaunchExecutionResultLike>;
|
|
347
|
+
/** Records facts without firing an action or changing lifecycle state. */
|
|
348
|
+
observe?(input: ExternalObservationInput): Promise<ActionExecutionResultLike>;
|
|
355
349
|
}
|
|
356
350
|
|
|
357
351
|
export interface LauncherRecentValuesServiceLike {
|
|
@@ -364,6 +358,7 @@ export interface QueuedProcessInputLike {
|
|
|
364
358
|
kind: InputKind;
|
|
365
359
|
bodyMarkdown: string;
|
|
366
360
|
target?: ProcessInputTarget | null;
|
|
361
|
+
/** Stable principal that queued this input. Defaults to SYSTEM_ACTOR at persist time. */
|
|
367
362
|
actor?: Actor;
|
|
368
363
|
}
|
|
369
364
|
|
|
@@ -387,6 +382,7 @@ export interface ProcessEngineLike {
|
|
|
387
382
|
>;
|
|
388
383
|
startProcess(instanceId: string, startTurnId: TurnId): Promise<ProcessEngineResultLike>;
|
|
389
384
|
abortProcess(instanceId: string, opts?: { actor?: Actor }): Promise<ProcessEngineResultLike>;
|
|
385
|
+
/** Retries the current failed startup or accepted turn; startup retries consume no attempt. */
|
|
390
386
|
retryProcess(
|
|
391
387
|
instanceId: string,
|
|
392
388
|
opts?: { nextTurnModelProfileId?: string | null; actor?: Actor },
|
|
@@ -422,6 +418,44 @@ export interface RegisteredProcessWatcherLike<TConfig = unknown, TEvent = unknow
|
|
|
422
418
|
readonly presentation: ProcessWatcherPresentation;
|
|
423
419
|
readonly launchModelConfig: LaunchModelConfigInputLike;
|
|
424
420
|
resolveLaunch(event: TEvent, ctx?: LauncherContext): Promise<ProcessLaunchPlan | null>;
|
|
421
|
+
resolveLaunchAttempt(
|
|
422
|
+
event: TEvent,
|
|
423
|
+
ctx?: LauncherContext,
|
|
424
|
+
): Promise<{
|
|
425
|
+
launchConfig: ProcessLaunchConfig;
|
|
426
|
+
launchPlan: ProcessLaunchPlan;
|
|
427
|
+
preparationChecks: readonly LaunchPreparationCheck[];
|
|
428
|
+
} | null>;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export interface WatcherLaunchResultLike extends ProgrammaticLaunchResultLike {}
|
|
432
|
+
|
|
433
|
+
export interface ProgrammaticLaunchRequestLike {
|
|
434
|
+
launcherId: string;
|
|
435
|
+
launcherInput: Record<string, unknown>;
|
|
436
|
+
title?: string | null;
|
|
437
|
+
modelConfig?: LaunchModelConfigInputLike;
|
|
438
|
+
skillIds?: readonly string[];
|
|
439
|
+
/** Trusted, non-secret process metadata merged after launcher resolution. */
|
|
440
|
+
processMetadata?: Record<string, unknown>;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
export interface ProgrammaticLaunchResultLike {
|
|
444
|
+
launchRunId: string;
|
|
445
|
+
process: ProcessInstance | null;
|
|
446
|
+
error: string | null;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
export interface LaunchRunServiceLike {
|
|
450
|
+
startProgrammatic(
|
|
451
|
+
request: ProgrammaticLaunchRequestLike,
|
|
452
|
+
opts: { idempotencyKey: string; actor?: Actor },
|
|
453
|
+
): Promise<ProgrammaticLaunchResultLike>;
|
|
454
|
+
startWatcher<TConfig, TEvent>(
|
|
455
|
+
watcher: RegisteredProcessWatcherLike<TConfig, TEvent>,
|
|
456
|
+
event: TEvent,
|
|
457
|
+
opts: { idempotencyKey: string; actor?: Actor },
|
|
458
|
+
): Promise<WatcherLaunchResultLike>;
|
|
425
459
|
}
|
|
426
460
|
|
|
427
461
|
export interface ProcessWatcherServiceLike {
|
|
@@ -431,6 +465,24 @@ export interface ProcessWatcherServiceLike {
|
|
|
431
465
|
): readonly RegisteredProcessWatcherLike<TConfig, TEvent>[];
|
|
432
466
|
}
|
|
433
467
|
|
|
468
|
+
export interface PollResultLike {
|
|
469
|
+
readonly errors: readonly string[];
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export interface PollingHandleLike<T extends PollResultLike = PollResultLike> {
|
|
473
|
+
poll(): Promise<T>;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
export interface PollingServiceLike {
|
|
477
|
+
create<T extends PollResultLike>(options: {
|
|
478
|
+
id: string;
|
|
479
|
+
pollOnce(): Promise<T>;
|
|
480
|
+
isEnabled(): boolean;
|
|
481
|
+
pollInterval(): string;
|
|
482
|
+
defaultIntervalMs?: number;
|
|
483
|
+
}): PollingHandleLike<T>;
|
|
484
|
+
}
|
|
485
|
+
|
|
434
486
|
export interface ProcessQuestionServiceLike {
|
|
435
487
|
listOpen(instanceId?: string): readonly import("@leitwerk-dev/domain").ProcessQuestionRequest[];
|
|
436
488
|
submitAnswers(
|
|
@@ -467,9 +519,10 @@ export interface CoreServerSetupDeps {
|
|
|
467
519
|
launcherRecentValues: LauncherRecentValuesServiceLike;
|
|
468
520
|
launcherModelConfigs: LauncherModelConfigServiceLike;
|
|
469
521
|
launchPlans: ProcessLaunchPlanServiceLike;
|
|
470
|
-
processLaunches: ProcessLaunchExecutorLike;
|
|
471
522
|
handoffDedupKeys?: HandoffDedupKeyServiceLike;
|
|
472
523
|
processWatchers?: ProcessWatcherServiceLike;
|
|
524
|
+
launchRuns: LaunchRunServiceLike;
|
|
525
|
+
polling: PollingServiceLike;
|
|
473
526
|
processModelSelection?: ProcessModelSelectionServiceLike;
|
|
474
527
|
/** Durable active-turn questions for trusted operator-channel extensions. */
|
|
475
528
|
processQuestions?: ProcessQuestionServiceLike;
|