@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.
- package/README.md +1276 -2
- package/dist/components/agents.d.ts +155 -0
- package/dist/components/authoring-core.d.ts +253 -0
- package/dist/components/base.d.ts +25 -0
- package/dist/components/catalog.d.ts +21 -0
- package/dist/components/connections.d.ts +52 -0
- package/dist/components/connector-instances.d.ts +142 -0
- package/dist/components/connectors.d.ts +408 -0
- package/dist/components/dataset-parser-validation.d.ts +2 -0
- package/dist/components/dataset-parser.d.ts +74 -0
- package/dist/components/datasets.d.ts +356 -0
- package/dist/components/declaration.d.ts +12 -0
- package/dist/components/executable-authoring.d.ts +27 -0
- package/dist/components/external-app-gateway.d.ts +7 -0
- package/dist/components/external-application.d.ts +17 -0
- package/dist/components/fields.d.ts +34 -0
- package/dist/components/knowledge-remote-reference.d.ts +7 -0
- package/dist/components/knowledge.d.ts +188 -0
- package/dist/components/lifecycle.d.ts +7 -0
- package/dist/components/metadata-authoring.d.ts +66 -0
- package/dist/components/notification-channel-capabilities.d.ts +7 -0
- package/dist/components/remote-tool-collection.d.ts +3 -0
- package/dist/components/studio.d.ts +48 -0
- package/dist/components/templates.d.ts +50 -0
- package/dist/components/tools.d.ts +138 -0
- package/dist/components/workflow-editor.d.ts +28 -0
- package/dist/components/workflow-node-authoring.d.ts +4 -0
- package/dist/components/workflow-ports.d.ts +26 -0
- package/dist/components/workflow-results.d.ts +75 -0
- package/dist/components/workflow-rules.d.ts +20 -0
- package/dist/components/workflow-schema.d.ts +22 -0
- package/dist/components/workflows.d.ts +529 -0
- package/dist/foundation/json.d.ts +8 -0
- package/dist/foundation/string-order.d.ts +2 -0
- package/dist/gateway/declarations.d.ts +69 -0
- package/dist/gateway/operation-contract.d.ts +29 -0
- package/dist/hosted/contributions.d.ts +52 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +1 -0
- package/dist/package/canonical.d.ts +9 -0
- package/dist/package/connector-readers.d.ts +171 -0
- package/dist/package/definition.d.ts +31 -0
- package/dist/package/dependencies.d.ts +10 -0
- package/dist/package/instance-readers.d.ts +4 -0
- package/dist/package/knowledge-readers.d.ts +137 -0
- package/dist/package/manifest.d.ts +42 -0
- package/dist/package/parse-manifest.d.ts +3 -0
- package/dist/package/policy-readers.d.ts +17 -0
- package/dist/package/presentation-readers.d.ts +61 -0
- package/dist/package/primitive-readers.d.ts +678 -0
- package/dist/package/readers.d.ts +230 -0
- package/dist/package/template-readers.d.ts +37 -0
- package/dist/package/workflow-readers.d.ts +167 -0
- package/dist/release/archive.d.ts +11 -0
- package/dist/release/manifest.d.ts +66 -0
- package/dist/release/paths.d.ts +5 -0
- package/dist/release/stored-manifest.d.ts +13 -0
- package/dist/schema/forms.d.ts +117 -0
- package/dist/schema/knowledge-record.d.ts +16 -0
- package/dist/schema/normalization.d.ts +7 -0
- package/dist/schema/profiles.d.ts +45 -0
- package/dist/schema/projection.d.ts +59 -0
- package/dist/schema/source.d.ts +65 -0
- package/package.json +46 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { JsonSchemaDocument, PackageSchemaProjection, ProjectionFidelity } from "./projection.js";
|
|
2
|
+
export declare const ConsumerProfileIds: readonly ["runtime_json", "ai_function_input", "interactive_form", "workflow_value", "studio_props", "knowledge_record"];
|
|
3
|
+
export type ConsumerProfileId = (typeof ConsumerProfileIds)[number];
|
|
4
|
+
export declare const SchemaConsumerProfiles: Readonly<{
|
|
5
|
+
readonly automationGraphInput: "workflow_value";
|
|
6
|
+
readonly automationGraphOutput: "workflow_value";
|
|
7
|
+
readonly connectionCredential: "interactive_form";
|
|
8
|
+
readonly connectorSettings: "interactive_form";
|
|
9
|
+
readonly form: "interactive_form";
|
|
10
|
+
readonly knowledgeEntity: "knowledge_record";
|
|
11
|
+
readonly knowledgeRelation: "knowledge_record";
|
|
12
|
+
readonly notificationCredential: "interactive_form";
|
|
13
|
+
readonly studioComponentProps: "studio_props";
|
|
14
|
+
readonly toolInput: "ai_function_input";
|
|
15
|
+
readonly toolOutput: "runtime_json";
|
|
16
|
+
readonly toolSettings: "interactive_form";
|
|
17
|
+
readonly workflowConfiguration: "workflow_value";
|
|
18
|
+
readonly workflowFieldValue: "workflow_value";
|
|
19
|
+
readonly workflowInput: "workflow_value";
|
|
20
|
+
readonly workflowOutput: "workflow_value";
|
|
21
|
+
readonly workflowPortValue: "workflow_value";
|
|
22
|
+
}>;
|
|
23
|
+
export type ConsumerProfileDiagnostic = Readonly<{
|
|
24
|
+
code: "fidelity_not_supported" | "invalid_default" | "invalid_root" | "recursive_reference" | "remote_reference" | "unknown_vocabulary" | "unsupported_keyword";
|
|
25
|
+
location: string;
|
|
26
|
+
profile: ConsumerProfileId;
|
|
27
|
+
reason: string;
|
|
28
|
+
}>;
|
|
29
|
+
export type ConsumerProfile = Readonly<{
|
|
30
|
+
allowedFidelity: readonly ProjectionFidelity[];
|
|
31
|
+
allowedKeywords: readonly string[] | null;
|
|
32
|
+
id: ConsumerProfileId;
|
|
33
|
+
rootObject: boolean;
|
|
34
|
+
unsupportedKeywords: readonly string[];
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Form-field keyword: `true` on a boolean field means enabling it lifts the
|
|
38
|
+
* binding's scope restrictions. Hosts gate enabling it behind their own
|
|
39
|
+
* elevated binding authority.
|
|
40
|
+
*/
|
|
41
|
+
export declare const UnrestrictedScopeKeyword = "x-unrestricted-scope";
|
|
42
|
+
export declare const ConsumerProfiles: Readonly<Record<ConsumerProfileId, ConsumerProfile>>;
|
|
43
|
+
export declare const resolveLocalSchema: (root: JsonSchemaDocument, reference: string) => JsonSchemaDocument | undefined;
|
|
44
|
+
export declare const validateConsumerProfile: (projectionValue: PackageSchemaProjection, profileId: ConsumerProfileId, location: string) => readonly ConsumerProfileDiagnostic[];
|
|
45
|
+
export declare const assertConsumerProfile: (projectionValue: PackageSchemaProjection, profile: ConsumerProfileId, location: string) => void;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue } from "../foundation/json.js";
|
|
2
|
+
export declare const Draft202012Dialect: "https://json-schema.org/draft/2020-12/schema";
|
|
3
|
+
/** JSON-compatible Draft 2020-12 vocabulary used for portable manifests. */
|
|
4
|
+
export type JsonSchemaDocument = JsonObject & Readonly<{
|
|
5
|
+
$anchor?: string;
|
|
6
|
+
$comment?: string;
|
|
7
|
+
$defs?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
8
|
+
$dynamicAnchor?: string;
|
|
9
|
+
$dynamicRef?: string;
|
|
10
|
+
$id?: string;
|
|
11
|
+
$ref?: string;
|
|
12
|
+
$schema?: typeof Draft202012Dialect;
|
|
13
|
+
additionalProperties?: boolean | JsonSchemaDocument;
|
|
14
|
+
allOf?: readonly JsonSchemaDocument[];
|
|
15
|
+
anyOf?: readonly JsonSchemaDocument[];
|
|
16
|
+
const?: JsonValue;
|
|
17
|
+
contains?: JsonSchemaDocument;
|
|
18
|
+
default?: JsonValue;
|
|
19
|
+
dependentRequired?: Readonly<Record<string, readonly string[]>>;
|
|
20
|
+
description?: string;
|
|
21
|
+
else?: JsonSchemaDocument;
|
|
22
|
+
enum?: readonly JsonValue[];
|
|
23
|
+
exclusiveMaximum?: number;
|
|
24
|
+
exclusiveMinimum?: number;
|
|
25
|
+
format?: string;
|
|
26
|
+
if?: JsonSchemaDocument;
|
|
27
|
+
items?: JsonSchemaDocument;
|
|
28
|
+
maxItems?: number;
|
|
29
|
+
maxLength?: number;
|
|
30
|
+
maxProperties?: number;
|
|
31
|
+
maximum?: number;
|
|
32
|
+
minItems?: number;
|
|
33
|
+
minLength?: number;
|
|
34
|
+
minProperties?: number;
|
|
35
|
+
minimum?: number;
|
|
36
|
+
multipleOf?: number;
|
|
37
|
+
not?: JsonSchemaDocument;
|
|
38
|
+
oneOf?: readonly JsonSchemaDocument[];
|
|
39
|
+
pattern?: string;
|
|
40
|
+
patternProperties?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
41
|
+
prefixItems?: readonly JsonSchemaDocument[];
|
|
42
|
+
properties?: Readonly<Record<string, JsonSchemaDocument>>;
|
|
43
|
+
required?: readonly string[];
|
|
44
|
+
then?: JsonSchemaDocument;
|
|
45
|
+
title?: string;
|
|
46
|
+
type?: "array" | "boolean" | "integer" | "null" | "number" | "object" | "string" | readonly ("array" | "boolean" | "integer" | "null" | "number" | "object" | "string")[];
|
|
47
|
+
unevaluatedItems?: boolean | JsonSchemaDocument;
|
|
48
|
+
unevaluatedProperties?: boolean | JsonSchemaDocument;
|
|
49
|
+
uniqueItems?: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
export type ProjectionFidelity = "exact" | "structural";
|
|
52
|
+
export type PackageSchemaProjection = Readonly<{
|
|
53
|
+
dialect: typeof Draft202012Dialect;
|
|
54
|
+
document: JsonSchemaDocument;
|
|
55
|
+
fidelity: ProjectionFidelity;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const deepFreeze: <Value>(value: Value) => Value;
|
|
58
|
+
/** Canonicalizes and freezes a provider projection at an SDK-owned boundary. */
|
|
59
|
+
export declare const normalizePackageSchemaProjection: (value: PackageSchemaProjection) => PackageSchemaProjection;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { StandardJSONSchemaV1, StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { PackageSchemaProjection } from "./projection.js";
|
|
3
|
+
export type SchemaDirection = "input" | "output";
|
|
4
|
+
export type PackageSchemaIssue = StandardSchemaV1.Issue & Readonly<{
|
|
5
|
+
code?: string;
|
|
6
|
+
}>;
|
|
7
|
+
export type PackageSchemaResult<Value> = Readonly<{
|
|
8
|
+
issues?: undefined;
|
|
9
|
+
value: Value;
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
issues: readonly PackageSchemaIssue[];
|
|
12
|
+
}>;
|
|
13
|
+
export type PackageSchemaProjections = Readonly<{
|
|
14
|
+
input: PackageSchemaProjection;
|
|
15
|
+
output?: PackageSchemaProjection;
|
|
16
|
+
}>;
|
|
17
|
+
export type PackageDecoder<Wire, Value> = Readonly<{
|
|
18
|
+
validate: (value: unknown) => PackageSchemaResult<Value> | Promise<PackageSchemaResult<Value>>;
|
|
19
|
+
project: (target: "input") => PackageSchemaProjection;
|
|
20
|
+
readonly "~standard": StandardSchemaV1.Props<Wire, Value> & StandardJSONSchemaV1.Props<Wire, Value>;
|
|
21
|
+
}>;
|
|
22
|
+
export type PackageCodec<Wire, Value> = PackageDecoder<Wire, Value> & Readonly<{
|
|
23
|
+
encode: (value: Value) => PackageSchemaResult<Wire> | Promise<PackageSchemaResult<Wire>>;
|
|
24
|
+
project: (target: "input" | "output") => PackageSchemaProjection;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Open, provider-neutral authoring capability. Provider names are diagnostics
|
|
28
|
+
* only; consumers use the structural validate/encode/projection capabilities.
|
|
29
|
+
*/
|
|
30
|
+
export type PackageSchemaSource<Wire, Value, Native = unknown> = PackageDecoder<Wire, Value> & Readonly<{
|
|
31
|
+
encode?: (value: Value) => PackageSchemaResult<Wire> | Promise<PackageSchemaResult<Wire>>;
|
|
32
|
+
native: Native;
|
|
33
|
+
provider: string;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Erased structural input capability for heterogeneous declaration slots.
|
|
37
|
+
*
|
|
38
|
+
* The Standard Schema metadata is intentionally not part of this erased
|
|
39
|
+
* view. Its generic input/output parameters are invariant in provider
|
|
40
|
+
* implementations (for example Effect codecs), while declaration consumers
|
|
41
|
+
* only dispatch through validate/project and the native/provider diagnostics.
|
|
42
|
+
* Concrete PackageSchemaSource values retain the complete metadata contract.
|
|
43
|
+
*/
|
|
44
|
+
export type PackageDecoderSource = Omit<PackageDecoder<unknown, unknown>, "~standard"> & Pick<PackageSchemaSource<unknown, unknown>, "native" | "provider">;
|
|
45
|
+
/** Erased structural output capability; concrete codecs remain type-inferred. */
|
|
46
|
+
export type PackageCodecSource = Omit<PackageDecoderSource, "project"> & Readonly<{
|
|
47
|
+
encode: (value: never) => PackageSchemaResult<unknown> | Promise<PackageSchemaResult<unknown>>;
|
|
48
|
+
project: (target: "input" | "output") => PackageSchemaProjection;
|
|
49
|
+
}>;
|
|
50
|
+
export type PackageSchemaDefinition<Wire, Value, Native> = Readonly<{
|
|
51
|
+
encode?: (value: Value) => PackageSchemaResult<Wire> | Promise<PackageSchemaResult<Wire>>;
|
|
52
|
+
native: Native;
|
|
53
|
+
projections: PackageSchemaProjections;
|
|
54
|
+
provider: string;
|
|
55
|
+
validate: (value: unknown) => PackageSchemaResult<Value> | Promise<PackageSchemaResult<Value>>;
|
|
56
|
+
}>;
|
|
57
|
+
export declare function definePackageSchema<Wire, Value, Native>(definition: PackageSchemaDefinition<Wire, Value, Native> & Required<Pick<PackageSchemaDefinition<Wire, Value, Native>, "encode">> & Readonly<{
|
|
58
|
+
projections: Readonly<{
|
|
59
|
+
input: PackageSchemaProjection;
|
|
60
|
+
output: PackageSchemaProjection;
|
|
61
|
+
}>;
|
|
62
|
+
}>): PackageSchemaSource<Wire, Value, Native> & PackageCodec<Wire, Value>;
|
|
63
|
+
export declare function definePackageSchema<Wire, Value, Native>(definition: PackageSchemaDefinition<Wire, Value, Native>): PackageSchemaSource<Wire, Value, Native>;
|
|
64
|
+
export type SchemaWire<Source> = Source extends PackageSchemaSource<infer Wire, unknown> ? Wire : never;
|
|
65
|
+
export type SchemaValue<Source> = Source extends PackageSchemaSource<unknown, infer Value> ? Value : never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@collective-intelligence/extensions-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Framework-neutral authoring contracts for Collective Intelligence extension packages.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"README.md"
|
|
10
|
+
],
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"ci-source": "./src/index.ts",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "bun tools/build.ts",
|
|
23
|
+
"test": "bun test src tools && bun run test:pack",
|
|
24
|
+
"test:pack": "bun run build && bun tools/test-pack.ts",
|
|
25
|
+
"test:unit": "bun test src",
|
|
26
|
+
"format": "oxfmt --write .",
|
|
27
|
+
"format:check": "oxfmt --check .",
|
|
28
|
+
"format:check:staged": "oxfmt --check",
|
|
29
|
+
"lint": "node \"../../../.agents/scripts/managed-lint-runner.mjs\" --scope \"packages/public/extensions-sdk\"",
|
|
30
|
+
"lint:staged": "oxlint --no-error-on-unmatched-pattern",
|
|
31
|
+
"prepack": "bun run build",
|
|
32
|
+
"type-check": "tsc --noEmit && tsc --noEmit -p tsconfig.type-tests.json"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@standard-schema/spec": "^1.1.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@oxlint/plugins": "1.85.0",
|
|
42
|
+
"bun-types": "^1.3.14",
|
|
43
|
+
"oxfmt": "0.66.0",
|
|
44
|
+
"oxlint": "1.82.0",
|
|
45
|
+
"typescript": "^5.9.3",
|
|
46
|
+
"ultracite": "7.10.7"
|
|
47
|
+
}
|
|
48
|
+
}
|