@ixo/topic-protocol 0.8.0 → 1.0.0-rc.1

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 (54) hide show
  1. package/README.md +6 -1
  2. package/dist/schemas/decision-to-pay-template-v2.schema.json +301 -0
  3. package/dist/schemas/payable-obligation-v2.schema.json +319 -0
  4. package/dist/schemas/payment-terms-v2.schema.json +238 -0
  5. package/dist/schemas/topic-contract-body.schema.json +66 -0
  6. package/dist/schemas/topic-contract-state.schema.json +63 -295
  7. package/dist/schemas/topic-recipe.schema.json +19 -0
  8. package/dist/schemas/topic-root.schema.json +17 -1
  9. package/dist/schemas/topic-shape.schema.json +79 -0
  10. package/dist/src/contracts/schemas.d.ts +3417 -1822
  11. package/dist/src/contracts/schemas.js +12 -0
  12. package/dist/src/contracts/schemas.js.map +1 -1
  13. package/dist/src/contracts/topic-contract.d.ts +30 -5
  14. package/dist/src/contracts/topic-contract.js +3 -1
  15. package/dist/src/contracts/topic-contract.js.map +1 -1
  16. package/dist/src/errors.d.ts +1 -1
  17. package/dist/src/errors.js.map +1 -1
  18. package/dist/src/index.d.ts +10 -2
  19. package/dist/src/index.js +9 -1
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/projector/types.d.ts +9 -1
  22. package/dist/src/projector/types.js.map +1 -1
  23. package/dist/src/shapes/canonical.d.ts +2 -0
  24. package/dist/src/shapes/canonical.js +20 -0
  25. package/dist/src/shapes/canonical.js.map +1 -0
  26. package/dist/src/shapes/claims.d.ts +12 -0
  27. package/dist/src/shapes/claims.js +20 -0
  28. package/dist/src/shapes/claims.js.map +1 -0
  29. package/dist/src/shapes/now.d.ts +2 -0
  30. package/dist/src/shapes/now.js +42 -0
  31. package/dist/src/shapes/now.js.map +1 -0
  32. package/dist/src/shapes/progress.d.ts +3 -0
  33. package/dist/src/shapes/progress.js +176 -0
  34. package/dist/src/shapes/progress.js.map +1 -0
  35. package/dist/src/shapes/recipes.d.ts +5 -0
  36. package/dist/src/shapes/recipes.js +337 -0
  37. package/dist/src/shapes/recipes.js.map +1 -0
  38. package/dist/src/shapes/resolver.d.ts +14 -0
  39. package/dist/src/shapes/resolver.js +111 -0
  40. package/dist/src/shapes/resolver.js.map +1 -0
  41. package/dist/src/shapes/state.d.ts +53 -0
  42. package/dist/src/shapes/state.js +2 -0
  43. package/dist/src/shapes/state.js.map +1 -0
  44. package/dist/src/shapes/types.d.ts +241 -0
  45. package/dist/src/shapes/types.js +42 -0
  46. package/dist/src/shapes/types.js.map +1 -0
  47. package/package.json +3 -1
  48. package/recipes/README.md +12 -0
  49. package/recipes/agent-delivery.json +607 -0
  50. package/recipes/registry.json +41 -0
  51. package/recipes/research-brief.json +460 -0
  52. package/recipes/verified-work-payment.json +663 -0
  53. package/templates/decision-to-pay/README.md +27 -19
  54. package/templates/decision-to-pay/verified-work-payment.v0.2.template.json +319 -0
@@ -3,6 +3,7 @@ import agentRun from "../../schemas/agent-run.schema.json" with { type: "json" }
3
3
  import approvalDecision from "../../schemas/approval-decision.schema.json" with { type: "json" };
4
4
  import claimRecord from "../../schemas/claim-record.schema.json" with { type: "json" };
5
5
  import decisionToPayTemplate from "../../schemas/decision-to-pay-template.schema.json" with { type: "json" };
6
+ import decisionToPayTemplateV2 from "../../schemas/decision-to-pay-template-v2.schema.json" with { type: "json" };
6
7
  import deliveryDecision from "../../schemas/delivery-decision.schema.json" with { type: "json" };
7
8
  import deliveryPacket from "../../schemas/delivery-packet.schema.json" with { type: "json" };
8
9
  import evaluationAssertion from "../../schemas/evaluation-assertion.schema.json" with { type: "json" };
@@ -11,10 +12,13 @@ import externalWorkStateMap from "../../schemas/external-work-state-map.schema.j
11
12
  import externalSessionBinding from "../../schemas/external-session-binding.schema.json" with { type: "json" };
12
13
  import jobCard from "../../schemas/job-card.schema.json" with { type: "json" };
13
14
  import payableObligation from "../../schemas/payable-obligation.schema.json" with { type: "json" };
15
+ import payableObligationV2 from "../../schemas/payable-obligation-v2.schema.json" with { type: "json" };
14
16
  import paymentTerms from "../../schemas/payment-terms.schema.json" with { type: "json" };
17
+ import paymentTermsV2 from "../../schemas/payment-terms-v2.schema.json" with { type: "json" };
15
18
  import roomPolicy from "../../schemas/room-policy.schema.json" with { type: "json" };
16
19
  import settlementReceipt from "../../schemas/settlement-receipt.schema.json" with { type: "json" };
17
20
  import topicCapsule from "../../schemas/topic-capsule.schema.json" with { type: "json" };
21
+ import topicContractBody from "../../schemas/topic-contract-body.schema.json" with { type: "json" };
18
22
  import topicActionRequest from "../../schemas/topic-action-request.schema.json" with { type: "json" };
19
23
  import topicContractState from "../../schemas/topic-contract-state.schema.json" with { type: "json" };
20
24
  import topicFileAttachment from "../../schemas/topic-file-attachment.schema.json" with { type: "json" };
@@ -28,7 +32,9 @@ import topicPreferences from "../../schemas/topic-preferences.schema.json" with
28
32
  import topicRecord from "../../schemas/topic-record.schema.json" with { type: "json" };
29
33
  import topicRecordMessage from "../../schemas/topic-record-message.schema.json" with { type: "json" };
30
34
  import topicRelation from "../../schemas/topic-relation.schema.json" with { type: "json" };
35
+ import topicRecipe from "../../schemas/topic-recipe.schema.json" with { type: "json" };
31
36
  import topicRoot from "../../schemas/topic-root.schema.json" with { type: "json" };
37
+ import topicShape from "../../schemas/topic-shape.schema.json" with { type: "json" };
32
38
  import topicState from "../../schemas/topic-state.schema.json" with { type: "json" };
33
39
  import topicSourceMessage from "../../schemas/topic-source-message.schema.json" with { type: "json" };
34
40
  import workItemSnapshot from "../../schemas/work-item-snapshot.schema.json" with { type: "json" };
@@ -38,6 +44,7 @@ export const SCHEMA_REGISTRY = Object.freeze({
38
44
  "approval-decision": approvalDecision,
39
45
  "claim-record": claimRecord,
40
46
  "decision-to-pay-template": decisionToPayTemplate,
47
+ "decision-to-pay-template-v2": decisionToPayTemplateV2,
41
48
  "delivery-decision": deliveryDecision,
42
49
  "delivery-packet": deliveryPacket,
43
50
  "evaluation-assertion": evaluationAssertion,
@@ -46,10 +53,13 @@ export const SCHEMA_REGISTRY = Object.freeze({
46
53
  "external-work-state-map": externalWorkStateMap,
47
54
  "job-card": jobCard,
48
55
  "payable-obligation": payableObligation,
56
+ "payable-obligation-v2": payableObligationV2,
49
57
  "payment-terms": paymentTerms,
58
+ "payment-terms-v2": paymentTermsV2,
50
59
  "room-policy": roomPolicy,
51
60
  "settlement-receipt": settlementReceipt,
52
61
  "topic-capsule": topicCapsule,
62
+ "topic-contract-body": topicContractBody,
53
63
  "topic-action-request": topicActionRequest,
54
64
  "topic-contract-state": topicContractState,
55
65
  "topic-file-attachment": topicFileAttachment,
@@ -63,7 +73,9 @@ export const SCHEMA_REGISTRY = Object.freeze({
63
73
  "topic-record": topicRecord,
64
74
  "topic-record-message": topicRecordMessage,
65
75
  "topic-relation": topicRelation,
76
+ "topic-recipe": topicRecipe,
66
77
  "topic-root": topicRoot,
78
+ "topic-shape": topicShape,
67
79
  "topic-state": topicState,
68
80
  "topic-source-message": topicSourceMessage,
69
81
  "work-item-snapshot": workItemSnapshot,
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/contracts/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,0CAA0C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3F,OAAO,QAAQ,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,gBAAgB,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjG,OAAO,WAAW,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvF,OAAO,qBAAqB,MAAM,oDAAoD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7G,OAAO,gBAAgB,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjG,OAAO,cAAc,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CA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EAAE,UAAU;IACzB,aAAa,EAAE,UAAU;IACzB,sBAAsB,EAAE,kBAAkB;IAC1C,oBAAoB,EAAE,gBAAgB;CACvC,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CACzC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAoB,CACtD,CAAC"}
@@ -1,8 +1,13 @@
1
1
  import type { TopicKindProfileRef, TopicKindResourceBinding } from "./topic-kind-profile.js";
2
+ import type { BaseRecipeCodeV1, TopicClaimBindingV1, TopicRecipeRefV1, TopicShapeSourceRefV1 } from "../shapes/types.js";
2
3
  export declare const PERSISTED_TOPIC_KINDS: readonly ["task", "agent_task", "proposal", "evaluation", "claims", "question", "discussion", "incident"];
4
+ export declare const BASE_TOPIC_RECIPES: readonly ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"];
5
+ /** @deprecated v1 writers use BASE_TOPIC_RECIPES and the baseRecipe field. */
3
6
  export declare const TOPIC_CONTRACT_RECIPES: readonly ["project", "flow", "proposal", "evaluation", "claims", "research", "discussion", "incident"];
4
7
  export type PersistedTopicKind = (typeof PERSISTED_TOPIC_KINDS)[number];
5
- export type TopicContractRecipe = (typeof TOPIC_CONTRACT_RECIPES)[number];
8
+ export type BaseTopicRecipe = (typeof BASE_TOPIC_RECIPES)[number];
9
+ /** @deprecated v1 writers use BaseTopicRecipe. */
10
+ export type TopicContractRecipe = BaseTopicRecipe;
6
11
  export type TopicKindRef = {
7
12
  readonly source: "standard";
8
13
  readonly kind: PersistedTopicKind;
@@ -33,6 +38,13 @@ export interface TopicStatementV2 {
33
38
  readonly createdAt?: string;
34
39
  };
35
40
  }
41
+ export interface TopicFieldProvenanceV1 {
42
+ readonly basis: "explicit" | "contextual" | "inferred" | "suggested" | "retrieved";
43
+ readonly acceptance: "proposed" | "accepted" | "rejected" | "superseded";
44
+ readonly sourceEventIds: readonly string[];
45
+ readonly createdBy?: string;
46
+ readonly createdAt?: string;
47
+ }
36
48
  export type TemporalTarget = {
37
49
  readonly precision: "date";
38
50
  readonly value: string;
@@ -67,8 +79,7 @@ export interface TopicOutcomeV2 {
67
79
  readonly outcomeRecordId?: string;
68
80
  readonly abandonedReason?: string;
69
81
  }
70
- export interface TopicContractBodyV2 {
71
- readonly version: 2;
82
+ interface TopicContractBodyCommon {
72
83
  readonly revision: string;
73
84
  readonly status: "draft" | "accepted" | "superseded";
74
85
  readonly kindRef: TopicKindRef;
@@ -77,7 +88,6 @@ export interface TopicContractBodyV2 {
77
88
  readonly authoredBy: string;
78
89
  readonly authoredAt: string;
79
90
  readonly workingMode: "solo" | "team" | "client";
80
- readonly recipe: TopicContractRecipe;
81
91
  readonly locale?: string;
82
92
  readonly timezone?: string;
83
93
  readonly temporalMode?: "finite" | "ongoing";
@@ -102,10 +112,24 @@ export interface TopicContractBodyV2 {
102
112
  readonly risks?: readonly TopicRiskV2[];
103
113
  readonly participants?: readonly Readonly<Record<string, unknown>>[];
104
114
  readonly roles?: readonly Readonly<Record<string, unknown>>[];
105
- readonly agents?: readonly Readonly<Record<string, unknown>>[];
106
115
  readonly decision?: Readonly<Record<string, unknown>>;
107
116
  readonly plan?: Readonly<Record<string, unknown>>;
108
117
  readonly attachments?: readonly Readonly<Record<string, unknown>>[];
118
+ /** Provenance for scalar values that cannot carry provenance inline. Keys are JSON Pointers. */
119
+ readonly fieldProvenance?: Readonly<Record<string, TopicFieldProvenanceV1>>;
120
+ }
121
+ export interface TopicContractBodyV2 extends TopicContractBodyCommon {
122
+ readonly version: 2;
123
+ readonly recipe: TopicContractRecipe;
124
+ readonly agents?: readonly Readonly<Record<string, unknown>>[];
125
+ }
126
+ export interface TopicContractBodyV3 extends TopicContractBodyCommon {
127
+ readonly version: 3;
128
+ readonly baseRecipe: BaseRecipeCodeV1;
129
+ readonly topicRecipeRef?: TopicRecipeRefV1;
130
+ readonly shapeSources: readonly TopicShapeSourceRefV1[];
131
+ readonly shapeDigest: `sha256:${string}`;
132
+ readonly claimBinding?: TopicClaimBindingV1;
109
133
  }
110
134
  export type TopicReminder = {
111
135
  readonly mode: "at";
@@ -157,3 +181,4 @@ export interface TopicContractCompletenessIssue {
157
181
  }
158
182
  export declare function contractCompleteness(body: TopicContractBodyV2): readonly TopicContractCompletenessIssue[];
159
183
  export declare function assertContractComplete(body: TopicContractBodyV2): void;
184
+ export {};
@@ -9,7 +9,7 @@ export const PERSISTED_TOPIC_KINDS = [
9
9
  "discussion",
10
10
  "incident",
11
11
  ];
12
- export const TOPIC_CONTRACT_RECIPES = [
12
+ export const BASE_TOPIC_RECIPES = [
13
13
  "project",
14
14
  "flow",
15
15
  "proposal",
@@ -19,6 +19,8 @@ export const TOPIC_CONTRACT_RECIPES = [
19
19
  "discussion",
20
20
  "incident",
21
21
  ];
22
+ /** @deprecated v1 writers use BASE_TOPIC_RECIPES and the baseRecipe field. */
23
+ export const TOPIC_CONTRACT_RECIPES = BASE_TOPIC_RECIPES;
22
24
  const RECIPE_BY_KIND = {
23
25
  task: "project",
24
26
  agent_task: "flow",
@@ -1 +1 @@
1
- {"version":3,"file":"topic-contract.js","sourceRoot":"","sources":["../../../src/contracts/topic-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,MAAM;IACN,YAAY;IACZ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,UAAU;CACF,CAAC;AAEX,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS;IACT,MAAM;IACN,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,UAAU;CACF,CAAC;AAyJX,MAAM,cAAc,GAA8D;IAChF,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,MAAM;IAClB,QAAQ,EAAE,UAAU;IACpB,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;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AAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAyB;IAC9D,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAChC,MAAM,IAAI,kBAAkB,CAC1B,4BAA4B,EAC5B,6CAA6C,EAC7C,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM,EAAE,CACrD,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- export type TopicProtocolErrorCode = "ANCHOR_CONFLICT" | "ANCHOR_CYCLE" | "AUTHORIZATION_FAILED" | "CONTRACT_VALIDATION_FAILED" | "DUPLICATE_OPERATION" | "FIRST_MESSAGE_FAILED" | "INVALID_ANCHOR" | "INVALID_CONTEXT_TYPE" | "INVALID_MATRIX_EVENT" | "INVALID_OPERATION_PAYLOAD" | "INVALID_SERVER_EVENT_ID" | "NON_CANONICAL_CONFLICT_SELECTION" | "PENDING_ROOT_UNRESOLVED" | "ROOT_CREATION_FAILED" | "ROOT_DISCOVERY_FAILED" | "STORAGE_FAILED" | "TOPIC_ROOT_NOT_FOUND" | "TOPIC_MISMATCH" | "UNMAPPED_EXTERNAL_WORK_STATE" | "UNKNOWN_CONFLICT" | "UNKNOWN_CONTRACT";
1
+ export type TopicProtocolErrorCode = "ANCHOR_CONFLICT" | "ANCHOR_CYCLE" | "AUTHORIZATION_FAILED" | "CONTRACT_VALIDATION_FAILED" | "DUPLICATE_OPERATION" | "FIRST_MESSAGE_FAILED" | "INVALID_ANCHOR" | "INVALID_CONTEXT_TYPE" | "INVALID_MATRIX_EVENT" | "INVALID_OPERATION_PAYLOAD" | "INVALID_SERVER_EVENT_ID" | "NON_CANONICAL_CONFLICT_SELECTION" | "PENDING_ROOT_UNRESOLVED" | "ROOT_CREATION_FAILED" | "ROOT_DISCOVERY_FAILED" | "SHAPE_DIGEST_MISMATCH" | "SHAPE_INVALID" | "SHAPE_SOURCE_NOT_FOUND" | "STORAGE_FAILED" | "TOPIC_ROOT_NOT_FOUND" | "TOPIC_MISMATCH" | "UNMAPPED_EXTERNAL_WORK_STATE" | "UNKNOWN_CONFLICT" | "UNKNOWN_CONTRACT";
2
2
  export declare class TopicProtocolError extends Error {
3
3
  readonly code: TopicProtocolErrorCode;
4
4
  readonly details: Readonly<Record<string, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAuBA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAyB;IAC7B,OAAO,CAAoC;IAEpD,YACE,IAA4B,EAC5B,OAAe,EACf,UAA6C,EAAE,EAC/C,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AA0BA,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAyB;IAC7B,OAAO,CAAoC;IAEpD,YACE,IAA4B,EAC5B,OAAe,EACf,UAA6C,EAAE,EAC/C,OAAsB;QAEtB,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  export { TOPIC_ACTION_RUNTIME_PROVIDERS, TOPIC_ACTION_STATUSES, type ActionReceiptReference, type ActionReceiptV2, type ProjectedTopicAction, type Sha256Uri, type TopicActionRequestV1, type TopicActionRuntimeProvider, type TopicActionStatus, type TopicFlowBindingV1, } from "./action-runtime/types.js";
2
2
  export { CONTRACT_NAMES, type ContractName, } from "./contracts/schemas.js";
3
3
  export { assertContract, validateContract, type ContractValidationError, type ContractValidationResult, } from "./contracts/validator.js";
4
- export { PERSISTED_TOPIC_KINDS, TOPIC_CONTRACT_RECIPES, assertContractComplete, baseTopicKind, contractCompleteness, topicRecipeForKind, type PersistedTopicKind, type TemporalTarget, type TopicAppearance, type TopicAutomationBindingV2, type TopicContractBodyV2, type TopicContractCompletenessIssue, type TopicContractRecipe, type TopicIconName, type TopicKindRef, type TopicRecurrence, type TopicReminder, type TopicRiskV2, type TopicStatementV2, type TopicUserSettings, type Weekday, } from "./contracts/topic-contract.js";
4
+ export { PERSISTED_TOPIC_KINDS, BASE_TOPIC_RECIPES, TOPIC_CONTRACT_RECIPES, assertContractComplete, baseTopicKind, contractCompleteness, topicRecipeForKind, type PersistedTopicKind, type TemporalTarget, type TopicAppearance, type TopicAutomationBindingV2, type TopicContractBodyV2, type TopicContractBodyV3, type BaseTopicRecipe, type TopicContractCompletenessIssue, type TopicContractRecipe, type TopicIconName, type TopicKindRef, type TopicRecurrence, type TopicReminder, type TopicRiskV2, type TopicStatementV2, type TopicUserSettings, type Weekday, } from "./contracts/topic-contract.js";
5
5
  export { JOB_CARD_KIND_PROFILE, JOB_CARD_KIND_PROFILE_REF, JOB_CARD_KIND_REF, JOB_CARD_PHASES, JOB_CARD_PRIORITIES, contractCompletenessWithProfiles, resolveTopicKindProfile, topicKindProfileActionIssues, type JobCardPhase, type JobCardPriority, type JobCardV1, type TopicKindProfileRef, type TopicKindActionReference, type TopicKindProfile, type TopicKindProfileV1, type TopicKindProfileV2, type TopicActionContractDescriptor, type TopicActionManifestIndex, type TopicKindProfileActionIssue, type TopicKindResourceBinding, } from "./contracts/topic-kind-profile.js";
6
6
  export { TopicProtocolError, type TopicProtocolErrorCode, } from "./errors.js";
7
7
  export { projectTopic } from "./projector/project.js";
@@ -12,7 +12,7 @@ export { isTopicInfrastructureEvent, parseTopicRootEvent, projectMatrixTopic, }
12
12
  export { JsonPendingTopicStore, MemoryPendingTopicStore, type TopicKeyValueStore, } from "./matrix/pending.js";
13
13
  export { TopicRuntime, type TopicRuntimeOptions } from "./matrix/runtime.js";
14
14
  export { MATRIX_ROOM_MESSAGE, TOPIC_ANCHOR_KEY, TOPIC_METADATA_KEY, TOPIC_OPERATION_EVENT_TYPE, type CanonicalTopicAnchor, type MatrixEventContent, type MatrixSendRequest, type MatrixTopicProjection, type MatrixTopicProjectionInput, type ParsedTopicRoot, type PendingTopicCreation, type PendingTopicStore, type RejectedTopicEvent, type RejectedTopicEventReason, type TopicAnchorConflict, type TopicCreationInput, type TopicCreationResult, type TopicFirstMessageFactory, type TopicMatrixEvent, type TopicMatrixTransport, type TopicRootContentOptions, } from "./matrix/types.js";
15
- export { TOPIC_KINDS, TOPIC_CONTEXT_TYPES, TOPIC_STATUSES, TOPIC_VFS_FILE_PROVIDER, type IgnoredOperation, type IgnoredOperationReason, type MatrixAnchor, type TopicAnchor, type ProjectedTopicRelation, type ProjectionInput, type TopicContext, type TopicContextType, type TopicFileAttachmentIdentity, type TopicDecision, type EffectiveTopicContractReference, type TopicAutomationBinding, type TopicAutomationStatus, type TopicContractHeads, type TopicContractReference, type TopicKind, type TopicNextStep, type TopicOperation, type TopicOperationType, type TopicProjection, type ProjectedTopicAttachment, type ProjectedTopicOverview, type TopicOverview, type TopicProjectionConflict, type TopicRelationType, type TopicRoot, type TopicRootV2, type LegacyTopicRoot, type TopicStatus, type TopicVfsFileReference, isCanonicalTopicContextType, } from "./projector/types.js";
15
+ export { TOPIC_KINDS, TOPIC_CONTEXT_TYPES, TOPIC_STATUSES, TOPIC_VFS_FILE_PROVIDER, type IgnoredOperation, type IgnoredOperationReason, type MatrixAnchor, type TopicAnchor, type ProjectedTopicRelation, type ProjectionInput, type TopicContext, type TopicContextType, type TopicFileAttachmentIdentity, type TopicDecision, type EffectiveTopicContractReference, type TopicAutomationBinding, type TopicAutomationStatus, type TopicContractHeads, type TopicContractReference, type TopicKind, type TopicNextStep, type TopicOperation, type TopicOperationType, type TopicProjection, type ProjectedTopicAttachment, type ProjectedTopicOverview, type TopicOverview, type TopicProjectionConflict, type TopicRelationType, type TopicRoot, type TopicRootV2, type TopicRootV3, type LegacyTopicRoot, type TopicStatus, type TopicVfsFileReference, isCanonicalTopicContextType, } from "./projector/types.js";
16
16
  export { TOPIC_RECORD_KINDS, type TopicRecord, type TopicRecordKind, } from "./records/types.js";
17
17
  export { emptyTopicIndexSnapshot, reconcileTopicIndex } from "./indexing/reconcile.js";
18
18
  export { searchTopicIndex } from "./indexing/search.js";
@@ -20,3 +20,11 @@ export { rankTopicIndex } from "./indexing/rank.js";
20
20
  export { TOPIC_INDEX_COMPLETENESS, TOPIC_INDEX_RANK_REASONS, TOPIC_INDEX_STORAGE_STATES, TOPIC_INDEX_UNREAD_STATES, TOPIC_NOTIFICATION_MODES, type RankedTopicIndexEntry, type TopicAttentionSignalMap, type TopicAttentionSignals, type TopicIndexCompleteness, type TopicIndexDomain, type TopicIndexEntry, type TopicIndexObservation, type TopicIndexRankReason, type TopicIndexReconciliation, type TopicIndexSearchFilters, type TopicIndexSnapshot, type TopicIndexStorageState, type TopicIndexTombstone, type TopicIndexUnreadState, type TopicNotificationMode, type TopicPreference, type TopicPreferenceMap, } from "./indexing/types.js";
21
21
  export { mapExternalWorkState } from "./work-bridge/mapping.js";
22
22
  export { EXTERNAL_WORK_HEALTH_STATES, EXTERNAL_WORK_STATES, EXTERNAL_WORKFLOW_CATEGORIES, type ApprovalDecisionV1, type ClaimRecordV1, type DeliveryDecisionV1, type DeliveryPacketV1, type EvaluationAssertionV1, type ExternalWorkBindingV1, type ExternalWorkCheckpoint, type ExternalWorkHealth, type ExternalWorkSync, type ExternalWorkTombstone, type ExternalWorkflowCategory, type ExternalWorkflowStateInput, type ExternalWorkState, type ExternalWorkStateMapV1, type ExternalWorkStateMapping, type ExternalWorkStateMappingResult, type ProjectedExternalWorkBinding, type SettlementReceiptV1, type Sha256Digest, type TopicWorkBridgeProjection, type WorkArtifactReference, type WorkEvidenceReference, type WorkItemSnapshotV1, } from "./work-bridge/types.js";
23
+ export { canonicalShapeJson, shapeDigest } from "./shapes/canonical.js";
24
+ export { inferredRecordMayAutoAccept, resolveTopicClaimBinding, type TopicClaimCollectionResolutionV1, } from "./shapes/claims.js";
25
+ export { projectTopicNow } from "./shapes/now.js";
26
+ export { projectTopicProgress, replayTopicShape } from "./shapes/progress.js";
27
+ export { BASE_RECIPE_REGISTRY, KIND_SHAPE_REGISTRY, TOPIC_RECIPE_REGISTRY } from "./shapes/recipes.js";
28
+ export { resolveEffectiveTopicShape, topicRecipeRef, type ResolveEffectiveTopicShapeInputV1, } from "./shapes/resolver.js";
29
+ export { TOPIC_STATE_PROFILE_V3, type TopicContractReferenceV3, type TopicContractStateV3 } from "./shapes/state.js";
30
+ export { BASE_RECIPE_CODES, SHAPE_ATTENTION_STATES, SHAPE_CONDITIONS, SHAPE_PHASES, TOPIC_RECIPE_CODES, type BaseRecipeCodeV1, type EffectiveTopicShapeV1, type ResolvedTopicClaimBindingV1, type ShapeAttentionV1, type ShapeConditionV1, type ShapeConfirmationPolicyV1, type ShapeConsequenceClassV1, type ShapeEvidenceRequirementV1, type ShapeGateV1, type ShapePhaseV1, type ShapeProgressRuleV1, type ShapeStateAxisV1, type ShapeStateDefinitionV1, type ShapeTransitionV1, type TopicClaimBindingV1, type TopicNowProjectionV1, type TopicProgressBlockV1, type TopicProgressInputV1, type TopicProgressProjectionV1, type TopicProgressSourceV1, type TopicRecipeCodeV1, type TopicRecipeRefV1, type TopicRecipeV1, type TopicShapeSourceRefV1, type TopicShapeOverlayV1, type TopicShapeV1, type TopicStateTagV1, type TopicTransitionCandidateV1, type TopicViewerAuthorityV1, } from "./shapes/types.js";
package/dist/src/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { TOPIC_ACTION_RUNTIME_PROVIDERS, TOPIC_ACTION_STATUSES, } from "./action-runtime/types.js";
2
2
  export { CONTRACT_NAMES, } from "./contracts/schemas.js";
3
3
  export { assertContract, validateContract, } from "./contracts/validator.js";
4
- export { PERSISTED_TOPIC_KINDS, TOPIC_CONTRACT_RECIPES, assertContractComplete, baseTopicKind, contractCompleteness, topicRecipeForKind, } from "./contracts/topic-contract.js";
4
+ export { PERSISTED_TOPIC_KINDS, BASE_TOPIC_RECIPES, TOPIC_CONTRACT_RECIPES, assertContractComplete, baseTopicKind, contractCompleteness, topicRecipeForKind, } from "./contracts/topic-contract.js";
5
5
  export { JOB_CARD_KIND_PROFILE, JOB_CARD_KIND_PROFILE_REF, JOB_CARD_KIND_REF, JOB_CARD_PHASES, JOB_CARD_PRIORITIES, contractCompletenessWithProfiles, resolveTopicKindProfile, topicKindProfileActionIssues, } from "./contracts/topic-kind-profile.js";
6
6
  export { TopicProtocolError, } from "./errors.js";
7
7
  export { projectTopic } from "./projector/project.js";
@@ -20,4 +20,12 @@ export { rankTopicIndex } from "./indexing/rank.js";
20
20
  export { TOPIC_INDEX_COMPLETENESS, TOPIC_INDEX_RANK_REASONS, TOPIC_INDEX_STORAGE_STATES, TOPIC_INDEX_UNREAD_STATES, TOPIC_NOTIFICATION_MODES, } from "./indexing/types.js";
21
21
  export { mapExternalWorkState } from "./work-bridge/mapping.js";
22
22
  export { EXTERNAL_WORK_HEALTH_STATES, EXTERNAL_WORK_STATES, EXTERNAL_WORKFLOW_CATEGORIES, } from "./work-bridge/types.js";
23
+ export { canonicalShapeJson, shapeDigest } from "./shapes/canonical.js";
24
+ export { inferredRecordMayAutoAccept, resolveTopicClaimBinding, } from "./shapes/claims.js";
25
+ export { projectTopicNow } from "./shapes/now.js";
26
+ export { projectTopicProgress, replayTopicShape } from "./shapes/progress.js";
27
+ export { BASE_RECIPE_REGISTRY, KIND_SHAPE_REGISTRY, TOPIC_RECIPE_REGISTRY } from "./shapes/recipes.js";
28
+ export { resolveEffectiveTopicShape, topicRecipeRef, } from "./shapes/resolver.js";
29
+ export { TOPIC_STATE_PROFILE_V3 } from "./shapes/state.js";
30
+ export { BASE_RECIPE_CODES, SHAPE_ATTENTION_STATES, SHAPE_CONDITIONS, SHAPE_PHASES, TOPIC_RECIPE_CODES, } from "./shapes/types.js";
23
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,GAStB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,gBAAgB,GAGjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,aAAa,EACb,oBAAoB,EACpB,kBAAkB,GAgBnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,gCAAgC,EAChC,uBAAuB,EACvB,4BAA4B,GAa7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,kBAAkB,GAEnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACxG,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,qBAAqB,EACrB,aAAa,EACb,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,GAS/B,M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B,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GAkBzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,4BAA4B,GAwB7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,GAEzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,EACL,0BAA0B,EAC1B,cAAc,GAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAA4D,MAAM,mBAAmB,CAAC;AACrH,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,GA8BnB,MAAM,mBAAmB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { TopicWorkBridgeProjection } from "../work-bridge/types.js";
2
2
  import type { ActionReceiptV2, ProjectedTopicAction, TopicActionRequestV1, TopicFlowBindingV1 } from "../action-runtime/types.js";
3
+ import type { BaseRecipeCodeV1, TopicRecipeRefV1 } from "../shapes/types.js";
3
4
  export declare const TOPIC_STATUSES: readonly ["draft", "active", "waiting", "blocked", "resolved", "archived", "redirected"];
4
5
  export declare const TOPIC_KINDS: readonly ["discussion", "question", "decision", "proposal", "task", "incident", "flow", "agent_task", "evaluation", "claims"];
5
6
  export declare const TOPIC_CONTEXT_TYPES: readonly ["ixo.flow", "ixo.resource", "ixo.service", "ixo.authority", "ixo.domain", "ixo.account", "ixo.entity"];
@@ -70,7 +71,14 @@ export interface TopicRootV2 extends TopicRootFields {
70
71
  readonly version: 2;
71
72
  readonly kind: TopicKind;
72
73
  }
73
- export type TopicRoot = LegacyTopicRoot | TopicRootV2;
74
+ export interface TopicRootV3 extends TopicRootFields {
75
+ readonly version: 3;
76
+ readonly kind: TopicKind;
77
+ readonly baseRecipe: BaseRecipeCodeV1;
78
+ readonly topicRecipeRef?: TopicRecipeRefV1;
79
+ readonly shapeDigest: `sha256:${string}`;
80
+ }
81
+ export type TopicRoot = LegacyTopicRoot | TopicRootV2 | TopicRootV3;
74
82
  export interface MatrixAnchor {
75
83
  readonly roomId: string;
76
84
  readonly rootEventId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/projector/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO;IACP,QAAQ;IACR,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,YAAY;CACJ,CAAC;AACX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,QAAQ;CACA,CAAC;AACX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,cAAc;IACd,aAAa;IACb,eAAe;IACf,YAAY;IACZ,aAAa;IACb,YAAY;CACJ,CAAC;AACX,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AA+CjD;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACvD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAyB,CAAC;WACzD,mDAAmD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/projector/types.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO;IACP,QAAQ;IACR,SAAS;IACT,SAAS;IACT,UAAU;IACV,UAAU;IACV,YAAY;CACJ,CAAC;AACX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY;IACZ,UAAU;IACV,UAAU;IACV,UAAU;IACV,MAAM;IACN,UAAU;IACV,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,QAAQ;CACA,CAAC;AACX,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,UAAU;IACV,cAAc;IACd,aAAa;IACb,eAAe;IACf,YAAY;IACZ,aAAa;IACb,YAAY;CACJ,CAAC;AACX,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AA+CjD;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAa;IACvD,OAAO,mBAAmB,CAAC,QAAQ,CAAC,KAAyB,CAAC;WACzD,mDAAmD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function canonicalShapeJson(value: unknown): string;
2
+ export declare function shapeDigest(value: unknown): `sha256:${string}`;
@@ -0,0 +1,20 @@
1
+ import { createHash } from "node:crypto";
2
+ function canonicalValue(value) {
3
+ if (Array.isArray(value))
4
+ return value.map(canonicalValue);
5
+ if (value === null || typeof value !== "object")
6
+ return value;
7
+ const entries = Object.entries(value)
8
+ .filter(([, entry]) => entry !== undefined)
9
+ .sort(([left], [right]) => left.localeCompare(right))
10
+ .map(([key, entry]) => [key, canonicalValue(entry)]);
11
+ return Object.fromEntries(entries);
12
+ }
13
+ export function canonicalShapeJson(value) {
14
+ return JSON.stringify(canonicalValue(value));
15
+ }
16
+ export function shapeDigest(value) {
17
+ const digest = createHash("sha256").update(canonicalShapeJson(value)).digest("hex");
18
+ return `sha256:${digest}`;
19
+ }
20
+ //# sourceMappingURL=canonical.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical.js","sourceRoot":"","sources":["../../../src/shapes/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAC3D,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAA0C,CAAC;SACvE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC;SAC1C,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SACpD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,cAAc,CAAC,KAAK,CAAC,CAAU,CAAC,CAAC;IAChE,OAAO,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACpF,OAAO,UAAU,MAAM,EAAE,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { ResolvedTopicClaimBindingV1, TopicClaimBindingV1 } from "./types.js";
2
+ export type TopicClaimCollectionResolutionV1 = {
3
+ readonly entityDid: string;
4
+ readonly collectionId: string;
5
+ readonly protocolDid: string;
6
+ readonly rubric: {
7
+ readonly id: string;
8
+ readonly digest?: `sha256:${string}`;
9
+ };
10
+ };
11
+ export declare function resolveTopicClaimBinding(binding: TopicClaimBindingV1, resolveCollection: (entityDid: string, collectionId: string) => Promise<TopicClaimCollectionResolutionV1 | null>): Promise<ResolvedTopicClaimBindingV1>;
12
+ export declare function inferredRecordMayAutoAccept(recordType: string, consequence: "none" | "shared-state" | "external-effect" | "settlement", allowedTypes: readonly string[]): boolean;
@@ -0,0 +1,20 @@
1
+ import { TopicProtocolError } from "../errors.js";
2
+ export async function resolveTopicClaimBinding(binding, resolveCollection) {
3
+ const resolved = await resolveCollection(binding.entityDid, binding.collectionId);
4
+ if (resolved === null) {
5
+ throw new TopicProtocolError("SHAPE_SOURCE_NOT_FOUND", "The bound claim collection could not be resolved", { ...binding });
6
+ }
7
+ if (resolved.entityDid !== binding.entityDid || resolved.collectionId !== binding.collectionId) {
8
+ throw new TopicProtocolError("SHAPE_INVALID", "Claim resolution returned a different entity or collection", {
9
+ expectedEntityDid: binding.entityDid,
10
+ expectedCollectionId: binding.collectionId,
11
+ actualEntityDid: resolved.entityDid,
12
+ actualCollectionId: resolved.collectionId,
13
+ });
14
+ }
15
+ return resolved;
16
+ }
17
+ export function inferredRecordMayAutoAccept(recordType, consequence, allowedTypes) {
18
+ return consequence !== "external-effect" && consequence !== "settlement" && allowedTypes.includes(recordType);
19
+ }
20
+ //# sourceMappingURL=claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claims.js","sourceRoot":"","sources":["../../../src/shapes/claims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAUlD,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAA4B,EAC5B,iBAAgH;IAEhH,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,IAAI,kBAAkB,CAAC,wBAAwB,EAAE,kDAAkD,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7H,CAAC;IACD,IAAI,QAAQ,CAAC,SAAS,KAAK,OAAO,CAAC,SAAS,IAAI,QAAQ,CAAC,YAAY,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC;QAC/F,MAAM,IAAI,kBAAkB,CAAC,eAAe,EAAE,4DAA4D,EAAE;YAC1G,iBAAiB,EAAE,OAAO,CAAC,SAAS;YACpC,oBAAoB,EAAE,OAAO,CAAC,YAAY;YAC1C,eAAe,EAAE,QAAQ,CAAC,SAAS;YACnC,kBAAkB,EAAE,QAAQ,CAAC,YAAY;SAC1C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,2BAA2B,CACzC,UAAkB,EAClB,WAAuE,EACvE,YAA+B;IAE/B,OAAO,WAAW,KAAK,iBAAiB,IAAI,WAAW,KAAK,YAAY,IAAI,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAChH,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { TopicNowProjectionV1, TopicProgressProjectionV1, TopicViewerAuthorityV1 } from "./types.js";
2
+ export declare function projectTopicNow(progress: TopicProgressProjectionV1, authority: TopicViewerAuthorityV1): TopicNowProjectionV1;
@@ -0,0 +1,42 @@
1
+ function assignedToViewer(transition, authority) {
2
+ if (transition.assignedTo.kind === "actor")
3
+ return transition.assignedTo.value === authority.viewerId;
4
+ return authority.roleAssignments[transition.assignedTo.value]?.includes(authority.viewerId) === true;
5
+ }
6
+ function authorized(transition, authority) {
7
+ return authority.matrixWrite
8
+ && authority.verifiedAbilities.includes(transition.requiredAbility)
9
+ && assignedToViewer(transition, authority);
10
+ }
11
+ function attentionFor(transitions) {
12
+ if (transitions.some(({ confirmation }) => confirmation !== "none"))
13
+ return "viewer-confirmation-required";
14
+ if (transitions.some(({ phase }) => phase === "verifying" || phase === "deciding"))
15
+ return "viewer-review-required";
16
+ return transitions.length === 0 ? "none" : "viewer-action-required";
17
+ }
18
+ export function projectTopicNow(progress, authority) {
19
+ const transitions = progress.candidates
20
+ .map(({ transition }) => transition)
21
+ .filter((transition) => authorized(transition, authority));
22
+ const attention = attentionFor(transitions);
23
+ const reasonCode = attention === "none"
24
+ ? progress.reasonCode
25
+ : transitions[0]?.presentation?.reasonCode ?? progress.reasonCode;
26
+ return {
27
+ version: 1,
28
+ phase: progress.phase,
29
+ condition: progress.condition,
30
+ attention,
31
+ reasonCode,
32
+ stateTags: progress.stateTags,
33
+ transitions,
34
+ cacheKey: {
35
+ topicRevision: progress.topicRevision,
36
+ contractRevision: progress.contractRevision,
37
+ shapeDigest: progress.shapeDigest,
38
+ },
39
+ ...(progress.block === undefined ? {} : { blockedOn: progress.block.target }),
40
+ };
41
+ }
42
+ //# sourceMappingURL=now.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"now.js","sourceRoot":"","sources":["../../../src/shapes/now.ts"],"names":[],"mappings":"AAQA,SAAS,gBAAgB,CACvB,UAA6B,EAC7B,SAAiC;IAEjC,IAAI,UAAU,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,UAAU,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,CAAC,QAAQ,CAAC;IACtG,OAAO,SAAS,CAAC,eAAe,CAAC,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;AACvG,CAAC;AAED,SAAS,UAAU,CACjB,UAA6B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U;QACV,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,WAAW;QACX,QAAQ,EAAE;YACR,aAAa,EAAE,QAAQ,CAAC,aAAa;YACrC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;YAC3C,WAAW,EAAE,QAAQ,CAAC,WAAW;SAClC;QACD,GAAG,CAAC,QAAQ,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { TopicProgressInputV1, TopicProgressProjectionV1 } from "./types.js";
2
+ export declare function projectTopicProgress(input: TopicProgressInputV1): TopicProgressProjectionV1;
3
+ export declare function replayTopicShape(input: Omit<TopicProgressInputV1, "axisStates">, initialAxisStates?: Readonly<Record<string, string>>): Readonly<Record<string, string>>;