@catalyst-cloud/sdk 0.8.49 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/dist/browser.d.ts +2 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +5 -3
- package/dist/browser.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/live-sync-client.d.ts +143 -7
- package/dist/live-sync-client.d.ts.map +1 -1
- package/dist/live-sync-client.js +446 -69
- package/dist/live-sync-client.js.map +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +1 -1
- package/dist/node.js.map +1 -1
- package/dist/otel.d.ts.map +1 -1
- package/dist/otel.js +3 -0
- package/dist/otel.js.map +1 -1
- package/dist/replica/catalyst-replica.d.ts +24 -2
- package/dist/replica/catalyst-replica.d.ts.map +1 -1
- package/dist/replica/catalyst-replica.js +78 -5
- package/dist/replica/catalyst-replica.js.map +1 -1
- package/dist/tenant-client.d.ts +537 -0
- package/dist/tenant-client.d.ts.map +1 -0
- package/dist/tenant-client.js +504 -0
- package/dist/tenant-client.js.map +1 -0
- package/dist/tenant-contract.d.ts +237 -0
- package/dist/tenant-contract.d.ts.map +1 -0
- package/dist/tenant-contract.js +183 -0
- package/dist/tenant-contract.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/** The eleven stage slots `teams[].stages` is keyed by. Served as `slots` on the wire, in this order. */
|
|
2
|
+
export type WorkflowSlot = "dispatch" | "intake" | "research" | "plan" | "implement" | "remediate" | "verify" | "review" | "pr" | "done" | "canceled";
|
|
3
|
+
/** ⛔ `unscoped`, NOT `workspace` — the mirror's `labels.team_id` is advisory (NULL means either
|
|
4
|
+
* "genuinely workspace-scoped" or "not re-stamped yet"), so the document reports what was read. */
|
|
5
|
+
export type LabelScopeKind = "unscoped" | "team" | "absent";
|
|
6
|
+
export interface ContractLabel {
|
|
7
|
+
name: string;
|
|
8
|
+
unscopedId: string | null;
|
|
9
|
+
teamScopedId: string | null;
|
|
10
|
+
scope: LabelScopeKind;
|
|
11
|
+
/** The id `scope` resolves to (the unscoped copy wins); `null` when `scope` is `absent`. */
|
|
12
|
+
preferredId: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ContractStage {
|
|
15
|
+
/** Linear's state id — THE join key. Address stages by slot, and states by this. */
|
|
16
|
+
stateId: string;
|
|
17
|
+
/** The state's CURRENT name, read live — never the mapping's write-time snapshot. */
|
|
18
|
+
name: string | null;
|
|
19
|
+
type: string | null;
|
|
20
|
+
/** False when the mapped id is not in the team's live stage set (archived, or re-minted). */
|
|
21
|
+
stateStillExists: boolean;
|
|
22
|
+
/** How the mapping was made: created | matched | chosen. */
|
|
23
|
+
source: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ContractReadinessCheck {
|
|
26
|
+
id: string;
|
|
27
|
+
state: "pass" | "fail" | "unknown";
|
|
28
|
+
reason?: string;
|
|
29
|
+
count?: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ContractTeam {
|
|
32
|
+
id: string;
|
|
33
|
+
key: string | null;
|
|
34
|
+
name: string | null;
|
|
35
|
+
workflowMode: string;
|
|
36
|
+
gitAutomation: string;
|
|
37
|
+
/** Keyed by slot. An UNMAPPED slot is ABSENT — never a placeholder. */
|
|
38
|
+
stages: Partial<Record<WorkflowSlot, ContractStage>>;
|
|
39
|
+
labels: {
|
|
40
|
+
ask: ContractLabel[];
|
|
41
|
+
hold: ContractLabel[];
|
|
42
|
+
release: ContractLabel[];
|
|
43
|
+
};
|
|
44
|
+
readiness: {
|
|
45
|
+
/** `unchecked` means no verdict has ever been computed — a real answer, not `blocked`. */
|
|
46
|
+
status: "ready" | "degraded" | "blocked" | "unchecked";
|
|
47
|
+
checks: ContractReadinessCheck[];
|
|
48
|
+
checkedAt: number | null;
|
|
49
|
+
expiresAt: number | null;
|
|
50
|
+
workflowRev: number | null;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface ContractRoute {
|
|
54
|
+
method: "GET" | "POST";
|
|
55
|
+
path: string;
|
|
56
|
+
/** Whether a call spends a unit of the per-host daily write budget. */
|
|
57
|
+
takesWriteBudgetUnit: boolean;
|
|
58
|
+
/** The contract version this route first appeared in. */
|
|
59
|
+
since: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ContractMergeRepository {
|
|
62
|
+
repoId: string;
|
|
63
|
+
owner: string;
|
|
64
|
+
name: string;
|
|
65
|
+
/** The EFFECTIVE policy after repo-wins-over-tenant precedence. */
|
|
66
|
+
policy: string;
|
|
67
|
+
policySource: "repo" | "tenant" | "default";
|
|
68
|
+
}
|
|
69
|
+
export interface ContractMergeCleanPassShape {
|
|
70
|
+
kind: string;
|
|
71
|
+
description: string;
|
|
72
|
+
/** FALSE means the cloud does NOT accept this shape today. */
|
|
73
|
+
honoured: boolean;
|
|
74
|
+
ticket: string | null;
|
|
75
|
+
}
|
|
76
|
+
export interface ContractAdvanceRule {
|
|
77
|
+
phase: string;
|
|
78
|
+
result: "ok" | "failed";
|
|
79
|
+
fromSlots: readonly WorkflowSlot[] | null;
|
|
80
|
+
toSlot: WorkflowSlot | null;
|
|
81
|
+
because: string;
|
|
82
|
+
}
|
|
83
|
+
export interface TenantContract {
|
|
84
|
+
/** Semver over the DOCUMENT'S SHAPE (MAJOR: meaning changed/removed; MINOR: additive). */
|
|
85
|
+
contractVersion: string;
|
|
86
|
+
protocolVersion: number;
|
|
87
|
+
/** The cloud states the freshness bounds; the CLIENT measures its own age against them. */
|
|
88
|
+
cache: {
|
|
89
|
+
maxAgeSeconds: number;
|
|
90
|
+
staleRefusalSeconds: number;
|
|
91
|
+
};
|
|
92
|
+
account: {
|
|
93
|
+
id: string;
|
|
94
|
+
slug: string;
|
|
95
|
+
name: string;
|
|
96
|
+
linearWorkspaceId: string | null;
|
|
97
|
+
linearWorkspaceSlug: string | null;
|
|
98
|
+
};
|
|
99
|
+
apiPrefix: string;
|
|
100
|
+
slots: readonly WorkflowSlot[];
|
|
101
|
+
routes: readonly ContractRoute[];
|
|
102
|
+
teams: ContractTeam[];
|
|
103
|
+
vocabulary: {
|
|
104
|
+
askLabelPrefix: string;
|
|
105
|
+
askPhaseLabelPrefix: string;
|
|
106
|
+
askMarkerLabel: string;
|
|
107
|
+
releaseLabel: string;
|
|
108
|
+
bookkeeping: {
|
|
109
|
+
marker: string;
|
|
110
|
+
prefixOnly: boolean;
|
|
111
|
+
asciiCaseInsensitive: boolean;
|
|
112
|
+
leadingWhitespaceTrimmed: boolean;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
askTemplate: {
|
|
116
|
+
headings: {
|
|
117
|
+
ask: string;
|
|
118
|
+
options: string;
|
|
119
|
+
defaultIfSilent: string;
|
|
120
|
+
howToAnswer: string;
|
|
121
|
+
};
|
|
122
|
+
howToAnswer: {
|
|
123
|
+
withOptions: string;
|
|
124
|
+
withoutOptions: string;
|
|
125
|
+
};
|
|
126
|
+
optionBulletFormat: string;
|
|
127
|
+
maxLetteredOptions: number;
|
|
128
|
+
maxAskGenerations: number;
|
|
129
|
+
example: string;
|
|
130
|
+
};
|
|
131
|
+
ladder: {
|
|
132
|
+
phases: readonly string[];
|
|
133
|
+
keying: string;
|
|
134
|
+
keyingScope: string;
|
|
135
|
+
/** `phases` is the full vocabulary; this says whether `intake` actually runs. */
|
|
136
|
+
intakeEnabled: boolean;
|
|
137
|
+
advance: readonly ContractAdvanceRule[];
|
|
138
|
+
};
|
|
139
|
+
thresholds: {
|
|
140
|
+
scope: string;
|
|
141
|
+
parkAfterConsecutiveFailures: number;
|
|
142
|
+
remediateRoundCap: number;
|
|
143
|
+
remediateEscalatedRoundBudget: number;
|
|
144
|
+
remediateRewindBudget: number;
|
|
145
|
+
retryBackoffMs: readonly number[];
|
|
146
|
+
hostDailyWriteBudget: number;
|
|
147
|
+
};
|
|
148
|
+
merge: {
|
|
149
|
+
policies: readonly string[];
|
|
150
|
+
defaultPolicy: string;
|
|
151
|
+
repositories: readonly ContractMergeRepository[];
|
|
152
|
+
reviewerLogin: string;
|
|
153
|
+
cleanPassShapes: readonly ContractMergeCleanPassShape[];
|
|
154
|
+
cloudRemediateRequiredChecks: readonly string[];
|
|
155
|
+
prLabels: {
|
|
156
|
+
queueReady: string;
|
|
157
|
+
handStepsHold: string;
|
|
158
|
+
hold: string;
|
|
159
|
+
preview: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
readinessChecks: readonly {
|
|
163
|
+
id: string;
|
|
164
|
+
severity: string;
|
|
165
|
+
needsAnswer: boolean;
|
|
166
|
+
}[];
|
|
167
|
+
humans: readonly {
|
|
168
|
+
linearUserId: string;
|
|
169
|
+
role: "owner" | "admin";
|
|
170
|
+
}[];
|
|
171
|
+
asks: {
|
|
172
|
+
/** `null` means NOT CONFIGURED, and a consumer must refuse rather than guess. */
|
|
173
|
+
approvalsTeamId: string | null;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/** The one path a consumer knows a priori — the address the document itself is served from. */
|
|
177
|
+
export declare const CONTRACT_ROUTE = "/api/v1/agent/contract";
|
|
178
|
+
/**
|
|
179
|
+
* The document's top-level keys, as a runtime list, in lockstep with {@link TenantContract} — the
|
|
180
|
+
* drift test asserts the two agree at compile time, and {@link readTenantContract} requires every
|
|
181
|
+
* one of them on the wire. Kept alphabetical so the fixture comparison is order-independent.
|
|
182
|
+
*/
|
|
183
|
+
export declare const TENANT_CONTRACT_KEYS: readonly ["account", "apiPrefix", "askTemplate", "asks", "cache", "contractVersion", "humans", "ladder", "merge", "protocolVersion", "readinessChecks", "routes", "slots", "teams", "thresholds", "vocabulary"];
|
|
184
|
+
/**
|
|
185
|
+
* The shape guard the client applies to every 200 from the contract route. Structural, not
|
|
186
|
+
* exhaustive: it requires every top-level key, and checks the load-bearing legs a consumer will
|
|
187
|
+
* immediately index into (`cache`'s two bounds, `routes[]`'s method/path, `teams[]`'s id/stages/
|
|
188
|
+
* labels/readiness, `slots[]`). A type predicate, so the narrowing is the compiler's — no cast.
|
|
189
|
+
*/
|
|
190
|
+
export declare function isTenantContract(value: unknown): value is TenantContract;
|
|
191
|
+
/** {@link isTenantContract} as a read: the typed document, or `null` — never a throw, because the
|
|
192
|
+
* caller's answer to a malformed document is a typed `shape` outcome, not an exception. */
|
|
193
|
+
export declare function readTenantContract(value: unknown): TenantContract | null;
|
|
194
|
+
/** The route whose LAST path segment is `name` (`issue-comment`); the path itself is never assumed. */
|
|
195
|
+
export declare function routeByName(doc: TenantContract, name: string): ContractRoute | null;
|
|
196
|
+
export type TeamLookup = {
|
|
197
|
+
outcome: "ok";
|
|
198
|
+
team: ContractTeam;
|
|
199
|
+
} | {
|
|
200
|
+
outcome: "team-unknown";
|
|
201
|
+
key: string;
|
|
202
|
+
known: string[];
|
|
203
|
+
} | {
|
|
204
|
+
outcome: "ticket-shape";
|
|
205
|
+
ticket: string;
|
|
206
|
+
};
|
|
207
|
+
export declare function teamByKey(doc: TenantContract, key: string): TeamLookup;
|
|
208
|
+
/** The team a ticket identifier belongs to, by its `KEY-` prefix. */
|
|
209
|
+
export declare function teamForTicket(doc: TenantContract, ticket: string): TeamLookup;
|
|
210
|
+
export type StageLookup = {
|
|
211
|
+
outcome: "ok";
|
|
212
|
+
stateId: string;
|
|
213
|
+
} | {
|
|
214
|
+
outcome: "slot-unmapped";
|
|
215
|
+
slot: string;
|
|
216
|
+
mapped: string[];
|
|
217
|
+
} | {
|
|
218
|
+
outcome: "slot-stale";
|
|
219
|
+
slot: string;
|
|
220
|
+
stateId: string;
|
|
221
|
+
};
|
|
222
|
+
/** The Linear state id a slot maps to on this team. An unmapped slot and a stale mapping are two
|
|
223
|
+
* DIFFERENT answers (docs/agent-contract.md rule 1) and are reported by name. */
|
|
224
|
+
export declare function stageIdForSlot(team: ContractTeam, slot: string): StageLookup;
|
|
225
|
+
export type LabelLookup = {
|
|
226
|
+
outcome: "ok";
|
|
227
|
+
labelId: string;
|
|
228
|
+
} | {
|
|
229
|
+
outcome: "label-absent";
|
|
230
|
+
name: string;
|
|
231
|
+
scope: LabelScopeKind;
|
|
232
|
+
};
|
|
233
|
+
/** Resolve a label by NAME through the contract's ask/hold/release lists to its `preferredId`. A name
|
|
234
|
+
* the contract does not list is passed through as an id the caller already holds (the contract
|
|
235
|
+
* only lists Catalyst's own labels); `scope: "absent"` is a real, reported answer, never an id. */
|
|
236
|
+
export declare function labelIdFor(team: ContractTeam, nameOrId: string): LabelLookup;
|
|
237
|
+
//# sourceMappingURL=tenant-contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-contract.d.ts","sourceRoot":"","sources":["../src/tenant-contract.ts"],"names":[],"mappings":"AAmBA,yGAAyG;AACzG,MAAM,MAAM,YAAY,GACpB,UAAU,GACV,QAAQ,GACR,UAAU,GACV,MAAM,GACN,WAAW,GACX,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,UAAU,CAAC;AAEf;oGACoG;AACpG,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,EAAE,cAAc,CAAC;IACtB,4FAA4F;IAC5F,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,6FAA6F;IAC7F,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4DAA4D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MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAOtE;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAI7E;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,OAAO,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GAC5D;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;kFACkF;AAClF,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAK5E;AAED,MAAM,MAAM,WAAW,GACnB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,OAAO,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,cAAc,CAAA;CAAE,CAAC;AAErE;;oGAEoG;AACpG,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,WAAW,CAM5E"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// tenant-contract.ts — CTC-2004. The SHAPE of GET /api/v1/agent/contract as this SDK reads it, plus
|
|
2
|
+
// the pure accessors a consumer needs over it.
|
|
3
|
+
//
|
|
4
|
+
// ⛔ SELF-CONTAINED ON PURPOSE. The cloud declares this document in `@catalyst-cloud/types`
|
|
5
|
+
// (packages/types/src/tenant-contract.ts), a PRIVATE workspace package this SDK cannot import — the
|
|
6
|
+
// same constraint `src/types.ts` states for the change-feed contract. So this module is the SDK's own
|
|
7
|
+
// copy, structurally the cloud's, and test/tenant-contract.test.ts pins it against the fixture the
|
|
8
|
+
// cloud commits (packages/types/fixtures/tenant-contract.fixture.json — built by the real
|
|
9
|
+
// `buildTenantContract`, regenerated by `bun run contract:fixture`) so a cloud-side shape change
|
|
10
|
+
// reddens here as a fixture diff rather than surfacing as a silent wrong answer in a customer's skill.
|
|
11
|
+
//
|
|
12
|
+
// ⛔ NO FIELD BELOW CARRIES A DEFAULT. Every value is filled from the wire; a tenant fact the contract
|
|
13
|
+
// does not serve is reported as a typed miss (`slot-unmapped`, `label-absent`, `route-unknown`), never
|
|
14
|
+
// guessed. That is the whole point of the document (docs/agent-contract.md): a consumer that falls
|
|
15
|
+
// back to a remembered literal has reintroduced the defect the contract exists to retire.
|
|
16
|
+
//
|
|
17
|
+
// This module is free of any runtime-specific import — pure type declarations + plain functions — so
|
|
18
|
+
// it imports cleanly into a browser bundle or a node/bun app alike.
|
|
19
|
+
/** The one path a consumer knows a priori — the address the document itself is served from. */
|
|
20
|
+
export const CONTRACT_ROUTE = "/api/v1/agent/contract";
|
|
21
|
+
/**
|
|
22
|
+
* The document's top-level keys, as a runtime list, in lockstep with {@link TenantContract} — the
|
|
23
|
+
* drift test asserts the two agree at compile time, and {@link readTenantContract} requires every
|
|
24
|
+
* one of them on the wire. Kept alphabetical so the fixture comparison is order-independent.
|
|
25
|
+
*/
|
|
26
|
+
export const TENANT_CONTRACT_KEYS = [
|
|
27
|
+
"account",
|
|
28
|
+
"apiPrefix",
|
|
29
|
+
"askTemplate",
|
|
30
|
+
"asks",
|
|
31
|
+
"cache",
|
|
32
|
+
"contractVersion",
|
|
33
|
+
"humans",
|
|
34
|
+
"ladder",
|
|
35
|
+
"merge",
|
|
36
|
+
"protocolVersion",
|
|
37
|
+
"readinessChecks",
|
|
38
|
+
"routes",
|
|
39
|
+
"slots",
|
|
40
|
+
"teams",
|
|
41
|
+
"thresholds",
|
|
42
|
+
"vocabulary",
|
|
43
|
+
];
|
|
44
|
+
function isRecord(value) {
|
|
45
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The shape guard the client applies to every 200 from the contract route. Structural, not
|
|
49
|
+
* exhaustive: it requires every top-level key, and checks the load-bearing legs a consumer will
|
|
50
|
+
* immediately index into (`cache`'s two bounds, `routes[]`'s method/path, `teams[]`'s id/stages/
|
|
51
|
+
* labels/readiness, `slots[]`). A type predicate, so the narrowing is the compiler's — no cast.
|
|
52
|
+
*/
|
|
53
|
+
export function isTenantContract(value) {
|
|
54
|
+
if (!isRecord(value))
|
|
55
|
+
return false;
|
|
56
|
+
for (const key of TENANT_CONTRACT_KEYS)
|
|
57
|
+
if (!(key in value))
|
|
58
|
+
return false;
|
|
59
|
+
if (typeof value["contractVersion"] !== "string")
|
|
60
|
+
return false;
|
|
61
|
+
if (typeof value["protocolVersion"] !== "number")
|
|
62
|
+
return false;
|
|
63
|
+
const cache = value["cache"];
|
|
64
|
+
if (!isRecord(cache) ||
|
|
65
|
+
typeof cache["maxAgeSeconds"] !== "number" ||
|
|
66
|
+
typeof cache["staleRefusalSeconds"] !== "number") {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
const account = value["account"];
|
|
70
|
+
if (!isRecord(account) || typeof account["id"] !== "string" || typeof account["slug"] !== "string") {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
const routes = value["routes"];
|
|
74
|
+
if (!Array.isArray(routes) ||
|
|
75
|
+
!routes.every((r) => isRecord(r) &&
|
|
76
|
+
(r["method"] === "GET" || r["method"] === "POST") &&
|
|
77
|
+
typeof r["path"] === "string" &&
|
|
78
|
+
typeof r["takesWriteBudgetUnit"] === "boolean" &&
|
|
79
|
+
typeof r["since"] === "string")) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
const slots = value["slots"];
|
|
83
|
+
if (!Array.isArray(slots) || !slots.every((s) => typeof s === "string"))
|
|
84
|
+
return false;
|
|
85
|
+
const teams = value["teams"];
|
|
86
|
+
if (!Array.isArray(teams) || !teams.every(isContractTeam))
|
|
87
|
+
return false;
|
|
88
|
+
const vocabulary = value["vocabulary"];
|
|
89
|
+
if (!isRecord(vocabulary) ||
|
|
90
|
+
!isRecord(vocabulary["bookkeeping"]) ||
|
|
91
|
+
typeof vocabulary["bookkeeping"]["marker"] !== "string") {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return isRecord(value["thresholds"]) && isRecord(value["merge"]) && isRecord(value["ladder"]);
|
|
95
|
+
}
|
|
96
|
+
function isNullableString(value) {
|
|
97
|
+
return value === null || typeof value === "string";
|
|
98
|
+
}
|
|
99
|
+
function isContractLabel(value) {
|
|
100
|
+
return (isRecord(value) &&
|
|
101
|
+
typeof value["name"] === "string" &&
|
|
102
|
+
isNullableString(value["preferredId"]) &&
|
|
103
|
+
(value["scope"] === "unscoped" || value["scope"] === "team" || value["scope"] === "absent"));
|
|
104
|
+
}
|
|
105
|
+
function isContractStage(value) {
|
|
106
|
+
return (isRecord(value) &&
|
|
107
|
+
typeof value["stateId"] === "string" &&
|
|
108
|
+
typeof value["stateStillExists"] === "boolean");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* ⛔ THE NESTED LEGS ARE CHECKED, NOT JUST THEIR PRESENCE (Codex #65 r1, P2). The typed accessors
|
|
112
|
+
* spread `team.labels.ask` and upper-case `team.key`; a document that passed the guard with
|
|
113
|
+
* `labels: {}` or `key: 5` would reach them as `ok` and throw there, one call later, instead of
|
|
114
|
+
* answering `shape` at the one place that read the wire.
|
|
115
|
+
*/
|
|
116
|
+
function isContractTeam(value) {
|
|
117
|
+
if (!isRecord(value) || typeof value["id"] !== "string" || !isNullableString(value["key"])) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
const stages = value["stages"];
|
|
121
|
+
if (!isRecord(stages) || !Object.values(stages).every(isContractStage))
|
|
122
|
+
return false;
|
|
123
|
+
const labels = value["labels"];
|
|
124
|
+
if (!isRecord(labels) ||
|
|
125
|
+
!["ask", "hold", "release"].every((k) => {
|
|
126
|
+
const list = labels[k];
|
|
127
|
+
return Array.isArray(list) && list.every(isContractLabel);
|
|
128
|
+
})) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
const readiness = value["readiness"];
|
|
132
|
+
return (isRecord(readiness) &&
|
|
133
|
+
typeof readiness["status"] === "string" &&
|
|
134
|
+
Array.isArray(readiness["checks"]));
|
|
135
|
+
}
|
|
136
|
+
/** {@link isTenantContract} as a read: the typed document, or `null` — never a throw, because the
|
|
137
|
+
* caller's answer to a malformed document is a typed `shape` outcome, not an exception. */
|
|
138
|
+
export function readTenantContract(value) {
|
|
139
|
+
return isTenantContract(value) ? value : null;
|
|
140
|
+
}
|
|
141
|
+
// ── Pure accessors — the bundle's contract.ts helpers, returning results instead of throwing ──────
|
|
142
|
+
/** The route whose LAST path segment is `name` (`issue-comment`); the path itself is never assumed. */
|
|
143
|
+
export function routeByName(doc, name) {
|
|
144
|
+
return doc.routes.find((r) => r.path.split("/").filter(Boolean).at(-1) === name) ?? null;
|
|
145
|
+
}
|
|
146
|
+
export function teamByKey(doc, key) {
|
|
147
|
+
const wanted = key.toUpperCase();
|
|
148
|
+
const team = doc.teams.find((t) => (t.key ?? "").toUpperCase() === wanted);
|
|
149
|
+
if (team === undefined) {
|
|
150
|
+
return { outcome: "team-unknown", key: wanted, known: doc.teams.map((t) => t.key ?? t.id) };
|
|
151
|
+
}
|
|
152
|
+
return { outcome: "ok", team };
|
|
153
|
+
}
|
|
154
|
+
/** The team a ticket identifier belongs to, by its `KEY-` prefix. */
|
|
155
|
+
export function teamForTicket(doc, ticket) {
|
|
156
|
+
const dash = ticket.indexOf("-");
|
|
157
|
+
if (dash <= 0)
|
|
158
|
+
return { outcome: "ticket-shape", ticket };
|
|
159
|
+
return teamByKey(doc, ticket.slice(0, dash));
|
|
160
|
+
}
|
|
161
|
+
/** The Linear state id a slot maps to on this team. An unmapped slot and a stale mapping are two
|
|
162
|
+
* DIFFERENT answers (docs/agent-contract.md rule 1) and are reported by name. */
|
|
163
|
+
export function stageIdForSlot(team, slot) {
|
|
164
|
+
const stage = team.stages[slot];
|
|
165
|
+
if (stage === undefined)
|
|
166
|
+
return { outcome: "slot-unmapped", slot, mapped: Object.keys(team.stages) };
|
|
167
|
+
if (!stage.stateStillExists)
|
|
168
|
+
return { outcome: "slot-stale", slot, stateId: stage.stateId };
|
|
169
|
+
return { outcome: "ok", stateId: stage.stateId };
|
|
170
|
+
}
|
|
171
|
+
/** Resolve a label by NAME through the contract's ask/hold/release lists to its `preferredId`. A name
|
|
172
|
+
* the contract does not list is passed through as an id the caller already holds (the contract
|
|
173
|
+
* only lists Catalyst's own labels); `scope: "absent"` is a real, reported answer, never an id. */
|
|
174
|
+
export function labelIdFor(team, nameOrId) {
|
|
175
|
+
const all = [...team.labels.ask, ...team.labels.hold, ...team.labels.release];
|
|
176
|
+
const hit = all.find((l) => l.name === nameOrId);
|
|
177
|
+
if (hit === undefined)
|
|
178
|
+
return { outcome: "ok", labelId: nameOrId };
|
|
179
|
+
if (hit.preferredId === null)
|
|
180
|
+
return { outcome: "label-absent", name: hit.name, scope: hit.scope };
|
|
181
|
+
return { outcome: "ok", labelId: hit.preferredId };
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=tenant-contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-contract.js","sourceRoot":"","sources":["../src/tenant-contract.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,+CAA+C;AAC/C,EAAE;AACF,2FAA2F;AAC3F,oGAAoG;AACpG,sGAAsG;AACtG,mGAAmG;AACnG,0FAA0F;AAC1F,iGAAiG;AACjG,uGAAuG;AACvG,EAAE;AACF,sGAAsG;AACtG,uGAAuG;AACvG,mGAAmG;AACnG,0FAA0F;AAC1F,EAAE;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,CAAC,EAAE,CAAC;IACrG,IAAI,CAAC,KAAK,CAAC,gBAAgB;QAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IAC5F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;AACnD,CAAC;AAMD;;oGAEoG;AACpG,MAAM,UAAU,UAAU,CAAC,IAAkB,EAAE,QAAgB;IAC7D,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9E,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;IACjD,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IACnE,IAAI,GAAG,CAAC,WAAW,KAAK,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;IACnG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catalyst-cloud/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Keep a live local copy of your Linear and GitHub project data — pushed in real time, without polling rate limits or webhook tunnels.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Coalesce Labs",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@catalyst-cloud/read-model": "^0.1.0",
|
|
82
|
-
"@catalyst-cloud/replicate": "0.1.
|
|
83
|
-
"@catalyst-cloud/schema": "0.1.
|
|
82
|
+
"@catalyst-cloud/replicate": "0.1.47",
|
|
83
|
+
"@catalyst-cloud/schema": "0.1.53"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@opentelemetry/api": ">=1.3.0 <2",
|