@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
package/dist/commands/login.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { CliError, ExitCode } from '../errors.js';
|
|
2
|
+
import { discoverIssuer, resolveIssuerUrl } from '../issuer.js';
|
|
2
3
|
import { awaitDeviceTokens, discover, startDeviceAuthorization } from '../oidc.js';
|
|
3
4
|
import { exchangeKeycloakToken } from '../session.js';
|
|
4
5
|
const STEP = 'login';
|
|
5
6
|
/** RFC 8628 device flow on Keycloak, then the exchange; stores the credentials. */
|
|
6
7
|
export const login = async (deps, options) => {
|
|
7
|
-
const issuerUrl = options.issuerUrl
|
|
8
|
-
|
|
9
|
-
throw new CliError('No Keycloak issuer URL: pass --issuer-url or set OARS_ISSUER_URL.', ExitCode.USAGE, 'usage');
|
|
10
|
-
}
|
|
11
|
-
const config = await discover(issuerUrl, { ...deps, step: STEP });
|
|
8
|
+
const issuerUrl = await resolveIssuerUrl(deps, options.issuerUrl);
|
|
9
|
+
const config = await discoverIssuer(deps, options.issuerUrl, () => discover(issuerUrl, { ...deps, step: STEP }));
|
|
12
10
|
const device = await startDeviceAuthorization(config, STEP);
|
|
13
11
|
const url = device.verification_uri_complete ?? device.verification_uri;
|
|
14
12
|
deps.io.stderr(`To sign in, open ${url}\nand confirm the code ${device.user_code}\n`);
|
package/dist/errors.d.ts
CHANGED
|
@@ -8,32 +8,32 @@ export declare const ExitCode: {
|
|
|
8
8
|
readonly AUTH: 3;
|
|
9
9
|
readonly INVALID: 4;
|
|
10
10
|
readonly CONFLICT: 5;
|
|
11
|
-
readonly HUMAN: 6;
|
|
12
11
|
readonly RATE_LIMITED: 7;
|
|
13
12
|
readonly UNREACHABLE: 8;
|
|
14
|
-
|
|
13
|
+
/** `pool fetch` hit the pool's weekly cap: nothing is wrong, and the bundle on disk is untouched. */
|
|
14
|
+
readonly CAPPED: 10;
|
|
15
15
|
};
|
|
16
16
|
export type ExitCode = (typeof ExitCode)[keyof typeof ExitCode];
|
|
17
17
|
/** The exit code for a failed response. The problem's code (then its type) decides; the status covers what has none. Text is never read. */
|
|
18
18
|
export declare const exitCodeForProblem: (status: number, problem?: ProblemDetail) => ExitCode;
|
|
19
|
-
/** What a deploy that stopped after registering leaves behind: the workload, the key shown only once, and the command that resumes. */
|
|
20
|
-
export interface PartialDeploy {
|
|
21
|
-
workloadId: string;
|
|
22
|
-
/** Only when the run that failed minted it: no rerun can show it again. */
|
|
23
|
-
sdkKey?: string;
|
|
24
|
-
rerun: string;
|
|
25
|
-
}
|
|
26
19
|
/** A failure the CLI reports and exits on. `step` names where it happened in `--json` documents. */
|
|
27
20
|
export declare class CliError extends Error {
|
|
28
21
|
readonly exitCode: ExitCode;
|
|
29
22
|
readonly step: string;
|
|
30
23
|
readonly problem: ProblemDetail;
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
/** Extra fields for the `--json` failure document, such as the invariants a strict verify failed. */
|
|
25
|
+
readonly details?: object | undefined;
|
|
26
|
+
constructor(message: string, exitCode: ExitCode, step: string, problem?: ProblemDetail,
|
|
27
|
+
/** Extra fields for the `--json` failure document, such as the invariants a strict verify failed. */
|
|
28
|
+
details?: object | undefined);
|
|
33
29
|
}
|
|
34
30
|
/** Keeps the known string fields of a response body that should be a ProblemDetail; anything else (HTML from a proxy) is no problem. */
|
|
35
31
|
export declare const toProblem: (body: unknown) => ProblemDetail | undefined;
|
|
36
32
|
/** A CliError for a non-2xx response; its message is the problem's title, else detail, else the status. */
|
|
37
33
|
export declare const problemError: (step: string, status: number, body: unknown) => CliError;
|
|
38
|
-
/**
|
|
39
|
-
|
|
34
|
+
/**
|
|
35
|
+
* A request that never got an answer (after the retries). Node's fetch reports every network failure as "fetch failed" and keeps
|
|
36
|
+
* the reason (`getaddrinfo ENOTFOUND host`, `connect ECONNREFUSED`) on its cause, so the message gives that reason, and names
|
|
37
|
+
* `server` when the caller knows it: a user whose server does not resolve yet can see which one.
|
|
38
|
+
*/
|
|
39
|
+
export declare const unreachableError: (step: string, cause: unknown, server?: string) => CliError;
|
package/dist/errors.js
CHANGED
|
@@ -6,18 +6,16 @@ export const ExitCode = {
|
|
|
6
6
|
AUTH: 3,
|
|
7
7
|
INVALID: 4,
|
|
8
8
|
CONFLICT: 5,
|
|
9
|
-
HUMAN: 6,
|
|
10
9
|
RATE_LIMITED: 7,
|
|
11
10
|
UNREACHABLE: 8,
|
|
12
|
-
|
|
11
|
+
/** `pool fetch` hit the pool's weekly cap: nothing is wrong, and the bundle on disk is untouched. */
|
|
12
|
+
CAPPED: 10,
|
|
13
13
|
};
|
|
14
14
|
const codes = (exit, ...names) => names.map((name) => [name, exit]);
|
|
15
15
|
// Problem codes (or types) from spec 1 §13, T87 and T92. EXPIRED_TOKEN and ACCESS_DENIED are the device flow's own, raised locally.
|
|
16
16
|
const BY_CODE = new Map([
|
|
17
|
-
...codes(ExitCode.AUTH, '
|
|
18
|
-
...codes(ExitCode.
|
|
19
|
-
...codes(ExitCode.CONFLICT, 'IDEMPOTENCY_CONFLICT', 'WORKLOAD_FINGERPRINT_EXISTS'),
|
|
20
|
-
...codes(ExitCode.HUMAN, 'ACCOUNT_NOT_READY', 'PAYMENT_METHOD_REQUIRED', 'INSUFFICIENT_CREDITS', 'COMPUTE_CAP_REACHED'),
|
|
17
|
+
...codes(ExitCode.AUTH, 'EXPIRED_TOKEN', 'ACCESS_DENIED'),
|
|
18
|
+
...codes(ExitCode.CONFLICT, 'IDEMPOTENCY_CONFLICT'),
|
|
21
19
|
...codes(ExitCode.RATE_LIMITED, 'RATE_LIMITED'),
|
|
22
20
|
]);
|
|
23
21
|
/** The exit code for a failed response. The problem's code (then its type) decides; the status covers what has none. Text is never read. */
|
|
@@ -41,13 +39,15 @@ export class CliError extends Error {
|
|
|
41
39
|
exitCode;
|
|
42
40
|
step;
|
|
43
41
|
problem;
|
|
44
|
-
|
|
45
|
-
constructor(message, exitCode, step, problem = { title: message },
|
|
42
|
+
details;
|
|
43
|
+
constructor(message, exitCode, step, problem = { title: message },
|
|
44
|
+
/** Extra fields for the `--json` failure document, such as the invariants a strict verify failed. */
|
|
45
|
+
details) {
|
|
46
46
|
super(message);
|
|
47
47
|
this.exitCode = exitCode;
|
|
48
48
|
this.step = step;
|
|
49
49
|
this.problem = problem;
|
|
50
|
-
this.
|
|
50
|
+
this.details = details;
|
|
51
51
|
this.name = 'CliError';
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -69,5 +69,22 @@ export const problemError = (step, status, body) => {
|
|
|
69
69
|
const message = problem?.title ?? problem?.detail ?? `The platform answered HTTP ${String(status)}`;
|
|
70
70
|
return new CliError(message, exitCodeForProblem(status, problem), step, { ...problem, title: message, status });
|
|
71
71
|
};
|
|
72
|
-
/**
|
|
73
|
-
|
|
72
|
+
/** The network's own reason for a failed fetch: the first of these that is not blank. */
|
|
73
|
+
const reasonOf = (error) => {
|
|
74
|
+
const inner = error.cause;
|
|
75
|
+
if (!(inner instanceof Error))
|
|
76
|
+
return error.message === '' ? 'no reason given' : error.message;
|
|
77
|
+
// Node 24 tries every address of a dual-stack host and reports an AggregateError whose own message is empty.
|
|
78
|
+
const first = inner instanceof AggregateError && inner.errors[0] instanceof Error ? inner.errors[0].message : '';
|
|
79
|
+
const code = 'code' in inner && typeof inner.code === 'string' ? inner.code : '';
|
|
80
|
+
return [first, inner.message, code, error.message].find((reason) => reason !== '') ?? 'no reason given';
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* A request that never got an answer (after the retries). Node's fetch reports every network failure as "fetch failed" and keeps
|
|
84
|
+
* the reason (`getaddrinfo ENOTFOUND host`, `connect ECONNREFUSED`) on its cause, so the message gives that reason, and names
|
|
85
|
+
* `server` when the caller knows it: a user whose server does not resolve yet can see which one.
|
|
86
|
+
*/
|
|
87
|
+
export const unreachableError = (step, cause, server) => {
|
|
88
|
+
const reason = cause instanceof Error ? reasonOf(cause) : String(cause);
|
|
89
|
+
return new CliError(`Cannot reach the server${server === undefined ? '' : ` at ${server}`}: ${reason}`, ExitCode.UNREACHABLE, step);
|
|
90
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Redactor } from '../sessions/redact.js';
|
|
2
|
+
import { type ShellCommand } from '../sessions/extract.js';
|
|
3
|
+
import type { Program } from './record.js';
|
|
4
|
+
export declare const CROSSING_CLASSES: readonly ["npm-package", "python-package", "mcp-server", "skill"];
|
|
5
|
+
export type CrossingClass = (typeof CROSSING_CLASSES)[number];
|
|
6
|
+
export declare const CROSSING_FORMS: readonly ["install", "url-install", "fetch-and-run", "url-fetch-and-run", "local-bin-run", "mcp-call", "skill-call"];
|
|
7
|
+
export type CrossingForm = (typeof CROSSING_FORMS)[number];
|
|
8
|
+
/** A command that looks like a crossing and states no name to record. Counted, so a report can say what it could not read. */
|
|
9
|
+
export declare const UNREAD_SHAPES: readonly ["manifest-install", "local-path", "variable-name", "masked-name", "pipe-to-shell", "behind-xargs", "harness-registration", "unreadable-name"];
|
|
10
|
+
export type UnreadShape = (typeof UNREAD_SHAPES)[number];
|
|
11
|
+
export type VersionForm = 'pinned' | 'range' | 'tag' | 'url' | 'unstated';
|
|
12
|
+
export interface Crossing {
|
|
13
|
+
class: CrossingClass;
|
|
14
|
+
form: CrossingForm;
|
|
15
|
+
/** The name as stated, redacted, normalized only where the package manager itself treats the spellings as one. */
|
|
16
|
+
name: string;
|
|
17
|
+
version: string | null;
|
|
18
|
+
versionForm: VersionForm;
|
|
19
|
+
/** The program that crossed (`npm`, `uvx`), or `mcp` and `skill` for those tools. */
|
|
20
|
+
program: Program;
|
|
21
|
+
/** Whether the call's own status reports this command: false behind a pipe or a later `;`. */
|
|
22
|
+
statusReports: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether a registry question for this name would reach the registry the command itself would: false when the command, its environment,
|
|
25
|
+
* or an earlier `cd` of the call chose the registry, the config, or the folder. A replay then leaves the name unasked.
|
|
26
|
+
*/
|
|
27
|
+
registryAsked: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface Removal {
|
|
30
|
+
class: CrossingClass;
|
|
31
|
+
name: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CallCheck {
|
|
34
|
+
crossings: Crossing[];
|
|
35
|
+
unread: UnreadShape[];
|
|
36
|
+
removals: Removal[];
|
|
37
|
+
}
|
|
38
|
+
export interface ToolCall {
|
|
39
|
+
tool: string;
|
|
40
|
+
input: unknown;
|
|
41
|
+
}
|
|
42
|
+
type Family = 'npm-package' | 'python-package';
|
|
43
|
+
export interface Words {
|
|
44
|
+
names: string[];
|
|
45
|
+
flags: Map<string, string[]>;
|
|
46
|
+
bare: Set<string>;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* `limit` is how many names a runner's own words take. Once that many are read, every later word is a name, whatever it looks like: it
|
|
50
|
+
* belongs to the fetched program, which may take `-p` or `--package` for its own. Flags before the limit are the runner's.
|
|
51
|
+
*/
|
|
52
|
+
export declare const readWords: (command: ShellCommand, family: Family, limit?: number) => Words;
|
|
53
|
+
export type Admitted = {
|
|
54
|
+
kind: 'named';
|
|
55
|
+
name: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'unread';
|
|
58
|
+
shape: UnreadShape;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* The one point every recorded name passes, before it reaches `crossings.jsonl`, a registry question, or a removal match. A name outside
|
|
62
|
+
* its family's grammar is never written and never asked: it is counted by the shape it has. A URL loses its credentials, query, and
|
|
63
|
+
* fragment first.
|
|
64
|
+
*/
|
|
65
|
+
export declare const admitName: (cls: CrossingClass, form: CrossingForm | "removal", name: string) => Admitted;
|
|
66
|
+
/** Names the crossing a tool call makes, if any. The later hook calls this same function with the call it is handed. */
|
|
67
|
+
export declare const checkCall: (call: ToolCall, redact: Redactor) => CallCheck;
|
|
68
|
+
export {};
|