@alisio/core 0.1.0-alpha.12 → 0.1.0-alpha.13
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/application.d.ts +2 -0
- package/dist/application.js +12 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +24 -0
- package/dist/core/compaction.js +1 -0
- package/dist/core/runner.d.ts +7 -0
- package/dist/core/runner.js +3 -0
- package/dist/plugins/host.d.ts +6 -0
- package/dist/plugins/host.js +8 -0
- package/package.json +2 -2
package/dist/application.d.ts
CHANGED
|
@@ -171,6 +171,8 @@ export declare function createApplication(options?: AppOptions): Promise<{
|
|
|
171
171
|
* (next instructions load), `websearch.provider` mutates the shared config object the search
|
|
172
172
|
* chain reads per call, `pluginHooks.timeoutMs` lands in the plugin host (next hook call),
|
|
173
173
|
* and `tui.*` is persisted for the host to apply. Nothing in this set requires a restart.
|
|
174
|
+
* `agents.*` (active agent id and reasoning effort) is persisted for the TUI to consume:
|
|
175
|
+
* the next `/agents`/`/effort` selection and the next prompt already read the live config.
|
|
174
176
|
* `mcp.allow` is deliberately not routed here: it flows through
|
|
175
177
|
* `rememberGlobalMcpConsent`/`revokeGlobalMcpConsent` instead.
|
|
176
178
|
* Throws under `--read-only`. Returns the written config file.
|
package/dist/application.js
CHANGED
|
@@ -743,6 +743,8 @@ export async function createApplication(options = {}) {
|
|
|
743
743
|
* (next instructions load), `websearch.provider` mutates the shared config object the search
|
|
744
744
|
* chain reads per call, `pluginHooks.timeoutMs` lands in the plugin host (next hook call),
|
|
745
745
|
* and `tui.*` is persisted for the host to apply. Nothing in this set requires a restart.
|
|
746
|
+
* `agents.*` (active agent id and reasoning effort) is persisted for the TUI to consume:
|
|
747
|
+
* the next `/agents`/`/effort` selection and the next prompt already read the live config.
|
|
746
748
|
* `mcp.allow` is deliberately not routed here: it flows through
|
|
747
749
|
* `rememberGlobalMcpConsent`/`revokeGlobalMcpConsent` instead.
|
|
748
750
|
* Throws under `--read-only`. Returns the written config file.
|
|
@@ -790,6 +792,16 @@ export async function createApplication(options = {}) {
|
|
|
790
792
|
case "tui.skillSlashCommands":
|
|
791
793
|
config.tui = { ...config.tui, skillSlashCommands: value === true };
|
|
792
794
|
break;
|
|
795
|
+
case "agents.active":
|
|
796
|
+
config.agents = { ...config.agents, active: String(value) };
|
|
797
|
+
break;
|
|
798
|
+
case "agents.effort":
|
|
799
|
+
// Clearing (undefined) drops the leaf from the live config and the JSON file.
|
|
800
|
+
config.agents =
|
|
801
|
+
value === undefined
|
|
802
|
+
? { active: config.agents.active }
|
|
803
|
+
: { ...config.agents, effort: String(value) };
|
|
804
|
+
break;
|
|
793
805
|
case "websearch.provider":
|
|
794
806
|
// Mutated in place (same object identity) so the tool chain's per-call
|
|
795
807
|
// `websearchCtx.config` sees the new provider on the very next search call.
|
package/dist/config.d.ts
CHANGED
|
@@ -177,6 +177,10 @@ export declare const configSchema: z.ZodPipe<z.ZodObject<{
|
|
|
177
177
|
paddingX: z.ZodDefault<z.ZodNumber>;
|
|
178
178
|
skillSlashCommands: z.ZodDefault<z.ZodBoolean>;
|
|
179
179
|
}, z.core.$strict>>;
|
|
180
|
+
agents: z.ZodDefault<z.ZodObject<{
|
|
181
|
+
active: z.ZodDefault<z.ZodString>;
|
|
182
|
+
effort: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strict>>;
|
|
180
184
|
}, z.core.$strict>, z.ZodTransform<{
|
|
181
185
|
schemaVersion: 1;
|
|
182
186
|
provider: {
|
|
@@ -232,6 +236,10 @@ export declare const configSchema: z.ZodPipe<z.ZodObject<{
|
|
|
232
236
|
paddingX: number;
|
|
233
237
|
skillSlashCommands: boolean;
|
|
234
238
|
};
|
|
239
|
+
agents: {
|
|
240
|
+
active: string;
|
|
241
|
+
effort?: string | undefined;
|
|
242
|
+
};
|
|
235
243
|
mcp: {
|
|
236
244
|
allow?: boolean | undefined;
|
|
237
245
|
servers: {
|
|
@@ -370,6 +378,10 @@ export declare const configSchema: z.ZodPipe<z.ZodObject<{
|
|
|
370
378
|
paddingX: number;
|
|
371
379
|
skillSlashCommands: boolean;
|
|
372
380
|
};
|
|
381
|
+
agents: {
|
|
382
|
+
active: string;
|
|
383
|
+
effort?: string | undefined;
|
|
384
|
+
};
|
|
373
385
|
}>>;
|
|
374
386
|
export type Config = z.infer<typeof configSchema>;
|
|
375
387
|
export type ServerConfig = z.infer<typeof serverSchema>;
|
|
@@ -452,6 +464,8 @@ declare const SETTABLE_KEYS: {
|
|
|
452
464
|
serpapi: "serpapi";
|
|
453
465
|
tavily: "tavily";
|
|
454
466
|
}>>;
|
|
467
|
+
readonly "agents.active": z.ZodDefault<z.ZodString>;
|
|
468
|
+
readonly "agents.effort": z.ZodOptional<z.ZodString>;
|
|
455
469
|
};
|
|
456
470
|
export type SettableSettingKey = keyof typeof SETTABLE_KEYS;
|
|
457
471
|
export declare function isSettableSettingKey(key: string): key is SettableSettingKey;
|
package/dist/config.js
CHANGED
|
@@ -188,6 +188,27 @@ const configObjectSchema = z
|
|
|
188
188
|
})
|
|
189
189
|
.strict()
|
|
190
190
|
.default(() => ({ paddingX: 1, skillSlashCommands: true })),
|
|
191
|
+
/**
|
|
192
|
+
* The ACTIVE agent drives the main session: its system prompt is appended to every prompt and
|
|
193
|
+
* its optional model selector is offered when the agent is chosen (`/agents`). `build` is the
|
|
194
|
+
* built-in default (full-power, no added persona); `plan` is the built-in read-only planner.
|
|
195
|
+
* `effort` holds a reasoning effort level chosen with `/effort` for a model that advertises
|
|
196
|
+
* `effort.supportedLevels`; it is validated against the ACTIVE model on use, falling back to
|
|
197
|
+
* the model's default level when unsupported.
|
|
198
|
+
*/
|
|
199
|
+
agents: z
|
|
200
|
+
.object({
|
|
201
|
+
active: z
|
|
202
|
+
.string()
|
|
203
|
+
.trim()
|
|
204
|
+
.min(1)
|
|
205
|
+
.max(100)
|
|
206
|
+
.regex(/^[a-zA-Z0-9][a-zA-Z0-9._:-]*$/, "invalid agent name")
|
|
207
|
+
.default("build"),
|
|
208
|
+
effort: z.string().trim().min(1).max(50).optional(),
|
|
209
|
+
})
|
|
210
|
+
.strict()
|
|
211
|
+
.default(() => ({ active: "build" })),
|
|
191
212
|
})
|
|
192
213
|
.strict()
|
|
193
214
|
.superRefine((config, context) => {
|
|
@@ -434,6 +455,7 @@ const SETTABLE_SECTIONS = {
|
|
|
434
455
|
pluginHooks: configObjectSchema.shape.pluginHooks.removeDefault(),
|
|
435
456
|
tui: configObjectSchema.shape.tui.removeDefault(),
|
|
436
457
|
websearch: configObjectSchema.shape.websearch.removeDefault(),
|
|
458
|
+
agents: configObjectSchema.shape.agents.removeDefault(),
|
|
437
459
|
};
|
|
438
460
|
const SETTABLE_KEYS = {
|
|
439
461
|
"compaction.auto": SETTABLE_SECTIONS.compaction.shape.auto,
|
|
@@ -450,6 +472,8 @@ const SETTABLE_KEYS = {
|
|
|
450
472
|
"tui.paddingX": SETTABLE_SECTIONS.tui.shape.paddingX,
|
|
451
473
|
"tui.skillSlashCommands": SETTABLE_SECTIONS.tui.shape.skillSlashCommands,
|
|
452
474
|
"websearch.provider": SETTABLE_SECTIONS.websearch.shape.provider,
|
|
475
|
+
"agents.active": SETTABLE_SECTIONS.agents.shape.active,
|
|
476
|
+
"agents.effort": SETTABLE_SECTIONS.agents.shape.effort,
|
|
453
477
|
};
|
|
454
478
|
export function isSettableSettingKey(key) {
|
|
455
479
|
return Object.prototype.hasOwnProperty.call(SETTABLE_KEYS, key);
|
package/dist/core/compaction.js
CHANGED
|
@@ -381,6 +381,7 @@ async function completeTextWithMeta(provider, request) {
|
|
|
381
381
|
signal: request.signal,
|
|
382
382
|
...(request.model ? { model: request.model } : {}),
|
|
383
383
|
...(request.sessionId ? { sessionId: request.sessionId } : {}),
|
|
384
|
+
...(request.reasoningEffort ? { reasoningEffort: request.reasoningEffort } : {}),
|
|
384
385
|
})) {
|
|
385
386
|
request.signal.throwIfAborted();
|
|
386
387
|
if (event.type === "completed") {
|
package/dist/core/runner.d.ts
CHANGED
|
@@ -42,6 +42,11 @@ export interface RunnerOptions {
|
|
|
42
42
|
* runner; only meaningful for a provider that documents an equivalent server-side tool.
|
|
43
43
|
*/
|
|
44
44
|
nativeTools?: Array<Record<string, unknown>>;
|
|
45
|
+
/**
|
|
46
|
+
* Default reasoning effort level (a value from the current model's `ModelInfo.effort`), sent on
|
|
47
|
+
* every run unless overridden per-run. Providers that do not advertise effort levels ignore it.
|
|
48
|
+
*/
|
|
49
|
+
reasoningEffort?: string;
|
|
45
50
|
}
|
|
46
51
|
/** The settings a running TUI can change live; merged into the runner options on apply. */
|
|
47
52
|
export interface RunnerSettingsPatch {
|
|
@@ -80,6 +85,8 @@ export interface RunOptions {
|
|
|
80
85
|
/** Per-call output token budget for this run; beats the runner-level budget when set. */
|
|
81
86
|
maxOutputTokens?: number;
|
|
82
87
|
timeoutMs?: number;
|
|
88
|
+
/** Reasoning effort level for this run; beats the runner-level default when set. */
|
|
89
|
+
reasoningEffort?: string;
|
|
83
90
|
}
|
|
84
91
|
/**
|
|
85
92
|
* Default cumulative token budget for one run: several context windows (each turn re-sends the
|
package/dist/core/runner.js
CHANGED
|
@@ -418,6 +418,9 @@ export class AgentRunner {
|
|
|
418
418
|
model,
|
|
419
419
|
sessionId,
|
|
420
420
|
...(o.nativeTools?.length ? { nativeTools: o.nativeTools } : {}),
|
|
421
|
+
...((options.reasoningEffort ?? o.reasoningEffort)
|
|
422
|
+
? { reasoningEffort: options.reasoningEffort ?? o.reasoningEffort }
|
|
423
|
+
: {}),
|
|
421
424
|
})) {
|
|
422
425
|
combined.throwIfAborted();
|
|
423
426
|
if (e.type === "text_delta")
|
package/dist/plugins/host.d.ts
CHANGED
|
@@ -72,6 +72,12 @@ export declare class PluginHost implements RunnerExtensions {
|
|
|
72
72
|
askQuestions(request: AskQuestionsRequest): Promise<AskQuestionsResult>;
|
|
73
73
|
open(sessionId: string): boolean;
|
|
74
74
|
}): void;
|
|
75
|
+
/**
|
|
76
|
+
* Read-only view of one plugin's shared state (written through `api.state.set`). The host layer
|
|
77
|
+
* uses this to consume plugin-published data (for example the main-capable agent definitions the
|
|
78
|
+
* built-in subagents plugin publishes) without importing the plugin package.
|
|
79
|
+
*/
|
|
80
|
+
pluginState(plugin: string, key: string): unknown;
|
|
75
81
|
get sessions(): PluginAPI["sessions"];
|
|
76
82
|
/**
|
|
77
83
|
* Live accessor for core standard tools (e.g. `ask_user_question`), which are not "a plugin"
|
package/dist/plugins/host.js
CHANGED
|
@@ -60,6 +60,14 @@ export class PluginHost {
|
|
|
60
60
|
setInteractiveUI(ui) {
|
|
61
61
|
this.uiImpl = ui;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Read-only view of one plugin's shared state (written through `api.state.set`). The host layer
|
|
65
|
+
* uses this to consume plugin-published data (for example the main-capable agent definitions the
|
|
66
|
+
* built-in subagents plugin publishes) without importing the plugin package.
|
|
67
|
+
*/
|
|
68
|
+
pluginState(plugin, key) {
|
|
69
|
+
return this.state.getState(plugin, key);
|
|
70
|
+
}
|
|
63
71
|
get sessions() {
|
|
64
72
|
if (!this.sessionsImpl)
|
|
65
73
|
throw new Error("Child sessions are not available yet");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alisio/core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.13",
|
|
4
4
|
"description": "Embeddable provider-agnostic Alisio agent core: tool loop, context compaction, local tools, MCP, plugin host and SQLite session store. Runs on Node >=22.16 and Bun.",
|
|
5
5
|
"author": "Gustavo Gutiérrez",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"node": ">=22.16"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@alisio/sdk": "0.1.0-alpha.
|
|
44
|
+
"@alisio/sdk": "0.1.0-alpha.8",
|
|
45
45
|
"@mixmark-io/domino": "2.2.0",
|
|
46
46
|
"@modelcontextprotocol/client": "2.1.0",
|
|
47
47
|
"ajv": "8.20.0",
|