@ashlr/hub 3.7.0 → 3.9.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/CHANGELOG.md +257 -0
- package/dist/build-identity.json +2 -2
- package/dist/cli/resource-profile.js +95 -21
- package/dist/cli/resource-profile.js.map +1 -1
- package/dist/core/policy/local-only.d.ts +142 -2
- package/dist/core/policy/local-only.js +204 -15
- package/dist/core/policy/local-only.js.map +1 -1
- package/dist/core/resources/native-profile.d.ts +56 -0
- package/dist/core/resources/native-profile.js +368 -6
- package/dist/core/resources/native-profile.js.map +1 -1
- package/dist/core/run/budget.d.ts +22 -8
- package/dist/core/run/budget.js +80 -12
- package/dist/core/run/budget.js.map +1 -1
- package/dist/core/run/model-catalog.js +8 -1
- package/dist/core/run/model-catalog.js.map +1 -1
- package/dist/core/run/sandboxed-engine.js +3 -3
- package/dist/core/run/sandboxed-engine.js.map +1 -1
- package/dist/core/universe/builtins/preparation/manifest.json +1 -1
- package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +69 -10
- package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +68 -9
- package/dist/core/verse/adapters/claude.d.ts +49 -2
- package/dist/core/verse/adapters/claude.js +317 -56
- package/dist/core/verse/adapters/claude.js.map +1 -1
- package/dist/core/verse/adapters/codex.d.ts +81 -5
- package/dist/core/verse/adapters/codex.js +409 -47
- package/dist/core/verse/adapters/codex.js.map +1 -1
- package/dist/core/verse/adapters/grok.d.ts +13 -1
- package/dist/core/verse/adapters/grok.js +28 -2
- package/dist/core/verse/adapters/grok.js.map +1 -1
- package/dist/core/verse/adapters/index.d.ts +32 -0
- package/dist/core/verse/adapters/index.js +2 -0
- package/dist/core/verse/adapters/index.js.map +1 -1
- package/dist/core/verse/codex-rollout.d.ts +284 -0
- package/dist/core/verse/codex-rollout.js +786 -0
- package/dist/core/verse/codex-rollout.js.map +1 -0
- package/dist/core/verse/context-fit.d.ts +63 -0
- package/dist/core/verse/context-fit.js +355 -0
- package/dist/core/verse/context-fit.js.map +1 -0
- package/dist/core/verse/context-math.d.ts +215 -0
- package/dist/core/verse/context-math.js +365 -0
- package/dist/core/verse/context-math.js.map +1 -0
- package/dist/core/verse/local-models.d.ts +137 -1
- package/dist/core/verse/local-models.js +209 -5
- package/dist/core/verse/local-models.js.map +1 -1
- package/dist/core/verse/model-windows.d.ts +217 -0
- package/dist/core/verse/model-windows.js +616 -0
- package/dist/core/verse/model-windows.js.map +1 -0
- package/dist/core/verse/preferences.d.ts +123 -0
- package/dist/core/verse/preferences.js +403 -0
- package/dist/core/verse/preferences.js.map +1 -0
- package/dist/core/verse/project-memory.d.ts +112 -0
- package/dist/core/verse/project-memory.js +295 -0
- package/dist/core/verse/project-memory.js.map +1 -0
- package/dist/core/verse/seats.d.ts +106 -4
- package/dist/core/verse/seats.js +291 -89
- package/dist/core/verse/seats.js.map +1 -1
- package/dist/core/verse/session-engine.d.ts +117 -2
- package/dist/core/verse/session-engine.js +763 -65
- package/dist/core/verse/session-engine.js.map +1 -1
- package/dist/core/verse/session-handoff.d.ts +94 -0
- package/dist/core/verse/session-handoff.js +551 -0
- package/dist/core/verse/session-handoff.js.map +1 -0
- package/dist/core/verse/session-search.d.ts +63 -0
- package/dist/core/verse/session-search.js +213 -0
- package/dist/core/verse/session-search.js.map +1 -0
- package/dist/core/verse/session-store.d.ts +16 -2
- package/dist/core/verse/session-store.js +80 -6
- package/dist/core/verse/session-store.js.map +1 -1
- package/dist/core/verse/types.d.ts +333 -1
- package/dist/core/verse/types.js +54 -2
- package/dist/core/verse/types.js.map +1 -1
- package/dist/core/verse/verse-api.d.ts +40 -5
- package/dist/core/verse/verse-api.js +724 -25
- package/dist/core/verse/verse-api.js.map +1 -1
- package/dist/core/web/api.d.ts +14 -4
- package/dist/core/web/api.js +26 -11
- package/dist/core/web/api.js.map +1 -1
- package/dist/core/web/public/next/assets/{App-vtaHB9mp.js → App-XURmiAAp.js} +5 -5
- package/dist/core/web/public/next/assets/{App-vtaHB9mp.js.map → App-XURmiAAp.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js → ApprovalsSection-BriUzoZc.js} +2 -2
- package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js.map → ApprovalsSection-BriUzoZc.js.map} +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-C4GBsQVc.js +2 -0
- package/dist/core/web/public/next/assets/{AutonomySection-DoqmsCjw.js.map → AutonomySection-C4GBsQVc.js.map} +1 -1
- package/dist/core/web/public/next/assets/ChatSection-BpOBOUvg.css +1 -0
- package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js +84 -0
- package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js.map +1 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js +2 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js.map +1 -0
- package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js → Dialog-BxdIfmFH.js} +2 -2
- package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js.map → Dialog-BxdIfmFH.js.map} +1 -1
- package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js → DiffViewer-DmeRWuc4.js} +2 -2
- package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js.map → DiffViewer-DmeRWuc4.js.map} +1 -1
- package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js → McpSection-q34T7Tho.js} +2 -2
- package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js.map → McpSection-q34T7Tho.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js → MutationTokenDialog-CFAkwOEt.js} +2 -2
- package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js.map → MutationTokenDialog-CFAkwOEt.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js → ResourcePoolConsoleApp-DHc8GFOY.js} +4 -4
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js.map → ResourcePoolConsoleApp-DHc8GFOY.js.map} +1 -1
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js → RouteErrorBoundary-ZL9F4qUn.js} +2 -2
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js.map → RouteErrorBoundary-ZL9F4qUn.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Meter-CLcr-4wS.css → Segmented-8cf0Fypn.css} +1 -1
- package/dist/core/web/public/next/assets/{Meter--h3MmZS-.js → Segmented-DbRjVye3.js} +2 -2
- package/dist/core/web/public/next/assets/Segmented-DbRjVye3.js.map +1 -0
- package/dist/core/web/public/next/assets/SettingsSection-nJGGGYqv.js +2 -0
- package/dist/core/web/public/next/assets/{SettingsSection-BwrpQlpP.js.map → SettingsSection-nJGGGYqv.js.map} +1 -1
- package/dist/core/web/public/next/assets/UniverseConsoleApp-6GJydgo4.js +2 -0
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-_FSohAdN.js.map → UniverseConsoleApp-6GJydgo4.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js → UniverseView-DLDtNYL8.js} +2 -2
- package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js.map → UniverseView-DLDtNYL8.js.map} +1 -1
- package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js +2 -0
- package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js.map +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-DsdKQoTH.css +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js +3 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js.map +1 -0
- package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js → charts-CVooqJWN.js} +2 -2
- package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js.map → charts-CVooqJWN.js.map} +1 -1
- package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js +2 -0
- package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js.map +1 -0
- package/dist/core/web/public/next/assets/global-eaY9GyX3.js +2 -0
- package/dist/core/web/public/next/assets/global-eaY9GyX3.js.map +1 -0
- package/dist/core/web/public/next/assets/{icons-D9vlf85u.js → icons-vex8rclC.js} +2 -2
- package/dist/core/web/public/next/assets/{icons-D9vlf85u.js.map → icons-vex8rclC.js.map} +1 -1
- package/dist/core/web/public/next/assets/{index-CZamKRUg.js → index-D2Eik-zt.js} +3 -3
- package/dist/core/web/public/next/assets/{index-CZamKRUg.js.map → index-D2Eik-zt.js.map} +1 -1
- package/dist/core/web/public/next/assets/{queries-B8eBnFox.js → queries-bAYU0VNy.js} +2 -2
- package/dist/core/web/public/next/assets/{queries-B8eBnFox.js.map → queries-bAYU0VNy.js.map} +1 -1
- package/dist/core/web/public/next/assets/use-guarded-action-C7QrP7Yp.js +2 -0
- package/dist/core/web/public/next/assets/{use-guarded-action-bzrVVAYq.js.map → use-guarded-action-C7QrP7Yp.js.map} +1 -1
- package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js +2 -0
- package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js.map +1 -0
- package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js → workspace-model-CHol5RVp.js} +2 -2
- package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js.map → workspace-model-CHol5RVp.js.map} +1 -1
- package/dist/core/web/public/next/index.html +1 -1
- package/dist/release-dependency-inventory.json +1 -1
- package/docs/README.md +1 -0
- package/package.json +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-DoqmsCjw.js +0 -2
- package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +0 -1
- package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js +0 -80
- package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js.map +0 -1
- package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js +0 -2
- package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js.map +0 -1
- package/dist/core/web/public/next/assets/Meter--h3MmZS-.js.map +0 -1
- package/dist/core/web/public/next/assets/SettingsSection-BwrpQlpP.js +0 -2
- package/dist/core/web/public/next/assets/UniverseConsoleApp-_FSohAdN.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js.map +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js +0 -3
- package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js.map +0 -1
- package/dist/core/web/public/next/assets/global-D6bTxIRn.js +0 -2
- package/dist/core/web/public/next/assets/global-D6bTxIRn.js.map +0 -1
- package/dist/core/web/public/next/assets/use-guarded-action-bzrVVAYq.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +0 -1
|
@@ -10,9 +10,31 @@
|
|
|
10
10
|
* its own process-group leader (`detached: true`) so cancellation signals the
|
|
11
11
|
* whole group, escalating SIGINT → SIGKILL after a grace period, with a bounded
|
|
12
12
|
* drain so a descendant holding our pipes cannot keep a turn "running" forever.
|
|
13
|
+
*
|
|
14
|
+
* CONTEXT (V3.9, docs/VERSE-CONTEXT.md). The engine is the one place a
|
|
15
|
+
* session's context budget is decided and kept current:
|
|
16
|
+
* - at creation, from the seat's model option and the session's mode
|
|
17
|
+
* (`budgetFor`), recorded on `usage` with where the window came from;
|
|
18
|
+
* - on every reading, a window the CLI reports at runtime WINS over the
|
|
19
|
+
* catalog (a 1M Claude model the CLI clamps to 200k is a 200k session),
|
|
20
|
+
* and the compaction point is recomputed for it (`reconcileAutoCompactAt`);
|
|
21
|
+
* - `context` / `compaction` events replace occupancy and count compactions;
|
|
22
|
+
* - adapters that can only see exact occupancy in the CLI's own files
|
|
23
|
+
* (codex rollouts) get bounded telemetry hooks: polled while the turn
|
|
24
|
+
* runs, and called once after the parser has flushed.
|
|
25
|
+
* None of this spends: it reads what the CLI already reported or wrote.
|
|
26
|
+
*
|
|
27
|
+
* LOCAL-ONLY. Because the spawn is raw rather than routed through
|
|
28
|
+
* `run/engines.spawnEngine`, this module is a SECOND subprocess funnel and none
|
|
29
|
+
* of the daemon's gates cover it. It therefore carries its own call to the one
|
|
30
|
+
* shared predicate (`policy/local-only.decidePermission`, reached through its
|
|
31
|
+
* published wrappers) at the top of `startTurn` — see `verseSeatPermitted`.
|
|
13
32
|
*/
|
|
14
33
|
import { spawn as nodeSpawn } from 'node:child_process';
|
|
15
|
-
import { type
|
|
34
|
+
import { type LocalOnlyVerdict } from '../policy/local-only.js';
|
|
35
|
+
import type { AshlrConfig } from '../types.js';
|
|
36
|
+
import { type VerseAdapter } from './adapters/index.js';
|
|
37
|
+
import { type VerseContextMode, type VerseCreateSessionRequest, type VerseEngine, type VerseEvent, type VerseModelOption, type VerseSeat, type VerseSession } from './types.js';
|
|
16
38
|
export type VerseErrorCode = 'VERSE_SESSION_NOT_FOUND' | 'VERSE_SESSION_BUSY' | 'VERSE_INVALID' | 'VERSE_TOO_LARGE';
|
|
17
39
|
export declare class VerseError extends Error {
|
|
18
40
|
readonly code: VerseErrorCode;
|
|
@@ -38,16 +60,72 @@ export interface VerseSeatLaunch {
|
|
|
38
60
|
* means "the Ollama lane", which is what those sessions were created on.
|
|
39
61
|
*/
|
|
40
62
|
anthropicBaseUrl?: string;
|
|
63
|
+
/**
|
|
64
|
+
* V3.9 ADDITIVE. Shared project memory offered to this session, SNAPSHOTTED
|
|
65
|
+
* at creation: `dir` is the private memory directory, `block` the exact text
|
|
66
|
+
* appended to the CLI's system prompt on EVERY turn. Pinned rather than
|
|
67
|
+
* re-rendered per turn so the prompt prefix stays byte-identical and the
|
|
68
|
+
* provider's prompt cache survives; agents read the live file from `dir`.
|
|
69
|
+
* Absent = memory off for this session (and on every older record).
|
|
70
|
+
*/
|
|
71
|
+
memory?: {
|
|
72
|
+
dir: string;
|
|
73
|
+
block: string;
|
|
74
|
+
writable: boolean;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/** V3.9 — creation-time extras the API resolves (preferences, provenance); never read off a request body. */
|
|
78
|
+
export interface VerseCreateOptions {
|
|
79
|
+
memory?: {
|
|
80
|
+
dir: string;
|
|
81
|
+
block: string;
|
|
82
|
+
writable: boolean;
|
|
83
|
+
} | null;
|
|
84
|
+
handoffFrom?: {
|
|
85
|
+
sessionId: string;
|
|
86
|
+
title: string;
|
|
87
|
+
} | null;
|
|
41
88
|
}
|
|
42
89
|
export interface VerseEngineHandle {
|
|
43
90
|
listSessions(): VerseSession[];
|
|
44
91
|
getSession(id: string): VerseSession | null;
|
|
45
92
|
getEvents(id: string, fromSeq?: number): VerseEvent[];
|
|
46
|
-
|
|
93
|
+
/**
|
|
94
|
+
* `opts` carries what the API resolved server-side (memory snapshot, handoff
|
|
95
|
+
* provenance). Omitted by every pre-3.9 caller, whose records then carry no
|
|
96
|
+
* memory or handoff keys at all.
|
|
97
|
+
*/
|
|
98
|
+
createSession(req: VerseCreateSessionRequest, launch: VerseSeatLaunch, opts?: VerseCreateOptions): VerseSession;
|
|
47
99
|
sendTurn(id: string, text: string): {
|
|
48
100
|
turnId: string;
|
|
49
101
|
session: VerseSession;
|
|
50
102
|
};
|
|
103
|
+
/**
|
|
104
|
+
* V3.9. Switch the session's context budget. Takes effect from the NEXT turn
|
|
105
|
+
* (it only changes CLI flags, never prompt content, so the cache survives).
|
|
106
|
+
* Refused while a turn runs — that turn was launched with the old flags and
|
|
107
|
+
* its readings must be measured against them — and for a mode the model has
|
|
108
|
+
* no budget for.
|
|
109
|
+
*/
|
|
110
|
+
setContextMode(id: string, mode: VerseContextMode): VerseSession;
|
|
111
|
+
/**
|
|
112
|
+
* V3.9. Re-read a LOCAL session's window from the seat's LIVE option (the
|
|
113
|
+
* API calls this before each turn with the option discovery resolves now).
|
|
114
|
+
*
|
|
115
|
+
* Local windows are the runtime's allocation — the dispatch lane, the pinned
|
|
116
|
+
* `num_ctx`, what `/api/ps` has resident — and change after a chat is
|
|
117
|
+
* created; a pre-3.9 record may even hold a window the old discovery got
|
|
118
|
+
* wrong (262,144 stored for a `-ctx64k` tag that serves 65,536). The CLI is
|
|
119
|
+
* told `usage.contextWindow` (`CLAUDE_CODE_MAX_CONTEXT_TOKENS`) and the meter
|
|
120
|
+
* draws the same field, so correcting it HERE, before the launch, keeps what
|
|
121
|
+
* the CLI compacts against and what the operator sees one number.
|
|
122
|
+
*
|
|
123
|
+
* Writes (and emits one `context` event) only when window, compaction point
|
|
124
|
+
* or source actually changed. A no-op for any other engine, and for an
|
|
125
|
+
* option with no window. Refused while a turn runs (its CLI was launched
|
|
126
|
+
* with the old window) and for an option naming a different model.
|
|
127
|
+
*/
|
|
128
|
+
refreshLocalWindow(id: string, option: VerseModelOption): VerseSession;
|
|
51
129
|
cancelTurn(id: string): boolean;
|
|
52
130
|
deleteSession(id: string): void;
|
|
53
131
|
renameSession(id: string, title: string): VerseSession;
|
|
@@ -65,6 +143,43 @@ export interface VerseEngineOptions {
|
|
|
65
143
|
turnTimeoutMs?: number;
|
|
66
144
|
/** SIGINT → SIGKILL escalation delay. Default 10s. */
|
|
67
145
|
killGraceMs?: number;
|
|
146
|
+
/**
|
|
147
|
+
* Read the operator config that the local-only gate consults.
|
|
148
|
+
*
|
|
149
|
+
* Called ONCE PER TURN rather than once at construction, deliberately: the
|
|
150
|
+
* cockpit's Local-only switch writes `~/.ashlr/config.json` while this engine
|
|
151
|
+
* is already live, and a mode read at startup would leave the switch looking
|
|
152
|
+
* like it did nothing until a restart. `undefined` means "no config in hand",
|
|
153
|
+
* which the policy answers from env + its process latch — i.e. toward refusal.
|
|
154
|
+
*
|
|
155
|
+
* Default: `loadConfigReadOnly()`, which never creates, seeds or writes the
|
|
156
|
+
* file. The config is the user's; this module only ever reads it.
|
|
157
|
+
*/
|
|
158
|
+
loadConfig?: () => AshlrConfig | undefined;
|
|
159
|
+
/** Adapter resolver. Default: `adapters/index.adapterFor`. A test seam, like `spawn`. */
|
|
160
|
+
adapterFor?: (engine: VerseEngine) => VerseAdapter;
|
|
161
|
+
/** Telemetry poll interval for adapters with `pollTelemetry`. Default VERSE_TELEMETRY_POLL_MS. */
|
|
162
|
+
telemetryPollMs?: number;
|
|
68
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Is this SEAT permitted to run a turn right now?
|
|
166
|
+
*
|
|
167
|
+
* NOT a second policy predicate — that is the point. Both branches delegate to
|
|
168
|
+
* `decidePermission()` through its published wrappers, so "local" means here
|
|
169
|
+
* exactly what it means at the daemon's chokepoints. This function contributes
|
|
170
|
+
* only the mapping from a Verse seat to a subject the predicate understands:
|
|
171
|
+
*
|
|
172
|
+
* claude / codex / grok — a Verse engine id IS the registry engine id, so
|
|
173
|
+
* `enginePermitted` classifies it directly (cli-agent → cloud for claude and
|
|
174
|
+
* codex, api-model at api.x.ai → cloud for grok).
|
|
175
|
+
*
|
|
176
|
+
* local — a local seat is discovered from a serving runtime and has no
|
|
177
|
+
* registry engine to name, so the ENDPOINT it dispatches to is the truth
|
|
178
|
+
* and `endpointPermitted` classifies that. A loopback runtime (the default,
|
|
179
|
+
* and every local seat today) is permitted exactly as before. One repointed
|
|
180
|
+
* at a remote inference host is refused, because that one would spend — the
|
|
181
|
+
* same rule the raw-transport sites apply to `cfg.foundry.ollamaBaseUrl`.
|
|
182
|
+
*/
|
|
183
|
+
export declare function verseSeatPermitted(engine: VerseEngine, launch: VerseSeatLaunch, cfg: AshlrConfig | undefined): LocalOnlyVerdict;
|
|
69
184
|
export declare function buildTurnEnv(extra: Record<string, string>, base?: NodeJS.ProcessEnv): Record<string, string>;
|
|
70
185
|
export declare function createVerseEngine(opts?: VerseEngineOptions): VerseEngineHandle;
|