@kindgi/runtime 0.1.4-rc.0 → 0.1.4-rc.2
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 +22 -2
- package/dist/inputs.d.ts.map +1 -1
- package/dist/runs.d.ts +13 -1
- package/dist/runs.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/inputs.ts +32 -2
- package/src/runs.ts +22 -1
package/dist/inputs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
import type { ConversationId, NodeId, ProjectId, Result, RunId, TenantId } from '@kindgi/types';
|
|
4
|
+
import type { AgentVersionVia, ConversationId, LiveScope, NodeId, ProjectId, Result, RunId, ScopeSegment, TenantId } from '@kindgi/types';
|
|
5
5
|
import type { HandlerMissingError } from './errors.js';
|
|
6
6
|
import type { KernelEventBusBinding } from './event-bus.js';
|
|
7
7
|
import type { RunOptions } from './types.js';
|
|
@@ -47,6 +47,10 @@ export interface RunAgentRef {
|
|
|
47
47
|
readonly id: string;
|
|
48
48
|
readonly version: string;
|
|
49
49
|
readonly conversationId: ConversationId;
|
|
50
|
+
/** Why this version ran (absent on runs from before it was recorded). */
|
|
51
|
+
readonly via?: AgentVersionVia;
|
|
52
|
+
/** The pin that chose it, when `via` is `live`. */
|
|
53
|
+
readonly liveScope?: LiveScope;
|
|
50
54
|
}
|
|
51
55
|
/** Marks a run as a replay: an eval run re-running a past run (`of`). */
|
|
52
56
|
export interface RunReplayRef {
|
|
@@ -99,6 +103,18 @@ export interface RunFlowInput {
|
|
|
99
103
|
readonly agent?: RunAgentRef;
|
|
100
104
|
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
101
105
|
readonly replay?: RunReplayRef;
|
|
106
|
+
/**
|
|
107
|
+
* Agents and tools this run uses at other exact versions than the flow
|
|
108
|
+
* version's pins (`withVersions`): "this flow, with `acme.scorer` at
|
|
109
|
+
* 0.4.0". The run keeps them, so a resumed run binds the same. `flow`
|
|
110
|
+
* is the flow version as published; the caller applies them to bind.
|
|
111
|
+
*/
|
|
112
|
+
readonly versions?: FlowVersionOverrides;
|
|
113
|
+
/**
|
|
114
|
+
* The run's segment path (ordered, coarse to fine), which picks live agent
|
|
115
|
+
* versions; a child run inherits its parent's.
|
|
116
|
+
*/
|
|
117
|
+
readonly segments?: readonly ScopeSegment[];
|
|
102
118
|
/**
|
|
103
119
|
* Run an existing `pending` row (created by `startRun`) instead of
|
|
104
120
|
* inserting a new one — how a caller hands back a run id before the
|
|
@@ -168,6 +184,10 @@ export interface StartRunParams {
|
|
|
168
184
|
readonly agent?: RunAgentRef;
|
|
169
185
|
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
170
186
|
readonly replay?: RunReplayRef;
|
|
187
|
+
/** The versions the run swaps in over its flow version's pins; see `RunFlowInput.versions`. */
|
|
188
|
+
readonly versions?: FlowVersionOverrides;
|
|
189
|
+
/** The run's segment path; see `RunFlowInput.segments`. */
|
|
190
|
+
readonly segments?: readonly ScopeSegment[];
|
|
171
191
|
}
|
|
172
192
|
export type StartRunError = {
|
|
173
193
|
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,CA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AAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;IAC7B,wEAAwE;IACxE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IAC/B,+FAA+F;IAC/F,QAAQ,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IACzC,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC7C;AAED,MAAM,MAAM,aAAa,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,CAAC,OAAO,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,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FlowVersionOverrides } from '@kindgi/flow';
|
|
2
|
+
import type { Cursor, NodeId, OrgId, ProjectId, RunId, ScopeSegment, TenantId, Timestamp } from '@kindgi/types';
|
|
2
3
|
import type { RunAgentRef } from './inputs.js';
|
|
3
4
|
import type { RunStatus } from './types.js';
|
|
4
5
|
/**
|
|
@@ -33,6 +34,17 @@ export interface KernelRunRecord {
|
|
|
33
34
|
/** Set on a replay run: the run it re-ran and the eval run that did so (`RunReplayRef`). */
|
|
34
35
|
readonly replayOf?: RunId | null;
|
|
35
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;
|
|
42
|
+
/**
|
|
43
|
+
* The segment path the run was started with (ordered, coarse to fine),
|
|
44
|
+
* which picks live agent versions: the run's own, and its agent steps'
|
|
45
|
+
* when it is a flow run. Absent when it was started without one.
|
|
46
|
+
*/
|
|
47
|
+
readonly segments?: readonly ScopeSegment[];
|
|
36
48
|
}
|
|
37
49
|
/**
|
|
38
50
|
* Content-scope filter for `RunBinding.listRuns`. Present-with-value
|
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,
|
|
1
|
+
{"version":3,"file":"runs.d.ts","sourceRoot":"","sources":["../src/runs.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EACV,MAAM,EACN,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AAEvB,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,EAA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GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE;QAChB,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;QACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,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.4-rc.
|
|
3
|
+
"version": "0.1.4-rc.2",
|
|
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.4-rc.
|
|
32
|
-
"@kindgi/flow": "0.1.4-rc.
|
|
33
|
-
"@kindgi/handler": "0.1.4-rc.
|
|
34
|
-
"@kindgi/types": "0.1.4-rc.
|
|
31
|
+
"@kindgi/authz": "0.1.4-rc.2",
|
|
32
|
+
"@kindgi/flow": "0.1.4-rc.2",
|
|
33
|
+
"@kindgi/handler": "0.1.4-rc.2",
|
|
34
|
+
"@kindgi/types": "0.1.4-rc.2"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=22.12.0"
|
package/src/inputs.ts
CHANGED
|
@@ -2,9 +2,19 @@
|
|
|
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
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
AgentVersionVia,
|
|
9
|
+
ConversationId,
|
|
10
|
+
LiveScope,
|
|
11
|
+
NodeId,
|
|
12
|
+
ProjectId,
|
|
13
|
+
Result,
|
|
14
|
+
RunId,
|
|
15
|
+
ScopeSegment,
|
|
16
|
+
TenantId,
|
|
17
|
+
} from '@kindgi/types';
|
|
8
18
|
|
|
9
19
|
import type { HandlerMissingError } from './errors.js';
|
|
10
20
|
import type { KernelEventBusBinding } from './event-bus.js';
|
|
@@ -54,6 +64,10 @@ export interface RunAgentRef {
|
|
|
54
64
|
readonly id: string;
|
|
55
65
|
readonly version: string;
|
|
56
66
|
readonly conversationId: ConversationId;
|
|
67
|
+
/** Why this version ran (absent on runs from before it was recorded). */
|
|
68
|
+
readonly via?: AgentVersionVia;
|
|
69
|
+
/** The pin that chose it, when `via` is `live`. */
|
|
70
|
+
readonly liveScope?: LiveScope;
|
|
57
71
|
}
|
|
58
72
|
|
|
59
73
|
/** Marks a run as a replay: an eval run re-running a past run (`of`). */
|
|
@@ -109,6 +123,18 @@ export interface RunFlowInput {
|
|
|
109
123
|
readonly agent?: RunAgentRef;
|
|
110
124
|
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
111
125
|
readonly replay?: RunReplayRef;
|
|
126
|
+
/**
|
|
127
|
+
* Agents and tools this run uses at other exact versions than the flow
|
|
128
|
+
* version's pins (`withVersions`): "this flow, with `acme.scorer` at
|
|
129
|
+
* 0.4.0". The run keeps them, so a resumed run binds the same. `flow`
|
|
130
|
+
* is the flow version as published; the caller applies them to bind.
|
|
131
|
+
*/
|
|
132
|
+
readonly versions?: FlowVersionOverrides;
|
|
133
|
+
/**
|
|
134
|
+
* The run's segment path (ordered, coarse to fine), which picks live agent
|
|
135
|
+
* versions; a child run inherits its parent's.
|
|
136
|
+
*/
|
|
137
|
+
readonly segments?: readonly ScopeSegment[];
|
|
112
138
|
/**
|
|
113
139
|
* Run an existing `pending` row (created by `startRun`) instead of
|
|
114
140
|
* inserting a new one — how a caller hands back a run id before the
|
|
@@ -180,6 +206,10 @@ export interface StartRunParams {
|
|
|
180
206
|
readonly agent?: RunAgentRef;
|
|
181
207
|
/** Set when an eval run is replaying a past run; see `RunReplayRef`. */
|
|
182
208
|
readonly replay?: RunReplayRef;
|
|
209
|
+
/** The versions the run swaps in over its flow version's pins; see `RunFlowInput.versions`. */
|
|
210
|
+
readonly versions?: FlowVersionOverrides;
|
|
211
|
+
/** The run's segment path; see `RunFlowInput.segments`. */
|
|
212
|
+
readonly segments?: readonly ScopeSegment[];
|
|
183
213
|
}
|
|
184
214
|
|
|
185
215
|
export type StartRunError = { readonly code: 'insert-failed'; readonly message: string };
|
package/src/runs.ts
CHANGED
|
@@ -8,7 +8,17 @@
|
|
|
8
8
|
// is not part of this shape.
|
|
9
9
|
//
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { FlowVersionOverrides } from '@kindgi/flow';
|
|
12
|
+
import type {
|
|
13
|
+
Cursor,
|
|
14
|
+
NodeId,
|
|
15
|
+
OrgId,
|
|
16
|
+
ProjectId,
|
|
17
|
+
RunId,
|
|
18
|
+
ScopeSegment,
|
|
19
|
+
TenantId,
|
|
20
|
+
Timestamp,
|
|
21
|
+
} from '@kindgi/types';
|
|
12
22
|
|
|
13
23
|
import type { RunAgentRef } from './inputs.js';
|
|
14
24
|
import type { RunStatus } from './types.js';
|
|
@@ -45,6 +55,17 @@ export interface KernelRunRecord {
|
|
|
45
55
|
/** Set on a replay run: the run it re-ran and the eval run that did so (`RunReplayRef`). */
|
|
46
56
|
readonly replayOf?: RunId | null;
|
|
47
57
|
readonly evalRunId?: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The versions the run swaps in over its flow version's pins
|
|
60
|
+
* (`RunFlowInput.versions`). Absent on a run that has none.
|
|
61
|
+
*/
|
|
62
|
+
readonly versions?: FlowVersionOverrides;
|
|
63
|
+
/**
|
|
64
|
+
* The segment path the run was started with (ordered, coarse to fine),
|
|
65
|
+
* which picks live agent versions: the run's own, and its agent steps'
|
|
66
|
+
* when it is a flow run. Absent when it was started without one.
|
|
67
|
+
*/
|
|
68
|
+
readonly segments?: readonly ScopeSegment[];
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
/**
|