agent-nuvira 3.5.5 → 3.5.7
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/.agents/skills/index.json +16 -0
- package/.agents/skills/motion/SKILL.md +27 -0
- package/README.md +122 -1
- package/dist/cli/chat.d.ts +76 -17
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +330 -137
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +17 -3
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/doctor.d.ts +31 -2
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +143 -7
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/execute.d.ts.map +1 -1
- package/dist/cli/execute.js +63 -22
- package/dist/cli/execute.js.map +1 -1
- package/dist/cli/failover-runner.js +4 -4
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/gateway.js +13 -13
- package/dist/cli/gateway.js.map +1 -1
- package/dist/cli/loop-executor.d.ts +22 -0
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +60 -13
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/parity.d.ts +12 -0
- package/dist/cli/parity.d.ts.map +1 -1
- package/dist/cli/parity.js +46 -1
- package/dist/cli/parity.js.map +1 -1
- package/dist/cli/stats.d.ts +62 -4
- package/dist/cli/stats.d.ts.map +1 -1
- package/dist/cli/stats.js +282 -5
- package/dist/cli/stats.js.map +1 -1
- package/dist/cli/tool-install-prompt.d.ts +2 -7
- package/dist/cli/tool-install-prompt.d.ts.map +1 -1
- package/dist/cli/tool-install-prompt.js +11 -28
- package/dist/cli/tool-install-prompt.js.map +1 -1
- package/dist/cli/ui/index.d.ts +2 -2
- package/dist/cli/ui/index.d.ts.map +1 -1
- package/dist/cli/ui/index.js +1 -1
- package/dist/cli/ui/index.js.map +1 -1
- package/dist/cli/ui/presenter.d.ts +43 -0
- package/dist/cli/ui/presenter.d.ts.map +1 -1
- package/dist/cli/ui/presenter.js +88 -1
- package/dist/cli/ui/presenter.js.map +1 -1
- package/dist/config/manager.d.ts +29 -1
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/config/manager.js +178 -143
- package/dist/config/manager.js.map +1 -1
- package/dist/config/paths.d.ts +48 -1
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +59 -9
- package/dist/config/paths.js.map +1 -1
- package/dist/config/scratch-workspace.d.ts +134 -0
- package/dist/config/scratch-workspace.d.ts.map +1 -0
- package/dist/config/scratch-workspace.js +213 -0
- package/dist/config/scratch-workspace.js.map +1 -0
- package/dist/config/service-catalog.js +1 -1
- package/dist/config/service-catalog.js.map +1 -1
- package/dist/config/service-probe.js +1 -1
- package/dist/config/service-probe.js.map +1 -1
- package/dist/config/types.d.ts +22 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/gateway/adapters.d.ts +24 -0
- package/dist/gateway/adapters.d.ts.map +1 -1
- package/dist/gateway/adapters.js +20 -8
- package/dist/gateway/adapters.js.map +1 -1
- package/dist/gateway/oversized-reply.d.ts +39 -0
- package/dist/gateway/oversized-reply.d.ts.map +1 -0
- package/dist/gateway/oversized-reply.js +54 -0
- package/dist/gateway/oversized-reply.js.map +1 -0
- package/dist/gateway/registry.d.ts +0 -10
- package/dist/gateway/registry.d.ts.map +1 -1
- package/dist/gateway/registry.js +149 -5
- package/dist/gateway/registry.js.map +1 -1
- package/dist/learning/auto-router.d.ts +30 -4
- package/dist/learning/auto-router.d.ts.map +1 -1
- package/dist/learning/auto-router.js +54 -38
- package/dist/learning/auto-router.js.map +1 -1
- package/dist/learning/cost-classification.d.ts +188 -0
- package/dist/learning/cost-classification.d.ts.map +1 -0
- package/dist/learning/cost-classification.js +294 -0
- package/dist/learning/cost-classification.js.map +1 -0
- package/dist/learning/cost-ledger-maintenance.d.ts +122 -0
- package/dist/learning/cost-ledger-maintenance.d.ts.map +1 -0
- package/dist/learning/cost-ledger-maintenance.js +289 -0
- package/dist/learning/cost-ledger-maintenance.js.map +1 -0
- package/dist/learning/cost-reconcile.d.ts +160 -0
- package/dist/learning/cost-reconcile.d.ts.map +1 -0
- package/dist/learning/cost-reconcile.js +238 -0
- package/dist/learning/cost-reconcile.js.map +1 -0
- package/dist/learning/cost-tracker.d.ts +134 -13
- package/dist/learning/cost-tracker.d.ts.map +1 -1
- package/dist/learning/cost-tracker.js +190 -68
- package/dist/learning/cost-tracker.js.map +1 -1
- package/dist/learning/model-pricing.d.ts +240 -0
- package/dist/learning/model-pricing.d.ts.map +1 -0
- package/dist/learning/model-pricing.js +309 -0
- package/dist/learning/model-pricing.js.map +1 -0
- package/dist/learning/model-selection.d.ts +15 -0
- package/dist/learning/model-selection.d.ts.map +1 -1
- package/dist/learning/model-selection.js +22 -2
- package/dist/learning/model-selection.js.map +1 -1
- package/dist/learning/model-warmup.d.ts.map +1 -1
- package/dist/learning/model-warmup.js +4 -1
- package/dist/learning/model-warmup.js.map +1 -1
- package/dist/learning/quota-ledger.d.ts +24 -0
- package/dist/learning/quota-ledger.d.ts.map +1 -1
- package/dist/learning/quota-ledger.js +40 -0
- package/dist/learning/quota-ledger.js.map +1 -1
- package/dist/learning/runtime-dependencies.d.ts +183 -0
- package/dist/learning/runtime-dependencies.d.ts.map +1 -0
- package/dist/learning/runtime-dependencies.js +349 -0
- package/dist/learning/runtime-dependencies.js.map +1 -0
- package/dist/learning/session-store.d.ts +1 -5
- package/dist/learning/session-store.d.ts.map +1 -1
- package/dist/learning/session-store.js +10 -1
- package/dist/learning/session-store.js.map +1 -1
- package/dist/learning/skill-store.d.ts.map +1 -1
- package/dist/learning/skill-store.js +6 -5
- package/dist/learning/skill-store.js.map +1 -1
- package/dist/learning/step-checkpoint.d.ts +32 -3
- package/dist/learning/step-checkpoint.d.ts.map +1 -1
- package/dist/learning/step-checkpoint.js +33 -4
- package/dist/learning/step-checkpoint.js.map +1 -1
- package/dist/mcp/settings.d.ts +15 -3
- package/dist/mcp/settings.d.ts.map +1 -1
- package/dist/mcp/settings.js +30 -15
- package/dist/mcp/settings.js.map +1 -1
- package/dist/parity/drivers.d.ts.map +1 -1
- package/dist/parity/drivers.js +31 -5
- package/dist/parity/drivers.js.map +1 -1
- package/dist/skills/bundled-skills-phase3.d.ts +14 -0
- package/dist/skills/bundled-skills-phase3.d.ts.map +1 -1
- package/dist/skills/bundled-skills-phase3.js +50 -0
- package/dist/skills/bundled-skills-phase3.js.map +1 -1
- package/dist/tools/child-agent-runtime.d.ts.map +1 -1
- package/dist/tools/child-agent-runtime.js +13 -7
- package/dist/tools/child-agent-runtime.js.map +1 -1
- package/dist/tools/followup-utils.d.ts +36 -0
- package/dist/tools/followup-utils.d.ts.map +1 -1
- package/dist/tools/followup-utils.js +66 -0
- package/dist/tools/followup-utils.js.map +1 -1
- package/dist/tools/modality/browser.js +2 -2
- package/dist/tools/modality/browser.js.map +1 -1
- package/dist/tools/modality/image-gen.d.ts +1 -1
- package/dist/tools/modality/image-gen.js +1 -1
- package/dist/tools/modality/image-providers.js +1 -1
- package/dist/tools/modality/image-providers.js.map +1 -1
- package/dist/tools/modality/motion-presets.d.ts +62 -0
- package/dist/tools/modality/motion-presets.d.ts.map +1 -0
- package/dist/tools/modality/motion-presets.js +399 -0
- package/dist/tools/modality/motion-presets.js.map +1 -0
- package/dist/tools/modality/motion-tool.d.ts +62 -0
- package/dist/tools/modality/motion-tool.d.ts.map +1 -0
- package/dist/tools/modality/motion-tool.js +220 -0
- package/dist/tools/modality/motion-tool.js.map +1 -0
- package/dist/tools/modality/motion.d.ts +298 -0
- package/dist/tools/modality/motion.d.ts.map +1 -0
- package/dist/tools/modality/motion.js +514 -0
- package/dist/tools/modality/motion.js.map +1 -0
- package/dist/tools/modality/vision.d.ts +1 -1
- package/dist/tools/modality/vision.js +1 -1
- package/dist/tools/modality/voice.js +2 -2
- package/dist/tools/modality/voice.js.map +1 -1
- package/dist/tools/neutts-synth.d.ts +3 -3
- package/dist/tools/neutts-synth.js +3 -3
- package/dist/tools/neutts-synth.js.map +1 -1
- package/dist/tools/process-liveness.d.ts +50 -0
- package/dist/tools/process-liveness.d.ts.map +1 -1
- package/dist/tools/process-liveness.js +82 -9
- package/dist/tools/process-liveness.js.map +1 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +102 -4
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +18 -1
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +71 -19
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/toolsets.js +2 -2
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/tools/web-research.d.ts +1 -1
- package/dist/tools/web-research.js +3 -3
- package/dist/tools/web-research.js.map +1 -1
- package/dist/utils/workspace-need.d.ts +84 -0
- package/dist/utils/workspace-need.d.ts.map +1 -0
- package/dist/utils/workspace-need.js +227 -0
- package/dist/utils/workspace-need.js.map +1 -0
- package/dist/web-dashboard/chat-console.d.ts +78 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +122 -12
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/hub-data.d.ts +9 -1
- package/dist/web-dashboard/hub-data.d.ts.map +1 -1
- package/dist/web-dashboard/hub-data.js +2 -0
- package/dist/web-dashboard/hub-data.js.map +1 -1
- package/dist/web-dashboard/project-context.d.ts +1 -1
- package/dist/web-dashboard/project-context.d.ts.map +1 -1
- package/dist/web-dashboard/project-context.js +7 -1
- package/dist/web-dashboard/project-context.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +33 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +326 -23
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +109 -0
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/web-dashboard/task-runner.d.ts +17 -1
- package/dist/web-dashboard/task-runner.d.ts.map +1 -1
- package/dist/web-dashboard/task-runner.js +40 -4
- package/dist/web-dashboard/task-runner.js.map +1 -1
- package/dist/web-dashboard/workspace-guard.d.ts +20 -21
- package/dist/web-dashboard/workspace-guard.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-guard.js +20 -153
- package/dist/web-dashboard/workspace-guard.js.map +1 -1
- package/dist/web-dashboard/workspace-resolution.d.ts +23 -5
- package/dist/web-dashboard/workspace-resolution.d.ts.map +1 -1
- package/dist/web-dashboard/workspace-resolution.js +22 -4
- package/dist/web-dashboard/workspace-resolution.js.map +1 -1
- package/package.json +1 -1
- package/src/web-dashboard/public/assets/index-CzRU84ET.css +1 -0
- package/src/web-dashboard/public/assets/index-V0rIqVbg.js +236 -0
- package/src/web-dashboard/public/assets/index-V0rIqVbg.js.map +1 -0
- package/src/web-dashboard/public/index.html +2 -2
- package/src/web-dashboard/public/assets/index-DycGBWwy.js +0 -236
- package/src/web-dashboard/public/assets/index-DycGBWwy.js.map +0 -1
- package/src/web-dashboard/public/assets/index-aO3aG7ex.css +0 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* returned it as a successful synthesis with duration/voice/text metadata. Anything
|
|
14
14
|
* downstream — a gateway that sends the file, an agent that reports "the audio is
|
|
15
15
|
* ready" — then acted on silence that looked like speech. Silence is now an
|
|
16
|
-
* explicit opt-in (
|
|
16
|
+
* explicit opt-in (NUVIRA_NEUTTS_ALLOW_SILENT) and never the default.
|
|
17
17
|
*
|
|
18
18
|
* See TOOL_TRUTHFULNESS_TRACKER.md finding #5.
|
|
19
19
|
*/
|
|
@@ -26,7 +26,7 @@ import { envBuff } from '../config/paths.js';
|
|
|
26
26
|
import { refusalFields } from './tool-refusal.js';
|
|
27
27
|
/**
|
|
28
28
|
* Whether a silent placeholder WAV may stand in for speech. Opt-in only
|
|
29
|
-
* (`
|
|
29
|
+
* (`NUVIRA_NEUTTS_ALLOW_SILENT=1`) — the point of the refusal is that silence must
|
|
30
30
|
* never be mistaken for synthesis. Exported for tests.
|
|
31
31
|
*/
|
|
32
32
|
export function allowSilentFallback() {
|
|
@@ -67,7 +67,7 @@ export class NeuTTSSynthesizer {
|
|
|
67
67
|
// it — a silent WAV reported as a successful synthesis is a lie the caller
|
|
68
68
|
// cannot detect, so it is never the default.
|
|
69
69
|
if (allowSilentFallback()) {
|
|
70
|
-
logger.warn(`[neutts] writing SILENT placeholder audio (
|
|
70
|
+
logger.warn(`[neutts] writing SILENT placeholder audio (NUVIRA_NEUTTS_ALLOW_SILENT is set) — ${failureReason}`);
|
|
71
71
|
return this.synthesizeLocal(text, voice, audioPath, options);
|
|
72
72
|
}
|
|
73
73
|
// 3. Refuse: say what is missing and what to use instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"neutts-synth.js","sourceRoot":"","sources":["../../src/tools/neutts-synth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AAEpE;;;;GAIG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACzC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,KAAK,CAAC;AAClD,CAAC;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commas — so the header is the only reliable index.
|
|
124
124
|
*/
|
|
125
125
|
export declare function parseWmicProcessTable(stdout: string): ProcessTable;
|
|
126
|
+
export declare function lastProbeBlockedWindow(): {
|
|
127
|
+
from: number;
|
|
128
|
+
until: number;
|
|
129
|
+
};
|
|
126
130
|
/**
|
|
127
131
|
* One process table read, for a caller that needs the SAME view several times.
|
|
128
132
|
*
|
|
@@ -174,6 +178,20 @@ export declare function lookupProcess(pid: number): {
|
|
|
174
178
|
command: string | null;
|
|
175
179
|
startedAtText: string | null;
|
|
176
180
|
} | null;
|
|
181
|
+
/**
|
|
182
|
+
* How much of a quiet window `[quietFrom, quietUntil]` fell inside a window in
|
|
183
|
+
* which the monitor could not observe output at all.
|
|
184
|
+
*
|
|
185
|
+
* That part of the silence is not evidence: an output byte produced while the
|
|
186
|
+
* observer's event loop was blocked is timestamped only once the loop is free
|
|
187
|
+
* again, so it shows up as silence that never happened. Pure, so the overlap can
|
|
188
|
+
* be asserted directly (see `lastProbeBlockedWindow` for where the blocked
|
|
189
|
+
* window comes from).
|
|
190
|
+
*/
|
|
191
|
+
export declare function unobservedPartOf(quietFrom: number, quietUntil: number, blocked: {
|
|
192
|
+
from: number;
|
|
193
|
+
until: number;
|
|
194
|
+
}): number;
|
|
177
195
|
export interface LivenessInput {
|
|
178
196
|
/** The run still exists (the registry has not seen it exit). */
|
|
179
197
|
alive: boolean;
|
|
@@ -181,6 +199,34 @@ export interface LivenessInput {
|
|
|
181
199
|
bytes: number;
|
|
182
200
|
/** ms since the last output byte (or since the start when nothing came). */
|
|
183
201
|
quietMs: number;
|
|
202
|
+
/**
|
|
203
|
+
* How much of `quietMs` the monitor itself could not have observed — time its
|
|
204
|
+
* own synchronous probe held the event loop (see `lastProbeBlockedWindow`, and
|
|
205
|
+
* `unobservedPartOf` for computing it). SUBTRACTED before any verdict is made:
|
|
206
|
+
* silence we were blind for is not the command's silence. Optional, and 0 by
|
|
207
|
+
* default, because a caller that knows it was watching the whole time has
|
|
208
|
+
* nothing to subtract.
|
|
209
|
+
*/
|
|
210
|
+
unobservedMs?: number;
|
|
211
|
+
/**
|
|
212
|
+
* Output bytes that arrived SINCE THE PREVIOUS SAMPLE.
|
|
213
|
+
*
|
|
214
|
+
* This is the load-bearing signal, and it exists because a byte's timestamp is
|
|
215
|
+
* the moment the monitor READ it, not the moment the command wrote it: while a
|
|
216
|
+
* sample holds the event loop (the process-table probe is synchronous — ~10-30ms
|
|
217
|
+
* of `ps`, but ~1s of PowerShell on the windows release runners), everything the
|
|
218
|
+
* command prints queues up unread and is stamped all at once when the loop is
|
|
219
|
+
* free. So measured silence can be an artefact of the observer, and a command
|
|
220
|
+
* printing a line every 80ms was reported in CI as "HUNG — no output for 1s and
|
|
221
|
+
* no CPU in that time". Bytes moved, though. They always move when a command is
|
|
222
|
+
* producing, whatever the clock of the reader says, and they do NOT move when it
|
|
223
|
+
* is genuinely stuck — which is exactly the distinction being made.
|
|
224
|
+
*
|
|
225
|
+
* 0/undefined (nothing arrived, or this is the first sample and there is no
|
|
226
|
+
* baseline) is NOT evidence of anything, so it leaves the CPU and silence rules
|
|
227
|
+
* to decide.
|
|
228
|
+
*/
|
|
229
|
+
bytesSinceLastSample?: number;
|
|
184
230
|
/** ms since the run started. */
|
|
185
231
|
ageMs: number;
|
|
186
232
|
/** CPU ms now, and at the previous sample (null = unmeasurable). */
|
|
@@ -204,6 +250,10 @@ export declare function formatSpan(ms: number): string;
|
|
|
204
250
|
* output recently → working; CPU advancing → working; only then, silence PLUS a
|
|
205
251
|
* measurable absence of CPU → hung. Anything we cannot prove lands in `stalled`,
|
|
206
252
|
* which is reported but never reaped.
|
|
253
|
+
*
|
|
254
|
+
* The silence is the ATTESTED silence: `quietMs` minus the part of it the monitor
|
|
255
|
+
* could not have observed (`unobservedMs`). Silence nobody was watching for is
|
|
256
|
+
* not something to accuse a command of.
|
|
207
257
|
*/
|
|
208
258
|
export declare function classifyLiveness(input: LivenessInput, thresholds?: LivenessThresholds): LivenessVerdict;
|
|
209
259
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-liveness.d.ts","sourceRoot":"","sources":["../../src/tools/process-liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH,2EAA2E;AAC3E,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;AAEhF,2DAA2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,YAAY,EAAE,MAAM,CAAC;IACrB,uDAAuD;IACvD,WAAW,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,2BAA2B,EAAE,kBAIzC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,CAU3F;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASxD;AAED,MAAM,WAAW,iBAAiB;IAChC,mDAAmD;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,iFAAiF;IACjF,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kFAAkF;IAClF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;;;;;;;;;;OAYG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAanD;;;;;;GAMG;AACH,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AAY,GAAG,IAAI,GAC1B,MAAM,EAAE,CAyBV"}
|
|
@@ -249,9 +249,51 @@ function readPosixProcessTable() {
|
|
|
249
249
|
}
|
|
250
250
|
return null;
|
|
251
251
|
}
|
|
252
|
+
/**
|
|
253
|
+
* The last window in which the process-table probe held the event loop — the
|
|
254
|
+
* time during which this process could not have NOTICED the output a monitored
|
|
255
|
+
* command was producing.
|
|
256
|
+
*
|
|
257
|
+
* It is not bookkeeping for its own sake. The probe is SYNCHRONOUS
|
|
258
|
+
* (`execFileSync`/`execSync`), so while it runs the child's stdout events sit in
|
|
259
|
+
* the queue unread and `lastOutputAt` stays frozen at the last drain. On POSIX
|
|
260
|
+
* `ps` costs ~10-30ms and that is invisible, but on Windows it is a PowerShell
|
|
261
|
+
* start — MEASURED at ~1s on the release runners — which is longer than the
|
|
262
|
+
* silence a watchdog is willing to call a hang. The consequence was REAL and
|
|
263
|
+
* reproduced in CI: a command printing a line every 80ms was reported "HUNG — no
|
|
264
|
+
* output for 1s and no CPU in that time", because the only second of silence in
|
|
265
|
+
* the picture was the watchdog's own blindness. Callers subtract this window from
|
|
266
|
+
* the silence they are willing to hold against a run (see
|
|
267
|
+
* `LivenessInput.unobservedMs`), which is the difference between "it said
|
|
268
|
+
* nothing" and "I was not looking".
|
|
269
|
+
*
|
|
270
|
+
* It is the COMPLEMENT of the byte count (`LivenessInput.bytesSinceLastSample`),
|
|
271
|
+
* which is the primary rule: a run whose output WAS read between two samples is
|
|
272
|
+
* plainly working, and that covers a monitor slow enough to batch its reads. This
|
|
273
|
+
* window covers the other half — a sample that read nothing at all, because its
|
|
274
|
+
* own probe held the loop for the span being judged.
|
|
275
|
+
*
|
|
276
|
+
* The MOST RECENT read only, and that is the one that matters: a tick reads this
|
|
277
|
+
* BEFORE running its own probe, so what it gets is the PREVIOUS probe's block —
|
|
278
|
+
* precisely the block that can have frozen the quiet window it is judging.
|
|
279
|
+
*/
|
|
280
|
+
let lastProbeBlockedFrom = 0;
|
|
281
|
+
let lastProbeBlockedUntil = 0;
|
|
282
|
+
export function lastProbeBlockedWindow() {
|
|
283
|
+
return { from: lastProbeBlockedFrom, until: lastProbeBlockedUntil };
|
|
284
|
+
}
|
|
252
285
|
/** One process table read: pid → { parent, cpu, command }. NEVER cached. */
|
|
253
286
|
function readProcessTable() {
|
|
254
|
-
|
|
287
|
+
const from = Date.now();
|
|
288
|
+
try {
|
|
289
|
+
return process.platform === 'win32' ? readWindowsProcessTable() : readPosixProcessTable();
|
|
290
|
+
}
|
|
291
|
+
finally {
|
|
292
|
+
// Recorded in `finally` so a probe that THREW still reports the time it held
|
|
293
|
+
// the loop — a failed read hides output exactly as well as a slow one.
|
|
294
|
+
lastProbeBlockedFrom = from;
|
|
295
|
+
lastProbeBlockedUntil = Date.now();
|
|
296
|
+
}
|
|
255
297
|
}
|
|
256
298
|
/**
|
|
257
299
|
* One process table read, for a caller that needs the SAME view several times.
|
|
@@ -372,6 +414,22 @@ export function lookupProcess(pid) {
|
|
|
372
414
|
? { found: true, command: row.command, startedAtText: row.startedAtText }
|
|
373
415
|
: { found: false, command: null, startedAtText: null };
|
|
374
416
|
}
|
|
417
|
+
/**
|
|
418
|
+
* How much of a quiet window `[quietFrom, quietUntil]` fell inside a window in
|
|
419
|
+
* which the monitor could not observe output at all.
|
|
420
|
+
*
|
|
421
|
+
* That part of the silence is not evidence: an output byte produced while the
|
|
422
|
+
* observer's event loop was blocked is timestamped only once the loop is free
|
|
423
|
+
* again, so it shows up as silence that never happened. Pure, so the overlap can
|
|
424
|
+
* be asserted directly (see `lastProbeBlockedWindow` for where the blocked
|
|
425
|
+
* window comes from).
|
|
426
|
+
*/
|
|
427
|
+
export function unobservedPartOf(quietFrom, quietUntil, blocked) {
|
|
428
|
+
if (blocked.until <= blocked.from)
|
|
429
|
+
return 0;
|
|
430
|
+
const overlap = Math.min(blocked.until, quietUntil) - Math.max(blocked.from, quietFrom);
|
|
431
|
+
return Math.max(0, overlap);
|
|
432
|
+
}
|
|
375
433
|
/** `45s` / `3m 05s` — how long, for a human reading a message. */
|
|
376
434
|
export function formatSpan(ms) {
|
|
377
435
|
const totalSeconds = Math.max(0, Math.round(ms / 1000));
|
|
@@ -391,6 +449,10 @@ export function formatSpan(ms) {
|
|
|
391
449
|
* output recently → working; CPU advancing → working; only then, silence PLUS a
|
|
392
450
|
* measurable absence of CPU → hung. Anything we cannot prove lands in `stalled`,
|
|
393
451
|
* which is reported but never reaped.
|
|
452
|
+
*
|
|
453
|
+
* The silence is the ATTESTED silence: `quietMs` minus the part of it the monitor
|
|
454
|
+
* could not have observed (`unobservedMs`). Silence nobody was watching for is
|
|
455
|
+
* not something to accuse a command of.
|
|
394
456
|
*/
|
|
395
457
|
export function classifyLiveness(input, thresholds = DEFAULT_LIVENESS_THRESHOLDS) {
|
|
396
458
|
if (!input.alive)
|
|
@@ -398,10 +460,21 @@ export function classifyLiveness(input, thresholds = DEFAULT_LIVENESS_THRESHOLDS
|
|
|
398
460
|
// A command seconds old has simply not said anything yet.
|
|
399
461
|
if (input.ageMs < 3_000)
|
|
400
462
|
return { verdict: 'starting', why: 'just started' };
|
|
401
|
-
|
|
463
|
+
// It produced something since we last looked — that is production itself, and
|
|
464
|
+
// it outranks the clock (see `bytesSinceLastSample`: the clock measures when we
|
|
465
|
+
// READ, so it under-reports a command we were too busy to listen to).
|
|
466
|
+
const arrived = input.bytesSinceLastSample ?? 0;
|
|
467
|
+
if (arrived > 0) {
|
|
468
|
+
return {
|
|
469
|
+
verdict: 'working',
|
|
470
|
+
why: `${arrived} bytes of output arrived since the last sample — still producing`,
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const quietMs = Math.max(0, input.quietMs - Math.max(0, input.unobservedMs ?? 0));
|
|
474
|
+
if (quietMs < thresholds.stallQuietMs) {
|
|
402
475
|
return {
|
|
403
476
|
verdict: 'working',
|
|
404
|
-
why: input.bytes > 0 ? `produced output ${formatSpan(
|
|
477
|
+
why: input.bytes > 0 ? `produced output ${formatSpan(quietMs)} ago` : 'producing output',
|
|
405
478
|
};
|
|
406
479
|
}
|
|
407
480
|
// "the last 0s" reads as nonsense, so a sub-second sample window is reported
|
|
@@ -412,31 +485,31 @@ export function classifyLiveness(input, thresholds = DEFAULT_LIVENESS_THRESHOLDS
|
|
|
412
485
|
if (cpuDelta !== null && cpuDelta >= thresholds.hangCpuFloorMs) {
|
|
413
486
|
return {
|
|
414
487
|
verdict: 'working',
|
|
415
|
-
why: `silent for ${formatSpan(
|
|
488
|
+
why: `silent for ${formatSpan(quietMs)} but still computing — ` +
|
|
416
489
|
`${cpuDelta}ms of CPU in the last ${windowLabel}`,
|
|
417
490
|
};
|
|
418
491
|
}
|
|
419
|
-
if (
|
|
492
|
+
if (quietMs >= thresholds.hangQuietMs) {
|
|
420
493
|
if (cpuDelta !== null) {
|
|
421
494
|
return {
|
|
422
495
|
verdict: 'hung',
|
|
423
|
-
why: `no output for ${formatSpan(
|
|
496
|
+
why: `no output for ${formatSpan(quietMs)} and no CPU in that time ` +
|
|
424
497
|
`(${cpuDelta}ms over the last ${windowLabel}) — it is waiting for something ` +
|
|
425
498
|
`that is not coming (a prompt with no stdin, a lock, or a socket that never answers)`,
|
|
426
499
|
};
|
|
427
500
|
}
|
|
428
501
|
return {
|
|
429
502
|
verdict: 'stalled',
|
|
430
|
-
why: `no output for ${formatSpan(
|
|
503
|
+
why: `no output for ${formatSpan(quietMs)}; CPU is not measurable on this platform, so this is ` +
|
|
431
504
|
`reported rather than treated as a confirmed hang`,
|
|
432
505
|
};
|
|
433
506
|
}
|
|
434
507
|
return {
|
|
435
508
|
verdict: 'stalled',
|
|
436
509
|
why: measurable
|
|
437
|
-
? `quiet for ${formatSpan(
|
|
510
|
+
? `quiet for ${formatSpan(quietMs)} with only ${cpuDelta}ms of CPU in the last ` +
|
|
438
511
|
`${windowLabel} — slowing rather than stopped`
|
|
439
|
-
: `quiet for ${formatSpan(
|
|
512
|
+
: `quiet for ${formatSpan(quietMs)}`,
|
|
440
513
|
};
|
|
441
514
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C,EAAE;KACvC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,MAAsB,EACtB,KAA2D,EAC3D,KAA2B;IAE3B,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,0EAA0E;IAC1E,wEAAwE;IACxE,mEAAmE;IACnE,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,EAAE,IAAI,EAAE,GAAG,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/C,KAAK,MAAM,OAAO,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC;gBAAE,SAAS;YACxD,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC9B,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1B,CAAC;YAAC,MAAM,CAAC;gBACP,kCAAkC;YACpC,CAAC;QACH,CAAC;IACH,CAAC;IACD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACrB,CAAC;QAAC,MAAM,CAAC;YACP,iBAAiB;QACnB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -476,7 +476,7 @@ export declare function toolJsonSchemas(toolNames?: string[]): ToolJsonSchema[];
|
|
|
476
476
|
*/
|
|
477
477
|
export declare const TOOL_CONTRACT = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call `finding` with the claim, what became of it, and the evidence you ACTUALLY checked \u2014 the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.";
|
|
478
478
|
/** The JSON-fallback tool contract — for providers WITHOUT native tool-calling. */
|
|
479
|
-
export declare const TOOL_CONTRACT_JSON = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call `finding` with the claim, what became of it, and the evidence you ACTUALLY checked \u2014 the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.\n\nTOOL CALL FORMAT (JSON fallback transport):\nWhen calling a tool, emit its JSON AFTER your response text, in this exact shape:\n{\"tool\":\"<name>\",\"arguments\":{...}}\nOne tool call per block. The final block may be a suggest_followups call.";
|
|
479
|
+
export declare const TOOL_CONTRACT_JSON = "You have tools available. Call them when appropriate.\n\n- If a request is ambiguous or incomplete, call `ask_user` with a question and 2\u20134 choices \u2014 never guess, never ask in plain text.\n- If a request needs code written, debugged, or prior work resumed, call `build`, `repair`, or `resume` with the goal.\n- If a request needs documentation, a website, analysis of a project, or running tests, call `document`, `website`, `analyze`, or `test` with the goal.\n- If a request asks to publish a release (npm/GitHub), call `publish`. It leaves this machine and is irreversible \u2014 confirm the bump type and target with the user via `ask_user` first unless they already specified them.\n- When your answer ASSERTS something a second party could check (a test passed, a file contains X, the count is N, a command was run), call `finding` with the claim, what became of it, and the evidence you ACTUALLY checked \u2014 the command and its real output, the path you read, a quote from the request. Usable evidence records it CONFIRMED; with none it is recorded PLAUSIBLE, which is the honest result for a reasoned guess. You cannot set the verdict and must never claim a check you did not perform.\n- If a request's completeness is uncertain, call `verify_requirement` first.\n- If a request asks to deliver a message or result to a DIFFERENT contact/channel than the one you are currently chatting on (WhatsApp, Telegram, Slack, email, \u2026), call `gateway_send` with the target (e.g. `whatsapp:Alex`) and the text. Do NOT call gateway_send to reply to the CURRENT conversation \u2014 your text response is automatically delivered back. If the target contact is not configured, tell the user what to set up.\n- If a request asks to manage the system/agent itself in plain English \u2014 start/stop the dashboard or gateway, check status, add/remove a verified sender, configure a platform (telegram/whatsapp), run evals, show stats \u2014 call `run_cli` with the plain-English ask. It resolves the exact `nuvira` command and runs it. If the user's own request already resolves to that command (\"stop the dashboard\"), it just runs \u2014 do not ask for permission to do what was just asked. If it reports AMBIGUOUS, call `ask_user` with the two choices; if the intent is one YOU chose rather than the user (or is irreversible: history.clear, memory.prune, stats.cost.clear, publish), call `ask_user` first and retry with confirm:true.\n- If a subtask can be delegated to a specialized sub-agent (gather context, review, security scan, run tests), call `delegate` with the agent type, a focused prompt, and optional file paths.\n- To find code matching a pattern (context gathering, locating definitions/usages), call `code_search` with the pattern and optional globs.\n- To READ the project: call `read_file` to open a file (with line numbers), `list_dir` to see a directory's contents, or `glob` to find files by pattern. Always prefer reading the actual file over assuming its contents \u2014 a large file reports a line range, continue with offset/limit.\n- To CHANGE code (after reading it): call `edit_file` for a surgical exact-text replacement, or `write_file` to create/replace a file. CREATING a file the request asked for is applied directly \u2014 no confirmation needed, so just call it. An `edit_file` that is surgical (small relative to the file) also applies directly, as does one on a file the request names \u2014 the verify loop must not need a human between iterations. A whole-file write over existing content, or an edit that rewrites most of a file, refuses without confirm \u2014 call `ask_user` with a one-line summary, then retry with confirm:true.\n- NEVER ask for permission to do work the user already asked for \u2014 not via `ask_user` and never in plain text. Decide it yourself, state the decision in your answer, and continue. Reserve `ask_user` for a decision that is genuinely the user's: it cannot proceed without an answer, it is high-impact AND irreversible, and there is no sensible default (overwriting existing work, deleting data, spending money, publishing).\n- To VERIFY code by actual invocation: call `run_terminal` with the real command (`npx vitest run tests/x.test.ts`, `npx tsc --noEmit`, `npm run build`, `git diff`). Read-only verify commands run directly, and so do recoverable workspace commands (`npm/pnpm/yarn/bun install`, `pip install`, `mkdir`, `touch`, `cp`, `mv`, `git add`, `npm init`) when the request authorized the work \u2014 the build you were asked for is your job to set up. Everything else state-changing (network fetches, arbitrary code, global installs, anything leaving the machine) needs confirm:true after the user approves via ask_user. Never guess that a test passes \u2014 run it and read the output. Use run_cli (not run_terminal) for buff/agent-nuvira control commands, and the `git` tool (not run_terminal) to commit.\n- END EVERY RESPONSE by calling `suggest_followups` with exactly 3 followups the user is likely to want next \u2014 natural next questions, deeper dives, or related directions that build on what you just said; specific to this conversation, not generic.\n- If you have nothing to add, answer directly and still end with suggest_followups.\n- ORDERING (non-negotiable): deliver the user's answer FIRST, then suggest_followups. The followup call must come only AFTER the complete answer is written \u2014 never before it, never instead of it. A bare lead-in (\"Sure, I can help!\") is NOT an answer; write the full answer in the same step as the followup call.\n\nTOOL CALL FORMAT (JSON fallback transport):\nWhen calling a tool, emit its JSON AFTER your response text, in this exact shape:\n{\"tool\":\"<name>\",\"arguments\":{...}}\nOne tool call per block. The final block may be a suggest_followups call.\n\nFINAL STEP \u2014 how a turn ends on this transport:\nEnd your LAST line with that block for suggest_followups, with the suggestions INSIDE it:\n{\"tool\":\"suggest_followups\",\"arguments\":{\"followups\":[{\"prompt\":\"...\",\"label\":\"...\"},{\"prompt\":\"...\"},{\"prompt\":\"...\"}]}}\nOptions written as prose are NOT a tool call \u2014 \"Would you like me to: 1. ... 2. ...\" leaves the user with nothing to pick, because the choices are read from the block only. Write the answer first, then the block.";
|
|
480
480
|
/**
|
|
481
481
|
* Parse + validate a model's followups output against the shared
|
|
482
482
|
* suggest_followups schema. Accepts both the tool shape `[{prompt,label?}]`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAAE,CAAC,EAAgB,KAAK,OAAO,EAAE,MAAM,KAAK,CAAC;AAMpD,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAC;AAOtC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAMjF,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAElE,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAC;IACvC,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAC;IACrB;;;;;;;;;;;;;;;;OAgBG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,qEAAqE;IACrE,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC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/B,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,eAAe,EACf,YAAY,GACb,MAAM,qBAAqB,CAAC"}
|
package/dist/tools/registry.js
CHANGED
|
@@ -261,6 +261,45 @@ const imageGenSchema = z.object({
|
|
|
261
261
|
.optional()
|
|
262
262
|
.describe('Optional backend override: gemini (Imagen/Nano Banana), openai (DALL-E/gpt-image), stability, comfyui (local), or pollinations (free). Defaults to the first backend whose API key is configured.'),
|
|
263
263
|
});
|
|
264
|
+
/**
|
|
265
|
+
* Motion tool args — code-authored animation rendered to a video file.
|
|
266
|
+
*
|
|
267
|
+
* Kept deliberately narrow: the SOURCE (html / html_path / preset+data) and the
|
|
268
|
+
* handful of settings that change the output, because a long schema is prompt
|
|
269
|
+
* budget spent on every turn whether or not motion is being rendered.
|
|
270
|
+
*/
|
|
271
|
+
const motionRenderSchema = z.object({
|
|
272
|
+
action: z
|
|
273
|
+
.enum(['render', 'revise', 'list', 'presets'])
|
|
274
|
+
.optional()
|
|
275
|
+
.describe("Default 'render'. 'revise' re-renders a previous render (source_id) with edits — deterministic because the stored source is re-rendered, not re-invented; 'list' shows this workspace's renders; 'presets' lists the ready-made scenes."),
|
|
276
|
+
html: z.string().optional().describe('A self-contained HTML animation (no network: inline CSS/JS/SVG). Must be seekable — see the motion skill.'),
|
|
277
|
+
html_path: z.string().optional().describe('Path to an HTML animation file instead of inline html'),
|
|
278
|
+
preset: z
|
|
279
|
+
.enum(['title-card', 'bar-race', 'line-reveal', 'code-walkthrough'])
|
|
280
|
+
.optional()
|
|
281
|
+
.describe('Use a ready-made scene instead of hand-written html: title-card, bar-race, line-reveal (charts from your data), code-walkthrough'),
|
|
282
|
+
params: z.record(z.string(), z.unknown()).optional().describe('Preset parameters: title, subtitle, kicker, accent, background, foreground, unit, decimals'),
|
|
283
|
+
data: z.unknown().optional().describe('Data to animate: JSON (array of numbers, [{label,value}], {series:[…]}) or CSV text'),
|
|
284
|
+
data_path: z.string().optional().describe('Path to a CSV/JSON file to animate (bar-race, line-reveal, code-walkthrough)'),
|
|
285
|
+
source_id: z.string().optional().describe("Render id to revise (from a previous motion_render or action:'list')"),
|
|
286
|
+
title: z.string().optional().describe('Convenience title (merged into preset params)'),
|
|
287
|
+
fps: z.number().int().min(1).max(60).optional().describe('Frames per second (default 30)'),
|
|
288
|
+
duration_ms: z.number().int().min(200).max(600000).optional().describe('Length in ms (default 8000)'),
|
|
289
|
+
width: z.number().int().min(64).max(3840).optional().describe('Frame width (default 1280)'),
|
|
290
|
+
height: z.number().int().min(64).max(2160).optional().describe('Frame height (default 720)'),
|
|
291
|
+
aspect_ratio: z.string().optional().describe("Shape instead of a size, e.g. '16:9', '9:16', '1:1' (720p/1080p by default)"),
|
|
292
|
+
format: z.enum(['mp4', 'gif', 'webm']).optional().describe('Container (default mp4; gif carries no audio)'),
|
|
293
|
+
crf: z.number().int().min(0).max(51).optional().describe('Quality: lower is better (default 20)'),
|
|
294
|
+
narration: z.string().optional().describe('Narration text, synthesized locally (edge-tts/Piper) and muxed onto the video'),
|
|
295
|
+
voice: z.string().optional().describe('TTS voice id for narration'),
|
|
296
|
+
captions: z
|
|
297
|
+
.array(z.object({ from_ms: z.number(), to_ms: z.number(), text: z.string() }))
|
|
298
|
+
.optional()
|
|
299
|
+
.describe('Caption cues, written as a .srt next to the video'),
|
|
300
|
+
burn_captions: z.boolean().optional().describe('Burn the captions into the frames (needs an ffmpeg with libass)'),
|
|
301
|
+
out_name: z.string().optional().describe('Filename prefix for the artifact (defaults to the preset name)'),
|
|
302
|
+
});
|
|
264
303
|
/** I4 — voice tools: TTS + transcription (optional installs). */
|
|
265
304
|
const speakSchema = z.object({
|
|
266
305
|
text: z.string().min(1).describe('The text to speak'),
|
|
@@ -438,7 +477,12 @@ export const TOOL_CONTRACT_JSON = `${TOOL_CONTRACT}
|
|
|
438
477
|
TOOL CALL FORMAT (JSON fallback transport):
|
|
439
478
|
When calling a tool, emit its JSON AFTER your response text, in this exact shape:
|
|
440
479
|
{"tool":"<name>","arguments":{...}}
|
|
441
|
-
One tool call per block. The final block may be a suggest_followups call
|
|
480
|
+
One tool call per block. The final block may be a suggest_followups call.
|
|
481
|
+
|
|
482
|
+
FINAL STEP — how a turn ends on this transport:
|
|
483
|
+
End your LAST line with that block for suggest_followups, with the suggestions INSIDE it:
|
|
484
|
+
{"tool":"suggest_followups","arguments":{"followups":[{"prompt":"...","label":"..."},{"prompt":"..."},{"prompt":"..."}]}}
|
|
485
|
+
Options written as prose are NOT a tool call — "Would you like me to: 1. ... 2. ..." leaves the user with nothing to pick, because the choices are read from the block only. Write the answer first, then the block.`;
|
|
442
486
|
// ─── Built-in registration (module load) ────────────────────────────────────
|
|
443
487
|
registerTool({
|
|
444
488
|
name: 'build',
|
|
@@ -657,6 +701,24 @@ registerTool({
|
|
|
657
701
|
`you made (e.g. "I assumed ${picked} — tell me if you would prefer something else"), then continue with it.`) +
|
|
658
702
|
' Do not record it as a user decision or re-ask the same question.');
|
|
659
703
|
}
|
|
704
|
+
// A SHOWN question the user did NOT answer is not an answer.
|
|
705
|
+
//
|
|
706
|
+
// The GUI's skip button and the Cancel/abort path both resolve a pending
|
|
707
|
+
// question with `index: -1` and nothing chosen, and this tool used to fall
|
|
708
|
+
// through to `User answered: ` with an empty tail — telling the model it had
|
|
709
|
+
// the user's word when it had nothing at all. MEASURED (trace
|
|
710
|
+
// `trace-1791996357488-wpm352`, 2026-10-14): a dashboard turn waited 5m02s on
|
|
711
|
+
// an `ask_user`, the user cancelled, and the recorded tool result was
|
|
712
|
+
// `User answered:` — the model was then free to treat an unanswered fork as
|
|
713
|
+
// decided. Nothing is recorded as their decision here, and the model is told
|
|
714
|
+
// what to do instead: state an assumption, or stop.
|
|
715
|
+
if (!picked && !answer.custom) {
|
|
716
|
+
ctx.runTrace?.recordAsk(question, true, '');
|
|
717
|
+
return ('The question was shown and the user did NOT answer it (they skipped it, or the turn was cancelled ' +
|
|
718
|
+
'while it waited). Do not record it as their decision, and do not re-ask the same question. Either pick ' +
|
|
719
|
+
'the option you can defend, say plainly in your answer which one you assumed and why (e.g. "I assumed ' +
|
|
720
|
+
'X — tell me if you want otherwise"), and continue, or stop and name exactly what you need to go on.');
|
|
721
|
+
}
|
|
660
722
|
// ── Grant it, if the user picked the session choice ──────────────────────
|
|
661
723
|
// The grant is stored against the session (the same key the intent envelope
|
|
662
724
|
// uses), so it outlives this turn and dies with the conversation. The write
|
|
@@ -996,7 +1058,7 @@ registerTool({
|
|
|
996
1058
|
registerTool({
|
|
997
1059
|
name: 'generate_image',
|
|
998
1060
|
capability: { effectClass: 'external', reversible: false, grantCategory: 'external' },
|
|
999
|
-
description: 'Generate an image from a text prompt using a bring-your-own-key backend: Google Gemini/Imagen (GEMINI_API_KEY), OpenAI DALL-E/gpt-image (OPENAI_API_KEY), Stability AI (STABILITY_API_KEY), a local ComfyUI/Stable Diffusion (
|
|
1061
|
+
description: 'Generate an image from a text prompt using a bring-your-own-key backend: Google Gemini/Imagen (GEMINI_API_KEY), OpenAI DALL-E/gpt-image (OPENAI_API_KEY), Stability AI (STABILITY_API_KEY), a local ComfyUI/Stable Diffusion (NUVIRA_IMAGE_API_URL), or the free keyless Pollinations.ai fallback. The first backend whose key is configured wins (override with `modality.image.provider`), and a failing backend falls back to Pollinations. The image is saved to the sandbox images/ dir and the path is returned. When running in a gateway context (WhatsApp/Telegram/etc.), the image is automatically sent back to the originating channel.',
|
|
1000
1062
|
category: 'workflow',
|
|
1001
1063
|
inputSchema: imageGenSchema,
|
|
1002
1064
|
endsAgentStep: false,
|
|
@@ -1071,7 +1133,7 @@ registerTool({
|
|
|
1071
1133
|
registerTool({
|
|
1072
1134
|
name: 'describe_image',
|
|
1073
1135
|
capability: { effectClass: 'external', reversible: false, grantCategory: 'external' },
|
|
1074
|
-
description: 'Describe an image (local Ollama llava/llama3.2-vision, or free Gemini vision when
|
|
1136
|
+
description: 'Describe an image (local Ollama llava/llama3.2-vision, or free Gemini vision when NUVIRA_GEMINI_API_KEY is set). Use for screenshots, diagrams, or any image the user references.',
|
|
1075
1137
|
category: 'workflow',
|
|
1076
1138
|
inputSchema: describeImageSchema,
|
|
1077
1139
|
endsAgentStep: false,
|
|
@@ -1079,7 +1141,7 @@ registerTool({
|
|
|
1079
1141
|
const parsed = describeImageSchema.parse(args);
|
|
1080
1142
|
const { describeImage, isVisionAvailable } = await import('./modality/vision.js');
|
|
1081
1143
|
if (!(await isVisionAvailable())) {
|
|
1082
|
-
return 'describe_image: unavailable — start Ollama with a vision model (llava) or set
|
|
1144
|
+
return 'describe_image: unavailable — start Ollama with a vision model (llava) or set NUVIRA_GEMINI_API_KEY.';
|
|
1083
1145
|
}
|
|
1084
1146
|
const result = await describeImage(parsed.path, parsed.prompt);
|
|
1085
1147
|
return result.ok ? `describe_image: ${result.description}` : `describe_image: failed — ${result.error}`;
|
|
@@ -2772,6 +2834,42 @@ registerTool({
|
|
|
2772
2834
|
}
|
|
2773
2835
|
}),
|
|
2774
2836
|
});
|
|
2837
|
+
// Motion — animation authored as code, rendered to a real video file.
|
|
2838
|
+
registerTool({
|
|
2839
|
+
name: 'motion_render',
|
|
2840
|
+
capability: { effectClass: 'local-write', reversible: true },
|
|
2841
|
+
description: 'Render an ANIMATED video from code: a self-contained HTML/CSS/SVG animation (html or html_path) or a ready-made scene (preset + data). Use for animated explainers, animated charts of the user\'s own data, kinetic titles and code walkthroughs — the output is deterministic (frames are captured from the animation timeline, not recorded), so a revise re-renders the stored source. Needs chromium (playwright) and ffmpeg; a missing one is named with its install command. Optional narration is synthesized locally and muxed in; captions are written as .srt. The video is saved to the sandbox motion/ dir and, in a gateway context, sent back to the originating channel.',
|
|
2842
|
+
category: 'workflow',
|
|
2843
|
+
inputSchema: motionRenderSchema,
|
|
2844
|
+
endsAgentStep: false,
|
|
2845
|
+
run: async (args, ctx) => {
|
|
2846
|
+
const parsed = motionRenderSchema.parse(args);
|
|
2847
|
+
const { runMotionTool } = await import('./modality/motion-tool.js');
|
|
2848
|
+
const result = await runMotionTool(parsed, ctx);
|
|
2849
|
+
if (result.media) {
|
|
2850
|
+
// Same artifact path as generate_image/speak: a render is a deliverable, so
|
|
2851
|
+
// the dashboard's Artifacts tab can show (and re-open) it.
|
|
2852
|
+
recordArtifact(ctx?.artifacts, {
|
|
2853
|
+
kind: 'media',
|
|
2854
|
+
title: result.media.title,
|
|
2855
|
+
path: result.media.path,
|
|
2856
|
+
mime: result.media.mime,
|
|
2857
|
+
});
|
|
2858
|
+
if (result.sidecar) {
|
|
2859
|
+
recordArtifact(ctx?.artifacts, {
|
|
2860
|
+
kind: 'file',
|
|
2861
|
+
title: result.sidecar.title,
|
|
2862
|
+
path: result.sidecar.path,
|
|
2863
|
+
mime: result.sidecar.mime,
|
|
2864
|
+
});
|
|
2865
|
+
}
|
|
2866
|
+
const caption = parsed.title ?? parsed.narration ?? undefined;
|
|
2867
|
+
const delivered = await tryAutoDeliver(result.media.path, caption, ctx, 'video');
|
|
2868
|
+
return `${result.text}${delivered}`;
|
|
2869
|
+
}
|
|
2870
|
+
return result.text;
|
|
2871
|
+
},
|
|
2872
|
+
});
|
|
2775
2873
|
// Voice mode tool
|
|
2776
2874
|
registerTool({
|
|
2777
2875
|
name: 'voice_mode',
|