@kindgi/runtime 0.1.3 → 0.1.4-rc.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/inputs.d.ts +19 -1
- package/dist/inputs.d.ts.map +1 -1
- package/dist/runs.d.ts +13 -0
- package/dist/runs.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/inputs.ts +20 -1
- package/src/runs.ts +13 -0
package/dist/inputs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Principal } from '@kindgi/authz';
|
|
2
|
-
import type { Flow } from '@kindgi/flow';
|
|
2
|
+
import type { Flow, FlowVersionOverrides } from '@kindgi/flow';
|
|
3
3
|
import type { HandlerRegistry } from '@kindgi/handler';
|
|
4
4
|
import type { ConversationId, NodeId, ProjectId, Result, RunId, TenantId } from '@kindgi/types';
|
|
5
5
|
import type { HandlerMissingError } from './errors.js';
|
|
@@ -48,6 +48,11 @@ export interface RunAgentRef {
|
|
|
48
48
|
readonly version: string;
|
|
49
49
|
readonly conversationId: ConversationId;
|
|
50
50
|
}
|
|
51
|
+
/** Marks a run as a replay: an eval run re-running a past run (`of`). */
|
|
52
|
+
export interface RunReplayRef {
|
|
53
|
+
readonly of: RunId;
|
|
54
|
+
readonly evalRunId: string;
|
|
55
|
+
}
|
|
51
56
|
/**
|
|
52
57
|
* Binds the handlers for a flow the runtime is about to run or resume —
|
|
53
58
|
* the root flow and every child flow a subgraph node starts. Lets a
|
|
@@ -92,6 +97,15 @@ export interface RunFlowInput {
|
|
|
92
97
|
readonly parent?: ParentRunRef;
|
|
93
98
|
/** The agent this run is a turn of; see `RunAgentRef`. */
|
|
94
99
|
readonly agent?: RunAgentRef;
|
|
100
|
+
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
101
|
+
readonly replay?: RunReplayRef;
|
|
102
|
+
/**
|
|
103
|
+
* Agents and tools this run uses at other exact versions than the flow
|
|
104
|
+
* version's pins (`withVersions`): "this flow, with `acme.scorer` at
|
|
105
|
+
* 0.4.0". The run keeps them, so a resumed run binds the same. `flow`
|
|
106
|
+
* is the flow version as published; the caller applies them to bind.
|
|
107
|
+
*/
|
|
108
|
+
readonly versions?: FlowVersionOverrides;
|
|
95
109
|
/**
|
|
96
110
|
* Run an existing `pending` row (created by `startRun`) instead of
|
|
97
111
|
* inserting a new one — how a caller hands back a run id before the
|
|
@@ -159,6 +173,10 @@ export interface StartRunParams {
|
|
|
159
173
|
readonly parent?: ParentRunRef;
|
|
160
174
|
/** The agent this run is a turn of; see `RunAgentRef`. */
|
|
161
175
|
readonly agent?: RunAgentRef;
|
|
176
|
+
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
177
|
+
readonly replay?: RunReplayRef;
|
|
178
|
+
/** The versions the run swaps in over its flow version's pins; see `RunFlowInput.versions`. */
|
|
179
|
+
readonly versions?: FlowVersionOverrides;
|
|
162
180
|
}
|
|
163
181
|
export type StartRunError = {
|
|
164
182
|
readonly code: 'insert-failed';
|
package/dist/inputs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../src/inputs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"inputs.d.ts","sourceRoot":"","sources":["../src/inputs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe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AAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;CACvB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,CAAC;IAC7C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
package/dist/runs.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { FlowVersionOverrides } from '@kindgi/flow';
|
|
1
2
|
import type { Cursor, NodeId, OrgId, ProjectId, RunId, TenantId, Timestamp } from '@kindgi/types';
|
|
2
3
|
import type { RunAgentRef } from './inputs.js';
|
|
3
4
|
import type { RunStatus } from './types.js';
|
|
@@ -30,6 +31,14 @@ export interface KernelRunRecord {
|
|
|
30
31
|
* every other run, and on agent runs started before runs recorded it.
|
|
31
32
|
*/
|
|
32
33
|
readonly agent?: RunAgentRef;
|
|
34
|
+
/** Set on a replay run: the run it re-ran and the eval run that did so (`RunReplayRef`). */
|
|
35
|
+
readonly replayOf?: RunId | null;
|
|
36
|
+
readonly evalRunId?: string | null;
|
|
37
|
+
/**
|
|
38
|
+
* The versions the run swaps in over its flow version's pins
|
|
39
|
+
* (`RunFlowInput.versions`). Absent on a run that has none.
|
|
40
|
+
*/
|
|
41
|
+
readonly versions?: FlowVersionOverrides;
|
|
33
42
|
}
|
|
34
43
|
/**
|
|
35
44
|
* Content-scope filter for `RunBinding.listRuns`. Present-with-value
|
|
@@ -73,6 +82,10 @@ export interface ListRunsInput {
|
|
|
73
82
|
readonly topLevelOnly?: boolean;
|
|
74
83
|
/** Only the turns of this agent (`RunAgentRef.id`), at any version. */
|
|
75
84
|
readonly agentId?: string;
|
|
85
|
+
/** Replay runs: `exclude` leaves them out, `only` returns just them. Absent = include, so internal callers see every run. */
|
|
86
|
+
readonly replays?: 'exclude' | 'include' | 'only';
|
|
87
|
+
/** Only the replays of this eval run. */
|
|
88
|
+
readonly evalRunId?: string;
|
|
76
89
|
}
|
|
77
90
|
export interface ListRunsPage {
|
|
78
91
|
readonly data: readonly KernelRunRecord[];
|
package/dist/runs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAElG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxC,wFAAwF;IACxF,QAAQ,CAAC,WAAW,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AAE,MAAM,CAAC;QACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,qDAAqD;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;IAChC,uEAAuE;IACvE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,6HAA6H;IAC7H,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IAClD,yCAAyC;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,SAAS,eAAe,EAAE,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kindgi/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-rc.1",
|
|
4
4
|
"description": "Kindgi™ runtime wire-vocabulary + binding interfaces. Public shape covering: RunStatus / RunResult / RunOptions / JournalEntry / JournalKind and all fanout/subgraph/iteration/step payload types; all kernel error shapes (KernelError, RunNotFoundError, HandlerMissingError, WaitpointError, etc.); run inputs and records (RunFlowInput / ResumeRunInput / StartRunParams, FlowResolver, HandlerResolver, ParentRunRef, KernelRunRecord, ListRunsInput); trigger schemas (Cron/Event/Webhook records + inputs + errors, plus TriggerRegistryBinding + RunFlowBinding + TRIGGER_KINDS); versioning envelope + wrap/unwrap; event-bus channel + KernelEventBusBinding; and the binding interfaces (RunBinding, SchedulerBinding, WaitpointBinding, RunRetentionBinding, umbrella KernelBinding) that deployments plug into `createApp`. Types + pure derivation functions — no runtime state, no dependency on a runtime implementation. The Kindgi runtime implements the bindings.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"README.md"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@kindgi/authz": "0.1.
|
|
32
|
-
"@kindgi/flow": "0.1.
|
|
33
|
-
"@kindgi/handler": "0.1.
|
|
34
|
-
"@kindgi/types": "0.1.
|
|
31
|
+
"@kindgi/authz": "0.1.4-rc.1",
|
|
32
|
+
"@kindgi/flow": "0.1.4-rc.1",
|
|
33
|
+
"@kindgi/handler": "0.1.4-rc.1",
|
|
34
|
+
"@kindgi/types": "0.1.4-rc.1"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22.12.0"
|
package/src/inputs.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (C) 2026 Kindgi Inc.
|
|
3
3
|
|
|
4
4
|
import type { Principal } from '@kindgi/authz';
|
|
5
|
-
import type { Flow } from '@kindgi/flow';
|
|
5
|
+
import type { Flow, FlowVersionOverrides } from '@kindgi/flow';
|
|
6
6
|
import type { HandlerRegistry } from '@kindgi/handler';
|
|
7
7
|
import type { ConversationId, NodeId, ProjectId, Result, RunId, TenantId } from '@kindgi/types';
|
|
8
8
|
|
|
@@ -56,6 +56,12 @@ export interface RunAgentRef {
|
|
|
56
56
|
readonly conversationId: ConversationId;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/** Marks a run as a replay: an eval run re-running a past run (`of`). */
|
|
60
|
+
export interface RunReplayRef {
|
|
61
|
+
readonly of: RunId;
|
|
62
|
+
readonly evalRunId: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
/**
|
|
60
66
|
* Binds the handlers for a flow the runtime is about to run or resume —
|
|
61
67
|
* the root flow and every child flow a subgraph node starts. Lets a
|
|
@@ -101,6 +107,15 @@ export interface RunFlowInput {
|
|
|
101
107
|
readonly parent?: ParentRunRef;
|
|
102
108
|
/** The agent this run is a turn of; see `RunAgentRef`. */
|
|
103
109
|
readonly agent?: RunAgentRef;
|
|
110
|
+
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
111
|
+
readonly replay?: RunReplayRef;
|
|
112
|
+
/**
|
|
113
|
+
* Agents and tools this run uses at other exact versions than the flow
|
|
114
|
+
* version's pins (`withVersions`): "this flow, with `acme.scorer` at
|
|
115
|
+
* 0.4.0". The run keeps them, so a resumed run binds the same. `flow`
|
|
116
|
+
* is the flow version as published; the caller applies them to bind.
|
|
117
|
+
*/
|
|
118
|
+
readonly versions?: FlowVersionOverrides;
|
|
104
119
|
/**
|
|
105
120
|
* Run an existing `pending` row (created by `startRun`) instead of
|
|
106
121
|
* inserting a new one — how a caller hands back a run id before the
|
|
@@ -170,6 +185,10 @@ export interface StartRunParams {
|
|
|
170
185
|
readonly parent?: ParentRunRef;
|
|
171
186
|
/** The agent this run is a turn of; see `RunAgentRef`. */
|
|
172
187
|
readonly agent?: RunAgentRef;
|
|
188
|
+
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
189
|
+
readonly replay?: RunReplayRef;
|
|
190
|
+
/** The versions the run swaps in over its flow version's pins; see `RunFlowInput.versions`. */
|
|
191
|
+
readonly versions?: FlowVersionOverrides;
|
|
173
192
|
}
|
|
174
193
|
|
|
175
194
|
export type StartRunError = { readonly code: 'insert-failed'; readonly message: string };
|
package/src/runs.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
// is not part of this shape.
|
|
9
9
|
//
|
|
10
10
|
|
|
11
|
+
import type { FlowVersionOverrides } from '@kindgi/flow';
|
|
11
12
|
import type { Cursor, NodeId, OrgId, ProjectId, RunId, TenantId, Timestamp } from '@kindgi/types';
|
|
12
13
|
|
|
13
14
|
import type { RunAgentRef } from './inputs.js';
|
|
@@ -42,6 +43,14 @@ export interface KernelRunRecord {
|
|
|
42
43
|
* every other run, and on agent runs started before runs recorded it.
|
|
43
44
|
*/
|
|
44
45
|
readonly agent?: RunAgentRef;
|
|
46
|
+
/** Set on a replay run: the run it re-ran and the eval run that did so (`RunReplayRef`). */
|
|
47
|
+
readonly replayOf?: RunId | null;
|
|
48
|
+
readonly evalRunId?: string | null;
|
|
49
|
+
/**
|
|
50
|
+
* The versions the run swaps in over its flow version's pins
|
|
51
|
+
* (`RunFlowInput.versions`). Absent on a run that has none.
|
|
52
|
+
*/
|
|
53
|
+
readonly versions?: FlowVersionOverrides;
|
|
45
54
|
}
|
|
46
55
|
|
|
47
56
|
/**
|
|
@@ -84,6 +93,10 @@ export interface ListRunsInput {
|
|
|
84
93
|
readonly topLevelOnly?: boolean;
|
|
85
94
|
/** Only the turns of this agent (`RunAgentRef.id`), at any version. */
|
|
86
95
|
readonly agentId?: string;
|
|
96
|
+
/** Replay runs: `exclude` leaves them out, `only` returns just them. Absent = include, so internal callers see every run. */
|
|
97
|
+
readonly replays?: 'exclude' | 'include' | 'only';
|
|
98
|
+
/** Only the replays of this eval run. */
|
|
99
|
+
readonly evalRunId?: string;
|
|
87
100
|
}
|
|
88
101
|
|
|
89
102
|
export interface ListRunsPage {
|