@possibl/rcrt-sdk 0.1.2 → 0.5.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +99 -62
  2. package/LICENSE +21 -0
  3. package/README.md +35 -21
  4. package/dist/auth.d.ts +45 -0
  5. package/dist/auth.d.ts.map +1 -0
  6. package/{src/auth.ts → dist/auth.js} +9 -24
  7. package/dist/auth.js.map +1 -0
  8. package/dist/authn.d.ts +114 -0
  9. package/dist/authn.d.ts.map +1 -0
  10. package/dist/authn.js +107 -0
  11. package/dist/authn.js.map +1 -0
  12. package/dist/breadcrumbs.d.ts +43 -0
  13. package/dist/breadcrumbs.d.ts.map +1 -0
  14. package/dist/breadcrumbs.js +122 -0
  15. package/dist/breadcrumbs.js.map +1 -0
  16. package/dist/cards.d.ts +28 -0
  17. package/dist/cards.d.ts.map +1 -0
  18. package/dist/cards.js +105 -0
  19. package/dist/cards.js.map +1 -0
  20. package/dist/chat.d.ts +103 -0
  21. package/dist/chat.d.ts.map +1 -0
  22. package/dist/chat.js +105 -0
  23. package/dist/chat.js.map +1 -0
  24. package/dist/client.d.ts +85 -0
  25. package/dist/client.d.ts.map +1 -0
  26. package/dist/client.js +133 -0
  27. package/dist/client.js.map +1 -0
  28. package/dist/errors.d.ts +32 -0
  29. package/dist/errors.d.ts.map +1 -0
  30. package/dist/errors.js +76 -0
  31. package/dist/errors.js.map +1 -0
  32. package/dist/files.d.ts +41 -0
  33. package/dist/files.d.ts.map +1 -0
  34. package/dist/files.js +64 -0
  35. package/dist/files.js.map +1 -0
  36. package/dist/generated/conformance.d.ts +48 -0
  37. package/dist/generated/conformance.d.ts.map +1 -0
  38. package/dist/generated/conformance.js +24 -0
  39. package/dist/generated/conformance.js.map +1 -0
  40. package/dist/generated/index.d.ts +34 -0
  41. package/dist/generated/index.d.ts.map +1 -0
  42. package/dist/generated/index.js +34 -0
  43. package/dist/generated/index.js.map +1 -0
  44. package/dist/generated/openapi.d.ts +3900 -0
  45. package/dist/generated/openapi.d.ts.map +1 -0
  46. package/dist/generated/openapi.js +6 -0
  47. package/dist/generated/openapi.js.map +1 -0
  48. package/dist/grants.d.ts +41 -0
  49. package/dist/grants.d.ts.map +1 -0
  50. package/dist/grants.js +50 -0
  51. package/dist/grants.js.map +1 -0
  52. package/dist/index.d.ts +34 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +24 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/internal/fetch.d.ts +47 -0
  57. package/dist/internal/fetch.d.ts.map +1 -0
  58. package/dist/internal/fetch.js +108 -0
  59. package/dist/internal/fetch.js.map +1 -0
  60. package/dist/internal/sse.d.ts +82 -0
  61. package/dist/internal/sse.d.ts.map +1 -0
  62. package/dist/internal/sse.js +161 -0
  63. package/dist/internal/sse.js.map +1 -0
  64. package/dist/marketplace.d.ts +98 -0
  65. package/dist/marketplace.d.ts.map +1 -0
  66. package/dist/marketplace.js +74 -0
  67. package/dist/marketplace.js.map +1 -0
  68. package/dist/members.d.ts +60 -0
  69. package/dist/members.d.ts.map +1 -0
  70. package/dist/members.js +74 -0
  71. package/dist/members.js.map +1 -0
  72. package/dist/org.d.ts +85 -0
  73. package/dist/org.d.ts.map +1 -0
  74. package/dist/org.js +70 -0
  75. package/dist/org.js.map +1 -0
  76. package/dist/types/breadcrumb.d.ts +70 -0
  77. package/dist/types/breadcrumb.d.ts.map +1 -0
  78. package/dist/types/breadcrumb.js +8 -0
  79. package/dist/types/breadcrumb.js.map +1 -0
  80. package/dist/types/card.d.ts +251 -0
  81. package/dist/types/card.d.ts.map +1 -0
  82. package/dist/types/card.js +10 -0
  83. package/dist/types/card.js.map +1 -0
  84. package/dist/types/engine.d.ts +69 -0
  85. package/dist/types/engine.d.ts.map +1 -0
  86. package/dist/types/engine.js +53 -0
  87. package/dist/types/engine.js.map +1 -0
  88. package/dist/types/index.d.ts +4 -0
  89. package/dist/types/index.d.ts.map +1 -0
  90. package/dist/types/index.js +4 -0
  91. package/dist/types/index.js.map +1 -0
  92. package/package.json +35 -6
  93. package/src/authn.ts +0 -159
  94. package/src/breadcrumbs.ts +0 -111
  95. package/src/capabilities.ts +0 -93
  96. package/src/cards.ts +0 -109
  97. package/src/chat.ts +0 -83
  98. package/src/client.ts +0 -97
  99. package/src/errors.ts +0 -101
  100. package/src/files.ts +0 -135
  101. package/src/grants.ts +0 -99
  102. package/src/index.ts +0 -103
  103. package/src/internal/fetch.ts +0 -133
  104. package/src/internal/sse.ts +0 -236
  105. package/src/sessions.ts +0 -110
  106. package/src/types/breadcrumb.ts +0 -77
  107. package/src/types/card.ts +0 -298
  108. package/src/types/index.ts +0 -2
package/dist/org.js ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Org admin module — `/v1/orgs/*` management surface.
3
+ *
4
+ * Everything here requires org-admin (or platform-admin) rights on the
5
+ * target org. Tenant scoping does not apply — calls are addressed by
6
+ * org id, not by the client's X-Tenant-ID.
7
+ */
8
+ import { request } from './internal/fetch.js';
9
+ export class OrgModule {
10
+ ctx;
11
+ constructor(ctx) {
12
+ this.ctx = ctx;
13
+ }
14
+ /** `GET /v1/orgs/{org_id}` */
15
+ async get(orgId) {
16
+ return request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}`);
17
+ }
18
+ /** `GET /v1/orgs/{org_id}/members` */
19
+ async listMembers(orgId) {
20
+ const res = await request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}/members`);
21
+ return Array.isArray(res) ? res : (res?.members ?? []);
22
+ }
23
+ /**
24
+ * `GET /v1/orgs/{org_id}/tenants` — all workspaces in the org.
25
+ *
26
+ * Privacy note for fleet apps: never enumerate a *customer-run*
27
+ * platform org's tenants; use org-level rollups instead.
28
+ */
29
+ async listTenants(orgId) {
30
+ const res = await request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}/tenants`);
31
+ return Array.isArray(res) ? res : (res?.tenants ?? []);
32
+ }
33
+ /** `POST /v1/orgs/{org_id}/tenants` — create a workspace inside the org. Returns the new tenant id. */
34
+ async createTenant(orgId, name, slug) {
35
+ const res = await request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}/tenants`, {
36
+ method: 'POST',
37
+ body: { name, ...(slug ? { slug } : {}) },
38
+ });
39
+ // Normalise the gateway's historical response shapes.
40
+ const r = res;
41
+ if (r.tenant?.id)
42
+ return r.tenant;
43
+ const id = r.id ?? r.tenant_id ?? '';
44
+ return { id, name: r.name ?? name, org_id: orgId };
45
+ }
46
+ /**
47
+ * `POST /v1/orgs/{org_id}/customers` — create a child customer org
48
+ * (optionally adopting an existing workspace as its default).
49
+ */
50
+ async createCustomerOrg(orgId, opts) {
51
+ return request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}/customers`, {
52
+ method: 'POST',
53
+ body: { name: opts.name, ...(opts.adoptTenantId ? { adopt_tenant_id: opts.adoptTenantId } : {}) },
54
+ });
55
+ }
56
+ // ── LLM provider credentials ────────────────────────────────────
57
+ //
58
+ // `org_llm_providers` is a pure credential store keyed by route. The
59
+ // tier-override surface (getLLMTiers/upsertLLMTier/deleteLLMTier and the
60
+ // `/v1/orgs/{org}/llm-tiers` endpoints) was removed: model selection is the
61
+ // agent breadcrumb's concrete `route/provider/model` address, expanded from
62
+ // authoring tiers at publish time. See
63
+ // docs/design/LLM_PROVIDER_MODEL_RESOLUTION.md.
64
+ /** `GET /v1/orgs/{org_id}/llm-providers` — list stored BYO credentials (no fallback role). */
65
+ async listLLMProviders(orgId) {
66
+ const res = await request(this.ctx, `/v1/orgs/${encodeURIComponent(orgId)}/llm-providers`);
67
+ return Array.isArray(res) ? res : (res?.providers ?? []);
68
+ }
69
+ }
70
+ //# sourceMappingURL=org.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org.js","sourceRoot":"","sources":["../src/org.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAkD9C,M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CRT.
3
+ *
4
+ * Every meaningful state change in the system is a breadcrumb. See
5
+ * `packages/docs/concepts/02-primitives.md` for the mental model.
6
+ */
7
+ export type ActorType = 'user' | 'agent' | 'tool' | 'system';
8
+ export interface Actor {
9
+ type: ActorType;
10
+ /** For users: the user UUID. For agents: the agent id. For tools: the tool name. */
11
+ id: string;
12
+ }
13
+ export interface Breadcrumb {
14
+ id: string;
15
+ tenant_id: string;
16
+ name: string;
17
+ title: string;
18
+ content: Record<string, unknown>;
19
+ /** AND-semantics when queried. Prefix conventions: `interpret:*`, `service:*`, `session:*`, `user:*`, etc. */
20
+ tags: string[];
21
+ /** Breadcrumbs this derived from (SAPL provenance chain). */
22
+ parent_ids: string[];
23
+ /** Optimistic locking. PATCH must include the current value. */
24
+ version: number;
25
+ created_by: Actor;
26
+ created_at: string;
27
+ updated_at: string;
28
+ deleted_at: string | null;
29
+ /** Optional embedding for semantic search. */
30
+ embedding?: number[];
31
+ /** Relative TTL — e.g. "24h", "30d". */
32
+ ttl?: string;
33
+ }
34
+ export interface CreateBreadcrumbRequest {
35
+ name?: string;
36
+ title: string;
37
+ content: Record<string, unknown>;
38
+ tags?: string[];
39
+ parent_ids?: string[];
40
+ created_by?: Actor;
41
+ ttl?: string;
42
+ /** If a breadcrumb with the same name + tags exists, update it rather than inserting a new row. */
43
+ upsert?: boolean;
44
+ }
45
+ export interface UpdateBreadcrumbRequest {
46
+ /** Required. Optimistic locking fails with 409 Conflict otherwise. */
47
+ version: number;
48
+ title?: string;
49
+ content?: Record<string, unknown>;
50
+ tags?: string[];
51
+ parent_ids?: string[];
52
+ ttl?: string;
53
+ }
54
+ export interface BreadcrumbResponse {
55
+ breadcrumb: Breadcrumb;
56
+ action?: 'created' | 'updated';
57
+ }
58
+ export interface QueryByTagsOptions {
59
+ /** Max rows to return. Server max is 200. */
60
+ limit?: number;
61
+ offset?: number;
62
+ /** Exact name match. */
63
+ name?: string;
64
+ order?: 'newest' | 'oldest';
65
+ }
66
+ export interface SemanticSearchOptions {
67
+ limit?: number;
68
+ tags?: string[];
69
+ }
70
+ //# sourceMappingURL=breadcrumb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/types/breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE7D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,8GAA8G;IAC9G,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6DAA6D;IAC7D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mGAAmG;IACnG,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Breadcrumb — the fundamental record of RCRT.
3
+ *
4
+ * Every meaningful state change in the system is a breadcrumb. See
5
+ * `packages/docs/concepts/02-primitives.md` for the mental model.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=breadcrumb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/types/breadcrumb.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,251 @@
1
+ /**
2
+ * JIT UI Card contract.
3
+ *
4
+ * The universal structure every pending-action breadcrumb carries in
5
+ * `content.card`. Mirrors the OpenAPI schemas under
6
+ * `#/components/schemas/Card*`. See
7
+ * `packages/docs/concepts/05-jit-ui.md` for the mental model.
8
+ */
9
+ export type CardLayout = 'claim' | 'list-feed' | 'timeline' | 'stat' | 'chart' | 'compare' | 'draft' | 'decision' | 'rating' | 'input' | 'progress' | 'receipt' | 'connect' | 'info';
10
+ export type ActionStyle = 'primary' | 'secondary' | 'ghost' | 'destructive';
11
+ export interface CardAction {
12
+ /**
13
+ * PATCHed as `content.status` when the user taps. Canonical values:
14
+ * `approved` / `rejected` / `dismissed` / `edited`. Custom ids are
15
+ * allowed and land in `content.user_response.status`.
16
+ */
17
+ id: string;
18
+ label: string;
19
+ style?: ActionStyle;
20
+ emoji?: string;
21
+ /** Explicit result; default when absent is `{status: id}`. */
22
+ result?: {
23
+ status: string;
24
+ user_response?: unknown;
25
+ };
26
+ }
27
+ export interface CardHeader {
28
+ title: string;
29
+ emoji?: string;
30
+ /** Lucide icon name. Fallback when emoji isn't set. */
31
+ icon?: string;
32
+ subtitle?: string;
33
+ /** Drives chart palette and home-feed placement. e.g. `health`, `finance`. */
34
+ domain_tag?: string;
35
+ }
36
+ export interface CardFooter {
37
+ actions?: CardAction[];
38
+ dismissable?: boolean;
39
+ }
40
+ export type TrendDirection = 'up' | 'down' | 'flat';
41
+ export type ChartSpec = {
42
+ kind: 'spark';
43
+ points: number[];
44
+ trend?: TrendDirection;
45
+ } | {
46
+ kind: 'line';
47
+ series: Array<{
48
+ label?: string;
49
+ points: Array<[string, number]>;
50
+ }>;
51
+ y_target?: number;
52
+ y_unit?: string;
53
+ } | {
54
+ kind: 'bar';
55
+ bars: Array<{
56
+ label: string;
57
+ value: number;
58
+ highlight?: boolean;
59
+ }>;
60
+ orientation?: 'h' | 'v';
61
+ y_unit?: string;
62
+ } | {
63
+ kind: 'area';
64
+ points: Array<[string, number]>;
65
+ y_target?: number;
66
+ y_unit?: string;
67
+ } | {
68
+ kind: 'ring';
69
+ value: number;
70
+ max: number;
71
+ label?: string;
72
+ value_label?: string;
73
+ } | {
74
+ kind: 'heatmap';
75
+ cells: number[][];
76
+ x_labels?: string[];
77
+ y_labels?: string[];
78
+ } | {
79
+ kind: 'histogram';
80
+ buckets: Array<{
81
+ label: string;
82
+ count: number;
83
+ }>;
84
+ };
85
+ export interface TextRow {
86
+ kind: 'text';
87
+ text: string;
88
+ badge?: string;
89
+ }
90
+ /**
91
+ * Flexible text row shape. Agents frequently reach for natural field
92
+ * names like `{label, detail, meta}` when listing email-ish items.
93
+ * Renderers should accept either shape; this SDK re-exports the
94
+ * strict `TextRow` as the canonical type and the loose shape as a
95
+ * helper for consumers writing their own renderers.
96
+ */
97
+ export interface FlexibleTextRow {
98
+ kind?: 'text';
99
+ text?: string;
100
+ label?: string;
101
+ title?: string;
102
+ name?: string;
103
+ detail?: string;
104
+ subtitle?: string;
105
+ snippet?: string;
106
+ description?: string;
107
+ meta?: string;
108
+ badge?: string;
109
+ when?: string;
110
+ value?: string | number;
111
+ }
112
+ export interface ClaimRow {
113
+ kind: 'claim';
114
+ claim: string;
115
+ confidence?: 'low' | 'med' | 'high';
116
+ /** Longer context shown when the user expands a "why" drawer. */
117
+ why?: string;
118
+ /** Breadcrumb id the claim derives from. */
119
+ source_ref?: string;
120
+ }
121
+ export interface MetricRow {
122
+ kind: 'metric';
123
+ label: string;
124
+ /** Formatted display value — "6h 45m", "$1,420", "42%". */
125
+ value: string;
126
+ trend?: TrendDirection;
127
+ target?: string;
128
+ spark?: ChartSpec;
129
+ }
130
+ export interface EventRow {
131
+ kind: 'event';
132
+ title: string;
133
+ starts_at: string;
134
+ duration_min?: number;
135
+ location?: string;
136
+ who?: string[];
137
+ emoji?: string;
138
+ }
139
+ export interface PersonRow {
140
+ kind: 'person';
141
+ name: string;
142
+ avatar_hint?: string;
143
+ relationship?: string;
144
+ last_touch?: string;
145
+ spark?: ChartSpec;
146
+ quick_actions?: CardAction[];
147
+ }
148
+ export interface PlaceRow {
149
+ kind: 'place';
150
+ label: string;
151
+ address?: string;
152
+ lat_lng?: [number, number];
153
+ }
154
+ export interface ToggleRow {
155
+ kind: 'toggle';
156
+ label: string;
157
+ enabled: boolean;
158
+ action_id: string;
159
+ }
160
+ export interface DraftPreviewRow {
161
+ kind: 'draft-preview';
162
+ lines: string[];
163
+ body?: string;
164
+ }
165
+ export interface ChartRow {
166
+ kind: 'chart';
167
+ chart: ChartSpec;
168
+ caption?: string;
169
+ }
170
+ export type Row = TextRow | ClaimRow | MetricRow | EventRow | PersonRow | PlaceRow | ToggleRow | DraftPreviewRow | ChartRow;
171
+ export interface DraftPreview {
172
+ kind: 'email' | 'calendar-event' | 'message' | 'ritual' | 'task' | 'custom';
173
+ subject?: string;
174
+ to?: string[];
175
+ from?: string;
176
+ starts_at?: string;
177
+ duration_min?: number;
178
+ location?: string;
179
+ body: string;
180
+ }
181
+ export type InputSpec = {
182
+ id: string;
183
+ label: string;
184
+ placeholder?: string;
185
+ kind?: 'text' | 'textarea' | 'email' | 'url' | 'number' | 'time' | 'date';
186
+ default_value?: string;
187
+ };
188
+ export type RatingSpec = {
189
+ kind: 'scale';
190
+ min: number;
191
+ max: number;
192
+ step?: number;
193
+ label?: string;
194
+ } | {
195
+ kind: 'emoji';
196
+ options: Array<{
197
+ id: string;
198
+ emoji: string;
199
+ label: string;
200
+ }>;
201
+ };
202
+ export interface ProgressState {
203
+ /** 0..1, or `null` for indeterminate. */
204
+ pct?: number | null;
205
+ step?: string;
206
+ }
207
+ export interface ConnectDetails {
208
+ service_id: string;
209
+ scope_description?: string;
210
+ account_label?: string;
211
+ ask_label?: boolean;
212
+ }
213
+ export interface CompareColumn {
214
+ title: string;
215
+ subtitle?: string;
216
+ rows: Row[];
217
+ action_id?: string;
218
+ }
219
+ export interface CardBody {
220
+ text?: string;
221
+ rows?: Row[];
222
+ metrics?: MetricRow[];
223
+ chart?: ChartSpec;
224
+ draft?: DraftPreview;
225
+ inputs?: InputSpec[];
226
+ rating?: RatingSpec;
227
+ progress?: ProgressState;
228
+ connect?: ConnectDetails;
229
+ columns?: CompareColumn[];
230
+ }
231
+ export interface Card {
232
+ layout: CardLayout;
233
+ header: CardHeader;
234
+ body?: CardBody;
235
+ footer?: CardFooter;
236
+ /** Default `chat`. `home` → goes on the Awaiting-you feed. */
237
+ target?: 'chat' | 'home' | 'both';
238
+ entity_refs?: string[];
239
+ /**
240
+ * Optional explicit dedupe key. Without one, the server applies an
241
+ * implicit `(layout, service_id, title)` key for `connect` cards
242
+ * and `(layout, title)` otherwise.
243
+ */
244
+ dedupe_key?: string;
245
+ }
246
+ export type CanonicalStatus = 'pending' | 'approved' | 'rejected' | 'dismissed' | 'edited';
247
+ export interface ResolveRequest {
248
+ status: CanonicalStatus | string;
249
+ user_response?: unknown;
250
+ }
251
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/types/card.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,OAAO,GACP,SAAS,GACT,OAAO,GACP,UAAU,GACV,QAAQ,GACR,OAAO,GACP,UAAU,GACV,SAAS,GACT,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,aAAa,CAAC;AAE5E,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACtD;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CA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D;IAC9D,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAID,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE3F,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * JIT UI Card contract.
3
+ *
4
+ * The universal structure every pending-action breadcrumb carries in
5
+ * `content.card`. Mirrors the OpenAPI schemas under
6
+ * `#/components/schemas/Card*`. See
7
+ * `packages/docs/concepts/05-jit-ui.md` for the mental model.
8
+ */
9
+ export {};
10
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","sourceRoot":"","sources":["../../src/types/card.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * LLM engine selection types — the TypeScript mirror of the Go contract in
3
+ * `pkg/rcrt/types.go` (`EngineConfig`) and `internal/llm/address.go`
4
+ * (`ModelAddress`). See docs/design/LLM_PROVIDER_MODEL_RESOLUTION.md.
5
+ *
6
+ * The canonical address `route/provider/model` stored in an agent breadcrumb's
7
+ * `engine_config.model` is the SINGLE source of truth for LLM selection. It is
8
+ * ALWAYS concrete at runtime (tiers are expanded to a concrete address at
9
+ * publish time). There is no runtime tier indirection, no org override layer,
10
+ * and no fallbacks.
11
+ */
12
+ /**
13
+ * The parsed form of a canonical `route/provider/model` address.
14
+ *
15
+ * - `route` = transport/adapter that makes the call (`vertex_ai`,
16
+ * `openrouter`, `sovereign`, …). The special route `tier` is
17
+ * AUTHORING-ONLY and is never valid at runtime.
18
+ * - `provider` = vendor namespace within the route, may be empty
19
+ * (`anthropic`, `google`, `custom`, ``).
20
+ * - `model` = the concrete model id (may itself contain slashes).
21
+ *
22
+ * Examples:
23
+ * - `vertex_ai//gemini-3.1-pro-preview` → { route: 'vertex_ai', provider: '', model: 'gemini-3.1-pro-preview' }
24
+ * - `openrouter/anthropic/claude-fable-5` → { route: 'openrouter', provider: 'anthropic', model: 'claude-fable-5' }
25
+ * - `vertex_ai/anthropic/claude-sonnet-4-6` → { route: 'vertex_ai', provider: 'anthropic', model: 'claude-sonnet-4-6' }
26
+ */
27
+ export interface ModelAddress {
28
+ route: string;
29
+ /** Vendor namespace within the route; may be empty (`route//model`). */
30
+ provider: string;
31
+ model: string;
32
+ }
33
+ /**
34
+ * Parse a canonical `route/provider/model` address. Splits into at most three
35
+ * segments so the `model` segment may contain further slashes. Throws on a
36
+ * malformed/empty address (no default — fail loudly, mirroring the Go
37
+ * `ParseModelAddress`).
38
+ */
39
+ export declare function parseModelAddress(s: string): ModelAddress;
40
+ /**
41
+ * Render a {@link ModelAddress} back to canonical `route/provider/model` form.
42
+ * An empty provider renders as `route//model`.
43
+ */
44
+ export declare function formatModelAddress(addr: ModelAddress): string;
45
+ /** The authoring-only route. An address with this route is an unexpanded tier. */
46
+ export declare const ROUTE_TIER = "tier";
47
+ /** True if the address is an unexpanded authoring-only tier address. */
48
+ export declare function isTierAddress(addr: ModelAddress): boolean;
49
+ /** Authoring-sugar intelligence tiers; expanded to a concrete address at publish time. */
50
+ export type IntelligenceTier = 'efficient' | 'balanced' | 'expert' | 'max';
51
+ /**
52
+ * EngineConfig — which LLM engine an agent uses. Mirrors the Go `EngineConfig`
53
+ * in `pkg/rcrt/types.go`.
54
+ *
55
+ * `model` is the runtime source of truth: a canonical `route/provider/model`
56
+ * address. `tool` and `intelligence_level` are AUTHORING-ONLY sugar that are
57
+ * stripped at publish time once a concrete `model` address is present.
58
+ */
59
+ export interface EngineConfig {
60
+ /** Engine kind: `llm` | `human`. */
61
+ type: string;
62
+ /** Authoring-only legacy provider hint; stripped at publish. */
63
+ tool?: string;
64
+ /** Canonical `route/provider/model` address — runtime SSOT. */
65
+ model?: string;
66
+ /** Authoring-only sugar; expanded to `model` at publish. */
67
+ intelligence_level?: IntelligenceTier;
68
+ }
69
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/types/engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAkBzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAE7D;AAED,kFAAkF;AAClF,eAAO,MAAM,UAAU,SAAS,CAAC;AAEjC,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAEzD;AAED,0FAA0F;AAC1F,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE3E;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,gBAAgB,CAAC;CACvC"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * LLM engine selection types — the TypeScript mirror of the Go contract in
3
+ * `pkg/rcrt/types.go` (`EngineConfig`) and `internal/llm/address.go`
4
+ * (`ModelAddress`). See docs/design/LLM_PROVIDER_MODEL_RESOLUTION.md.
5
+ *
6
+ * The canonical address `route/provider/model` stored in an agent breadcrumb's
7
+ * `engine_config.model` is the SINGLE source of truth for LLM selection. It is
8
+ * ALWAYS concrete at runtime (tiers are expanded to a concrete address at
9
+ * publish time). There is no runtime tier indirection, no org override layer,
10
+ * and no fallbacks.
11
+ */
12
+ /**
13
+ * Parse a canonical `route/provider/model` address. Splits into at most three
14
+ * segments so the `model` segment may contain further slashes. Throws on a
15
+ * malformed/empty address (no default — fail loudly, mirroring the Go
16
+ * `ParseModelAddress`).
17
+ */
18
+ export function parseModelAddress(s) {
19
+ const raw = (s ?? '').trim();
20
+ if (raw === '')
21
+ throw new Error('empty model address');
22
+ // Split into at most three parts: route, provider, model-with-slashes.
23
+ const firstSlash = raw.indexOf('/');
24
+ if (firstSlash === -1) {
25
+ throw new Error(`malformed model address "${s}": expected route/provider/model`);
26
+ }
27
+ const secondSlash = raw.indexOf('/', firstSlash + 1);
28
+ if (secondSlash === -1) {
29
+ throw new Error(`malformed model address "${s}": expected route/provider/model`);
30
+ }
31
+ const route = raw.slice(0, firstSlash).trim();
32
+ const provider = raw.slice(firstSlash + 1, secondSlash).trim();
33
+ const model = raw.slice(secondSlash + 1).trim();
34
+ if (route === '')
35
+ throw new Error(`malformed model address "${s}": empty route`);
36
+ if (model === '')
37
+ throw new Error(`malformed model address "${s}": empty model`);
38
+ return { route, provider, model };
39
+ }
40
+ /**
41
+ * Render a {@link ModelAddress} back to canonical `route/provider/model` form.
42
+ * An empty provider renders as `route//model`.
43
+ */
44
+ export function formatModelAddress(addr) {
45
+ return `${addr.route}/${addr.provider}/${addr.model}`;
46
+ }
47
+ /** The authoring-only route. An address with this route is an unexpanded tier. */
48
+ export const ROUTE_TIER = 'tier';
49
+ /** True if the address is an unexpanded authoring-only tier address. */
50
+ export function isTierAddress(addr) {
51
+ return addr.route === ROUTE_TIER;
52
+ }
53
+ //# sourceMappingURL=engine.js.map
@@ -0,0 +1 @@
1
+ {"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AK,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AACpC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAkB;IACnD,OAAO,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;AACxD,CAAC;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC;AAEjC,wEAAwE;AACxE,MAAM,UAAU,aAAa,CAAC,IAAkB;IAC9C,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC;AACnC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './breadcrumb.js';
2
+ export * from './card.js';
3
+ export * from './engine.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './breadcrumb.js';
2
+ export * from './card.js';
3
+ export * from './engine.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}