@qvac/harness 0.2.6 → 0.2.8
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/.claude/skills/gh-stack/SKILL.md +24 -24
- package/.claude/skills/gh-stack/references/commands.md +2 -2
- package/.claude/skills/js-house-style/SKILL.md +89 -68
- package/.claude/skills/kvcache/SKILL.md +7 -7
- package/.claude/skills/pr-create/SKILL.md +58 -15
- package/.claude/skills/pr-review/SKILL.md +307 -41
- package/CLAUDE.md +3 -0
- package/README.md +26 -4
- package/dist/harness.bundle +12 -10
- package/dist-lib/index.js +58 -58
- package/dist-lib/lib/audio-transcode-bare.js +2 -2
- package/dist-lib/lib/capabilities/completion.js +30 -30
- package/dist-lib/lib/capabilities/download.js +2 -2
- package/dist-lib/lib/capabilities/speech-text.js +1 -1
- package/dist-lib/lib/capabilities/tool-prompt-log.js +1 -1
- package/dist-lib/lib/capabilities/tool-selection.js +2 -2
- package/dist-lib/lib/capabilities/tool-turns.js +1 -1
- package/dist-lib/lib/capabilities/usage-breakdown.js +1 -1
- package/dist-lib/lib/capabilities/voice.js +3 -3
- package/dist-lib/lib/connect.js +11 -11
- package/dist-lib/lib/context-window.js +1 -1
- package/dist-lib/lib/docx/index.d.ts +5 -0
- package/dist-lib/lib/docx/index.js +49 -0
- package/dist-lib/lib/hardware/capability-probe.js +3 -3
- package/dist-lib/lib/hardware/gpu-probe-addon.js +2 -2
- package/dist-lib/lib/hardware/gpu-probe-entry.js +1 -1
- package/dist-lib/lib/helpers/markup-stream-filter.js +1 -1
- package/dist-lib/lib/helpers/run-outcome.js +1 -1
- package/dist-lib/lib/helpers/spawn-path.d.ts +1 -1
- package/dist-lib/lib/helpers/thinking.js +2 -2
- package/dist-lib/lib/helpers/tool-intent.js +1 -1
- package/dist-lib/lib/helpers/tool-label.js +3 -3
- package/dist-lib/lib/hooks/built-in/arg-repair.d.ts +1 -1
- package/dist-lib/lib/hooks/built-in/arg-repair.js +1 -1
- package/dist-lib/lib/hooks/built-in/egress.d.ts +1 -1
- package/dist-lib/lib/hooks/built-in/egress.js +2 -2
- package/dist-lib/lib/hooks/built-in/index.js +3 -3
- package/dist-lib/lib/hooks/built-in/skill-catalog.d.ts +1 -1
- package/dist-lib/lib/hooks/pipeline.js +4 -4
- package/dist-lib/lib/hooks/registry.js +1 -1
- package/dist-lib/lib/hooks/run.js +1 -1
- package/dist-lib/lib/models/model-catalog.js +4 -4
- package/dist-lib/lib/models/model-delete.js +1 -1
- package/dist-lib/lib/models/model-handle.js +1 -1
- package/dist-lib/lib/models/model-list.js +1 -1
- package/dist-lib/lib/models/model-pool.js +8 -8
- package/dist-lib/lib/models/model-source.js +1 -1
- package/dist-lib/lib/models/music-catalog.d.ts +1 -1
- package/dist-lib/lib/no-redirect-fetch-bare.js +3 -3
- package/dist-lib/lib/no-redirect-fetch-impl.js +1 -1
- package/dist-lib/lib/no-redirect-fetch-node.js +2 -2
- package/dist-lib/lib/resolution-detector.js +1 -1
- package/dist-lib/lib/sdk-loader.js +2 -2
- package/dist-lib/lib/sdk-storage.js +1 -1
- package/dist-lib/lib/serve.js +10 -10
- package/dist-lib/lib/spawn.js +3 -3
- package/dist-lib/lib/staging.js +1 -1
- package/dist-lib/lib/tools/catalog.js +1 -1
- package/dist-lib/lib/tools/create-documents.js +2 -2
- package/dist-lib/lib/tools/edit-documents.js +2 -2
- package/dist-lib/lib/tools/edit-image.js +2 -2
- package/dist-lib/lib/tools/exec/adapters/python/attachments.js +2 -2
- package/dist-lib/lib/tools/exec/adapters/python/create-effect.js +1 -1
- package/dist-lib/lib/tools/exec/adapters/python/loader.js +1 -1
- package/dist-lib/lib/tools/exec/adapters/python/memfs.js +2 -2
- package/dist-lib/lib/tools/exec/adapters/python/pyodide.js +8 -6
- package/dist-lib/lib/tools/exec/adapters/python/python-adapter.js +3 -3
- package/dist-lib/lib/tools/exec/adapters/python/run-session.js +5 -5
- package/dist-lib/lib/tools/exec/adapters/python/wheels.js +3 -2
- package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +4 -4
- package/dist-lib/lib/tools/exec/adapters/python/worker/entry.js +4 -4
- package/dist-lib/lib/tools/exec/adapters/shell/shell-adapter.js +1 -1
- package/dist-lib/lib/tools/exec/obsidian/cli-process.js +2 -2
- package/dist-lib/lib/tools/exec/obsidian/cli.js +4 -4
- package/dist-lib/lib/tools/exec/obsidian/command.js +1 -1
- package/dist-lib/lib/tools/exec/obsidian/route.js +7 -7
- package/dist-lib/lib/tools/exec/obsidian/vault-create.js +2 -2
- package/dist-lib/lib/tools/exec/obsidian/vault-fs.js +6 -6
- package/dist-lib/lib/tools/exec/obsidian/vault-paths.js +2 -2
- package/dist-lib/lib/tools/exec/obsidian/vault-read.js +1 -1
- package/dist-lib/lib/tools/exec/obsidian/vault-write.js +2 -2
- package/dist-lib/lib/tools/exec/runner.js +1 -1
- package/dist-lib/lib/tools/exec.js +13 -13
- package/dist-lib/lib/tools/file-glob.js +3 -3
- package/dist-lib/lib/tools/fs/local.js +1 -1
- package/dist-lib/lib/tools/fs/remote.js +1 -1
- package/dist-lib/lib/tools/fs/walk.js +2 -2
- package/dist-lib/lib/tools/generate-image.js +4 -4
- package/dist-lib/lib/tools/generate-music.js +6 -6
- package/dist-lib/lib/tools/grep.js +6 -6
- package/dist-lib/lib/tools/http-request/truncate-response.js +1 -1
- package/dist-lib/lib/tools/http-request.js +9 -9
- package/dist-lib/lib/tools/mcp/utils.js +1 -1
- package/dist-lib/lib/tools/mcp-call.js +8 -8
- package/dist-lib/lib/tools/operations/builders.d.ts +1 -1
- package/dist-lib/lib/tools/operations/builders.js +1 -1
- package/dist-lib/lib/tools/operations/compile.js +1 -1
- package/dist-lib/lib/tools/operations/manifest.d.ts +16 -16
- package/dist-lib/lib/tools/operations/manifest.js +1 -1
- package/dist-lib/lib/tools/outbound-guard.js +1 -1
- package/dist-lib/lib/tools/rag-search.js +1 -1
- package/dist-lib/lib/tools/read-files.js +3 -3
- package/dist-lib/lib/tools/skill.js +8 -8
- package/dist-lib/lib/tools/skills/auth-resolver.js +2 -2
- package/dist-lib/lib/tools/skills/bin-check.js +1 -1
- package/dist-lib/lib/tools/skills/bundled-dir.js +2 -2
- package/dist-lib/lib/tools/skills/catalog.js +10 -10
- package/dist-lib/lib/tools/skills/cli-schema-check.js +1 -1
- package/dist-lib/lib/tools/skills/cli-schema-load.js +1 -1
- package/dist-lib/lib/tools/skills/cli-schema.js +4 -4
- package/dist-lib/lib/tools/skills/credential-check.js +3 -3
- package/dist-lib/lib/tools/skills/credential-grants.js +1 -1
- package/dist-lib/lib/tools/skills/credential-health.js +2 -2
- package/dist-lib/lib/tools/skills/frontmatter-parser.js +1 -1
- package/dist-lib/lib/tools/skills/index.js +5 -5
- package/dist-lib/lib/tools/skills/mention.js +1 -1
- package/dist-lib/lib/tools/skills/overlay-crud.js +1 -1
- package/dist-lib/lib/tools/skills/setup-routes.js +1 -1
- package/dist-lib/lib/tools/skills/skill-settings.js +1 -1
- package/dist-lib/lib/tools/skills/skill-state-constants.d.ts +8 -8
- package/dist-lib/lib/tools/skills/skill-state.js +9 -9
- package/dist-lib/lib/tools/toolsets.d.ts +1 -1
- package/dist-lib/lib/tools/url-guard.js +2 -2
- package/dist-lib/lib/tools/weather-lookup/place.d.ts +11 -0
- package/dist-lib/lib/tools/weather-lookup/place.js +152 -0
- package/dist-lib/lib/tools/weather-lookup/report.d.ts +37 -0
- package/dist-lib/lib/tools/weather-lookup/report.js +56 -0
- package/dist-lib/lib/tools/weather-lookup.d.ts +8 -0
- package/dist-lib/lib/tools/weather-lookup.js +110 -0
- package/dist-lib/lib/tools/web-fetch.js +10 -10
- package/dist-lib/lib/tools/web-search.js +2 -2
- package/dist-lib/lib/transport.js +1 -1
- package/dist-lib/lib/validating-lookup.js +1 -1
- package/dist-lib/lib/web-fetch/embedded-state.js +1 -1
- package/dist-lib/lib/web-fetch/extract.js +1 -1
- package/dist-lib/lib/web-fetch/images.js +1 -1
- package/dist-lib/lib/web-fetch/video.js +1 -1
- package/dist-lib/lib/web-search/engine-registry.js +7 -7
- package/dist-lib/lib/web-search/engines/aol.js +3 -3
- package/dist-lib/lib/web-search/engines/bing.js +4 -4
- package/dist-lib/lib/web-search/engines/brave.js +2 -2
- package/dist-lib/lib/web-search/engines/duckduckgo.js +3 -3
- package/dist-lib/lib/web-search/engines/google.js +4 -4
- package/dist-lib/lib/web-search/engines/wikipedia.js +2 -2
- package/dist-lib/lib/web-search/engines/yahoo.js +3 -3
- package/dist-lib/lib/web-search/fetch-html.js +1 -1
- package/dist-lib/lib/web-search/merge-results.js +1 -1
- package/dist-lib/lib/web-search/orchestrator.js +3 -3
- package/dist-lib/schema/baseline.js +1 -1
- package/dist-lib/schema/build.js +3 -3
- package/dist-lib/schema/release-tags.d.ts +2 -1
- package/dist-lib/schema/release-tags.js +9 -7
- package/docs/decisions/2026-05-29-kvcache-tool-turns.md +75 -0
- package/docs/decisions/2026-06-02-kvcache-tool-turns-reenabled.md +127 -0
- package/docs/decisions/2026-06-23-android-cpu-llm-defaults.md +126 -0
- package/docs/decisions/2026-07-29-assistant-owned-storage-layout.md +88 -0
- package/docs/decisions/2026-08-04-sidecar-orphan-reaping.md +79 -0
- package/docs/decisions/2026-08-11-pyodide-worker-thread.md +68 -0
- package/docs/decisions/2026-08-17-harness-hook-pipeline.md +84 -0
- package/docs/decisions/2026-08-17-harness-outbound-egress-guard.md +176 -0
- package/docs/decisions/2026-08-20-chat-prompt-prefix-is-stable.md +95 -0
- package/docs/decisions/2026-08-20-kvcache-static-placement.md +109 -0
- package/docs/decisions/2026-08-21-vendored-python-wheels.md +85 -0
- package/docs/decisions/2026-08-26-exec-is-not-gated-by-skills.md +64 -0
- package/docs/decisions/2026-08-27-writable-skills-overlay.md +56 -0
- package/docs/decisions/2026-09-01-skill-operation-manifests.md +53 -0
- package/docs/decisions/2026-09-01-usage-breakdown-is-measured.md +78 -0
- package/docs/decisions/2026-09-03-usage-breakdown-reported-by-the-harness.md +136 -0
- package/docs/decisions/2026-09-10-skill-wording-is-measured-offline.md +63 -0
- package/docs/decisions/2026-09-16-a-lookup-reports-the-place-it-resolved.md +70 -0
- package/docs/decisions/INDEX.md +40 -0
- package/docs/decisions/TEMPLATE.md +32 -0
- package/package.json +21 -4
- package/worker/harness-sidecar.mjs +2 -0
package/dist-lib/index.js
CHANGED
|
@@ -2,65 +2,65 @@ import fs from 'fs';
|
|
|
2
2
|
import { platform, totalmem } from 'os';
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import ReadyResource from 'ready-resource';
|
|
5
|
-
import { probeGpuStats } from
|
|
6
|
-
import { probeCapabilityProfile } from
|
|
7
|
-
import { closePythonWorker } from
|
|
8
|
-
import { completion } from
|
|
9
|
-
import { download } from
|
|
10
|
-
import { createEmbedLane } from
|
|
11
|
-
import { deleteAllKvCaches, deleteKvCacheKey } from
|
|
12
|
-
import { pcmForTranscription } from
|
|
13
|
-
import { buildWavBuffer } from
|
|
14
|
-
import { createVoiceLane, packSamples, speakOnce, speakStreamOnce, transcribeOnce, transcribeStreaming, SUPERTONIC_SAMPLE_RATE } from
|
|
15
|
-
import { pushQueue } from
|
|
16
|
-
import { AbortedError, raceAbort } from
|
|
17
|
-
import { audioGenDownloadMetadata, customProjectionMap, defaultProjectionMap, defaultTtsFor, defaultVoiceModel, diffusionDownloadMetadata, infraModelsFor, modelNameToCapabilityProfile, musicModelSet, setCustomModels } from
|
|
18
|
-
import { createModelStatusCache, invalidateModelStatusCache, listModels } from
|
|
19
|
-
import { deleteModelFiles, summarizeDelete } from
|
|
20
|
-
import { createEmbedPool, createLoadTracker, createModelPool, createVoicePool, awaitModelCapacity, evictIdle, evictModelWithin, isResident, leaseCount, loadedModels, modelKey, releaseModel, resolveLoadOptions, progressState } from
|
|
21
|
-
import { resolveMainGpu } from
|
|
22
|
-
import { openclCacheDir } from
|
|
23
|
-
import { assertEmbedDevice, createEmbedConfig } from
|
|
24
|
-
import { createGpuFaultState, isSdkGpuDeviceLostError, isSdkModelWedgedError } from
|
|
25
|
-
import { createSdkLoader } from
|
|
26
|
-
import { createEditImageTool } from
|
|
27
|
-
import { toolCatalog } from
|
|
28
|
-
import { createDiffusionRuntime, createGenerateImageTool } from
|
|
29
|
-
import { createGenerateMusicTool, createMusicRuntime } from
|
|
30
|
-
import { availableSkills, detectPlatform, loadSkillCatalog, resolveSkillStatuses, skillSupportsPlatform, versionProbeSkills } from
|
|
31
|
-
import { ensureBundledSkillsDir } from
|
|
32
|
-
import { ensureSkillsOverlayDir } from
|
|
33
|
-
import { copyBaseForEdit, deleteOverlaySkill, listManagedSkills, readSkillFile, writeSkillFile } from
|
|
34
|
-
import { watchSkillsOverlay } from
|
|
35
|
-
import { hlog } from
|
|
5
|
+
import { probeGpuStats } from './lib/hardware/gpu-probe.js';
|
|
6
|
+
import { probeCapabilityProfile } from './lib/hardware/capability-probe.js';
|
|
7
|
+
import { closePythonWorker } from './lib/tools/exec/adapters/python/worker/client.js';
|
|
8
|
+
import { completion } from './lib/capabilities/completion.js';
|
|
9
|
+
import { download } from './lib/capabilities/download.js';
|
|
10
|
+
import { createEmbedLane } from './lib/capabilities/embed.js';
|
|
11
|
+
import { deleteAllKvCaches, deleteKvCacheKey } from './lib/capabilities/kv-cache.js';
|
|
12
|
+
import { pcmForTranscription } from './lib/capabilities/audio-resample.js';
|
|
13
|
+
import { buildWavBuffer } from './lib/wav-encode.js';
|
|
14
|
+
import { createVoiceLane, packSamples, speakOnce, speakStreamOnce, transcribeOnce, transcribeStreaming, SUPERTONIC_SAMPLE_RATE } from './lib/capabilities/voice.js';
|
|
15
|
+
import { pushQueue } from './lib/queue.js';
|
|
16
|
+
import { AbortedError, raceAbort } from './lib/helpers/race-abort.js';
|
|
17
|
+
import { audioGenDownloadMetadata, customProjectionMap, defaultProjectionMap, defaultTtsFor, defaultVoiceModel, diffusionDownloadMetadata, infraModelsFor, modelNameToCapabilityProfile, musicModelSet, setCustomModels } from './lib/models/model-catalog.js';
|
|
18
|
+
import { createModelStatusCache, invalidateModelStatusCache, listModels } from './lib/models/model-list.js';
|
|
19
|
+
import { deleteModelFiles, summarizeDelete } from './lib/models/model-delete.js';
|
|
20
|
+
import { createEmbedPool, createLoadTracker, createModelPool, createVoicePool, awaitModelCapacity, evictIdle, evictModelWithin, isResident, leaseCount, loadedModels, modelKey, releaseModel, resolveLoadOptions, progressState } from './lib/models/model-pool.js';
|
|
21
|
+
import { resolveMainGpu } from './lib/models/gpu-selection.js';
|
|
22
|
+
import { openclCacheDir } from './lib/models/opencl-cache.js';
|
|
23
|
+
import { assertEmbedDevice, createEmbedConfig } from './lib/models/embed-config.js';
|
|
24
|
+
import { createGpuFaultState, isSdkGpuDeviceLostError, isSdkModelWedgedError } from './lib/models/sdk-faults.js';
|
|
25
|
+
import { createSdkLoader } from './lib/sdk-loader.js';
|
|
26
|
+
import { createEditImageTool } from './lib/tools/edit-image.js';
|
|
27
|
+
import { toolCatalog } from './lib/tools/catalog.js';
|
|
28
|
+
import { createDiffusionRuntime, createGenerateImageTool } from './lib/tools/generate-image.js';
|
|
29
|
+
import { createGenerateMusicTool, createMusicRuntime } from './lib/tools/generate-music.js';
|
|
30
|
+
import { availableSkills, detectPlatform, loadSkillCatalog, resolveSkillStatuses, skillSupportsPlatform, versionProbeSkills } from './lib/tools/skills/catalog.js';
|
|
31
|
+
import { ensureBundledSkillsDir } from './lib/tools/skills/bundled-dir.js';
|
|
32
|
+
import { ensureSkillsOverlayDir } from './lib/tools/skills/overlay-dir.js';
|
|
33
|
+
import { copyBaseForEdit, deleteOverlaySkill, listManagedSkills, readSkillFile, writeSkillFile } from './lib/tools/skills/overlay-crud.js';
|
|
34
|
+
import { watchSkillsOverlay } from './lib/tools/skills/overlay-watch.js';
|
|
35
|
+
import { hlog } from './lib/log.js';
|
|
36
36
|
import { harness } from './spec/index.js';
|
|
37
|
-
import { installResolutionDetector, resolutionDetail } from
|
|
38
|
-
import { probeBinVersions } from
|
|
39
|
-
import { bareRuntime } from
|
|
40
|
-
import { runCommand } from
|
|
41
|
-
import { createLocalRoots } from
|
|
42
|
-
import { createRemoteRoots } from
|
|
43
|
-
import { resetCredentialHealth as resetCredentialHealthAfterSnapshot } from
|
|
44
|
-
import { isDeviceSharedCredentialKey, scopeKey } from
|
|
45
|
-
import { settingsScopeKey } from
|
|
46
|
-
export * from
|
|
47
|
-
export { attachmentTurn, loadedSkillsFrom, skillLoadedTurn } from
|
|
48
|
-
export * from
|
|
49
|
-
export * from
|
|
50
|
-
export * from
|
|
51
|
-
export { harnessChild, spawnHarness } from
|
|
52
|
-
export { settingsDimension, settingsSteps } from
|
|
53
|
-
export * from
|
|
54
|
-
export { requiredSettings, settingEnvName } from
|
|
55
|
-
export { TOOLSETS, toolsetEnabled } from
|
|
56
|
-
export { markCredentialRejected, markCredentialValid, recordCredentialHealth, resetAllCredentialHealth, resetCredentialHealth } from
|
|
57
|
-
export { readSetup as normalizeSkillSetup } from
|
|
58
|
-
export { isAvailableState, SKILL_STATE } from
|
|
59
|
-
export { connectHarness, HARNESS_DIED, RemoteHarness } from
|
|
60
|
-
export { serveHarness } from
|
|
61
|
-
export { hlog, setHarnessLog, setHarnessLogSink } from
|
|
62
|
-
export { harnessHooks } from
|
|
63
|
-
export { EgressGuardHook, SkillCatalogGuardHook } from
|
|
37
|
+
import { installResolutionDetector, resolutionDetail } from './lib/resolution-detector.js';
|
|
38
|
+
import { probeBinVersions } from './lib/tools/skills/bin-check.js';
|
|
39
|
+
import { bareRuntime } from './lib/tools/exec.js';
|
|
40
|
+
import { runCommand } from './lib/tools/exec/runner.js';
|
|
41
|
+
import { createLocalRoots } from './lib/tools/fs/local.js';
|
|
42
|
+
import { createRemoteRoots } from './lib/tools/fs/remote.js';
|
|
43
|
+
import { resetCredentialHealth as resetCredentialHealthAfterSnapshot } from './lib/tools/skills/credential-health.js';
|
|
44
|
+
import { isDeviceSharedCredentialKey, scopeKey } from './lib/tools/skills/scope-key.js';
|
|
45
|
+
import { settingsScopeKey } from './lib/tools/skills/skill-settings.js';
|
|
46
|
+
export * from './lib/capabilities/completion.js';
|
|
47
|
+
export { attachmentTurn, loadedSkillsFrom, skillLoadedTurn } from './lib/capabilities/tool-turns.js';
|
|
48
|
+
export * from './lib/capabilities/download.js';
|
|
49
|
+
export * from './lib/models/model-catalog.js';
|
|
50
|
+
export * from './lib/models/model-list.js';
|
|
51
|
+
export { harnessChild, spawnHarness } from './lib/spawn.js';
|
|
52
|
+
export { settingsDimension, settingsSteps } from './lib/tools/generate-image.js';
|
|
53
|
+
export * from './lib/tools/skills/catalog.js';
|
|
54
|
+
export { requiredSettings, settingEnvName } from './lib/tools/skills/skill-settings.js';
|
|
55
|
+
export { TOOLSETS, toolsetEnabled } from './lib/tools/toolsets.js';
|
|
56
|
+
export { markCredentialRejected, markCredentialValid, recordCredentialHealth, resetAllCredentialHealth, resetCredentialHealth } from './lib/tools/skills/credential-health.js';
|
|
57
|
+
export { readSetup as normalizeSkillSetup } from './lib/tools/skills/manifest-parse.js';
|
|
58
|
+
export { isAvailableState, SKILL_STATE } from './lib/tools/skills/skill-state.js';
|
|
59
|
+
export { connectHarness, HARNESS_DIED, RemoteHarness } from './lib/connect.js';
|
|
60
|
+
export { serveHarness } from './lib/serve.js';
|
|
61
|
+
export { hlog, setHarnessLog, setHarnessLogSink } from './lib/log.js';
|
|
62
|
+
export { harnessHooks } from './lib/hooks/registry.js';
|
|
63
|
+
export { EgressGuardHook, SkillCatalogGuardHook } from './lib/hooks/built-in/index.js';
|
|
64
64
|
const HarnessState = harness.getEnum('@harness/state');
|
|
65
65
|
const BIN_VERSION_PROBE_TTL_MS = 45_000;
|
|
66
66
|
const TRANSCRIBE_STREAM_MIN_BYTES = 16_000 * 2 * 60;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ffmpeg from 'bare-ffmpeg';
|
|
2
|
-
import { hlog } from
|
|
3
|
-
import { buildWavBuffer, TARGET_SAMPLE_RATE } from
|
|
2
|
+
import { hlog } from './log.js';
|
|
3
|
+
import { buildWavBuffer, TARGET_SAMPLE_RATE } from './wav-encode.js';
|
|
4
4
|
function bufferReadIO(input) {
|
|
5
5
|
let offset = 0;
|
|
6
6
|
return new ffmpeg.IOContext(Buffer.alloc(4096), {
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
|
-
import { contextCandidates } from
|
|
3
|
-
import { errorCode, errorMessage } from
|
|
4
|
-
import { bufferBurst } from
|
|
5
|
-
import { endsTurn, stopAtControlToken, stripControlTokens, truncateAtControlToken } from
|
|
6
|
-
import { createMarkupStreamFilter } from
|
|
7
|
-
import { AbortedError, raceAbort } from
|
|
8
|
-
import { createRunOutcomeTracker, degenerateAnswer, unnamedWrites, writeReport } from
|
|
9
|
-
import { splitThinking } from
|
|
10
|
-
import { clipRawCall, normalizeToolArgs, recoverMarkupToolCalls, recoverPrintedSkillLoad, recoverSkillNamedCall, stripToolCallMarkup, stripToolResponseBlocks, toolCallMarkup } from
|
|
11
|
-
import { INTENT_PARAM, INTENT_PARAM_DESCRIPTION, takeToolIntent } from
|
|
12
|
-
import { HookPipeline } from
|
|
13
|
-
import { fallbackToolLabel } from
|
|
14
|
-
import { hlog } from
|
|
15
|
-
import { resolveLlmGenerationParams } from
|
|
16
|
-
import { customToolDialect } from
|
|
17
|
-
import { isContextOverflowError, isSdkModelWedgedError } from
|
|
18
|
-
import { annotateLastUserTime, skillsPromptSection, systemPromptParts } from
|
|
19
|
-
import { isMetadataMethod } from
|
|
20
|
-
import { unquoteArg } from
|
|
21
|
-
import { SKILL_TOOL_NAME, WEB_SEARCH_TOOL_NAME } from
|
|
22
|
-
import { promptUsageParts, usageBreakdown } from
|
|
23
|
-
import { collectToolGrants, enabledTools, isSelected, skillIsActive, skillsAreSelected } from
|
|
24
|
-
import { guardToolCall } from
|
|
25
|
-
import { isAvailableState } from
|
|
26
|
-
import { resolveImplicitSkill, resolveSkillMention, skillPreloadMessage } from
|
|
27
|
-
import { permittedTools } from
|
|
28
|
-
import { promptPrefixHash } from
|
|
29
|
-
import { logToolPrompt } from
|
|
30
|
-
import { DIRECT_CALL_ID, loadedSkillFilesFrom, loadedSkillsFrom, TOOL_CONTINUATION_NUDGE, toolResultTurn, withoutSkillLoadTurns } from
|
|
31
|
-
import { projectVisionHistory, visionHistoryCacheKey } from
|
|
2
|
+
import { contextCandidates } from '../context-window.js';
|
|
3
|
+
import { errorCode, errorMessage } from '../error-fields.js';
|
|
4
|
+
import { bufferBurst } from '../helpers/buffer-burst.js';
|
|
5
|
+
import { endsTurn, stopAtControlToken, stripControlTokens, truncateAtControlToken } from '../helpers/control-tokens.js';
|
|
6
|
+
import { createMarkupStreamFilter } from '../helpers/markup-stream-filter.js';
|
|
7
|
+
import { AbortedError, raceAbort } from '../helpers/race-abort.js';
|
|
8
|
+
import { createRunOutcomeTracker, degenerateAnswer, unnamedWrites, writeReport } from '../helpers/run-outcome.js';
|
|
9
|
+
import { splitThinking } from '../helpers/thinking.js';
|
|
10
|
+
import { clipRawCall, normalizeToolArgs, recoverMarkupToolCalls, recoverPrintedSkillLoad, recoverSkillNamedCall, stripToolCallMarkup, stripToolResponseBlocks, toolCallMarkup } from '../helpers/tool-call-markup.js';
|
|
11
|
+
import { INTENT_PARAM, INTENT_PARAM_DESCRIPTION, takeToolIntent } from '../helpers/tool-intent.js';
|
|
12
|
+
import { HookPipeline } from '../hooks/pipeline.js';
|
|
13
|
+
import { fallbackToolLabel } from '../helpers/tool-label.js';
|
|
14
|
+
import { hlog } from '../log.js';
|
|
15
|
+
import { resolveLlmGenerationParams } from '../models/llm-presets.js';
|
|
16
|
+
import { customToolDialect } from '../models/model-catalog.js';
|
|
17
|
+
import { isContextOverflowError, isSdkModelWedgedError } from '../models/sdk-faults.js';
|
|
18
|
+
import { annotateLastUserTime, skillsPromptSection, systemPromptParts } from '../prompt.js';
|
|
19
|
+
import { isMetadataMethod } from '../tools/mcp/utils.js';
|
|
20
|
+
import { unquoteArg } from '../tools/model-args.js';
|
|
21
|
+
import { SKILL_TOOL_NAME, WEB_SEARCH_TOOL_NAME } from './tool-names.js';
|
|
22
|
+
import { promptUsageParts, usageBreakdown } from './usage-breakdown.js';
|
|
23
|
+
import { collectToolGrants, enabledTools, isSelected, skillIsActive, skillsAreSelected } from './tool-selection.js';
|
|
24
|
+
import { guardToolCall } from '../tools/outbound-guard.js';
|
|
25
|
+
import { isAvailableState } from '../tools/skills/skill-state-constants.js';
|
|
26
|
+
import { resolveImplicitSkill, resolveSkillMention, skillPreloadMessage } from '../tools/skills/mention.js';
|
|
27
|
+
import { permittedTools } from '../tools/toolsets.js';
|
|
28
|
+
import { promptPrefixHash } from './prompt-prefix.js';
|
|
29
|
+
import { logToolPrompt } from './tool-prompt-log.js';
|
|
30
|
+
import { DIRECT_CALL_ID, loadedSkillFilesFrom, loadedSkillsFrom, TOOL_CONTINUATION_NUDGE, toolResultTurn, withoutSkillLoadTurns } from './tool-turns.js';
|
|
31
|
+
import { projectVisionHistory, visionHistoryCacheKey } from './vision-history.js';
|
|
32
32
|
export function imageSettingsFrom(agent) {
|
|
33
33
|
if (!agent)
|
|
34
34
|
return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Readable } from 'streamx';
|
|
2
|
-
import { errorMessage } from
|
|
3
|
-
import { resolveModelSrc } from
|
|
2
|
+
import { errorMessage } from '../error-fields.js';
|
|
3
|
+
import { resolveModelSrc } from '../models/model-source.js';
|
|
4
4
|
const noop = () => { };
|
|
5
5
|
export function download(sdkOrLoader, args, onSettled) {
|
|
6
6
|
const { model, addon = 'llm', seed, signal, projection, companions = [], assetSizes } = args;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ascii } from 'asenion';
|
|
2
|
-
import { CURRENCY_CODES, SPEECH_LEXICON } from
|
|
2
|
+
import { CURRENCY_CODES, SPEECH_LEXICON } from './speech-lexicon.js';
|
|
3
3
|
const EMOJI_MODIFIERS = /[\uFE0E\uFE0F\u200D\u{1F3FB}-\u{1F3FF}]/gu;
|
|
4
4
|
const UNSPEAKABLE = /[^\nA-Za-z0-9 .,;:!?'"()\u002D_]/gu;
|
|
5
5
|
export function normalizeForSpeech(text, lang = 'en') {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { harnessLogEnabled, hlog } from
|
|
1
|
+
import { harnessLogEnabled, hlog } from '../log.js';
|
|
2
2
|
export function logToolPrompt({ promptPrefix, modelId, cacheKey, agentId, messageCount, responseFormat, tools = [], definitions, activeSkills, skillsSelected, enabledSkills, mentionedSkill, loadedSkills, toolOps }) {
|
|
3
3
|
if (!harnessLogEnabled())
|
|
4
4
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseToolGrant } from
|
|
2
|
-
import { SKILL_TOOL_NAME, WEB_SEARCH_TOOL_NAME } from
|
|
1
|
+
import { parseToolGrant } from '../tools/skills/tool-grants.js';
|
|
2
|
+
import { SKILL_TOOL_NAME, WEB_SEARCH_TOOL_NAME } from './tool-names.js';
|
|
3
3
|
export function collectToolGrants(skills) {
|
|
4
4
|
const grants = {
|
|
5
5
|
grantedNames: new Set(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SKILL_TOOL_NAME } from
|
|
1
|
+
import { SKILL_TOOL_NAME } from './tool-names.js';
|
|
2
2
|
export const DIRECT_CALL_ID = 'call-direct';
|
|
3
3
|
export const TOOL_CONTINUATION_NUDGE = "[Tool results above. Continue the user's request: call the next tool, or answer.]";
|
|
4
4
|
export function toolResultTurn(name, id, output) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { detectToolDialect } from
|
|
1
|
+
import { detectToolDialect } from '../models/tool-dialect.js';
|
|
2
2
|
const QWEN35 = { prose: 4.38, schema: 4.08, toolBlockTokens: 189 };
|
|
3
3
|
const DENSITY_BY_DIALECT = new Map([['qwen35', QWEN35]]);
|
|
4
4
|
export function densityFor(modelName) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import b4a from 'b4a';
|
|
2
|
-
import { AbortedError } from
|
|
3
|
-
import { hlog } from
|
|
4
|
-
import { normalizeForSpeech } from
|
|
2
|
+
import { AbortedError } from '../helpers/race-abort.js';
|
|
3
|
+
import { hlog } from '../log.js';
|
|
4
|
+
import { normalizeForSpeech } from './speech-text.js';
|
|
5
5
|
export const SUPERTONIC_SAMPLE_RATE = 44100;
|
|
6
6
|
export function createVoiceLane() {
|
|
7
7
|
let tail = Promise.resolve();
|
package/dist-lib/lib/connect.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import EventEmitter from 'events';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import { settleOnClose } from
|
|
3
|
+
import { settleOnClose } from './rpc-session.js';
|
|
4
4
|
import { harnessClient } from '../spec/calls.js';
|
|
5
5
|
import HRPC from '../spec/hrpc/index.js';
|
|
6
|
-
import { unsupportedKvCacheDeletion } from
|
|
7
|
-
import { hlog } from
|
|
8
|
-
import { assertEmbedDevice } from
|
|
9
|
-
import { errorCode, errorMessage } from
|
|
10
|
-
import { pushQueue } from
|
|
11
|
-
import { stageFile, sweepStaging } from
|
|
12
|
-
import { readInstall, readSetup } from
|
|
13
|
-
import { SKILL_STATE } from
|
|
14
|
-
import { asToolset } from
|
|
15
|
-
import { fromDownloadWire, fromWire, unpackVectors } from
|
|
6
|
+
import { unsupportedKvCacheDeletion } from './capabilities/kv-cache.js';
|
|
7
|
+
import { hlog } from './log.js';
|
|
8
|
+
import { assertEmbedDevice } from './models/embed-config.js';
|
|
9
|
+
import { errorCode, errorMessage } from './error-fields.js';
|
|
10
|
+
import { pushQueue } from './queue.js';
|
|
11
|
+
import { stageFile, sweepStaging } from './staging.js';
|
|
12
|
+
import { readInstall, readSetup } from './tools/skills/manifest-parse.js';
|
|
13
|
+
import { SKILL_STATE } from './tools/skills/skill-state.js';
|
|
14
|
+
import { asToolset } from './tools/toolsets.js';
|
|
15
|
+
import { fromDownloadWire, fromWire, unpackVectors } from './wire.js';
|
|
16
16
|
export const HARNESS_DIED = 'HARNESS_DIED';
|
|
17
17
|
export function connectHarness(transport) {
|
|
18
18
|
return new RemoteHarness(transport);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOOL_CONTINUATION_NUDGE } from
|
|
1
|
+
import { TOOL_CONTINUATION_NUDGE } from './capabilities/tool-turns.js';
|
|
2
2
|
export const TOOL_RESULT_TRUNCATION_MARKER = '\n[tool result truncated for context]\n';
|
|
3
3
|
function isTurnBoundary(message) {
|
|
4
4
|
return message.role === 'user' && message.content !== TOOL_CONTINUATION_NUDGE;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AbortSignal } from 'bare-abort-controller';
|
|
2
|
+
export { closePythonWorker as closeDocxWorker } from '../tools/exec/adapters/python/worker/client.ts';
|
|
3
|
+
export declare function extractDocxText(bytes: Uint8Array, fileName: string, options?: {
|
|
4
|
+
readonly signal?: AbortSignal;
|
|
5
|
+
}): Promise<string>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import b4a from 'b4a';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import { runPython } from '../tools/exec/adapters/python/pyodide.js';
|
|
4
|
+
import { planVendoredInstall, vendoredManifest, wheelsDir } from '../tools/exec/adapters/python/wheels.js';
|
|
5
|
+
export { closePythonWorker as closeDocxWorker } from '../tools/exec/adapters/python/worker/client.js';
|
|
6
|
+
const MAX_OFFICE_BYTES = 20 * 1024 * 1024;
|
|
7
|
+
const PACKAGES = ['python-docx==1.2.0'];
|
|
8
|
+
const EXTRACT = `from docx import Document
|
|
9
|
+
from docx.text.paragraph import Paragraph
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
def text(container):
|
|
13
|
+
for block in container.iter_inner_content():
|
|
14
|
+
if isinstance(block, Paragraph):
|
|
15
|
+
if block.text.strip():
|
|
16
|
+
yield block.text
|
|
17
|
+
else:
|
|
18
|
+
for row in block.rows:
|
|
19
|
+
yield " | ".join(" ".join(text(cell)) for cell in row.cells)
|
|
20
|
+
|
|
21
|
+
Path("extracted.txt").write_text("\\n".join(text(Document("input.docx"))), encoding="utf-8")
|
|
22
|
+
`;
|
|
23
|
+
export async function extractDocxText(bytes, fileName, options = {}) {
|
|
24
|
+
if (bytes.byteLength > MAX_OFFICE_BYTES) {
|
|
25
|
+
throw new Error(`document is too large to extract: ${bytes.byteLength} bytes, limit ${MAX_OFFICE_BYTES}`);
|
|
26
|
+
}
|
|
27
|
+
const dir = wheelsDir();
|
|
28
|
+
const manifest = vendoredManifest(dir);
|
|
29
|
+
const install = planVendoredInstall(PACKAGES, { dir, manifest });
|
|
30
|
+
if (!dir ||
|
|
31
|
+
!manifest ||
|
|
32
|
+
!install ||
|
|
33
|
+
!['micropip', ...install.packages].every((name) => Object.keys(manifest.files).some((file) => file.replaceAll('_', '-').startsWith(`${name}-`) && fs.existsSync(`${dir}/${file}`)))) {
|
|
34
|
+
throw new Error('bundled DOCX extraction packages are unavailable');
|
|
35
|
+
}
|
|
36
|
+
const result = await runPython(EXTRACT, {
|
|
37
|
+
packages: PACKAGES,
|
|
38
|
+
inputs: [{ path: 'input.docx', bytes }],
|
|
39
|
+
outputs: ['extracted.txt'],
|
|
40
|
+
signal: options.signal
|
|
41
|
+
});
|
|
42
|
+
if (result.exitCode !== 0)
|
|
43
|
+
throw new Error(`${fileName}: ${result.stderr.trim()}`);
|
|
44
|
+
const output = result.files?.get('extracted.txt');
|
|
45
|
+
if (!output) {
|
|
46
|
+
throw new Error(result.rejected?.[0]?.reason ?? 'DOCX extraction produced no text file');
|
|
47
|
+
}
|
|
48
|
+
return b4a.toString(output, 'utf8');
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
|
-
import { capabilityProfileToModelName } from
|
|
3
|
-
import { probeWithAddon } from
|
|
4
|
-
import { mobileBudget, parseNvidiaSmiOutput, parseRocmSmiOutput, parseWindowsRegistryOutput, sharedRamBudget } from
|
|
2
|
+
import { capabilityProfileToModelName } from '../models/model-catalog.js';
|
|
3
|
+
import { probeWithAddon } from './gpu-probe-addon.js';
|
|
4
|
+
import { mobileBudget, parseNvidiaSmiOutput, parseRocmSmiOutput, parseWindowsRegistryOutput, sharedRamBudget } from './parsers.js';
|
|
5
5
|
const GIB = 1024 * 1024 * 1024;
|
|
6
6
|
const WINDOWS_REGISTRY_QUERY = "(Get-ItemProperty 'HKLM:\\SYSTEM\\ControlSet001\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0*' -Name 'HardwareInformation.qwMemorySize' -ErrorAction SilentlyContinue).'HardwareInformation.qwMemorySize' | Sort-Object -Descending | Select-Object -First 1";
|
|
7
7
|
const SYSFS_VRAM_PATHS = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { classifyGpu } from
|
|
3
|
-
import { IGPU_LIE_THRESHOLD, sharedRamBudget } from
|
|
2
|
+
import { classifyGpu } from './gpu-classify.js';
|
|
3
|
+
import { IGPU_LIE_THRESHOLD, sharedRamBudget } from './parsers.js';
|
|
4
4
|
const GpuDeviceSchema = z.object({
|
|
5
5
|
name: z.string(),
|
|
6
6
|
videoMemoryBytes: z.number()
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { runGpuProbeIfRequested } from
|
|
1
|
+
import { runGpuProbeIfRequested } from './gpu-probe.js';
|
|
2
2
|
runGpuProbeIfRequested();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { firstMarker } from 'asenion/guards';
|
|
2
2
|
import { holdback } from 'asenion/scan';
|
|
3
|
-
import { createJoinGuard } from
|
|
3
|
+
import { createJoinGuard } from './join-guard.js';
|
|
4
4
|
const MARKUP_OPENERS = ['<tool_call>', '<function=', '<tool_response>'];
|
|
5
5
|
const MARKUP_CLOSERS = {
|
|
6
6
|
'<tool_call>': '</tool_call>',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TOOL_CONTINUATION_NUDGE } from
|
|
1
|
+
import { TOOL_CONTINUATION_NUDGE } from '../capabilities/tool-turns.js';
|
|
2
2
|
export const DEGENERATE_ANSWER_FALLBACK = "I couldn't complete that step and don't have a useful result to share.";
|
|
3
3
|
export const ROUND_CAP_ANSWER = "I ran out of steps before I could finish that. Ask me to continue and I'll pick up where I left off.";
|
|
4
4
|
export const SEARCH_CAPPED_ANSWER = "I searched the web but couldn't find the answer in the results I got.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const HOMEBREW_BIN_DIRS: readonly string[];
|
|
2
2
|
export declare function withHomebrewPath(path: string | undefined, platformName: string): string | undefined;
|
|
3
|
-
export declare const EXEC_ENV_ALLOWLIST: readonly [
|
|
3
|
+
export declare const EXEC_ENV_ALLOWLIST: readonly ['PATH', 'HOME', 'TMPDIR', 'TMP', 'TEMP', 'LANG', 'LC_ALL', 'LC_CTYPE', 'TZ', 'USER', 'LOGNAME', 'HTTP_PROXY', 'http_proxy', 'HTTPS_PROXY', 'https_proxy', 'ALL_PROXY', 'all_proxy', 'NO_PROXY', 'no_proxy', 'SSL_CERT_FILE', 'SSL_CERT_DIR', 'CURL_CA_BUNDLE', 'REQUESTS_CA_BUNDLE', 'NODE_EXTRA_CA_CERTS'];
|
|
4
4
|
export declare function execEnv(env: Readonly<Record<string, string | undefined>>, platformName: string): Record<string, string>;
|
|
5
5
|
export declare function spawnEnv(env: Readonly<Record<string, string | undefined>>, platformName: string, overrides?: Readonly<Record<string, string>>): Record<string, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { firstMarker } from 'asenion/guards';
|
|
2
2
|
import { holdback } from 'asenion/scan';
|
|
3
|
-
import { STOP_MARKERS } from
|
|
4
|
-
import { createJoinGuard } from
|
|
3
|
+
import { STOP_MARKERS } from './control-tokens.js';
|
|
4
|
+
import { createJoinGuard } from './join-guard.js';
|
|
5
5
|
const OPEN_TAGS = ['<think>', '<thinking>'];
|
|
6
6
|
const CLOSE_TAGS = ['</think>', '</thinking>'];
|
|
7
7
|
const ALL_TAGS = [...OPEN_TAGS, ...CLOSE_TAGS];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { stripControlTokens } from
|
|
1
|
+
import { stripControlTokens } from './control-tokens.js';
|
|
2
2
|
export const INTENT_PARAM = 'intent';
|
|
3
3
|
export const INTENT_PARAM_DESCRIPTION = 'One short sentence, addressed to the user, saying plainly what this call will ' +
|
|
4
4
|
'do for them — the outcome, never the code. It is the only thing the approval ' +
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { unwrap } from 'asenion';
|
|
2
|
-
import { SKILL_TOOL_NAME } from
|
|
3
|
-
import { unquoteArg } from
|
|
4
|
-
import { stripControlTokens } from
|
|
2
|
+
import { SKILL_TOOL_NAME } from '../capabilities/tool-names.js';
|
|
3
|
+
import { unquoteArg } from '../tools/model-args.js';
|
|
4
|
+
import { stripControlTokens } from './control-tokens.js';
|
|
5
5
|
const MAX_LABEL_WORDS = 6;
|
|
6
6
|
const MAX_LABEL_LENGTH = 60;
|
|
7
7
|
const MAX_DESCRIPTION_LENGTH = 200;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mcpTargetUrl } from
|
|
2
|
-
import { checkOutboundHost } from
|
|
1
|
+
import { mcpTargetUrl } from '../../tools/mcp-call.js';
|
|
2
|
+
import { checkOutboundHost } from '../../tools/url-guard.js';
|
|
3
3
|
export class EgressGuardHook {
|
|
4
4
|
phase = 'preToolCall';
|
|
5
5
|
run(ctx) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ArgRepairHook } from
|
|
2
|
-
export { EgressGuardHook } from
|
|
3
|
-
export { SkillCatalogGuardHook } from
|
|
1
|
+
export { ArgRepairHook } from './arg-repair.js';
|
|
2
|
+
export { EgressGuardHook } from './egress.js';
|
|
3
|
+
export { SkillCatalogGuardHook } from './skill-catalog.js';
|
|
@@ -2,7 +2,7 @@ import type { SkillCatalogEntry } from '../../tools/skills/catalog.ts';
|
|
|
2
2
|
import type { HarnessHook, HookContext, HookResult } from '../types.ts';
|
|
3
3
|
type SkillCatalogInput = readonly SkillCatalogEntry[] | (() => readonly SkillCatalogEntry[] | readonly string[]);
|
|
4
4
|
export declare class SkillCatalogGuardHook implements HarnessHook {
|
|
5
|
-
readonly phase:
|
|
5
|
+
readonly phase: 'preToolCall';
|
|
6
6
|
private readonly _catalog;
|
|
7
7
|
constructor(catalog?: SkillCatalogInput);
|
|
8
8
|
run(ctx: HookContext): HookResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { hlog } from
|
|
2
|
-
import { normalizeToolExecutionOutcome } from
|
|
3
|
-
import { harnessHooks } from
|
|
4
|
-
import { runHooks } from
|
|
1
|
+
import { hlog } from '../log.js';
|
|
2
|
+
import { normalizeToolExecutionOutcome } from '../helpers/run-outcome.js';
|
|
3
|
+
import { harnessHooks } from './registry.js';
|
|
4
|
+
import { runHooks } from './run.js';
|
|
5
5
|
export class HookPipeline {
|
|
6
6
|
_behaviorHooks;
|
|
7
7
|
constructor(hooks = harnessHooks) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AUDIOGEN_ACESTEP_5HZ_LM_0_6B_Q8_0, AUDIOGEN_ACESTEP_V15_SFT_Q8_0, AUDIOGEN_ACESTEP_V15_TURBO_Q4_K_M, AUDIOGEN_ACESTEP_V15_TURBO_Q8_0, AUDIOGEN_QWEN3_EMBEDDING_0_6B_Q8_0, AUDIOGEN_VAE_BF16, EMBEDDINGGEMMA_300M_Q4_0, FLUX_2_KLEIN_4B_Q4_0, FLUX_2_KLEIN_4B_VAE, HEALTHCARE_1_7B_MEDICAL_Q4_K_M, HEALTHCARE_4B_MEDICAL_Q4_K_M, MMPROJ_QWEN3_5_2B_MULTIMODAL_Q8_0, MMPROJ_QWEN3_5_4B_MULTIMODAL_Q8_0, MMPROJ_QWEN3_5_9B_MULTIMODAL_F16, MMPROJ_QWEN3_6_27B_MULTIMODAL_F16, MMPROJ_QWEN3_6_35B_A3B_MULTIMODAL_F16, MMPROJ_QWEN3_8_27B_MULTIMODAL_F16, QWEN3_5_2B_MULTIMODAL_Q4_K_M, QWEN3_5_4B_MULTIMODAL_Q4_K_M, QWEN3_5_9B_MULTIMODAL_Q4_K_M, PARAKEET_TDT_0_6B_V3_Q8_0, QWEN3_4B_Q4_K_M, QWEN3_6_27B_MULTIMODAL_Q4_K_XL, QWEN3_6_35B_A3B_MULTIMODAL_Q4_K_M, QWEN3_8_27B_MULTIMODAL_UD_Q4_K_XL, SD_V2_1_1B_Q8_0, SDXL_BASE_1_0_3B_Q4_0, TTS_MULTILINGUAL_SUPERTONIC3_Q4_0, TTS_MULTILINGUAL_SUPERTONIC3_Q8_0 } from '@qvac/sdk/models';
|
|
2
|
-
import { detectToolDialect } from
|
|
3
|
-
import { defaultTtsModelName } from
|
|
4
|
-
import { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG } from
|
|
2
|
+
import { detectToolDialect } from './tool-dialect.js';
|
|
3
|
+
import { defaultTtsModelName } from './tts-model-default.js';
|
|
4
|
+
import { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG } from './model-catalog-constants.js';
|
|
5
5
|
export { CAPABILITY_PROFILE_ORDER, QWEN_35_2B, QWEN_35_4B, QWEN_35_9B, QWEN_36_27B, QWEN_36_35B_A3B, QWEN_38_27B, MEDPSY_1_7B, MEDPSY_4B, isCapabilityProfile, meetsMinCapabilityProfile, modelNameToCapabilityProfile, capabilityProfileToModelName, isMultimodalLlm, AGENT_MODEL_NAMES, modelDisplayName, capabilityProfileModelLabel, DEFAULT_IMAGE_MODEL_CHOICE, IMAGE_CHOICE_CATALOG };
|
|
6
6
|
export const LLM_CATALOG = [
|
|
7
7
|
{
|
|
@@ -153,7 +153,7 @@ export function diffusionDownloadMetadata(model, addon) {
|
|
|
153
153
|
assetSizes
|
|
154
154
|
};
|
|
155
155
|
}
|
|
156
|
-
import { DEFAULT_MUSIC_MODEL_CHOICE } from
|
|
156
|
+
import { DEFAULT_MUSIC_MODEL_CHOICE } from './music-catalog.js';
|
|
157
157
|
export { DEFAULT_MUSIC_MODEL_CHOICE };
|
|
158
158
|
const MUSIC_GENERATION_SKILL = 'music-generation';
|
|
159
159
|
export const AUDIOGEN_CATALOG = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
|
-
import { curatedListables, musicListables } from
|
|
2
|
+
import { curatedListables, musicListables } from './model-catalog.js';
|
|
3
3
|
export function summarizeDelete(result) {
|
|
4
4
|
return { name: result.name, removed: result.removed.length, freedBytes: result.freedBytes };
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { companionRegistryPaths, curatedListables, musicListables } from
|
|
1
|
+
import { companionRegistryPaths, curatedListables, musicListables } from './model-catalog.js';
|
|
2
2
|
export const MODEL_STATUS_TTL_MS = 30_000;
|
|
3
3
|
export function createModelStatusCache() {
|
|
4
4
|
return { entries: new Map(), epoch: 0 };
|