@agenticprimitives/fabric 0.0.0-alpha.3 → 0.0.0-alpha.5
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/CLAUDE.md +12 -2
- package/dist/cloudflare/index.d.ts +1 -0
- package/dist/cloudflare/index.d.ts.map +1 -1
- package/dist/cloudflare/index.js +4 -0
- package/dist/cloudflare/index.js.map +1 -1
- package/dist/cloudflare/interaction-store.d.ts +55 -0
- package/dist/cloudflare/interaction-store.d.ts.map +1 -0
- package/dist/cloudflare/interaction-store.js +230 -0
- package/dist/cloudflare/interaction-store.js.map +1 -0
- package/dist/cloudflare/principal-gateway-do.d.ts +118 -2
- package/dist/cloudflare/principal-gateway-do.d.ts.map +1 -1
- package/dist/cloudflare/principal-gateway-do.js +182 -7
- package/dist/cloudflare/principal-gateway-do.js.map +1 -1
- package/dist/communicative-act.d.ts +24 -1
- package/dist/communicative-act.d.ts.map +1 -1
- package/dist/communicative-act.js +28 -0
- package/dist/communicative-act.js.map +1 -1
- package/dist/delivery-envelope.d.ts.map +1 -1
- package/dist/delivery-envelope.js +0 -1
- package/dist/delivery-envelope.js.map +1 -1
- package/dist/enum-retirement.d.ts +34 -0
- package/dist/enum-retirement.d.ts.map +1 -0
- package/dist/enum-retirement.js +87 -0
- package/dist/enum-retirement.js.map +1 -0
- package/dist/exchange-record.d.ts +19 -3
- package/dist/exchange-record.d.ts.map +1 -1
- package/dist/exchange-record.js.map +1 -1
- package/dist/exchange-reducer.d.ts +33 -0
- package/dist/exchange-reducer.d.ts.map +1 -1
- package/dist/exchange-reducer.js +48 -0
- package/dist/exchange-reducer.js.map +1 -1
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/dist/interaction-machines.d.ts +136 -0
- package/dist/interaction-machines.d.ts.map +1 -0
- package/dist/interaction-machines.js +174 -0
- package/dist/interaction-machines.js.map +1 -0
- package/dist/interaction-profile.d.ts +126 -0
- package/dist/interaction-profile.d.ts.map +1 -0
- package/dist/interaction-profile.js +192 -0
- package/dist/interaction-profile.js.map +1 -0
- package/dist/interaction-record.d.ts +168 -0
- package/dist/interaction-record.d.ts.map +1 -0
- package/dist/interaction-record.js +108 -0
- package/dist/interaction-record.js.map +1 -0
- package/dist/messaging/conversation-interaction.d.ts +66 -0
- package/dist/messaging/conversation-interaction.d.ts.map +1 -0
- package/dist/messaging/conversation-interaction.js +139 -0
- package/dist/messaging/conversation-interaction.js.map +1 -0
- package/dist/messaging/inbox-assistant.d.ts +6 -3
- package/dist/messaging/inbox-assistant.d.ts.map +1 -1
- package/dist/messaging/inbox-assistant.js +23 -2
- package/dist/messaging/inbox-assistant.js.map +1 -1
- package/dist/messaging/index.d.ts +4 -1
- package/dist/messaging/index.d.ts.map +1 -1
- package/dist/messaging/index.js +4 -0
- package/dist/messaging/index.js.map +1 -1
- package/dist/messaging/rules.d.ts +9 -2
- package/dist/messaging/rules.d.ts.map +1 -1
- package/dist/messaging/rules.js +8 -1
- package/dist/messaging/rules.js.map +1 -1
- package/dist/messaging/store.d.ts.map +1 -1
- package/dist/messaging/store.js +5 -3
- package/dist/messaging/store.js.map +1 -1
- package/dist/messaging/types.d.ts +30 -0
- package/dist/messaging/types.d.ts.map +1 -1
- package/dist/messaging/types.js +3 -0
- package/dist/messaging/types.js.map +1 -1
- package/dist/protocol-binding.d.ts +71 -0
- package/dist/protocol-binding.d.ts.map +1 -0
- package/dist/protocol-binding.js +0 -0
- package/dist/protocol-binding.js.map +1 -0
- package/dist/record-catalog.d.ts.map +1 -1
- package/dist/record-catalog.js +7 -0
- package/dist/record-catalog.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange-record.d.ts","sourceRoot":"","sources":["../src/exchange-record.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"exchange-record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MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"exchange-record.js","sourceRoot":"","sources":["../src/exchange-record.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,6GAA6G;AAC7G,0GAA0G;AAC1G,EAAE;AACF,oGAAoG;AACpG,2GAA2G;AAC3G,6GAA6G;AAC7G,8GAA8G;AAC9G,+EAA+E;AAC/E,EAAE;AACF,4GAA4G;AAC5G,oGAAoG;AAGpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAkC3D;;kDAEkD;AAClD,MAAM,CAAC,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AACxD,uFAAuF;AACvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAiGtD;uGACuG;AACvG,MAAM,UAAU,OAAO,CAAC,MAAqD;IAC3E,OAAO,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,SAAS,CAAC;AAC1C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CaseFsmFields } from './case-machine.js';
|
|
2
2
|
import type { ExchangeRecordV1, ExchangeEventV1 } from './exchange-record.js';
|
|
3
|
+
import type { Hex32 } from './messaging/index.js';
|
|
3
4
|
export type ExchangeApplyResult = {
|
|
4
5
|
ok: true;
|
|
5
6
|
record: ExchangeRecordV1;
|
|
@@ -22,4 +23,36 @@ export declare function caseViewFromRecord(record: ExchangeRecordV1): CaseFsmFie
|
|
|
22
23
|
* replay (`changed: false`), or a typed rejection.
|
|
23
24
|
*/
|
|
24
25
|
export declare function applyExchangeEvent(record: ExchangeRecordV1, event: ExchangeEventV1): ExchangeApplyResult;
|
|
26
|
+
/** Bumped ONLY when a fold changes an output for inputs it already accepted. Adding a rejection reason
|
|
27
|
+
* is not a bump; changing what an accepted event does to the record is. */
|
|
28
|
+
export declare const EXCHANGE_REDUCER_VERSION: "ap.exchange-reducer.v1";
|
|
29
|
+
export interface MaterializationProvenanceV1 {
|
|
30
|
+
reducerVersion: typeof EXCHANGE_REDUCER_VERSION;
|
|
31
|
+
/** sha256 over the canonical event array — order-sensitive, because the fold is. */
|
|
32
|
+
eventSetDigest: Hex32;
|
|
33
|
+
eventCount: number;
|
|
34
|
+
}
|
|
35
|
+
/** Digest of the exact event sequence a materialization consumed. Order-sensitive on purpose: the same
|
|
36
|
+
* events in a different order are a different history, and folding them yields a different record. */
|
|
37
|
+
export declare function eventSetDigest(events: readonly ExchangeEventV1[]): Promise<Hex32>;
|
|
38
|
+
export type ExchangeReplayResult = {
|
|
39
|
+
ok: true;
|
|
40
|
+
record: ExchangeRecordV1;
|
|
41
|
+
provenance: MaterializationProvenanceV1;
|
|
42
|
+
} | {
|
|
43
|
+
ok: false;
|
|
44
|
+
reason: string;
|
|
45
|
+
atSeq: number;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Rebuild an exchange from its event stream, and return the state WITH the evidence of how it was
|
|
49
|
+
* built.
|
|
50
|
+
*
|
|
51
|
+
* `seed` is the record as it existed before any event — the identity fields only. Its `events` are
|
|
52
|
+
* ignored and replaced by the fold, so replaying an already-materialized record cannot double-apply.
|
|
53
|
+
*
|
|
54
|
+
* Failure carries `atSeq` rather than just a reason: on a stream of two hundred events, "illegal
|
|
55
|
+
* transition" without the position is not a diagnosis.
|
|
56
|
+
*/
|
|
57
|
+
export declare function replayExchange(seed: ExchangeRecordV1, events: readonly ExchangeEventV1[]): Promise<ExchangeReplayResult>;
|
|
25
58
|
//# sourceMappingURL=exchange-reducer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange-reducer.d.ts","sourceRoot":"","sources":["../src/exchange-reducer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exchange-reducer.d.ts","sourceRoot":"","sources":["../src/exchange-reducer.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,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reducer.js
CHANGED
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
//
|
|
14
14
|
// Fail-closed: an illegal case transition, an inconsistent transport move, or a seq gap is a typed rejection,
|
|
15
15
|
// never a silent state change. Idempotent: a replayed event (same `idempotencyKey`) is a no-op.
|
|
16
|
+
import { canonicalizeJson } from '@agenticprimitives/types';
|
|
16
17
|
import { canTaskTransition, expectedExecForCase, isExecCaseConsistent } from './exchange-state.js';
|
|
17
18
|
import { applyCaseTransition } from './case-machine.js';
|
|
19
|
+
import { sha256Hex32 } from './messaging/index.js';
|
|
18
20
|
/**
|
|
19
21
|
* Derive the transient case FSM view from a lean `ExchangeRecordV1` (option (a) — the record stays the lean
|
|
20
22
|
* spine; the case view is constructed only when applying a transition). Role convention: `requester` = the
|
|
@@ -105,4 +107,50 @@ export function applyExchangeEvent(record, event) {
|
|
|
105
107
|
}
|
|
106
108
|
}
|
|
107
109
|
}
|
|
110
|
+
// ─── Materialization provenance (spec 340 INV-340-8) ─────────────────────────
|
|
111
|
+
//
|
|
112
|
+
// "Materialized state rebuilds deterministically from signed events" is a claim, and a claim nobody can
|
|
113
|
+
// check is a hope. Two things make it checkable, and both must travel WITH the rebuilt state:
|
|
114
|
+
//
|
|
115
|
+
// eventSetDigest — WHICH events produced this. Without it, a state that silently dropped an event
|
|
116
|
+
// and a state that legitimately never received one are indistinguishable.
|
|
117
|
+
// reducerVersion — WHICH rules produced this. Two nodes on different reducer versions can fold the
|
|
118
|
+
// same events into different states and both be internally consistent; the
|
|
119
|
+
// disagreement then looks like data corruption instead of a version skew.
|
|
120
|
+
/** Bumped ONLY when a fold changes an output for inputs it already accepted. Adding a rejection reason
|
|
121
|
+
* is not a bump; changing what an accepted event does to the record is. */
|
|
122
|
+
export const EXCHANGE_REDUCER_VERSION = 'ap.exchange-reducer.v1';
|
|
123
|
+
/** Digest of the exact event sequence a materialization consumed. Order-sensitive on purpose: the same
|
|
124
|
+
* events in a different order are a different history, and folding them yields a different record. */
|
|
125
|
+
export async function eventSetDigest(events) {
|
|
126
|
+
return sha256Hex32(canonicalizeJson(events));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Rebuild an exchange from its event stream, and return the state WITH the evidence of how it was
|
|
130
|
+
* built.
|
|
131
|
+
*
|
|
132
|
+
* `seed` is the record as it existed before any event — the identity fields only. Its `events` are
|
|
133
|
+
* ignored and replaced by the fold, so replaying an already-materialized record cannot double-apply.
|
|
134
|
+
*
|
|
135
|
+
* Failure carries `atSeq` rather than just a reason: on a stream of two hundred events, "illegal
|
|
136
|
+
* transition" without the position is not a diagnosis.
|
|
137
|
+
*/
|
|
138
|
+
export async function replayExchange(seed, events) {
|
|
139
|
+
let record = { ...seed, events: [] };
|
|
140
|
+
for (const event of events) {
|
|
141
|
+
const res = applyExchangeEvent(record, event);
|
|
142
|
+
if (!res.ok)
|
|
143
|
+
return { ok: false, reason: res.reason, atSeq: event.seq };
|
|
144
|
+
record = res.record;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
ok: true,
|
|
148
|
+
record,
|
|
149
|
+
provenance: {
|
|
150
|
+
reducerVersion: EXCHANGE_REDUCER_VERSION,
|
|
151
|
+
eventSetDigest: await eventSetDigest(events),
|
|
152
|
+
eventCount: events.length,
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
108
156
|
//# sourceMappingURL=exchange-reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exchange-reducer.js","sourceRoot":"","sources":["../src/exchange-reducer.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,0GAA0G;AAC1G,6FAA6F;AAC7F,EAAE;AACF,2GAA2G;AAC3G,2GAA2G;AAC3G,6GAA6G;AAC7G,oEAAoE;AACpE,2GAA2G;AAC3G,wDAAwD;AACxD,6GAA6G;AAC7G,+GAA+G;AAC/G,EAAE;AACF,8GAA8G;AAC9G,gGAAgG;AAEhG,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EA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AM;QACN,UAAU,EAAE;YACV,cAAc,EAAE,wBAAwB;YACxC,cAAc,EAAE,MAAM,cAAc,CAAC,MAAM,CAAC;YAC5C,UAAU,EAAE,MAAM,CAAC,MAAM;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,20 @@ export { applyCaseTransition, isTerminalCaseState, TERMINAL_CASE_STATES, } from
|
|
|
8
8
|
export type { FabricCaseV1, CaseFsmFields, CaseTransition, CaseTransitionEventV1, CaseResult, CaseRejection, } from './case-machine.js';
|
|
9
9
|
export { applyExchangeEvent, caseViewFromRecord } from './exchange-reducer.js';
|
|
10
10
|
export type { ExchangeApplyResult } from './exchange-reducer.js';
|
|
11
|
+
export { EXCHANGE_REDUCER_VERSION, eventSetDigest, replayExchange } from './exchange-reducer.js';
|
|
12
|
+
export type { MaterializationProvenanceV1, ExchangeReplayResult } from './exchange-reducer.js';
|
|
13
|
+
export { PROTOCOL, looksCanonical, bindProtocol, bindingKey, buildBindingIndex, resolveInteractionByBinding, topicInteractionId, channelIdFromTopicInteraction, } from './protocol-binding.js';
|
|
14
|
+
export type { ProtocolBindingV1, BindingRejection, BindingIndex, BindingResolution } from './protocol-binding.js';
|
|
15
|
+
export { PROFILE_FOR_MESSAGE_KIND, MACHINE_FOR_CASE_STATE, machinesSpannedByCaseState } from './enum-retirement.js';
|
|
16
|
+
export type { OwningMachine } from './enum-retirement.js';
|
|
17
|
+
export { checkExchangeAgainstProfile, profileFor, PROFILE_LIBRARY, DIRECT_PROFILE, NEGOTIATION_PROFILE, CONSULTATION_PROFILE, ENGAGEMENT_PROFILE, TOPIC_PROFILE, ENGAGEMENT_RESPONSE_KIND_AXES, } from './interaction-profile.js';
|
|
18
|
+
export type { InteractionProfileV1, ProfileViolation, ExchangeUnderProfile, } from './interaction-profile.js';
|
|
19
|
+
export { applyInboxTransition, applyInteractionTransition, applyDecisionTransition, applyCommitmentTransition, mayDischargeOnExecution, TERMINAL_INTERACTION_STATES, TERMINAL_DECISION_STATES, TERMINAL_COMMITMENT_STATES, } from './interaction-machines.js';
|
|
20
|
+
export type { MachineRejection, MachineResult, InboxState, InboxTransition, InboxEntryV1, InteractionState, InteractionTransition, InteractionLifecycleV1, DecisionState, DecisionTransition, DecisionRecordV1, CommitmentState, CommitmentTransition, CommitmentRecordV1, } from './interaction-machines.js';
|
|
21
|
+
export { isProfileVersion, isFloatingVersion, checkReproducible, assertReproducible, hashContextSnapshot, buildContextSnapshot, verifyContextSnapshot, participantsAt, detectProfileDowngrades, } from './interaction-record.js';
|
|
22
|
+
export type { InteractionId, InteractionRecordV1, ProfileVersion, ParticipationV1, ContextDigest, ContextReferenceV1, ContextSnapshotV1, ContextReproducibilityFailure, ProfileDowngrade, } from './interaction-record.js';
|
|
23
|
+
export { conversationInteractionId, conversationIdFromInteraction, participationModeOfConversation, profileVersionOfConversation, participationsOfConversation, conversationPins, interactionViewOfConversation, participationModeOfChannel, interactionViewOfChannel, } from './messaging/conversation-interaction.js';
|
|
24
|
+
export type { ConversationExchangePins, ConversationInteractionView } from './messaging/conversation-interaction.js';
|
|
11
25
|
export { projectInboxItem, applyMessageEvent, applyInboxRules, createInMemoryInboxProjector, } from './inbox-projection.js';
|
|
12
26
|
export type { InboxProjectionEvent, InboxItemV1, InboxRuleV1, InboxProjector, CreateInboxProjectorOpts, FolderKind, } from './inbox-projection.js';
|
|
13
27
|
export { buildGatewaySurfaceCommitment, hashGatewaySurfaceCommitment, verifyGatewaySurfaceCommitment, } from './gateway-surface.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,S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a,EACb,kBAAkB,EAClB,iBAAiB,EACjB,6BAA6B,EAC7B,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,6BAA6B,EAC7B,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,yCAAyC,CAAC;AACjD,YAAY,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAGrH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,UAAU,GACX,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAGvE,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAIpF,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,WAAW,GACjB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,29 @@ export { performativeForKind } from './communicative-act.js';
|
|
|
15
15
|
export { applyCaseTransition, isTerminalCaseState, TERMINAL_CASE_STATES, } from './case-machine.js';
|
|
16
16
|
// The unified exchange-event reducer (spec 316 §b/§2) — one append-only stream, one reducer over the record.
|
|
17
17
|
export { applyExchangeEvent, caseViewFromRecord } from './exchange-reducer.js';
|
|
18
|
+
// Materialization provenance (spec 340 INV-340-8) — rebuilt state travels WITH which events and which
|
|
19
|
+
// rules produced it, so a dropped event and a never-received one stop looking identical.
|
|
20
|
+
export { EXCHANGE_REDUCER_VERSION, eventSetDigest, replayExchange } from './exchange-reducer.js';
|
|
21
|
+
// Protocol bindings (spec 340 §11 / W5) — foreign keys into other protocols' namespaces, NEVER our
|
|
22
|
+
// canonical ids. Resolution returns a typed ambiguity rather than a first match: cross-wiring two
|
|
23
|
+
// interactions merges two participant sets, two commitment ledgers and two audit trails.
|
|
24
|
+
export { PROTOCOL, looksCanonical, bindProtocol, bindingKey, buildBindingIndex, resolveInteractionByBinding, topicInteractionId, channelIdFromTopicInteraction, } from './protocol-binding.js';
|
|
25
|
+
// TRANSITIONAL (spec 340 W5) — the MessageKind/CaseState retirement path. This module exists to be
|
|
26
|
+
// deleted; both enums are still live, and the total compiler-checked mapping is what makes the later
|
|
27
|
+
// removal mechanical instead of a judgement call per call site.
|
|
28
|
+
export { PROFILE_FOR_MESSAGE_KIND, MACHINE_FOR_CASE_STATE, machinesSpannedByCaseState } from './enum-retirement.js';
|
|
29
|
+
// The profile mechanism (spec 340 W4) — what replaces the frozen MessageKind/CaseState enums. A new
|
|
30
|
+
// interaction type is DATA, not a schema change. A profile permits nothing.
|
|
31
|
+
export { checkExchangeAgainstProfile, profileFor, PROFILE_LIBRARY, DIRECT_PROFILE, NEGOTIATION_PROFILE, CONSULTATION_PROFILE, ENGAGEMENT_PROFILE, TOPIC_PROFILE, ENGAGEMENT_RESPONSE_KIND_AXES, } from './interaction-profile.js';
|
|
32
|
+
// The four state machines spec 340 §5 named and the fabric did not have (W3). Six, never collapsed:
|
|
33
|
+
// delivery · inbox · interaction · decision · commitment · execution. None of them is authority.
|
|
34
|
+
export { applyInboxTransition, applyInteractionTransition, applyDecisionTransition, applyCommitmentTransition, mayDischargeOnExecution, TERMINAL_INTERACTION_STATES, TERMINAL_DECISION_STATES, TERMINAL_COMMITMENT_STATES, } from './interaction-machines.js';
|
|
35
|
+
// The durable governed situation (spec 340 W2; ADR-0058). The aggregate an Exchange occurs IN — an
|
|
36
|
+
// Exchange without one is a message, which is a legitimate state and why the pins are optional.
|
|
37
|
+
export { isProfileVersion, isFloatingVersion, checkReproducible, assertReproducible, hashContextSnapshot, buildContextSnapshot, verifyContextSnapshot, participantsAt, detectProfileDowngrades, } from './interaction-record.js';
|
|
38
|
+
// The vault-backed conversation as an Interaction (spec 340 W12) — the projection `demo-a2a`'s live
|
|
39
|
+
// board path uses. W11 wired the DO-SQL channel store, which no app runs; this reaches the one that does.
|
|
40
|
+
export { conversationInteractionId, conversationIdFromInteraction, participationModeOfConversation, profileVersionOfConversation, participationsOfConversation, conversationPins, interactionViewOfConversation, participationModeOfChannel, interactionViewOfChannel, } from './messaging/conversation-interaction.js';
|
|
18
41
|
// Inbox projection (spec 316 §b) — the vault-resident inbox row projected from the message-event slice.
|
|
19
42
|
export { projectInboxItem, applyMessageEvent, applyInboxRules, createInMemoryInboxProjector, } from './inbox-projection.js';
|
|
20
43
|
// Gateway surface commitment (spec 316 §4.1 / W4 — decentralized discovery; the atl:gatewayRoot preimage).
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,sGAAsG;AACtG,oGAAoG;AACpG,8EAA8E;AAC9E,EAAE;AACF,qGAAqG;AACrG,oFAAoF;AAEpF,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,WAAW,GACZ,MAAM,qBAAqB,CAAC;AAG7B,6GAA6G;AAC7G,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AA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AO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GAEnB,MAAM,gBAAgB,CAAC;AAExB,iGAAiG;AACjG,uFAAuF;AACvF,OAAO,EAAE,cAAc,EAAE,eAAe,EAA2B,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { CanonicalAgentId } from '@agenticprimitives/types';
|
|
2
|
+
import type { InteractionId, ParticipationV1 } from './interaction-record.js';
|
|
3
|
+
/** Shared rejection vocabulary. Every machine is fail-closed: an unknown or ill-timed move is a TYPED
|
|
4
|
+
* rejection, never a silent no-op, because a silent no-op is indistinguishable from success. */
|
|
5
|
+
export type MachineRejection = 'invalid-transition' | 'unauthorized-actor' | 'terminal-state' | 'wrong-subject';
|
|
6
|
+
export type MachineResult<T> = {
|
|
7
|
+
ok: true;
|
|
8
|
+
next: T;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
reason: MachineRejection;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* What one participant's client has done with an exchange. Deliberately separate from delivery: two
|
|
15
|
+
* recipients of the same exchange have different inbox states, and neither is a fact about the
|
|
16
|
+
* exchange itself.
|
|
17
|
+
*
|
|
18
|
+
* `read` is the state ADR-0058 §16 is most careful about. It means a client marked something read. It
|
|
19
|
+
* is not comprehension, not acknowledgement, not consent, and not acceptance.
|
|
20
|
+
*/
|
|
21
|
+
export type InboxState = 'unread' | 'read' | 'archived' | 'deleted';
|
|
22
|
+
export type InboxTransition = 'mark-read' | 'mark-unread' | 'archive' | 'restore' | 'delete';
|
|
23
|
+
export interface InboxEntryV1 {
|
|
24
|
+
/** WHOSE inbox. The state belongs to this viewer alone. */
|
|
25
|
+
viewer: CanonicalAgentId;
|
|
26
|
+
exchangeId: string;
|
|
27
|
+
state: InboxState;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Only the viewer moves their own inbox state.
|
|
32
|
+
*
|
|
33
|
+
* `deleted` is a tombstone, not an erasure: `restore` can bring it back, and the exchange itself is
|
|
34
|
+
* untouched. One participant deleting their copy must never remove the record other participants and
|
|
35
|
+
* the audit trail depend on.
|
|
36
|
+
*/
|
|
37
|
+
export declare function applyInboxTransition(entry: InboxEntryV1, event: {
|
|
38
|
+
transition: InboxTransition;
|
|
39
|
+
actor: CanonicalAgentId;
|
|
40
|
+
at: string;
|
|
41
|
+
}): MachineResult<InboxEntryV1>;
|
|
42
|
+
export type InteractionState = 'forming' | 'active' | 'suspended' | 'concluded' | 'abandoned';
|
|
43
|
+
export type InteractionTransition = 'open' | 'suspend' | 'resume' | 'conclude' | 'abandon';
|
|
44
|
+
export declare const TERMINAL_INTERACTION_STATES: readonly InteractionState[];
|
|
45
|
+
export interface InteractionLifecycleV1 {
|
|
46
|
+
interactionId: InteractionId;
|
|
47
|
+
state: InteractionState;
|
|
48
|
+
/** The SA custodying the interaction. Ending it is a custodial act, not a participant's. */
|
|
49
|
+
principal: CanonicalAgentId;
|
|
50
|
+
participations: readonly ParticipationV1[];
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Ending an interaction is CUSTODIAL — the principal, not any participant. A counterparty who could
|
|
55
|
+
* conclude a negotiation could end it the moment it stopped favouring them.
|
|
56
|
+
*
|
|
57
|
+
* Concluding does NOT touch commitments. That separation is the entire reason this machine and the
|
|
58
|
+
* commitment machine are distinct: otherwise closing a conversation quietly voids what was promised
|
|
59
|
+
* in it, and the party who benefits from that is exactly the party who closes it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyInteractionTransition(lifecycle: InteractionLifecycleV1, event: {
|
|
62
|
+
transition: InteractionTransition;
|
|
63
|
+
actor: CanonicalAgentId;
|
|
64
|
+
at: string;
|
|
65
|
+
}): MachineResult<InteractionLifecycleV1>;
|
|
66
|
+
/**
|
|
67
|
+
* A determination's own lifecycle, separate from the work it may authorize.
|
|
68
|
+
*
|
|
69
|
+
* `granted` means a decision was recorded. It does not mean anything ran, and it does not by itself
|
|
70
|
+
* permit anything — the authority re-check happens at the moment of acting regardless of what this
|
|
71
|
+
* says (ADR-0041). A `DecisionReceipt` attests that a decision was made, never that it was executed.
|
|
72
|
+
*/
|
|
73
|
+
export type DecisionState = 'pending' | 'granted' | 'refused' | 'withdrawn' | 'expired' | 'superseded';
|
|
74
|
+
export type DecisionTransition = 'grant' | 'refuse' | 'withdraw' | 'expire' | 'supersede';
|
|
75
|
+
export declare const TERMINAL_DECISION_STATES: readonly DecisionState[];
|
|
76
|
+
export interface DecisionRecordV1 {
|
|
77
|
+
decisionId: string;
|
|
78
|
+
state: DecisionState;
|
|
79
|
+
/** Whose determination this is. */
|
|
80
|
+
decider: CanonicalAgentId;
|
|
81
|
+
/** What it is about — an exchange, an act, a request. */
|
|
82
|
+
subject: string;
|
|
83
|
+
decidedAt?: string;
|
|
84
|
+
expiresAt?: string;
|
|
85
|
+
updatedAt: string;
|
|
86
|
+
}
|
|
87
|
+
/** Only the decider moves their own decision. `expire` is the exception: time is not an actor, so any
|
|
88
|
+
* party may record that the deadline passed, and only once it actually has. */
|
|
89
|
+
export declare function applyDecisionTransition(decision: DecisionRecordV1, event: {
|
|
90
|
+
transition: DecisionTransition;
|
|
91
|
+
actor: CanonicalAgentId;
|
|
92
|
+
at: string;
|
|
93
|
+
subject?: string;
|
|
94
|
+
}): MachineResult<DecisionRecordV1>;
|
|
95
|
+
/**
|
|
96
|
+
* A normative obligation with a debtor, a creditor and its own lifecycle.
|
|
97
|
+
*
|
|
98
|
+
* The two states doing the real work are `fulfilment-claimed` and `discharged`, and they are separate
|
|
99
|
+
* because the debtor saying "done" and the obligation ENDING are different facts with different
|
|
100
|
+
* signers. Collapsing them lets the party who owes the obligation declare it satisfied — which is the
|
|
101
|
+
* failure ADR-0058 §15 names when it says workflow completion discharges nothing on its own.
|
|
102
|
+
*/
|
|
103
|
+
export type CommitmentState = 'proposed' | 'active' | 'fulfilment-claimed' | 'discharged' | 'breached' | 'void';
|
|
104
|
+
export type CommitmentTransition = 'activate' | 'claim-fulfilment' | 'dispute-claim' | 'discharge' | 'assert-breach' | 'void';
|
|
105
|
+
export declare const TERMINAL_COMMITMENT_STATES: readonly CommitmentState[];
|
|
106
|
+
export interface CommitmentRecordV1 {
|
|
107
|
+
commitmentId: string;
|
|
108
|
+
state: CommitmentState;
|
|
109
|
+
/** Who owes. */
|
|
110
|
+
debtor: CanonicalAgentId;
|
|
111
|
+
/** Who is owed. */
|
|
112
|
+
creditor: CanonicalAgentId;
|
|
113
|
+
/** The Offer this obligation came from — an Offer is not a Commitment (ADR-0058 §15). */
|
|
114
|
+
fromOffer?: string;
|
|
115
|
+
updatedAt: string;
|
|
116
|
+
}
|
|
117
|
+
export declare function applyCommitmentTransition(commitment: CommitmentRecordV1, event: {
|
|
118
|
+
transition: CommitmentTransition;
|
|
119
|
+
actor: CanonicalAgentId;
|
|
120
|
+
at: string;
|
|
121
|
+
}): MachineResult<CommitmentRecordV1>;
|
|
122
|
+
/**
|
|
123
|
+
* Whether finishing the work discharges the obligation.
|
|
124
|
+
*
|
|
125
|
+
* The answer is NO unless the profile says otherwise, and this function exists so that answer has a
|
|
126
|
+
* name a caller can find instead of an assumption a caller can make. A profile MAY declare
|
|
127
|
+
* auto-discharge for obligations whose fulfilment is objectively observable (a payment settling); it
|
|
128
|
+
* MUST NOT for anything requiring the creditor's judgement, which is most things.
|
|
129
|
+
*
|
|
130
|
+
* There is no code path from an execution event to a commitment transition. That is deliberate: the
|
|
131
|
+
* link has to be written by a profile that chose it, so the choice appears in a diff.
|
|
132
|
+
*/
|
|
133
|
+
export declare function mayDischargeOnExecution(profile: {
|
|
134
|
+
autoDischargeOnExecution?: boolean;
|
|
135
|
+
}): boolean;
|
|
136
|
+
//# sourceMappingURL=interaction-machines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction-machines.d.ts","sourceRoot":"","sources":["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C;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/F,aAAa,CAAC,gBAAgB,CAAC,CAyBjC;AAID;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,QAAQ,GACR,oBAAoB,GACpB,YAAY,GACZ,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAC5B,UAAU,GACV,kBAAkB,GAClB,eAAe,GACf,WAAW,GACX,eAAe,GACf,MAAM,CAAC;AAEX,eAAO,MAAM,0BAA0B,EAAE,SAAS,eAAe,EAAuC,CAAC;AAEzG,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,eAAe,CAAC;IACvB,gBAAgB;IAChB,MAAM,EAAE,gBAAgB,CAAC;IACzB,mBAAmB;IACnB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAoBD,wBAAgB,yBAAyB,CACvC,UAAU,EAAE,kBAAkB,EAC9B,KAAK,EAAE;IAAE,UAAU,EAAE,oBAAoB,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC/E,aAAa,CAAC,kBAAkB,CAAC,CAYnC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE;IAAE,wBAAwB,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEhG"}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// The four state machines spec 340 §5 names and the fabric did not have.
|
|
2
|
+
//
|
|
3
|
+
// Six machines, never collapsed: `delivery · inbox · interaction · decision · commitment · execution`.
|
|
4
|
+
// Two exist — `ExecState` (delivery/transport) and `CaseState` (execution substate). These are the
|
|
5
|
+
// other four.
|
|
6
|
+
//
|
|
7
|
+
// WHY SIX AND NOT ONE. A single `status` field forces every question through one answer, and the
|
|
8
|
+
// answers genuinely differ. The chain that must never be short-circuited:
|
|
9
|
+
//
|
|
10
|
+
// delivered ≠ admitted ≠ authenticated ≠ canonical-agent-bound ≠ authorized ≠ executed ≠ completed
|
|
11
|
+
//
|
|
12
|
+
// Each collapse below is a real, specific misreading — not a theoretical one:
|
|
13
|
+
//
|
|
14
|
+
// inbox into delivery → "they read it" becomes "they agreed". Read state is PER-VIEWER and
|
|
15
|
+
// proves only that a client marked something read (ADR-0058 §16).
|
|
16
|
+
// decision into execution → a granted decision reads as work done. Deciding is not doing.
|
|
17
|
+
// commitment into execution → finishing the work discharges the obligation. It does not, unless the
|
|
18
|
+
// profile's discharge conditions are met (ADR-0058 §15) — which is why
|
|
19
|
+
// `claim-fulfilment` and `discharge` are two states with two signers.
|
|
20
|
+
// interaction into case → concluding a conversation silently voids what was promised in it.
|
|
21
|
+
//
|
|
22
|
+
// NONE OF THESE MACHINES IS AUTHORITY. They record what a situation IS, never what a party MAY do.
|
|
23
|
+
// A transition being legal here says nothing about whether the actor was permitted to make it —
|
|
24
|
+
// that is `delegation` + `entitlements` + `tool-policy`, re-evaluated at the moment of acting
|
|
25
|
+
// (ADR-0041, ADR-0043). The role checks below are integrity checks on the record's own shape
|
|
26
|
+
// ("the creditor releases their own claim"), not permission grants.
|
|
27
|
+
const INBOX_TRANSITIONS = {
|
|
28
|
+
'mark-read': { from: ['unread', 'archived'], to: 'read' },
|
|
29
|
+
// Reversible on purpose: marking unread is a UI affordance, and a machine that forbade it would push
|
|
30
|
+
// clients into tracking read state somewhere this machine could not see.
|
|
31
|
+
'mark-unread': { from: ['read', 'archived'], to: 'unread' },
|
|
32
|
+
archive: { from: ['unread', 'read'], to: 'archived' },
|
|
33
|
+
restore: { from: ['archived', 'deleted'], to: 'read' },
|
|
34
|
+
delete: { from: ['unread', 'read', 'archived'], to: 'deleted' },
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Only the viewer moves their own inbox state.
|
|
38
|
+
*
|
|
39
|
+
* `deleted` is a tombstone, not an erasure: `restore` can bring it back, and the exchange itself is
|
|
40
|
+
* untouched. One participant deleting their copy must never remove the record other participants and
|
|
41
|
+
* the audit trail depend on.
|
|
42
|
+
*/
|
|
43
|
+
export function applyInboxTransition(entry, event) {
|
|
44
|
+
if (event.actor !== entry.viewer)
|
|
45
|
+
return { ok: false, reason: 'unauthorized-actor' };
|
|
46
|
+
const spec = INBOX_TRANSITIONS[event.transition];
|
|
47
|
+
if (!spec)
|
|
48
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
49
|
+
if (!spec.from.includes(entry.state))
|
|
50
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
51
|
+
return { ok: true, next: { ...entry, state: spec.to, updatedAt: event.at } };
|
|
52
|
+
}
|
|
53
|
+
export const TERMINAL_INTERACTION_STATES = ['concluded', 'abandoned'];
|
|
54
|
+
const INTERACTION_TRANSITIONS = {
|
|
55
|
+
open: { from: ['forming'], to: 'active', custodialOnly: false },
|
|
56
|
+
suspend: { from: ['active'], to: 'suspended', custodialOnly: true },
|
|
57
|
+
resume: { from: ['suspended'], to: 'active', custodialOnly: true },
|
|
58
|
+
conclude: { from: ['active', 'suspended'], to: 'concluded', custodialOnly: true },
|
|
59
|
+
abandon: { from: ['forming', 'active', 'suspended'], to: 'abandoned', custodialOnly: true },
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Ending an interaction is CUSTODIAL — the principal, not any participant. A counterparty who could
|
|
63
|
+
* conclude a negotiation could end it the moment it stopped favouring them.
|
|
64
|
+
*
|
|
65
|
+
* Concluding does NOT touch commitments. That separation is the entire reason this machine and the
|
|
66
|
+
* commitment machine are distinct: otherwise closing a conversation quietly voids what was promised
|
|
67
|
+
* in it, and the party who benefits from that is exactly the party who closes it.
|
|
68
|
+
*/
|
|
69
|
+
export function applyInteractionTransition(lifecycle, event) {
|
|
70
|
+
const spec = INTERACTION_TRANSITIONS[event.transition];
|
|
71
|
+
if (!spec)
|
|
72
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
73
|
+
if (TERMINAL_INTERACTION_STATES.includes(lifecycle.state))
|
|
74
|
+
return { ok: false, reason: 'terminal-state' };
|
|
75
|
+
if (!spec.from.includes(lifecycle.state))
|
|
76
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
77
|
+
if (spec.custodialOnly) {
|
|
78
|
+
if (event.actor !== lifecycle.principal)
|
|
79
|
+
return { ok: false, reason: 'unauthorized-actor' };
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const isParticipant = lifecycle.participations.some((p) => p.agent === event.actor && p.leftAt === undefined);
|
|
83
|
+
if (!isParticipant && event.actor !== lifecycle.principal)
|
|
84
|
+
return { ok: false, reason: 'unauthorized-actor' };
|
|
85
|
+
}
|
|
86
|
+
return { ok: true, next: { ...lifecycle, state: spec.to, updatedAt: event.at } };
|
|
87
|
+
}
|
|
88
|
+
export const TERMINAL_DECISION_STATES = [
|
|
89
|
+
'refused', 'withdrawn', 'expired', 'superseded',
|
|
90
|
+
];
|
|
91
|
+
const DECISION_TRANSITIONS = {
|
|
92
|
+
grant: { from: ['pending'], to: 'granted' },
|
|
93
|
+
refuse: { from: ['pending'], to: 'refused' },
|
|
94
|
+
// A GRANT may be withdrawn; a refusal may not be "un-refused" into nothing — reversing a refusal is
|
|
95
|
+
// a NEW decision, so the trail shows both rather than one mutable verdict.
|
|
96
|
+
withdraw: { from: ['pending', 'granted'], to: 'withdrawn' },
|
|
97
|
+
expire: { from: ['pending', 'granted'], to: 'expired' },
|
|
98
|
+
supersede: { from: ['pending', 'granted'], to: 'superseded' },
|
|
99
|
+
};
|
|
100
|
+
/** Only the decider moves their own decision. `expire` is the exception: time is not an actor, so any
|
|
101
|
+
* party may record that the deadline passed, and only once it actually has. */
|
|
102
|
+
export function applyDecisionTransition(decision, event) {
|
|
103
|
+
if (event.subject !== undefined && event.subject !== decision.subject) {
|
|
104
|
+
return { ok: false, reason: 'wrong-subject' };
|
|
105
|
+
}
|
|
106
|
+
const spec = DECISION_TRANSITIONS[event.transition];
|
|
107
|
+
if (!spec)
|
|
108
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
109
|
+
if (!spec.from.includes(decision.state)) {
|
|
110
|
+
return { ok: false, reason: TERMINAL_DECISION_STATES.includes(decision.state) ? 'terminal-state' : 'invalid-transition' };
|
|
111
|
+
}
|
|
112
|
+
if (event.transition === 'expire') {
|
|
113
|
+
if (decision.expiresAt === undefined || Date.parse(event.at) < Date.parse(decision.expiresAt)) {
|
|
114
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else if (event.actor !== decision.decider) {
|
|
118
|
+
return { ok: false, reason: 'unauthorized-actor' };
|
|
119
|
+
}
|
|
120
|
+
return {
|
|
121
|
+
ok: true,
|
|
122
|
+
next: {
|
|
123
|
+
...decision,
|
|
124
|
+
state: spec.to,
|
|
125
|
+
decidedAt: spec.to === 'granted' || spec.to === 'refused' ? event.at : decision.decidedAt,
|
|
126
|
+
updatedAt: event.at,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export const TERMINAL_COMMITMENT_STATES = ['discharged', 'breached', 'void'];
|
|
131
|
+
const COMMITMENT_TRANSITIONS = {
|
|
132
|
+
// Activation follows a VALID, authorized Accept. This machine records that it happened; it does not
|
|
133
|
+
// judge the acceptance — acceptance by an unauthorized party creates nothing, and the check for that
|
|
134
|
+
// lives in the authority layer, which is why no amount of calling `activate` here can substitute.
|
|
135
|
+
activate: { from: ['proposed'], to: 'active', signers: ['creditor'] },
|
|
136
|
+
'claim-fulfilment': { from: ['active'], to: 'fulfilment-claimed', signers: ['debtor'] },
|
|
137
|
+
'dispute-claim': { from: ['fulfilment-claimed'], to: 'active', signers: ['creditor'] },
|
|
138
|
+
discharge: { from: ['active', 'fulfilment-claimed'], to: 'discharged', signers: ['creditor'] },
|
|
139
|
+
'assert-breach': { from: ['active', 'fulfilment-claimed'], to: 'breached', signers: ['creditor'] },
|
|
140
|
+
// Only the creditor voids: giving up your own claim is yours to do; cancelling what you owe is not.
|
|
141
|
+
void: { from: ['proposed', 'active'], to: 'void', signers: ['creditor'] },
|
|
142
|
+
};
|
|
143
|
+
export function applyCommitmentTransition(commitment, event) {
|
|
144
|
+
const spec = COMMITMENT_TRANSITIONS[event.transition];
|
|
145
|
+
if (!spec)
|
|
146
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
147
|
+
if (TERMINAL_COMMITMENT_STATES.includes(commitment.state))
|
|
148
|
+
return { ok: false, reason: 'terminal-state' };
|
|
149
|
+
if (!spec.from.includes(commitment.state))
|
|
150
|
+
return { ok: false, reason: 'invalid-transition' };
|
|
151
|
+
const parties = new Set();
|
|
152
|
+
if (event.actor === commitment.debtor)
|
|
153
|
+
parties.add('debtor');
|
|
154
|
+
if (event.actor === commitment.creditor)
|
|
155
|
+
parties.add('creditor');
|
|
156
|
+
if (!spec.signers.some((p) => parties.has(p)))
|
|
157
|
+
return { ok: false, reason: 'unauthorized-actor' };
|
|
158
|
+
return { ok: true, next: { ...commitment, state: spec.to, updatedAt: event.at } };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Whether finishing the work discharges the obligation.
|
|
162
|
+
*
|
|
163
|
+
* The answer is NO unless the profile says otherwise, and this function exists so that answer has a
|
|
164
|
+
* name a caller can find instead of an assumption a caller can make. A profile MAY declare
|
|
165
|
+
* auto-discharge for obligations whose fulfilment is objectively observable (a payment settling); it
|
|
166
|
+
* MUST NOT for anything requiring the creditor's judgement, which is most things.
|
|
167
|
+
*
|
|
168
|
+
* There is no code path from an execution event to a commitment transition. That is deliberate: the
|
|
169
|
+
* link has to be written by a profile that chose it, so the choice appears in a diff.
|
|
170
|
+
*/
|
|
171
|
+
export function mayDischargeOnExecution(profile) {
|
|
172
|
+
return profile.autoDischargeOnExecution === true;
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=interaction-machines.js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