@qvac/harness 0.2.7 → 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/pr-review/SKILL.md +237 -40
- package/dist/harness.bundle +10 -9
- 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.js +3 -3
- 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 +6 -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 +1 -1
- package/dist-lib/lib/tools/exec/adapters/python/worker/client.js +3 -3
- 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-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 +17 -15
- package/package.json +16 -3
- package/worker/harness-sidecar.mjs +2 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import http, { Agent as HttpAgent } from 'bare-http1';
|
|
2
2
|
import https, { Agent as HttpsAgent } from 'bare-https';
|
|
3
3
|
import * as bareDns from 'bare-dns';
|
|
4
|
-
import { isPrivateOrBlocked } from
|
|
5
|
-
import { makeValidatingLookup } from
|
|
6
|
-
import { runNoRedirectFetch } from
|
|
4
|
+
import { isPrivateOrBlocked } from './tools/private-ip.js';
|
|
5
|
+
import { makeValidatingLookup } from './validating-lookup.js';
|
|
6
|
+
import { runNoRedirectFetch } from './no-redirect-fetch-impl.js';
|
|
7
7
|
export class BlockedHostError extends Error {
|
|
8
8
|
code = 'EBLOCKEDHOST';
|
|
9
9
|
constructor(host) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import b4a from 'b4a';
|
|
2
|
-
import { DEFAULT_USER_AGENT } from
|
|
2
|
+
import { DEFAULT_USER_AGENT } from './user-agent.js';
|
|
3
3
|
const UA_SNIFFING_HOSTS = new Set(['wttr.in']);
|
|
4
4
|
export function runNoRedirectFetch(request, url, init = {}) {
|
|
5
5
|
return new Promise((resolve, reject) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as dns from 'node:dns';
|
|
2
2
|
import * as http from 'node:http';
|
|
3
3
|
import * as https from 'node:https';
|
|
4
|
-
import { isPrivateOrBlocked } from
|
|
5
|
-
import { runNoRedirectFetch } from
|
|
4
|
+
import { isPrivateOrBlocked } from './tools/private-ip.js';
|
|
5
|
+
import { runNoRedirectFetch } from './no-redirect-fetch-impl.js';
|
|
6
6
|
export default function noRedirectFetch(url, init = {}) {
|
|
7
7
|
const request = (target, options, onresponse) => {
|
|
8
8
|
const common = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { retryMemo } from
|
|
2
|
-
import { hlog } from
|
|
1
|
+
import { retryMemo } from './helpers/retry-memo.js';
|
|
2
|
+
import { hlog } from './log.js';
|
|
3
3
|
const defaultImports = {
|
|
4
4
|
sdk: () => import('#sdk'),
|
|
5
5
|
plugins: () => import('@qvac/sdk/plugins'),
|
|
@@ -3,7 +3,7 @@ import { join } from 'path';
|
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import { isBareKit } from 'which-runtime';
|
|
5
5
|
import { installSdkConfigLoader } from '#sdk-config-loader';
|
|
6
|
-
import { SDK_HOME_ENV } from
|
|
6
|
+
import { SDK_HOME_ENV } from './storage.js';
|
|
7
7
|
export const SDK_CONFIG_PATH_ENV = 'QVAC_CONFIG_PATH';
|
|
8
8
|
export const OPENCL_CACHE_DIR_ENV = 'QVAC_OPENCL_CACHE_DIR';
|
|
9
9
|
export function configureSdkStorage(storage, channels = {}) {
|
package/dist-lib/lib/serve.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { AbortController } from 'bare-abort-controller';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import { settleOnClose } from
|
|
3
|
+
import { settleOnClose } from './rpc-session.js';
|
|
4
4
|
import { pipeline, Readable } from 'streamx';
|
|
5
5
|
import { bindApi } from '../spec/bind.js';
|
|
6
6
|
import HRPC from '../spec/hrpc/index.js';
|
|
7
|
-
import { unsupportedKvCacheDeletion } from
|
|
8
|
-
import { errorMessage } from
|
|
9
|
-
import { hlog } from
|
|
10
|
-
import { pushQueue } from
|
|
11
|
-
import { TextCoalescer } from
|
|
12
|
-
import { prepareOpenclCache } from
|
|
13
|
-
import { stageFile, sweepStaging } from
|
|
14
|
-
import { readSetup } from
|
|
15
|
-
import { packVectors, toDownloadWire, toWire } from
|
|
7
|
+
import { unsupportedKvCacheDeletion } from './capabilities/kv-cache.js';
|
|
8
|
+
import { errorMessage } from './error-fields.js';
|
|
9
|
+
import { hlog } from './log.js';
|
|
10
|
+
import { pushQueue } from './queue.js';
|
|
11
|
+
import { TextCoalescer } from './helpers/text-coalescer.js';
|
|
12
|
+
import { prepareOpenclCache } from './models/opencl-cache.js';
|
|
13
|
+
import { stageFile, sweepStaging } from './staging.js';
|
|
14
|
+
import { readSetup } from './tools/skills/manifest-parse.js';
|
|
15
|
+
import { packVectors, toDownloadWire, toWire } from './wire.js';
|
|
16
16
|
const MODEL_STATUSES = new Set([
|
|
17
17
|
'loading',
|
|
18
18
|
'downloading',
|
package/dist-lib/lib/spawn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import stowChild, {} from 'bare-supervisor/stow';
|
|
2
|
-
import { connectHarness } from
|
|
3
|
-
import { setHarnessLog } from
|
|
4
|
-
import { createEmbedConfig } from
|
|
2
|
+
import { connectHarness } from './connect.js';
|
|
3
|
+
import { setHarnessLog } from './log.js';
|
|
4
|
+
import { createEmbedConfig } from './models/embed-config.js';
|
|
5
5
|
export function harnessChild(entry, opts) {
|
|
6
6
|
if (opts.logger)
|
|
7
7
|
setHarnessLog(true);
|
package/dist-lib/lib/staging.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { userTmpPath } from
|
|
3
|
+
import { userTmpPath } from './tmp-path.js';
|
|
4
4
|
export const STAGING_DIR = userTmpPath('qvac-harness-staging');
|
|
5
5
|
export const STAGING_MAX_AGE_MS = 60 * 60 * 1000;
|
|
6
6
|
const noop = () => { };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { canonicalDenyRoots, defaultRealpath, resolveKey } from
|
|
2
|
-
import { writeText } from
|
|
1
|
+
import { canonicalDenyRoots, defaultRealpath, resolveKey } from './fs/scope.js';
|
|
2
|
+
import { writeText } from './fs/write.js';
|
|
3
3
|
function documentRequests(raw) {
|
|
4
4
|
if (!Array.isArray(raw) || raw.length === 0)
|
|
5
5
|
return null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import b4a from 'b4a';
|
|
2
|
-
import { canonicalDenyRoots, defaultRealpath, resolveKey } from
|
|
3
|
-
import { writeText } from
|
|
2
|
+
import { canonicalDenyRoots, defaultRealpath, resolveKey } from './fs/scope.js';
|
|
3
|
+
import { writeText } from './fs/write.js';
|
|
4
4
|
function editRequests(raw) {
|
|
5
5
|
if (!Array.isArray(raw) || raw.length === 0)
|
|
6
6
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { AbortedError } from
|
|
4
|
-
import { BUSY_ERROR, DIM_STEP, effectiveSteps, generationPercentTick, IMAGE_LOAD_STALL_ERROR, normalizeClamps, parseCommonArgs, runDiffusion } from
|
|
3
|
+
import { AbortedError } from '../helpers/race-abort.js';
|
|
4
|
+
import { BUSY_ERROR, DIM_STEP, effectiveSteps, generationPercentTick, IMAGE_LOAD_STALL_ERROR, normalizeClamps, parseCommonArgs, runDiffusion } from './generate-image.js';
|
|
5
5
|
const DEFAULT_STRENGTH = 0.7;
|
|
6
6
|
const FLUX2_GUIDANCE = 3.5;
|
|
7
7
|
const FLUX2_CFG_SCALE = 1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { hlog } from
|
|
4
|
-
import { checkOutputBytes, MAX_INPUT_TOTAL_BYTES, RUN_OUTPUT_BUDGET_BYTES } from
|
|
3
|
+
import { hlog } from '../../../../log.js';
|
|
4
|
+
import { checkOutputBytes, MAX_INPUT_TOTAL_BYTES, RUN_OUTPUT_BUDGET_BYTES } from './output-policy.js';
|
|
5
5
|
const STAGE_TIMEOUT_MS = 60_000;
|
|
6
6
|
const STAGE_TIMEOUT_MESSAGE = `staging attachments timed out after ${STAGE_TIMEOUT_MS}ms`;
|
|
7
7
|
const OVER_BUDGET_ERROR = 'inputs exceed maximum total size';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IMAGE_INPUT, OFFICE_READ, PDF_READ, isEscaped, parseInputs, parseOutputs, parsePackages, stripCommentsAndDocstrings, unwrapPythonSource } from
|
|
1
|
+
import { IMAGE_INPUT, OFFICE_READ, PDF_READ, isEscaped, parseInputs, parseOutputs, parsePackages, stripCommentsAndDocstrings, unwrapPythonSource } from './python-adapter.js';
|
|
2
2
|
const ARTIFACT_OUTPUT = /\.(docx|xlsx|pptx|pdf)$/i;
|
|
3
3
|
const CREATE_PACKAGES = new Map([
|
|
4
4
|
['python-docx', '1.2.0'],
|
|
@@ -9,7 +9,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
9
9
|
import b4a from 'b4a';
|
|
10
10
|
import { constants as fsConstants } from 'fs';
|
|
11
11
|
import process from 'process';
|
|
12
|
-
import { seedPackageCache } from
|
|
12
|
+
import { seedPackageCache } from './wheels.js';
|
|
13
13
|
class B4aTextDecoder {
|
|
14
14
|
encoding;
|
|
15
15
|
constructor(label = 'utf-8') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hlog } from
|
|
2
|
-
import { MAX_OUTPUT_FILE_BYTES, MAX_OUTPUT_TOTAL_BYTES } from
|
|
1
|
+
import { hlog } from '../../../../log.js';
|
|
2
|
+
import { MAX_OUTPUT_FILE_BYTES, MAX_OUTPUT_TOTAL_BYTES } from './output-policy.js';
|
|
3
3
|
let runCounter = 0;
|
|
4
4
|
function filePath(dir, name) {
|
|
5
5
|
return `${dir}/${name}`;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
2
|
import ScopeLock from 'scope-lock';
|
|
3
|
-
import { AbortedError, raceAbort } from
|
|
4
|
-
import { hlog } from
|
|
5
|
-
import { MAX_OUTPUT_CHARS } from
|
|
6
|
-
import { defaultLoad, pyodideLoadOptions } from
|
|
7
|
-
import { isPyodideFatal, performRun } from
|
|
8
|
-
import { runPythonInWorker } from
|
|
3
|
+
import { AbortedError, raceAbort } from '../../../../helpers/race-abort.js';
|
|
4
|
+
import { hlog } from '../../../../log.js';
|
|
5
|
+
import { MAX_OUTPUT_CHARS } from '../../runner.js';
|
|
6
|
+
import { defaultLoad, pyodideLoadOptions } from './loader.js';
|
|
7
|
+
import { isPyodideFatal, performRun } from './run-session.js';
|
|
8
|
+
import { runPythonInWorker } from './worker/client.js';
|
|
9
9
|
export { pyodideLoadOptions };
|
|
10
10
|
const DEFAULT_TIMEOUT_MS = 120_000;
|
|
11
11
|
const PACKAGE_INSTALL_TIMEOUT_MS = 300_000;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import b4a from 'b4a';
|
|
2
|
-
import { attachOutputs, stageInputs } from
|
|
3
|
-
import { checkFileName, checkOutputName, MAX_INPUTS, MAX_OUTPUTS } from
|
|
4
|
-
import { runPython } from
|
|
2
|
+
import { attachOutputs, stageInputs } from './attachments.js';
|
|
3
|
+
import { checkFileName, checkOutputName, MAX_INPUTS, MAX_OUTPUTS } from './output-policy.js';
|
|
4
|
+
import { runPython } from './pyodide.js';
|
|
5
5
|
export function isPythonLanguage(language) {
|
|
6
6
|
return typeof language === 'string' && language.trim().toLowerCase() === 'python';
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AbortedError } from
|
|
2
|
-
import { hlog } from
|
|
3
|
-
import { TRUNCATED_OUTPUT_SUFFIX } from
|
|
4
|
-
import { collectOutputs, openScratch, stageInputFiles } from
|
|
5
|
-
import { planVendoredInstall, stageVendoredWheels } from
|
|
1
|
+
import { AbortedError } from '../../../../helpers/race-abort.js';
|
|
2
|
+
import { hlog } from '../../../../log.js';
|
|
3
|
+
import { TRUNCATED_OUTPUT_SUFFIX } from '../../runner.js';
|
|
4
|
+
import { collectOutputs, openScratch, stageInputFiles } from './memfs.js';
|
|
5
|
+
import { planVendoredInstall, stageVendoredWheels } from './wheels.js';
|
|
6
6
|
export function cap(text, limit) {
|
|
7
7
|
if (text.length <= limit)
|
|
8
8
|
return text;
|
|
@@ -2,7 +2,7 @@ import fs from 'fs';
|
|
|
2
2
|
import process from 'process';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { hlog } from
|
|
5
|
+
import { hlog } from '../../../../log.js';
|
|
6
6
|
const ManifestSchema = z.object({
|
|
7
7
|
pyodide: z.string(),
|
|
8
8
|
packages: z.record(z.string(), z.object({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { spawnPythonWorker } from '#pyodide-worker-spawn';
|
|
2
2
|
import process from 'process';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
|
-
import { AbortedError, raceAbort } from
|
|
5
|
-
import { harnessLogEnabled, hlog } from
|
|
6
|
-
import { asWorkerMessage, fromWireResult } from
|
|
4
|
+
import { AbortedError, raceAbort } from '../../../../../helpers/race-abort.js';
|
|
5
|
+
import { harnessLogEnabled, hlog } from '../../../../../log.js';
|
|
6
|
+
import { asWorkerMessage, fromWireResult } from './protocol.js';
|
|
7
7
|
const SIGINT = 2;
|
|
8
8
|
function interruptGraceMs() {
|
|
9
9
|
const ms = Number(process.env.QVAC_PYODIDE_INTERRUPT_GRACE_MS);
|
|
@@ -7,10 +7,10 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
import process from 'process';
|
|
10
|
-
import { setHarnessLog, setHarnessLogSink } from
|
|
11
|
-
import { defaultLoad } from
|
|
12
|
-
import { performRun } from
|
|
13
|
-
import { asHostMessage, toWireResult } from
|
|
10
|
+
import { setHarnessLog, setHarnessLogSink } from '../../../../../log.js';
|
|
11
|
+
import { defaultLoad } from '../loader.js';
|
|
12
|
+
import { performRun } from '../run-session.js';
|
|
13
|
+
import { asHostMessage, toWireResult } from './protocol.js';
|
|
14
14
|
function narrowThreadData(data) {
|
|
15
15
|
if (typeof data === 'object' && data !== null && 'sab' in data && 'handle' in data) {
|
|
16
16
|
const sab = data.sab;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import process from 'process';
|
|
4
|
-
import { execEnv } from
|
|
5
|
-
import { expandObsidianPath, firstExistingPath, OBSIDIAN_BIN_CANDIDATES } from
|
|
4
|
+
import { execEnv } from '../../../helpers/spawn-path.js';
|
|
5
|
+
import { expandObsidianPath, firstExistingPath, OBSIDIAN_BIN_CANDIDATES } from '../../skills/obsidian-readiness.js';
|
|
6
6
|
const RUNNING_CHECK_MS = 3_000;
|
|
7
7
|
export function runningCheckCommand(os) {
|
|
8
8
|
if (os === 'win32') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { appendOutput, capOutput, createCapturedOutput, MAX_OUTPUT_CHARS } from
|
|
2
|
-
import { isObsidianRunning, launchObsidianApp, obsidianPathEnv } from
|
|
3
|
-
import { OBSIDIAN_CLI_FAILURE_GUIDANCE } from
|
|
4
|
-
import { cleanObsidianOutput } from
|
|
1
|
+
import { appendOutput, capOutput, createCapturedOutput, MAX_OUTPUT_CHARS } from '../runner.js';
|
|
2
|
+
import { isObsidianRunning, launchObsidianApp, obsidianPathEnv } from './cli-process.js';
|
|
3
|
+
import { OBSIDIAN_CLI_FAILURE_GUIDANCE } from './guidance.js';
|
|
4
|
+
import { cleanObsidianOutput } from './output.js';
|
|
5
5
|
const READY_WAIT_MS = 5_000;
|
|
6
6
|
const COMMAND_MS = 15_000;
|
|
7
7
|
const OUTPUT_QUIET_MS = 700;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
|
-
import { credentialRecord } from
|
|
3
|
-
import { isObsidianVaultPath, isSandboxedWorkbenchInstall, OBSIDIAN_VAULT_PATH_CREDENTIAL_KEY } from
|
|
4
|
-
import { capOutput, MAX_OUTPUT_CHARS } from
|
|
5
|
-
import { runObsidianCli } from
|
|
6
|
-
import { normalizeObsidianCommand, parseObsidianCommand } from
|
|
7
|
-
import { OBSIDIAN_DESKTOP_AGENT_REQUIRED, OBSIDIAN_NO_SHELL_FALLBACK, OBSIDIAN_VAULT_SETUP_REQUIRED } from
|
|
8
|
-
import { executeVaultFsAction } from
|
|
2
|
+
import { credentialRecord } from '../../skills/auth-resolver.js';
|
|
3
|
+
import { isObsidianVaultPath, isSandboxedWorkbenchInstall, OBSIDIAN_VAULT_PATH_CREDENTIAL_KEY } from '../../skills/obsidian-readiness.js';
|
|
4
|
+
import { capOutput, MAX_OUTPUT_CHARS } from '../runner.js';
|
|
5
|
+
import { runObsidianCli } from './cli.js';
|
|
6
|
+
import { normalizeObsidianCommand, parseObsidianCommand } from './command.js';
|
|
7
|
+
import { OBSIDIAN_DESKTOP_AGENT_REQUIRED, OBSIDIAN_NO_SHELL_FALLBACK, OBSIDIAN_VAULT_SETUP_REQUIRED } from './guidance.js';
|
|
8
|
+
import { executeVaultFsAction } from './vault-fs.js';
|
|
9
9
|
const DESKTOP_PLATFORMS = new Set(['darwin', 'linux', 'win32']);
|
|
10
10
|
function limitResult(result, maxOutputChars) {
|
|
11
11
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { markdownFileName } from
|
|
4
|
-
import { ensureWithinRoot, getArg, getContentArg, writeNewFileText } from
|
|
3
|
+
import { markdownFileName } from './note-name.js';
|
|
4
|
+
import { ensureWithinRoot, getArg, getContentArg, writeNewFileText } from './vault-paths.js';
|
|
5
5
|
function markdownPath(vaultPath, target) {
|
|
6
6
|
const notePath = target.endsWith('.md') ? target : `${target}.md`;
|
|
7
7
|
return ensureWithinRoot(vaultPath, notePath);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { handleCreate } from
|
|
2
|
-
import { todayStamp } from
|
|
3
|
-
import { handleDailyRead, handleFiles, handleFolders, handleOutline, handleProperties, handleRead, handleSearch, handleTags, handleVault, handleVaults, handleWordcount } from
|
|
4
|
-
import { handleAppend, handleDailyAppend, handleDelete, handleMove, handlePrepend, handlePropertySet, handleRename } from
|
|
5
|
-
export { parseObsidianCommand, normalizeObsidianCommand } from
|
|
6
|
-
export { ensureWithinRoot } from
|
|
1
|
+
import { handleCreate } from './vault-create.js';
|
|
2
|
+
import { todayStamp } from './vault-paths.js';
|
|
3
|
+
import { handleDailyRead, handleFiles, handleFolders, handleOutline, handleProperties, handleRead, handleSearch, handleTags, handleVault, handleVaults, handleWordcount } from './vault-read.js';
|
|
4
|
+
import { handleAppend, handleDailyAppend, handleDelete, handleMove, handlePrepend, handlePropertySet, handleRename } from './vault-write.js';
|
|
5
|
+
export { parseObsidianCommand, normalizeObsidianCommand } from './command.js';
|
|
6
|
+
export { ensureWithinRoot } from './vault-paths.js';
|
|
7
7
|
export function executeVaultFsAction(vaultPath, action, args) {
|
|
8
8
|
switch (action) {
|
|
9
9
|
case 'vault':
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { ensureWithinRoot, isSymlink, writeNewFileText } from
|
|
4
|
-
export { ensureWithinRoot, writeNewFileText } from
|
|
3
|
+
import { ensureWithinRoot, isSymlink, writeNewFileText } from './safe-path.js';
|
|
4
|
+
export { ensureWithinRoot, writeNewFileText } from './safe-path.js';
|
|
5
5
|
export const FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---/;
|
|
6
6
|
export function resolveNotePath(vaultPath, args) {
|
|
7
7
|
const fileArg = args.find((a) => a.startsWith('file='));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { dailyCandidates, ensureWithinRoot, FRONTMATTER_RE, getArg, listFolders, listMarkdownFiles, parseFrontmatter, readFileText, resolveNotePath, todayStamp } from
|
|
3
|
+
import { dailyCandidates, ensureWithinRoot, FRONTMATTER_RE, getArg, listFolders, listMarkdownFiles, parseFrontmatter, readFileText, resolveNotePath, todayStamp } from './vault-paths.js';
|
|
4
4
|
export function handleVault(vaultPath) {
|
|
5
5
|
return JSON.stringify({ name: path.basename(vaultPath), path: vaultPath });
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { markdownFileName } from
|
|
4
|
-
import { appendToFile, dailyCandidates, ensureWithinRoot, FRONTMATTER_RE, getArg, getContentArg, moveFile, readFileSnapshot, resolveNotePath, todayStamp, updateFileText, writeIfUnchanged } from
|
|
3
|
+
import { markdownFileName } from './note-name.js';
|
|
4
|
+
import { appendToFile, dailyCandidates, ensureWithinRoot, FRONTMATTER_RE, getArg, getContentArg, moveFile, readFileSnapshot, resolveNotePath, todayStamp, updateFileText, writeIfUnchanged } from './vault-paths.js';
|
|
5
5
|
export function handleAppend(vaultPath, args) {
|
|
6
6
|
const notePath = resolveNotePath(vaultPath, args);
|
|
7
7
|
if (!notePath || !fs.existsSync(notePath)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
|
-
import { AbortedError } from
|
|
2
|
+
import { AbortedError } from '../../helpers/race-abort.js';
|
|
3
3
|
const DEFAULT_TIMEOUT_MS = 120_000;
|
|
4
4
|
export const MAX_OUTPUT_CHARS = 8_192;
|
|
5
5
|
export const MAX_OUTPUT_CHARS_LIMIT = 65_536;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { AbortedError } from
|
|
4
|
-
import { spawnEnv } from
|
|
5
|
-
import { checkPdfBuildSource, checkBareLengthArgs, checkPptxBuildSource, checkPythonSource, checkUnstagedRead, createPythonAdapter, isPythonLanguage, looksLikePythonSource, parseInputs, parseOutputs, parsePackages, parseWorkdir, runsThroughPyodide, unwrapPythonSource } from
|
|
6
|
-
import { pythonCreateEffect } from
|
|
7
|
-
import { createShellAdapter } from
|
|
8
|
-
import { routeObsidianCommand } from
|
|
9
|
-
import { MAX_OUTPUT_CHARS_LIMIT } from
|
|
10
|
-
import { bareBin, firstCommandToken, sanitizeCommand } from
|
|
11
|
-
import { shellArgv } from
|
|
12
|
-
import { canonicalDenyRoots, defaultRealpath, hostPath, resolveKey } from
|
|
13
|
-
import { unquoteArg } from
|
|
14
|
-
import { settingsEnv } from
|
|
15
|
-
import { checkCliOps } from
|
|
3
|
+
import { AbortedError } from '../helpers/race-abort.js';
|
|
4
|
+
import { spawnEnv } from '../helpers/spawn-path.js';
|
|
5
|
+
import { checkPdfBuildSource, checkBareLengthArgs, checkPptxBuildSource, checkPythonSource, checkUnstagedRead, createPythonAdapter, isPythonLanguage, looksLikePythonSource, parseInputs, parseOutputs, parsePackages, parseWorkdir, runsThroughPyodide, unwrapPythonSource } from './exec/adapters/python/python-adapter.js';
|
|
6
|
+
import { pythonCreateEffect } from './exec/adapters/python/create-effect.js';
|
|
7
|
+
import { createShellAdapter } from './exec/adapters/shell/shell-adapter.js';
|
|
8
|
+
import { routeObsidianCommand } from './exec/obsidian/route.js';
|
|
9
|
+
import { MAX_OUTPUT_CHARS_LIMIT } from './exec/runner.js';
|
|
10
|
+
import { bareBin, firstCommandToken, sanitizeCommand } from './exec/scope.js';
|
|
11
|
+
import { shellArgv } from './exec/shell-argv.js';
|
|
12
|
+
import { canonicalDenyRoots, defaultRealpath, hostPath, resolveKey } from './fs/scope.js';
|
|
13
|
+
import { unquoteArg } from './model-args.js';
|
|
14
|
+
import { settingsEnv } from './skills/skill-settings.js';
|
|
15
|
+
import { checkCliOps } from './skills/cli-schema.js';
|
|
16
16
|
function parsePositiveInt(value, name, max) {
|
|
17
17
|
if (value === undefined || value === null || value === '')
|
|
18
18
|
return undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { compileGlob } from
|
|
2
|
-
import { NO_DIRS_GRANTED, canonicalDenyRoots, defaultRealpath, isDeniedPath, resolveKey } from
|
|
3
|
-
import { walkFiles } from
|
|
1
|
+
import { compileGlob } from './fs/glob.js';
|
|
2
|
+
import { NO_DIRS_GRANTED, canonicalDenyRoots, defaultRealpath, isDeniedPath, resolveKey } from './fs/scope.js';
|
|
3
|
+
import { walkFiles } from './fs/walk.js';
|
|
4
4
|
export const DEFAULT_GLOB_MATCHES = 100;
|
|
5
5
|
export const MAX_GLOB_MATCHES = 1000;
|
|
6
6
|
export async function searchTargets(dir, roots, realpath, deny) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { Writable } from 'streamx';
|
|
4
|
-
import { STAGING_DIR } from
|
|
4
|
+
import { STAGING_DIR } from '../../staging.js';
|
|
5
5
|
export const DRIVE_CALL_TIMEOUT_MS = 20_000;
|
|
6
6
|
export const MAX_DRIVE_BYTES = 8 * 1024 * 1024;
|
|
7
7
|
export const DRIVE_LIST_PAGE = 256;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { hlog } from
|
|
2
|
-
import { displayPath } from
|
|
1
|
+
import { hlog } from '../../log.js';
|
|
2
|
+
import { displayPath } from './scope.js';
|
|
3
3
|
export const WALK_SKIP_DIRS = new Set(['.git', 'node_modules']);
|
|
4
4
|
export const MAX_WALK_ENTRIES = 10_000;
|
|
5
5
|
export const MAX_WALK_MS = 30_000;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import ScopeLock from 'scope-lock';
|
|
2
|
-
import { AbortedError, raceAbort } from
|
|
3
|
-
import { DIFFUSION_CATALOG, imageModelFor } from
|
|
4
|
-
import { createLoadTracker } from
|
|
5
|
-
import { resolveModelSrc } from
|
|
2
|
+
import { AbortedError, raceAbort } from '../helpers/race-abort.js';
|
|
3
|
+
import { DIFFUSION_CATALOG, imageModelFor } from '../models/model-catalog.js';
|
|
4
|
+
import { createLoadTracker } from '../models/model-pool.js';
|
|
5
|
+
import { resolveModelSrc } from '../models/model-source.js';
|
|
6
6
|
export const MAX_DIM = 1024;
|
|
7
7
|
export const DIM_STEP = 64;
|
|
8
8
|
const DEFAULT_DIM = 512;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import process from 'process';
|
|
2
2
|
import ScopeLock from 'scope-lock';
|
|
3
|
-
import { AbortedError, raceAbort } from
|
|
4
|
-
import { hdiag } from
|
|
5
|
-
import { AUDIOGEN_CATALOG, musicChoiceForDit, musicDefaultSteps, musicModelSet } from
|
|
6
|
-
import { GENERATE_MUSIC_TOOL } from
|
|
7
|
-
import { createLoadTracker } from
|
|
8
|
-
import { resolveModelSrc } from
|
|
3
|
+
import { AbortedError, raceAbort } from '../helpers/race-abort.js';
|
|
4
|
+
import { hdiag } from '../log.js';
|
|
5
|
+
import { AUDIOGEN_CATALOG, musicChoiceForDit, musicDefaultSteps, musicModelSet } from '../models/model-catalog.js';
|
|
6
|
+
import { GENERATE_MUSIC_TOOL } from '../models/music-catalog.js';
|
|
7
|
+
import { createLoadTracker } from '../models/model-pool.js';
|
|
8
|
+
import { resolveModelSrc } from '../models/model-source.js';
|
|
9
9
|
export const MAX_DURATION_SECONDS = 300;
|
|
10
10
|
export const MIN_DURATION_SECONDS = 1;
|
|
11
11
|
export const MAX_STEPS = 60;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hlog } from
|
|
2
|
-
import { searchTargets } from
|
|
3
|
-
import { readLines } from
|
|
4
|
-
import { isDriveReadTruncated } from
|
|
5
|
-
import { canonicalDenyRoots, defaultRealpath, isDeniedPath } from
|
|
6
|
-
import { walkFiles } from
|
|
1
|
+
import { hlog } from '../log.js';
|
|
2
|
+
import { searchTargets } from './file-glob.js';
|
|
3
|
+
import { readLines } from './fs/read.js';
|
|
4
|
+
import { isDriveReadTruncated } from './fs/remote.js';
|
|
5
|
+
import { canonicalDenyRoots, defaultRealpath, isDeniedPath } from './fs/scope.js';
|
|
6
|
+
import { walkFiles } from './fs/walk.js';
|
|
7
7
|
export const DEFAULT_GREP_MATCHES = 200;
|
|
8
8
|
export const MAX_GREP_MATCHES = 1000;
|
|
9
9
|
const MAX_LINE_CHARS = 500;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import defaultFetch from '#no-redirect-fetch';
|
|
2
2
|
import { AbortController } from 'bare-abort-controller';
|
|
3
|
-
import { lookupHost } from
|
|
4
|
-
import { READ_METHODS } from
|
|
5
|
-
import { encodeDeclaredFields } from
|
|
6
|
-
import { truncateResponseBody } from
|
|
7
|
-
import { AbortedError } from
|
|
8
|
-
import { applyQuery, buildHeaders, contentTypeOf, encodeBody, isRedirectStatus, parseJsonBody, parseObjectArg, TIMEOUT_MS } from
|
|
9
|
-
import { parseAuth, resolveBearerHeader, resolveRedirectBearerHeader } from
|
|
10
|
-
import { recordCredentialHealth } from
|
|
11
|
-
import { resolveOutboundUrl } from
|
|
3
|
+
import { lookupHost } from '../dns-lookup.js';
|
|
4
|
+
import { READ_METHODS } from './http-methods.js';
|
|
5
|
+
import { encodeDeclaredFields } from './http-request/encode-fields.js';
|
|
6
|
+
import { truncateResponseBody } from './http-request/truncate-response.js';
|
|
7
|
+
import { AbortedError } from '../helpers/race-abort.js';
|
|
8
|
+
import { applyQuery, buildHeaders, contentTypeOf, encodeBody, isRedirectStatus, parseJsonBody, parseObjectArg, TIMEOUT_MS } from './http-request/utils.js';
|
|
9
|
+
import { parseAuth, resolveBearerHeader, resolveRedirectBearerHeader } from './skills/auth-resolver.js';
|
|
10
|
+
import { recordCredentialHealth } from './skills/credential-health.js';
|
|
11
|
+
import { resolveOutboundUrl } from './url-guard.js';
|
|
12
12
|
const MAX_REDIRECTS = 5;
|
|
13
13
|
export function createHttpRequestTool({ fetch: fetchImpl, credentialStore, credentialAllowList, resolveHost = lookupHost } = {}) {
|
|
14
14
|
return {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import defaultFetch from '#no-redirect-fetch';
|
|
2
2
|
import { AbortController } from 'bare-abort-controller';
|
|
3
|
-
import { MCP_CALL_TOOL_NAME } from
|
|
4
|
-
import { lookupHost } from
|
|
5
|
-
import { AbortedError } from
|
|
6
|
-
import { isRedirectStatus, parseObjectArg } from
|
|
7
|
-
import { cacheSession, deleteSession, establishSession, flattenMcpResponse, getSession, isNotification, needsSession, normalizeMethod, post, readBody, sessionKey, TIMEOUT_MS } from
|
|
8
|
-
import { parseAuth, resolveBearerHeader } from
|
|
9
|
-
import { recordCredentialHealth } from
|
|
10
|
-
import { resolveOutboundUrl } from
|
|
3
|
+
import { MCP_CALL_TOOL_NAME } from '../capabilities/tool-names.js';
|
|
4
|
+
import { lookupHost } from '../dns-lookup.js';
|
|
5
|
+
import { AbortedError } from '../helpers/race-abort.js';
|
|
6
|
+
import { isRedirectStatus, parseObjectArg } from './http-request/utils.js';
|
|
7
|
+
import { cacheSession, deleteSession, establishSession, flattenMcpResponse, getSession, isNotification, needsSession, normalizeMethod, post, readBody, sessionKey, TIMEOUT_MS } from './mcp/utils.js';
|
|
8
|
+
import { parseAuth, resolveBearerHeader } from './skills/auth-resolver.js';
|
|
9
|
+
import { recordCredentialHealth } from './skills/credential-health.js';
|
|
10
|
+
import { resolveOutboundUrl } from './url-guard.js';
|
|
11
11
|
function nestedUrl(params) {
|
|
12
12
|
return typeof params?.url === 'string' && params.url.length > 0 ? params.url : undefined;
|
|
13
13
|
}
|