@agentconnect.md/daemon 1.0.0-rc.96 → 1.0.0-rc.98
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.js +78 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7688,6 +7688,7 @@ const AgentSchema = object({
|
|
|
7688
7688
|
description: string().optional(),
|
|
7689
7689
|
reasoningEffort: string().optional(),
|
|
7690
7690
|
executionMode: string().optional(),
|
|
7691
|
+
fastMode: boolean().optional(),
|
|
7691
7692
|
runtimeOverrides: object({
|
|
7692
7693
|
model: string().optional(),
|
|
7693
7694
|
env: array(object({
|
|
@@ -13030,6 +13031,12 @@ const AgentSpec = object({
|
|
|
13030
13031
|
model: string().optional(),
|
|
13031
13032
|
reasoningEffort: string().optional(),
|
|
13032
13033
|
executionMode: string().optional(),
|
|
13034
|
+
outputMode: _enum([
|
|
13035
|
+
"low",
|
|
13036
|
+
"medium",
|
|
13037
|
+
"high"
|
|
13038
|
+
]).optional(),
|
|
13039
|
+
fastMode: boolean().optional(),
|
|
13033
13040
|
workspace: AgentWorkspace.optional(),
|
|
13034
13041
|
env: record(string(), string()).optional()
|
|
13035
13042
|
});
|
|
@@ -18055,21 +18062,32 @@ function planConfigSelection(configOptions, category, desired) {
|
|
|
18055
18062
|
value: desired
|
|
18056
18063
|
};
|
|
18057
18064
|
}
|
|
18058
|
-
/** The
|
|
18059
|
-
*
|
|
18060
|
-
*
|
|
18061
|
-
*
|
|
18062
|
-
*
|
|
18063
|
-
*
|
|
18064
|
-
*
|
|
18065
|
-
*
|
|
18066
|
-
*
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18065
|
+
/** The session `_meta` sent to a Claude runtime on session/new and session/load
|
|
18066
|
+
* (`_meta.claudeCode.options` is spread into the SDK `query()` options layer), or
|
|
18067
|
+
* undefined off Claude runtimes. Two things ride on it:
|
|
18068
|
+
*
|
|
18069
|
+
* - `thinking`: recent models default `thinking.display` to "omitted" — thinking
|
|
18070
|
+
* blocks stream signature-only with empty text, so the ACP wrapper never emits
|
|
18071
|
+
* `agent_thought_chunk` and the transcript loses its reasoning rows. Request
|
|
18072
|
+
* "summarized" (the fullest display the API offers) so thoughts reach the stream.
|
|
18073
|
+
* - `settings.ultracode` (effort "ultracode" only): a session-scoped flag setting
|
|
18074
|
+
* the effort select can't reach — the runtime rejects effort="ultracode".
|
|
18075
|
+
* `enableWorkflows` rides along so the "pro" plan default (workflows off) doesn't
|
|
18076
|
+
* silently drop the orchestration half. Best-effort: on a non-xhigh-capable model
|
|
18077
|
+
* or with workflows unavailable the runtime reports `applied.ultracode=false` and
|
|
18078
|
+
* the session still runs on its default effort — nothing to fail on our side. */
|
|
18079
|
+
function claudeSessionMeta(reasoningEffort, isClaudeRuntime) {
|
|
18080
|
+
if (!isClaudeRuntime) return void 0;
|
|
18081
|
+
return { claudeCode: { options: {
|
|
18082
|
+
thinking: {
|
|
18083
|
+
type: "adaptive",
|
|
18084
|
+
display: "summarized"
|
|
18085
|
+
},
|
|
18086
|
+
...reasoningEffort === "ultracode" ? { settings: {
|
|
18087
|
+
ultracode: true,
|
|
18088
|
+
enableWorkflows: true
|
|
18089
|
+
} } : {}
|
|
18090
|
+
} } };
|
|
18073
18091
|
}
|
|
18074
18092
|
/**
|
|
18075
18093
|
* Extract the model selector from a session's `configOptions`. ACP models are an
|
|
@@ -18160,7 +18178,7 @@ var AcpHost = class {
|
|
|
18160
18178
|
return Boolean(this.promptCaps[kind]);
|
|
18161
18179
|
}
|
|
18162
18180
|
async newSession(cwd, mcpServers = []) {
|
|
18163
|
-
const _meta =
|
|
18181
|
+
const _meta = claudeSessionMeta(this.opts.configPrefs?.reasoningEffort, this.isClaudeRuntime());
|
|
18164
18182
|
const res = await this.conn.agent.request(methods.agent.session.new, {
|
|
18165
18183
|
cwd,
|
|
18166
18184
|
mcpServers,
|
|
@@ -18172,17 +18190,23 @@ var AcpHost = class {
|
|
|
18172
18190
|
return res.sessionId;
|
|
18173
18191
|
}
|
|
18174
18192
|
/**
|
|
18175
|
-
* Apply the desired model / reasoning effort to a fresh session
|
|
18176
|
-
* `session/set_config_option`. Model first — the effort
|
|
18177
|
-
* the selected model, and each response returns the
|
|
18178
|
-
* next step plans against. Best-effort by design: a
|
|
18179
|
-
* selector, an unoffered value, or a failed request logs
|
|
18180
|
-
* session still runs on the runtime's defaults. Returns the
|
|
18193
|
+
* Apply the desired model / reasoning effort / fast mode to a fresh session
|
|
18194
|
+
* via ACP `session/set_config_option`. Model first — the effort and fast-mode
|
|
18195
|
+
* vocabularies depend on the selected model, and each response returns the
|
|
18196
|
+
* reconciled option set the next step plans against. Best-effort by design: a
|
|
18197
|
+
* runtime without the selector, an unoffered value, or a failed request logs
|
|
18198
|
+
* and moves on — the session still runs on the runtime's defaults. Returns the
|
|
18199
|
+
* final option set.
|
|
18181
18200
|
*/
|
|
18182
18201
|
async applySessionConfig(sessionId, initial) {
|
|
18183
18202
|
let options = initial;
|
|
18184
|
-
const ultracode =
|
|
18185
|
-
const
|
|
18203
|
+
const ultracode = this.isClaudeRuntime() && this.opts.configPrefs?.reasoningEffort === "ultracode";
|
|
18204
|
+
const fastMode = this.opts.configPrefs?.fastMode;
|
|
18205
|
+
const prefs = [
|
|
18206
|
+
["model", this.opts.configPrefs?.model],
|
|
18207
|
+
["thought_level", ultracode ? void 0 : this.opts.configPrefs?.reasoningEffort],
|
|
18208
|
+
["model_config", fastMode === void 0 ? void 0 : fastMode ? "on" : "off"]
|
|
18209
|
+
];
|
|
18186
18210
|
for (const [category, desired] of prefs) {
|
|
18187
18211
|
if (!desired) continue;
|
|
18188
18212
|
const plan = planConfigSelection(options, category, desired);
|
|
@@ -18228,7 +18252,7 @@ var AcpHost = class {
|
|
|
18228
18252
|
async loadSession(sessionId, cwd) {
|
|
18229
18253
|
this.loadingSessions.add(sessionId);
|
|
18230
18254
|
try {
|
|
18231
|
-
const _meta =
|
|
18255
|
+
const _meta = claudeSessionMeta(this.opts.configPrefs?.reasoningEffort, this.isClaudeRuntime());
|
|
18232
18256
|
const res = await this.conn.agent.request(methods.agent.session.load, {
|
|
18233
18257
|
sessionId,
|
|
18234
18258
|
cwd,
|
|
@@ -18321,7 +18345,8 @@ async function runChat(opts) {
|
|
|
18321
18345
|
env: agentChildEnv(agent),
|
|
18322
18346
|
configPrefs: {
|
|
18323
18347
|
model: agent.runtimeOverrides?.model,
|
|
18324
|
-
reasoningEffort: agent.reasoningEffort
|
|
18348
|
+
reasoningEffort: agent.reasoningEffort,
|
|
18349
|
+
fastMode: agent.fastMode
|
|
18325
18350
|
}
|
|
18326
18351
|
});
|
|
18327
18352
|
await host.start();
|
|
@@ -23924,7 +23949,7 @@ function signature(a) {
|
|
|
23924
23949
|
/** Sub-signature over the dimensions that determine the ACP host subprocess —
|
|
23925
23950
|
* the spawn binary (`runtime`) and the knobs baked into the host at construction:
|
|
23926
23951
|
* child env / system-prompt seed (agentChildEnv + cpRuntimeEnv) and the session
|
|
23927
|
-
* config prefs (model / reasoningEffort, applied per session via ACP
|
|
23952
|
+
* config prefs (model / reasoningEffort / fastMode, applied per session via ACP
|
|
23928
23953
|
* set_config_option). A change here means the cached host must be evicted so
|
|
23929
23954
|
* the next session respawns it fresh. */
|
|
23930
23955
|
function hostSpawnSig(a) {
|
|
@@ -23934,6 +23959,7 @@ function hostSpawnSig(a) {
|
|
|
23934
23959
|
description: a.description,
|
|
23935
23960
|
reasoningEffort: a.reasoningEffort,
|
|
23936
23961
|
executionMode: a.executionMode,
|
|
23962
|
+
fastMode: a.fastMode,
|
|
23937
23963
|
env: a.runtimeOverrides?.env
|
|
23938
23964
|
});
|
|
23939
23965
|
}
|
|
@@ -23995,7 +24021,7 @@ var LocalStore = class {
|
|
|
23995
24021
|
CREATE TABLE IF NOT EXISTS sessions (
|
|
23996
24022
|
key TEXT PRIMARY KEY, agentId TEXT, platform TEXT, channel TEXT, thread TEXT,
|
|
23997
24023
|
acpSessionId TEXT, state TEXT, lastDeliveredTs TEXT, updatedAt INTEGER,
|
|
23998
|
-
usage TEXT, muted INTEGER, triggeredBy TEXT
|
|
24024
|
+
usage TEXT, muted INTEGER, triggeredBy TEXT, title TEXT
|
|
23999
24025
|
);
|
|
24000
24026
|
-- Platform id → human display name (Slack channel/user names, daemon-resolved
|
|
24001
24027
|
-- and cached here so session read-back can label ids without a Slack call).
|
|
@@ -24041,14 +24067,16 @@ var LocalStore = class {
|
|
|
24041
24067
|
ON transcript (channel, thread, tool_call_id) WHERE tool_call_id IS NOT NULL`);
|
|
24042
24068
|
}
|
|
24043
24069
|
/** Add the `sessions.usage` (JSON token accounting), `sessions.muted` (`!stop`
|
|
24044
|
-
* thread mute) and `sessions.
|
|
24045
|
-
* TABLE IF NOT EXISTS above adds them for fresh DBs but
|
|
24046
|
-
* table, so upgrade in place. No-op once the columns
|
|
24070
|
+
* thread mute), `sessions.triggeredBy` and `sessions.title` columns to a
|
|
24071
|
+
* pre-existing DB. CREATE TABLE IF NOT EXISTS above adds them for fresh DBs but
|
|
24072
|
+
* never alters an existing table, so upgrade in place. No-op once the columns
|
|
24073
|
+
* are present. */
|
|
24047
24074
|
migrateSessionUsage() {
|
|
24048
24075
|
const cols = this.db.prepare("PRAGMA table_info(sessions)").all();
|
|
24049
24076
|
if (!cols.some((c) => c.name === "usage")) this.db.exec("ALTER TABLE sessions ADD COLUMN usage TEXT");
|
|
24050
24077
|
if (!cols.some((c) => c.name === "muted")) this.db.exec("ALTER TABLE sessions ADD COLUMN muted INTEGER");
|
|
24051
24078
|
if (!cols.some((c) => c.name === "triggeredBy")) this.db.exec("ALTER TABLE sessions ADD COLUMN triggeredBy TEXT");
|
|
24079
|
+
if (!cols.some((c) => c.name === "title")) this.db.exec("ALTER TABLE sessions ADD COLUMN title TEXT");
|
|
24052
24080
|
}
|
|
24053
24081
|
/**
|
|
24054
24082
|
* Pre-`kind` transcript tables keyed on (channel, thread, ts) hold only conversational
|
|
@@ -24128,6 +24156,11 @@ var LocalStore = class {
|
|
|
24128
24156
|
setSessionMuted(key, muted) {
|
|
24129
24157
|
this.db.prepare("UPDATE sessions SET muted = ? WHERE key = ?").run(muted ? 1 : 0, key);
|
|
24130
24158
|
}
|
|
24159
|
+
/** Human-facing session title from the runtime's `session_info_update` (latest
|
|
24160
|
+
* wins; null clears per ACP semantics). No-op on an unknown key. */
|
|
24161
|
+
setSessionTitle(key, title) {
|
|
24162
|
+
this.db.prepare("UPDATE sessions SET title = ? WHERE key = ?").run(title, key);
|
|
24163
|
+
}
|
|
24131
24164
|
isSessionMuted(key) {
|
|
24132
24165
|
return this.db.prepare("SELECT muted FROM sessions WHERE key = ?").get(key)?.muted === 1;
|
|
24133
24166
|
}
|
|
@@ -83276,6 +83309,7 @@ function createSessionReader(store) {
|
|
|
83276
83309
|
status: r.state,
|
|
83277
83310
|
lastActivityAt: new Date(r.updatedAt).toISOString(),
|
|
83278
83311
|
...usage ? { usage } : {},
|
|
83312
|
+
...r.title ? { title: r.title } : {},
|
|
83279
83313
|
...r.triggeredBy ? { triggeredBy: r.triggeredBy } : {},
|
|
83280
83314
|
...channelName ? { channelName } : {},
|
|
83281
83315
|
...triggeredByName ? { triggeredByName } : {}
|
|
@@ -83527,8 +83561,10 @@ async function fetchHeadMtime(root) {
|
|
|
83527
83561
|
* `workspace.path` rewritten to an absolute path. Editing the raw file preserves
|
|
83528
83562
|
* `${VAR}` templates and the original relative `workspace.path`.
|
|
83529
83563
|
*
|
|
83530
|
-
* Locally-owned keys (id, status, runtime, integrations,
|
|
83531
|
-
*
|
|
83564
|
+
* Locally-owned keys (id, status, runtime, integrations, permissions, crons,
|
|
83565
|
+
* workspace.path / pullOnNewSession / skills) are preserved untouched.
|
|
83566
|
+
* `output.mode` is CP-owned when the spec carries `outputMode` (a spec without
|
|
83567
|
+
* it leaves the local value alone — hand-authored agent.json keeps working).
|
|
83532
83568
|
*/
|
|
83533
83569
|
/** Map a CP workspace mode onto the daemon's AgentSchema workspace mode. */
|
|
83534
83570
|
function mapWorkspaceMode(mode) {
|
|
@@ -83556,6 +83592,12 @@ function applySpecFields(raw, spec, opts) {
|
|
|
83556
83592
|
if (spec.description !== void 0) raw.description = spec.description;
|
|
83557
83593
|
if (spec.reasoningEffort !== void 0) raw.reasoningEffort = spec.reasoningEffort;
|
|
83558
83594
|
if (spec.executionMode !== void 0) raw.executionMode = spec.executionMode;
|
|
83595
|
+
if (spec.fastMode !== void 0) raw.fastMode = spec.fastMode;
|
|
83596
|
+
if (spec.outputMode !== void 0) {
|
|
83597
|
+
const out = typeof raw.output === "object" && raw.output !== null ? raw.output : {};
|
|
83598
|
+
out.mode = spec.outputMode;
|
|
83599
|
+
raw.output = out;
|
|
83600
|
+
}
|
|
83559
83601
|
if (spec.model !== void 0 || spec.env !== void 0) {
|
|
83560
83602
|
const ro = typeof raw.runtimeOverrides === "object" && raw.runtimeOverrides !== null ? raw.runtimeOverrides : {};
|
|
83561
83603
|
if (spec.model !== void 0) ro.model = spec.model;
|
|
@@ -84414,7 +84456,8 @@ var Daemon = class Daemon {
|
|
|
84414
84456
|
},
|
|
84415
84457
|
configPrefs: {
|
|
84416
84458
|
model: agent.runtimeOverrides?.model,
|
|
84417
|
-
reasoningEffort: agent.reasoningEffort
|
|
84459
|
+
reasoningEffort: agent.reasoningEffort,
|
|
84460
|
+
fastMode: agent.fastMode
|
|
84418
84461
|
},
|
|
84419
84462
|
log: this.log
|
|
84420
84463
|
});
|
|
@@ -84781,6 +84824,7 @@ var Daemon = class Daemon {
|
|
|
84781
84824
|
costAmount: update.cost?.amount ?? void 0,
|
|
84782
84825
|
costCurrency: update.cost?.currency ?? void 0
|
|
84783
84826
|
});
|
|
84827
|
+
if (update?.sessionUpdate === "session_info_update" && update.title !== void 0) this.store.setSessionTitle(p.sessionKey, update.title);
|
|
84784
84828
|
for (const action of p.conv.onUpdate(update)) this.enqueueApply(p, action);
|
|
84785
84829
|
this.armIdle(p);
|
|
84786
84830
|
for (const ev of p.rec.onUpdate(update)) this.recordEvent(p.agentId, p.channel, p.statusThread, ev);
|