@maycombhq/sdk 2.0.0-beta.11 → 2.0.0-beta.12

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/npm/core/api.d.ts CHANGED
@@ -124,8 +124,12 @@ import { z } from "zod";
124
124
  * 2.48.0 (ADR 0163): the organisation's terms a repo writes. `terms` on a repo in GET
125
125
  * /api/trust: each term fact's term, value, role and line, with the line giving it its role
126
126
  * and the note it rests on. Additive only.
127
+ * 2.49.0 (ADR 0168): GET /api/questions' `about[id].rule`, for an open targets question whose
128
+ * calls share a path prefix or host with other open targets questions of its repo: the rule
129
+ * (`/accounts/**`) one answer could take to cover them all, the questions it covers and their
130
+ * calls. Additive only.
127
131
  */
128
- export declare const API_VERSION = "2.48.0";
132
+ export declare const API_VERSION = "2.49.0";
129
133
  export declare const DEFAULT_PORT = 4321;
130
134
  /** RFC 9457 problem details, used for every error. */
131
135
  export declare const Problem: z.ZodObject<{
@@ -6605,6 +6609,11 @@ export declare const QuestionList: z.ZodObject<{
6605
6609
  at: z.ZodString;
6606
6610
  file: z.ZodString;
6607
6611
  }, z.core.$strip>>;
6612
+ rule: z.ZodOptional<z.ZodObject<{
6613
+ match: z.ZodString;
6614
+ ids: z.ZodArray<z.ZodString>;
6615
+ calls: z.ZodNumber;
6616
+ }, z.core.$strip>>;
6608
6617
  }, z.core.$strip>>>;
6609
6618
  me: z.ZodOptional<z.ZodObject<{
6610
6619
  handle: z.ZodString;
@@ -318,6 +318,29 @@ export interface FactJoinOutside {
318
318
  call: FactEnd;
319
319
  target: string;
320
320
  }
321
+ /**
322
+ * Why the join left a call it neither joined, asked about nor left to an outside system (with
323
+ * `explain`), in its own words, at the point it gave up:
324
+ * - `no-host`: no host, base or target in the code, and no entry of the estate serves its path;
325
+ * - `unresolved-placeholder`: the host or base it names (a placeholder or a config key) no
326
+ * setting resolves (J0), and no entry serves its path;
327
+ * - `host-no-route`: a host the manifest or an exposure lists, and no route there serves its path
328
+ * or method; `label-no-route`: the same for a host's first label naming a component;
329
+ * - `target-no-route`: the repo or component it names (or a person's answer names) has no entry
330
+ * serving it;
331
+ * - `generic-path`: a health, status or metrics path with no target, which every service serves;
332
+ * - `answered-none`: a person answered that nothing in the estate answers it;
333
+ * - `topic-unheard`: a publish no listener's topic matches; `topic-unresolved`: a placeholder
334
+ * topic no setting resolves (J0);
335
+ * - `type-not-joined`: a call of a type the join doesn't join (`SERVES`).
336
+ */
337
+ export declare const JOIN_LEFT_REASONS: readonly ["no-host", "unresolved-placeholder", "host-no-route", "label-no-route", "target-no-route", "generic-path", "answered-none", "topic-unheard", "topic-unresolved", "type-not-joined"];
338
+ export type JoinLeftReason = (typeof JOIN_LEFT_REASONS)[number];
339
+ /** A call the join left, and why (with `explain`). */
340
+ export interface FactJoinLeft {
341
+ call: FactEnd;
342
+ reason: JoinLeftReason;
343
+ }
321
344
  /** A call whose named target (a repo or component of the estate) has no entry for it. */
322
345
  export interface FactJoinMiss {
323
346
  call: FactEnd;
@@ -359,6 +382,8 @@ export interface FactsJoinResult {
359
382
  outside?: FactJoinOutside[];
360
383
  /** J1: exposure facts that conflict with the manifest or name no component; left out when none. */
361
384
  exposure?: ExposureFinding[];
385
+ /** With `explain`: every call left, with why; left out otherwise. */
386
+ left?: FactJoinLeft[];
362
387
  }
363
388
  export interface JoinFactsInput {
364
389
  repos: readonly JoinRepo[];
@@ -386,6 +411,8 @@ export interface JoinFactsInput {
386
411
  * gateway's repo, and the route's forwarding call is joined on its own. Default true.
387
412
  */
388
413
  walkGateways?: boolean;
414
+ /** Say why each call left unjoined, unasked and not outside was left (`left`). Default false. */
415
+ explain?: boolean;
389
416
  }
390
417
  type Entry = FactOf<"entry">;
391
418
  type Call = FactOf<"call">;
@@ -154,6 +154,14 @@ export interface RaiseOptions {
154
154
  hold?: (q: Question, answered: Question[]) => boolean;
155
155
  /** Where judgments are kept; default the metarepo's judgments/. */
156
156
  judgments?: JudgmentStore;
157
+ /**
158
+ * Beta.12: an open, unanswered question on file by the draft's id, that this step asked, gets
159
+ * the draft's options and words in place (the same id, its history kept), so what a step
160
+ * offers now (ranked suggestions, their reasons, a repo read since) reaches a question asked
161
+ * before. Returned in `refreshed` (and `known`). An answered or retired question is never
162
+ * touched.
163
+ */
164
+ refresh?: boolean;
157
165
  }
158
166
  /** A question held back: the one it would have been, and the answered ones that may decide it. */
159
167
  export interface HeldQuestion {
@@ -178,7 +186,8 @@ export declare function sameTarget(a: {
178
186
  }, repo?: string): boolean;
179
187
  /**
180
188
  * Write the questions a step raised (ADR 0078, 0089, 0117). One already on file by its id is
181
- * left as it is and returned in `known`. Otherwise it is weighed against the questions on file
189
+ * left as it is and returned in `known` (with `refresh`, an open one this step asked takes the
190
+ * draft's options and words first). Otherwise it is weighed against the questions on file
182
191
  * for the same repo:
183
192
  * 1. the veto: the two name different ids, fields or numbers, so they differ;
184
193
  * 2. the step's own reading (`sameAs`), when the id is a candidate and its words are in it;
@@ -198,6 +207,8 @@ export declare function raiseQuestions(root: string, drafts: QuestionDraft[], by
198
207
  held: HeldQuestion[];
199
208
  /** The answered questions whose answer decides a draft, by the draft's index (ADR 0117 addendum). */
200
209
  decidedBy: Map<number, Question>;
210
+ /** With `refresh`: open questions on file that took the draft's options and words. */
211
+ refreshed: Question[];
201
212
  }>;
202
213
  /**
203
214
  * Rewrite questions/<id>.yaml files written at an older question schema version (1, ADR 0078;
package/npm/index.js CHANGED
@@ -6852,6 +6852,15 @@ var QuestionList = z29.object({
6852
6852
  by: z29.string(),
6853
6853
  at: z29.string(),
6854
6854
  file: z29.string()
6855
+ }).optional(),
6856
+ /**
6857
+ * 2.49.0 (ADR 0168): the rule one answer could take to cover this open targets question
6858
+ * and the other open ones of its repo whose calls share its path prefix or host.
6859
+ */
6860
+ rule: z29.object({
6861
+ match: z29.string(),
6862
+ ids: z29.array(z29.string()),
6863
+ calls: z29.number().int()
6855
6864
  }).optional()
6856
6865
  })).optional(),
6857
6866
  /** 2.33.0 (ADR 0140): with mine=true, who the person is and the teams roles.yaml puts them on. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maycombhq/sdk",
3
- "version": "2.0.0-beta.11",
3
+ "version": "2.0.0-beta.12",
4
4
  "description": "Atticus plugin SDK (contract C4): interfaces for extractors, dialects, ingestors and adapters.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",