@treeseed/sdk 0.13.0-rc.38 → 0.13.0-rc.40
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/dist/agent-capacity/validation/agent-definition-schema.d.ts +420 -420
- package/dist/agent-capacity/validation/agent-lab-forensics-schema.d.ts +8 -8
- package/dist/content/validation/agent-operational-content-schemas.d.ts +66 -66
- package/dist/content/validation/auxiliary-content-schemas.d.ts +44 -44
- package/dist/content/validation/content-model-schemas.d.ts +966 -966
- package/dist/content/validation/portable-content-data.d.ts +103 -103
- package/dist/deployment/schemas.d.ts +782 -782
- package/dist/development/index.d.ts +1 -0
- package/dist/development/index.js +1 -0
- package/dist/development/schemas.d.ts +3149 -0
- package/dist/development/schemas.js +153 -0
- package/dist/guarantees/index.d.ts +96 -0
- package/dist/guarantees/index.js +41 -0
- package/dist/operator-contracts/canonical-command-tree.js +35 -0
- package/dist/operator-contracts/catalog/communication-operations.d.ts +40 -40
- package/dist/operator-contracts/communication/contracts.d.ts +44 -44
- package/dist/operator-contracts/control-plane-operations.d.ts +46 -46
- package/dist/operator-contracts/oauth.d.ts +35 -0
- package/dist/operator-contracts/oauth.js +7 -0
- package/dist/site-contracts/catalog.d.ts +16 -0
- package/dist/site-contracts/catalog.js +19 -0
- package/dist/site-contracts/cloudflare.d.ts +48 -0
- package/dist/site-contracts/cloudflare.js +0 -0
- package/dist/site-contracts/platform.d.ts +94 -0
- package/dist/site-contracts/platform.js +0 -0
- package/dist/site-contracts/plugin.d.ts +63 -0
- package/dist/site-contracts/plugin.js +26 -0
- package/package.json +29 -1
|
@@ -345,12 +345,12 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
345
345
|
projectId: string;
|
|
346
346
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
347
347
|
readonly updateWorkflow: ControlPlaneOperationBinding<{
|
|
348
|
-
operationId: string;
|
|
349
348
|
projectId: string;
|
|
349
|
+
operationId: string;
|
|
350
350
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
351
351
|
readonly dispatchWorkflow: ControlPlaneOperationBinding<{
|
|
352
|
-
operationId: string;
|
|
353
352
|
projectId: string;
|
|
353
|
+
operationId: string;
|
|
354
354
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
355
355
|
readonly workflowRun: ControlPlaneOperationBinding<{
|
|
356
356
|
runId: string;
|
|
@@ -368,23 +368,23 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
368
368
|
projectId: string;
|
|
369
369
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
370
370
|
readonly putWorkflowSecret: ControlPlaneOperationBinding<{
|
|
371
|
-
name: string;
|
|
372
371
|
projectId: string;
|
|
372
|
+
name: string;
|
|
373
373
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
374
374
|
readonly deleteWorkflowSecret: ControlPlaneOperationBinding<{
|
|
375
|
-
name: string;
|
|
376
375
|
projectId: string;
|
|
376
|
+
name: string;
|
|
377
377
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
378
378
|
readonly workflowVariables: ControlPlaneOperationBinding<{
|
|
379
379
|
projectId: string;
|
|
380
380
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
381
381
|
readonly putWorkflowVariable: ControlPlaneOperationBinding<{
|
|
382
|
-
name: string;
|
|
383
382
|
projectId: string;
|
|
383
|
+
name: string;
|
|
384
384
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
385
385
|
readonly deleteWorkflowVariable: ControlPlaneOperationBinding<{
|
|
386
|
-
name: string;
|
|
387
386
|
projectId: string;
|
|
387
|
+
name: string;
|
|
388
388
|
}, {}, Record<string, unknown> | undefined, Record<string, unknown>>;
|
|
389
389
|
};
|
|
390
390
|
readonly services: {
|
|
@@ -470,40 +470,12 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
470
470
|
timeoutSeconds?: number | undefined;
|
|
471
471
|
recipients?: string[] | undefined;
|
|
472
472
|
}, {
|
|
473
|
-
status: "
|
|
473
|
+
status: "failed" | "partial" | "complete" | "running" | "queued";
|
|
474
474
|
schemaVersion: "treeseed.communication-send-receipt/v2";
|
|
475
|
-
createdAt: string;
|
|
476
|
-
responses: {
|
|
477
|
-
status: "failed" | "cancelled" | "responded" | "abstained";
|
|
478
|
-
createdAt: string;
|
|
479
|
-
projectId: string;
|
|
480
|
-
agentSlug: string;
|
|
481
|
-
assignmentId: string | null;
|
|
482
|
-
invocationId: string;
|
|
483
|
-
requirement: "required" | "optional";
|
|
484
|
-
messageRef: string;
|
|
485
|
-
markdown: string;
|
|
486
|
-
}[];
|
|
487
|
-
teamId: string;
|
|
488
|
-
channel: string;
|
|
489
|
-
updatedAt: string;
|
|
490
|
-
messageRef: string;
|
|
491
|
-
sendId: string;
|
|
492
|
-
topic: {
|
|
493
|
-
id: string;
|
|
494
|
-
slug: string;
|
|
495
|
-
};
|
|
496
|
-
projectStream: {
|
|
497
|
-
id: string;
|
|
498
|
-
projectId: string;
|
|
499
|
-
projectSlug: string;
|
|
500
|
-
};
|
|
501
|
-
discussionId: string;
|
|
502
|
-
sourceMessage: string;
|
|
503
475
|
targets: {
|
|
504
476
|
status: "failed" | "running" | "cancelled" | "queued" | "responded" | "abstained";
|
|
505
|
-
completedAt: string | null;
|
|
506
477
|
projectId: string;
|
|
478
|
+
completedAt: string | null;
|
|
507
479
|
agentSlug: string;
|
|
508
480
|
capacity: {
|
|
509
481
|
status: string | null;
|
|
@@ -537,19 +509,11 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
537
509
|
message: string | null;
|
|
538
510
|
} | null;
|
|
539
511
|
}[];
|
|
540
|
-
replayed: boolean;
|
|
541
|
-
}>;
|
|
542
|
-
readonly sendStatus: ControlPlaneOperationBinding<{
|
|
543
|
-
teamId: string;
|
|
544
|
-
sendId: string;
|
|
545
|
-
}, {}, undefined, {
|
|
546
|
-
status: "partial" | "failed" | "complete" | "running" | "queued";
|
|
547
|
-
schemaVersion: "treeseed.communication-send-receipt/v2";
|
|
548
512
|
createdAt: string;
|
|
549
513
|
responses: {
|
|
550
514
|
status: "failed" | "cancelled" | "responded" | "abstained";
|
|
551
|
-
createdAt: string;
|
|
552
515
|
projectId: string;
|
|
516
|
+
createdAt: string;
|
|
553
517
|
agentSlug: string;
|
|
554
518
|
assignmentId: string | null;
|
|
555
519
|
invocationId: string;
|
|
@@ -573,10 +537,18 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
573
537
|
};
|
|
574
538
|
discussionId: string;
|
|
575
539
|
sourceMessage: string;
|
|
540
|
+
replayed: boolean;
|
|
541
|
+
}>;
|
|
542
|
+
readonly sendStatus: ControlPlaneOperationBinding<{
|
|
543
|
+
teamId: string;
|
|
544
|
+
sendId: string;
|
|
545
|
+
}, {}, undefined, {
|
|
546
|
+
status: "failed" | "partial" | "complete" | "running" | "queued";
|
|
547
|
+
schemaVersion: "treeseed.communication-send-receipt/v2";
|
|
576
548
|
targets: {
|
|
577
549
|
status: "failed" | "running" | "cancelled" | "queued" | "responded" | "abstained";
|
|
578
|
-
completedAt: string | null;
|
|
579
550
|
projectId: string;
|
|
551
|
+
completedAt: string | null;
|
|
580
552
|
agentSlug: string;
|
|
581
553
|
capacity: {
|
|
582
554
|
status: string | null;
|
|
@@ -610,6 +582,34 @@ export declare const CONTROL_PLANE_OPERATIONS: {
|
|
|
610
582
|
message: string | null;
|
|
611
583
|
} | null;
|
|
612
584
|
}[];
|
|
585
|
+
createdAt: string;
|
|
586
|
+
responses: {
|
|
587
|
+
status: "failed" | "cancelled" | "responded" | "abstained";
|
|
588
|
+
projectId: string;
|
|
589
|
+
createdAt: string;
|
|
590
|
+
agentSlug: string;
|
|
591
|
+
assignmentId: string | null;
|
|
592
|
+
invocationId: string;
|
|
593
|
+
requirement: "required" | "optional";
|
|
594
|
+
messageRef: string;
|
|
595
|
+
markdown: string;
|
|
596
|
+
}[];
|
|
597
|
+
teamId: string;
|
|
598
|
+
channel: string;
|
|
599
|
+
updatedAt: string;
|
|
600
|
+
messageRef: string;
|
|
601
|
+
sendId: string;
|
|
602
|
+
topic: {
|
|
603
|
+
id: string;
|
|
604
|
+
slug: string;
|
|
605
|
+
};
|
|
606
|
+
projectStream: {
|
|
607
|
+
id: string;
|
|
608
|
+
projectId: string;
|
|
609
|
+
projectSlug: string;
|
|
610
|
+
};
|
|
611
|
+
discussionId: string;
|
|
612
|
+
sourceMessage: string;
|
|
613
613
|
replayed: boolean;
|
|
614
614
|
}>;
|
|
615
615
|
};
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { OAuthScope } from './control-plane-operation.js';
|
|
2
|
+
export declare const OAUTH_CLIENT_IDS: {
|
|
3
|
+
readonly cli: "trsd";
|
|
4
|
+
readonly admin: "treeseed-admin";
|
|
5
|
+
};
|
|
6
|
+
export type OAuthClientId = typeof OAUTH_CLIENT_IDS[keyof typeof OAUTH_CLIENT_IDS];
|
|
2
7
|
export interface ApiPrincipal {
|
|
3
8
|
id: string;
|
|
4
9
|
displayName?: string;
|
|
@@ -18,6 +23,36 @@ export interface OAuthAuthorizationServerMetadata {
|
|
|
18
23
|
code_challenge_methods_supported: ['S256'];
|
|
19
24
|
scopes_supported: OAuthScope[];
|
|
20
25
|
}
|
|
26
|
+
export interface OAuthAuthorizationPresentation {
|
|
27
|
+
schemaVersion: 'treeseed.oauth.authorization-presentation/v1';
|
|
28
|
+
clientId: string;
|
|
29
|
+
clientName: string;
|
|
30
|
+
redirectUri: string;
|
|
31
|
+
redirectOrigin: string;
|
|
32
|
+
responseType: 'code';
|
|
33
|
+
codeChallenge: string;
|
|
34
|
+
codeChallengeMethod: 'S256';
|
|
35
|
+
scopes: OAuthScope[];
|
|
36
|
+
state: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface OAuthAuthorizationDecisionRequest {
|
|
39
|
+
clientId: string;
|
|
40
|
+
redirectUri: string;
|
|
41
|
+
responseType: 'code';
|
|
42
|
+
codeChallenge: string;
|
|
43
|
+
codeChallengeMethod: 'S256';
|
|
44
|
+
scope: OAuthScope[];
|
|
45
|
+
state?: string | null;
|
|
46
|
+
decision: 'approve' | 'deny';
|
|
47
|
+
identifier?: string;
|
|
48
|
+
password?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface OAuthAuthorizationDecisionResult {
|
|
51
|
+
schemaVersion: 'treeseed.oauth.authorization-decision/v1';
|
|
52
|
+
approved: boolean;
|
|
53
|
+
redirectTo: string;
|
|
54
|
+
expiresIn?: number;
|
|
55
|
+
}
|
|
21
56
|
export interface OAuthProtectedResourceMetadata {
|
|
22
57
|
resource: string;
|
|
23
58
|
authorization_servers: string[];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const REMOTE_CONTRACT_HEADER = "x-treeseed-contract-version";
|
|
2
|
+
export declare const REMOTE_CONTRACT_VERSION = 1;
|
|
3
|
+
export declare const COMMERCE_OFFER_MODES: readonly ["free", "private", "contact", "one_time", "one_time_current_version", "subscription", "subscription_updates", "professional_hosting", "scoped_contract", "external"];
|
|
4
|
+
export type CommerceOfferMode = typeof COMMERCE_OFFER_MODES[number];
|
|
5
|
+
export type CatalogItemOfferMode = CommerceOfferMode;
|
|
6
|
+
export interface CatalogItem {
|
|
7
|
+
id?: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
visibility?: string;
|
|
13
|
+
offerMode?: CommerceOfferMode;
|
|
14
|
+
priceModel?: CommerceOfferMode;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const REMOTE_CONTRACT_HEADER = "x-treeseed-contract-version";
|
|
2
|
+
const REMOTE_CONTRACT_VERSION = 1;
|
|
3
|
+
const COMMERCE_OFFER_MODES = [
|
|
4
|
+
"free",
|
|
5
|
+
"private",
|
|
6
|
+
"contact",
|
|
7
|
+
"one_time",
|
|
8
|
+
"one_time_current_version",
|
|
9
|
+
"subscription",
|
|
10
|
+
"subscription_updates",
|
|
11
|
+
"professional_hosting",
|
|
12
|
+
"scoped_contract",
|
|
13
|
+
"external"
|
|
14
|
+
];
|
|
15
|
+
export {
|
|
16
|
+
COMMERCE_OFFER_MODES,
|
|
17
|
+
REMOTE_CONTRACT_HEADER,
|
|
18
|
+
REMOTE_CONTRACT_VERSION
|
|
19
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export interface KvNamespacePutOptions {
|
|
2
|
+
expirationTtl?: number;
|
|
3
|
+
}
|
|
4
|
+
export interface KvNamespaceLike {
|
|
5
|
+
get(key: string): Promise<string | null>;
|
|
6
|
+
put(key: string, value: string, options?: KvNamespacePutOptions): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export interface D1PreparedStatementLike {
|
|
9
|
+
bind(...values: unknown[]): D1PreparedStatementLike;
|
|
10
|
+
run(): Promise<unknown>;
|
|
11
|
+
first<T = Record<string, unknown>>(): Promise<T | null>;
|
|
12
|
+
all<T = Record<string, unknown>>(): Promise<{
|
|
13
|
+
results: T[];
|
|
14
|
+
}>;
|
|
15
|
+
raw<T = unknown[]>(): Promise<T[]>;
|
|
16
|
+
}
|
|
17
|
+
export interface D1DatabaseLike {
|
|
18
|
+
prepare(query: string): D1PreparedStatementLike;
|
|
19
|
+
batch?(statements: D1PreparedStatementLike[]): Promise<unknown[]>;
|
|
20
|
+
exec?(query: string): Promise<unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface CloudflareRuntimeAssets {
|
|
23
|
+
fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
|
|
24
|
+
}
|
|
25
|
+
export interface R2ObjectLike {
|
|
26
|
+
text(): Promise<string>;
|
|
27
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
28
|
+
json<T = unknown>(): Promise<T>;
|
|
29
|
+
httpEtag?: string;
|
|
30
|
+
etag?: string;
|
|
31
|
+
size?: number;
|
|
32
|
+
uploaded?: Date;
|
|
33
|
+
writeHttpMetadata?(headers: Headers): void;
|
|
34
|
+
}
|
|
35
|
+
export interface R2BucketLike {
|
|
36
|
+
get(key: string): Promise<R2ObjectLike | null>;
|
|
37
|
+
head?(key: string): Promise<R2ObjectLike | null>;
|
|
38
|
+
put(key: string, value: string | ArrayBuffer | ArrayBufferView | ReadableStream, options?: Record<string, unknown>): Promise<unknown>;
|
|
39
|
+
delete?(key: string | string[]): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export interface CloudflareRuntime {
|
|
42
|
+
env: {
|
|
43
|
+
FORM_GUARD_KV: KvNamespaceLike;
|
|
44
|
+
SITE_DATA_DB: D1DatabaseLike;
|
|
45
|
+
ASSETS?: CloudflareRuntimeAssets;
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export type ContentCollection = 'pages' | 'notes' | 'questions' | 'objectives' | 'proposals' | 'decisions' | 'people' | 'agents' | 'books' | 'docs' | 'templates' | 'workdays' | 'groups' | 'group_edges';
|
|
2
|
+
export type ThemeMode = 'light' | 'dark' | 'system';
|
|
3
|
+
export type ColorSchemeId = 'fern' | 'lichen' | 'cedar' | 'tidepool' | (string & {});
|
|
4
|
+
export interface SemanticColorTokens {
|
|
5
|
+
canvas: string;
|
|
6
|
+
canvasSubtle: string;
|
|
7
|
+
surface: string;
|
|
8
|
+
surfaceMuted: string;
|
|
9
|
+
surfaceRaised: string;
|
|
10
|
+
surfaceOverlay: string;
|
|
11
|
+
text: string;
|
|
12
|
+
textMuted: string;
|
|
13
|
+
textSubtle: string;
|
|
14
|
+
textInverse: string;
|
|
15
|
+
link: string;
|
|
16
|
+
linkHover: string;
|
|
17
|
+
border: string;
|
|
18
|
+
borderMuted: string;
|
|
19
|
+
borderStrong: string;
|
|
20
|
+
focus: string;
|
|
21
|
+
accent: string;
|
|
22
|
+
accentHover: string;
|
|
23
|
+
accentStrong: string;
|
|
24
|
+
accentSoft: string;
|
|
25
|
+
accentText: string;
|
|
26
|
+
info: string;
|
|
27
|
+
infoSoft: string;
|
|
28
|
+
infoText: string;
|
|
29
|
+
infoBorder: string;
|
|
30
|
+
success: string;
|
|
31
|
+
successSoft: string;
|
|
32
|
+
successText: string;
|
|
33
|
+
successBorder: string;
|
|
34
|
+
warning: string;
|
|
35
|
+
warningSoft: string;
|
|
36
|
+
warningText: string;
|
|
37
|
+
warningBorder: string;
|
|
38
|
+
danger: string;
|
|
39
|
+
dangerSoft: string;
|
|
40
|
+
dangerText: string;
|
|
41
|
+
dangerBorder: string;
|
|
42
|
+
shadow: string;
|
|
43
|
+
grid: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SchemeTokens {
|
|
46
|
+
light: SemanticColorTokens;
|
|
47
|
+
dark: SemanticColorTokens;
|
|
48
|
+
}
|
|
49
|
+
export interface ThemeConfig {
|
|
50
|
+
defaultScheme?: ColorSchemeId;
|
|
51
|
+
defaultMode?: ThemeMode;
|
|
52
|
+
schemes?: Record<string, Partial<{
|
|
53
|
+
light: Partial<SemanticColorTokens>;
|
|
54
|
+
dark: Partial<SemanticColorTokens>;
|
|
55
|
+
}>>;
|
|
56
|
+
}
|
|
57
|
+
export type PlatformSurfaceName = 'web' | 'api' | (string & {});
|
|
58
|
+
export type PlatformResourceKind = 'pages' | 'styles' | 'components' | 'routes' | 'middleware' | 'handlers' | 'config';
|
|
59
|
+
export interface PlatformLayerDefinition {
|
|
60
|
+
root: string;
|
|
61
|
+
kinds?: PlatformResourceKind[];
|
|
62
|
+
}
|
|
63
|
+
export interface ManagedServiceEnvironmentConfig {
|
|
64
|
+
baseUrl?: string;
|
|
65
|
+
domain?: string;
|
|
66
|
+
serviceName?: string;
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}
|
|
69
|
+
export interface DeployConfig {
|
|
70
|
+
content?: Record<string, unknown>;
|
|
71
|
+
forms?: Record<string, unknown>;
|
|
72
|
+
surfaces?: Record<string, unknown>;
|
|
73
|
+
services?: Record<string, unknown>;
|
|
74
|
+
[key: string]: any;
|
|
75
|
+
}
|
|
76
|
+
export interface TenantConfig {
|
|
77
|
+
id?: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
root?: string;
|
|
80
|
+
content: Record<string, string | undefined>;
|
|
81
|
+
features?: Record<string, boolean | undefined>;
|
|
82
|
+
site?: {
|
|
83
|
+
models?: Partial<Record<ContentCollection, {
|
|
84
|
+
rendered?: boolean;
|
|
85
|
+
}>>;
|
|
86
|
+
};
|
|
87
|
+
theme?: ThemeConfig;
|
|
88
|
+
plugins?: Array<{
|
|
89
|
+
package: string;
|
|
90
|
+
enabled?: boolean;
|
|
91
|
+
config?: Record<string, unknown>;
|
|
92
|
+
}>;
|
|
93
|
+
[key: string]: any;
|
|
94
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { DeployConfig, PlatformLayerDefinition, PlatformResourceKind, PlatformSurfaceName, TenantConfig } from './platform.js';
|
|
2
|
+
export type RouteOwner = 'market' | 'admin' | 'core';
|
|
3
|
+
export type RouteResponseKind = 'page' | 'message' | 'redirect' | 'data' | 'proxy' | 'action' | 'feed';
|
|
4
|
+
export type RouteArchetype = 'action' | 'auth-form' | 'collection' | 'dashboard' | 'detail' | 'feed' | 'message' | 'profile' | 'reader' | 'redirect' | 'settings' | 'wizard';
|
|
5
|
+
export type RouteNavigationPosture = 'primary' | 'secondary' | 'contextual' | 'hidden';
|
|
6
|
+
export type RouteStatus = 'active' | 'planned' | 'deprecated';
|
|
7
|
+
export interface RouteCapability {
|
|
8
|
+
id: string;
|
|
9
|
+
owner: RouteOwner;
|
|
10
|
+
responseKind: RouteResponseKind;
|
|
11
|
+
archetype: RouteArchetype;
|
|
12
|
+
shell: string;
|
|
13
|
+
template: string;
|
|
14
|
+
surface: 'auth' | 'public' | 'personal' | 'team' | 'content' | 'system';
|
|
15
|
+
resourceType: string;
|
|
16
|
+
accessPolicy: string[];
|
|
17
|
+
viewModelDependencies: string[];
|
|
18
|
+
navigation: RouteNavigationPosture;
|
|
19
|
+
states: Array<'loading' | 'empty' | 'forbidden' | 'unavailable' | 'validation' | 'conflict' | 'retry' | 'success' | 'not-found'>;
|
|
20
|
+
selector: string;
|
|
21
|
+
status: RouteStatus;
|
|
22
|
+
guarantees: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
knowledgePageIds?: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface SiteRouteContribution {
|
|
27
|
+
pattern: string;
|
|
28
|
+
entrypoint?: string;
|
|
29
|
+
resourcePath?: string;
|
|
30
|
+
capability?: RouteCapability;
|
|
31
|
+
}
|
|
32
|
+
export interface SiteExtensionContribution {
|
|
33
|
+
routes?: SiteRouteContribution[];
|
|
34
|
+
starlightComponents?: Record<string, string>;
|
|
35
|
+
customCss?: string[];
|
|
36
|
+
remarkPlugins?: unknown[];
|
|
37
|
+
rehypePlugins?: unknown[];
|
|
38
|
+
envSchema?: Record<string, unknown>;
|
|
39
|
+
vitePlugins?: unknown[];
|
|
40
|
+
integrations?: unknown[];
|
|
41
|
+
routeMiddleware?: unknown[];
|
|
42
|
+
}
|
|
43
|
+
export interface PluginSiteContext {
|
|
44
|
+
projectRoot: string;
|
|
45
|
+
tenantConfig: TenantConfig;
|
|
46
|
+
deployConfig?: DeployConfig;
|
|
47
|
+
pluginConfig: Record<string, unknown>;
|
|
48
|
+
}
|
|
49
|
+
export interface Plugin {
|
|
50
|
+
id?: string;
|
|
51
|
+
provides?: Record<string, unknown>;
|
|
52
|
+
siteProviders?: Record<string, SiteExtensionContribution | ((context: PluginSiteContext) => SiteExtensionContribution)>;
|
|
53
|
+
siteHooks?: SiteExtensionContribution | ((context: PluginSiteContext) => SiteExtensionContribution);
|
|
54
|
+
siteLayers?: PlatformLayerDefinition[] | ((context: PluginSiteContext) => PlatformLayerDefinition[] | undefined);
|
|
55
|
+
platformLayers?: Array<PlatformLayerDefinition & {
|
|
56
|
+
surface?: PlatformSurfaceName;
|
|
57
|
+
kinds?: PlatformResourceKind[];
|
|
58
|
+
}>;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
export declare function defineRoute<T extends SiteRouteContribution>(route: T): T;
|
|
62
|
+
export declare function validateRouteCapabilities(routes: readonly SiteRouteContribution[]): readonly SiteRouteContribution[];
|
|
63
|
+
export declare function definePlugin<T extends Plugin>(plugin: T): T;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function defineRoute(route) {
|
|
2
|
+
if (!route.pattern.startsWith("/")) throw new Error(`TreeSeed route pattern must start with "/": ${route.pattern}`);
|
|
3
|
+
if (route.capability && !/^[a-z][a-z0-9.-]+$/u.test(route.capability.id)) throw new Error(`Invalid TreeSeed route capability id: ${route.capability.id}`);
|
|
4
|
+
return route;
|
|
5
|
+
}
|
|
6
|
+
function validateRouteCapabilities(routes) {
|
|
7
|
+
const patterns = /* @__PURE__ */ new Set();
|
|
8
|
+
const ids = /* @__PURE__ */ new Set();
|
|
9
|
+
for (const route of routes) {
|
|
10
|
+
defineRoute(route);
|
|
11
|
+
if (patterns.has(route.pattern)) throw new Error(`Duplicate TreeSeed route pattern: ${route.pattern}`);
|
|
12
|
+
patterns.add(route.pattern);
|
|
13
|
+
if (!route.capability) throw new Error(`TreeSeed route ${route.pattern} is missing capability metadata.`);
|
|
14
|
+
if (ids.has(route.capability.id)) throw new Error(`Duplicate TreeSeed route capability id: ${route.capability.id}`);
|
|
15
|
+
ids.add(route.capability.id);
|
|
16
|
+
}
|
|
17
|
+
return routes;
|
|
18
|
+
}
|
|
19
|
+
function definePlugin(plugin) {
|
|
20
|
+
return plugin;
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
definePlugin,
|
|
24
|
+
defineRoute,
|
|
25
|
+
validateRouteCapabilities
|
|
26
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.13.0-rc.
|
|
3
|
+
"version": "0.13.0-rc.40",
|
|
4
4
|
"description": "Portable TreeSeed contracts, standards, and typed remote control-plane clients.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -61,6 +61,10 @@
|
|
|
61
61
|
"vitest": "^4.1.2"
|
|
62
62
|
},
|
|
63
63
|
"exports": {
|
|
64
|
+
"./development": {
|
|
65
|
+
"types": "./dist/development/index.d.ts",
|
|
66
|
+
"default": "./dist/development/index.js"
|
|
67
|
+
},
|
|
64
68
|
"./deployment": {
|
|
65
69
|
"types": "./dist/deployment/index.d.ts",
|
|
66
70
|
"default": "./dist/deployment/index.js"
|
|
@@ -85,6 +89,30 @@
|
|
|
85
89
|
"types": "./dist/operator-contracts/index.d.ts",
|
|
86
90
|
"default": "./dist/operator-contracts/index.js"
|
|
87
91
|
},
|
|
92
|
+
"./guarantees": {
|
|
93
|
+
"types": "./dist/guarantees/index.d.ts",
|
|
94
|
+
"default": "./dist/guarantees/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./site-contracts/platform": {
|
|
97
|
+
"types": "./dist/site-contracts/platform.d.ts",
|
|
98
|
+
"default": "./dist/site-contracts/platform.js"
|
|
99
|
+
},
|
|
100
|
+
"./site-contracts/plugin": {
|
|
101
|
+
"types": "./dist/site-contracts/plugin.d.ts",
|
|
102
|
+
"default": "./dist/site-contracts/plugin.js"
|
|
103
|
+
},
|
|
104
|
+
"./site-contracts/cloudflare": {
|
|
105
|
+
"types": "./dist/site-contracts/cloudflare.d.ts",
|
|
106
|
+
"default": "./dist/site-contracts/cloudflare.js"
|
|
107
|
+
},
|
|
108
|
+
"./site-contracts/catalog": {
|
|
109
|
+
"types": "./dist/site-contracts/catalog.d.ts",
|
|
110
|
+
"default": "./dist/site-contracts/catalog.js"
|
|
111
|
+
},
|
|
112
|
+
"./field-aliases": {
|
|
113
|
+
"types": "./dist/entrypoints/models/field-aliases.d.ts",
|
|
114
|
+
"default": "./dist/entrypoints/models/field-aliases.js"
|
|
115
|
+
},
|
|
88
116
|
"./control-plane-client": {
|
|
89
117
|
"types": "./dist/entrypoints/clients/control-plane-client.d.ts",
|
|
90
118
|
"default": "./dist/entrypoints/clients/control-plane-client.js"
|