@maycombhq/sdk 0.0.0-stage → 2.0.0-beta.2
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/LICENSE +177 -0
- package/npm/cache.d.ts +47 -0
- package/npm/core/api.d.ts +6098 -0
- package/npm/core/assistant-actor.d.ts +15 -0
- package/npm/core/branches.d.ts +21 -0
- package/npm/core/cancel.d.ts +9 -0
- package/npm/core/catalog.d.ts +4733 -0
- package/npm/core/change-types-migrate.d.ts +10 -0
- package/npm/core/cite.d.ts +54 -0
- package/npm/core/curated.d.ts +37 -0
- package/npm/core/facts-callers.d.ts +150 -0
- package/npm/core/facts-carry.d.ts +36 -0
- package/npm/core/facts-join-prototype.d.ts +177 -0
- package/npm/core/facts-join-vendor.d.ts +92 -0
- package/npm/core/facts-join.d.ts +256 -0
- package/npm/core/facts.d.ts +94 -0
- package/npm/core/fs.d.ts +47 -0
- package/npm/core/gates-migrate.d.ts +10 -0
- package/npm/core/host-questions.d.ts +24 -0
- package/npm/core/identity.d.ts +17 -0
- package/npm/core/index.d.ts +62 -0
- package/npm/core/json-schema.d.ts +20 -0
- package/npm/core/judgments.d.ts +63 -0
- package/npm/core/light.d.ts +8 -0
- package/npm/core/log.d.ts +49 -0
- package/npm/core/manifest-edit.d.ts +48 -0
- package/npm/core/merge.d.ts +78 -0
- package/npm/core/metarepo.d.ts +83 -0
- package/npm/core/migrate.d.ts +31 -0
- package/npm/core/migration-files.d.ts +13 -0
- package/npm/core/orgpack-defaults.d.ts +194 -0
- package/npm/core/orgpack-load.d.ts +86 -0
- package/npm/core/questions.d.ts +267 -0
- package/npm/core/record-cache.d.ts +52 -0
- package/npm/core/refs.d.ts +9 -0
- package/npm/core/repo-description.d.ts +44 -0
- package/npm/core/runtime-migrate.d.ts +11 -0
- package/npm/core/schema/ai.d.ts +397 -0
- package/npm/core/schema/change.d.ts +244 -0
- package/npm/core/schema/common.d.ts +135 -0
- package/npm/core/schema/dialect.d.ts +801 -0
- package/npm/core/schema/executors.d.ts +396 -0
- package/npm/core/schema/fact-corrections.d.ts +55 -0
- package/npm/core/schema/facts.d.ts +1476 -0
- package/npm/core/schema/frameworks.d.ts +371 -0
- package/npm/core/schema/judgment.d.ts +77 -0
- package/npm/core/schema/kinds.d.ts +5166 -0
- package/npm/core/schema/layout.d.ts +25 -0
- package/npm/core/schema/orgpack.d.ts +1167 -0
- package/npm/core/schema/plugin.d.ts +73 -0
- package/npm/core/schema/question.d.ts +152 -0
- package/npm/core/schema/repo-type.d.ts +109 -0
- package/npm/core/schema/review.d.ts +558 -0
- package/npm/core/schema/scan-settings.d.ts +34 -0
- package/npm/core/schema/scan-verify.d.ts +535 -0
- package/npm/core/schema/spec.d.ts +269 -0
- package/npm/core/schema/version.d.ts +9 -0
- package/npm/core/schema/workspace.d.ts +312 -0
- package/npm/core/serialize.d.ts +17 -0
- package/npm/core/sources-migrate.d.ts +15 -0
- package/npm/core/specs.d.ts +66 -0
- package/npm/core/tar-read.d.ts +13 -0
- package/npm/core/template.d.ts +101 -0
- package/npm/core/words.d.ts +13 -0
- package/npm/core/zip-read.d.ts +37 -0
- package/npm/core/zip.d.ts +13 -0
- package/npm/fs-repo.d.ts +34 -0
- package/npm/index.d.ts +6 -0
- package/npm/index.js +8892 -0
- package/npm/parse-cache.d.ts +97 -0
- package/npm/plugin.d.ts +89 -0
- package/npm/runner.d.ts +72 -0
- package/npm/sandbox.d.ts +80 -0
- package/package.json +28 -3
- package/README.md +0 -3
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { RepoDescription } from "./schema/workspace.js";
|
|
2
|
+
/**
|
|
3
|
+
* Editing `org-pack/profiles/<platform>/repos.manifest.yaml` in place, keeping the file's
|
|
4
|
+
* comments and the order a person put its entries in: a repo's description (ADR 0128), and the
|
|
5
|
+
* schema-version rewrite `atticus upgrade` runs. Every write is checked against the manifest
|
|
6
|
+
* schema first, so a manifest Atticus can't read is never written.
|
|
7
|
+
*/
|
|
8
|
+
/** One profile's manifest: where it is on disk and how the metarepo names it. */
|
|
9
|
+
export interface ManifestFile {
|
|
10
|
+
path: string;
|
|
11
|
+
rel: string;
|
|
12
|
+
platform: string;
|
|
13
|
+
}
|
|
14
|
+
/** Every profile's manifest, by platform name. */
|
|
15
|
+
export declare function manifestFiles(root: string): Promise<ManifestFile[]>;
|
|
16
|
+
export declare class ManifestEditError extends Error {
|
|
17
|
+
readonly code: "not-found" | "invalid";
|
|
18
|
+
constructor(code: "not-found" | "invalid", message: string);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Set, replace or remove a repo's description in the manifest that lists it. A person's own
|
|
22
|
+
* words come in as `verified`; a draft the assistant wrote comes in as `suggested` with its
|
|
23
|
+
* cites, and stays marked unconfirmed until a person confirms it.
|
|
24
|
+
*/
|
|
25
|
+
export declare function setManifestDescription(root: string, repo: string, description: RepoDescription | undefined): Promise<ManifestFile>;
|
|
26
|
+
/**
|
|
27
|
+
* Add a repo to a platform's manifest, keeping the file's comments and the order its entries
|
|
28
|
+
* are in. The entry is written with the fields that are set and no more, and the whole manifest
|
|
29
|
+
* is checked before it is written, so a duplicate id or a password in the URL is refused here.
|
|
30
|
+
*/
|
|
31
|
+
export declare function addManifestRepo(root: string, platform: string, entry: {
|
|
32
|
+
id: string;
|
|
33
|
+
url: string;
|
|
34
|
+
type: string;
|
|
35
|
+
owner: string;
|
|
36
|
+
system?: string;
|
|
37
|
+
component?: string;
|
|
38
|
+
description?: RepoDescription;
|
|
39
|
+
}): Promise<ManifestFile>;
|
|
40
|
+
/**
|
|
41
|
+
* Rewrite every manifest that still says schemaVersion 1 at the current version, keeping its
|
|
42
|
+
* comments and order (ADR 0009, 0128). Nothing a person wrote changes: version-1 manifests are
|
|
43
|
+
* read as they are and stay valid, and this only keeps diffs clean. `dryRun` lists what it
|
|
44
|
+
* would change.
|
|
45
|
+
*/
|
|
46
|
+
export declare function migrateManifests(root: string, o?: {
|
|
47
|
+
dryRun?: boolean;
|
|
48
|
+
}): Promise<string[]>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type CatalogRecord, type RecordIssue } from "./catalog.js";
|
|
2
|
+
/**
|
|
3
|
+
* Merge and identity: turns the records every repo's scan produced into one catalog.
|
|
4
|
+
*
|
|
5
|
+
* - Records with the same identity merge (evidence is unioned, the best value wins).
|
|
6
|
+
* - REST endpoints are keyed by component, method and normalised path and get a canonical id.
|
|
7
|
+
* - Loose ends (Unresolved records, ADR 0016) are resolved: HTTP calls into Interfaces
|
|
8
|
+
* (through the gateway when a route's base path matches), publishes and subscribes into
|
|
9
|
+
* event Interfaces, database access into Tables' readers and writers; GraphQL, gRPC and
|
|
10
|
+
* webhook loose ends (ADR 0040) into Interfaces to the matching typed endpoints.
|
|
11
|
+
* - A direct synchronous call between two components with a `mesh` Setting goes via mesh.
|
|
12
|
+
* - Interfaces are verified only when both ends are seen; otherwise inferred.
|
|
13
|
+
* - Whatever can't be resolved stays as an Unresolved record with its owner.
|
|
14
|
+
*
|
|
15
|
+
* Deterministic: the same input gives the same catalog, sorted by kind and id. See ADR 0017.
|
|
16
|
+
*/
|
|
17
|
+
export interface MergeRepo {
|
|
18
|
+
id: string;
|
|
19
|
+
component?: string;
|
|
20
|
+
system?: string;
|
|
21
|
+
type: string;
|
|
22
|
+
/** Hosts the repo's component (or, for a gateway repo, the gateway) answers on (ADR 0053). */
|
|
23
|
+
hosts?: string[];
|
|
24
|
+
}
|
|
25
|
+
export interface MergeSystem {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
boundary: "product" | "internal" | "vendor";
|
|
29
|
+
owner?: string;
|
|
30
|
+
aliases: string[];
|
|
31
|
+
/** Copied to the System record (ADR 0040: saas marks a SaaS vendor). */
|
|
32
|
+
tags?: string[];
|
|
33
|
+
}
|
|
34
|
+
/** What merge needs from an integration pattern (C6) to infer it on a hop. */
|
|
35
|
+
export interface MergePattern {
|
|
36
|
+
code: string;
|
|
37
|
+
status: string;
|
|
38
|
+
detection: {
|
|
39
|
+
via: string[];
|
|
40
|
+
sync?: string;
|
|
41
|
+
targetBoundary?: string;
|
|
42
|
+
sameSystem?: boolean;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface MergeInput {
|
|
46
|
+
records: CatalogRecord[];
|
|
47
|
+
repos: MergeRepo[];
|
|
48
|
+
systems: MergeSystem[];
|
|
49
|
+
patterns?: MergePattern[];
|
|
50
|
+
/** Where the systems came from, for their evidence (e.g. "org-pack/profiles/forge/profile.yaml"). */
|
|
51
|
+
profilePath?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Route a call to an undeclared host through the gateway route its path starts with, as before
|
|
54
|
+
* ADR 0053. Only for callers without the repos manifest (drift on a fetched copy of the
|
|
55
|
+
* catalog), where no host is declared; a full scan never sets it.
|
|
56
|
+
*/
|
|
57
|
+
gatewayByBasepath?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface MergeResult {
|
|
60
|
+
records: CatalogRecord[];
|
|
61
|
+
/** Records merge produced that failed C1 (a bug if ever non-empty). */
|
|
62
|
+
invalid: {
|
|
63
|
+
record: unknown;
|
|
64
|
+
issues: RecordIssue[];
|
|
65
|
+
}[];
|
|
66
|
+
stats: {
|
|
67
|
+
interfaces: number;
|
|
68
|
+
verified: number;
|
|
69
|
+
unresolved: number;
|
|
70
|
+
};
|
|
71
|
+
/** Things worth knowing that aren't wrong, e.g. hosts that look like a gateway nobody declared. */
|
|
72
|
+
notes: string[];
|
|
73
|
+
}
|
|
74
|
+
/** Canonical REST endpoint id: <component>.<method>-<last fixed path segment, singular>. */
|
|
75
|
+
export declare function endpointId(component: string, method: string | undefined, normalizedPath: string): string;
|
|
76
|
+
export declare function mergeCatalog(input: MergeInput): MergeResult;
|
|
77
|
+
/** The Setting key that says a component runs in a service mesh (ADR 0040); its value names the mesh. */
|
|
78
|
+
export declare const MESH_KEY = "mesh";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** True when the org pack is in `.atticus/org-pack/` (a repo adopted in place). */
|
|
2
|
+
export declare function isAdopted(root: string): boolean;
|
|
3
|
+
/** The org pack folder: `org-pack/` at the root, else `.atticus/org-pack/` when adopted. */
|
|
4
|
+
export declare function orgPackDirOf(root: string): string;
|
|
5
|
+
/** The org pack folder relative to the root with forward slashes, for messages and stored paths. */
|
|
6
|
+
export declare function orgPackRelOf(root: string): string;
|
|
7
|
+
/** The folder holding local state (`.index/`, `.runs/`, `workspace/`): the root, or `.atticus/`. */
|
|
8
|
+
export declare function stateDirOf(root: string): string;
|
|
9
|
+
/** Run folders (`.runs/<change>/<runId>/`: prompts, packs, build logs): under the state folder. */
|
|
10
|
+
export declare function runsDirOf(root: string): string;
|
|
11
|
+
/** The run folders relative to the root with forward slashes, for messages and stored paths. */
|
|
12
|
+
export declare function runsRelOf(root: string): string;
|
|
13
|
+
/** Where intake looks for what people drop in: `inputs/`, or `.atticus/inputs/` when adopted. */
|
|
14
|
+
export declare function inputsDirOf(root: string): string;
|
|
15
|
+
/** Where Atticus writes proposals for people to review, relative to the root with forward slashes. */
|
|
16
|
+
export declare function proposalsRelOf(root: string): string;
|
|
17
|
+
/** The proposals folder: `proposals/`, or `.atticus/proposals/` when adopted. */
|
|
18
|
+
export declare function proposalsDirOf(root: string): string;
|
|
19
|
+
/** Where questions to people live (ADR 0078), relative to the root: `questions`, or `.atticus/questions` when adopted. */
|
|
20
|
+
export declare function questionsRelOf(root: string): string;
|
|
21
|
+
/** The questions folder (ADR 0078). */
|
|
22
|
+
export declare function questionsDirOf(root: string): string;
|
|
23
|
+
/** Where the facts an assistant writes live, with forward slashes (ADR 0124): `facts`, or `.atticus/facts` when adopted. */
|
|
24
|
+
export declare function factsRelOf(root: string): string;
|
|
25
|
+
/** The facts folder (ADR 0124): `<repo>.jsonl` the assistant writes, `<repo>.rejected.jsonl` and `<repo>.verify.yaml` the verifier writes. */
|
|
26
|
+
export declare function factsDirOf(root: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* The files the facts folder keeps beside a repo's facts file (ADR 0124): the questions the
|
|
29
|
+
* assistant raised, what the verifier rejected, the files read and found to hold no fact, a
|
|
30
|
+
* person's corrections, the verifier's report, and the read plan of a repo read in parts
|
|
31
|
+
* (addendum A-ledger). None of them is a facts file of its own.
|
|
32
|
+
*/
|
|
33
|
+
export declare const FACTS_COMPANIONS: readonly [".questions.jsonl", ".rejected.jsonl", ".reviewed.jsonl", ".corrections.jsonl", ".verify.yaml", ".read-plan.yaml"];
|
|
34
|
+
/**
|
|
35
|
+
* The repo a file in the facts folder belongs to, and whether it is the repo's facts file
|
|
36
|
+
* (`<repo>.jsonl`) or one of its companions; undefined for any other file. Every place that lists
|
|
37
|
+
* the facts folder reads it through this, so a companion is never taken for another repo.
|
|
38
|
+
*/
|
|
39
|
+
export declare function factsFileOf(name: string): {
|
|
40
|
+
repo: string;
|
|
41
|
+
facts: boolean;
|
|
42
|
+
} | undefined;
|
|
43
|
+
/** Where the map rendered from a repo's verified facts lives, with forward slashes (ADR 0124): `map`, or `.atticus/map` when adopted. */
|
|
44
|
+
export declare function mapRelOf(root: string): string;
|
|
45
|
+
/** The map folder (ADR 0124): `<repo>/map.md`, `<repo>/flows/` and `<repo>/contracts/`, written by atticus map render. */
|
|
46
|
+
export declare function mapDirOf(root: string): string;
|
|
47
|
+
/** Where judgments live (ADR 0117), relative to the root: `judgments`, or `.atticus/judgments` when adopted. */
|
|
48
|
+
export declare function judgmentsRelOf(root: string): string;
|
|
49
|
+
/** The judgments folder (ADR 0117): judgments/<kind>/<key>.yaml. */
|
|
50
|
+
export declare function judgmentsDirOf(root: string): string;
|
|
51
|
+
/** Where repo specs live (ADR 0079), relative to the root: `specs`, or `.atticus/specs` when adopted. */
|
|
52
|
+
export declare function specsRelOf(root: string): string;
|
|
53
|
+
/** The specs folder (ADR 0079), holding one folder per repo. */
|
|
54
|
+
export declare function specsDirOf(root: string): string;
|
|
55
|
+
/** One repo's spec folder, relative to the root: `specs/<repo>` (spec.yaml and one file per flow). */
|
|
56
|
+
export declare function specRelOf(root: string, repo: string): string;
|
|
57
|
+
/** One repo's spec folder (ADR 0079). */
|
|
58
|
+
export declare function specDirOf(root: string, repo: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Where knowledge lives (ADR 0083), relative to the root: `knowledge`, or `.atticus/knowledge`
|
|
61
|
+
* when adopted. It holds `snapshots/<source>/<date>/` (what a sync copied) and `items/` (what
|
|
62
|
+
* the knowledge scan read from a snapshot).
|
|
63
|
+
*/
|
|
64
|
+
export declare function knowledgeRelOf(root: string): string;
|
|
65
|
+
/** The knowledge folder (ADR 0083). */
|
|
66
|
+
export declare function knowledgeDirOf(root: string): string;
|
|
67
|
+
/** The layout from sources.yaml, or the defaults. */
|
|
68
|
+
export declare function layoutOf(root: string): {
|
|
69
|
+
catalog: string;
|
|
70
|
+
openspec: string;
|
|
71
|
+
};
|
|
72
|
+
/** The catalog folder (holding generated/ and curated/). */
|
|
73
|
+
export declare function catalogDirOf(root: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Where OpenSpec keeps changes, relative to the root with forward slashes: `changes/` under
|
|
76
|
+
* `layout.openspec` (`openspec/changes` by default, `.atticus/openspec/changes` in a repo
|
|
77
|
+
* adopted without its own OpenSpec folder). For messages, PR file lists and CODEOWNERS paths.
|
|
78
|
+
*/
|
|
79
|
+
export declare function changesRelOf(root: string): string;
|
|
80
|
+
/** The OpenSpec folder (holding config.yaml, specs/ and changes/). */
|
|
81
|
+
export declare function openspecDirOf(root: string): string;
|
|
82
|
+
/** The folder holding change folders (`<id>/`) and `archive/`. */
|
|
83
|
+
export declare function changesDirOf(root: string): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface MigrationResult {
|
|
2
|
+
/** Files rewritten at the current schema version (relative to the folder, "/"-separated). */
|
|
3
|
+
migrated: string[];
|
|
4
|
+
/** Record files already at the current version, left alone. */
|
|
5
|
+
current: string[];
|
|
6
|
+
/** Old record files that don't pass C1: left exactly as they are, with why. */
|
|
7
|
+
problems: {
|
|
8
|
+
file: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Rewrite every older record file under a catalog folder (generated and curated) at the
|
|
14
|
+
* current schema version, in canonical form. Readers accept old files anyway; migrating once
|
|
15
|
+
* keeps diffs clean afterwards. A file that isn't a catalog record (no known `kind`) is not
|
|
16
|
+
* touched, nor is an old one that fails C1: it is reported, so nothing is half-migrated.
|
|
17
|
+
* Version 1 → 2 (ADR 0031) and 2 → 3 (ADR 0125) change only `schemaVersion`: version 3 adds
|
|
18
|
+
* `required` on a Schema field, and a migrated record gains none, since nothing knew it. The
|
|
19
|
+
* canonical form also writes list defaults a hand-written file left out, exactly as a scan
|
|
20
|
+
* would write the record. `versions` limits it to files at those versions (each `atticus
|
|
21
|
+
* upgrade` step lists its own); what it writes is always the current version.
|
|
22
|
+
*
|
|
23
|
+
* `pendingOnly` is for a question about what is to do (`atticus doctor`, the app's Set up
|
|
24
|
+
* screen): `current` stays empty, and with `versions` a file whose text alone says it is at
|
|
25
|
+
* another version is not read as YAML. `migrated` and `problems` are the same as without it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function migrateCatalog(dir: string, o?: {
|
|
28
|
+
dryRun?: boolean;
|
|
29
|
+
versions?: readonly number[];
|
|
30
|
+
pendingOnly?: boolean;
|
|
31
|
+
}): Promise<MigrationResult>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a cited file is a database migration, by the file naming the common migration tools
|
|
3
|
+
* use (ADR 0124 addendum B-places): the facts cite a column where it is declared, and when that
|
|
4
|
+
* is a migration the store's migrations are known from the facts, so a change to its tables is a
|
|
5
|
+
* new migration beside them rather than an edit of a schema file. `tool` is C1's Migration tool;
|
|
6
|
+
* `version` is the part of the name the tool orders by. A schema file, an entity, a tool's own
|
|
7
|
+
* scaffolding (an environment script, a designer or snapshot file) is no migration.
|
|
8
|
+
*/
|
|
9
|
+
export interface MigrationFile {
|
|
10
|
+
tool: "flyway" | "liquibase" | "alembic" | "prisma" | "other";
|
|
11
|
+
version: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function migrationOf(path: string): MigrationFile | undefined;
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
export declare const DEFAULT_CHANGE_TYPES: {
|
|
2
|
+
schemaVersion: 1 | 2;
|
|
3
|
+
types: {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
phases: ("release" | "design" | "qa" | "define" | "plan" | "build")[];
|
|
7
|
+
artifacts: ("interfaces" | "data" | "ux" | "brief" | "proposal" | "specs" | "mappings" | "design" | "stories" | "tasks" | "snow")[];
|
|
8
|
+
lenses: ("true" | "complete" | "safe" | "ship" | "business" | "architecture" | "story" | "ux" | "delivery" | "code-and-test" | "release")[];
|
|
9
|
+
approvals: Partial<Record<"release" | "design" | "qa" | "define" | "plan" | "build", string[]>>;
|
|
10
|
+
postReleaseReview: boolean;
|
|
11
|
+
description?: string | undefined;
|
|
12
|
+
size?: "small" | "standard" | undefined;
|
|
13
|
+
smallWhenBriefSays?: boolean | undefined;
|
|
14
|
+
fastGate?: string | undefined;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export declare const DEFAULT_GATES: {
|
|
18
|
+
schemaVersion: 1 | 2;
|
|
19
|
+
gates: {
|
|
20
|
+
id: string;
|
|
21
|
+
phase: "release" | "design" | "qa" | "define" | "plan" | "build";
|
|
22
|
+
approvers: string[];
|
|
23
|
+
minApprovals: number;
|
|
24
|
+
checklists: string[];
|
|
25
|
+
checks: {
|
|
26
|
+
check: string;
|
|
27
|
+
params: Record<string, unknown>;
|
|
28
|
+
}[];
|
|
29
|
+
maxAuthorRounds?: number | "unlimited" | undefined;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
export declare const DEFAULT_ROLES: {
|
|
33
|
+
schemaVersion: 1;
|
|
34
|
+
custom: {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
basedOn: "product-owner" | "business-analyst" | "architect" | "team-lead" | "developer" | "qa" | "delivery-lead" | "platform-lead" | "designer" | "process-owner" | "data-architect" | "sre" | "security-reviewer";
|
|
38
|
+
}[];
|
|
39
|
+
enabledOptional: ("process-owner" | "data-architect" | "sre" | "security-reviewer")[];
|
|
40
|
+
mappings: {
|
|
41
|
+
group: string;
|
|
42
|
+
role: string;
|
|
43
|
+
}[];
|
|
44
|
+
approvals: Partial<Record<"release-go-no-go" | "waiver" | "snow-submission" | "org-pack-change" | "catalog-assert", {
|
|
45
|
+
roles: string[];
|
|
46
|
+
groups: string[];
|
|
47
|
+
people: string[];
|
|
48
|
+
}>>;
|
|
49
|
+
separation: {
|
|
50
|
+
actions: [string, string];
|
|
51
|
+
reason: string;
|
|
52
|
+
}[];
|
|
53
|
+
};
|
|
54
|
+
export declare const DEFAULT_RUNTIME: {
|
|
55
|
+
schemaVersion: 1 | 2;
|
|
56
|
+
assistants: {
|
|
57
|
+
allowed: ("copilot" | "claude-code" | "cursor" | "gemini-cli" | "windsurf" | "agents-md")[];
|
|
58
|
+
default: "copilot" | "claude-code" | "cursor" | "gemini-cli" | "windsurf" | "agents-md";
|
|
59
|
+
};
|
|
60
|
+
editors: ("vscode" | "intellij")[];
|
|
61
|
+
ai: "on" | "text-only" | "off";
|
|
62
|
+
modes: {
|
|
63
|
+
allowed: ("model" | "hand-off" | "headless-claude-code")[];
|
|
64
|
+
default: "model" | "hand-off" | "headless-claude-code";
|
|
65
|
+
};
|
|
66
|
+
models: {
|
|
67
|
+
allowed: string[];
|
|
68
|
+
recommended: Record<string, string>;
|
|
69
|
+
read?: string | undefined;
|
|
70
|
+
draft?: string | undefined;
|
|
71
|
+
critic?: string | undefined;
|
|
72
|
+
knowledge?: string | undefined;
|
|
73
|
+
quick?: string | undefined;
|
|
74
|
+
};
|
|
75
|
+
autonomy: {
|
|
76
|
+
default: "draft" | "plan-only" | "draft-and-pr";
|
|
77
|
+
capPerRepo: Record<string, "draft" | "plan-only" | "draft-and-pr">;
|
|
78
|
+
maxFixRounds: number;
|
|
79
|
+
};
|
|
80
|
+
budgets: {
|
|
81
|
+
defaultTokens: number;
|
|
82
|
+
perAgent: Record<string, number>;
|
|
83
|
+
};
|
|
84
|
+
retention: {
|
|
85
|
+
runsDays: number;
|
|
86
|
+
};
|
|
87
|
+
telemetry: {
|
|
88
|
+
enabled: boolean;
|
|
89
|
+
};
|
|
90
|
+
adapters: {
|
|
91
|
+
workTracker?: {
|
|
92
|
+
type: string;
|
|
93
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
94
|
+
} | undefined;
|
|
95
|
+
serviceDesk?: {
|
|
96
|
+
type: string;
|
|
97
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
98
|
+
} | undefined;
|
|
99
|
+
gitHost?: {
|
|
100
|
+
type: string;
|
|
101
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
102
|
+
} | undefined;
|
|
103
|
+
wiki?: {
|
|
104
|
+
type: string;
|
|
105
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
106
|
+
} | undefined;
|
|
107
|
+
notify?: {
|
|
108
|
+
type: string;
|
|
109
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
110
|
+
} | undefined;
|
|
111
|
+
design?: {
|
|
112
|
+
type: string;
|
|
113
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
114
|
+
} | undefined;
|
|
115
|
+
model?: {
|
|
116
|
+
type: string;
|
|
117
|
+
settings: Record<string, string | number | boolean | string[]>;
|
|
118
|
+
} | undefined;
|
|
119
|
+
};
|
|
120
|
+
history?: {
|
|
121
|
+
record: boolean;
|
|
122
|
+
} | undefined;
|
|
123
|
+
retrieval?: {
|
|
124
|
+
embeddings: {
|
|
125
|
+
model: string;
|
|
126
|
+
runtime?: string | undefined;
|
|
127
|
+
};
|
|
128
|
+
expansion: boolean;
|
|
129
|
+
rerank: boolean;
|
|
130
|
+
} | undefined;
|
|
131
|
+
buildEngine?: {
|
|
132
|
+
default: "atticus" | "speckit";
|
|
133
|
+
perRepo: Record<string, "atticus" | "speckit">;
|
|
134
|
+
} | undefined;
|
|
135
|
+
};
|
|
136
|
+
export declare const DEFAULT_SOURCES: {
|
|
137
|
+
schemaVersion: 3 | 1 | 2;
|
|
138
|
+
layout: {
|
|
139
|
+
openspec: string;
|
|
140
|
+
catalog: string;
|
|
141
|
+
skills: string[];
|
|
142
|
+
prompts: string[];
|
|
143
|
+
constitution?: string | undefined;
|
|
144
|
+
};
|
|
145
|
+
wikis: {
|
|
146
|
+
id: string;
|
|
147
|
+
type: "confluence-export" | "sharepoint-export" | "confluence" | "ado-wiki" | "sharepoint" | "markdown-folder" | "git";
|
|
148
|
+
location: string;
|
|
149
|
+
spaces: string[];
|
|
150
|
+
owner?: string | undefined;
|
|
151
|
+
tags?: {
|
|
152
|
+
kinds: string[];
|
|
153
|
+
frameworks: string[];
|
|
154
|
+
} | undefined;
|
|
155
|
+
ref?: string | undefined;
|
|
156
|
+
path?: string | undefined;
|
|
157
|
+
checkout?: "clone" | "submodule" | undefined;
|
|
158
|
+
include?: string[] | undefined;
|
|
159
|
+
exclude?: string[] | undefined;
|
|
160
|
+
authority?: "platform" | "standard" | "framework" | "team" | "reference" | undefined;
|
|
161
|
+
byPage?: {
|
|
162
|
+
match: string[];
|
|
163
|
+
authority?: "platform" | "standard" | "framework" | "team" | "reference" | undefined;
|
|
164
|
+
status?: "current" | "deprecated" | "superseded" | "archived" | undefined;
|
|
165
|
+
}[] | undefined;
|
|
166
|
+
reviewMonths?: number | undefined;
|
|
167
|
+
appliesTo?: {
|
|
168
|
+
systems?: string[] | undefined;
|
|
169
|
+
components?: string[] | undefined;
|
|
170
|
+
platforms?: string[] | undefined;
|
|
171
|
+
repoTypes?: string[] | undefined;
|
|
172
|
+
frameworks?: string[] | undefined;
|
|
173
|
+
newComponents?: boolean | undefined;
|
|
174
|
+
} | undefined;
|
|
175
|
+
readRestricted?: boolean | undefined;
|
|
176
|
+
maxPages?: number | undefined;
|
|
177
|
+
}[];
|
|
178
|
+
absorbed: {
|
|
179
|
+
id: string;
|
|
180
|
+
url: string;
|
|
181
|
+
format: "openspec" | "atticus" | "speckit" | "plain";
|
|
182
|
+
mode: "link" | "adopt" | "ignore";
|
|
183
|
+
ref?: string | undefined;
|
|
184
|
+
}[];
|
|
185
|
+
};
|
|
186
|
+
export declare const DEFAULT_TEST_STRATEGY: {
|
|
187
|
+
schemaVersion: 1;
|
|
188
|
+
matrix: {
|
|
189
|
+
changeType: string;
|
|
190
|
+
risk: "low" | "medium" | "high";
|
|
191
|
+
required: ("unit" | "contract" | "integration" | "e2e" | "regression" | "performance" | "security" | "accessibility" | "data-migration")[];
|
|
192
|
+
}[];
|
|
193
|
+
definitionOfReady: string[];
|
|
194
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { FrameworkModel } from "./schema/frameworks.js";
|
|
2
|
+
import { ScanSettings } from "./schema/scan-settings.js";
|
|
3
|
+
import { RepoType } from "./schema/repo-type.js";
|
|
4
|
+
import { ModelProviderPlugin, ScannerPlugin } from "./schema/plugin.js";
|
|
5
|
+
import { SpecTemplate } from "./schema/spec.js";
|
|
6
|
+
import type { z } from "zod";
|
|
7
|
+
import { AgentDefinition } from "./schema/ai.js";
|
|
8
|
+
import { Dialect } from "./schema/dialect.js";
|
|
9
|
+
import { ChangeTypes, Estimates, Gates, OpenSpecSettings, IntegrationPattern, PackManifest, Procedure, Profile, Roles, Runtime, ServiceRequestTemplate, SkillMeta, Sources, TestStrategy } from "./schema/orgpack.js";
|
|
10
|
+
import { ChecklistPack } from "./schema/review.js";
|
|
11
|
+
import { RepoManifest } from "./schema/workspace.js";
|
|
12
|
+
export interface OrgPackProblem {
|
|
13
|
+
/** File relative to the org-pack folder. */
|
|
14
|
+
file: string;
|
|
15
|
+
path: string;
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
export interface OrgPack {
|
|
19
|
+
pack?: PackManifest;
|
|
20
|
+
/** Deprecated (ADR 0073): loaded and validated when present, read by nothing. */
|
|
21
|
+
roles: Roles;
|
|
22
|
+
changeTypes: z.infer<typeof ChangeTypes>;
|
|
23
|
+
gates: z.infer<typeof Gates>;
|
|
24
|
+
runtime: Runtime;
|
|
25
|
+
sources: z.infer<typeof Sources>;
|
|
26
|
+
testStrategy: z.infer<typeof TestStrategy>;
|
|
27
|
+
profiles: {
|
|
28
|
+
profile?: Profile;
|
|
29
|
+
repos?: RepoManifest;
|
|
30
|
+
platform: string;
|
|
31
|
+
}[];
|
|
32
|
+
patterns: IntegrationPattern[];
|
|
33
|
+
dialects: Dialect[];
|
|
34
|
+
/** Framework models (ADR 0054), from frameworks/. */
|
|
35
|
+
frameworks: FrameworkModel[];
|
|
36
|
+
/** Scan settings per repo (ADR 0075), from scan/<repo>.yaml. */
|
|
37
|
+
scanSettings: ScanSettings[];
|
|
38
|
+
/** Repo types (ADR 0077), from repo-types/<id>/type.yaml. */
|
|
39
|
+
repoTypes: RepoType[];
|
|
40
|
+
/** Scanner plugins (ADR 0080), from plugins/<id>/plugin.yaml, with their folders. */
|
|
41
|
+
plugins: {
|
|
42
|
+
manifest: ScannerPlugin;
|
|
43
|
+
dir: string;
|
|
44
|
+
}[];
|
|
45
|
+
/** Model-provider plugins (ADR 0121 item 4): plugins/model-providers/<id>/plugin.yaml. */
|
|
46
|
+
modelProviders: {
|
|
47
|
+
manifest: ModelProviderPlugin;
|
|
48
|
+
dir: string;
|
|
49
|
+
}[];
|
|
50
|
+
/** Spec templates (ADR 0079), from repo-types/<id>/spec-template.yaml; a type may have none. */
|
|
51
|
+
specTemplates: SpecTemplate[];
|
|
52
|
+
checklists: ChecklistPack[];
|
|
53
|
+
skills: (z.infer<typeof SkillMeta> & {
|
|
54
|
+
body: string;
|
|
55
|
+
})[];
|
|
56
|
+
serviceRequests: z.infer<typeof ServiceRequestTemplate>[];
|
|
57
|
+
/** Procedures (ADR 0033), from process/procedures/. */
|
|
58
|
+
procedures: Procedure[];
|
|
59
|
+
agents: AgentDefinition[];
|
|
60
|
+
/** Files that came from built-in defaults because the pack doesn't have them. */
|
|
61
|
+
defaulted: string[];
|
|
62
|
+
problems: OrgPackProblem[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Read and validate a whole org pack. Never throws for content problems: every schema or
|
|
66
|
+
* cross-file problem is listed in `problems` with its file, so a team sees all of them at
|
|
67
|
+
* once. Missing files fall back to the built-in defaults.
|
|
68
|
+
*/
|
|
69
|
+
export declare function loadOrgPack(dir: string): Promise<OrgPack>;
|
|
70
|
+
/**
|
|
71
|
+
* The org pack's OpenSpec store settings (ADR 0126), `openspec.yaml`: the defaults (nothing on)
|
|
72
|
+
* when the pack has none, and also, with a problem, when the file is there and doesn't read.
|
|
73
|
+
*/
|
|
74
|
+
export declare function loadOpenSpecSettings(dir: string): Promise<{
|
|
75
|
+
settings: OpenSpecSettings;
|
|
76
|
+
problem?: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* The org pack's reference ranges for estimates (ADR 0109), `estimates.yaml`: undefined when
|
|
80
|
+
* the pack has none (an estimate then sizes the work and gives no days); a problem when the
|
|
81
|
+
* file is there and doesn't read.
|
|
82
|
+
*/
|
|
83
|
+
export declare function loadEstimates(dir: string): Promise<{
|
|
84
|
+
estimates?: Estimates;
|
|
85
|
+
problem?: string;
|
|
86
|
+
}>;
|