@arcforge/kernel 2.0.198 → 2.0.200
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/package.json +8 -8
- package/src/kernel.ts +14 -2
- package/src/scheduler/invocation.ts +9 -1
- package/src/scheduler/scheduler.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcforge/kernel",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.200",
|
|
4
4
|
"description": "The Axon kernel — ring 0. Owns resources and execution, enforces policy, and is the only constructor of the unprivileged capsule.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"deploy": "echo \"This package is published ONLY by apps/tui/scripts/release.ts, which pins workspace:* deps to concrete versions first. Publishing it directly ships an unresolvable dependency.\" && exit 1"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@arcforge/air": "2.0.
|
|
19
|
-
"@arcforge/engines": "2.0.
|
|
20
|
-
"@arcforge/err": "2.0.
|
|
21
|
-
"@arcforge/session": "2.0.
|
|
22
|
-
"@arcforge/types": "2.0.
|
|
23
|
-
"@arcforge/cloud": "2.0.
|
|
24
|
-
"@arcforge/capsule": "2.0.
|
|
18
|
+
"@arcforge/air": "2.0.200",
|
|
19
|
+
"@arcforge/engines": "2.0.200",
|
|
20
|
+
"@arcforge/err": "2.0.200",
|
|
21
|
+
"@arcforge/session": "2.0.200",
|
|
22
|
+
"@arcforge/types": "2.0.200",
|
|
23
|
+
"@arcforge/cloud": "2.0.200",
|
|
24
|
+
"@arcforge/capsule": "2.0.200"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/bun": "latest",
|
package/src/kernel.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { err } from "@arcforge/err"
|
|
2
|
-
import type { AxonBlueprint, AxonDriver, AxonEngineCall, AxonEngineDriver, CapsulePolicy, ResolvedCapsulePolicy, AxonEngineEvent, AxonEntry, AxonEntryEvent, AxonEventMap, AxonRunResult, CapsuleCommandOrigin, EngineSession, KernelAbi, TransformOptions } from "@arcforge/types"
|
|
2
|
+
import type { AxonBlueprint, AxonDriver, AxonEngineCall, AxonEngineDriver, CapsulePolicy, ResolvedCapsulePolicy, AxonEngineEvent, AxonEntry, AxonEntryEvent, AxonEventMap, AxonRunResult, CapsuleCommandOrigin, EngineSession, KernelAbi, TransformOptions, AxonStimulusInput } from "@arcforge/types"
|
|
3
3
|
import { EMPTY_CAPSULE_SCOPE } from "@arcforge/types"
|
|
4
4
|
import type { AxonCloudClient } from "@arcforge/cloud"
|
|
5
5
|
import type { KernelBus } from "./contracts"
|
|
@@ -83,6 +83,8 @@ type KernelOpts = {
|
|
|
83
83
|
type KernelInput = {
|
|
84
84
|
/** User message committed before the wake starts. */
|
|
85
85
|
content?: string | string[]
|
|
86
|
+
/** Ordered non-text stimuli committed before this wake starts. */
|
|
87
|
+
stimuli?: AxonStimulusInput[]
|
|
86
88
|
/**
|
|
87
89
|
* The surface this message arrived on, and the address a reply goes back
|
|
88
90
|
* to — `terminal`, `axon-cli`, `telegram:8199237521`.
|
|
@@ -731,13 +733,20 @@ export async function Kernel(opts: KernelOpts) {
|
|
|
731
733
|
// otherwise. A confined agent reads what it asked for rather than
|
|
732
734
|
// what it was given, which is the same indirection that keeps
|
|
733
735
|
// cognition from learning which model is behind a role.
|
|
736
|
+
const resolved = live.cognet.resolvedEngines?.[role]
|
|
734
737
|
const facts = bound
|
|
735
738
|
? {
|
|
736
739
|
get context() { return bound.capability.context },
|
|
737
740
|
get modalities() { return { in: bound.capability.in, out: bound.capability.out } },
|
|
738
741
|
get slots() { return bound.slots },
|
|
739
742
|
}
|
|
740
|
-
:
|
|
743
|
+
: resolved
|
|
744
|
+
? {
|
|
745
|
+
get context() { return resolved.context },
|
|
746
|
+
get modalities() { return resolved.modalities },
|
|
747
|
+
get slots() { return resolved.slots },
|
|
748
|
+
}
|
|
749
|
+
: factsFromDeclaration(declared!)
|
|
741
750
|
const kind = bound?.requirement.type ?? declared?.type
|
|
742
751
|
|
|
743
752
|
// The handle follows the DECLARED type, because that is what the
|
|
@@ -1164,6 +1173,9 @@ export async function Kernel(opts: KernelOpts) {
|
|
|
1164
1173
|
content,
|
|
1165
1174
|
})
|
|
1166
1175
|
}
|
|
1176
|
+
for (const stimulus of input.stimuli ?? []) {
|
|
1177
|
+
await opts.session.stimuli.ingest(stimulus.type, stimulus.data as never)
|
|
1178
|
+
}
|
|
1167
1179
|
},
|
|
1168
1180
|
|
|
1169
1181
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AxonEntry, AxonStimulusEntry } from "@arcforge/types"
|
|
1
|
+
import type { AxonEntry, AxonStimulusEntry, AxonStimulusInput } from "@arcforge/types"
|
|
2
2
|
import type { AxonSessionT } from "@arcforge/session"
|
|
3
3
|
|
|
4
4
|
type InvocationOpts = {
|
|
@@ -20,6 +20,7 @@ const ABANDON_MS = 30_000
|
|
|
20
20
|
|
|
21
21
|
type StreamInput = {
|
|
22
22
|
content?: string | string[]
|
|
23
|
+
stimuli?: AxonStimulusInput[]
|
|
23
24
|
/** The surface the message arrived on — see the ingest below. */
|
|
24
25
|
channel?: string
|
|
25
26
|
}
|
|
@@ -85,6 +86,13 @@ export function Invocation(opts: InvocationOpts) {
|
|
|
85
86
|
yield entry
|
|
86
87
|
}
|
|
87
88
|
|
|
89
|
+
// The reservation was taken before any ingest, so bus-driven
|
|
90
|
+
// wake attempts are refused until this complete batch exists.
|
|
91
|
+
for (const stimulus of input.stimuli ?? []) {
|
|
92
|
+
const entry = await opts.session.stimuli.ingest(stimulus.type, stimulus.data as never)
|
|
93
|
+
yield entry
|
|
94
|
+
}
|
|
95
|
+
|
|
88
96
|
const stimuli = opts.session.stimuli.drain()
|
|
89
97
|
yield* opts.runWake(reservationId, { stimuli })
|
|
90
98
|
} catch (cause) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks"
|
|
2
2
|
import { err } from "@arcforge/err"
|
|
3
|
-
import type { AxonEntry, AxonStimulusEntry } from "@arcforge/types"
|
|
3
|
+
import type { AxonEntry, AxonStimulusEntry, AxonStimulusInput } from "@arcforge/types"
|
|
4
4
|
import type { KernelBus } from "../contracts"
|
|
5
5
|
import type { AxonSessionT } from "@arcforge/session"
|
|
6
6
|
import type { KernelCognet } from "../contracts"
|
|
@@ -16,6 +16,7 @@ type SchedulerOpts = {
|
|
|
16
16
|
type InvokeInput = {
|
|
17
17
|
/** User message committed before the invoke starts. */
|
|
18
18
|
content?: string | string[]
|
|
19
|
+
stimuli?: AxonStimulusInput[]
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
/**
|