@manyoars/oars 0.1.1 → 0.3.0
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/README.md +134 -26
- package/dist/api.js +1 -1
- package/dist/bin.js +6 -29
- package/dist/cli.d.ts +6 -3
- package/dist/cli.js +370 -72
- package/dist/commands/keys.d.ts +31 -0
- package/dist/commands/keys.js +65 -0
- package/dist/commands/login.d.ts +1 -1
- package/dist/commands/login.js +3 -5
- package/dist/errors.d.ts +13 -13
- package/dist/errors.js +28 -11
- package/dist/gate/checks.d.ts +68 -0
- package/dist/gate/checks.js +584 -0
- package/dist/gate/command.d.ts +14 -0
- package/dist/gate/command.js +61 -0
- package/dist/gate/hook-fill-main.d.ts +1 -0
- package/dist/gate/hook-fill-main.js +16 -0
- package/dist/gate/hook-fill.d.ts +38 -0
- package/dist/gate/hook-fill.js +94 -0
- package/dist/gate/hook-main.d.ts +1 -0
- package/dist/gate/hook-main.js +35 -0
- package/dist/gate/hook-process.d.ts +14 -0
- package/dist/gate/hook-process.js +64 -0
- package/dist/gate/hook.d.ts +46 -0
- package/dist/gate/hook.js +256 -0
- package/dist/gate/install.d.ts +25 -0
- package/dist/gate/install.js +126 -0
- package/dist/gate/local-bin.d.ts +8 -0
- package/dist/gate/local-bin.js +36 -0
- package/dist/gate/notes.d.ts +19 -0
- package/dist/gate/notes.js +27 -0
- package/dist/gate/novelty.d.ts +35 -0
- package/dist/gate/novelty.js +99 -0
- package/dist/gate/policy.d.ts +25 -0
- package/dist/gate/policy.js +73 -0
- package/dist/gate/record.d.ts +120 -0
- package/dist/gate/record.js +125 -0
- package/dist/gate/registry-state.d.ts +10 -0
- package/dist/gate/registry-state.js +30 -0
- package/dist/gate/registry.d.ts +56 -0
- package/dist/gate/registry.js +94 -0
- package/dist/gate/replay.d.ts +20 -0
- package/dist/gate/replay.js +257 -0
- package/dist/gate/report.d.ts +50 -0
- package/dist/gate/report.js +89 -0
- package/dist/gate/scope.d.ts +7 -0
- package/dist/gate/scope.js +27 -0
- package/dist/gate/transcripts.d.ts +68 -0
- package/dist/gate/transcripts.js +232 -0
- package/dist/hook-bin.d.ts +1 -0
- package/dist/hook-bin.js +25 -0
- package/dist/issuer.d.ts +16 -0
- package/dist/issuer.js +55 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +64 -0
- package/dist/oidc.js +1 -1
- package/dist/sessions/actions.d.ts +35 -0
- package/dist/sessions/actions.js +351 -0
- package/dist/sessions/allow.d.ts +14 -0
- package/dist/sessions/allow.js +51 -0
- package/dist/sessions/archive.d.ts +11 -0
- package/dist/sessions/archive.js +38 -0
- package/dist/sessions/audit.d.ts +42 -0
- package/dist/sessions/audit.js +104 -0
- package/dist/sessions/baseline.d.ts +62 -0
- package/dist/sessions/baseline.js +188 -0
- package/dist/sessions/capture-runtime.d.ts +10 -0
- package/dist/sessions/capture-runtime.js +12 -0
- package/dist/sessions/cell-increments.d.ts +43 -0
- package/dist/sessions/cell-increments.js +209 -0
- package/dist/sessions/cells.d.ts +79 -0
- package/dist/sessions/cells.js +181 -0
- package/dist/sessions/codex.d.ts +53 -0
- package/dist/sessions/codex.js +679 -0
- package/dist/sessions/command.d.ts +117 -0
- package/dist/sessions/command.js +373 -0
- package/dist/sessions/copilot.d.ts +40 -0
- package/dist/sessions/copilot.js +432 -0
- package/dist/sessions/cursor.d.ts +24 -0
- package/dist/sessions/cursor.js +324 -0
- package/dist/sessions/derive.d.ts +57 -0
- package/dist/sessions/derive.js +320 -0
- package/dist/sessions/exclusion.d.ts +81 -0
- package/dist/sessions/exclusion.js +353 -0
- package/dist/sessions/extract.d.ts +179 -0
- package/dist/sessions/extract.js +1774 -0
- package/dist/sessions/fold.d.ts +17 -0
- package/dist/sessions/fold.js +71 -0
- package/dist/sessions/frame.d.ts +24 -0
- package/dist/sessions/frame.js +95 -0
- package/dist/sessions/gemini.d.ts +37 -0
- package/dist/sessions/gemini.js +613 -0
- package/dist/sessions/gold-arms.d.ts +67 -0
- package/dist/sessions/gold-arms.js +172 -0
- package/dist/sessions/gold.d.ts +197 -0
- package/dist/sessions/gold.js +463 -0
- package/dist/sessions/graph.d.ts +12 -0
- package/dist/sessions/graph.js +34 -0
- package/dist/sessions/grok.d.ts +36 -0
- package/dist/sessions/grok.js +421 -0
- package/dist/sessions/hook-calls.d.ts +3 -0
- package/dist/sessions/hook-calls.js +47 -0
- package/dist/sessions/hook-index.d.ts +53 -0
- package/dist/sessions/hook-index.js +157 -0
- package/dist/sessions/hooks.d.ts +13 -0
- package/dist/sessions/hooks.js +170 -0
- package/dist/sessions/identity.d.ts +22 -0
- package/dist/sessions/identity.js +101 -0
- package/dist/sessions/install.d.ts +54 -0
- package/dist/sessions/install.js +201 -0
- package/dist/sessions/lineage.d.ts +19 -0
- package/dist/sessions/lineage.js +118 -0
- package/dist/sessions/mcp.d.ts +6 -0
- package/dist/sessions/mcp.js +153 -0
- package/dist/sessions/merkle.d.ts +7 -0
- package/dist/sessions/merkle.js +28 -0
- package/dist/sessions/motif.d.ts +43 -0
- package/dist/sessions/motif.js +59 -0
- package/dist/sessions/package-resolve.d.ts +30 -0
- package/dist/sessions/package-resolve.js +183 -0
- package/dist/sessions/pending.d.ts +34 -0
- package/dist/sessions/pending.js +142 -0
- package/dist/sessions/pool-command.d.ts +44 -0
- package/dist/sessions/pool-command.js +542 -0
- package/dist/sessions/pool-delta.d.ts +54 -0
- package/dist/sessions/pool-delta.js +190 -0
- package/dist/sessions/pool-outbox.d.ts +63 -0
- package/dist/sessions/pool-outbox.js +260 -0
- package/dist/sessions/pool-print.d.ts +26 -0
- package/dist/sessions/pool-print.js +68 -0
- package/dist/sessions/pool-wire.d.ts +225 -0
- package/dist/sessions/pool-wire.js +620 -0
- package/dist/sessions/pool.d.ts +32 -0
- package/dist/sessions/pool.js +164 -0
- package/dist/sessions/projection.d.ts +75 -0
- package/dist/sessions/projection.js +165 -0
- package/dist/sessions/public-vocabulary.d.ts +73 -0
- package/dist/sessions/public-vocabulary.js +302 -0
- package/dist/sessions/query.d.ts +111 -0
- package/dist/sessions/query.js +246 -0
- package/dist/sessions/read-adoption.d.ts +2 -0
- package/dist/sessions/read-adoption.js +27 -0
- package/dist/sessions/read-call-shape.d.ts +2 -0
- package/dist/sessions/read-call-shape.js +25 -0
- package/dist/sessions/read-change.d.ts +2 -0
- package/dist/sessions/read-change.js +30 -0
- package/dist/sessions/read-cost.d.ts +4 -0
- package/dist/sessions/read-cost.js +37 -0
- package/dist/sessions/read-day-move.d.ts +3 -0
- package/dist/sessions/read-day-move.js +65 -0
- package/dist/sessions/read-fit.d.ts +7 -0
- package/dist/sessions/read-fit.js +41 -0
- package/dist/sessions/read-interaction.d.ts +5 -0
- package/dist/sessions/read-interaction.js +62 -0
- package/dist/sessions/read-lead-lag.d.ts +15 -0
- package/dist/sessions/read-lead-lag.js +81 -0
- package/dist/sessions/read-live.d.ts +6 -0
- package/dist/sessions/read-live.js +38 -0
- package/dist/sessions/read-method.d.ts +2 -0
- package/dist/sessions/read-method.js +29 -0
- package/dist/sessions/read-next-step.d.ts +2 -0
- package/dist/sessions/read-next-step.js +35 -0
- package/dist/sessions/read-order.d.ts +54 -0
- package/dist/sessions/read-order.js +62 -0
- package/dist/sessions/read-readable.d.ts +8 -0
- package/dist/sessions/read-readable.js +24 -0
- package/dist/sessions/read-recovery.d.ts +20 -0
- package/dist/sessions/read-recovery.js +97 -0
- package/dist/sessions/read-rows.d.ts +13 -0
- package/dist/sessions/read-rows.js +47 -0
- package/dist/sessions/read-substitution.d.ts +5 -0
- package/dist/sessions/read-substitution.js +51 -0
- package/dist/sessions/read-support.d.ts +48 -0
- package/dist/sessions/read-support.js +73 -0
- package/dist/sessions/read-tool-day.d.ts +2 -0
- package/dist/sessions/read-tool-day.js +26 -0
- package/dist/sessions/read-version-boundary.d.ts +31 -0
- package/dist/sessions/read-version-boundary.js +95 -0
- package/dist/sessions/read.d.ts +79 -0
- package/dist/sessions/read.js +84 -0
- package/dist/sessions/recall-consequence.d.ts +45 -0
- package/dist/sessions/recall-consequence.js +179 -0
- package/dist/sessions/recall-object.d.ts +137 -0
- package/dist/sessions/recall-object.js +77 -0
- package/dist/sessions/recall-pool.d.ts +19 -0
- package/dist/sessions/recall-pool.js +96 -0
- package/dist/sessions/recall-push.d.ts +26 -0
- package/dist/sessions/recall-push.js +95 -0
- package/dist/sessions/recall-reads.d.ts +117 -0
- package/dist/sessions/recall-reads.js +410 -0
- package/dist/sessions/recall-render.d.ts +19 -0
- package/dist/sessions/recall-render.js +168 -0
- package/dist/sessions/redact.d.ts +6 -0
- package/dist/sessions/redact.js +54 -0
- package/dist/sessions/repo-root.d.ts +10 -0
- package/dist/sessions/repo-root.js +101 -0
- package/dist/sessions/schema.d.ts +644 -0
- package/dist/sessions/schema.js +148 -0
- package/dist/sessions/session-shape.d.ts +73 -0
- package/dist/sessions/session-shape.js +342 -0
- package/dist/sessions/sources.d.ts +50 -0
- package/dist/sessions/sources.js +159 -0
- package/dist/sessions/steps.d.ts +105 -0
- package/dist/sessions/steps.js +250 -0
- package/dist/sessions/store.d.ts +297 -0
- package/dist/sessions/store.js +1478 -0
- package/dist/sessions/strata.d.ts +26 -0
- package/dist/sessions/strata.js +77 -0
- package/dist/sessions/survival.d.ts +25 -0
- package/dist/sessions/survival.js +230 -0
- package/dist/sessions/verify.d.ts +53 -0
- package/dist/sessions/verify.js +286 -0
- package/dist/sessions/vocab-load.d.ts +26 -0
- package/dist/sessions/vocab-load.js +61 -0
- package/dist/sessions/vscode-copilot.d.ts +38 -0
- package/dist/sessions/vscode-copilot.js +477 -0
- package/package.json +4 -5
- package/vocab/crates.json +1 -0
- package/vocab/go.json +1 -0
- package/vocab/harness.json +1 -0
- package/vocab/homebrew.json +1 -0
- package/vocab/manifest.json +1 -0
- package/vocab/maven.json +1 -0
- package/vocab/models.json +1 -0
- package/vocab/npm.json +1 -0
- package/vocab/programs.json +1 -0
- package/vocab/pypi.json +1 -0
- package/vocab/rubygems.json +1 -0
- package/dist/commands/deploy-input.d.ts +0 -35
- package/dist/commands/deploy-input.js +0 -107
- package/dist/commands/deploy.d.ts +0 -22
- package/dist/commands/deploy.js +0 -120
- package/dist/commands/status.d.ts +0 -7
- package/dist/commands/status.js +0 -18
- package/dist/commands/test-charge.d.ts +0 -11
- package/dist/commands/test-charge.js +0 -34
- package/dist/journal.d.ts +0 -26
- package/dist/journal.js +0 -58
- package/parity/deploy-plans/paid-api.json +0 -34
- package/parity/deploy-plans/per-task-agent.json +0 -34
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
// The public vocabulary (recall spec Sections 2.1, 2.2, and 7): the one file that says which names may stand in a class P field of a
|
|
2
|
+
// captured step (the frame's fields pool only as cells). Anything else becomes `<literal>`, so a private script, host, package, or server name never reaches a pooled field.
|
|
3
|
+
//
|
|
4
|
+
// A simple list on purpose, and it fails closed: a missing public name costs a `<literal>`, while a wrongly listed one costs a leak. The D11 and
|
|
5
|
+
// D13 vocabulary spec owns the final list and wins on what may leave the machine. This repository is public, so nothing private is ever added here.
|
|
6
|
+
/** What every name outside this file becomes. */
|
|
7
|
+
export const LITERAL = '<literal>';
|
|
8
|
+
export const REPO_SIZES = ['xs', 's', 'm', 'l', 'xl'];
|
|
9
|
+
/** A stored size bucket: null is a size that could not be read, and undefined is a value that is not one. */
|
|
10
|
+
export const asRepoSize = (value) => (value === null ? null : REPO_SIZES.find((size) => size === value));
|
|
11
|
+
/** File extension to language: the stack's language mix. */
|
|
12
|
+
export const LANGUAGE_OF_EXTENSION = new Map([
|
|
13
|
+
['ts', 'typescript'],
|
|
14
|
+
['tsx', 'typescript'],
|
|
15
|
+
['mts', 'typescript'],
|
|
16
|
+
['cts', 'typescript'],
|
|
17
|
+
['js', 'javascript'],
|
|
18
|
+
['jsx', 'javascript'],
|
|
19
|
+
['mjs', 'javascript'],
|
|
20
|
+
['cjs', 'javascript'],
|
|
21
|
+
['py', 'python'],
|
|
22
|
+
['java', 'java'],
|
|
23
|
+
['kt', 'kotlin'],
|
|
24
|
+
['go', 'go'],
|
|
25
|
+
['rs', 'rust'],
|
|
26
|
+
['rb', 'ruby'],
|
|
27
|
+
['php', 'php'],
|
|
28
|
+
['cs', 'csharp'],
|
|
29
|
+
['c', 'c'],
|
|
30
|
+
['h', 'c'],
|
|
31
|
+
['cpp', 'cpp'],
|
|
32
|
+
['hpp', 'cpp'],
|
|
33
|
+
['swift', 'swift'],
|
|
34
|
+
['scala', 'scala'],
|
|
35
|
+
['sh', 'shell'],
|
|
36
|
+
['ps1', 'powershell'],
|
|
37
|
+
['sql', 'sql'],
|
|
38
|
+
['astro', 'astro'],
|
|
39
|
+
['vue', 'vue'],
|
|
40
|
+
['svelte', 'svelte'],
|
|
41
|
+
['css', 'css'],
|
|
42
|
+
['html', 'html'],
|
|
43
|
+
]);
|
|
44
|
+
export const LANGUAGES = new Set(LANGUAGE_OF_EXTENSION.values());
|
|
45
|
+
/** A touched file's base name to the framework it shows. */
|
|
46
|
+
export const FRAMEWORK_OF_FILE = [
|
|
47
|
+
[/^pom\.xml$/, 'maven'],
|
|
48
|
+
[/^build\.gradle(\.kts)?$/, 'gradle'],
|
|
49
|
+
[/^vite\.config\.[a-z]+$/, 'vite'],
|
|
50
|
+
[/^vitest\.config\.[a-z]+$/, 'vitest'],
|
|
51
|
+
[/^astro\.config\.[a-z]+$/, 'astro'],
|
|
52
|
+
[/^next\.config\.[a-z]+$/, 'next'],
|
|
53
|
+
[/^nuxt\.config\.[a-z]+$/, 'nuxt'],
|
|
54
|
+
[/^svelte\.config\.[a-z]+$/, 'svelte'],
|
|
55
|
+
[/^angular\.json$/, 'angular'],
|
|
56
|
+
[/^tailwind\.config\.[a-z]+$/, 'tailwind'],
|
|
57
|
+
[/^playwright\.config\.[a-z]+$/, 'playwright'],
|
|
58
|
+
[/^jest\.config\.[a-z]+$/, 'jest'],
|
|
59
|
+
[/^wrangler\.(toml|jsonc?)$/, 'cloudflare-workers'],
|
|
60
|
+
[/^Cargo\.toml$/, 'cargo'],
|
|
61
|
+
[/^go\.mod$/, 'go-modules'],
|
|
62
|
+
[/^Dockerfile$/, 'docker'],
|
|
63
|
+
[/^manage\.py$/, 'django'],
|
|
64
|
+
[/^Gemfile$/, 'bundler'],
|
|
65
|
+
[/\.tf$/, 'terraform'],
|
|
66
|
+
[/\.csproj$/, 'dotnet'],
|
|
67
|
+
];
|
|
68
|
+
/** A program a shell call ran to the framework it shows. */
|
|
69
|
+
export const FRAMEWORK_OF_PROGRAM = new Map([
|
|
70
|
+
['mvn', 'maven'],
|
|
71
|
+
['mvnw', 'maven'],
|
|
72
|
+
['gradle', 'gradle'],
|
|
73
|
+
['gradlew', 'gradle'],
|
|
74
|
+
['vite', 'vite'],
|
|
75
|
+
['vitest', 'vitest'],
|
|
76
|
+
['astro', 'astro'],
|
|
77
|
+
['playwright', 'playwright'],
|
|
78
|
+
['jest', 'jest'],
|
|
79
|
+
['wrangler', 'cloudflare-workers'],
|
|
80
|
+
['cargo', 'cargo'],
|
|
81
|
+
['docker', 'docker'],
|
|
82
|
+
['kubectl', 'kubernetes'],
|
|
83
|
+
['helm', 'kubernetes'],
|
|
84
|
+
['terraform', 'terraform'],
|
|
85
|
+
['dotnet', 'dotnet'],
|
|
86
|
+
['rails', 'rails'],
|
|
87
|
+
]);
|
|
88
|
+
export const FRAMEWORKS = new Set([...FRAMEWORK_OF_FILE.map(([, name]) => name), ...FRAMEWORK_OF_PROGRAM.values()]);
|
|
89
|
+
const EFFORTS = new Set(['low', 'medium', 'high', 'xhigh', 'max', 'auto']);
|
|
90
|
+
// Published shapes only, each part a version or a word from the closed list, so a gateway or fine-tune name under a known family fails closed.
|
|
91
|
+
const MODEL_VERSION = '[a-z]?\\d[\\d.]*[a-z]?';
|
|
92
|
+
const MODEL_WORD = 'mini|nano|pro|max|lite|turbo|flash|ultra|large|medium|small|tiny|high|low|fast|code|codex|coder|chat|reasoner|thinking|exp|preview|latest|instant';
|
|
93
|
+
const CLAUDE_TIER = 'opus|sonnet|haiku|fable';
|
|
94
|
+
const MODEL = new RegExp([
|
|
95
|
+
`^claude-(?:${CLAUDE_TIER})(?:-\\d[\\d.]*)*$`,
|
|
96
|
+
`^claude-\\d[\\d.]*(?:-\\d+)*(?:-(?:${CLAUDE_TIER}|instant)(?:-\\d+)*)?$`,
|
|
97
|
+
`^(?:gpt|o[134]|gemini|codex|composer|cursor|grok|deepseek|llama|mistral|qwen|kimi|glm)(?:-?${MODEL_VERSION})?(?:-(?:${MODEL_VERSION}|${MODEL_WORD}))*$`,
|
|
98
|
+
'^(?:auto|default)$',
|
|
99
|
+
].join('|'));
|
|
100
|
+
// A suffix is digits or a release word, so a private build tag fails closed, as a private name does in `MODEL`.
|
|
101
|
+
const VERSION_SUFFIX = '(?:[-+.](?:\\d+|(?:alpha|beta|rc|dev|canary|nightly|next)\\d*))*';
|
|
102
|
+
const VERSION = new RegExp(`^\\d+(?:\\.\\d+){0,3}${VERSION_SUFFIX}$`);
|
|
103
|
+
/** A name this long is not one of these: it is text someone pasted. */
|
|
104
|
+
const NAME_MAX = 64;
|
|
105
|
+
const orLiteral = (value, isPublic) => (value === null || (value.length <= NAME_MAX && isPublic(value)) ? value : LITERAL);
|
|
106
|
+
export const publicEffort = (value) => orLiteral(value, (effort) => EFFORTS.has(effort));
|
|
107
|
+
export const publicModel = (value) => orLiteral(value, (model) => MODEL.test(model));
|
|
108
|
+
export const publicVersion = (value) => orLiteral(value, (version) => VERSION.test(version));
|
|
109
|
+
const words = (text) => new Set(text.split(/\s+/).filter((word) => word !== ''));
|
|
110
|
+
/** Programs whose short flags are commonly bundled, as in `rm -rf`. Elsewhere a short lowercase run is more likely a value joined to its flag, as in `mysql -pabc`. */
|
|
111
|
+
export const BUNDLING_PROGRAMS = new Set(words(`
|
|
112
|
+
rm cp mv ls mkdir chmod chown ln touch tar zip unzip gzip gunzip grep rg sed awk sort uniq wc cut head tail du df ps kill
|
|
113
|
+
xargs git curl wget rsync diff tr bash sh zsh docker
|
|
114
|
+
`));
|
|
115
|
+
/** Programs anyone can install or a system ships. A private script or binary is not here, so it reads as the literal. */
|
|
116
|
+
export const PUBLIC_PROGRAMS = new Set([
|
|
117
|
+
...FRAMEWORK_OF_PROGRAM.keys(),
|
|
118
|
+
...words(`
|
|
119
|
+
git gh glab svn hg
|
|
120
|
+
for foreach while until case select break continue exit return read shift throw param trap wait
|
|
121
|
+
od basename dirname cygpath cmp fold paste seq rev sum
|
|
122
|
+
get-date out-string out-null out-file start-sleep get-ciminstance import-module format-table format-list convertfrom-json convertto-json resolve-path
|
|
123
|
+
tee-object get-member join-path split-path start-threadjob start-job receive-job wait-job push-location pop-location set-location
|
|
124
|
+
npm npx pnpm yarn bun deno node nvm tsc eslint prettier biome turbo nx webpack rollup esbuild tsx
|
|
125
|
+
python python3 py pip pip3 pipx uv uvx poetry pytest ruff mypy black tox conda
|
|
126
|
+
java javac jar kotlin scala sbt go gofmt rustc rustup ruby gem bundle rake php composer perl lua swift nuget make cmake just gcc clang brew
|
|
127
|
+
docker-compose podman k3d kind minikube aws az gcloud flyctl vercel netlify stripe psql mysql sqlite3 redis-cli curl wget ssh scp rsync
|
|
128
|
+
ls dir cat type head tail less more wc sort uniq cut tr sed awk grep rg find fd tree du df stat file touch mkdir rmdir rm cp mv ln chmod chown pwd cd pushd popd
|
|
129
|
+
echo printf test true false sleep date which where whoami hostname export set unset source tee xargs diff patch tar zip unzip gzip gunzip jq yq sha256sum md5sum base64
|
|
130
|
+
ps kill killall pkill pgrep top lsof netstat taskkill tasklist bash sh zsh dash fish pwsh powershell cmd code cursor claude codex copilot gemini oars
|
|
131
|
+
get-childitem get-content set-content add-content get-item set-item new-item remove-item copy-item move-item rename-item test-path select-string select-object where-object foreach-object sort-object measure-object get-process stop-process start-process write-output write-host out-file get-command set-location get-location invoke-webrequest invoke-restmethod
|
|
132
|
+
`),
|
|
133
|
+
]);
|
|
134
|
+
/** The subcommands of a public program. Only a program whose subcommands are its own public interface is here: a `just` recipe or a `make` target belongs to the repository. */
|
|
135
|
+
export const PUBLIC_SUBCOMMANDS = new Map(Object.entries({
|
|
136
|
+
git: 'add am apply bisect blame branch checkout cherry-pick clean clone commit config describe diff fetch format-patch gc grep init log ls-files ls-remote ls-tree merge merge-base mv pull push rebase reflog remote reset restore revert rev-list rev-parse rm shortlog show stash status submodule switch symbolic-ref tag update-index worktree',
|
|
137
|
+
gh: 'alias api auth browse cache codespace config extension gist issue label pr release repo run search secret ssh-key status variable workflow',
|
|
138
|
+
npm: 'access audit ci config create dedupe exec explain fund help init install link list login logout ls outdated pack prune publish rebuild root run run-script test uninstall unlink update version view whoami',
|
|
139
|
+
pnpm: 'add audit create dlx exec init install link list outdated publish remove run store test update why',
|
|
140
|
+
yarn: 'add audit create dlx exec init install link list outdated remove run test upgrade why',
|
|
141
|
+
bun: 'add build create init install link pm publish remove run test update x',
|
|
142
|
+
deno: 'add bench check compile fmt info init install lint publish run task test',
|
|
143
|
+
pip: 'cache check config download freeze hash index install list show uninstall wheel',
|
|
144
|
+
pip3: 'cache check config download freeze hash index install list show uninstall wheel',
|
|
145
|
+
pipx: 'ensurepath inject install list reinstall run uninstall upgrade',
|
|
146
|
+
uv: 'add build cache init lock pip publish python remove run sync tool tree venv',
|
|
147
|
+
poetry: 'add build check config export init install lock publish remove run shell show update',
|
|
148
|
+
go: 'bug build clean doc env fix fmt generate get install list mod run test tool version vet work',
|
|
149
|
+
cargo: 'add bench build check clean clippy doc fetch fix fmt init install metrics new publish remove run search test tree uninstall update',
|
|
150
|
+
rustup: 'check component default install override show target toolchain update',
|
|
151
|
+
dotnet: 'add build clean format list new nuget pack publish remove restore run sln test tool',
|
|
152
|
+
mvn: 'clean compile dependency:tree deploy install package site test test-compile validate verify',
|
|
153
|
+
mvnw: 'clean compile dependency:tree deploy install package site test test-compile validate verify',
|
|
154
|
+
gradle: 'assemble bootRun build check clean dependencies jar tasks test wrapper',
|
|
155
|
+
gradlew: 'assemble bootRun build check clean dependencies jar tasks test wrapper',
|
|
156
|
+
gem: 'build environment install list outdated push search uninstall update',
|
|
157
|
+
bundle: 'add check config exec init install list lock outdated remove show update',
|
|
158
|
+
brew: 'cask cleanup doctor info install leaves link list outdated search services tap uninstall unlink update upgrade',
|
|
159
|
+
docker: 'attach build buildx commit compose context cp create diff events exec export history image images import info inspect kill load login logout logs network node pause port ps pull push rename restart rm rmi run save search secret service stack start stats stop swarm system tag top unpause update version volume wait',
|
|
160
|
+
'docker-compose': 'build config create down events exec images kill logs pause port ps pull push restart rm run start stop top unpause up version',
|
|
161
|
+
kubectl: 'annotate api-resources apply attach auth autoscale cluster-info config cordon cp create debug delete describe diff drain edit events exec explain expose get kustomize label logs patch port-forward proxy replace rollout run scale set taint top uncordon version wait',
|
|
162
|
+
helm: 'create dependency diff get history install lint list package pull push repo rollback search show status template test uninstall upgrade verify version',
|
|
163
|
+
terraform: 'apply console destroy fmt force-unlock get graph import init output plan providers refresh show state taint test untaint validate version workspace',
|
|
164
|
+
aws: 'cloudformation cloudfront configure dynamodb ec2 ecr ecs eks iam kms lambda logs rds route53 s3 s3api secretsmanager sns sqs ssm sts',
|
|
165
|
+
gcloud: 'app auth builds compute config container functions iam projects run secrets services sql storage',
|
|
166
|
+
az: 'account acr aks group keyvault login network storage vm webapp',
|
|
167
|
+
wrangler: 'd1 deploy dev init kv login logout pages queues r2 secret tail types versions whoami',
|
|
168
|
+
vitest: 'bench dev related run typecheck watch',
|
|
169
|
+
playwright: 'codegen install show-report test',
|
|
170
|
+
astro: 'add build check dev preview sync',
|
|
171
|
+
vite: 'build dev optimize preview',
|
|
172
|
+
oars: 'allow api audit config deposit derive doctor help init install login measure pull push recall sessions status verify',
|
|
173
|
+
claude: 'agents config doctor install mcp plugin setup-token update',
|
|
174
|
+
}).map(([program, list]) => [program, words(list)]));
|
|
175
|
+
/** Flag names of common public programs. A flag name on another program can be a private script's, so an unlisted name reads as the literal. */
|
|
176
|
+
export const PUBLIC_FLAGS = words(`
|
|
177
|
+
--all --allow-empty --amend --author --base --body --branch --build --cached --check --chdir --ci --clean --color --config --context --count --coverage
|
|
178
|
+
--create --cwd --debug --decorate --delete --depth --detach --dir --directory --dry-run --edit --env --exclude --exit-code --fail --file --filter --fix
|
|
179
|
+
--follow --force --force-with-lease --format --from --global --graph --hard --head --help --ignore-case --include --info --init --interactive --json --jq
|
|
180
|
+
--label --limit --line-number --list --lockfile-only --message --method --mixed --name --name-only --name-status --namespace --no-cache --no-color --no-edit
|
|
181
|
+
--no-ff --no-install --no-pager --no-verify --no-save --noEmit --numstat --oneline --only --output --package --parents --path --porcelain --port --prefix
|
|
182
|
+
--production --project --prune --pretty --quiet --recursive --reporter --repo --reverse --rm --run --save --save-dev --set-upstream --short --show-current
|
|
183
|
+
--silent --since --skip-tests --soft --stat --state --tags --target --template --title --token --until --update --user --verbose --version --watch --web --workspace --yes
|
|
184
|
+
--abbrev-ref --abort --contains --continue --ff-only --first-parent --ignored --is-ancestor --is-inside-work-tree --max-count --merged --no-commit
|
|
185
|
+
--no-merges --no-rebase --no-stat --others --remotes --show-toplevel --staged --stdin
|
|
186
|
+
-AllMatches -Append -Compress -Confirm -Context -Descending -Directory -Encoding -Exclude -ExpandProperty -File -First -ItemType -Last -Milliseconds -Name
|
|
187
|
+
-NoNewline -Property -Seconds -SimpleMatch -Skip -TotalCount -Unique -Value -Wait
|
|
188
|
+
-Command -Depth -ErrorAction -ExecutionPolicy -Filter -Force -Include -LiteralPath -NoLogo -NoProfile -NonInteractive -Path -Pattern -Raw -Recurse -Tail
|
|
189
|
+
`);
|
|
190
|
+
/** Hosts that say nothing about who asked. Matched whole: `acme.github.io` names a customer even though `github.io` is public. */
|
|
191
|
+
export const PUBLIC_HOSTS = words(`
|
|
192
|
+
github.com raw.githubusercontent.com gist.github.com docs.github.com api.github.com gitlab.com bitbucket.org stackoverflow.com superuser.com serverfault.com
|
|
193
|
+
en.wikipedia.org developer.mozilla.org npmjs.com www.npmjs.com registry.npmjs.org pypi.org docs.python.org crates.io docs.rs pkg.go.dev go.dev rubygems.org
|
|
194
|
+
docs.oracle.com spring.io docs.spring.io maven.apache.org kubernetes.io docs.docker.com hub.docker.com nodejs.org react.dev vite.dev vitejs.dev typescriptlang.org
|
|
195
|
+
www.typescriptlang.org docs.astro.build developers.cloudflare.com docs.stripe.com stripe.com docs.anthropic.com docs.claude.com code.claude.com learn.microsoft.com
|
|
196
|
+
docs.aws.amazon.com cloud.google.com platform.openai.com arxiv.org medium.com dev.to news.ycombinator.com reddit.com www.reddit.com youtube.com www.youtube.com
|
|
197
|
+
`);
|
|
198
|
+
/** MCP servers published for anyone to install. A server someone named themselves can name their company, so it reads as the literal. */
|
|
199
|
+
export const PUBLIC_MCP_SERVERS = words(`
|
|
200
|
+
claude-in-chrome playwright puppeteer github gitlab filesystem fetch memory sequential-thinking context7 sentry
|
|
201
|
+
linear notion slack postgres sqlite stripe cloudflare supabase vercel figma atlassian exa tavily brave-search oars oars-sessions
|
|
202
|
+
`);
|
|
203
|
+
/**
|
|
204
|
+
* Tools the published server of that name serves, by server. A server name is a label the user picks, so an allowlisted server does not make
|
|
205
|
+
* its tools public: anything not listed under the server reads as the literal, and a server with no entry here has every tool read that way.
|
|
206
|
+
*/
|
|
207
|
+
export const PUBLIC_MCP_TOOLS = new Map(Object.entries({
|
|
208
|
+
'claude-in-chrome': 'browser_batch computer file_upload find form_input get_page_text gif_creator javascript_tool list_connected_browsers navigate read_console_messages read_network_requests read_page resize_window select_browser shortcuts_execute shortcuts_list switch_browser tabs_close_mcp tabs_context_mcp tabs_create_mcp upload_image',
|
|
209
|
+
playwright: 'browser_click browser_close browser_console_messages browser_drag browser_evaluate browser_file_upload browser_fill_form browser_handle_dialog browser_hover browser_install browser_navigate browser_navigate_back browser_network_requests browser_press_key browser_resize browser_select_option browser_snapshot browser_tabs browser_take_screenshot browser_type browser_wait_for',
|
|
210
|
+
puppeteer: 'puppeteer_click puppeteer_evaluate puppeteer_fill puppeteer_hover puppeteer_navigate puppeteer_screenshot puppeteer_select',
|
|
211
|
+
github: 'add_issue_comment create_branch create_issue create_or_update_file create_pull_request create_repository delete_file fork_repository get_commit get_file_contents get_issue get_me get_pull_request issue_read issue_write list_branches list_commits list_issues list_pull_requests merge_pull_request pull_request_read push_files search_code search_issues search_pull_requests search_repositories search_users update_issue update_pull_request',
|
|
212
|
+
filesystem: 'create_directory directory_tree edit_file get_file_info list_allowed_directories list_directory list_directory_with_sizes move_file read_file read_media_file read_multiple_files read_text_file search_files write_file',
|
|
213
|
+
memory: 'add_observations create_entities create_relations delete_entities delete_observations delete_relations open_nodes read_graph search_nodes',
|
|
214
|
+
'sequential-thinking': 'sequentialthinking',
|
|
215
|
+
fetch: 'fetch',
|
|
216
|
+
postgres: 'query',
|
|
217
|
+
sqlite: 'append_insight create_table describe_table list_tables read_query write_query',
|
|
218
|
+
context7: 'get-library-docs query-docs resolve-library-id',
|
|
219
|
+
oars: 'oars_recall',
|
|
220
|
+
'oars-sessions': 'oars_recall',
|
|
221
|
+
}).map(([server, tools]) => [server, words(tools)]));
|
|
222
|
+
/** Skills published for anyone to install. */
|
|
223
|
+
export const PUBLIC_SKILLS = words(`
|
|
224
|
+
pdf docx xlsx pptx skill-creator frontend-design webapp-testing mcp-builder canvas-design algorithmic-art theme-factory brand-guidelines internal-comms slack-gif-creator web-artifacts-builder
|
|
225
|
+
commit review code-review compact init schedule loop simplify security-review debug
|
|
226
|
+
`);
|
|
227
|
+
/** Packages a public registry serves and many projects use. No registry is asked at capture, so anything else reads as the literal, including a real public package missing here. */
|
|
228
|
+
export const PUBLIC_PACKAGES = words(`
|
|
229
|
+
typescript vitest jest eslint prettier vite astro react react-dom next vue svelte express fastify lodash axios zod tsx esbuild webpack rollup turbo pnpm yarn wrangler playwright @playwright/test
|
|
230
|
+
@types/node @types/react @types/react-dom @anthropic-ai/sdk @anthropic-ai/claude-code @modelcontextprotocol/sdk @modelcontextprotocol/inspector tailwindcss postcss autoprefixer nodemon dotenv
|
|
231
|
+
requests numpy pandas scipy flask django fastapi uvicorn pytest ruff mypy black httpx pydantic anthropic openai pillow pyyaml beautifulsoup4 boto3 setuptools wheel pip uv
|
|
232
|
+
serde tokio clap anyhow thiserror reqwest rails rake bundler
|
|
233
|
+
`);
|
|
234
|
+
const REGISTRY_VERSION = new RegExp(`^[~^<>=!]*v?\\d+(?:\\.(?:\\d+|x|\\*))*${VERSION_SUFFIX}$`);
|
|
235
|
+
export const isRegistryVersion = (version) => version.length <= NAME_MAX && REGISTRY_VERSION.test(version);
|
|
236
|
+
export const isPublicMcpTool = (server, tool) => PUBLIC_MCP_TOOLS.get(server)?.has(tool) === true;
|
|
237
|
+
// The pooled vocabulary (pool vocabulary spec Section 1.3). Everything above is what capture keeps in a P field; everything below is what may
|
|
238
|
+
// leave the machine. The pinned snapshots live in packages/cli/vocab/ and are loaded by vocab-load.ts, so this file stays free of the filesystem
|
|
239
|
+
// and the pool's Worker can bundle it.
|
|
240
|
+
/**
|
|
241
|
+
* The version of every pinned snapshot and curated list below, as one number. Change a snapshot file or any curated list in vocab-pin.test.ts's
|
|
242
|
+
* `curatedDigest`, and bump it: that test fails otherwise.
|
|
243
|
+
*/
|
|
244
|
+
export const VOCAB_VERSION = '1';
|
|
245
|
+
/** The day the snapshots were taken. It must equal `snapshotDate` in vocab/manifest.json, which the loader checks. */
|
|
246
|
+
export const VOCAB_SNAPSHOT_DATE = '2026-11-04';
|
|
247
|
+
/** How old a snapshot may be before `deposit` builds no batch (spec Section 7, `registry_max_age`). */
|
|
248
|
+
export const REGISTRY_MAX_AGE_DAYS = 30;
|
|
249
|
+
/** Names admitted per package ecosystem, by the registry's own download counts (spec Section 7, `seed_top`). */
|
|
250
|
+
export const SEED_TOP = 1000;
|
|
251
|
+
/** The longest ordered `program` list a compound command pools as (spec Section 7, `pipe_max`). */
|
|
252
|
+
export const PIPE_MAX = 4;
|
|
253
|
+
/** What a name that is not admitted pools as. */
|
|
254
|
+
export const PRIVATE = 'private';
|
|
255
|
+
const DAY_MS = 86_400_000;
|
|
256
|
+
/** A client more than `registry_max_age` past its snapshot builds no batch (the exact elapsed time, not whole days): its sessions wait in `A` until it upgrades. */
|
|
257
|
+
export const isVocabularyExpired = (now) => now.getTime() - Date.parse(`${VOCAB_SNAPSHOT_DATE}T00:00:00Z`) > REGISTRY_MAX_AGE_DAYS * DAY_MS;
|
|
258
|
+
/** The built-in tools of Claude Code, by the names a transcript records. Curated, since no registry publishes them (spec Section 1.3, the name seed). */
|
|
259
|
+
export const HARNESS_TOOLS = new Map(Object.entries({
|
|
260
|
+
'claude-code': 'Agent AskUserQuestion Bash BashOutput Edit EnterPlanMode ExitPlanMode Glob Grep KillBash KillShell MultiEdit NotebookEdit NotebookRead Read SlashCommand Skill Task TaskCreate TaskGet TaskList TaskOutput TaskStop TaskUpdate TodoRead TodoWrite ToolSearch WebFetch WebSearch Write',
|
|
261
|
+
}).map(([harness, tools]) => [harness, words(tools)]));
|
|
262
|
+
/**
|
|
263
|
+
* The built-in subagent types of each harness, by the names a transcript records (`agentType`). Curated, since no registry publishes them. No plugin registry
|
|
264
|
+
* is pinned yet, so an admitted plugin agent is not on this list and pools as `custom` (spec Section 2).
|
|
265
|
+
*/
|
|
266
|
+
export const HARNESS_AGENT_TYPES = new Map(Object.entries({
|
|
267
|
+
'claude-code': 'general-purpose Explore Plan statusline-setup output-style-setup claude-code-guide',
|
|
268
|
+
}).map(([harness, types]) => [harness, words(types)]));
|
|
269
|
+
/** What a subagent type pools as when it is not a built-in: a custom agent's name is private. */
|
|
270
|
+
export const CUSTOM_AGENT = 'custom';
|
|
271
|
+
/** A subagent type as it pools: a built-in of a harness as itself, anything else as `custom`. */
|
|
272
|
+
export const projectedAgentType = (agentType) => ([...HARNESS_AGENT_TYPES.values()].some((types) => types.has(agentType)) ? agentType : CUSTOM_AGENT);
|
|
273
|
+
/**
|
|
274
|
+
* The input keys each built-in tool's published schema lists, by the tool's name. Curated from the harness's tool reference. A key outside the tool's list, and every
|
|
275
|
+
* key of an MCP tool (no pinned registry lists their schemas), is counted and never named (spec Section 1.3).
|
|
276
|
+
*/
|
|
277
|
+
export const TOOL_INPUT_KEYS = new Map(Object.entries({
|
|
278
|
+
Agent: 'description prompt subagent_type model run_in_background',
|
|
279
|
+
AskUserQuestion: 'questions answers',
|
|
280
|
+
Bash: 'command description timeout run_in_background dangerouslyDisableSandbox',
|
|
281
|
+
BashOutput: 'bash_id filter',
|
|
282
|
+
Edit: 'file_path old_string new_string replace_all',
|
|
283
|
+
ExitPlanMode: 'plan',
|
|
284
|
+
Glob: 'pattern path',
|
|
285
|
+
Grep: 'pattern path glob output_mode -B -A -C context -n -i type head_limit offset multiline',
|
|
286
|
+
KillBash: 'shell_id',
|
|
287
|
+
KillShell: 'shell_id',
|
|
288
|
+
MultiEdit: 'file_path edits',
|
|
289
|
+
NotebookEdit: 'notebook_path new_source cell_id cell_type edit_mode',
|
|
290
|
+
NotebookRead: 'notebook_path cell_id',
|
|
291
|
+
Read: 'file_path offset limit pages',
|
|
292
|
+
Skill: 'skill args',
|
|
293
|
+
SlashCommand: 'command',
|
|
294
|
+
Task: 'description prompt subagent_type model run_in_background resume',
|
|
295
|
+
TaskOutput: 'task_id block timeout',
|
|
296
|
+
TaskStop: 'task_id',
|
|
297
|
+
TodoWrite: 'todos',
|
|
298
|
+
ToolSearch: 'query max_results',
|
|
299
|
+
WebFetch: 'url prompt',
|
|
300
|
+
WebSearch: 'query allowed_domains blocked_domains',
|
|
301
|
+
Write: 'file_path content',
|
|
302
|
+
}).map(([tool, keys]) => [tool, words(keys)]));
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type ErrorObservation, type HookCall, type RecallCall, type SignatureRecord } from './schema.js';
|
|
2
|
+
import { type Store } from './store.js';
|
|
3
|
+
import type { SurvivalState } from './survival.js';
|
|
4
|
+
export interface RecallQuery {
|
|
5
|
+
/** Error text as pasted: it is normalized the way deposit normalizes an error. */
|
|
6
|
+
error?: string;
|
|
7
|
+
/** A file the session touched (a path, or a bare file name). */
|
|
8
|
+
path?: string;
|
|
9
|
+
cls?: string;
|
|
10
|
+
sinceDays?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface RecallMatch extends SignatureRecord {
|
|
13
|
+
/** Tools that followed, most common first. */
|
|
14
|
+
followedBy: Array<{
|
|
15
|
+
tool: string;
|
|
16
|
+
count: number;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export interface RecallResult {
|
|
20
|
+
query: RecallQuery;
|
|
21
|
+
/** The normalized, redacted form of `error` that was matched. */
|
|
22
|
+
normalized: string | null;
|
|
23
|
+
matches: RecallMatch[];
|
|
24
|
+
}
|
|
25
|
+
/** Which error rows a query selects, and the normalized text it matched them on. A count stated for a narrowed query reads through this, so it counts what the query narrowed to. */
|
|
26
|
+
export declare const recallRows: (store: Store, query: RecallQuery, now: number, redactDomains?: readonly string[]) => {
|
|
27
|
+
normalized: string | null;
|
|
28
|
+
keep: (error: ErrorObservation) => boolean;
|
|
29
|
+
};
|
|
30
|
+
export declare const recall: (store: Store, query: RecallQuery, now: number, limit?: number, redactDomains?: readonly string[]) => RecallResult;
|
|
31
|
+
export declare const formatRecall: (result: RecallResult) => string;
|
|
32
|
+
/** Below this many in its denominator a share is noise, so a cell has none and prints as too few. The counts stay in `--json`. */
|
|
33
|
+
export declare const BOOKS_MIN_PROMPTS = 30;
|
|
34
|
+
/** A signal in a row: how many of the prompts or commits that can carry it did, and the share when `of` reaches `BOOKS_MIN_PROMPTS`. */
|
|
35
|
+
export interface BooksShare {
|
|
36
|
+
count: number;
|
|
37
|
+
of: number;
|
|
38
|
+
share: number | null;
|
|
39
|
+
}
|
|
40
|
+
export interface BooksRow {
|
|
41
|
+
key: string;
|
|
42
|
+
prompts: number;
|
|
43
|
+
cacheRead: number;
|
|
44
|
+
cacheWrite: number;
|
|
45
|
+
output: number;
|
|
46
|
+
thinking: number;
|
|
47
|
+
wallSec: number;
|
|
48
|
+
turns: number;
|
|
49
|
+
errors: number;
|
|
50
|
+
/** Prompts that edited and then ran a command, over prompts that edited; null when none edited. */
|
|
51
|
+
verifyAfterEdit: number | null;
|
|
52
|
+
/**
|
|
53
|
+
* Tokens (input, cache write, cache read, output) spent by the subagents these prompts spawned (A24): a subagent transcript joins its
|
|
54
|
+
* parent's `Agent` call by tool-use id, and that call's prompt gives the row.
|
|
55
|
+
*/
|
|
56
|
+
delegated: number;
|
|
57
|
+
/** `verify` passed, of the prompts that edited and whose `verify` can be read (not `na`, not `masked`, not absent; `none` counts, since no runner read as passing). */
|
|
58
|
+
verifyPassed: BooksShare;
|
|
59
|
+
/** A stop, of the prompts carrying `stopped`. */
|
|
60
|
+
stopped: BooksShare;
|
|
61
|
+
/** A redo, of the prompts carrying `redo`. */
|
|
62
|
+
redone: BooksShare;
|
|
63
|
+
/** The prompts' `commits`, with or without a readable sha. */
|
|
64
|
+
commits: number;
|
|
65
|
+
/** Distinct shas of these prompts that survival has a known state for: survived, reverted, or unreachable, not unknown. */
|
|
66
|
+
settled: number;
|
|
67
|
+
/** Survived, of `settled`. */
|
|
68
|
+
survived: BooksShare;
|
|
69
|
+
}
|
|
70
|
+
export type BooksBy = 'class' | 'model' | 'harness' | 'pull';
|
|
71
|
+
export declare const books: (store: Store, by: BooksBy, now: number, sinceDays?: number, survival?: ReadonlyMap<string, SurvivalState>) => BooksRow[];
|
|
72
|
+
/** The closing line of `books` text: what the columns can and cannot be read as. */
|
|
73
|
+
export declare const BOOKS_CAVEAT = "These are associations in one operator's logs, not measured lift.";
|
|
74
|
+
export declare const formatBooks: (rows: readonly BooksRow[], by: BooksBy) => string;
|
|
75
|
+
export interface Signal {
|
|
76
|
+
sessions: number;
|
|
77
|
+
/** Errors whose signature had already occurred in an earlier session, per hundred sessions. */
|
|
78
|
+
recurringPer100: number | null;
|
|
79
|
+
/** Distinct signatures among those recurring errors in the window. */
|
|
80
|
+
recurringSignatures: number | null;
|
|
81
|
+
/** Mean cache-write tokens of a session in the window. */
|
|
82
|
+
cacheWritePerSession: number | null;
|
|
83
|
+
/** MCP recall calls made during the window, per session. */
|
|
84
|
+
recallPerSession: number | null;
|
|
85
|
+
/** Hook lookups (SessionStart injection and PostToolUse recall) made in the window's sessions, per session. */
|
|
86
|
+
hookRecallPerSession: number | null;
|
|
87
|
+
/** Hook lookups that had something to say (an injected block or a recall hit), per session. */
|
|
88
|
+
hookHitsPerSession: number | null;
|
|
89
|
+
/** Sessions the SessionEnd hook deposited, per session (a deposit is a stop call that wrote something). */
|
|
90
|
+
hookDepositsPerSession: number | null;
|
|
91
|
+
/** Of `sessions`, those the Cursor source deposited (harness `cursor`). */
|
|
92
|
+
cursorSessions: number;
|
|
93
|
+
/** Of `sessions`, those each later source deposited, by harness (Cursor keeps `cursorSessions`); absent in an empty window. */
|
|
94
|
+
otherSessions?: {
|
|
95
|
+
[harness: string]: number;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export interface Measure {
|
|
99
|
+
window: number;
|
|
100
|
+
/** The cutoff the current window starts at, when `--since` pinned it. */
|
|
101
|
+
since: string | null;
|
|
102
|
+
last: Signal;
|
|
103
|
+
before: Signal;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Without `since` the current window is the last `window` sessions, so it moves with every deposit. With it, the current window is the
|
|
107
|
+
* first `window` sessions that started at or after the cutoff and the prior window is the `window` before it, so a reading pinned to an
|
|
108
|
+
* install time keeps its start however many sessions come later.
|
|
109
|
+
*/
|
|
110
|
+
export declare const measure: (store: Store, calls: readonly RecallCall[], hookCalls: readonly HookCall[], window: number, since?: string) => Measure;
|
|
111
|
+
export declare const formatMeasure: (result: Measure) => string;
|