@socketsecurity/lib 6.0.7 → 6.0.9
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/CHANGELOG.md +42 -0
- package/README.md +1 -1
- package/dist/ai/agent-context.d.mts +103 -0
- package/dist/ai/agent-context.js +157 -0
- package/dist/ai/backends.d.mts +83 -0
- package/dist/ai/backends.js +173 -0
- package/dist/ai/credentials.d.mts +49 -0
- package/dist/ai/credentials.js +82 -0
- package/dist/ai/discover.d.mts +4 -0
- package/dist/ai/discover.js +1 -1
- package/dist/ai/exec.d.mts +52 -0
- package/dist/ai/exec.js +92 -0
- package/dist/ai/http.d.mts +132 -0
- package/dist/ai/http.js +130 -0
- package/dist/ai/profiles.d.mts +41 -6
- package/dist/ai/profiles.js +52 -10
- package/dist/ai/route.d.mts +82 -0
- package/dist/ai/route.js +171 -0
- package/dist/ai/spawn.d.mts +42 -2
- package/dist/ai/spawn.js +146 -33
- package/dist/ai/subagent-status.d.mts +48 -0
- package/dist/ai/subagent-status.js +57 -0
- package/dist/ai/tier.d.mts +60 -0
- package/dist/ai/tier.js +53 -0
- package/dist/ai/types.d.mts +25 -2
- package/dist/ai/worktree.js +4 -0
- package/dist/archives/tar.js +1 -1
- package/dist/archives/zip.js +2 -2
- package/dist/argv/parse.d.ts +19 -2
- package/dist/argv/parse.js +1 -1
- package/dist/arrays/join.js +4 -0
- package/dist/bin/find.js +4 -4
- package/dist/bin/prim.cjs +23322 -18018
- package/dist/bin/resolve.js +2 -2
- package/dist/cache/ttl/store.js +2 -2
- package/dist/cli/check-primordials.d.ts +8 -3
- package/dist/cli/check-primordials.js +4 -4
- package/dist/compression/_internal.js +1 -1
- package/dist/compression/brotli.d.ts +1 -2
- package/dist/compression/brotli.js +5 -1
- package/dist/compression/gzip.js +5 -1
- package/dist/config/layers.d.ts +53 -0
- package/dist/config/layers.js +83 -0
- package/dist/constants/packages.d.ts +3 -0
- package/dist/constants/packages.js +2 -1
- package/dist/constants/socket.d.ts +2 -6
- package/dist/constants/socket.js +12 -14
- package/dist/cover/code.js +2 -2
- package/dist/crypto/hash.d.ts +4 -1
- package/dist/crypto/hash.js +4 -1
- package/dist/dlx/arborist.js +13 -3
- package/dist/dlx/binary-cache.js +1 -1
- package/dist/dlx/binary-resolution.js +1 -1
- package/dist/dlx/detect.d.ts +8 -0
- package/dist/dlx/firewall.d.ts +8 -0
- package/dist/dlx/lockfile.js +5 -2
- package/dist/dlx/manifest.js +1 -1
- package/dist/dlx/package.js +4 -0
- package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
- package/dist/eco/cargo/parse-lockfile.js +3 -3
- package/dist/eco/manifest/detect-format.js +1 -1
- package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
- package/dist/eco/npm/npm/parse-lockfile.js +2 -2
- package/dist/eco/npm/parse-package-json.d.ts +11 -0
- package/dist/eco/npm/parse-package-json.js +1 -1
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
- package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +2 -2
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +6 -3
- package/dist/env/rewire.js +7 -8
- package/dist/env/socket.d.ts +7 -0
- package/dist/env/socket.js +10 -0
- package/dist/env/xdg.d.ts +17 -0
- package/dist/env/xdg.js +21 -1
- package/dist/errors/predicates.js +1 -1
- package/dist/errors/stack.js +1 -2
- package/dist/external/@npmcli/package-json.js +3455 -4881
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/@yarnpkg/extensions.js +1 -1
- package/dist/external/external-pack.js +1 -1
- package/dist/external/npm-pack.js +29164 -31799
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/tar-fs.js +63 -16
- package/dist/external/which.js +3 -1
- package/dist/external-tools/bazel/asset-names.d.ts +1 -1
- package/dist/external-tools/bazel/asset-names.js +5 -2
- package/dist/external-tools/bazel/from-download.d.ts +1 -1
- package/dist/external-tools/bazel/from-download.js +5 -2
- package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
- package/dist/external-tools/bazel/resolve.d.ts +3 -3
- package/dist/external-tools/bazel/resolve.js +16 -8
- package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
- package/dist/external-tools/cdxgen/asset-names.js +5 -2
- package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
- package/dist/external-tools/cdxgen/from-download.js +7 -4
- package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
- package/dist/external-tools/cdxgen/resolve.js +16 -8
- package/dist/external-tools/from-download.d.ts +2 -2
- package/dist/external-tools/from-download.js +11 -5
- package/dist/external-tools/from-pip-venv.d.ts +1 -1
- package/dist/external-tools/from-pip-venv.js +12 -5
- package/dist/external-tools/janus/asset-names.d.ts +1 -1
- package/dist/external-tools/janus/asset-names.js +5 -2
- package/dist/external-tools/janus/from-download.d.ts +1 -1
- package/dist/external-tools/janus/from-download.js +5 -2
- package/dist/external-tools/janus/resolve.d.ts +3 -3
- package/dist/external-tools/janus/resolve.js +16 -8
- package/dist/external-tools/jre/asset-names.d.ts +1 -1
- package/dist/external-tools/jre/asset-names.js +5 -2
- package/dist/external-tools/jre/detect-platform-arch.js +1 -1
- package/dist/external-tools/jre/from-download.d.ts +1 -1
- package/dist/external-tools/jre/from-download.js +7 -4
- package/dist/external-tools/jre/from-java-home.js +2 -2
- package/dist/external-tools/jre/from-vfs.js +2 -2
- package/dist/external-tools/jre/resolve.d.ts +3 -3
- package/dist/external-tools/jre/resolve.js +16 -8
- package/dist/external-tools/manifest.d.ts +18 -0
- package/dist/external-tools/manifest.js +2 -2
- package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
- package/dist/external-tools/opengrep/asset-names.js +5 -2
- package/dist/external-tools/opengrep/from-download.d.ts +1 -1
- package/dist/external-tools/opengrep/from-download.js +5 -2
- package/dist/external-tools/opengrep/resolve.d.ts +3 -3
- package/dist/external-tools/opengrep/resolve.js +16 -8
- package/dist/external-tools/python/asset-names.d.ts +1 -1
- package/dist/external-tools/python/asset-names.js +11 -4
- package/dist/external-tools/python/dlx.d.ts +3 -3
- package/dist/external-tools/python/dlx.js +20 -9
- package/dist/external-tools/python/from-download.d.ts +1 -1
- package/dist/external-tools/python/from-download.js +12 -5
- package/dist/external-tools/python/pin.js +6 -3
- package/dist/external-tools/python/pip-install.js +6 -3
- package/dist/external-tools/python/resolve.d.ts +3 -3
- package/dist/external-tools/python/resolve.js +19 -11
- package/dist/external-tools/python/uv-install.d.ts +89 -0
- package/dist/external-tools/python/uv-install.js +165 -0
- package/dist/external-tools/sbt/asset-names.d.ts +1 -1
- package/dist/external-tools/sbt/asset-names.js +5 -2
- package/dist/external-tools/sbt/from-download.d.ts +1 -1
- package/dist/external-tools/sbt/from-download.js +5 -2
- package/dist/external-tools/sbt/resolve.d.ts +3 -3
- package/dist/external-tools/sbt/resolve.js +16 -8
- package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.js +10 -3
- package/dist/external-tools/skillspector/from-uv.d.ts +30 -0
- package/dist/external-tools/skillspector/from-uv.js +56 -0
- package/dist/external-tools/skillspector/resolve.d.ts +20 -5
- package/dist/external-tools/skillspector/resolve.js +27 -6
- package/dist/external-tools/skillspector/types.d.ts +3 -1
- package/dist/external-tools/synp/asset-names.d.ts +1 -1
- package/dist/external-tools/synp/asset-names.js +6 -2
- package/dist/external-tools/synp/from-download.d.ts +1 -1
- package/dist/external-tools/synp/from-download.js +5 -2
- package/dist/external-tools/synp/resolve.d.ts +3 -3
- package/dist/external-tools/synp/resolve.js +16 -8
- package/dist/external-tools/trivy/asset-names.d.ts +1 -1
- package/dist/external-tools/trivy/asset-names.js +5 -2
- package/dist/external-tools/trivy/from-download.d.ts +1 -1
- package/dist/external-tools/trivy/from-download.js +7 -4
- package/dist/external-tools/trivy/resolve.d.ts +3 -3
- package/dist/external-tools/trivy/resolve.js +16 -8
- package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
- package/dist/external-tools/trufflehog/asset-names.js +5 -2
- package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
- package/dist/external-tools/trufflehog/from-download.js +7 -4
- package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
- package/dist/external-tools/trufflehog/resolve.js +16 -8
- package/dist/external-tools/uv/asset-names.d.ts +36 -0
- package/dist/external-tools/uv/asset-names.js +73 -0
- package/dist/external-tools/uv/from-download.d.ts +17 -0
- package/dist/external-tools/uv/from-download.js +50 -0
- package/dist/external-tools/uv/from-path.d.ts +5 -0
- package/dist/external-tools/uv/from-path.js +22 -0
- package/dist/external-tools/uv/from-vfs.d.ts +7 -0
- package/dist/external-tools/uv/from-vfs.js +26 -0
- package/dist/external-tools/uv/resolve.d.ts +25 -0
- package/dist/external-tools/uv/resolve.js +61 -0
- package/dist/external-tools/uv/types.d.ts +24 -0
- package/dist/external-tools/uv/types.js +2 -0
- package/dist/fleet/repo-config.d.ts +53 -0
- package/dist/fleet/repo-config.js +79 -0
- package/dist/fs/allowed-dirs-cache.d.ts +27 -1
- package/dist/fs/allowed-dirs-cache.js +39 -6
- package/dist/fs/copy.d.ts +88 -0
- package/dist/fs/copy.js +89 -0
- package/dist/fs/find.js +1 -1
- package/dist/fs/read-json-cache.d.ts +7 -0
- package/dist/fs/resolve-module.js +6 -2
- package/dist/fs/safe.js +1 -1
- package/dist/git/_internal.js +3 -3
- package/dist/git/repo.js +2 -4
- package/dist/git/staged.js +8 -0
- package/dist/git/tracked.d.ts +84 -0
- package/dist/git/tracked.js +163 -0
- package/dist/git/unstaged.js +8 -0
- package/dist/github/refs-graphql.js +4 -0
- package/dist/github/refs-rest.js +4 -0
- package/dist/globs/_internal.js +1 -1
- package/dist/globs/match.js +9 -1
- package/dist/globs/matcher.js +5 -1
- package/dist/http-request/browser.js +7 -3
- package/dist/http-request/checksum-file.js +1 -1
- package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
- package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
- package/dist/http-request/headers.js +1 -1
- package/dist/http-request/request-attempt.js +2 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/integrity.d.ts +124 -71
- package/dist/integrity.js +168 -78
- package/dist/json/edit.js +38 -30
- package/dist/json/format.js +1 -1
- package/dist/logger/colors.d.ts +1 -2
- package/dist/logger/colors.js +2 -2
- package/dist/logger/symbols-builder.js +7 -8
- package/dist/logger/symbols.js +8 -8
- package/dist/native-messaging/install.d.ts +1 -1
- package/dist/native-messaging/install.js +7 -4
- package/dist/native-messaging/rate-limit.d.ts +7 -0
- package/dist/native-messaging/rate-limit.js +4 -0
- package/dist/node/async-hooks.js +1 -1
- package/dist/node/child-process.js +1 -1
- package/dist/node/crypto.js +1 -1
- package/dist/node/events.js +1 -1
- package/dist/node/fs-promises.js +1 -1
- package/dist/node/fs.d.ts +22 -6
- package/dist/node/fs.js +16 -3
- package/dist/node/http.js +1 -1
- package/dist/node/https.js +1 -1
- package/dist/node/module.d.ts +73 -2
- package/dist/node/module.js +97 -12
- package/dist/node/os.d.ts +10 -2
- package/dist/node/os.js +11 -4
- package/dist/node/path.d.ts +11 -2
- package/dist/node/path.js +17 -4
- package/dist/node/timers-promises.js +1 -1
- package/dist/node/url.js +1 -1
- package/dist/node/util.js +1 -1
- package/dist/objects/getters.js +1 -1
- package/dist/objects/mutate.js +2 -2
- package/dist/packages/edit-class.d.ts +2 -3
- package/dist/packages/edit-class.js +41 -35
- package/dist/packages/exports.js +4 -4
- package/dist/packages/fetch.js +1 -1
- package/dist/packages/isolation.js +2 -2
- package/dist/packages/licenses.js +2 -2
- package/dist/packages/manifest.d.ts +29 -0
- package/dist/packages/manifest.js +40 -4
- package/dist/packages/normalize.js +2 -2
- package/dist/packages/provenance.js +3 -3
- package/dist/packages/specs.js +1 -1
- package/dist/packages/tarball.js +4 -2
- package/dist/packages/types.d.ts +1 -2
- package/dist/paths/_internal.d.ts +1 -7
- package/dist/paths/_internal.js +9 -15
- package/dist/paths/conversion.js +1 -1
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/normalize.js +1 -1
- package/dist/paths/predicates.js +2 -1
- package/dist/paths/resolve.js +14 -19
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/socket.d.ts +137 -123
- package/dist/paths/socket.js +172 -131
- package/dist/perf/metrics.js +1 -1
- package/dist/perf/report.js +1 -1
- package/dist/primordials/process.d.ts +88 -0
- package/dist/primordials/process.js +132 -0
- package/dist/primordials/uncurry.d.ts +1 -2
- package/dist/process/spawn/child.js +8 -2
- package/dist/process/spawn/errors.js +1 -1
- package/dist/releases/github-archives.js +1 -1
- package/dist/releases/github-listing.d.ts +1 -2
- package/dist/schema/types.d.ts +3 -4
- package/dist/schema/validate.js +1 -1
- package/dist/secrets/broker.d.ts +35 -0
- package/dist/secrets/broker.js +72 -0
- package/dist/secrets/find.d.ts +8 -6
- package/dist/secrets/find.js +25 -5
- package/dist/secrets/keychain.d.ts +1 -1
- package/dist/secrets/linux.js +32 -44
- package/dist/secrets/macos.d.ts +1 -2
- package/dist/secrets/macos.js +20 -29
- package/dist/secrets/rc.d.ts +2 -2
- package/dist/secrets/rc.js +21 -13
- package/dist/secrets/socket-api-token.js +8 -0
- package/dist/secrets/windows.js +27 -33
- package/dist/shell/parse.d.ts +32 -0
- package/dist/shell/parse.js +60 -0
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.d.ts +1 -2
- package/dist/sorts/_internal.js +2 -6
- package/dist/sorts/semver.js +2 -2
- package/dist/spinner/create-spinner-class.js +2 -2
- package/dist/spinner/spinner-internals.d.ts +1 -1
- package/dist/spinner/spinner-internals.js +9 -5
- package/dist/spinner/spinner.d.ts +4 -0
- package/dist/spinner/spinner.js +1 -1
- package/dist/stdio/progress.js +6 -2
- package/dist/stdio/prompts.d.ts +2 -10
- package/dist/stdio/prompts.js +11 -24
- package/dist/strings/format.js +1 -1
- package/dist/strings/search.js +1 -1
- package/dist/temporal/instant.js +2 -2
- package/dist/themes/context.d.ts +5 -3
- package/dist/themes/context.js +5 -6
- package/dist/url/assert-safe.d.ts +29 -0
- package/dist/url/assert-safe.js +54 -0
- package/dist/url/predicates.d.ts +31 -1
- package/dist/url/predicates.js +42 -1
- package/dist/url/types.d.ts +4 -0
- package/llms.txt +750 -0
- package/package.json +253 -125
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
+
|
|
6
|
+
//#region src/ai/subagent-status.mts
|
|
7
|
+
/**
|
|
8
|
+
* @file The terminal-status contract a delegated subagent returns to its
|
|
9
|
+
* orchestrator. Subagent-driven development depends on a SMALL, fixed status
|
|
10
|
+
* vocabulary so the orchestrator can route deterministically instead of
|
|
11
|
+
* parsing free-form prose: a subagent that "sort of finished but has a worry"
|
|
12
|
+
* must be distinguishable from one that is genuinely blocked, because they
|
|
13
|
+
* escalate differently. The four states and their escalation paths are the
|
|
14
|
+
* contract; `escalationFor` is the single place that maps a state to what the
|
|
15
|
+
* orchestrator does next. Encoding it as a typed union + map (rather than a
|
|
16
|
+
* doc convention) is the code-is-law surface: a stray status string fails the
|
|
17
|
+
* guard, and `agent-delegation.md` is checked against this union so the prose
|
|
18
|
+
* can't drift from the code.
|
|
19
|
+
*/
|
|
20
|
+
const ESCALATION = {
|
|
21
|
+
__proto__: null,
|
|
22
|
+
blocked: "escalate",
|
|
23
|
+
done: "advance",
|
|
24
|
+
"done-with-concerns": "surface",
|
|
25
|
+
"needs-context": "redispatch"
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* The canonical status set, sorted, for callers that need to enumerate or
|
|
29
|
+
* validate against the full vocabulary (the doc-parity check reads this).
|
|
30
|
+
*/
|
|
31
|
+
const SUBAGENT_STATUSES = [
|
|
32
|
+
"blocked",
|
|
33
|
+
"done",
|
|
34
|
+
"done-with-concerns",
|
|
35
|
+
"needs-context"
|
|
36
|
+
];
|
|
37
|
+
/**
|
|
38
|
+
* Map a terminal status to the orchestrator action it requires. A status
|
|
39
|
+
* outside the vocabulary is itself a contract violation, so this throws rather
|
|
40
|
+
* than guessing — never force a retry on an unrecognized state.
|
|
41
|
+
*/
|
|
42
|
+
function escalationFor(status) {
|
|
43
|
+
const action = ESCALATION[status];
|
|
44
|
+
if (!action) throw new require_primordials_error.ErrorCtor(`escalationFor: unknown subagent status "${status}". Expected one of: ${SUBAGENT_STATUSES.join(", ")}. Return a status from the SubagentStatus contract.`);
|
|
45
|
+
return action;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* True when `value` names a status in the contract.
|
|
49
|
+
*/
|
|
50
|
+
function isSubagentStatus(value) {
|
|
51
|
+
return SUBAGENT_STATUSES.includes(value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.SUBAGENT_STATUSES = SUBAGENT_STATUSES;
|
|
56
|
+
exports.escalationFor = escalationFor;
|
|
57
|
+
exports.isSubagentStatus = isSubagentStatus;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Canonical model + reasoning-effort ladder for AI orchestrators. The
|
|
3
|
+
* fleet's AI-fix / AI-codify orchestrators pick a capability TIER per unit of
|
|
4
|
+
* work (a lint rule, a hook, a doc edit) and resolve it to a concrete `{
|
|
5
|
+
* model, effort }` pair. Before this module each orchestrator redefined the
|
|
6
|
+
* same three-row table, so a model-generation bump (Sonnet 4.6 → 5.0, Opus
|
|
7
|
+
* 4.8 → 4.9) meant editing N files and risked drift. Import `AI_TIER` /
|
|
8
|
+
* `tierToSpawn` here instead; a generation roll is then a single edit. The
|
|
9
|
+
* mapping encodes the CLAUDE.md token-spend rule ("match model AND effort to
|
|
10
|
+
* the job"): a cheap model left on the session's default effort still burns
|
|
11
|
+
* reasoning a mechanical task never needs, and a premium model on low effort
|
|
12
|
+
* under-thinks a hard one — so effort is pinned ALONGSIDE the model per
|
|
13
|
+
* tier.
|
|
14
|
+
*/
|
|
15
|
+
import type { AiEffort } from './types.mts';
|
|
16
|
+
/**
|
|
17
|
+
* The capability tiers, least → most capable. Orchestrators classify each unit
|
|
18
|
+
* of work into one of these (a regex-shaped rewrite → `haiku`; a caller-chain
|
|
19
|
+
* rewrite → `sonnet`; a module split / new-enforcer authoring → `opus`).
|
|
20
|
+
* `fable` is the apex escalation tier — reserve it for the hardest cases (a
|
|
21
|
+
* stuck compiler / native problem, planning + decomposition of a large task),
|
|
22
|
+
* never a first reach, and prefer to ask before selecting it. It is the most
|
|
23
|
+
* expensive model on the board (~2× opus, ~10× haiku output), so an
|
|
24
|
+
* orchestrator should pick the LEAST-capable tier that does the job and
|
|
25
|
+
* escalate to `fable` only after cheaper tiers fail.
|
|
26
|
+
*/
|
|
27
|
+
export type AiTier = 'fable' | 'haiku' | 'opus' | 'sonnet';
|
|
28
|
+
/**
|
|
29
|
+
* Resolved spawn parameters for a tier — spread alongside an `AI_PROFILE` into
|
|
30
|
+
* a `spawnAiAgent` call (`{ ...AI_PROFILE.verify, ...tierToSpawn('opus'),
|
|
31
|
+
* prompt, cwd }`).
|
|
32
|
+
*/
|
|
33
|
+
export interface TierSpawn {
|
|
34
|
+
readonly effort: AiEffort;
|
|
35
|
+
readonly model: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Canonical tier → { model, effort }. The single source of truth for which
|
|
39
|
+
* Claude model + effort each tier runs. Bump here on a model generation roll;
|
|
40
|
+
* every orchestrator that imports this picks it up.
|
|
41
|
+
*
|
|
42
|
+
* - `haiku` / low — deterministic, regex-shaped rewrites (identifier rename,
|
|
43
|
+
* null→undefined, single-token substitution).
|
|
44
|
+
* - `sonnet` / medium — control-flow / caller-chain reasoning (fetch→httpJson,
|
|
45
|
+
* sync→async), a check script, a doc edit.
|
|
46
|
+
* - `opus` / high — real authoring / refactoring (module split, a brand-new hook
|
|
47
|
+
* or lint rule with its test).
|
|
48
|
+
* - `fable` / xhigh — apex escalation only: a stuck compiler / native problem
|
|
49
|
+
* after cheaper tiers fail, or planning + decomposition of a large task whose
|
|
50
|
+
* chunks then run on cheaper tiers. Most expensive model on the board; never
|
|
51
|
+
* a default.
|
|
52
|
+
*/
|
|
53
|
+
export declare const AI_TIER: Readonly<Record<AiTier, TierSpawn>>;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve a tier label to its `{ model, effort }` spawn pair. A convenience
|
|
56
|
+
* over indexing `AI_TIER` directly; returns the `sonnet` row for an unknown
|
|
57
|
+
* label so a caller that hands in a stray string degrades to the safe default
|
|
58
|
+
* rather than producing `undefined` model/effort.
|
|
59
|
+
*/
|
|
60
|
+
export declare function tierToSpawn(tier: AiTier): TierSpawn;
|
package/dist/ai/tier.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
//#region src/ai/tier.mts
|
|
6
|
+
/**
|
|
7
|
+
* Canonical tier → { model, effort }. The single source of truth for which
|
|
8
|
+
* Claude model + effort each tier runs. Bump here on a model generation roll;
|
|
9
|
+
* every orchestrator that imports this picks it up.
|
|
10
|
+
*
|
|
11
|
+
* - `haiku` / low — deterministic, regex-shaped rewrites (identifier rename,
|
|
12
|
+
* null→undefined, single-token substitution).
|
|
13
|
+
* - `sonnet` / medium — control-flow / caller-chain reasoning (fetch→httpJson,
|
|
14
|
+
* sync→async), a check script, a doc edit.
|
|
15
|
+
* - `opus` / high — real authoring / refactoring (module split, a brand-new hook
|
|
16
|
+
* or lint rule with its test).
|
|
17
|
+
* - `fable` / xhigh — apex escalation only: a stuck compiler / native problem
|
|
18
|
+
* after cheaper tiers fail, or planning + decomposition of a large task whose
|
|
19
|
+
* chunks then run on cheaper tiers. Most expensive model on the board; never
|
|
20
|
+
* a default.
|
|
21
|
+
*/
|
|
22
|
+
const AI_TIER = {
|
|
23
|
+
__proto__: null,
|
|
24
|
+
fable: {
|
|
25
|
+
effort: "xhigh",
|
|
26
|
+
model: "claude-fable-5"
|
|
27
|
+
},
|
|
28
|
+
haiku: {
|
|
29
|
+
effort: "low",
|
|
30
|
+
model: "claude-haiku-4-5"
|
|
31
|
+
},
|
|
32
|
+
opus: {
|
|
33
|
+
effort: "high",
|
|
34
|
+
model: "claude-opus-4-8"
|
|
35
|
+
},
|
|
36
|
+
sonnet: {
|
|
37
|
+
effort: "medium",
|
|
38
|
+
model: "claude-sonnet-4-6"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a tier label to its `{ model, effort }` spawn pair. A convenience
|
|
43
|
+
* over indexing `AI_TIER` directly; returns the `sonnet` row for an unknown
|
|
44
|
+
* label so a caller that hands in a stray string degrades to the safe default
|
|
45
|
+
* rather than producing `undefined` model/effort.
|
|
46
|
+
*/
|
|
47
|
+
function tierToSpawn(tier) {
|
|
48
|
+
return AI_TIER[tier] ?? AI_TIER.sonnet;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.AI_TIER = AI_TIER;
|
|
53
|
+
exports.tierToSpawn = tierToSpawn;
|
package/dist/ai/types.d.mts
CHANGED
|
@@ -26,8 +26,14 @@ export type AiAgentName = 'claude' | 'codex' | 'gemini' | 'opencode';
|
|
|
26
26
|
*/
|
|
27
27
|
export type PermissionMode = 'acceptEdits' | 'dontAsk' | 'plan';
|
|
28
28
|
/**
|
|
29
|
-
* Reasoning-effort level for the agent session.
|
|
30
|
-
*
|
|
29
|
+
* Reasoning-effort level for the agent session. Two agents consume it, each via
|
|
30
|
+
* its own flag — `buildArgs` translates per-agent:
|
|
31
|
+
*
|
|
32
|
+
* - Claude: `--effort <level>`, accepts low/medium/high/xhigh/max.
|
|
33
|
+
* - Codex: `-c model_reasoning_effort=<level>`, accepts minimal/low/medium/high/
|
|
34
|
+
* xhigh (no `max` — `buildArgs` clamps `max` → `xhigh`, codex's ceiling).
|
|
35
|
+
*
|
|
36
|
+
* Gemini / opencode have no reasoning-effort flag, so they ignore it. Pair a
|
|
31
37
|
* cheap model with low effort for mechanical work and reserve high/max for
|
|
32
38
|
* tasks that genuinely need deeper reasoning.
|
|
33
39
|
*/
|
|
@@ -41,8 +47,25 @@ export interface AgentSpawnResult {
|
|
|
41
47
|
readonly attempts: number;
|
|
42
48
|
readonly durationMs: number;
|
|
43
49
|
readonly exitCode: number;
|
|
50
|
+
/**
|
|
51
|
+
* True when the spawn failed because the API stayed overloaded (HTTP 529 /
|
|
52
|
+
* "Overloaded") through every retry. Lets a caller distinguish "back off and
|
|
53
|
+
* retry later" from "the work genuinely failed" — both surface as a non-zero
|
|
54
|
+
* `exitCode`, so this is the only way to tell them apart.
|
|
55
|
+
*/
|
|
56
|
+
readonly overloaded: boolean;
|
|
44
57
|
readonly stderr: string;
|
|
45
58
|
readonly stdout: string;
|
|
59
|
+
/**
|
|
60
|
+
* True when the selected MODEL could not serve the request — it is offline
|
|
61
|
+
* (e.g. "Claude Fable 5 is currently unavailable") or gated/absent for this
|
|
62
|
+
* account ("issue with the selected model … may not exist or you may not have
|
|
63
|
+
* access"). Distinct from `overloaded`: the model is not coming back within a
|
|
64
|
+
* retry window, so the right response is to FALL OVER to the next agent in
|
|
65
|
+
* the tier chain rather than retry the same one. Both surface as a non-zero
|
|
66
|
+
* `exitCode`; this flag is how a caller knows to route elsewhere.
|
|
67
|
+
*/
|
|
68
|
+
readonly unavailable: boolean;
|
|
46
69
|
}
|
|
47
70
|
/**
|
|
48
71
|
* Inputs to a single agent spawn.
|
package/dist/ai/worktree.js
CHANGED
|
@@ -133,6 +133,10 @@ async function runOne(item, index, worktreeBranch, worktreePath, baseRepo, branc
|
|
|
133
133
|
* ```
|
|
134
134
|
*/
|
|
135
135
|
async function spawnAiAgentsInWorktrees(items, fn, options) {
|
|
136
|
+
options = {
|
|
137
|
+
__proto__: null,
|
|
138
|
+
...options
|
|
139
|
+
};
|
|
136
140
|
const cleanup = options.cleanup ?? "always";
|
|
137
141
|
const namePrefix = options.namePrefix ?? "agent-task";
|
|
138
142
|
const concurrency = require_primordials_math.MathMax(1, Math.min(options.concurrency ?? DEFAULT_CONCURRENCY, MAX_CONCURRENCY));
|
package/dist/archives/tar.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
7
|
-
const require_archives__internal = require('./_internal.js');
|
|
8
7
|
const require_fs_safe = require('../fs/safe.js');
|
|
8
|
+
const require_archives__internal = require('./_internal.js');
|
|
9
9
|
let node_fs = require("node:fs");
|
|
10
10
|
let node_process = require("node:process");
|
|
11
11
|
node_process = require_runtime.__toESM(node_process);
|
package/dist/archives/zip.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
5
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
-
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
8
8
|
const require_node_path = require('../node/path.js');
|
|
9
9
|
const require_primordials_promise = require('../primordials/promise.js');
|
|
10
|
-
const require_archives__internal = require('./_internal.js');
|
|
11
10
|
const require_fs_safe = require('../fs/safe.js');
|
|
11
|
+
const require_archives__internal = require('./_internal.js');
|
|
12
12
|
|
|
13
13
|
//#region src/archives/zip.ts
|
|
14
14
|
/**
|
package/dist/argv/parse.d.ts
CHANGED
|
@@ -3,10 +3,28 @@
|
|
|
3
3
|
* yargs-parser with a Node.js parseArgs-compatible surface for booleans,
|
|
4
4
|
* strings, arrays, aliases, defaults, and coercion.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Yargs parser options interface.
|
|
8
|
+
*/
|
|
9
|
+
export interface YargsOptions {
|
|
10
|
+
boolean?: string[] | undefined;
|
|
11
|
+
string?: string[] | undefined;
|
|
12
|
+
array?: string[] | undefined;
|
|
13
|
+
alias?: Record<string, string | string[]> | undefined;
|
|
14
|
+
default?: Record<string, unknown> | undefined;
|
|
15
|
+
coerce?: Record<string, (value: unknown) => unknown> | undefined;
|
|
16
|
+
'unknown-options-as-args'?: boolean | undefined;
|
|
17
|
+
'parse-numbers'?: boolean | undefined;
|
|
18
|
+
'parse-positional-numbers'?: boolean | undefined;
|
|
19
|
+
'boolean-negation'?: boolean | undefined;
|
|
20
|
+
'halt-at-non-option'?: boolean | undefined;
|
|
21
|
+
configuration?: Record<string, boolean | string> | undefined;
|
|
22
|
+
strict?: boolean | undefined;
|
|
23
|
+
}
|
|
6
24
|
/**
|
|
7
25
|
* Yargs parser result interface.
|
|
8
26
|
*/
|
|
9
|
-
interface YargsArguments extends Record<string, unknown> {
|
|
27
|
+
export interface YargsArguments extends Record<string, unknown> {
|
|
10
28
|
_: string[];
|
|
11
29
|
$0?: string | undefined;
|
|
12
30
|
}
|
|
@@ -95,4 +113,3 @@ export declare function parseArgs<T = Record<string, unknown>>(config?: ParseArg
|
|
|
95
113
|
* ```
|
|
96
114
|
*/
|
|
97
115
|
export declare function parseArgsWithDefaults<T = Record<string, unknown>>(config?: ParseArgsConfig): ParsedArgs<T>;
|
|
98
|
-
export {};
|
package/dist/argv/parse.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
5
6
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
8
8
|
let node_process = require("node:process");
|
|
9
9
|
node_process = require_runtime.__toESM(node_process);
|
|
10
10
|
let src_external_yargs_parser = require("../external/yargs-parser");
|
package/dist/arrays/join.js
CHANGED
|
@@ -77,6 +77,10 @@ function joinAnd(arr) {
|
|
|
77
77
|
* @returns Formatted string
|
|
78
78
|
*/
|
|
79
79
|
function joinList(items, options) {
|
|
80
|
+
options = {
|
|
81
|
+
__proto__: null,
|
|
82
|
+
...options
|
|
83
|
+
};
|
|
80
84
|
const w = options?.with;
|
|
81
85
|
if (w === "and") return require_arrays__internal.getConjunctionFormatter().format(items.map(String));
|
|
82
86
|
if (w === "or") return require_arrays__internal.getDisjunctionFormatter().format(items.map(String));
|
package/dist/bin/find.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_constants_platform = require('../constants/platform.js');
|
|
6
|
+
const require_env_home = require('../env/home.js');
|
|
7
|
+
const require_env_xdg = require('../env/xdg.js');
|
|
6
8
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
9
|
const require_node_fs = require('../node/fs.js');
|
|
8
10
|
const require_node_path = require('../node/path.js');
|
|
9
11
|
const require_bin_which = require('./which.js');
|
|
10
|
-
const require_env_home = require('../env/home.js');
|
|
11
12
|
const require_env_windows = require('../env/windows.js');
|
|
12
|
-
const require_env_xdg = require('../env/xdg.js');
|
|
13
13
|
const require_bin_shadow = require('./shadow.js');
|
|
14
|
-
let src_external_which = require("../external/which");
|
|
15
|
-
src_external_which = require_runtime.__toESM(src_external_which);
|
|
16
14
|
let node_process = require("node:process");
|
|
17
15
|
node_process = require_runtime.__toESM(node_process);
|
|
16
|
+
let src_external_which = require("../external/which");
|
|
17
|
+
src_external_which = require_runtime.__toESM(src_external_which);
|
|
18
18
|
|
|
19
19
|
//#region src/bin/find.ts
|
|
20
20
|
/**
|