@vincemakes/kiso-core 0.26.2 → 0.27.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/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/kernel/hooks.d.ts +1 -9
- package/dist/kernel/loop.d.ts +0 -33
- package/dist/kernel/loop.js +24 -49
- package/dist/tools/registry.d.ts +5 -11
- package/dist/tools/registry.js +7 -22
- package/package.json +2 -2
- package/dist/kernel/mode.d.ts +0 -24
- package/dist/kernel/mode.js +0 -24
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export * from "./tools/registry.js";
|
|
|
4
4
|
export * from "./errors.js";
|
|
5
5
|
export * from "./kernel/event-log.js";
|
|
6
6
|
export * from "./kernel/hooks.js";
|
|
7
|
-
export * from "./kernel/mode.js";
|
|
8
7
|
export * from "./kernel/permission.js";
|
|
9
8
|
export * from "./kernel/loop.js";
|
|
10
9
|
export * from "./kernel/compaction.js";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,6 @@ export * from "./tools/registry.js";
|
|
|
4
4
|
export * from "./errors.js";
|
|
5
5
|
export * from "./kernel/event-log.js";
|
|
6
6
|
export * from "./kernel/hooks.js";
|
|
7
|
-
export * from "./kernel/mode.js";
|
|
8
7
|
export * from "./kernel/permission.js";
|
|
9
8
|
export * from "./kernel/loop.js";
|
|
10
9
|
export * from "./kernel/compaction.js";
|
package/dist/kernel/hooks.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* compile-time fact instead of a written rule).
|
|
14
14
|
*/
|
|
15
15
|
import type { Event } from "../protocol/events.js";
|
|
16
|
-
import type {
|
|
16
|
+
import type { UserMessage } from "../protocol/messages.js";
|
|
17
17
|
import type { ToolResult } from "../tools/tool.js";
|
|
18
18
|
import type { PermissionDecision } from "./permission.js";
|
|
19
19
|
export interface HookContext {
|
|
@@ -39,14 +39,6 @@ export interface HookHost {
|
|
|
39
39
|
onPreTool?(call: ToolCallPayload, ctx: HookContext): Promise<PermissionDecision>;
|
|
40
40
|
/** Execute: rewrite the result a tool returns. */
|
|
41
41
|
onPostTool?(call: ToolCallPayload, result: ToolResult, ctx: HookContext): Promise<ToolResult>;
|
|
42
|
-
/**
|
|
43
|
-
* DEPRECATED (ADR-0044): the classic auto-compaction path is retired —
|
|
44
|
-
* the loop never fires these (the microcompact boundary replaced it).
|
|
45
|
-
* Kept so the extension contract type-checks; inert. Removed at 1.0.
|
|
46
|
-
*/
|
|
47
|
-
onPreCompact?(messages: readonly Message[], ctx: HookContext): Promise<void>;
|
|
48
|
-
/** DEPRECATED (ADR-0044): see onPreCompact — never invoked. */
|
|
49
|
-
onPostCompact?(messages: readonly Message[], ctx: HookContext): Promise<void>;
|
|
50
42
|
/** Lifecycle: the loop paused (human decision pending). */
|
|
51
43
|
onPause?(reason: string, ctx: HookContext): Promise<void>;
|
|
52
44
|
/** Lifecycle: the loop is about to stop. */
|
package/dist/kernel/loop.d.ts
CHANGED
|
@@ -40,7 +40,6 @@ import type { EventInput } from "./event-log.js";
|
|
|
40
40
|
import type { AssistantBlock, AssistantMessage, Message, ToolResultMessage } from "../protocol/messages.js";
|
|
41
41
|
import { ToolRegistry } from "../tools/registry.js";
|
|
42
42
|
import type { HookHost } from "./hooks.js";
|
|
43
|
-
import type { ModeProfile } from "./mode.js";
|
|
44
43
|
import { type PermissionDecision } from "./permission.js";
|
|
45
44
|
export interface LoopConfig {
|
|
46
45
|
readonly adapter: Adapter;
|
|
@@ -48,9 +47,6 @@ export interface LoopConfig {
|
|
|
48
47
|
readonly systemPrompt?: string;
|
|
49
48
|
readonly registry: ToolRegistry;
|
|
50
49
|
readonly hooks?: HookHost;
|
|
51
|
-
readonly modes?: readonly ModeProfile[];
|
|
52
|
-
/** Active mode name; applies visibleToolNames structurally. */
|
|
53
|
-
readonly mode?: string;
|
|
54
50
|
readonly maxTurns?: number;
|
|
55
51
|
readonly maxRetries?: number;
|
|
56
52
|
/**
|
|
@@ -73,16 +69,6 @@ export interface LoopConfig {
|
|
|
73
69
|
readonly messages?: readonly Message[];
|
|
74
70
|
/** The run's event log. Pass the session's log to make this run durable. */
|
|
75
71
|
readonly log?: EventLog;
|
|
76
|
-
/**
|
|
77
|
-
* DEPRECATED (ADR-0044): the classic auto-compaction path is retired —
|
|
78
|
-
* the loop no longer produces `compacted` events; the microcompact
|
|
79
|
-
* boundary (below) absorbed the responsibility. Kept so old configs
|
|
80
|
-
* type-check; IGNORED. Old sessions' `compacted` events still replay
|
|
81
|
-
* verbatim (the projection). Removed at 1.0.
|
|
82
|
-
*/
|
|
83
|
-
readonly compaction?: {
|
|
84
|
-
readonly thresholdTokens: number;
|
|
85
|
-
};
|
|
86
72
|
/**
|
|
87
73
|
* C area: MICROCOMPACT — when the projected context exceeds the threshold,
|
|
88
74
|
* append ONE durable `microcompacted` boundary (clearing compactable tool
|
|
@@ -112,25 +98,6 @@ export interface LoopConfig {
|
|
|
112
98
|
* human's decision outranks the abort.
|
|
113
99
|
*/
|
|
114
100
|
readonly approvalVerdict?: (decisionId: string) => boolean | undefined;
|
|
115
|
-
/**
|
|
116
|
-
* DEAD — accepted by the type, never read by this loop.
|
|
117
|
-
*
|
|
118
|
-
* It was the C group channel for the failed-receipt pause: the loop
|
|
119
|
-
* persisted `uncertain_pending` and awaited a human verdict. ADR-0038
|
|
120
|
-
* removed that pause (a complete receipt IS the outcome), and with it
|
|
121
|
-
* every read of this field — a failure is now simply recorded failed and
|
|
122
|
-
* the siblings run on. The runtime still passes both callbacks
|
|
123
|
-
* (runtime/run.ts), so supplying them is harmless and changes nothing.
|
|
124
|
-
*
|
|
125
|
-
* The crash window — started, no receipt — is the ONLY uncertainty left,
|
|
126
|
-
* and the runtime's recovery driver owns it (RESOLVE_UNCERTAIN in
|
|
127
|
-
* runtime/recovery-plan.ts), not the loop. Both fields are kept because
|
|
128
|
-
* the surface is frozen (ADR-0051); do not read them as live wiring.
|
|
129
|
-
*/
|
|
130
|
-
readonly resolveUncertainty?: (executionId: string) => Promise<"rerun" | "abandoned">;
|
|
131
|
-
/** DEAD, as above — the uncertainty twin of `approvalVerdict`
|
|
132
|
-
* (round 4, adversarial). Never read by the loop since ADR-0038. */
|
|
133
|
-
readonly uncertaintyVerdict?: (executionId: string) => "rerun" | "abandoned" | undefined;
|
|
134
101
|
/**
|
|
135
102
|
* E1: the COMPOSED approval chain — the runtime composes the
|
|
136
103
|
* extensions' policies (deny > allow > ask, the R3 ruling) into ONE
|
package/dist/kernel/loop.js
CHANGED
|
@@ -38,7 +38,6 @@ import { EventLog } from "./event-log.js";
|
|
|
38
38
|
import { ToolRegistry } from "../tools/registry.js";
|
|
39
39
|
import { validateArgs } from "../tools/validate.js";
|
|
40
40
|
import { NoOpHooks } from "./hooks.js";
|
|
41
|
-
import { resolveModeProfile } from "./mode.js";
|
|
42
41
|
import { denialResult } from "./permission.js";
|
|
43
42
|
import { messagesToEvents, MICROCOMPACTABLE, DO_NOT_COMPACT, projectMessages } from "./project.js";
|
|
44
43
|
/**
|
|
@@ -72,17 +71,13 @@ export async function* loop(config) {
|
|
|
72
71
|
const maxTurns = config.maxTurns ?? DEFAULT_MAX_TURNS;
|
|
73
72
|
const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
74
73
|
const signal = config.signal;
|
|
75
|
-
const mode = resolveModeProfile(config.modes, config.mode);
|
|
76
|
-
const registry = mode?.visibleToolNames !== undefined
|
|
77
|
-
? config.registry.subset(mode.visibleToolNames)
|
|
78
|
-
: config.registry;
|
|
79
74
|
// CX-1 F7b (audit F7): ONE tool table per request — captured at
|
|
80
75
|
// assembly, dispatched from until the next assembly. The definition
|
|
81
76
|
// the model saw, the schema the arguments are validated against, the
|
|
82
77
|
// execute that runs and the effects the scheduler reads are the same
|
|
83
78
|
// captured values; a live source that changes mid-request reaches the
|
|
84
79
|
// NEXT request.
|
|
85
|
-
let table = registry.snapshot();
|
|
80
|
+
let table = config.registry.snapshot();
|
|
86
81
|
// Seed: a fresh log encodes the seed history as events so the projection
|
|
87
82
|
// (and any later replay) contains it. A non-empty log (session resume)
|
|
88
83
|
// is never re-seeded — the log already holds everything.
|
|
@@ -559,7 +554,7 @@ export async function* loop(config) {
|
|
|
559
554
|
messages,
|
|
560
555
|
...(config.reasoning !== undefined ? { reasoning: config.reasoning } : {}),
|
|
561
556
|
...(config.systemPrompt !== undefined ? { systemPrompt: config.systemPrompt } : {}),
|
|
562
|
-
tools: (table = registry.snapshot()).specs,
|
|
557
|
+
tools: (table = config.registry.snapshot()).specs,
|
|
563
558
|
...(config.maxTokens !== undefined ? { maxTokens: config.maxTokens } : {}),
|
|
564
559
|
...(config.temperature !== undefined ? { temperature: config.temperature } : {}),
|
|
565
560
|
...(signal !== undefined ? { signal } : {}),
|
|
@@ -641,15 +636,13 @@ export async function* loop(config) {
|
|
|
641
636
|
return;
|
|
642
637
|
}
|
|
643
638
|
let structured = toStructuredError(err);
|
|
644
|
-
// CX-1 F8 (ruled: the kernel owns retries): the
|
|
645
|
-
// max(
|
|
646
|
-
//
|
|
647
|
-
//
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
};
|
|
652
|
-
if (structured.retryable && attempts < maxRetries && retryWait() === null) {
|
|
639
|
+
// CX-1 F8 (ruled: the kernel owns retries): the n-th retry waits
|
|
640
|
+
// max(n × 250 ms, the provider's Retry-After), abortable — computed
|
|
641
|
+
// BEFORE `attempts` advances (the 2026-09-07 review's P3: computed
|
|
642
|
+
// after it, the first wait was 500 ms). A wait above the cap is
|
|
643
|
+
// never shortened — the run stops with an explicit error instead.
|
|
644
|
+
const retryWait = () => Math.max((attempts + 1) * 250, structured.retryAfterMs ?? 0);
|
|
645
|
+
if (structured.retryable && attempts < maxRetries && retryWait() > RETRY_AFTER_MAX_MS) {
|
|
653
646
|
structured = {
|
|
654
647
|
...structured,
|
|
655
648
|
retryable: false,
|
|
@@ -660,8 +653,8 @@ export async function* loop(config) {
|
|
|
660
653
|
// content — duplicates are worse than failures. Nothing streamed
|
|
661
654
|
// yet: the cheap in-place retry (no draft exists to void).
|
|
662
655
|
if (structured.retryable && !streamed && attempts < maxRetries) {
|
|
656
|
+
await sleep(retryWait(), signal); // abortable backoff, Retry-After honored
|
|
663
657
|
attempts += 1;
|
|
664
|
-
await sleep(retryWait() ?? attempts * 250, signal); // abortable backoff, Retry-After honored
|
|
665
658
|
continue;
|
|
666
659
|
}
|
|
667
660
|
// F4 — ABANDON HYGIENE, every streamed exit: settle, drain,
|
|
@@ -675,8 +668,8 @@ export async function* loop(config) {
|
|
|
675
668
|
// F4 — the mid-stream retry: same classification, same per-turn
|
|
676
669
|
// budget (ADR-0005 Amendment 1: frame state, per-process).
|
|
677
670
|
if (structured.retryable && attempts < maxRetries && !unsafeStartedInDraft()) {
|
|
671
|
+
await sleep(retryWait(), signal); // the same abortable backoff, Retry-After honored
|
|
678
672
|
attempts += 1;
|
|
679
|
-
await sleep(retryWait() ?? attempts * 250, signal); // the same abortable backoff, Retry-After honored
|
|
680
673
|
// Fresh per-attempt state — the marker is the boundary now.
|
|
681
674
|
pending.length = 0;
|
|
682
675
|
lastStop = undefined;
|
|
@@ -984,14 +977,18 @@ async function decideCall(call, registry, hooks, ctx, log, resolveApproval, reso
|
|
|
984
977
|
// its verdict. A throwing chain counts as ask. Allow/deny are recorded
|
|
985
978
|
// durably with decidedBy = the deciding extension, never pausing for a
|
|
986
979
|
// human.
|
|
987
|
-
// CX-1 F1 (audit F1): a durable decision
|
|
988
|
-
// invocation it was recorded for
|
|
989
|
-
//
|
|
990
|
-
//
|
|
991
|
-
//
|
|
992
|
-
// (
|
|
993
|
-
//
|
|
994
|
-
//
|
|
980
|
+
// CX-1 F1 (audit F1): a durable decision binds to EXACTLY the
|
|
981
|
+
// invocation it was recorded for — `invocationSeq === call.seq`. A
|
|
982
|
+
// provider callId alone is correlation, never identity: the old lookup
|
|
983
|
+
// took the FIRST decision with that callId in the whole log, so a
|
|
984
|
+
// reused callId inherited an old allow for a new call. The 0.26.1
|
|
985
|
+
// "re-issue" exception (same callId, same input, no result yet) is
|
|
986
|
+
// RETRACTED (the 2026-09-07 review's P1): it let a same-turn duplicate
|
|
987
|
+
// and a voided draft's retry inherit a verdict, and nothing needed it —
|
|
988
|
+
// a committed turn's pending call is executed by the recovery driver
|
|
989
|
+
// under its ORIGINAL seq, and a re-streamed call after a void is a new
|
|
990
|
+
// invocation the chain decides again (a policy is a function; running
|
|
991
|
+
// it twice costs nothing and gives a stateful one its say).
|
|
995
992
|
//
|
|
996
993
|
// The decision's invocationSeq names the original call (every
|
|
997
994
|
// producer stamps it, round 5). A legacy decision (no invocationSeq,
|
|
@@ -1012,28 +1009,6 @@ async function decideCall(call, registry, hooks, ctx, log, resolveApproval, reso
|
|
|
1012
1009
|
}
|
|
1013
1010
|
return undefined;
|
|
1014
1011
|
};
|
|
1015
|
-
/** The re-issue rule: a resume re-issues the pending call under the SAME
|
|
1016
|
-
* provider id — same callId, same tool, identical input — and the
|
|
1017
|
-
* original never completed: no result and no other call under that id
|
|
1018
|
-
* stands between the original and this call. A different callId with
|
|
1019
|
-
* the same arguments is a new invocation (the /mode-switch shape: a
|
|
1020
|
-
* write denied under plan is asked afresh under default). */
|
|
1021
|
-
const reissues = (origSeq) => {
|
|
1022
|
-
const orig = all.find((e) => e.seq === origSeq);
|
|
1023
|
-
if (orig === undefined || orig.type !== "tool_call_end")
|
|
1024
|
-
return false;
|
|
1025
|
-
if (orig.callId !== call.callId || orig.name !== call.name)
|
|
1026
|
-
return false;
|
|
1027
|
-
if (JSON.stringify(orig.input) !== JSON.stringify(call.input))
|
|
1028
|
-
return false;
|
|
1029
|
-
for (const e of all) {
|
|
1030
|
-
if (e.seq <= origSeq || e.seq >= call.seq)
|
|
1031
|
-
continue;
|
|
1032
|
-
if ((e.type === "tool_result" || e.type === "tool_call_end") && e.callId === orig.callId)
|
|
1033
|
-
return false;
|
|
1034
|
-
}
|
|
1035
|
-
return true;
|
|
1036
|
-
};
|
|
1037
1012
|
let durable;
|
|
1038
1013
|
let legacyAmbiguous = false;
|
|
1039
1014
|
for (const e of all) {
|
|
@@ -1046,7 +1021,7 @@ async function decideCall(call, registry, hooks, ctx, log, resolveApproval, reso
|
|
|
1046
1021
|
legacyAmbiguous = true;
|
|
1047
1022
|
continue;
|
|
1048
1023
|
}
|
|
1049
|
-
if (origSeq === call.seq
|
|
1024
|
+
if (origSeq === call.seq)
|
|
1050
1025
|
durable = e;
|
|
1051
1026
|
}
|
|
1052
1027
|
let chainVerdict;
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -7,11 +7,6 @@
|
|
|
7
7
|
* implementation's hand-maintained agent-tool sets and its six copies of the
|
|
8
8
|
* default tool list — see ADR-0001).
|
|
9
9
|
*
|
|
10
|
-
* `subset()` is the structural tool filter: a mode or a subagent gets a
|
|
11
|
-
* registry whose tool table PHYSICALLY lacks the tools it must not see. The
|
|
12
|
-
* model cannot call a tool that is not in its registry — no prompt can
|
|
13
|
-
* achieve that guarantee.
|
|
14
|
-
*
|
|
15
10
|
* `registerLive()` adds a LIVE tool source — a function returning an
|
|
16
11
|
* extension's CURRENT tools array. Any extension whose tool table settles
|
|
17
12
|
* after load is such a source (the runtime registers every extension's
|
|
@@ -40,9 +35,11 @@ export declare class ToolRegistry {
|
|
|
40
35
|
* snapshot at request assembly and dispatches from it: the definition
|
|
41
36
|
* sent to the model, the schema validated against, the `execute` that
|
|
42
37
|
* runs and the `effects` the scheduler reads are the SAME captured
|
|
43
|
-
* values
|
|
44
|
-
*
|
|
45
|
-
*
|
|
38
|
+
* values: the declaration data (schema, effects) is COPIED into the
|
|
39
|
+
* table, the handler stays by reference — an in-place edit to the
|
|
40
|
+
* source after the snapshot cannot reach a request already under way
|
|
41
|
+
* (the 2026-09-07 review's P2: a shallow copy shared the nested
|
|
42
|
+
* objects). Two sources publishing one name is an error the moment
|
|
46
43
|
* it is observed, naming both owners — never a traversal-order pick;
|
|
47
44
|
* the one exception is the SAME Tool object reached twice (the 0.1.27
|
|
48
45
|
* dedup), which is one tool. */
|
|
@@ -50,9 +47,6 @@ export declare class ToolRegistry {
|
|
|
50
47
|
get(name: string): Tool<any> | undefined;
|
|
51
48
|
list(): readonly Tool[];
|
|
52
49
|
has(name: string): boolean;
|
|
53
|
-
/** A registry restricted to the named tools. Unknown names are dropped
|
|
54
|
-
* loudly (the kernel never silently shrinks a tool set). */
|
|
55
|
-
subset(names: readonly string[]): ToolRegistry;
|
|
56
50
|
/** The minimal projection an adapter may see (never the handlers). */
|
|
57
51
|
toSpecs(): readonly ToolSpec[];
|
|
58
52
|
}
|
package/dist/tools/registry.js
CHANGED
|
@@ -7,11 +7,6 @@
|
|
|
7
7
|
* implementation's hand-maintained agent-tool sets and its six copies of the
|
|
8
8
|
* default tool list — see ADR-0001).
|
|
9
9
|
*
|
|
10
|
-
* `subset()` is the structural tool filter: a mode or a subagent gets a
|
|
11
|
-
* registry whose tool table PHYSICALLY lacks the tools it must not see. The
|
|
12
|
-
* model cannot call a tool that is not in its registry — no prompt can
|
|
13
|
-
* achieve that guarantee.
|
|
14
|
-
*
|
|
15
10
|
* `registerLive()` adds a LIVE tool source — a function returning an
|
|
16
11
|
* extension's CURRENT tools array. Any extension whose tool table settles
|
|
17
12
|
* after load is such a source (the runtime registers every extension's
|
|
@@ -40,9 +35,11 @@ export class ToolRegistry {
|
|
|
40
35
|
* snapshot at request assembly and dispatches from it: the definition
|
|
41
36
|
* sent to the model, the schema validated against, the `execute` that
|
|
42
37
|
* runs and the `effects` the scheduler reads are the SAME captured
|
|
43
|
-
* values
|
|
44
|
-
*
|
|
45
|
-
*
|
|
38
|
+
* values: the declaration data (schema, effects) is COPIED into the
|
|
39
|
+
* table, the handler stays by reference — an in-place edit to the
|
|
40
|
+
* source after the snapshot cannot reach a request already under way
|
|
41
|
+
* (the 2026-09-07 review's P2: a shallow copy shared the nested
|
|
42
|
+
* objects). Two sources publishing one name is an error the moment
|
|
46
43
|
* it is observed, naming both owners — never a traversal-order pick;
|
|
47
44
|
* the one exception is the SAME Tool object reached twice (the 0.1.27
|
|
48
45
|
* dedup), which is one tool. */
|
|
@@ -55,7 +52,8 @@ export class ToolRegistry {
|
|
|
55
52
|
return; // the same object reached twice — one tool
|
|
56
53
|
throw new Error(`tool table: '${t.name}' is published by two sources (${prior.owner}, ${owner})`);
|
|
57
54
|
}
|
|
58
|
-
|
|
55
|
+
const copy = { ...t, parameters: structuredClone(t.parameters), ...(t.effects === undefined ? {} : { effects: Object.freeze(structuredClone(t.effects)) }) };
|
|
56
|
+
captured.set(t.name, { tool: Object.freeze(copy), original: t, owner });
|
|
59
57
|
};
|
|
60
58
|
for (const t of this.#tools.values())
|
|
61
59
|
take(t, "registered");
|
|
@@ -105,19 +103,6 @@ export class ToolRegistry {
|
|
|
105
103
|
return true;
|
|
106
104
|
return this.#live.some(({ source }) => source().some((x) => x.name === name));
|
|
107
105
|
}
|
|
108
|
-
/** A registry restricted to the named tools. Unknown names are dropped
|
|
109
|
-
* loudly (the kernel never silently shrinks a tool set). */
|
|
110
|
-
subset(names) {
|
|
111
|
-
const out = new ToolRegistry();
|
|
112
|
-
for (const name of names) {
|
|
113
|
-
const tool = this.get(name);
|
|
114
|
-
if (tool === undefined) {
|
|
115
|
-
throw new Error(`subset(): unknown tool '${name}'`);
|
|
116
|
-
}
|
|
117
|
-
out.register(tool);
|
|
118
|
-
}
|
|
119
|
-
return out;
|
|
120
|
-
}
|
|
121
106
|
/** The minimal projection an adapter may see (never the handlers). */
|
|
122
107
|
toSpecs() {
|
|
123
108
|
return this.list().map((t) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincemakes/kiso-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "kiso (foundation) core — protocol, event log, loop, hooks, modes, permissions, compaction, delivery truth. The 2,000-line kernel at the bottom of the kiso framework.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"openai"
|
|
34
34
|
],
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@vincemakes/kiso-evals": "0.
|
|
36
|
+
"@vincemakes/kiso-evals": "0.27.0",
|
|
37
37
|
"@types/node": "^26.1.2",
|
|
38
38
|
"typescript": "^5.7.2",
|
|
39
39
|
"vitest": "^3.0.0"
|
package/dist/kernel/mode.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* L2 — ModeProfile: a mode is a cross-layer behavior switch (mauri ADR-0011),
|
|
3
|
-
* not a kernel feature. The kernel knows ONE mode at a time and applies it
|
|
4
|
-
* structurally:
|
|
5
|
-
*
|
|
6
|
-
* - `visibleToolNames` — physical removal: the registry is subset() to these
|
|
7
|
-
* tools BEFORE the adapter is called. The model cannot call what it cannot
|
|
8
|
-
* see; no system-prompt overlay can make that guarantee.
|
|
9
|
-
*
|
|
10
|
-
* That is the whole profile. SC-1b: `systemOverlay`, `permissionDefault`,
|
|
11
|
-
* `compactionKeepExtra`, and `stopPredicate` were REMOVED at 0.12.0 by the
|
|
12
|
-
* SC-1 memo's adjudication — all four were declared here and read by
|
|
13
|
-
* nothing, in the kernel or above it. Two of them ("reserved, read by the
|
|
14
|
-
* harness when the semantics land") had been waiting since mauri ADR-0011
|
|
15
|
-
* for semantics that never landed. A field that describes an intention
|
|
16
|
-
* rather than a behavior is a promise the type system makes on the
|
|
17
|
-
* kernel's behalf and the kernel does not keep; the honest profile is the
|
|
18
|
-
* one member that is actually applied.
|
|
19
|
-
*/
|
|
20
|
-
export interface ModeProfile {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
readonly visibleToolNames?: readonly string[];
|
|
23
|
-
}
|
|
24
|
-
export declare function resolveModeProfile(modes: readonly ModeProfile[] | undefined, name: string | undefined): ModeProfile | undefined;
|
package/dist/kernel/mode.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* L2 — ModeProfile: a mode is a cross-layer behavior switch (mauri ADR-0011),
|
|
3
|
-
* not a kernel feature. The kernel knows ONE mode at a time and applies it
|
|
4
|
-
* structurally:
|
|
5
|
-
*
|
|
6
|
-
* - `visibleToolNames` — physical removal: the registry is subset() to these
|
|
7
|
-
* tools BEFORE the adapter is called. The model cannot call what it cannot
|
|
8
|
-
* see; no system-prompt overlay can make that guarantee.
|
|
9
|
-
*
|
|
10
|
-
* That is the whole profile. SC-1b: `systemOverlay`, `permissionDefault`,
|
|
11
|
-
* `compactionKeepExtra`, and `stopPredicate` were REMOVED at 0.12.0 by the
|
|
12
|
-
* SC-1 memo's adjudication — all four were declared here and read by
|
|
13
|
-
* nothing, in the kernel or above it. Two of them ("reserved, read by the
|
|
14
|
-
* harness when the semantics land") had been waiting since mauri ADR-0011
|
|
15
|
-
* for semantics that never landed. A field that describes an intention
|
|
16
|
-
* rather than a behavior is a promise the type system makes on the
|
|
17
|
-
* kernel's behalf and the kernel does not keep; the honest profile is the
|
|
18
|
-
* one member that is actually applied.
|
|
19
|
-
*/
|
|
20
|
-
export function resolveModeProfile(modes, name) {
|
|
21
|
-
if (!name || !modes)
|
|
22
|
-
return undefined;
|
|
23
|
-
return modes.find((m) => m.name === name);
|
|
24
|
-
}
|