@collective-intelligence/extensions-sdk 0.1.18 → 0.1.20

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.
@@ -1,15 +1,21 @@
1
- import type { KnowledgePolicyPredicate } from "../components/knowledge.js";
1
+ import type { KnowledgePolicyDeclaration, KnowledgePolicyPredicate } from "../components/knowledge.js";
2
2
  import type { ReadValue } from "./readers.js";
3
3
  export declare const policyPredicate: ReadValue<KnowledgePolicyPredicate>;
4
4
  export declare const policyBody: ReadValue<Readonly<{
5
5
  subjectMatch: KnowledgePolicyPredicate;
6
6
  rule?: KnowledgePolicyPredicate;
7
+ writableFields?: readonly (readonly string[])[];
7
8
  }> & import("../index.js").JsonObject>;
9
+ /** Only an allow filter policy on entities may hold a field write rule. */
10
+ export declare const fieldWriteRule: <A extends Pick<KnowledgePolicyDeclaration, "effect" | "policyBody" | "policyType" | "targetKind">>(policy: A, path: string) => A;
11
+ /** Only a policy on one entity schema may follow its relation fields. */
12
+ export declare const relationScopeRule: <A extends Pick<KnowledgePolicyDeclaration, "policyBody" | "targetKind">>(policy: A, path: string) => A;
8
13
  export declare const policyFields: {
9
14
  effect: ReadValue<"allow" | "deny">;
10
15
  policyBody: ReadValue<Readonly<{
11
16
  subjectMatch: KnowledgePolicyPredicate;
12
17
  rule?: KnowledgePolicyPredicate;
18
+ writableFields?: readonly (readonly string[])[];
13
19
  }> & import("../index.js").JsonObject>;
14
20
  policyType: ReadValue<"filter" | "gate">;
15
21
  targetFqn: ReadValue<string>;
@@ -309,7 +309,7 @@ export declare const primitives: {
309
309
  normalizesImportedData?: boolean;
310
310
  }> & JsonObject>;
311
311
  knowledgeEntitySchema: ReadValue<K.KnowledgeEntitySchemaDeclaration>;
312
- knowledgePolicy: ReadValue<Readonly<{
312
+ knowledgePolicy: (value: unknown, path: string) => Readonly<{
313
313
  description?: string;
314
314
  displayName: string;
315
315
  fqn: string;
@@ -324,7 +324,7 @@ export declare const primitives: {
324
324
  policyType: "filter" | "gate";
325
325
  priority?: number;
326
326
  targetFqn: string;
327
- }> & JsonObject>;
327
+ }> & JsonObject;
328
328
  knowledgeRelationAdapter: ReadValue<Readonly<{
329
329
  description?: string;
330
330
  displayName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@collective-intelligence/extensions-sdk",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "Framework-neutral authoring contracts for Collective Intelligence extension packages.",
5
5
  "type": "module",
6
6
  "sideEffects": false,