@sema-agent/mods-kernel 7.64.0 → 7.66.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/dispatch.d.ts +1 -0
- package/dist/dispatch.js +5 -2
- package/dist/events.d.ts +1 -1
- package/dist/events.js +2 -2
- package/package.json +2 -2
package/dist/dispatch.d.ts
CHANGED
package/dist/dispatch.js
CHANGED
|
@@ -2,6 +2,9 @@ import { CATCH_BUDGET_MS, createSelfBudget, POST_ABORT_GRACE_MS, RUNAWAY_AFTER_M
|
|
|
2
2
|
import { expandOnSide, failureRefuses, isModEventName, MOD_SEATS, nextToRefusal, stationOn } from "./events.js";
|
|
3
3
|
import { ENGINE_ORIGIN, modsInvalid, screenModSeats, } from "./registration.js";
|
|
4
4
|
import { answerUpward, answerViolation, detachedCopy, engineObjectsOnce, handedOn, handOnViolation, matcherMatches, matcherViolation, methodAnswerViolation, NEXT_IN_FLIGHT, receiveAnswer, receiveEvent, receivePayload, sealedObjects, } from "./site-rules.js";
|
|
5
|
+
function handlerFrame(below, plugin, handler, event) {
|
|
6
|
+
return Object.freeze([...below, Object.freeze({ kind: "handler", plugin, handler, event })]);
|
|
7
|
+
}
|
|
5
8
|
const TIER_RANK = { prepend: 0, user: 1, append: 2, builtin: 3, core: 4 };
|
|
6
9
|
const bypassed = (floors, tier) => floors.some((f) => TIER_RANK[f.from] < TIER_RANK[tier] && TIER_RANK[tier] < TIER_RANK[f.to]);
|
|
7
10
|
export async function admitMods(input) {
|
|
@@ -501,7 +504,7 @@ function createBus(side, mounted, bottoms, entries, report, records, describe, i
|
|
|
501
504
|
live.add(ac);
|
|
502
505
|
const budgetMs = ownMs(h.reg.budgetMs);
|
|
503
506
|
const budget = createSelfBudget(budgetMs, () => ac.abort(new Error(`${name} ran past its ${budgetMs}ms budget`)));
|
|
504
|
-
const myFrames =
|
|
507
|
+
const myFrames = handlerFrame(fr, name, h.index, event);
|
|
505
508
|
const state = {
|
|
506
509
|
pending: 0,
|
|
507
510
|
called: false,
|
|
@@ -672,7 +675,7 @@ function createBus(side, mounted, bottoms, entries, report, records, describe, i
|
|
|
672
675
|
live.add(ac);
|
|
673
676
|
const budgetMs = ownMs(h.reg.budgetMs);
|
|
674
677
|
const budget = createSelfBudget(budgetMs, () => ac.abort(new Error(`${name} ran past its ${budgetMs}ms budget`)));
|
|
675
|
-
const myFrames =
|
|
678
|
+
const myFrames = handlerFrame(fr, name, h.index, event);
|
|
676
679
|
const refuse = () => Promise.reject(new Error(`${name}: an observe handler is not in the chain; next() is unavailable`));
|
|
677
680
|
const next = makeNext({ budget, signal: ac.signal, trace: () => Object.freeze([]) }, refuse, refuse);
|
|
678
681
|
const verdict = (r) => {
|
package/dist/events.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const KERNEL_CONTRACT_VERSION =
|
|
1
|
+
export declare const KERNEL_CONTRACT_VERSION = 9;
|
|
2
2
|
export declare const MOD_TIERS: readonly ["prepend", "user", "append", "builtin", "core"];
|
|
3
3
|
export type ModTier = (typeof MOD_TIERS)[number];
|
|
4
4
|
export type ModRegistrationTier = Exclude<ModTier, "builtin" | "core">;
|
package/dist/events.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const KERNEL_CONTRACT_VERSION =
|
|
1
|
+
export const KERNEL_CONTRACT_VERSION = 9;
|
|
2
2
|
export const MOD_TIERS = Object.freeze(["prepend", "user", "append", "builtin", "core"]);
|
|
3
3
|
export const MOD_SEATS = Object.freeze(["deployment", "task"]);
|
|
4
4
|
export const MOD_EVENT_SIDES = Object.freeze(["engine", "surface", "both"]);
|
|
@@ -94,7 +94,7 @@ export const MOD_EVENT_TABLE = Object.freeze({
|
|
|
94
94
|
"ui.focus": surface(station("skip", "grace", ["component", "requestId", "plugin", "origin", "element"], { call: true })),
|
|
95
95
|
"agent.offer": engine(station("skip", "grace", ["agent", "provider"])),
|
|
96
96
|
"agent.spawn": engine(station("refuse_until_run", "immediate", AGENT_SPAWN_PINNED, { call: true })),
|
|
97
|
-
"prompt.submit": engine(station("refuse", "immediate", ["source", "inputId", "actor"])),
|
|
97
|
+
"prompt.submit": engine(station("refuse", "immediate", ["source", "inputId", "actor", "author", "extension"], { call: true })),
|
|
98
98
|
"prompt.fill": surface(station("skip", "grace", ["origin", "mode"], { call: true })),
|
|
99
99
|
"prompt.suggest": surface(station("skip", "grace", ["origin"], { call: true })),
|
|
100
100
|
"prompt.edit": surface(station("skip", "grace", ["origin", "key"], { budgetMs: PROMPT_EDIT_BUDGET_MS })),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sema-agent/mods-kernel",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.66.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The sema mods kernel: one extension bus (registration, admission, chain, failure and budget law) shared by the engine and the shell. Zero dependencies.",
|
|
6
6
|
"type": "module",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsc -p tsconfig.json"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "221be44613c0641e31654fcf2a9768c68f49f288"
|
|
35
35
|
}
|