@maycombhq/sdk 2.0.0-beta.21 → 2.0.0-beta.22

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.
@@ -64,6 +64,11 @@ export type RuleKind = "path" | "host" | "topic";
64
64
  * same way), as ADR 0153's `--match` takes it. Without a sibling sharing more, the corrected item's
65
65
  * own folder (`/forge/limits/{id}` → `/forge/limits/**`), its host's parent domain, or its topic's
66
66
  * family. Shown to the person before anything is saved; they may change it.
67
+ *
68
+ * Review round 48: the longest prefix shared with at least one sibling, not the prefix all the
69
+ * siblings share, so one distant sibling never widens `/api/v1/limits/**` to `/api/v1/**`; and a
70
+ * shared path of two segments or fewer that is wider than the item's own folder is too wide (as
71
+ * `/**` is): the item's own folder is taken instead.
67
72
  */
68
73
  export declare function deriveMatch(item: RuleSubject, siblings: readonly RuleSubject[]): {
69
74
  kind: RuleKind;
@@ -85,7 +90,11 @@ export declare const BatchLink: z.ZodObject<{
85
90
  fact: z.ZodString;
86
91
  line: z.ZodString;
87
92
  }, z.core.$strict>;
88
- /** A question a batch answered or opened again, with the answer it had before (none when open). */
93
+ /**
94
+ * A question a batch answered or opened again, with the answer it had before (none when open).
95
+ * Review round 48 (additive): for an AI answer taken up from a proposal, the proposal file's text
96
+ * as it was (`proposal`), so Undo puts it back for a person to review.
97
+ */
89
98
  export declare const BatchQuestion: z.ZodObject<{
90
99
  kind: z.ZodLiteral<"question">;
91
100
  id: z.ZodString;
@@ -131,6 +140,7 @@ export declare const BatchQuestion: z.ZodObject<{
131
140
  match: z.ZodString;
132
141
  }, z.core.$strict>>;
133
142
  }, z.core.$strict>>;
143
+ proposal: z.ZodOptional<z.ZodString>;
134
144
  }, z.core.$strict>;
135
145
  export declare const BatchItem: z.ZodDiscriminatedUnion<[z.ZodObject<{
136
146
  kind: z.ZodLiteral<"link">;
@@ -182,6 +192,7 @@ export declare const BatchItem: z.ZodDiscriminatedUnion<[z.ZodObject<{
182
192
  match: z.ZodString;
183
193
  }, z.core.$strict>>;
184
194
  }, z.core.$strict>>;
195
+ proposal: z.ZodOptional<z.ZodString>;
185
196
  }, z.core.$strict>], "kind">;
186
197
  export type BatchItemT = z.infer<typeof BatchItem>;
187
198
  /**
@@ -278,6 +289,7 @@ export declare const DecisionBatch: z.ZodObject<{
278
289
  match: z.ZodString;
279
290
  }, z.core.$strict>>;
280
291
  }, z.core.$strict>>;
292
+ proposal: z.ZodOptional<z.ZodString>;
281
293
  }, z.core.$strict>], "kind">>;
282
294
  reverted: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
283
295
  kind: z.ZodLiteral<"link">;
@@ -329,6 +341,7 @@ export declare const DecisionBatch: z.ZodObject<{
329
341
  match: z.ZodString;
330
342
  }, z.core.$strict>>;
331
343
  }, z.core.$strict>>;
344
+ proposal: z.ZodOptional<z.ZodString>;
332
345
  }, z.core.$strict>], "kind">>;
333
346
  undone: z.ZodOptional<z.ZodObject<{
334
347
  by: z.ZodString;
package/npm/core/api.d.ts CHANGED
@@ -297,8 +297,24 @@ import { z } from "zod";
297
297
  * as last applied. GET /api/settings/ai gives `decide` and `schemaVersion`, and PUT takes
298
298
  * `decide` (lifting a version 3 file to 4). GET /api/upgrade lists the pending upgrade steps and
299
299
  * POST /api/upgrade runs `atticus upgrade` as a local job on the person's click. Additive only.
300
+ * 3.0.0 (ADR 0186, review round 48: writes to shared systems need a person's confirmation). Not
301
+ * additive: the session token, which `--show-token` prints for assistants and scripts, is no
302
+ * longer a person's yes. POST /api/confirmations gives the app's page a confirmation for one
303
+ * write and target (single use, two minutes), and only with the page key the server puts in the
304
+ * page (<meta name="atticus-page-key">, or ATTICUS_UI_PAGE_KEY from the editor that starts it)
305
+ * and never prints. These take it as `confirmation` and answer 403 without a valid one: POST
306
+ * /api/changes/{changeId}/handoff (`handoff`), .../release-prs (`release-prs`),
307
+ * .../tasks/{taskId}/pr (`task-pr`, `<change>/<task>`), POST /api/propose (`propose`, the
308
+ * scope), POST /api/todo/{stepId}/run (`step-run`), POST /api/me/digest with send (`digest-send`,
309
+ * `me`), PUT /api/settings/ai when it changes the provider, keyEnv or an address (`ai-model`,
310
+ * `model`) and POST /api/settings/ai/test when the model settings differ from HEAD's (`ai-test`,
311
+ * `model`). POST .../sync merges a ready PR only with one (`merge`); without one it only reads.
312
+ * keyEnv must be a variable starting ATTICUS_, a model provider's own key variable or a name in
313
+ * the credential store (422). POST /api/workspace/sync and /api/reconcile answer 409 while one of
314
+ * their kind runs; GET /api/past-changes?change= and /api/changes/{changeId}/cockpit answer 400
315
+ * for a change id that isn't one, and /api/view/{name} 404 for a name that isn't a view.
300
316
  */
301
- export declare const API_VERSION = "2.84.0";
317
+ export declare const API_VERSION = "3.0.0";
302
318
  export declare const DEFAULT_PORT = 4321;
303
319
  /** RFC 9457 problem details, used for every error. */
304
320
  export declare const Problem: z.ZodObject<{
@@ -6568,6 +6584,65 @@ export declare const ProposePlanView: z.ZodObject<{
6568
6584
  title: z.ZodString;
6569
6585
  applyFirst: z.ZodOptional<z.ZodArray<z.ZodString>>;
6570
6586
  }, z.core.$strip>;
6587
+ /**
6588
+ * 3.0.0 (ADR 0186, review round 48): the writes to shared systems a person confirms in the app.
6589
+ * The session token drives the API and is printed for assistants and scripts (`--show-token`),
6590
+ * so it isn't a person's yes: the app's page asks for a confirmation (POST /api/confirmations,
6591
+ * with the page key only the page is given) when the person clicks, and the write sends it once.
6592
+ * `merge` is Sync's merge of a ready PR; `ai-model` a change of where runtime.yaml sends the
6593
+ * model's key (its provider, keyEnv or an address); `ai-test` a Test of settings not committed.
6594
+ */
6595
+ export declare const CONFIRMED_WRITES: readonly ["handoff", "release-prs", "merge", "task-pr", "digest-send", "propose", "step-run", "ai-model", "ai-test"];
6596
+ export declare const ConfirmedWrite: z.ZodEnum<{
6597
+ propose: "propose";
6598
+ handoff: "handoff";
6599
+ "release-prs": "release-prs";
6600
+ merge: "merge";
6601
+ "task-pr": "task-pr";
6602
+ "digest-send": "digest-send";
6603
+ "step-run": "step-run";
6604
+ "ai-model": "ai-model";
6605
+ "ai-test": "ai-test";
6606
+ }>;
6607
+ /** A confirmation the server gave the page: single use, for one write and target, two minutes. */
6608
+ export declare const Confirmation: z.ZodString;
6609
+ export declare const ConfirmationRequest: z.ZodObject<{
6610
+ write: z.ZodEnum<{
6611
+ propose: "propose";
6612
+ handoff: "handoff";
6613
+ "release-prs": "release-prs";
6614
+ merge: "merge";
6615
+ "task-pr": "task-pr";
6616
+ "digest-send": "digest-send";
6617
+ "step-run": "step-run";
6618
+ "ai-model": "ai-model";
6619
+ "ai-test": "ai-test";
6620
+ }>;
6621
+ target: z.ZodString;
6622
+ pageKey: z.ZodOptional<z.ZodString>;
6623
+ }, z.core.$strict>;
6624
+ export declare const ConfirmationView: z.ZodObject<{
6625
+ confirmation: z.ZodString;
6626
+ write: z.ZodEnum<{
6627
+ propose: "propose";
6628
+ handoff: "handoff";
6629
+ "release-prs": "release-prs";
6630
+ merge: "merge";
6631
+ "task-pr": "task-pr";
6632
+ "digest-send": "digest-send";
6633
+ "step-run": "step-run";
6634
+ "ai-model": "ai-model";
6635
+ "ai-test": "ai-test";
6636
+ }>;
6637
+ target: z.ZodString;
6638
+ expiresAt: z.ZodString;
6639
+ }, z.core.$strip>;
6640
+ /** The body of a write that takes nothing but the person's confirmation. */
6641
+ export declare const ConfirmedRequest: z.ZodObject<{
6642
+ confirmation: z.ZodOptional<z.ZodString>;
6643
+ }, z.core.$strict>;
6644
+ export type ConfirmedWriteT = z.infer<typeof ConfirmedWrite>;
6645
+ export type ConfirmationViewT = z.infer<typeof ConfirmationView>;
6571
6646
  export declare const ProposeRequest: z.ZodObject<{
6572
6647
  scope: z.ZodEnum<{
6573
6648
  "service-desk": "service-desk";
@@ -6584,6 +6659,7 @@ export declare const ProposeRequest: z.ZodObject<{
6584
6659
  files: z.ZodArray<z.ZodString>;
6585
6660
  title: z.ZodOptional<z.ZodString>;
6586
6661
  branch: z.ZodOptional<z.ZodString>;
6662
+ confirmation: z.ZodOptional<z.ZodString>;
6587
6663
  }, z.core.$strict>;
6588
6664
  export declare const LinesView: z.ZodObject<{
6589
6665
  code: z.ZodOptional<z.ZodNumber>;
@@ -7607,13 +7683,20 @@ export declare const HandoffRequest: z.ZodObject<{
7607
7683
  build: "build";
7608
7684
  }>>;
7609
7685
  repo: z.ZodOptional<z.ZodString>;
7686
+ confirmation: z.ZodOptional<z.ZodString>;
7610
7687
  }, z.core.$strict>;
7611
- /** ADR 0043: refresh a change from its hand-off PR. */
7688
+ /**
7689
+ * ADR 0043: refresh a change from its hand-off PR. 3.0.0 (ADR 0186): with a confirmation
7690
+ * (`merge`, the change) it merges a ready PR as the person; without one it only reads.
7691
+ */
7612
7692
  export declare const SyncRequest: z.ZodObject<{
7613
7693
  repo: z.ZodOptional<z.ZodString>;
7694
+ confirmation: z.ZodOptional<z.ZodString>;
7614
7695
  }, z.core.$strict>;
7615
7696
  /** ADR 0184: raise the release PRs, change/<id> into each code repo's default branch. */
7616
- export declare const ReleasePrsRequest: z.ZodObject<{}, z.core.$strict>;
7697
+ export declare const ReleasePrsRequest: z.ZodObject<{
7698
+ confirmation: z.ZodOptional<z.ZodString>;
7699
+ }, z.core.$strict>;
7617
7700
  /** 2.75.0 (seventh UX walk): tick (done) or untick a task in the change's tasks.md. */
7618
7701
  export declare const TaskDoneRequest: z.ZodObject<{
7619
7702
  done: z.ZodBoolean;
@@ -7704,6 +7787,7 @@ export declare const StepRunRequest: z.ZodObject<{
7704
7787
  inputsSha256: z.ZodString;
7705
7788
  fillOnly: z.ZodOptional<z.ZodBoolean>;
7706
7789
  change: z.ZodOptional<z.ZodString>;
7790
+ confirmation: z.ZodOptional<z.ZodString>;
7707
7791
  }, z.core.$strict>;
7708
7792
  export declare const ArchiveRequest: z.ZodObject<{
7709
7793
  rescan: z.ZodOptional<z.ZodBoolean>;
@@ -7769,8 +7853,10 @@ export declare const SaveNotifyRequest: z.ZodObject<{
7769
7853
  channel: z.ZodOptional<z.ZodString>;
7770
7854
  }, z.core.$strict>;
7771
7855
  /** ADR 0048: show the digest, or send it through the notify adapter (the click is the approval). */
7856
+ /** 3.0.0 (ADR 0186): send needs the person's confirmation from the app (`digest-send`, `me`). */
7772
7857
  export declare const SendDigestRequest: z.ZodObject<{
7773
7858
  send: z.ZodDefault<z.ZodBoolean>;
7859
+ confirmation: z.ZodOptional<z.ZodString>;
7774
7860
  }, z.core.$strict>;
7775
7861
  /** ADR 0043: choose one of a triage item's numbered options; it writes a curated decision. */
7776
7862
  export declare const TriageDecideRequest: z.ZodObject<{
@@ -33,16 +33,32 @@ export declare function claimOnLines(lines: readonly string[], line: number, cla
33
33
  export declare function normalizeQuote(q: string): string;
34
34
  /** Whether a quote is the line, starts it, or sits inside it, after normalisation. */
35
35
  export declare function quoteMatches(line: string, quote: string | undefined): boolean;
36
+ /** Whether a path names a binary file by its extension (an image, an archive, a font, a build). */
37
+ export declare function isBinaryPath(path: string): boolean;
36
38
  /** A quote is not required from a binary, a notebook, a minified file, or a very long line. */
37
39
  export declare function quoteNotRequired(path: string, line: string): boolean;
38
- /** Paths whose lines are never quoted into a map. */
40
+ /**
41
+ * Paths whose lines are never quoted into a map. Each part is read as NTFS opens it (review round
42
+ * 46): a stream's name after `:` (`.env::$DATA` is `.env`) and trailing dots and spaces dropped.
43
+ */
39
44
  export declare function isSecretPath(path: string): boolean;
40
45
  /**
41
- * Redact a line that carries a secret-looking key with a literal value; a placeholder or a
42
- * reference (`${X}`, `env:X`, `vault:...`) stays, as does a line that names no such key.
43
- * A private-key block is redacted whole.
46
+ * Redact the secrets on a line, keeping what names them: a value after a secret-looking key
47
+ * (at the line's start, whatever the value; anywhere on it, a quoted literal), a setter's
48
+ * literal, a URL's password, a bearer or basic token and well-known token shapes. A
49
+ * placeholder or a reference (`${X}`, `env:X`, `vault:...`) stays, as does code that only names
50
+ * a secret word (`if (password == null)`, `tokenizer.next()`). A private-key block is redacted
51
+ * whole. A key's value is redacted to the end of the line.
44
52
  */
45
53
  export declare function redactSecrets(line: string): string;
54
+ /**
55
+ * Whether a quote redaction left as it is still holds what looks like a secret: an identifier
56
+ * with a secret word and an opaque quoted literal (8 or more characters with letters and digits,
57
+ * no spaces, not a path, URL or placeholder) on the same line, e.g.
58
+ * `creds.put(PASSWORD_KEY, "Xk9fQ2mZ7p")`. Code that only names a secret word
59
+ * (`passwordEncoder.encode(x)`, `getToken("Authorization")`) doesn't.
60
+ */
61
+ export declare function quoteHoldsSecret(quote: string): boolean;
46
62
  /**
47
63
  * Whether a word claim is put together from `cite.with` parts (ADR 0124 addendum A-derived): a
48
64
  * rake task's `namespace:task`, a key a helper prefixes (`${prefix}_conferenceCache`). Each part's
@@ -6,13 +6,19 @@ import type { Fact } from "./schema/facts.js";
6
6
  * that was edited, renamed or deleted is read again. Pure: the diff comes from the git adapter
7
7
  * (`changedFiles` in @maycombhq/workspace), so the same facts and the same diff split the same way.
8
8
  */
9
- /** One file changed between two commits, as `git diff --name-status -M` says it. */
9
+ /** One file changed between two commits, as `git diff --raw -M` says it. */
10
10
  export interface FileChange {
11
11
  status: "added" | "modified" | "deleted" | "renamed" | "copied" | "type-changed";
12
12
  /** The path at the newer commit (a deleted file's path at the older one). */
13
13
  path: string;
14
14
  /** A rename's or copy's path at the older commit. */
15
15
  from?: string;
16
+ /**
17
+ * Review round 49: the path is a submodule's gitlink (mode 160000 at either commit), so the
18
+ * diff names the folder, not the files in it that changed. Every cited file under it is read
19
+ * again.
20
+ */
21
+ gitlink?: boolean;
16
22
  }
17
23
  /** Why a fact must be read again: the first file it cites that changed, and how. */
18
24
  export interface StaleCite {
@@ -24,7 +30,7 @@ export interface StaleCite {
24
30
  }
25
31
  /**
26
32
  * The files a fact rests on: its cite and the cite's `with` parts, an entry's `authCite` (ADR
27
- * 0124 addendum A-read), and for a flow every step's and error path's cite and parts. Unique and
33
+ * 0124 addendum A-read) and a call's `authCite` and `tlsCite` (ADR 0163), with their parts, and for a flow every step's and error path's cite and parts. Unique and
28
34
  * sorted, except that a fact's own cited file comes first for a non-flow fact.
29
35
  */
30
36
  export declare function citedFiles(f: Fact): string[];
@@ -435,6 +435,11 @@ export interface PersonPair {
435
435
  by: string;
436
436
  /** ADR 0181: the pairing is the AI's, with its run; joined `joined-by-ai`. */
437
437
  ai?: JoinAi;
438
+ /**
439
+ * Review round 48: a person said the call reaches none (their `unlink` is the newest): no
440
+ * pairing, and an AI answer naming a target doesn't join it (a person's answer still does).
441
+ */
442
+ none?: boolean;
438
443
  }
439
444
  export interface JoinFactsInput {
440
445
  repos: readonly JoinRepo[];
package/npm/core/fs.d.ts CHANGED
@@ -51,6 +51,23 @@ o?: {
51
51
  release: () => Promise<void>;
52
52
  interrupted?: LockInfo;
53
53
  }>;
54
+ /** The lock file beside a file two processes write (`<file>.lock`): no facts-folder reader takes it for a file of its own. */
55
+ export declare const sharedLockFileOf: (path: string) => string;
56
+ /**
57
+ * Review round 46: run `work` holding a file that another process may append to or rewrite at
58
+ * the same time (a repo's corrections: the app server appends, a CLI command rewrites it), so a
59
+ * read, change and write never loses what the other wrote meanwhile. In this process the writers
60
+ * of one file queue; between processes `<file>.lock` is created with `wx` (which fails when it is
61
+ * there), retried with a short backoff. A lock whose process is gone, or older than `staleMs`, is
62
+ * taken over; after `waitMs` it gives up with LockHeldError naming the holder. No `flock`, so it
63
+ * works the same on Windows, where a lock file being deleted can refuse for a moment (EPERM,
64
+ * EBUSY): those are retried.
65
+ */
66
+ export declare function withSharedFileLock<T>(path: string, work: () => Promise<T>, o?: {
67
+ staleMs?: number;
68
+ waitMs?: number;
69
+ what?: string;
70
+ }): Promise<T>;
54
71
  /**
55
72
  * What stays on this machine inside .atticus/: the person's settings, the log, locks, upgrade
56
73
  * backups, the prompt and response history (ADR 0110), what `atticus probe` measured of the
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Path globs for the code tools (grep `paths`, files, and every .gitignore line of a scanned
3
+ * repo), matched in linear time. A glob is compiled to a small automaton and run over the path
4
+ * one character at a time with a set of live states, so no glob, however its `*`s are laid out,
5
+ * can backtrack: these run on the main thread with no time limit (final review, 2.0.0-beta.21).
6
+ */
7
+ export interface GlobMatcher {
8
+ test(path: string): boolean;
9
+ }
10
+ /**
11
+ * A glob as a matcher over a repo-relative path. A glob with no / matches a name at any depth;
12
+ * a leading / anchors it at the top.
13
+ */
14
+ export declare function globMatcher(glob: string, anyDepth?: boolean): GlobMatcher;
@@ -8,6 +8,21 @@
8
8
  * - topics (no leading slash in the input and no "/" at all) are returned trimmed
9
9
  */
10
10
  export declare function normalizePath(input: string): string;
11
+ /**
12
+ * A path with each `{...}` parameter cut to its name: what follows the first `:`, `?` or `=` in
13
+ * braces nested inside a constraint (`{code:regex(^\\d{3}$)}`) are matched, not cut at the first `}`.
14
+ * braces nested inside a constraint (`{code:regex(^\\d{{3}}$)}`) are matched, not cut at the first `}`.
15
+ * An unclosed `{` leaves the rest as written.
16
+ */
17
+ export declare function stripParamConstraints(path: string): string;
18
+ /** Code-unit string order, the same in every locale (`localeCompare` is not: ICU orders `_`/`-`
19
+ * and, in `da`, `aa` differently), for every sort that feeds records, ids, hashes or a merge. */
20
+ export declare function cmpText(a: string, b: string): number;
21
+ /**
22
+ * `cmpText`, but a run of digits is compared as a number (`a.ts:9` before `a.ts:10`): what
23
+ * `localeCompare(b, "en", { numeric: true })` was used for, without ICU.
24
+ */
25
+ export declare function cmpNatural(a: string, b: string): number;
11
26
  /**
12
27
  * Stable interface id: a hash of caller, callee, method and normalised path, so the same
13
28
  * edge seen by several extractors merges into one Interface record.
@@ -15,3 +30,16 @@ export declare function normalizePath(input: string): string;
15
30
  export declare function interfaceId(from: string, to: string, method: string | undefined, path: string): string;
16
31
  /** Lowercase slug suitable as a record id, built from free text such as a system name. */
17
32
  export declare function slugify(text: string): string;
33
+ /**
34
+ * Round 47: a name with no Latin letter or digit in it (`注文`, `Заказы`, `...`) slugs to
35
+ * nothing, so every such name used to become the same `unnamed` and their records merged.
36
+ * It gets `unnamed-<short hash of the name>` instead: stable, and different per name. Blank
37
+ * text stays `unnamed`.
38
+ */
39
+ export declare function unnamedId(text: string): string;
40
+ /**
41
+ * A slug that is never a Windows device name (review round 46): a record is the file
42
+ * `<kind>/<id>.yaml` and Windows can't create `aux.yaml`, so the slug's first dot-separated part,
43
+ * when it is one, gets `-1` (`aux` is `aux-1`, `con.v2` is `con-1.v2`). C1's RecordId is unchanged.
44
+ */
45
+ export declare function notDeviceName(slug: string): string;
@@ -55,6 +55,8 @@ export * from "./roles-migrate.js";
55
55
  export * from "./profile-migrate.js";
56
56
  export * from "./metarepo.js";
57
57
  export * from "./fs.js";
58
+ export * from "./glob.js";
59
+ export * from "./repo-files.js";
58
60
  export * from "./record-cache.js";
59
61
  export * from "./log.js";
60
62
  export * from "./zip.js";
@@ -233,6 +233,11 @@ export declare function raiseQuestions(root: string, drafts: QuestionDraft[], by
233
233
  */
234
234
  export declare function migrateQuestions(root: string, o?: {
235
235
  dryRun?: boolean;
236
+ /** Round 49: the files left as they are, with why (a file not named by its question's id). */
237
+ problems?: {
238
+ file: string;
239
+ message: string;
240
+ }[];
236
241
  }): Promise<string[]>;
237
242
  /** What a step says of a question it reused: who asked it first, and that it waits on it. */
238
243
  export declare const reusedLine: (q: Question) => string;
@@ -0,0 +1,60 @@
1
+ import { type GlobMatcher } from "./glob.js";
2
+ /**
3
+ * A file's bytes as text, the same way for every reader: UTF-16 (LE or BE) when it starts with
4
+ * that byte-order mark (SQL Server Management Studio saves .sql files so), else UTF-8 with any
5
+ * byte-order mark dropped, else, when the bytes aren't valid UTF-8, windows-1252 (a Latin-1 file
6
+ * from an older editor). Line numbers and quotes then agree between the read, the scan and the
7
+ * check.
8
+ */
9
+ export declare function decodeText(bytes: Uint8Array): string;
10
+ /** Whether a file's bytes are binary: a NUL in the first 8,000, unless it is marked UTF-16. */
11
+ export declare function isBinaryBytes(bytes: Uint8Array): boolean;
12
+ /** The same, for text `decodeText` made: a NUL is left only where the bytes were binary. */
13
+ export declare function isBinaryText(text: string): boolean;
14
+ /** A Git LFS pointer a checkout wasn't smudged with: three lines that stand for the real file. */
15
+ export declare function isLfsPointer(text: string): boolean;
16
+ /**
17
+ * Tokens a text costs, as every budget counts them (ADR 0112): four ASCII characters a token,
18
+ * and each character outside ASCII a token of its own. Characters / 4 alone counted Japanese,
19
+ * Chinese or Cyrillic at a quarter of what a tokenizer gives, so prompts over the model's limit
20
+ * were planned as fitting. `tokenUnits` is the same count in quarters, to sum over parts.
21
+ */
22
+ export declare function estimateTokens(text: string): number;
23
+ /** Quarter tokens: 1 for each ASCII character, 4 for each other (an astral one counted once). */
24
+ export declare function tokenUnits(text: string): number;
25
+ export interface IgnoreRule {
26
+ /** The folder of the .gitignore, repo-relative ("" for the root). */
27
+ base: string;
28
+ /** Matched in linear time (glob.ts): a scanned repo's .gitignore can't stall the scan. */
29
+ re: GlobMatcher;
30
+ negate: boolean;
31
+ dirOnly: boolean;
32
+ }
33
+ /** The rules of one .gitignore file (git's syntax: #, !, a trailing /, a leading or inner /). */
34
+ export declare function ignoreRules(text: string, base: string): IgnoreRule[];
35
+ /** Whether git would ignore a path by these rules: the last rule that matches decides. */
36
+ export declare function ignoredBy(rules: readonly IgnoreRule[], path: string, isDir: boolean): boolean;
37
+ export interface WalkOptions {
38
+ /**
39
+ * Whether a folder is left out: `above` are the folders it is in (repo-relative parts), `name`
40
+ * its own, `siblings` every name beside it. Asked after .git, links and .gitignore.
41
+ */
42
+ skipFolder?: (above: readonly string[], name: string, siblings: readonly string[]) => boolean;
43
+ }
44
+ /**
45
+ * A checkout's files, repo-relative with `/`, in the order a walk by name meets them: never a
46
+ * symbolic link (so no loop, no file outside the repo and no secret under another name), never
47
+ * `.git`, and nothing a .gitignore in the repo ignores (an ignored folder isn't walked). Only the
48
+ * repo's own .gitignore files are read. Deterministic: the same tree gives the same list.
49
+ */
50
+ export declare function listRepoFilesSync(root: string, o?: WalkOptions): string[];
51
+ /**
52
+ * The same walk, a file at a time: `visit` returns false to stop. Stops after `max` files and
53
+ * says it was cut.
54
+ */
55
+ export declare function walkRepo(root: string, visit: (path: string) => Promise<boolean | void>, o?: WalkOptions & {
56
+ max?: number;
57
+ }): Promise<{
58
+ files: number;
59
+ cut: boolean;
60
+ }>;
@@ -134,16 +134,25 @@ type CallLike = {
134
134
  * on now. One matcher for the verifier and the join.
135
135
  */
136
136
  export declare function linksFor(f: CallLike, corrections: readonly FactCorrection[]): FactCorrection[];
137
- /** A pairing as the join reads it: what the call reaches, who said so, and (ADR 0181) the AI run. */
137
+ /**
138
+ * A pairing as the join reads it: what the call reaches, who said so, and (ADR 0181) the AI run.
139
+ * Review round 48: `none` when a person's `unlink` is the newest (asked for with `declined`): the
140
+ * call reaches nothing a person knows of, so an AI answer never joins it (the path is the call's).
141
+ */
138
142
  export type PairOnFile = CorrectionLink & {
139
143
  by: string;
140
144
  ai?: CorrectionAi;
145
+ none?: true;
141
146
  };
142
147
  /**
143
148
  * G1 (ADR 0174): a repo's pairings, call fact id → what the person paired it with, from its
144
149
  * corrections file: the newest link per call (a repo's or an outside system's), met as linksFor
145
150
  * meets it. A link that meets no call is left out (the verifier says so). ADR 0181: an AI
146
- * pairing keeps its run (`ai`); a newer `unlink` withdraws any pairing.
151
+ * pairing keeps its run (`ai`); a newer `unlink` withdraws any pairing. With `declined` (the
152
+ * join's read, round 48), a person's newest `unlink` is kept as `none`, so the join knows a
153
+ * person said "none" and an AI answer doesn't join the call.
147
154
  */
148
- export declare function pairsFromCorrections(facts: readonly CallLike[], corrections: readonly FactCorrection[]): Record<string, PairOnFile>;
155
+ export declare function pairsFromCorrections(facts: readonly CallLike[], corrections: readonly FactCorrection[], o?: {
156
+ declined?: boolean;
157
+ }): Record<string, PairOnFile>;
149
158
  export {};
@@ -432,6 +432,13 @@ export declare const IntegrationPattern: z.ZodObject<{
432
432
  }>;
433
433
  }, z.core.$strict>;
434
434
  export type IntegrationPattern = z.infer<typeof IntegrationPattern>;
435
+ /**
436
+ * Review round 49: why git wouldn't take a wiki's `ref` as a branch or tag name, or undefined
437
+ * when it would. Git's own rules (git check-ref-format), and never a leading `-`, so the name
438
+ * can't be read as an option. Beta.18 took any name; round 13 narrowed it to letters, digits and
439
+ * `._/-`, which refused names git takes (`v2.1+hotfix`, `feature@x`); this takes them again.
440
+ */
441
+ export declare function gitRefProblem(ref: string): string | undefined;
435
442
  /** Suggested source kinds (ADR 0083). Tags are free text: an organisation adds its own. */
436
443
  export declare const SOURCE_KIND_SUGGESTIONS: readonly ["enterprise-architecture", "integration-patterns", "platform-runbook", "security-standard", "change-process", "framework"];
437
444
  /**
@@ -930,42 +937,72 @@ export declare const Runtime: z.ZodObject<{
930
937
  enabled: z.ZodDefault<z.ZodBoolean>;
931
938
  }, z.core.$strict>>;
932
939
  adapters: z.ZodDefault<z.ZodObject<{
933
- workTracker: z.ZodOptional<z.ZodObject<{
940
+ workTracker: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
941
+ [x: string]: string;
942
+ }>, z.ZodTransform<{
943
+ type: string;
944
+ settings: Record<string, string | number | boolean | string[]>;
945
+ }, string>>, z.ZodObject<{
934
946
  type: z.ZodEnum<{
935
947
  [x: string]: string;
936
948
  }>;
937
949
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
938
- }, z.core.$strict>>;
939
- serviceDesk: z.ZodOptional<z.ZodObject<{
950
+ }, z.core.$strict>]>>;
951
+ serviceDesk: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
952
+ [x: string]: string;
953
+ }>, z.ZodTransform<{
954
+ type: string;
955
+ settings: Record<string, string | number | boolean | string[]>;
956
+ }, string>>, z.ZodObject<{
940
957
  type: z.ZodEnum<{
941
958
  [x: string]: string;
942
959
  }>;
943
960
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
944
- }, z.core.$strict>>;
945
- gitHost: z.ZodOptional<z.ZodObject<{
961
+ }, z.core.$strict>]>>;
962
+ gitHost: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
963
+ [x: string]: string;
964
+ }>, z.ZodTransform<{
965
+ type: string;
966
+ settings: Record<string, string | number | boolean | string[]>;
967
+ }, string>>, z.ZodObject<{
946
968
  type: z.ZodEnum<{
947
969
  [x: string]: string;
948
970
  }>;
949
971
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
950
- }, z.core.$strict>>;
951
- wiki: z.ZodOptional<z.ZodObject<{
972
+ }, z.core.$strict>]>>;
973
+ wiki: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
974
+ [x: string]: string;
975
+ }>, z.ZodTransform<{
976
+ type: string;
977
+ settings: Record<string, string | number | boolean | string[]>;
978
+ }, string>>, z.ZodObject<{
952
979
  type: z.ZodEnum<{
953
980
  [x: string]: string;
954
981
  }>;
955
982
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
956
- }, z.core.$strict>>;
957
- notify: z.ZodOptional<z.ZodObject<{
983
+ }, z.core.$strict>]>>;
984
+ notify: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
985
+ [x: string]: string;
986
+ }>, z.ZodTransform<{
987
+ type: string;
988
+ settings: Record<string, string | number | boolean | string[]>;
989
+ }, string>>, z.ZodObject<{
958
990
  type: z.ZodEnum<{
959
991
  [x: string]: string;
960
992
  }>;
961
993
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
962
- }, z.core.$strict>>;
963
- design: z.ZodOptional<z.ZodObject<{
994
+ }, z.core.$strict>]>>;
995
+ design: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodEnum<{
996
+ [x: string]: string;
997
+ }>, z.ZodTransform<{
998
+ type: string;
999
+ settings: Record<string, string | number | boolean | string[]>;
1000
+ }, string>>, z.ZodObject<{
964
1001
  type: z.ZodEnum<{
965
1002
  [x: string]: string;
966
1003
  }>;
967
1004
  settings: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString>]>>>;
968
- }, z.core.$strict>>;
1005
+ }, z.core.$strict>]>>;
969
1006
  model: z.ZodOptional<z.ZodObject<{
970
1007
  type: z.ZodUnion<readonly [z.ZodEnum<{
971
1008
  mock: "mock";
package/npm/fs-repo.d.ts CHANGED
@@ -29,6 +29,7 @@ export declare class RepoReadError extends Error {
29
29
  /**
30
30
  * A read-only RepoHandle over a folder on disk (a base clone). Paths are repo-relative with
31
31
  * forward slashes on every platform and listed in sorted order, so scans are deterministic.
32
- * Symbolic links are never followed, and no path may leave the repo folder.
32
+ * Symbolic links are never followed, what the repo's .gitignore files ignore isn't listed, and
33
+ * no path may leave the repo folder.
33
34
  */
34
35
  export declare function fsRepo(name: string, dir: string, commit: string, options?: FsRepoOptions): FsRepoHandle;