@collective-intelligence/extensions-sdk 0.0.0-stage → 0.1.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 (64) hide show
  1. package/README.md +1276 -2
  2. package/dist/components/agents.d.ts +155 -0
  3. package/dist/components/authoring-core.d.ts +253 -0
  4. package/dist/components/base.d.ts +25 -0
  5. package/dist/components/catalog.d.ts +21 -0
  6. package/dist/components/connections.d.ts +52 -0
  7. package/dist/components/connector-instances.d.ts +142 -0
  8. package/dist/components/connectors.d.ts +408 -0
  9. package/dist/components/dataset-parser-validation.d.ts +2 -0
  10. package/dist/components/dataset-parser.d.ts +74 -0
  11. package/dist/components/datasets.d.ts +356 -0
  12. package/dist/components/declaration.d.ts +12 -0
  13. package/dist/components/executable-authoring.d.ts +27 -0
  14. package/dist/components/external-app-gateway.d.ts +7 -0
  15. package/dist/components/external-application.d.ts +17 -0
  16. package/dist/components/fields.d.ts +34 -0
  17. package/dist/components/knowledge-remote-reference.d.ts +7 -0
  18. package/dist/components/knowledge.d.ts +188 -0
  19. package/dist/components/lifecycle.d.ts +7 -0
  20. package/dist/components/metadata-authoring.d.ts +66 -0
  21. package/dist/components/notification-channel-capabilities.d.ts +7 -0
  22. package/dist/components/remote-tool-collection.d.ts +3 -0
  23. package/dist/components/studio.d.ts +48 -0
  24. package/dist/components/templates.d.ts +50 -0
  25. package/dist/components/tools.d.ts +138 -0
  26. package/dist/components/workflow-editor.d.ts +28 -0
  27. package/dist/components/workflow-node-authoring.d.ts +4 -0
  28. package/dist/components/workflow-ports.d.ts +26 -0
  29. package/dist/components/workflow-results.d.ts +75 -0
  30. package/dist/components/workflow-rules.d.ts +20 -0
  31. package/dist/components/workflow-schema.d.ts +22 -0
  32. package/dist/components/workflows.d.ts +529 -0
  33. package/dist/foundation/json.d.ts +8 -0
  34. package/dist/foundation/string-order.d.ts +2 -0
  35. package/dist/gateway/declarations.d.ts +69 -0
  36. package/dist/gateway/operation-contract.d.ts +29 -0
  37. package/dist/hosted/contributions.d.ts +52 -0
  38. package/dist/index.d.ts +69 -0
  39. package/dist/index.js +1 -0
  40. package/dist/package/canonical.d.ts +9 -0
  41. package/dist/package/connector-readers.d.ts +171 -0
  42. package/dist/package/definition.d.ts +31 -0
  43. package/dist/package/dependencies.d.ts +10 -0
  44. package/dist/package/instance-readers.d.ts +4 -0
  45. package/dist/package/knowledge-readers.d.ts +137 -0
  46. package/dist/package/manifest.d.ts +42 -0
  47. package/dist/package/parse-manifest.d.ts +3 -0
  48. package/dist/package/policy-readers.d.ts +17 -0
  49. package/dist/package/presentation-readers.d.ts +61 -0
  50. package/dist/package/primitive-readers.d.ts +678 -0
  51. package/dist/package/readers.d.ts +230 -0
  52. package/dist/package/template-readers.d.ts +37 -0
  53. package/dist/package/workflow-readers.d.ts +167 -0
  54. package/dist/release/archive.d.ts +11 -0
  55. package/dist/release/manifest.d.ts +66 -0
  56. package/dist/release/paths.d.ts +5 -0
  57. package/dist/release/stored-manifest.d.ts +13 -0
  58. package/dist/schema/forms.d.ts +117 -0
  59. package/dist/schema/knowledge-record.d.ts +16 -0
  60. package/dist/schema/normalization.d.ts +7 -0
  61. package/dist/schema/profiles.d.ts +45 -0
  62. package/dist/schema/projection.d.ts +59 -0
  63. package/dist/schema/source.d.ts +65 -0
  64. package/package.json +46 -4
@@ -0,0 +1,230 @@
1
+ import type { JsonObject, JsonValue } from "../foundation/json.js";
2
+ import type * as F from "../schema/forms.js";
3
+ import type { JsonSchemaDocument, PackageSchemaProjection } from "../schema/projection.js";
4
+ export type ReadValue<A> = (value: unknown, path: string) => A;
5
+ export type Fields<A> = {
6
+ readonly [K in keyof A]-?: ReadValue<A[K]>;
7
+ };
8
+ export declare const invalid: (path: string) => never;
9
+ export declare const string: ReadValue<string>;
10
+ export declare const identity: ReadValue<string>;
11
+ export declare const hostedIdentity: ReadValue<string>;
12
+ export declare const assertDenseArrays: (value: unknown, path: string, seen: WeakSet<object>) => void;
13
+ export declare const boolean: ReadValue<boolean>;
14
+ export declare const number: ReadValue<number>;
15
+ export declare const positiveSafeInteger: ReadValue<number>;
16
+ export declare const optional: <A>(read: ReadValue<A>) => ReadValue<A | undefined>;
17
+ export declare const nullable: <A>(read: ReadValue<A>) => ReadValue<A | null>;
18
+ export declare const literal: <const A extends string | number>(...values: readonly A[]) => ReadValue<A>;
19
+ export declare const array: <A>(read: ReadValue<A>) => ReadValue<readonly A[]>;
20
+ export declare const record: <A>(read: ReadValue<A>) => ReadValue<Readonly<Record<string, A>>>;
21
+ export declare const object: <A extends object>(fields: Fields<A>) => ReadValue<A & JsonObject>;
22
+ /** Rejects a structurally valid value that breaks a cross-field rule. */
23
+ export declare const refine: <A>(read: ReadValue<A>, violation: (value: A) => string | undefined) => ReadValue<A>;
24
+ export declare const strings: ReadValue<readonly string[]>;
25
+ export declare const optString: ReadValue<string | undefined>;
26
+ export declare const optBoolean: ReadValue<boolean | undefined>;
27
+ export declare const optNumber: ReadValue<number | undefined>;
28
+ export declare const optStrings: ReadValue<readonly string[] | undefined>;
29
+ export declare const json: ReadValue<JsonValue>;
30
+ export declare const jsonObject: ReadValue<Readonly<Record<string, JsonValue>>>;
31
+ export declare const base: {
32
+ description: ReadValue<string | undefined>;
33
+ displayName: ReadValue<string>;
34
+ fqn: ReadValue<string>;
35
+ icon: ReadValue<string | undefined>;
36
+ tags: ReadValue<readonly string[] | undefined>;
37
+ version: ReadValue<string>;
38
+ };
39
+ export declare const union: <A, B>(left: ReadValue<A>, right: ReadValue<B>) => ReadValue<A | B>;
40
+ export declare const schemaDocument: ReadValue<JsonSchemaDocument>;
41
+ export declare const schema: ReadValue<Readonly<{
42
+ dialect: typeof import("../index.js").Draft202012Dialect;
43
+ document: JsonSchemaDocument;
44
+ fidelity: import("../index.js").ProjectionFidelity;
45
+ }> & JsonObject>;
46
+ /**
47
+ * Wraps an untrusted bare Draft 2020-12 JSON Schema object, such as a catalog
48
+ * entry's unwrapped `configSchema`, as a `PackageSchemaProjection`. The
49
+ * schema's provenance is unknown, so fidelity defaults to `structural`.
50
+ */
51
+ export declare const parseJsonSchemaProjection: (value: unknown, fidelity?: PackageSchemaProjection["fidelity"]) => PackageSchemaProjection;
52
+ export declare const visibility: ReadValue<Readonly<{
53
+ field: string;
54
+ equals?: JsonValue;
55
+ notEquals?: JsonValue;
56
+ in?: readonly JsonValue[];
57
+ notIn?: readonly JsonValue[];
58
+ isSet?: boolean;
59
+ isNotSet?: boolean;
60
+ }> & JsonObject>;
61
+ export declare const visibilityRule: ReadValue<Readonly<{
62
+ visibleWhen: Readonly<{
63
+ field: string;
64
+ equals?: JsonValue;
65
+ notEquals?: JsonValue;
66
+ in?: readonly JsonValue[];
67
+ notIn?: readonly JsonValue[];
68
+ isSet?: boolean;
69
+ isNotSet?: boolean;
70
+ }> | readonly Readonly<{
71
+ field: string;
72
+ equals?: JsonValue;
73
+ notEquals?: JsonValue;
74
+ in?: readonly JsonValue[];
75
+ notIn?: readonly JsonValue[];
76
+ isSet?: boolean;
77
+ isNotSet?: boolean;
78
+ }>[];
79
+ logic?: "and" | "or";
80
+ }> & JsonObject>;
81
+ export declare const validationRule: ReadValue<F.FieldValidationRule>;
82
+ export declare const selectOption: ReadValue<Readonly<{
83
+ value: string;
84
+ label?: string;
85
+ locked?: boolean;
86
+ }> & JsonObject>;
87
+ export declare const selectOptions: ReadValue<Readonly<{
88
+ options?: readonly (string | Readonly<{
89
+ value: string;
90
+ label?: string;
91
+ locked?: boolean;
92
+ }>)[];
93
+ allowCustom?: boolean;
94
+ searchable?: boolean;
95
+ allowClear?: boolean;
96
+ dataSource?: string;
97
+ dependencies?: readonly string[];
98
+ submit?: boolean;
99
+ readonlyOnUpdate?: boolean;
100
+ preventSaveWhenEmpty?: boolean;
101
+ selectionMetadataField?: string;
102
+ aiFill?: Readonly<{
103
+ prompt: string;
104
+ buttonLabel?: string;
105
+ retryable?: boolean;
106
+ }>;
107
+ }> & JsonObject>;
108
+ export declare const fieldUi: ReadValue<Readonly<{
109
+ "ui:widget"?: F.FormWidget;
110
+ "ui:placeholder"?: string;
111
+ "ui:help"?: string;
112
+ "ui:disabled"?: boolean;
113
+ "ui:readonly"?: boolean;
114
+ "ui:order"?: number;
115
+ "ui:suggestedName"?: string;
116
+ "ui:validation"?: readonly F.FieldValidationRule[];
117
+ "ui:options"?: Readonly<{
118
+ options?: readonly (string | Readonly<{
119
+ value: string;
120
+ label?: string;
121
+ locked?: boolean;
122
+ }>)[];
123
+ allowCustom?: boolean;
124
+ searchable?: boolean;
125
+ allowClear?: boolean;
126
+ dataSource?: string;
127
+ dependencies?: readonly string[];
128
+ submit?: boolean;
129
+ readonlyOnUpdate?: boolean;
130
+ preventSaveWhenEmpty?: boolean;
131
+ selectionMetadataField?: string;
132
+ aiFill?: Readonly<{
133
+ prompt: string;
134
+ buttonLabel?: string;
135
+ retryable?: boolean;
136
+ }>;
137
+ }>;
138
+ }> & JsonObject>;
139
+ export declare const formItems: ReadValue<readonly (string | (Readonly<{
140
+ md: string;
141
+ }> & JsonObject))[]>;
142
+ export declare const form: ReadValue<Readonly<{
143
+ createSteps?: readonly Readonly<{
144
+ id: string;
145
+ title: string;
146
+ description?: string | null;
147
+ includeInBasicInfo?: boolean | null;
148
+ items: readonly F.FormSectionItem<string>[];
149
+ visibility?: Readonly<{
150
+ visibleWhen: Readonly<{
151
+ field: string;
152
+ equals?: JsonValue;
153
+ notEquals?: JsonValue;
154
+ in?: readonly JsonValue[];
155
+ notIn?: readonly JsonValue[];
156
+ isSet?: boolean;
157
+ isNotSet?: boolean;
158
+ }> | readonly Readonly<{
159
+ field: string;
160
+ equals?: JsonValue;
161
+ notEquals?: JsonValue;
162
+ in?: readonly JsonValue[];
163
+ notIn?: readonly JsonValue[];
164
+ isSet?: boolean;
165
+ isNotSet?: boolean;
166
+ }>[];
167
+ logic?: "and" | "or";
168
+ }> | null;
169
+ }>[];
170
+ layout?: F.FormLayout;
171
+ uiSchema?: Partial<Record<string, Readonly<{
172
+ "ui:widget"?: F.FormWidget;
173
+ "ui:placeholder"?: string;
174
+ "ui:help"?: string;
175
+ "ui:disabled"?: boolean;
176
+ "ui:readonly"?: boolean;
177
+ "ui:order"?: number;
178
+ "ui:suggestedName"?: string;
179
+ "ui:validation"?: readonly F.FieldValidationRule[];
180
+ "ui:options"?: Readonly<{
181
+ options?: readonly (string | Readonly<{
182
+ value: string;
183
+ label?: string;
184
+ locked?: boolean;
185
+ }>)[];
186
+ allowCustom?: boolean;
187
+ searchable?: boolean;
188
+ allowClear?: boolean;
189
+ dataSource?: string;
190
+ dependencies?: readonly string[];
191
+ submit?: boolean;
192
+ readonlyOnUpdate?: boolean;
193
+ preventSaveWhenEmpty?: boolean;
194
+ selectionMetadataField?: string;
195
+ aiFill?: Readonly<{
196
+ prompt: string;
197
+ buttonLabel?: string;
198
+ retryable?: boolean;
199
+ }>;
200
+ }>;
201
+ }>>>;
202
+ updateSections?: readonly Readonly<{
203
+ title?: string | null;
204
+ description?: string | null;
205
+ items: readonly F.FormSectionItem<string>[];
206
+ layout?: F.FormLayout | null;
207
+ }>[];
208
+ visibility?: Partial<Record<string, Readonly<{
209
+ visibleWhen: Readonly<{
210
+ field: string;
211
+ equals?: JsonValue;
212
+ notEquals?: JsonValue;
213
+ in?: readonly JsonValue[];
214
+ notIn?: readonly JsonValue[];
215
+ isSet?: boolean;
216
+ isNotSet?: boolean;
217
+ }> | readonly Readonly<{
218
+ field: string;
219
+ equals?: JsonValue;
220
+ notEquals?: JsonValue;
221
+ in?: readonly JsonValue[];
222
+ notIn?: readonly JsonValue[];
223
+ isSet?: boolean;
224
+ isNotSet?: boolean;
225
+ }>[];
226
+ logic?: "and" | "or";
227
+ }>>>;
228
+ }> & Readonly<{
229
+ schema: PackageSchemaProjection;
230
+ }> & JsonObject>;
@@ -0,0 +1,37 @@
1
+ import type { DatasetDefinition } from "../components/datasets.js";
2
+ export declare const datasetBlueprint: import("./readers.js").ReadValue<Readonly<{
3
+ description?: string;
4
+ displayName: string;
5
+ fqn: string;
6
+ icon?: string;
7
+ kind: "datasetBlueprint";
8
+ tags?: readonly string[];
9
+ version: string;
10
+ }> & Readonly<{
11
+ blueprintVersion: number;
12
+ configuration?: import("../index.js").JsonObject;
13
+ definition: DatasetDefinition;
14
+ templateFqn: string;
15
+ }> & import("../index.js").JsonObject>;
16
+ export declare const datasetTableTemplate: import("./readers.js").ReadValue<Readonly<{
17
+ description?: string;
18
+ displayName: string;
19
+ fqn: string;
20
+ icon?: string;
21
+ kind: "datasetTableTemplate";
22
+ tags?: readonly string[];
23
+ version: string;
24
+ }> & Readonly<{
25
+ admittedIngestionModes: readonly import("../index.js").DatasetIngestMode[];
26
+ compatibleProviderFqns: readonly string[];
27
+ configuration: import("../index.js").PackageSchemaProjection;
28
+ identity: Readonly<{
29
+ keyRoles: readonly import("../index.js").DatasetTableTemplateSemanticRole[];
30
+ uniqueness: import("../index.js").DatasetTableTemplateUniqueness;
31
+ }>;
32
+ indexHints: readonly import("../index.js").DatasetTableTemplateHint[];
33
+ partitionHints: readonly import("../index.js").DatasetTableTemplateHint[];
34
+ physicalCode: import("../index.js").DatasetTableTemplatePhysicalCode;
35
+ requirements: import("../index.js").PackageSchemaProjection;
36
+ semanticRoles: readonly import("../index.js").DatasetTableTemplateSemanticRole[];
37
+ }> & import("../index.js").JsonObject>;
@@ -0,0 +1,167 @@
1
+ import type { JsonObject } from "../foundation/json.js";
2
+ import type { ReadValue } from "./readers.js";
3
+ import * as W from "../components/workflows.js";
4
+ export declare const dynamicPort: ReadValue<Readonly<{
5
+ configPath: string;
6
+ defaultIdPath?: string;
7
+ idPath: string;
8
+ requiredPath?: string;
9
+ schemaPath?: string;
10
+ }> & JsonObject>;
11
+ export declare const editorField: ReadValue<Readonly<{
12
+ binding: W.WorkflowFieldBindingDeclaration;
13
+ fieldConfig?: JsonObject;
14
+ fieldFqn?: string;
15
+ fieldVersion?: string;
16
+ help?: import("../index.js").LocalizedFieldText;
17
+ label?: import("../index.js").LocalizedFieldText;
18
+ optionSource?: W.WorkflowEditorOptionSource;
19
+ order?: number;
20
+ placeholder?: import("../index.js").LocalizedFieldText;
21
+ readOnly?: boolean;
22
+ required?: boolean;
23
+ resolutionPhase: "runtime" | "structural";
24
+ sensitive?: boolean;
25
+ valueSources: readonly W.WorkflowEditorValueSource[];
26
+ visibleWhen?: readonly W.WorkflowEditorVisibilityRule[];
27
+ widget?: W.WorkflowEditorWidget;
28
+ }> & JsonObject>;
29
+ /** Validates an untrusted trigger activation payload from a component catalog. */
30
+ export declare const parseWorkflowTriggerActivation: (value: unknown) => W.WorkflowTriggerActivationDeclaration;
31
+ /** Validates a dependency projection read from a persisted node declaration. */
32
+ export declare const parseWorkflowReusableDependency: (value: unknown) => W.WorkflowReusableDependencyDeclaration;
33
+ export declare const nodeContract: ReadValue<Readonly<{
34
+ capabilityComposition?: Readonly<{
35
+ capability: string;
36
+ fragments: readonly string[];
37
+ selector: Readonly<{
38
+ path: readonly (number | string)[];
39
+ target: "parameter";
40
+ }>;
41
+ }>;
42
+ configSchema?: import("../index.js").PackageSchemaProjection;
43
+ connectionRequirements?: readonly W.WorkflowConnectionRequirementDeclaration[];
44
+ dynamicPorts?: Readonly<{
45
+ input?: W.WorkflowDynamicPortDeclaration;
46
+ output?: W.WorkflowDynamicPortDeclaration;
47
+ }>;
48
+ editor?: W.WorkflowEditorDeclaration;
49
+ execution?: W.WorkflowNodeExecutionContract;
50
+ implementationId: string;
51
+ inputSchema?: import("../index.js").PackageSchemaProjection;
52
+ instancePolicy?: W.WorkflowNodeInstancePolicy;
53
+ nodeCollectionFqn?: string;
54
+ nodeCollectionVersion?: string;
55
+ outputChannels?: readonly W.WorkflowOutputChannelDeclaration[];
56
+ outputSchema?: import("../index.js").PackageSchemaProjection;
57
+ ports?: readonly W.WorkflowNodePortDeclaration[];
58
+ reusableDependency?: W.WorkflowReusableDependencyDeclaration;
59
+ triggerActivation?: W.WorkflowTriggerActivationDeclaration;
60
+ }> & JsonObject>;
61
+ export declare const fieldContract: ReadValue<Readonly<{
62
+ availableForInput?: boolean;
63
+ availableForOutput?: boolean;
64
+ clearOnDependencyChange?: boolean;
65
+ optionDependencies?: readonly Readonly<{
66
+ path: readonly (number | string)[];
67
+ target: "parameter" | "part" | "value";
68
+ }>[];
69
+ valueSchema?: import("../index.js").PackageSchemaProjection;
70
+ }> & JsonObject>;
71
+ export declare const graphSchema: ReadValue<Readonly<{
72
+ bindings?: readonly Readonly<{
73
+ extensions: JsonObject;
74
+ }>[];
75
+ fieldProjections: readonly Readonly<{
76
+ source: readonly (number | string)[];
77
+ target: readonly (number | string)[];
78
+ }>[];
79
+ schema: import("../index.js").PackageSchemaProjection;
80
+ }> & JsonObject>;
81
+ export declare const graphBoundary: ReadValue<Readonly<{
82
+ templateFqn: string;
83
+ templateVersion: string;
84
+ }> & JsonObject>;
85
+ export declare const graph: ReadValue<Readonly<{
86
+ edges: readonly Readonly<{
87
+ id: string;
88
+ source: string;
89
+ target: string;
90
+ extensions?: JsonObject;
91
+ }>[];
92
+ inputBoundary: Readonly<{
93
+ templateFqn: string;
94
+ templateVersion: string;
95
+ }>;
96
+ inputContract: W.WorkflowTemplateGraphSchemaContract;
97
+ metadata: Readonly<{
98
+ description: string | null;
99
+ tags: readonly string[];
100
+ templateSource: string | null;
101
+ }>;
102
+ nodes: readonly Readonly<{
103
+ id: string;
104
+ templateFqn: string;
105
+ templateVersion: string;
106
+ extensions?: JsonObject;
107
+ }>[];
108
+ outputBoundary: Readonly<{
109
+ templateFqn: string;
110
+ templateVersion: string;
111
+ }>;
112
+ outputContract: W.WorkflowTemplateGraphSchemaContract;
113
+ triggers: readonly Readonly<{
114
+ config: Readonly<{
115
+ extensions?: JsonObject;
116
+ }>;
117
+ id: string;
118
+ inputBindings: Readonly<Record<string, string>>;
119
+ invocation: Readonly<{
120
+ mode: "attach" | "detach";
121
+ timeoutMs: number | null;
122
+ }>;
123
+ metadata: Readonly<{
124
+ fieldDisplayValues: Readonly<Record<string, string>>;
125
+ }>;
126
+ settings: Readonly<{
127
+ enabled: boolean;
128
+ }>;
129
+ templateFqn: string;
130
+ templateVersion: string;
131
+ }>[];
132
+ version: 1;
133
+ }> & JsonObject>;
134
+ export declare const uiLayout: ReadValue<Readonly<{
135
+ edges: Readonly<Record<string, Readonly<{
136
+ extensions?: JsonObject;
137
+ }>>>;
138
+ nodes: Readonly<Record<string, Readonly<{
139
+ position?: Readonly<{
140
+ x: number;
141
+ y: number;
142
+ }>;
143
+ }>>>;
144
+ version: 1;
145
+ viewport: Readonly<{
146
+ x: number;
147
+ y: number;
148
+ zoom: number;
149
+ }> | null;
150
+ }> & JsonObject>;
151
+ export declare const authoringDefinition: ReadValue<Readonly<{
152
+ edges: readonly W.WorkflowAuthoringEdge[];
153
+ inputBoundary: W.WorkflowAuthoringTemplateRef;
154
+ inputContract: W.WorkflowAuthoringInputContract;
155
+ metadata: JsonObject;
156
+ nodes: readonly W.WorkflowAuthoringNode[];
157
+ outputBoundary: W.WorkflowAuthoringTemplateRef;
158
+ outputContract: W.WorkflowAuthoringOutputContract;
159
+ triggers: readonly W.WorkflowAuthoringTrigger[];
160
+ version: 1;
161
+ }> & JsonObject>;
162
+ /**
163
+ * Decodes an untrusted workflow node contract, such as a catalog entry's
164
+ * `contract`, with the same validation as package manifest admission. Throws
165
+ * a `TypeError` naming the first invalid location.
166
+ */
167
+ export declare const parseWorkflowNodeContract: (value: unknown) => W.WorkflowNodeContract;
@@ -0,0 +1,11 @@
1
+ import type { JsonValue } from "../foundation/json.js";
2
+ import type { ExtensionReleaseArchiveEntry, ExtensionReleaseManifest } from "./manifest.js";
3
+ /** Parses the deterministic runtime-and-declarations ustar archive at the public release seam. */
4
+ export declare const parseExtensionReleaseArchive: (archiveBytes: Uint8Array) => readonly ExtensionReleaseArchiveEntry[];
5
+ /**
6
+ * Verifies retained declarations against immutable archive bytes and returns
7
+ * runtime entries. Stored releases pass their stored declarations verbatim.
8
+ */
9
+ export declare const validateExtensionReleaseArchiveMetadata: (entries: readonly ExtensionReleaseArchiveEntry[], manifest: ExtensionReleaseManifest | Readonly<{
10
+ packageManifest?: JsonValue;
11
+ }>) => readonly ExtensionReleaseArchiveEntry[];
@@ -0,0 +1,66 @@
1
+ import type { BackendExecutionLane, ExtensionHost, FrontendCatalogContract, FrontendCatalogExportName } from "../hosted/contributions.js";
2
+ import type { PackageManifest } from "../package/manifest.js";
3
+ export declare const ExtensionReleaseManifestVersion: "v2";
4
+ export type ExtensionReleaseAsset = Readonly<{
5
+ digest: string;
6
+ host: ExtensionHost;
7
+ path: string;
8
+ privateSourceMap?: Readonly<{
9
+ digest: string;
10
+ size: number;
11
+ }>;
12
+ size: number;
13
+ }>;
14
+ type ExtensionReleaseContributionBase = Readonly<{
15
+ assetPath: string;
16
+ digest: string;
17
+ fqn: string;
18
+ size: number;
19
+ }>;
20
+ export type ExtensionReleaseContribution = (ExtensionReleaseContributionBase & Readonly<{
21
+ contract?: string;
22
+ execution?: BackendExecutionLane;
23
+ exportName: string;
24
+ host: "backend";
25
+ }>) | (ExtensionReleaseContributionBase & Readonly<{
26
+ contract: FrontendCatalogContract;
27
+ exportName: FrontendCatalogExportName;
28
+ host: "dashboard" | "studio";
29
+ }>);
30
+ /** Product-authoritative, JSON-only description of one immutable release. */
31
+ export type ExtensionReleaseManifest = Readonly<{
32
+ apiVersion: typeof ExtensionReleaseManifestVersion;
33
+ assets: readonly ExtensionReleaseAsset[];
34
+ compatibility: Readonly<Record<string, string>>;
35
+ contributions: readonly ExtensionReleaseContribution[];
36
+ package: Readonly<{
37
+ fqn: string;
38
+ version: string;
39
+ }>;
40
+ packageManifest?: PackageManifest;
41
+ releaseDigest: string;
42
+ }>;
43
+ /** Private diagnostic sidecar bytes, keyed to their public runtime asset digest. */
44
+ export type ExtensionReleasePrivateSourceMap = Readonly<{
45
+ bytes: Uint8Array;
46
+ digest: string;
47
+ runtimeAssetDigest: string;
48
+ size: number;
49
+ }>;
50
+ export type BuildAttemptResult = Readonly<{
51
+ archiveBytes: Uint8Array;
52
+ manifest: ExtensionReleaseManifest;
53
+ manifestBytes: Uint8Array;
54
+ packageManifest: PackageManifest;
55
+ packageManifestBytes: Uint8Array;
56
+ privateSourceMaps: readonly ExtensionReleasePrivateSourceMap[];
57
+ releaseDigest: string;
58
+ }>;
59
+ export type ExtensionReleaseArchiveEntry = Readonly<{
60
+ bytes: Uint8Array;
61
+ path: string;
62
+ }>;
63
+ /** Parses the exact JSON-only authority used to verify an immutable release. */
64
+ export declare const parseExtensionReleaseManifest: (value: unknown) => ExtensionReleaseManifest;
65
+ export declare const canonicalExtensionReleaseManifest: (manifest: ExtensionReleaseManifest) => string;
66
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const assertArchivePath: (path: string) => void;
2
+ export declare const assertRuntimeAssetPath: (path: string) => void;
3
+ /** Reserved immutable declarations entry; never a runtime-loadable asset. */
4
+ export declare const PackageManifestArchivePath: "package-manifest.json";
5
+ export declare const assertReleaseArchiveEntryPath: (path: string) => void;
@@ -0,0 +1,13 @@
1
+ import type { JsonObject } from "../foundation/json.js";
2
+ import type { ExtensionReleaseManifest } from "./manifest.js";
3
+ /**
4
+ * Returns a stored release manifest whose retained primitive declarations use
5
+ * the current spelling: current kind names, and an Agent `audience` in place
6
+ * of `invokingApplicationFqns`. The mapping is a one-to-one rename of
7
+ * retired spellings; every other value is returned as is. A reader that
8
+ * executes the release archive compares the verbatim stored JSON with the
9
+ * archive before it calls this function.
10
+ */
11
+ export declare const withCurrentPrimitiveKinds: (stored: JsonObject) => JsonObject;
12
+ /** Parses an immutable stored release manifest with current primitive spelling. */
13
+ export declare const parseStoredExtensionReleaseManifest: (stored: unknown) => ExtensionReleaseManifest;
@@ -0,0 +1,117 @@
1
+ import type { JsonValue } from "../foundation/json.js";
2
+ import type { PackageSchemaProjection } from "./projection.js";
3
+ import type { PackageDecoderSource } from "./source.js";
4
+ export type FormLayout = "stacked" | "two_column";
5
+ /**
6
+ * Renderer identifier owned by the consuming product. It remains open so
7
+ * external packages can declare their own widget implementations.
8
+ */
9
+ export type FormWidget = string;
10
+ export type FieldValidationRule = Readonly<{
11
+ type: "required";
12
+ code?: string;
13
+ message?: string;
14
+ }> | Readonly<{
15
+ type: "min_length" | "max_length" | "min" | "max";
16
+ value: number;
17
+ code?: string;
18
+ message?: string;
19
+ }> | Readonly<{
20
+ type: "pattern";
21
+ value: string;
22
+ code?: string;
23
+ message?: string;
24
+ }> | Readonly<{
25
+ type: "integer" | "json" | "non_empty_array";
26
+ code?: string;
27
+ message?: string;
28
+ }>;
29
+ export type SelectOption = Readonly<{
30
+ value: string;
31
+ label?: string;
32
+ locked?: boolean;
33
+ }>;
34
+ export type DynamicFormAiFillConfig = Readonly<{
35
+ prompt: string;
36
+ buttonLabel?: string;
37
+ retryable?: boolean;
38
+ }>;
39
+ /**
40
+ * Package-owned, serializable select-control options. The renderer may add
41
+ * runtime-only resolution metadata separately, but package declarations use
42
+ * only this protocol.
43
+ */
44
+ export type SelectOptions<Field extends string = string> = Readonly<{
45
+ options?: readonly (string | SelectOption)[];
46
+ allowCustom?: boolean;
47
+ searchable?: boolean;
48
+ allowClear?: boolean;
49
+ dataSource?: string;
50
+ dependencies?: readonly Field[];
51
+ submit?: boolean;
52
+ readonlyOnUpdate?: boolean;
53
+ preventSaveWhenEmpty?: boolean;
54
+ selectionMetadataField?: Field;
55
+ aiFill?: DynamicFormAiFillConfig;
56
+ }>;
57
+ export type VisibilityCondition<Field extends string = string> = Readonly<{
58
+ field: Field;
59
+ equals?: JsonValue;
60
+ notEquals?: JsonValue;
61
+ in?: readonly JsonValue[];
62
+ notIn?: readonly JsonValue[];
63
+ isSet?: boolean;
64
+ isNotSet?: boolean;
65
+ }>;
66
+ export type FieldVisibilityRule<Field extends string = string> = Readonly<{
67
+ visibleWhen: VisibilityCondition<Field> | readonly VisibilityCondition<Field>[];
68
+ logic?: "and" | "or";
69
+ }>;
70
+ export type FieldUiSchema<Field extends string = string> = Readonly<{
71
+ "ui:widget"?: FormWidget;
72
+ "ui:placeholder"?: string;
73
+ "ui:help"?: string;
74
+ "ui:disabled"?: boolean;
75
+ "ui:readonly"?: boolean;
76
+ "ui:order"?: number;
77
+ "ui:suggestedName"?: string;
78
+ "ui:validation"?: readonly FieldValidationRule[];
79
+ "ui:options"?: SelectOptions<Field>;
80
+ }>;
81
+ export type FormMarkdownBlock = Readonly<{
82
+ md: string;
83
+ }>;
84
+ export type FormSectionItem<Field extends string = string> = Field | FormMarkdownBlock;
85
+ export type FormSection<Field extends string = string> = Readonly<{
86
+ title?: string | null;
87
+ description?: string | null;
88
+ items: readonly FormSectionItem<Field>[];
89
+ layout?: FormLayout | null;
90
+ }>;
91
+ export type FormStep<Field extends string = string> = Readonly<{
92
+ id: string;
93
+ title: string;
94
+ description?: string | null;
95
+ includeInBasicInfo?: boolean | null;
96
+ items: readonly FormSectionItem<Field>[];
97
+ visibility?: FieldVisibilityRule<Field> | null;
98
+ }>;
99
+ /**
100
+ * JSON-only form contract. Schema-library adapters belong here so package
101
+ * authors can declare validation once without coupling declarations to a
102
+ * backend framework.
103
+ */
104
+ export type FormSchemaSource = PackageDecoderSource;
105
+ export type FormMetadata<Field extends string> = Readonly<{
106
+ createSteps?: readonly FormStep<Field>[];
107
+ layout?: FormLayout;
108
+ uiSchema?: Partial<Record<Field, FieldUiSchema<Field>>>;
109
+ updateSections?: readonly FormSection<Field>[];
110
+ visibility?: Partial<Record<Field, FieldVisibilityRule<Field>>>;
111
+ }>;
112
+ export type FormDefinition<Field extends string = string, Schema extends FormSchemaSource = FormSchemaSource> = FormMetadata<Field> & Readonly<{
113
+ schema: Schema;
114
+ }>;
115
+ export type PortableFormDefinition<Field extends string = string> = FormMetadata<Field> & Readonly<{
116
+ schema: PackageSchemaProjection;
117
+ }>;
@@ -0,0 +1,16 @@
1
+ import type { JsonSchemaDocument } from "./projection.js";
2
+ export type KnowledgeFieldType = "boolean" | "date" | "datetime" | "number" | "string" | "string_select" | "time" | "uuid";
3
+ export type KnowledgeFieldAuthoring = Readonly<{
4
+ maximum?: number;
5
+ minLength?: number;
6
+ minimum?: number;
7
+ numberKind?: "integer";
8
+ options?: readonly string[];
9
+ required?: boolean;
10
+ type: KnowledgeFieldType;
11
+ }>;
12
+ export type KnowledgeRecordAuthoring = Readonly<{
13
+ additionalProperties?: boolean;
14
+ properties: Readonly<Record<string, KnowledgeFieldAuthoring>>;
15
+ }>;
16
+ export declare const knowledgeRecordSchema: (authoring: KnowledgeRecordAuthoring) => import("./source.js").PackageSchemaSource<unknown, unknown, JsonSchemaDocument>;
@@ -0,0 +1,7 @@
1
+ import type { JsonSchemaDocument } from "./projection.js";
2
+ /**
3
+ * Normalizes portable JSON Schema wrappers emitted by authoring adapters.
4
+ * Exact mode preserves validation constraints; it does not establish that a
5
+ * native validator has exact fidelity. Adapters remain responsible for that proof.
6
+ */
7
+ export declare const normalizeJsonSchemaProjection: (schema: JsonSchemaDocument, fidelity: "exact" | "structural") => JsonSchemaDocument;