pullfrog 0.1.93 → 0.1.95

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/dist/internal.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "pullfrog",
11
- version: "0.1.93",
11
+ version: "0.1.95",
12
12
  cliContractVersion: "1",
13
13
  type: "module",
14
14
  bin: {
@@ -50,7 +50,6 @@ var package_default = {
50
50
  "@standard-schema/spec": "1.1.0",
51
51
  "@toon-format/toon": "^1.0.0",
52
52
  "@types/node": "^24.7.2",
53
- "@types/object-hash": "^3.0.6",
54
53
  "@types/semver": "^7.7.1",
55
54
  "@types/turndown": "^5.0.5",
56
55
  "agent-browser": "0.25.4",
@@ -64,8 +63,6 @@ var package_default = {
64
63
  fastmcp: "^3.34.0",
65
64
  "file-type": "^21.3.0",
66
65
  husky: "^9.0.0",
67
- "lru-cache": "^11.0.0",
68
- "object-hash": "^3.0.0",
69
66
  "opencode-ai": "1.18.29",
70
67
  "package-manager-detector": "^1.6.0",
71
68
  picocolors: "^1.1.1",
@@ -77,6 +74,7 @@ var package_default = {
77
74
  undici: "^7.22.0",
78
75
  vitest: "^4.0.17",
79
76
  yaml: "^2.8.2",
77
+ yes: "0.1.0",
80
78
  zod: "4.3.6"
81
79
  },
82
80
  repository: {
@@ -110,12 +108,6 @@ var package_default = {
110
108
  import: "./dist/internal.js",
111
109
  default: "./dist/internal.js"
112
110
  },
113
- "./yes": {
114
- "@pullfrog/source": "./yes/index.ts",
115
- types: "./dist/yes/index.d.ts",
116
- import: "./dist/yes.js",
117
- default: "./dist/yes.js"
118
- },
119
111
  "./package.json": "./package.json"
120
112
  },
121
113
  packageManager: "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
@@ -15011,6 +15003,17 @@ var providers = {
15011
15003
  // see the big-pickle note above (#1077).
15012
15004
  isFree: true
15013
15005
  },
15006
+ // Zen's FREE stealth preview (listed 2026-10-01), the fifth promo. Zen
15007
+ // has not published its data terms yet, so the description claims none.
15008
+ "fledge-alpha": {
15009
+ displayName: "Fledge Alpha",
15010
+ description: "Stealth preview, free for a limited time",
15011
+ resolve: "opencode/fledge-alpha-free",
15012
+ effort: ["low", "high", "max"],
15013
+ // free to run, still gated on the provider's own OPENCODE_API_KEY —
15014
+ // see the big-pickle note above (#1077).
15015
+ isFree: true
15016
+ },
15014
15017
  // Zen's live free MiMo, and the second free row in a menu that big-pickle
15015
15018
  // was alone in since `mimo-v2-pro-free` lost its model.
15016
15019
  mimo: {
@@ -15849,12 +15852,14 @@ The body has at most three parts, in this order:
15849
15852
 
15850
15853
  1. **Reviewed changes preamble** \u2014 a bolded \`**Reviewed changes**\` lead-in with one sentence on what was reviewed in this run (for \`IncrementalReview\`: what changed since the prior pullfrog review), then a bullet list of the substantive changes \u2014 short bolded title, one sentence each. A reviewer should understand the full reviewed scope from this list alone. Close the preamble with the metadata comment below.
15851
15854
  2. **Cross-cutting issue sections** (zero or more) \u2014 one \`### {emoji} {what's wrong, not what to do}\` heading per concern.
15852
- 3. **\`### \u2139\uFE0F Nitpicks\`** at the very bottom, if any \u2014 a flat bullet list, no technical-details block.
15855
+ 3. **\`### \u2139\uFE0F Nitpicks\`** at the very bottom, if any \u2014 a flat bullet list, no technical-details block. Only for what has no runtime effect: a stale or wrong comment or doc, a misleading name, a typo, dead code, a missing test. Never formatting or whitespace.
15853
15856
 
15854
15857
  **Inline vs. body.** Concerns that anchor to a specific line go inline (the \`comments\` parameter), even when their implications are broad. Body \`### \` sections are reserved for concerns that have **no line to anchor to** \u2014 *absence* (something the diff should have done but didn't), *sequencing* (rollout / deletion / migration order), *design decisions only the human can make*, or *scope questions the diff raises but doesn't address*. With no non-anchorable concerns, the body is just the preamble + metadata.
15855
15858
 
15856
15859
  **Severity emoji** on every \`### \` heading, and nowhere else: \u{1F6A8} critical (blocks merge \u2014 data loss, security, broken core flow) \xB7 \u26A0\uFE0F important (must address before merging) \xB7 \u2139\uFE0F informational (mergeable as-is).
15857
15860
 
15861
+ **Behavior decides placement, not fix size.** A finding that changes what the code does \u2014 a wrong value or message, a crash, a race, a leak, a missed cleanup, a slow path \u2014 gets its own inline comment (or a \`### \` section if no line anchors it) at its real severity, however small the fix. Never put it in Nitpicks: before submitting, re-read each Nitpicks bullet and move any that fails this test inline.
15862
+
15858
15863
  **Blank line between every block-level element.** GitHub's markdown parser requires one before and after HTML tags (\`<details>\`, \`<summary>\`, \`<sub>\`, \`<br/>\`) \u2014 without it GitHub treats what follows as a continuation of the HTML block and renders your markdown as literal text. This is a parser quirk, not a style preference, and it permanently breaks the posted review.
15859
15864
 
15860
15865
  ## Metadata comment
@@ -16027,9 +16032,9 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
16027
16032
 
16028
16033
  6. **aggregate & draft**: when specialist results land, merge findings; de-dup overlaps (two specialists catching the same issue = higher-confidence signal); trace each finding yourself before accepting it. drop praise, style preferences, speculative/unverified claims, findings about pre-existing code unrelated to the PR (heuristic: if the finding's root cause lives in lines this PR added or modified, it's in scope; otherwise drop unless the PR plausibly introduced or amplified the regression), and anything not actionable. also drop **bloat-shaped findings** \u2014 proposed fixes that would add defensive checks for cases that can't happen, abstractions used once, comments restating obvious code, tests asserting tautologies, or "just-in-case" guards. subagents are fallible and bias toward recommending changes; the bar for an actionable inline comment is sound + correct + elegant. recommending a change that improves only one of the three (or worse, degrades elegance to nominally improve correctness) makes the codebase worse, not better.
16029
16034
 
16030
- **Hunt for non-anchored concerns before drafting.** After collecting your anchored findings, deliberately scan for concerns that have no specific line to point at \u2014 typically: deletion / cleanup plans for code the diff replaces or shadows; rollout sequencing (what happens to in-flight state during deploy / revert?); coverage gaps the diff implies but doesn't add; scope questions that only the human can answer (e.g. is the legacy path going away or is this a long-term dual track?); architectural risks the diff opens up that aren't a single-line bug. On substantial PRs (migrations, refactors, multi-file rewrites, version bumps that change runtime semantics), at least one such concern almost always exists; if you can't think of any, your bar is probably too high.
16035
+ **Hunt for non-anchored concerns before drafting.** After collecting your anchored findings, deliberately scan for concerns that have no specific line to point at \u2014 typically: deletion / cleanup plans for code the diff replaces or shadows; rollout sequencing (what happens to in-flight state during deploy / revert?); scope questions that only the human can answer (e.g. is the legacy path going away or is this a long-term dual track?); architectural risks the diff opens up that aren't a single-line bug.
16031
16036
 
16032
- for surviving findings, draft inline comments with NEW line numbers from the diff \u2014 attach a \`<details>Technical details</details>\` block to any inline comment whose fix is non-trivial or has cross-file implications (see Inline technical details in the format below). every comment must be actionable, 2-3 sentences max in the visible part. use GitHub permalink format for code references. for impact-analysis findings (stale references after rename/remove), report them in the review body ordered by severity (runtime breakage > incorrect docs > stale comments) rather than as inline comments unless they're anchored to a specific line.
16037
+ for surviving findings, draft inline comments with NEW line numbers from the diff \u2014 attach a \`<details>Technical details</details>\` block to any inline comment whose fix is non-trivial or has cross-file implications (see Inline technical details in the format below). every comment must be actionable, 2-3 sentences max in the visible part, one per root cause \u2014 name its other sites in that comment rather than repeating it. use GitHub permalink format for code references. for impact-analysis findings (stale references after rename/remove), report them in the review body ordered by severity (runtime breakage > incorrect docs > stale comments) rather than as inline comments unless they're anchored to a specific line.
16033
16038
 
16034
16039
  7. **submit**: ALWAYS submit exactly one review via \`${t("create_pull_request_review")}\`. Do NOT call \`report_progress\` \u2014 the review is the final record and the progress comment will be cleaned up automatically.
16035
16040
 
@@ -16050,9 +16055,9 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
16050
16055
  \`approved: false\`. Body opens with \`> [!CAUTION]\\n> This PR introduces ...\`, followed by the PR summary. Include all inline comments via \`comments\`.
16051
16056
  - **must-address non-critical findings** (real consequences if shipped \u2014 incorrect behavior in non-critical paths, missing validation on user input, regressions the author should fix before merge):
16052
16057
  \`approved: false\`. Body opens with \`> [!IMPORTANT]\\n> ...\`, followed by the PR summary. Reserve this tier for findings with concrete fallout \u2014 do NOT use \`[!IMPORTANT]\` for nits, style preferences, or "consider also" suggestions. Include all inline comments via \`comments\`.
16053
- - **minor suggestions only** (single-line nits, doc/comment polish, defer-able observations, "rough edges"):
16058
+ - **minor suggestions only** (low-stakes findings, or Nitpicks only):
16054
16059
  \`approved: false\`. Body opens with \`> \u2139\uFE0F No critical issues \u2014 minor suggestions inline.\\n\\n\` followed by the PR summary. Include all inline comments via \`comments\`. Vary the wording after the emoji to fit the review (e.g. "Minor suggestions only.", "Two rough edges worth a look."), but always keep the \u2139\uFE0F prefix and keep it short.
16055
- - **informational observations** (mergeable as-is, nothing actionable \u2014 e.g. prior feedback addressed cleanly, surfacing a minor stale doc reference, calling out something noteworthy without recommending a change):
16060
+ - **informational observations** (mergeable as-is, nothing actionable \u2014 e.g. prior feedback addressed cleanly, calling out something noteworthy without recommending a change):
16056
16061
  \`approved: true\`. Body opens with \`> \u2705 No new issues found.\\n\\n\` followed by the PR summary. Do NOT include inline \`comments\` \u2014 the \u2705 signals "no action needed", which contradicts an actionable anchor; if a point is concrete enough to anchor to a line, downgrade the whole review to "minor suggestions only" (\`approved: false\`) instead.
16057
16062
  - **no actionable issues**:
16058
16063
  \`approved: true\`. Body opens with \`> \u2705 No new issues found.\\n\\n\` followed by the PR summary.
@@ -16118,9 +16123,9 @@ ${PR_SUMMARY_FORMAT}`
16118
16123
 
16119
16124
  8. **aggregate, draft, self-critique**: merge findings (yours + output from every specialist you dispatched); de-dup overlaps; trace each finding yourself. drop praise, style preferences, speculative/unverified claims, findings about pre-existing code unrelated to the new commits, anything not actionable, and anything that re-states prior review feedback (heuristic: if the finding's root cause lives in lines the *new commits* added or modified, it's in scope; otherwise drop). also drop **bloat-shaped findings** \u2014 proposed fixes that would add defensive checks for cases that can't happen, abstractions used once, comments restating obvious code, tests asserting tautologies, or "just-in-case" guards. subagents are fallible and bias toward recommending changes; the bar for an actionable inline comment is sound + correct + elegant. recommending a change that improves only one of the three (or degrades elegance to nominally improve correctness) makes the codebase worse, not better. To compute "lines the new commits added or modified": if \`incrementalDiffPath\` from step 2 is present, use it directly. Otherwise, take the prior Pullfrog review's \`commit_id\` (returned alongside each entry from \`${t("list_pull_request_reviews")}\` in step 4) and run \`git diff <prior-review-sha>..HEAD\` to isolate the lines added since that review.
16120
16125
 
16121
- **Hunt for non-anchored concerns before drafting.** After collecting your anchored findings, deliberately scan for concerns that have no specific line to point at \u2014 typically: deletion / cleanup plans for code the new commits replace or shadow; rollout sequencing (what happens to in-flight state during deploy / revert?); coverage gaps the new commits imply but don't add; scope questions that only the human can answer (e.g. is the legacy path going away or is this a long-term dual track?); architectural risks the new commits open up that aren't a single-line bug. On substantial incremental diffs (migrations, refactors, multi-file rewrites, version bumps that change runtime semantics), at least one such concern almost always exists; if you can't think of any, your bar is probably too high.
16126
+ **Hunt for non-anchored concerns before drafting.** After collecting your anchored findings, deliberately scan for concerns that have no specific line to point at \u2014 typically: deletion / cleanup plans for code the new commits replace or shadow; rollout sequencing (what happens to in-flight state during deploy / revert?); scope questions that only the human can answer (e.g. is the legacy path going away or is this a long-term dual track?); architectural risks the new commits open up that aren't a single-line bug.
16122
16127
 
16123
- draft inline comments with NEW line numbers from the full PR diff \u2014 attach a \`<details>Technical details</details>\` block to any inline comment whose fix is non-trivial or has cross-file implications (see Inline technical details in the format below). every comment must be actionable, 2-3 sentences max in the visible part.
16128
+ draft inline comments with NEW line numbers from the full PR diff \u2014 attach a \`<details>Technical details</details>\` block to any inline comment whose fix is non-trivial or has cross-file implications (see Inline technical details in the format below). every comment must be actionable, 2-3 sentences max in the visible part, one per root cause \u2014 name its other sites in that comment rather than repeating it.
16124
16129
 
16125
16130
  9. **build the review body**: use the same default format as Review mode (preamble + optional cross-cutting \`### \` sections + optional \`### \u2139\uFE0F Nitpicks\`) \u2014 scoped to the **incremental delta**, not the full PR. The "Reviewed changes" bullets describe what changed since the prior pullfrog review (each bullet starts with a past-tense verb, e.g. \`- Extracted shared CLI runtime into a single module\`). Do NOT include a separate "Prior review feedback" checklist \u2014 that's tracked in the rolling PR summary snapshot for the next agent run, and surfacing it in the user-facing body is noise (changes that addressed prior feedback are already covered by the Reviewed-changes bullets). In some cases you may receive a complete diff for the whole PR instead of an incremental one; when this happens, determine what changed since Pullfrog's most recent review yourself before drafting bullets.
16126
16131
 
@@ -16133,8 +16138,8 @@ ${PR_SUMMARY_FORMAT}`
16133
16138
  - IF NO NEW ISSUES, NON-SUBSTANTIVE CHANGES ONLY (trivial formatting, import reordering, comment tweaks): do NOT submit a review. Instead call \`${t("report_progress")}\` with a 1-2 sentence note explaining no review was warranted (e.g. "No new issues. Changes since last review are formatting-only."). this leaves a visible signal that the run completed.
16134
16139
  - ELSE IF NEW CRITICAL ISSUES (blocks merge \u2014 bugs, security, data loss, broken core flows): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> [!CAUTION]\\n> This PR introduces ...\`, followed by the PR summary using the default format below.
16135
16140
  - ELSE IF NEW MUST-ADDRESS NON-CRITICAL FINDINGS (real consequences if shipped \u2014 incorrect behavior, missing validation, regressions the author should fix before merge): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> [!IMPORTANT]\\n> ...\`, followed by the PR summary using the default format below. Do NOT use this tier for nits, style preferences, or "consider also" suggestions.
16136
- - ELSE IF NEW MINOR SUGGESTIONS ONLY (single-line nits, doc/comment polish, defer-able observations, "rough edges"): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> \u2139\uFE0F No critical issues \u2014 minor suggestions inline.\\n\\n\` (vary the wording after \u2139\uFE0F to fit the review), followed by the PR summary using the default format below.
16137
- - ELSE IF INFORMATIONAL OBSERVATIONS (mergeable as-is, but worth surfacing \u2014 e.g. prior feedback addressed cleanly with one minor stale doc reference, or a noteworthy positive observation): call \`${t("create_pull_request_review")}\` with \`approved: true\`, NO inline comments, and the review body. body opens with \`> \u2705 No new issues found.\\n\\n\` (or similar friendly green opener), followed by the PR summary using the default format below. If a point is concrete enough to anchor to a line, downgrade the whole review to "minor suggestions only" (\`approved: false\`) instead \u2014 the \u2705 signals "no action needed", which contradicts an actionable anchor.
16141
+ - ELSE IF NEW MINOR SUGGESTIONS ONLY (low-stakes findings, or Nitpicks only): call \`${t("create_pull_request_review")}\` with \`approved: false\`, all comments, and the review body. body opens with \`> \u2139\uFE0F No critical issues \u2014 minor suggestions inline.\\n\\n\` (vary the wording after \u2139\uFE0F to fit the review), followed by the PR summary using the default format below.
16142
+ - ELSE IF INFORMATIONAL OBSERVATIONS (mergeable as-is, but worth surfacing \u2014 e.g. prior feedback addressed cleanly, or a noteworthy positive observation): call \`${t("create_pull_request_review")}\` with \`approved: true\`, NO inline comments, and the review body. body opens with \`> \u2705 No new issues found.\\n\\n\` (or similar friendly green opener), followed by the PR summary using the default format below. If a point is concrete enough to anchor to a line, downgrade the whole review to "minor suggestions only" (\`approved: false\`) instead \u2014 the \u2705 signals "no action needed", which contradicts an actionable anchor.
16138
16143
  - ELSE IF NO NEW ISSUES, SUBSTANTIVE CHANGES (new functionality, behavior changes, or fixes to prior review feedback): call \`${t("create_pull_request_review")}\` to create a PR review. If all previous reviews have been properly addressed and no new issues were discovered, set \`approved: true\`. body opens with \`> \u2705 No new issues found.\\n\\n\`, followed by the PR summary using the default format below.
16139
16144
 
16140
16145
  ${PR_SUMMARY_FORMAT}`
@@ -78,5 +78,7 @@ export interface InstalledCodexHome {
78
78
  * call. callers treat null as "codex CLI can't use this credential".
79
79
  */
80
80
  export declare function installCodexHome(): InstalledCodexHome | null;
81
+ /** subscriptions this run held but could not install, so a no-key error can name the real cause. */
82
+ export declare const unhostedSubscriptions: Set<string>;
81
83
  /** false for a Codex or Grok subscription on a runner that cannot host it (`resolveDataHome`). */
82
84
  export declare function canInstallSubscription(name: string): boolean;
@@ -1,6 +1,6 @@
1
1
  import { throttling } from "@octokit/plugin-throttling";
2
2
  import { Octokit } from "@octokit/rest";
3
- import * as yes from "../yes/index.ts";
3
+ import * as yes from "yes";
4
4
  /** GitHub Actions OIDC request credentials, stashed before env wipes */
5
5
  export interface OidcCredentials {
6
6
  requestUrl: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.93",
3
+ "version": "0.1.95",
4
4
  "cliContractVersion": "1",
5
5
  "type": "module",
6
6
  "bin": {
@@ -42,7 +42,6 @@
42
42
  "@standard-schema/spec": "1.1.0",
43
43
  "@toon-format/toon": "^1.0.0",
44
44
  "@types/node": "^24.7.2",
45
- "@types/object-hash": "^3.0.6",
46
45
  "@types/semver": "^7.7.1",
47
46
  "@types/turndown": "^5.0.5",
48
47
  "agent-browser": "0.25.4",
@@ -56,8 +55,6 @@
56
55
  "fastmcp": "^3.34.0",
57
56
  "file-type": "^21.3.0",
58
57
  "husky": "^9.0.0",
59
- "lru-cache": "^11.0.0",
60
- "object-hash": "^3.0.0",
61
58
  "opencode-ai": "1.18.29",
62
59
  "package-manager-detector": "^1.6.0",
63
60
  "picocolors": "^1.1.1",
@@ -69,6 +66,7 @@
69
66
  "undici": "^7.22.0",
70
67
  "vitest": "^4.0.17",
71
68
  "yaml": "^2.8.2",
69
+ "yes": "0.1.0",
72
70
  "zod": "4.3.6"
73
71
  },
74
72
  "repository": {
@@ -102,12 +100,6 @@
102
100
  "import": "./dist/internal.js",
103
101
  "default": "./dist/internal.js"
104
102
  },
105
- "./yes": {
106
- "@pullfrog/source": "./yes/index.ts",
107
- "types": "./dist/yes/index.d.ts",
108
- "import": "./dist/yes.js",
109
- "default": "./dist/yes.js"
110
- },
111
103
  "./package.json": "./package.json"
112
104
  },
113
105
  "packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
@@ -1,59 +0,0 @@
1
- import type { StandardSchemaV1 } from "./standard-schema.ts";
2
- export type { StandardSchemaV1 } from "./standard-schema.ts";
3
- export declare function range(n: number): number[];
4
- export declare function range(start: number, end: number): number[];
5
- export declare function range(n: number, fn: (i: number) => number): number[];
6
- export declare function schedule(fn: (i: number) => number, count: number): number[];
7
- /**
8
- * read a retry delay (ms) from a thrown HTTP error's response headers, honoring
9
- * GitHub's rate-limit backoff hints on octokit errors (`error.response.headers`, or
10
- * `error.headers` on a GraphQL response error):
11
- * - `retry-after` (RFC 9110 delta-seconds or an HTTP-date) — an explicit
12
- * backoff directive whenever present (covers secondary rate limits, which
13
- * carry it with `x-ratelimit-remaining > 0`).
14
- * - else `x-ratelimit-reset` (epoch seconds) but ONLY when
15
- * `x-ratelimit-remaining` is `"0"` — GitHub sends the reset header on ~every
16
- * response (~1h ahead), so it's a backoff hint only under actual primary
17
- * rate-limit exhaustion (matching octokit's throttling plugin). without this
18
- * gate a non-rate-limit retried error (e.g. a permissions 403) would be
19
- * wrongly delayed to the reset time.
20
- * returns `undefined` when no applicable hint is present/parseable.
21
- */
22
- export declare function retryAfterMs(error: unknown): number | undefined;
23
- type InferInput<S> = S extends StandardSchemaV1<infer I, any> ? I : never;
24
- type InferOutput<S> = S extends StandardSchemaV1<any, infer O> ? O : never;
25
- export interface OpOptions<TReturn = any> {
26
- name?: string;
27
- ttl?: number;
28
- maxItems?: number;
29
- retries?: number[];
30
- /**
31
- * honor a server backoff hint on retries: when a retried error carries a
32
- * `retry-after` / `x-ratelimit-reset` header, schedule the next retry from
33
- * that value (clamped to `[fixed delay, retryAfterCap]`) instead of the fixed
34
- * `retries[attempt]` backoff. `true` uses the built-in `retryAfterMs` reader;
35
- * a function extracts a delay-ms from a custom error shape. errors without the
36
- * header fall back to the fixed backoff.
37
- */
38
- retryAfter?: boolean | ((error: unknown) => number | undefined);
39
- /** cap (ms) on a honored retry-after hint. default 20000. */
40
- retryAfterCap?: number;
41
- cacheHit?: ((key: string) => void) | null;
42
- cacheMiss?: ((key: string) => void) | null;
43
- skipCache?: (result: TReturn) => boolean;
44
- bail?: (error: unknown) => boolean;
45
- }
46
- export interface OpObjectOptions<TInputSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TRun extends (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any> = (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any>> extends OpOptions<TOutputSchema extends StandardSchemaV1 ? InferOutput<TOutputSchema> : Awaited<ReturnType<TRun>>> {
47
- input?: TInputSchema;
48
- output?: TOutputSchema;
49
- run: TRun;
50
- }
51
- type AnyAsyncFn = (...args: any[]) => Promise<any>;
52
- type Input<F extends AnyAsyncFn> = Parameters<F>[0];
53
- export type OpFunction<F extends AnyAsyncFn> = F & {
54
- clear: (key?: Input<F>) => void;
55
- has: (key: Input<F>) => boolean;
56
- invalidate: (predicate: (key: Input<F>) => boolean) => number;
57
- };
58
- export declare function op<F extends AnyAsyncFn>(fn: F, options?: OpOptions<Awaited<ReturnType<F>>>): OpFunction<F>;
59
- export declare function op<TInputSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TRun extends (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any> = (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any>>(options: OpObjectOptions<TInputSchema, TOutputSchema, TRun>): OpFunction<(input: TInputSchema extends StandardSchemaV1 ? InferInput<TInputSchema> : Parameters<TRun>[0], ctx?: TRun extends (input: any, ctx: infer C, ...rest: any[]) => any ? C : never) => Promise<TOutputSchema extends StandardSchemaV1 ? InferOutput<TOutputSchema> : Awaited<ReturnType<TRun>>>>;
@@ -1,117 +0,0 @@
1
- /** The Standard Typed interface. This is a base type extended by other specs. */
2
- export interface StandardTypedV1<Input = unknown, Output = Input> {
3
- /** The Standard properties. */
4
- readonly "~standard": StandardTypedV1.Props<Input, Output>;
5
- }
6
- export declare namespace StandardTypedV1 {
7
- /** The Standard Typed properties interface. */
8
- interface Props<Input = unknown, Output = Input> {
9
- /** The version number of the standard. */
10
- readonly version: 1;
11
- /** The vendor name of the schema library. */
12
- readonly vendor: string;
13
- /** Inferred types associated with the schema. */
14
- readonly types?: Types<Input, Output> | undefined;
15
- }
16
- /** The Standard Typed types interface. */
17
- interface Types<Input = unknown, Output = Input> {
18
- /** The input type of the schema. */
19
- readonly input: Input;
20
- /** The output type of the schema. */
21
- readonly output: Output;
22
- }
23
- /** Infers the input type of a Standard Typed. */
24
- type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
25
- /** Infers the output type of a Standard Typed. */
26
- type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
27
- }
28
- /** The Standard Schema interface. */
29
- export interface StandardSchemaV1<Input = unknown, Output = Input> {
30
- /** The Standard Schema properties. */
31
- readonly "~standard": StandardSchemaV1.Props<Input, Output>;
32
- }
33
- export declare namespace StandardSchemaV1 {
34
- /** The Standard Schema properties interface. */
35
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
36
- /** Validates unknown input values. */
37
- readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
38
- }
39
- /** The result interface of the validate function. */
40
- type Result<Output> = SuccessResult<Output> | FailureResult;
41
- /** The result interface if validation succeeds. */
42
- interface SuccessResult<Output> {
43
- /** The typed output value. */
44
- readonly value: Output;
45
- /** A falsy value for `issues` indicates success. */
46
- readonly issues?: undefined;
47
- }
48
- interface Options {
49
- /** Explicit support for additional vendor-specific parameters, if needed. */
50
- readonly libraryOptions?: Record<string, unknown> | undefined;
51
- }
52
- /** The result interface if validation fails. */
53
- interface FailureResult {
54
- /** The issues of failed validation. */
55
- readonly issues: ReadonlyArray<Issue>;
56
- }
57
- /** The issue interface of the failure output. */
58
- interface Issue {
59
- /** The error message of the issue. */
60
- readonly message: string;
61
- /** The path of the issue, if any. */
62
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
63
- }
64
- /** The path segment interface of the issue. */
65
- interface PathSegment {
66
- /** The key representing a path segment. */
67
- readonly key: PropertyKey;
68
- }
69
- /** The Standard types interface. */
70
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
71
- }
72
- /** Infers the input type of a Standard. */
73
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
74
- /** Infers the output type of a Standard. */
75
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
76
- }
77
- /** The Standard JSON Schema interface. */
78
- export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
79
- /** The Standard JSON Schema properties. */
80
- readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
81
- }
82
- export declare namespace StandardJSONSchemaV1 {
83
- /** The Standard JSON Schema properties interface. */
84
- interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
85
- /** Methods for generating the input/output JSON Schema. */
86
- readonly jsonSchema: StandardJSONSchemaV1.Converter;
87
- }
88
- /** The Standard JSON Schema converter interface. */
89
- interface Converter {
90
- /** Converts the input type to JSON Schema. May throw if conversion is not supported. */
91
- readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
92
- /** Converts the output type to JSON Schema. May throw if conversion is not supported. */
93
- readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
94
- }
95
- /**
96
- * The target version of the generated JSON Schema.
97
- *
98
- * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
99
- *
100
- * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
101
- */
102
- type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
103
- /** The options for the input/output methods. */
104
- interface Options {
105
- /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
106
- readonly target: Target;
107
- /** Explicit support for additional vendor-specific parameters, if needed. */
108
- readonly libraryOptions?: Record<string, unknown> | undefined;
109
- }
110
- /** The Standard types interface. */
111
- interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
112
- }
113
- /** Infers the input type of a Standard. */
114
- type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
115
- /** Infers the output type of a Standard. */
116
- type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
117
- }