@collective-intelligence/extensions-sdk 0.1.10 → 0.1.12

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.
@@ -4,9 +4,13 @@ import type { KnowledgeConnectorBindingExtraConfig, KnowledgeConnectorFieldMapRu
4
4
  import type { DatasetDefinition, DatasetFilter, DatasetSourceLocation } from "./datasets.js";
5
5
  import type { KnowledgePolicyDeclaration } from "./knowledge.js";
6
6
  import type { LifecycleOptions } from "./lifecycle.js";
7
- /** A slot is supplied separately at install time, never by embedding credentials. */
7
+ /** A slot uses install input or a declared connection, never embedded credentials. */
8
8
  export type ConnectorInstanceConnection = Readonly<{
9
9
  setupKey: string;
10
+ connectionInstanceFqn?: never;
11
+ }> | Readonly<{
12
+ connectionInstanceFqn: string;
13
+ setupKey?: never;
10
14
  }>;
11
15
  export type KnowledgeConnectorInstanceSettings = Readonly<Record<string, Readonly<{
12
16
  type: "inline" | "linked";
@@ -0,0 +1,11 @@
1
+ /** Per-source authority; an omitted source uses the declaration's own kind. */
2
+ export type DataAccess<Own extends "agent" | "skill" | "workflow"> = Readonly<{
3
+ datasets?: "user" | Own;
4
+ documents?: "user" | Own;
5
+ knowledge?: "user" | Own;
6
+ }>;
7
+ export declare const assertDataAccess: <Own extends "agent" | "skill" | "workflow">(value: unknown, own: Own, location: string) => asserts value is DataAccess<Own> | undefined;
8
+ /** Internal manifest reader, sharing declaration admission rules. */
9
+ export declare const readDataAccess: <Own extends "agent" | "skill" | "workflow">(own: Own) => (value: unknown, location: string) => DataAccess<Own> | undefined;
10
+ /** Reconcile the declaration and pinned graph as one Workflow setting. */
11
+ export declare const workflowDataAccess: (outer: DataAccess<"workflow"> | undefined, inner: DataAccess<"workflow"> | undefined, location: string) => DataAccess<"workflow"> | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { AgentDeclaration, SkillDeclaration } from "./agents.js";
2
2
  import type { DomainDeclaration, DomainTemplateDeclaration, SkillTemplateDeclaration } from "./catalog.js";
3
+ import type { ConnectionInstanceDeclaration } from "./connection-instances.js";
3
4
  import type { KnowledgeConnectorInstanceDeclaration, DatasetConnectorInstanceDeclaration } from "./connector-instances.js";
4
5
  import type { ConnectionDeclaration, DatasetParserDeclaration, ExternalDatasetProviderDeclaration, ManagedDatasetProviderDeclaration, EmailProviderDeclaration, EventListenerDeclaration, DocumentsConnectorDeclaration, KnowledgeConnectorDeclaration, KnowledgeConnectorOAuthDeclaration, KnowledgeEntityAdapterDeclaration, KnowledgeRelationAdapterDeclaration, OrganizationSsoDeclaration, OutboundMessagingProviderDeclaration } from "./connectors.js";
5
6
  import type { ExternalAppGatewayDeclaration } from "./external-app-gateway.js";
@@ -7,8 +8,9 @@ import type { ExternalApplicationDeclaration } from "./external-application.js";
7
8
  import type { KnowledgeEntitySchemaDeclaration, KnowledgePolicyDeclaration, KnowledgeRelationSchemaDeclaration } from "./knowledge.js";
8
9
  import type { OrganizationGroupDeclaration } from "./organization-group.js";
9
10
  import type { OrganizationSettingsDeclaration } from "./organization-settings.js";
11
+ import type { ServicePrincipalDeclaration } from "./service-principal.js";
10
12
  import type { StudioAppDeclaration, StudioAppTemplateDeclaration, StudioComponentDeclaration } from "./studio.js";
11
13
  import type { DatasetBlueprintDeclaration, DatasetTableTemplateDeclaration } from "./templates.js";
12
14
  import type { FieldTransformerDeclaration, NotificationChannelDeclaration, RemoteToolCollectionDeclaration, ToolCollectionDeclaration, ToolDeclaration, ToolSettingsOptionsDeclaration } from "./tools.js";
13
15
  import type { WorkflowDeclaration, WorkflowFieldCollectionDeclaration, WorkflowFieldDeclaration, WorkflowNodeCollectionDeclaration, WorkflowNodeDeclaration, WorkflowTemplateDeclaration } from "./workflows.js";
14
- export type PackagePrimitiveDeclaration = KnowledgeConnectorInstanceDeclaration | DatasetConnectorInstanceDeclaration | AgentDeclaration | OrganizationSsoDeclaration | KnowledgeEntityAdapterDeclaration | ConnectionDeclaration | DatasetParserDeclaration | DatasetBlueprintDeclaration | DatasetTableTemplateDeclaration | ExternalDatasetProviderDeclaration | ManagedDatasetProviderDeclaration | DocumentsConnectorDeclaration | KnowledgeConnectorDeclaration | KnowledgeConnectorOAuthDeclaration | DomainDeclaration | DomainTemplateDeclaration | EmailProviderDeclaration | EventListenerDeclaration | ExternalApplicationDeclaration | ExternalAppGatewayDeclaration | FieldTransformerDeclaration | KnowledgeEntitySchemaDeclaration | KnowledgePolicyDeclaration | KnowledgeRelationSchemaDeclaration | NotificationChannelDeclaration | OrganizationGroupDeclaration | OrganizationSettingsDeclaration | OutboundMessagingProviderDeclaration | RemoteToolCollectionDeclaration | KnowledgeRelationAdapterDeclaration | SkillDeclaration | SkillTemplateDeclaration | StudioAppDeclaration | StudioAppTemplateDeclaration | StudioComponentDeclaration | ToolCollectionDeclaration | ToolSettingsOptionsDeclaration | ToolDeclaration | WorkflowDeclaration | WorkflowFieldCollectionDeclaration | WorkflowFieldDeclaration | WorkflowNodeCollectionDeclaration | WorkflowNodeDeclaration | WorkflowTemplateDeclaration;
16
+ export type PackagePrimitiveDeclaration = ConnectionInstanceDeclaration | KnowledgeConnectorInstanceDeclaration | DatasetConnectorInstanceDeclaration | AgentDeclaration | OrganizationSsoDeclaration | KnowledgeEntityAdapterDeclaration | ConnectionDeclaration | DatasetParserDeclaration | DatasetBlueprintDeclaration | DatasetTableTemplateDeclaration | ExternalDatasetProviderDeclaration | ManagedDatasetProviderDeclaration | DocumentsConnectorDeclaration | KnowledgeConnectorDeclaration | KnowledgeConnectorOAuthDeclaration | DomainDeclaration | DomainTemplateDeclaration | EmailProviderDeclaration | EventListenerDeclaration | ExternalApplicationDeclaration | ExternalAppGatewayDeclaration | FieldTransformerDeclaration | KnowledgeEntitySchemaDeclaration | KnowledgePolicyDeclaration | KnowledgeRelationSchemaDeclaration | NotificationChannelDeclaration | OrganizationGroupDeclaration | OrganizationSettingsDeclaration | OutboundMessagingProviderDeclaration | RemoteToolCollectionDeclaration | KnowledgeRelationAdapterDeclaration | ServicePrincipalDeclaration | SkillDeclaration | SkillTemplateDeclaration | StudioAppDeclaration | StudioAppTemplateDeclaration | StudioComponentDeclaration | ToolCollectionDeclaration | ToolSettingsOptionsDeclaration | ToolDeclaration | WorkflowDeclaration | WorkflowFieldCollectionDeclaration | WorkflowFieldDeclaration | WorkflowNodeCollectionDeclaration | WorkflowNodeDeclaration | WorkflowTemplateDeclaration;
@@ -8,45 +8,93 @@ export type ExternalApplicationType = "confidential" | "public";
8
8
  */
9
9
  export type ExternalApplicationConsent = "inherit" | "ask" | "skip";
10
10
  export declare const externalApplicationConsents: readonly ["inherit", "ask", "skip"];
11
- /** A User Class that an Application can admit. */
12
- export type ExternalApplicationUserClass = "internal" | "external";
13
11
  /**
14
- * An Application Role: one node of the role tree of the application. `Key` is
15
- * the union of the declared role keys; a manifest holds plain strings.
12
+ * The target list of one binding kind: `all`, or the FQNs of the targets. An
13
+ * omitted kind binds no target.
16
14
  */
17
- export type ExternalApplicationRole<Key extends string = string> = Readonly<{
15
+ export type ExternalApplicationBindingTargets<Target> = "all" | readonly Target[];
16
+ /** A Knowledge Entity Schema or Domain, with an optional row policy. */
17
+ export type ExternalApplicationKnowledgeTarget = Readonly<{
18
+ fqn: string;
19
+ policy?: string;
20
+ }>;
21
+ /** The resources that a role sees without a Grant to the user. */
22
+ export type ExternalApplicationDeclaredBindings = Readonly<{
23
+ agents?: ExternalApplicationBindingTargets<string>;
24
+ documents?: ExternalApplicationBindingTargets<string>;
25
+ knowledge?: Readonly<{
26
+ domains?: ExternalApplicationBindingTargets<ExternalApplicationKnowledgeTarget>;
27
+ schemas?: ExternalApplicationBindingTargets<ExternalApplicationKnowledgeTarget>;
28
+ }>;
29
+ skills?: ExternalApplicationBindingTargets<string>;
30
+ workflows?: ExternalApplicationBindingTargets<string>;
31
+ }>;
32
+ /**
33
+ * The fields of every External App Role. `Key` is the union of the role keys
34
+ * of the same list and `UserKey` the union of the User Role keys; a manifest
35
+ * holds plain strings.
36
+ */
37
+ export type ExternalApplicationRoleBase<Key extends string = string, UserKey extends string = string> = Readonly<{
38
+ /** Permissions that the application defines and checks itself. */
39
+ appPermissions?: readonly string[];
40
+ /** Keys of the User Roles that a holder of this role can assign. */
41
+ assignRoles?: readonly NoInfer<UserKey>[];
18
42
  key: Key;
19
- /** Key of the declared role that holds every permission of this role. */
43
+ /** Key of the declared role of the same kind that holds every permission of this role. */
20
44
  parent?: NoInfer<Key>;
21
- /** CI permissions, each one `resource:action`. */
22
- permissions: readonly string[];
45
+ /** CI permissions, each one `resource:action`; resources may be namespaced. */
46
+ platformPermissions: readonly string[];
23
47
  /** Key of a role that an earlier release declared and this one removed. */
24
48
  replaces?: string;
49
+ /** `create: true` lets a holder of this role create External App Users. */
50
+ users?: Readonly<{
51
+ create: boolean;
52
+ }>;
53
+ }>;
54
+ /**
55
+ * A User Role. User Visibility shows the resources granted to the user;
56
+ * Declared Visibility shows the `bindings` of the role.
57
+ */
58
+ export type ExternalApplicationUserRole<Key extends string = string> = ExternalApplicationRoleBase<Key, Key> & (Readonly<{
59
+ visibility: "user";
60
+ }> | Readonly<{
61
+ bindings?: ExternalApplicationDeclaredBindings;
62
+ visibility: "declared";
63
+ }>);
64
+ /** A Server Role: the role of a call that the application server makes. */
65
+ export type ExternalApplicationServerRole<Key extends string = string, UserKey extends string = string> = ExternalApplicationRoleBase<Key, UserKey> & Readonly<{
66
+ bindings?: ExternalApplicationDeclaredBindings;
25
67
  }>;
26
- /** A Declared Grant: one Group holds one role of the application. */
27
- export type ExternalApplicationGrant = Readonly<{
28
- /** FQN of the Group that holds the role, in any package. */
68
+ /** A Group Role Binding: the members of one Group hold one User Role. */
69
+ export type ExternalApplicationGroupBinding = Readonly<{
70
+ /** `direct` covers the members of the Group only; `inherited` (the default) also covers its subgroups. */
71
+ coverage?: "direct" | "inherited";
72
+ /** FQN of the Group, in any package. */
29
73
  group: string;
30
74
  lifecycle: LifecycleOptions;
31
- /** Key of a declared role of the application. */
75
+ /** Key of a declared User Role of the application. */
32
76
  role: string;
33
77
  }>;
78
+ /**
79
+ * The access model of the application. It keeps its shape: a Variable
80
+ * Reference never stands in for one of its values.
81
+ */
82
+ type ExternalApplicationAccess = Readonly<{
83
+ /** The Server Role of a server call that names no role; required with `serverRoles`. */
84
+ defaultServerRole?: string;
85
+ groupBindings?: readonly ExternalApplicationGroupBinding[];
86
+ serverRoles?: readonly ExternalApplicationServerRole[];
87
+ userRoles: readonly ExternalApplicationUserRole[];
88
+ }>;
34
89
  /**
35
90
  * Portable External App definition. Tokens and client secrets are never
36
91
  * declared here; Dashboard rotate remains the credential path.
37
92
  */
38
- export type ExternalApplicationDeclaration = PackagePrimitiveBase<"externalApplication"> & Readonly<{
39
- /**
40
- * Admitted Classes ceiling: the User Classes that an Organization admin
41
- * can admit. When absent, the application admits internal users only.
42
- */
43
- admits?: readonly ExternalApplicationUserClass[];
93
+ export type ExternalApplicationDeclaration = PackagePrimitiveBase<"externalApplication"> & ExternalApplicationAccess & Readonly<{
44
94
  allowedOrigins: readonly string[];
45
95
  applicationConsent?: ExternalApplicationConsent;
46
96
  applicationType: ExternalApplicationType;
47
97
  audience: string;
48
- /** The Declared Grants of the application. */
49
- grants?: readonly ExternalApplicationGrant[];
50
98
  lifecycle: LifecycleOptions;
51
99
  postLogoutRedirectUris: readonly string[];
52
100
  /**
@@ -56,17 +104,17 @@ export type ExternalApplicationDeclaration = PackagePrimitiveBase<"externalAppli
56
104
  primaryRedirectUri?: string;
57
105
  /** Every accepted callback, including the primary redirect URI. */
58
106
  redirectUris: readonly string[];
59
- /** The role tree of the application. */
60
- roles?: readonly ExternalApplicationRole[];
61
107
  scopes: readonly string[];
62
108
  setupInstructions?: string;
63
109
  }>;
64
- /** The access model of the application; it keeps its shape. */
65
- export type ExternalApplicationAccessKey = "admits" | "grants" | "roles";
110
+ /** The fields of the access model of the application. */
111
+ export type ExternalApplicationAccessKey = keyof ExternalApplicationAccess;
66
112
  /** The declaration as manifest readers admit it, before substitution. */
67
- export type VaryingExternalApplication = Pick<ExternalApplicationDeclaration, ExternalApplicationAccessKey> & VaryingDefinition<Omit<ExternalApplicationDeclaration, ExternalApplicationAccessKey>>;
113
+ export type VaryingExternalApplication = ExternalApplicationAccess & VaryingDefinition<Omit<ExternalApplicationDeclaration, ExternalApplicationAccessKey>>;
68
114
  /**
69
- * Shared authoring and serialized admission invariant for callbacks, the role
70
- * tree, the Admitted Classes and the Declared Grants.
115
+ * Shared authoring and serialized admission invariant for callbacks, the
116
+ * User Roles, the Server Roles with their Default Server Role and the Group
117
+ * Role Bindings. A role violation starts with the field path of the role.
71
118
  */
72
- export declare const externalApplicationViolation: ({ admits, applicationConsent, grants, primaryRedirectUri, redirectUris, roles }: Pick<VaryingExternalApplication, "admits" | "applicationConsent" | "grants" | "primaryRedirectUri" | "redirectUris" | "roles">) => string | undefined;
119
+ export declare const externalApplicationViolation: ({ applicationConsent, defaultServerRole, groupBindings, primaryRedirectUri, redirectUris, serverRoles, userRoles }: Pick<VaryingExternalApplication, "applicationConsent" | "defaultServerRole" | "groupBindings" | "primaryRedirectUri" | "redirectUris" | "serverRoles" | "userRoles">) => string | undefined;
120
+ export {};
@@ -119,23 +119,44 @@ type KnowledgeRelationBaseFilter = Readonly<{
119
119
  * its value holds Entity References to entities of exactly one target schema
120
120
  * of the same organization. The schema does not define the property: the
121
121
  * platform generates it. `onDelete` defaults to `clear`; without `maxItems` a
122
- * `many` field has no item limit. `display.fields` label a referenced entity,
122
+ * list-shaped owner has no item limit. `display.fields` label a referenced entity,
123
123
  * `autocomplete.fields` are searched when picking one and
124
124
  * `autocomplete.baseFilters` (ANDed) limit the selectable targets.
125
125
  */
126
- export type KnowledgeEntityRelationField = Readonly<{
126
+ type KnowledgeOwnedRelationField = Readonly<{
127
127
  autocomplete?: Readonly<{
128
128
  baseFilters?: readonly KnowledgeRelationBaseFilter[];
129
129
  fields?: readonly KnowledgeAutocompleteFieldReference[];
130
130
  }>;
131
- cardinality: "many" | "one";
132
131
  display?: Readonly<{
133
132
  fields: readonly KnowledgeAutocompleteFieldReference[];
134
133
  }>;
135
- maxItems?: number;
136
134
  onDelete?: "clear" | "restrict";
137
135
  targetSchemaFqn: string;
136
+ inverseOf?: never;
137
+ }> & (Readonly<{
138
+ cardinality: "one_to_one" | "many_to_one";
139
+ maxItems?: never;
140
+ }> | Readonly<{
141
+ cardinality: "one_to_many" | "many_to_many";
142
+ maxItems?: number;
143
+ }>);
144
+ /** A read-only projection of one owner field; the host resolves its target and shape. */
145
+ type KnowledgeInverseRelationField = Readonly<{
146
+ inverseOf: Readonly<{
147
+ schemaFqn: string;
148
+ field: string;
149
+ }>;
150
+ display?: Readonly<{
151
+ fields: readonly KnowledgeAutocompleteFieldReference[];
152
+ }>;
153
+ autocomplete?: never;
154
+ cardinality?: never;
155
+ maxItems?: never;
156
+ onDelete?: never;
157
+ targetSchemaFqn?: never;
138
158
  }>;
159
+ export type KnowledgeEntityRelationField = KnowledgeOwnedRelationField | KnowledgeInverseRelationField;
139
160
  export type KnowledgeAutocompleteConfiguration = Readonly<{
140
161
  autocompleteFields: readonly KnowledgeAutocompleteFieldReference[];
141
162
  defaultAutocompleteFields: readonly KnowledgeAutocompleteFieldReference[];
@@ -2,16 +2,18 @@ import type { VaryingDefinition, VaryingStructure } from "../package/variables.j
2
2
  import type { PackageCodecSource, PackageDecoderSource } from "../schema/source.js";
3
3
  import type { ClassDeclaration, ClassDeclaredComponent, ComponentManifest, ComponentPresentation, DeclarationHandle, DeclarationReference, DeclaredComponent, DecoderSource, MetadataComponentManifest } from "./authoring-core.js";
4
4
  import type { DomainDeclaration, DomainTemplateDeclaration, SkillTemplateDeclaration } from "./catalog.js";
5
+ import type { ConnectionInstanceDeclaration } from "./connection-instances.js";
5
6
  import type { KnowledgeConnectorInstanceDeclaration, DatasetConnectorInstanceDeclaration } from "./connector-instances.js";
6
7
  import type { DatasetParserDeclaration, ExternalDatasetProviderDeclaration, ManagedDatasetProviderDeclaration } from "./connectors.js";
7
8
  import type { DatasetParserImplementation } from "./dataset-parser.js";
8
9
  import type { ExternalDatasetProviderImplementation, ManagedDatasetProviderImplementation } from "./datasets.js";
9
10
  import type { ExternalAppGatewayDeclaration } from "./external-app-gateway.js";
10
- import type { ExternalApplicationAccessKey, ExternalApplicationDeclaration, ExternalApplicationRole } from "./external-application.js";
11
+ import type { ExternalApplicationAccessKey, ExternalApplicationDeclaration, ExternalApplicationGroupBinding, ExternalApplicationServerRole, ExternalApplicationUserRole } from "./external-application.js";
11
12
  import type { KnowledgeEntitySchemaDeclaration, KnowledgeFieldSemantics, KnowledgeFileFieldDeclaration, KnowledgePolicyDeclaration, KnowledgeRelationSchemaDeclaration } from "./knowledge.js";
12
13
  import type { LifecycleOptions } from "./lifecycle.js";
13
14
  import type { OrganizationGroupDeclaration } from "./organization-group.js";
14
15
  import type { OrganizationSettingsDeclaration, VaryingOrganizationSettingsAuthentication, VaryingOrganizationSettingsSso } from "./organization-settings.js";
16
+ import type { ServicePrincipalDeclaration } from "./service-principal.js";
15
17
  import type { StudioAppDeclaration, StudioAppDeclarationInput, StudioAppTemplateDeclaration, StudioComponentDeclaration } from "./studio.js";
16
18
  import type { RemoteToolCollectionDeclaration, RemoteToolCollectionDefinition, ToolCollectionDeclaration } from "./tools.js";
17
19
  import type { WorkflowDeclaration, WorkflowFieldCollectionDeclaration, WorkflowNodeCollectionDeclaration, WorkflowTemplateDeclaration, WorkflowTemplateGraphDefinition } from "./workflows.js";
@@ -34,20 +36,22 @@ export declare const declareExternalDatasetProvider: <Constructor extends new ()
34
36
  export type DatasetParserClassDeclaration<Constructor extends new () => DatasetParserImplementation = new () => DatasetParserImplementation> = ClassDeclaration<DatasetParserDeclaration, Constructor>;
35
37
  export declare const declareDatasetParser: <Constructor extends new () => DatasetParserImplementation>(input: DatasetParserClassDeclaration<Constructor>) => ClassDeclaredComponent<DatasetParserDeclaration, Constructor>;
36
38
  export declare const declareDomainTemplate: (input: MetadataClassDeclaration<DomainTemplateDeclaration>) => DeclaredComponent<DomainTemplateDeclaration>;
37
- type ExternalApplicationDefinitionInput<Key extends string> = VaryingDefinition<Omit<MetadataDefinition<ExternalApplicationDeclaration>, ExternalApplicationAccessKey>> & Pick<ExternalApplicationDeclaration, "admits"> & Readonly<{
38
- grants?: readonly Readonly<{
39
+ type ExternalApplicationDefinitionInput<UserKey extends string, ServerKey extends string> = VaryingDefinition<Omit<MetadataDefinition<ExternalApplicationDeclaration>, ExternalApplicationAccessKey>> & Readonly<{
40
+ defaultServerRole?: NoInfer<ServerKey>;
41
+ groupBindings?: readonly (Omit<ExternalApplicationGroupBinding, "group" | "role"> & Readonly<{
39
42
  group: DeclarationReference<"organizationGroup">;
40
- lifecycle: LifecycleOptions;
41
- role: NoInfer<Key>;
42
- }>[];
43
- roles?: readonly ExternalApplicationRole<Key>[];
43
+ role: NoInfer<UserKey>;
44
+ }>)[];
45
+ serverRoles?: readonly ExternalApplicationServerRole<ServerKey, UserKey>[];
46
+ userRoles: readonly ExternalApplicationUserRole<UserKey>[];
44
47
  }>;
45
48
  /**
46
- * Declares an external application. `Key` is inferred from the `key` of each
47
- * declared role, so `parent` and the `role` of a Grant accept only a declared
48
- * role key.
49
+ * Declares an external application. `UserKey` and `ServerKey` are inferred
50
+ * from the `key` of each declared User Role and Server Role, so `parent`,
51
+ * `assignRoles`, `defaultServerRole` and the `role` of a Group Role Binding
52
+ * accept only a declared role key.
49
53
  */
50
- export declare const declareExternalApplication: <Key extends string>(input: MetadataClassDeclaration<ExternalApplicationDeclaration, ExternalApplicationDefinitionInput<Key>>) => DeclaredComponent<ExternalApplicationDeclaration>;
54
+ export declare const declareExternalApplication: <UserKey extends string, ServerKey extends string = never>(input: MetadataClassDeclaration<ExternalApplicationDeclaration, ExternalApplicationDefinitionInput<UserKey, ServerKey>>) => DeclaredComponent<ExternalApplicationDeclaration>;
51
55
  type OrganizationGroupDefinitionInput = Omit<MetadataDefinition<OrganizationGroupDeclaration>, "parent"> & Readonly<{
52
56
  parent?: DeclarationReference<"organizationGroup">;
53
57
  }>;
@@ -117,4 +121,13 @@ type StudioComponentDefinitionInput<Schema> = Omit<MetadataDefinition<StudioComp
117
121
  export declare const declareStudioComponent: <Schema>(input: MetadataClassDeclaration<StudioComponentDeclaration, StudioComponentDefinitionInput<Schema>>) => DeclaredComponent<StudioComponentDeclaration>;
118
122
  export declare const declareKnowledgeConnectorInstance: (input: MetadataClassDeclaration<KnowledgeConnectorInstanceDeclaration, VaryingMetadataDefinition<KnowledgeConnectorInstanceDeclaration>>) => DeclaredComponent<KnowledgeConnectorInstanceDeclaration>;
119
123
  export declare const declareDatasetConnectorInstance: (input: MetadataClassDeclaration<DatasetConnectorInstanceDeclaration, VaryingMetadataDefinition<DatasetConnectorInstanceDeclaration>>) => DeclaredComponent<DatasetConnectorInstanceDeclaration>;
124
+ /** Declares a service principal; Group ownership is checked when assembling the package. */
125
+ export declare const servicePrincipal: (input: Readonly<{
126
+ fqn: string;
127
+ name: string;
128
+ version: string;
129
+ organizationRole: ServicePrincipalDeclaration["organizationRole"];
130
+ groups: readonly DeclarationReference<"organizationGroup">[];
131
+ }>) => DeclaredComponent<ServicePrincipalDeclaration>;
132
+ export declare const declareConnectionInstance: (input: MetadataClassDeclaration<ConnectionInstanceDeclaration, VaryingMetadataDefinition<ConnectionInstanceDeclaration>>) => DeclaredComponent<ConnectionInstanceDeclaration>;
120
133
  export {};
@@ -10,7 +10,7 @@ export type OrganizationSettingsLocalMethod = Readonly<{
10
10
  domains?: readonly string[];
11
11
  enabled: boolean;
12
12
  }>;
13
- export type OrganizationSettingsSsoRole = "organization_admin" | "organization_user";
13
+ export type OrganizationSettingsSsoRole = "organization_admin" | "organization_operator" | "organization_member";
14
14
  /** One SSO provider of the Organization; credentials arrive through the slot. */
15
15
  export type OrganizationSettingsSso = Readonly<{
16
16
  connection: Readonly<{
@@ -0,0 +1,12 @@
1
+ import type { PackagePrimitiveBase } from "./base.js";
2
+ import type { PackagePrimitiveDeclaration } from "./declaration.js";
3
+ /** The Organization Role held by a declared service principal. */
4
+ export declare const servicePrincipalOrganizationRoles: readonly ["organization_admin", "organization_operator", "organization_member"];
5
+ export type ServicePrincipalOrganizationRole = (typeof servicePrincipalOrganizationRoles)[number];
6
+ export type ServicePrincipalDeclaration = PackagePrimitiveBase<"servicePrincipal"> & Readonly<{
7
+ /** FQNs of Groups declared by this package, including nested subgroups. */
8
+ groups: readonly string[];
9
+ organizationRole: ServicePrincipalOrganizationRole;
10
+ }>;
11
+ /** Group membership is package-local, regardless of the spelling of an FQN. */
12
+ export declare const assertServicePrincipalGroups: (primitives: readonly PackagePrimitiveDeclaration[]) => void;
@@ -70,6 +70,11 @@ export type PackageWorkflowNodeDirective = Readonly<{
70
70
  skillId: string;
71
71
  }> | Readonly<{
72
72
  directive: "run_code";
73
+ /**
74
+ * `trusted` asks for the host's trusted JavaScript runner. The engine
75
+ * decides from its own records whether the workflow may use it.
76
+ */
77
+ execution?: "isolated" | "trusted";
73
78
  language: "javascript" | "python";
74
79
  runtimeId: string;
75
80
  source: string;
@@ -2,6 +2,7 @@ import type { JsonObject, JsonValue } from "../foundation/json.js";
2
2
  import type { PackageSchemaProjection } from "../schema/projection.js";
3
3
  import type { PackagePrimitiveBase } from "./base.js";
4
4
  import type { CatalogTags } from "./catalog.js";
5
+ import type { DataAccess } from "./data-access.js";
5
6
  import type { LocalizedFieldText } from "./knowledge.js";
6
7
  import type { LifecycleOptions } from "./lifecycle.js";
7
8
  export type WorkflowNodeDeclaration = PackagePrimitiveBase<"workflowNode"> & Readonly<{
@@ -435,6 +436,7 @@ export type WorkflowAuthoringEdge = Readonly<{
435
436
  target: WorkflowAuthoringEdgeTarget;
436
437
  }>;
437
438
  export type WorkflowAuthoringDefinition = Readonly<{
439
+ dataAccess?: DataAccess<"workflow">;
438
440
  edges: readonly WorkflowAuthoringEdge[];
439
441
  inputBoundary: WorkflowAuthoringTemplateRef;
440
442
  inputContract: WorkflowAuthoringInputContract;
@@ -446,6 +448,7 @@ export type WorkflowAuthoringDefinition = Readonly<{
446
448
  version: 1;
447
449
  }>;
448
450
  export type WorkflowDeclaration = PackagePrimitiveBase<"workflow"> & Readonly<{
451
+ dataAccess?: DataAccess<"workflow">;
449
452
  definition: WorkflowAuthoringDefinition;
450
453
  lifecycle: LifecycleOptions;
451
454
  name: string;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export type { DataAccess } from "./components/data-access.js";
1
2
  export { buildOperationGatewayContract, readOperationGatewayContract } from "./gateway/operation-contract.js";
2
3
  export type { PortableOperationGatewayContract, OperationGatewayContractInput } from "./gateway/operation-contract.js";
3
4
  export type { ExternalAppGatewayDeclaration } from "./components/external-app-gateway.js";
@@ -19,7 +20,7 @@ export type { WorkflowNodePortsContract, WorkflowPortIssue, WorkflowPortIssueCod
19
20
  export { builtInCodeRuntimeIds } from "./components/workflow-code-runtimes.js";
20
21
  export { workflowSchemaAt } from "./components/workflow-schema.js";
21
22
  export type { WorkflowSchemaLocation } from "./components/workflow-schema.js";
22
- export { declareDatasetParser, declareDomain, declareDomainTemplate, declareExternalApplication, declareExternalAppGateway, declareExternalDatasetProvider, declareKnowledgeEntitySchema, declareKnowledgePolicy, declareKnowledgeRelationSchema, declareManagedDatasetProvider, declareOrganizationGroup, declareOrganizationSettings, declareRemoteToolCollection, declareSkillTemplate, declareStudioApp, declareStudioAppTemplate, declareStudioComponent, declareToolCollection, declareWorkflow, declareWorkflowFieldCollection, declareWorkflowNodeCollection, declareWorkflowTemplate } from "./components/metadata-authoring.js";
23
+ export { declareDatasetParser, declareDomain, declareDomainTemplate, declareExternalApplication, declareExternalAppGateway, declareExternalDatasetProvider, declareKnowledgeEntitySchema, declareKnowledgePolicy, declareKnowledgeRelationSchema, declareManagedDatasetProvider, declareOrganizationGroup, servicePrincipal, declareOrganizationSettings, declareRemoteToolCollection, declareSkillTemplate, declareStudioApp, declareStudioAppTemplate, declareStudioComponent, declareToolCollection, declareWorkflow, declareWorkflowFieldCollection, declareWorkflowNodeCollection, declareWorkflowTemplate } from "./components/metadata-authoring.js";
23
24
  export { DATASET_TABLE_TEMPLATE_PHYSICAL_CODES, DATASET_TABLE_TEMPLATE_SEMANTIC_ROLES, declareDatasetBlueprint, declareDatasetTableTemplate, rejectUnsupportedDatasetTableTemplate } from "./components/templates.js";
24
25
  export { declarePackage } from "./package/definition.js";
25
26
  export { isVariableReference, packageVariables, packageVariableTypes, packageVariableViolation, variableReference } from "./package/variables.js";
@@ -51,7 +52,7 @@ export type { BindingScope, ConnectionReference, PackagePrimitiveBase, PackagePr
51
52
  export type { LifecycleDeployMode, LifecycleOptions } from "./components/lifecycle.js";
52
53
  export type { CatalogTags, DomainDeclaration, DomainTemplateDeclaration, SkillTemplateDeclaration } from "./components/catalog.js";
53
54
  export { externalApplicationConsents, externalApplicationViolation } from "./components/external-application.js";
54
- export type { ExternalApplicationAccessKey, ExternalApplicationConsent, ExternalApplicationDeclaration, ExternalApplicationGrant, ExternalApplicationRole, ExternalApplicationType, ExternalApplicationUserClass, VaryingExternalApplication } from "./components/external-application.js";
55
+ export type { ExternalApplicationAccessKey, ExternalApplicationBindingTargets, ExternalApplicationConsent, ExternalApplicationDeclaration, ExternalApplicationDeclaredBindings, ExternalApplicationGroupBinding, ExternalApplicationKnowledgeTarget, ExternalApplicationRoleBase, ExternalApplicationServerRole, ExternalApplicationType, ExternalApplicationUserRole, VaryingExternalApplication } from "./components/external-application.js";
55
56
  export { organizationGroupFqnMaxLength, organizationGroupNodes, organizationGroupViolation } from "./components/organization-group.js";
56
57
  export type { OrganizationGroupDeclaration, OrganizationSubgroup } from "./components/organization-group.js";
57
58
  export { organizationSettingsViolation } from "./components/organization-settings.js";
@@ -81,3 +82,6 @@ export type { WorkflowEditorDerivationInput } from "./components/workflow-editor
81
82
  export { declareKnowledgeConnectorInstance, declareDatasetConnectorInstance } from "./components/metadata-authoring.js";
82
83
  export type { ConnectorInstanceConnection, KnowledgeConnectorInstanceDeclaration, DatasetConnectorInstanceDeclaration, KnowledgeConnectorInstanceSettings, KnowledgeConnectorInstanceRemoteFilters, KnowledgeConnectorInstanceBindingOptions, KnowledgeConnectorInstanceEntityBinding, KnowledgeConnectorPushEntityMatch, KnowledgeConnectorInstanceRelationBinding, KnowledgeConnectorInstancePipeline, KnowledgeConnectorInstanceSchedule, KnowledgeConnectorInstanceDataPolicy, DatasetConnectorInstanceDataPolicy, DatasetConnectorInstanceSchedule } from "./components/connector-instances.js";
83
84
  export type { KnowledgePolicyBody, KnowledgePolicyPredicate, KnowledgePolicyRef } from "./components/knowledge.js";
85
+ export type { ServicePrincipalDeclaration, ServicePrincipalOrganizationRole } from "./components/service-principal.js";
86
+ export { declareConnectionInstance } from "./components/metadata-authoring.js";
87
+ export type { ConnectionInstanceDeclaration } from "./components/connection-instances.js";