@decionis/agentsafe 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Index.d.ts +4 -1
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +4 -1
- package/dist/Index.js.map +1 -1
- package/dist/adapters/AdapterActionHandler.d.ts +36 -12
- package/dist/adapters/AdapterActionHandler.d.ts.map +1 -1
- package/dist/adapters/AdapterActionHandler.js +99 -100
- package/dist/adapters/AdapterActionHandler.js.map +1 -1
- package/dist/adapters/EffectAdapter.d.ts +7 -103
- package/dist/adapters/EffectAdapter.d.ts.map +1 -1
- package/dist/adapters/EffectAdapter.js +7 -18
- package/dist/adapters/EffectAdapter.js.map +1 -1
- package/dist/adapters/EffectAdapterExecutor.d.ts +93 -0
- package/dist/adapters/EffectAdapterExecutor.d.ts.map +1 -0
- package/dist/adapters/EffectAdapterExecutor.js +191 -0
- package/dist/adapters/EffectAdapterExecutor.js.map +1 -0
- package/dist/adapters/banking/BankingExecutor.d.ts +35 -0
- package/dist/adapters/banking/BankingExecutor.d.ts.map +1 -0
- package/dist/adapters/banking/BankingExecutor.js +64 -0
- package/dist/adapters/banking/BankingExecutor.js.map +1 -0
- package/dist/adapters/banking/BankingHandlers.d.ts.map +1 -1
- package/dist/adapters/banking/BankingHandlers.js +6 -3
- package/dist/adapters/banking/BankingHandlers.js.map +1 -1
- package/dist/adapters/cards/CardAuthorizationExecutor.d.ts +66 -0
- package/dist/adapters/cards/CardAuthorizationExecutor.d.ts.map +1 -0
- package/dist/adapters/cards/CardAuthorizationExecutor.js +116 -0
- package/dist/adapters/cards/CardAuthorizationExecutor.js.map +1 -0
- package/dist/cli/Doctor.d.ts.map +1 -1
- package/dist/cli/Doctor.js +2 -1
- package/dist/cli/Doctor.js.map +1 -1
- package/dist/journal/ExecutionJournal.d.ts +5 -120
- package/dist/journal/ExecutionJournal.d.ts.map +1 -1
- package/dist/journal/ExecutionJournal.js +5 -125
- package/dist/journal/ExecutionJournal.js.map +1 -1
- package/dist/journal/FileExecutionJournal.d.ts +1 -0
- package/dist/journal/FileExecutionJournal.d.ts.map +1 -1
- package/dist/journal/FileExecutionJournal.js +4 -1
- package/dist/journal/FileExecutionJournal.js.map +1 -1
- package/dist/journal/InMemoryExecutionJournal.d.ts +2 -1
- package/dist/journal/InMemoryExecutionJournal.d.ts.map +1 -1
- package/dist/journal/InMemoryExecutionJournal.js +4 -1
- package/dist/journal/InMemoryExecutionJournal.js.map +1 -1
- package/dist/service/TrustedExecutorService.d.ts.map +1 -1
- package/dist/service/TrustedExecutorService.js +19 -10
- package/dist/service/TrustedExecutorService.js.map +1 -1
- package/dist/time/MonotonicClock.d.ts +4 -32
- package/dist/time/MonotonicClock.d.ts.map +1 -1
- package/dist/time/MonotonicClock.js +4 -49
- package/dist/time/MonotonicClock.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ClaimedExecution, EffectObservation, EffectPreparedAction, ExecutionCapability, ExecutionEffect, NativeExecutor, PreparedAction, ReconcileResult } from "@decionis/agent-safe-pipeline";
|
|
2
|
+
import type { RegisteredEffect } from "../EffectEvidenceRegister.js";
|
|
3
|
+
import { type CardAuthorizationRequest, type CardAuthorizationResult, type CardPurchase } from "./CardPurchase.js";
|
|
4
|
+
export declare const CARD_ISSUER_PLATFORM = "card-issuer";
|
|
5
|
+
/**
|
|
6
|
+
* What the issuer reported about an authorization it was told to approve,
|
|
7
|
+
* with the attempt it belongs to: the purchase and the projection its grant
|
|
8
|
+
* was bound to, the issuer's request and result, and whether the claim's
|
|
9
|
+
* lease had closed by the time the result arrived.
|
|
10
|
+
*/
|
|
11
|
+
export interface CardAuthorizationReceipt {
|
|
12
|
+
readonly purchase: CardPurchase;
|
|
13
|
+
readonly prepared: EffectPreparedAction;
|
|
14
|
+
readonly request: CardAuthorizationRequest;
|
|
15
|
+
readonly result: CardAuthorizationResult;
|
|
16
|
+
readonly leaseExpired: boolean;
|
|
17
|
+
readonly correlationId: string;
|
|
18
|
+
readonly idempotencyKey: string;
|
|
19
|
+
}
|
|
20
|
+
export interface CardAuthorizationExecutorOptions {
|
|
21
|
+
/** The observer the effect record and the authority name. */
|
|
22
|
+
readonly observer: {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly version: string;
|
|
25
|
+
};
|
|
26
|
+
readonly clock?: () => Date;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The cards family on `agent-safe.executors.native/1`, permit style: the
|
|
30
|
+
* issuer performs the effect, when its real-time authorization hook asks, so
|
|
31
|
+
* this executor never writes anything. The grant is held when the purchase
|
|
32
|
+
* is decided; the issuer's authorization request presents it, which claims
|
|
33
|
+
* it once; the permit is the approval the issuer is answered with; and the
|
|
34
|
+
* issuer's result is the receipt that settles it.
|
|
35
|
+
*
|
|
36
|
+
* - `observe` reads the result into the family's effect record: an approval
|
|
37
|
+
* within the ceiling is the authorised effect, a decline is a refusal, and
|
|
38
|
+
* a result after the claim's lease is indeterminate whatever it says.
|
|
39
|
+
* - `reconcile` has no one to ask: the issuer is the system of record and
|
|
40
|
+
* this boundary has no read path into it, so an authorization whose result
|
|
41
|
+
* never arrived stays unknown until someone who can see the issuer's ledger
|
|
42
|
+
* says.
|
|
43
|
+
*/
|
|
44
|
+
export declare class CardAuthorizationExecutor implements NativeExecutor<CardPurchase, CardAuthorizationReceipt, RegisteredEffect> {
|
|
45
|
+
readonly platform = "card-issuer";
|
|
46
|
+
readonly style: "permit";
|
|
47
|
+
readonly actionTypes: readonly string[];
|
|
48
|
+
readonly version: string;
|
|
49
|
+
private readonly observer;
|
|
50
|
+
private readonly clock;
|
|
51
|
+
constructor(options: CardAuthorizationExecutorOptions);
|
|
52
|
+
capabilities(): Promise<readonly ExecutionCapability[]>;
|
|
53
|
+
/**
|
|
54
|
+
* The purchase as an intent: this card, at this merchant, for at most this
|
|
55
|
+
* amount, bound to the projection the issuer's result is later compared
|
|
56
|
+
* with. The retry identity is the purchase's own digest, so the same
|
|
57
|
+
* purchase proposed twice is one purchase.
|
|
58
|
+
*/
|
|
59
|
+
prepare(purchase: CardPurchase): Promise<PreparedAction>;
|
|
60
|
+
/** The permit the issuer is answered with: this grant, for this intent, until it expires. */
|
|
61
|
+
execute(run: ClaimedExecution<CardPurchase>): Promise<ExecutionEffect<CardAuthorizationReceipt>>;
|
|
62
|
+
/** The issuer's result as the family's effect record; anything but a receipt is unknown. */
|
|
63
|
+
observe(effect: ExecutionEffect<CardAuthorizationReceipt>): Promise<EffectObservation<RegisteredEffect>>;
|
|
64
|
+
reconcile(): Promise<ReconcileResult<RegisteredEffect>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=CardAuthorizationExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardAuthorizationExecutor.d.ts","sourceRoot":"","sources":["../../../src/adapters/cards/CardAuthorizationExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EAEf,cAAc,EACd,cAAc,EACd,eAAe,EAChB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAGL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC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EffectEvidenceBuilder.js";
|
|
2
|
+
import { cardResultRecord, prepareCardPurchase } from "./CardEffect.js";
|
|
3
|
+
import { CARD_PURCHASE_ACTION, cardTarget, } from "./CardPurchase.js";
|
|
4
|
+
export const CARD_ISSUER_PLATFORM = "card-issuer";
|
|
5
|
+
/**
|
|
6
|
+
* The cards family on `agent-safe.executors.native/1`, permit style: the
|
|
7
|
+
* issuer performs the effect, when its real-time authorization hook asks, so
|
|
8
|
+
* this executor never writes anything. The grant is held when the purchase
|
|
9
|
+
* is decided; the issuer's authorization request presents it, which claims
|
|
10
|
+
* it once; the permit is the approval the issuer is answered with; and the
|
|
11
|
+
* issuer's result is the receipt that settles it.
|
|
12
|
+
*
|
|
13
|
+
* - `observe` reads the result into the family's effect record: an approval
|
|
14
|
+
* within the ceiling is the authorised effect, a decline is a refusal, and
|
|
15
|
+
* a result after the claim's lease is indeterminate whatever it says.
|
|
16
|
+
* - `reconcile` has no one to ask: the issuer is the system of record and
|
|
17
|
+
* this boundary has no read path into it, so an authorization whose result
|
|
18
|
+
* never arrived stays unknown until someone who can see the issuer's ledger
|
|
19
|
+
* says.
|
|
20
|
+
*/
|
|
21
|
+
export class CardAuthorizationExecutor {
|
|
22
|
+
platform = CARD_ISSUER_PLATFORM;
|
|
23
|
+
style = "permit";
|
|
24
|
+
actionTypes = [CARD_PURCHASE_ACTION];
|
|
25
|
+
version;
|
|
26
|
+
observer;
|
|
27
|
+
clock;
|
|
28
|
+
constructor(options) {
|
|
29
|
+
this.observer = options.observer;
|
|
30
|
+
this.version = options.observer.version;
|
|
31
|
+
this.clock = options.clock ?? (() => new Date());
|
|
32
|
+
}
|
|
33
|
+
async capabilities() {
|
|
34
|
+
return await Promise.resolve([
|
|
35
|
+
{
|
|
36
|
+
platform: this.platform,
|
|
37
|
+
actionType: CARD_PURCHASE_ACTION,
|
|
38
|
+
enabled: true,
|
|
39
|
+
scopeGranted: true,
|
|
40
|
+
connected: true,
|
|
41
|
+
requirement: "",
|
|
42
|
+
},
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The purchase as an intent: this card, at this merchant, for at most this
|
|
47
|
+
* amount, bound to the projection the issuer's result is later compared
|
|
48
|
+
* with. The retry identity is the purchase's own digest, so the same
|
|
49
|
+
* purchase proposed twice is one purchase.
|
|
50
|
+
*/
|
|
51
|
+
async prepare(purchase) {
|
|
52
|
+
const effect = prepareCardPurchase(purchase);
|
|
53
|
+
return await Promise.resolve({
|
|
54
|
+
actionType: CARD_PURCHASE_ACTION,
|
|
55
|
+
proposal: {
|
|
56
|
+
action: CARD_PURCHASE_ACTION,
|
|
57
|
+
target: cardTarget(purchase),
|
|
58
|
+
parameters: purchase,
|
|
59
|
+
},
|
|
60
|
+
downstreamTarget: { system: CARD_ISSUER_PLATFORM, operation: "authorize" },
|
|
61
|
+
idempotencyKey: `card-purchase:${effect.intentDigest}`,
|
|
62
|
+
expectedEffectDigest: effect.expectedEffectDigest,
|
|
63
|
+
requestDigest: effect.requestDigest,
|
|
64
|
+
facts: {},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** The permit the issuer is answered with: this grant, for this intent, until it expires. */
|
|
68
|
+
async execute(run) {
|
|
69
|
+
return await Promise.resolve({
|
|
70
|
+
kind: "PERMIT",
|
|
71
|
+
permit: {
|
|
72
|
+
permitId: run.authorization.grantId,
|
|
73
|
+
intentHash: run.intent.intentHash,
|
|
74
|
+
expiresAt: run.authorization.expiresAt,
|
|
75
|
+
...(run.authorization.claimAttestation === undefined
|
|
76
|
+
? {}
|
|
77
|
+
: { claimAttestation: run.authorization.claimAttestation }),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/** The issuer's result as the family's effect record; anything but a receipt is unknown. */
|
|
82
|
+
async observe(effect) {
|
|
83
|
+
if (effect.kind !== "RECEIPT") {
|
|
84
|
+
return await Promise.resolve({ status: "INDETERMINATE", reason: null, result: null });
|
|
85
|
+
}
|
|
86
|
+
const receipt = effect.receipt;
|
|
87
|
+
const record = cardResultRecord({
|
|
88
|
+
purchase: receipt.purchase,
|
|
89
|
+
prepared: receipt.prepared,
|
|
90
|
+
authorization: receipt.request,
|
|
91
|
+
result: receipt.result,
|
|
92
|
+
leaseExpired: receipt.leaseExpired,
|
|
93
|
+
observer: this.observer,
|
|
94
|
+
correlationId: receipt.correlationId,
|
|
95
|
+
idempotencyKey: receipt.idempotencyKey,
|
|
96
|
+
observedAt: this.clock().toISOString(),
|
|
97
|
+
});
|
|
98
|
+
const evidence = authorityEffectEvidence(record, receipt.correlationId, this.observer);
|
|
99
|
+
if (record.outcome === "INDETERMINATE") {
|
|
100
|
+
return { status: "INDETERMINATE", reason: null, result: record, evidence };
|
|
101
|
+
}
|
|
102
|
+
if (record.outcome === "FAILED") {
|
|
103
|
+
return {
|
|
104
|
+
status: "FAILED",
|
|
105
|
+
reason: record.reasonCodes[0] ?? "ISSUER_DECLINED",
|
|
106
|
+
result: record,
|
|
107
|
+
evidence,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
return { status: "COMMITTED", reason: null, result: record, evidence };
|
|
111
|
+
}
|
|
112
|
+
async reconcile() {
|
|
113
|
+
return await Promise.resolve({ status: "UNKNOWN" });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=CardAuthorizationExecutor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardAuthorizationExecutor.js","sourceRoot":"","sources":["../../../src/adapters/cards/CardAuthorizationExecutor.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,UAAU,GAIX,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAwBlD;;;;;;;;;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,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE;SACvC,CAAC,CAAC;QACH,MAAM,QAAQ,GAA4B,uBAAuB,CAC/D,MAAM,EACN,OAAO,CAAC,aAAa,EACrB,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,IAAI,MAAM,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;YACvC,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC7E,CAAC;QACD,IAAI,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;YAChC,OAAO;gBACL,MAAM,EAAE,QAAQ;gBAChB,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,iBAAiB;gBAClD,MAAM,EAAE,MAAM;gBACd,QAAQ;aACT,CAAC;QACJ,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACzE,CAAC;IAEM,KAAK,CAAC,SAAS;QACpB,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;IACtD,CAAC;CACF"}
|
package/dist/cli/Doctor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Doctor.d.ts","sourceRoot":"","sources":["../../src/cli/Doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Doctor.d.ts","sourceRoot":"","sources":["../../src/cli/Doctor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AAEX,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8CAA8C;IAC9C,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAgCD;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,EAAE,EAAE,UAAU,EACd,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CA4KjC"}
|
package/dist/cli/Doctor.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AuthorityPaths } from "@decionis/agent-safe-pipeline";
|
|
1
2
|
import { packageVersion } from "../Version.js";
|
|
2
3
|
import { parseArguments, ArgumentError } from "./Arguments.js";
|
|
3
4
|
import { credentialsPath, readCredentials } from "./Credentials.js";
|
|
@@ -127,7 +128,7 @@ export async function runDoctor(io, argv, options = {}) {
|
|
|
127
128
|
});
|
|
128
129
|
}
|
|
129
130
|
else {
|
|
130
|
-
const auth = await probe(io.fetch, `${config.authority.endpoint}
|
|
131
|
+
const auth = await probe(io.fetch, `${config.authority.endpoint}${AuthorityPaths.GRANTS}`, {
|
|
131
132
|
method: "POST",
|
|
132
133
|
headers: { authorization: `Bearer ${key}`, "content-type": "application/json" },
|
|
133
134
|
body: "{}",
|
package/dist/cli/Doctor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Doctor.js","sourceRoot":"","sources":["../../src/cli/Doctor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Doctor.js","sourceRoot":"","sources":["../../src/cli/Doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,OAAO,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CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,2BAA2B,EACtF,EAAE,CACH,CAAC;QACF,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAClB,EAAc,EACd,GAAiD;IAEjD,MAAM,IAAI,GAAG,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -1,123 +1,8 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const JOURNAL_VERSION = "agent-safe.attempts/1";
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* whole on `ATTEMPT_OPENED`, because reconciliation needs the exact intent
|
|
9
|
-
* it was and nothing less will re-hash to the same value.
|
|
2
|
+
* The journal port moved into `@decionis/agent-safe-pipeline` with the runner
|
|
3
|
+
* that journals through it (`GovernedExecutionRunner`). Re-exported here so
|
|
4
|
+
* every journal in this package, and every existing import, implements and
|
|
5
|
+
* names the one contract.
|
|
10
6
|
*/
|
|
11
|
-
export
|
|
12
|
-
record: z.ZodLiteral<"ATTEMPT_OPENED">;
|
|
13
|
-
at: z.ZodString;
|
|
14
|
-
intent_id: z.ZodString;
|
|
15
|
-
intent_hash: z.ZodString;
|
|
16
|
-
idempotency_key: z.ZodString;
|
|
17
|
-
decision_id: z.ZodString;
|
|
18
|
-
dossier_id: z.ZodString;
|
|
19
|
-
caller_principal: z.ZodNullable<z.ZodString>;
|
|
20
|
-
intent: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
21
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
-
record: z.ZodLiteral<"GRANT_CLAIMED">;
|
|
23
|
-
at: z.ZodString;
|
|
24
|
-
intent_id: z.ZodString;
|
|
25
|
-
intent_hash: z.ZodString;
|
|
26
|
-
idempotency_key: z.ZodString;
|
|
27
|
-
grant_id: z.ZodString;
|
|
28
|
-
expires_at: z.ZodString;
|
|
29
|
-
request_digest: z.ZodString;
|
|
30
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
-
record: z.ZodLiteral<"ATTEMPT_CLOSED">;
|
|
32
|
-
at: z.ZodString;
|
|
33
|
-
intent_id: z.ZodString;
|
|
34
|
-
intent_hash: z.ZodString;
|
|
35
|
-
outcome: z.ZodString;
|
|
36
|
-
executed: z.ZodNullable<z.ZodBoolean>;
|
|
37
|
-
finalization: z.ZodNullable<z.ZodEnum<{
|
|
38
|
-
PENDING: "PENDING";
|
|
39
|
-
RECORDED: "RECORDED";
|
|
40
|
-
UNSUPPORTED: "UNSUPPORTED";
|
|
41
|
-
}>>;
|
|
42
|
-
}, z.core.$strict>, z.ZodObject<{
|
|
43
|
-
record: z.ZodLiteral<"RECONCILED">;
|
|
44
|
-
at: z.ZodString;
|
|
45
|
-
intent_id: z.ZodString;
|
|
46
|
-
intent_hash: z.ZodString;
|
|
47
|
-
status: z.ZodEnum<{
|
|
48
|
-
BLOCKED: "BLOCKED";
|
|
49
|
-
COMPLETED: "COMPLETED";
|
|
50
|
-
DEFINITELY_NOT_EXECUTED: "DEFINITELY_NOT_EXECUTED";
|
|
51
|
-
UNKNOWN_AFTER_DISPATCH: "UNKNOWN_AFTER_DISPATCH";
|
|
52
|
-
}>;
|
|
53
|
-
source: z.ZodEnum<{
|
|
54
|
-
STARTUP: "STARTUP";
|
|
55
|
-
CALLER: "CALLER";
|
|
56
|
-
}>;
|
|
57
|
-
}, z.core.$strict>], "record">;
|
|
58
|
-
export type JournalRecord = z.infer<typeof JournalRecordSchema>;
|
|
59
|
-
export type JournalRecordKind = JournalRecord["record"];
|
|
60
|
-
/** An attempt whose outcome the journal does not know, as the reconciler finds it. */
|
|
61
|
-
export interface OpenAttempt {
|
|
62
|
-
readonly intentId: string;
|
|
63
|
-
readonly intentHash: string;
|
|
64
|
-
readonly idempotencyKey: string;
|
|
65
|
-
readonly openedAt: string;
|
|
66
|
-
readonly decisionId: string;
|
|
67
|
-
readonly dossierId: string;
|
|
68
|
-
readonly grantId: string | null;
|
|
69
|
-
readonly expiresAt: string | null;
|
|
70
|
-
readonly callerPrincipal: string | null;
|
|
71
|
-
/** `CLAIMED`: a grant was consumed, so the provider may have acted. `OPENED`: it never was. */
|
|
72
|
-
readonly state: "OPENED" | "CLAIMED";
|
|
73
|
-
readonly intent: Readonly<Record<string, unknown>>;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* What one attempt was dispatched under: the decision it was opened for and
|
|
77
|
-
* the grant it claimed before the provider was touched. The shape is the
|
|
78
|
-
* pipeline's `VerifiedAuthorization`, so a reconciliation can be held
|
|
79
|
-
* against it field for field.
|
|
80
|
-
*/
|
|
81
|
-
export interface DispatchedAuthorization {
|
|
82
|
-
readonly decisionId: string;
|
|
83
|
-
readonly dossierId: string;
|
|
84
|
-
readonly grantId: string;
|
|
85
|
-
readonly intentHash: string;
|
|
86
|
-
readonly expiresAt: string;
|
|
87
|
-
}
|
|
88
|
-
/** A refusal by the journal: the code, never a path or a value. */
|
|
89
|
-
export declare class JournalError extends Error {
|
|
90
|
-
readonly code: string;
|
|
91
|
-
constructor(code: string);
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Where the executor writes what it is about to do, before it does it. The
|
|
95
|
-
* contract is deliberately small: append a record, and read back the
|
|
96
|
-
* attempts whose outcome is not yet known. Nothing here reaches the audit
|
|
97
|
-
* stream or an evidence export; the journal holds the request's own
|
|
98
|
-
* parameters, which the evidence planes never carry.
|
|
99
|
-
*/
|
|
100
|
-
export interface ExecutionJournal {
|
|
101
|
-
/** Appends one record durably. It must throw rather than lose a record. */
|
|
102
|
-
append(record: JournalRecord): Promise<void>;
|
|
103
|
-
/** Attempts opened and not closed or reconciled, oldest first. */
|
|
104
|
-
openAttempts(): Promise<readonly OpenAttempt[]>;
|
|
105
|
-
/**
|
|
106
|
-
* Every authorization one intent was dispatched under, however the attempt
|
|
107
|
-
* ended, oldest first: what a caller's reconciliation is held against.
|
|
108
|
-
*/
|
|
109
|
-
authorizationsOf(intentId: string): Promise<readonly DispatchedAuthorization[]>;
|
|
110
|
-
close(): void;
|
|
111
|
-
}
|
|
112
|
-
/** Folds a stream of records into the attempts still open, oldest first. */
|
|
113
|
-
export declare function openAttemptsFrom(records: Iterable<JournalRecord>): readonly OpenAttempt[];
|
|
114
|
-
/**
|
|
115
|
-
* Folds a stream of records into the authorizations one intent was
|
|
116
|
-
* dispatched under, oldest first. Only a claimed attempt was dispatched: one
|
|
117
|
-
* opened and never claimed consumed no grant, and a claim with no opening
|
|
118
|
-
* record names no decision, so neither is anything to reconcile. Closing and
|
|
119
|
-
* reconciling records are ignored, because what an attempt was dispatched
|
|
120
|
-
* under does not change when its outcome becomes known.
|
|
121
|
-
*/
|
|
122
|
-
export declare function authorizationsFrom(records: Iterable<JournalRecord>, intentId: string): readonly DispatchedAuthorization[];
|
|
7
|
+
export { authorizationsFrom, dispatchedUnderFrom, IDEMPOTENCY_KEY_DISPATCHED, JOURNAL_VERSION, JournalError, JournalRecordSchema, openAttemptsFrom, type DispatchedAuthorization, type ExecutionJournal, type JournalRecord, type JournalRecordKind, type OpenAttempt, } from "@decionis/agent-safe-pipeline";
|
|
123
8
|
//# sourceMappingURL=ExecutionJournal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionJournal.d.ts","sourceRoot":"","sources":["../../src/journal/ExecutionJournal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ExecutionJournal.d.ts","sourceRoot":"","sources":["../../src/journal/ExecutionJournal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC"}
|
|
@@ -1,128 +1,8 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export const JOURNAL_VERSION = "agent-safe.attempts/1";
|
|
3
|
-
const identifier = z.string().trim().min(1).max(200);
|
|
4
|
-
const hash = z.string().regex(/^sha256:[0-9a-f]{64}$/);
|
|
5
1
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* whole on `ATTEMPT_OPENED`, because reconciliation needs the exact intent
|
|
11
|
-
* it was and nothing less will re-hash to the same value.
|
|
2
|
+
* The journal port moved into `@decionis/agent-safe-pipeline` with the runner
|
|
3
|
+
* that journals through it (`GovernedExecutionRunner`). Re-exported here so
|
|
4
|
+
* every journal in this package, and every existing import, implements and
|
|
5
|
+
* names the one contract.
|
|
12
6
|
*/
|
|
13
|
-
export
|
|
14
|
-
z.strictObject({
|
|
15
|
-
record: z.literal("ATTEMPT_OPENED"),
|
|
16
|
-
at: z.string().datetime(),
|
|
17
|
-
intent_id: identifier,
|
|
18
|
-
intent_hash: hash,
|
|
19
|
-
idempotency_key: z.string().trim().min(1).max(180),
|
|
20
|
-
decision_id: identifier,
|
|
21
|
-
dossier_id: identifier,
|
|
22
|
-
caller_principal: identifier.nullable(),
|
|
23
|
-
/** The captured intent, verbatim, so a restart can present it again. */
|
|
24
|
-
intent: z.record(z.string(), z.unknown()),
|
|
25
|
-
}),
|
|
26
|
-
z.strictObject({
|
|
27
|
-
record: z.literal("GRANT_CLAIMED"),
|
|
28
|
-
at: z.string().datetime(),
|
|
29
|
-
intent_id: identifier,
|
|
30
|
-
intent_hash: hash,
|
|
31
|
-
idempotency_key: z.string().trim().min(1).max(180),
|
|
32
|
-
grant_id: identifier,
|
|
33
|
-
expires_at: z.string().datetime(),
|
|
34
|
-
/** SHA-256 over the canonical parameters the handler is about to send. */
|
|
35
|
-
request_digest: hash,
|
|
36
|
-
}),
|
|
37
|
-
z.strictObject({
|
|
38
|
-
record: z.literal("ATTEMPT_CLOSED"),
|
|
39
|
-
at: z.string().datetime(),
|
|
40
|
-
intent_id: identifier,
|
|
41
|
-
intent_hash: hash,
|
|
42
|
-
outcome: z.string().trim().min(1).max(64),
|
|
43
|
-
executed: z.boolean().nullable(),
|
|
44
|
-
finalization: z.enum(["RECORDED", "PENDING", "UNSUPPORTED"]).nullable(),
|
|
45
|
-
}),
|
|
46
|
-
z.strictObject({
|
|
47
|
-
record: z.literal("RECONCILED"),
|
|
48
|
-
at: z.string().datetime(),
|
|
49
|
-
intent_id: identifier,
|
|
50
|
-
intent_hash: hash,
|
|
51
|
-
status: z.enum(["COMPLETED", "DEFINITELY_NOT_EXECUTED", "UNKNOWN_AFTER_DISPATCH", "BLOCKED"]),
|
|
52
|
-
source: z.enum(["STARTUP", "CALLER"]),
|
|
53
|
-
}),
|
|
54
|
-
]);
|
|
55
|
-
/** A refusal by the journal: the code, never a path or a value. */
|
|
56
|
-
export class JournalError extends Error {
|
|
57
|
-
code;
|
|
58
|
-
constructor(code) {
|
|
59
|
-
super(code);
|
|
60
|
-
this.code = code;
|
|
61
|
-
this.name = "JournalError";
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/** Folds a stream of records into the attempts still open, oldest first. */
|
|
65
|
-
export function openAttemptsFrom(records) {
|
|
66
|
-
const open = new Map();
|
|
67
|
-
for (const record of records) {
|
|
68
|
-
if (record.record === "ATTEMPT_OPENED") {
|
|
69
|
-
open.set(record.intent_id, {
|
|
70
|
-
intentId: record.intent_id,
|
|
71
|
-
intentHash: record.intent_hash,
|
|
72
|
-
idempotencyKey: record.idempotency_key,
|
|
73
|
-
openedAt: record.at,
|
|
74
|
-
decisionId: record.decision_id,
|
|
75
|
-
dossierId: record.dossier_id,
|
|
76
|
-
grantId: null,
|
|
77
|
-
expiresAt: null,
|
|
78
|
-
callerPrincipal: record.caller_principal,
|
|
79
|
-
state: "OPENED",
|
|
80
|
-
intent: record.intent,
|
|
81
|
-
});
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
if (record.record === "GRANT_CLAIMED") {
|
|
85
|
-
const attempt = open.get(record.intent_id);
|
|
86
|
-
if (attempt !== undefined) {
|
|
87
|
-
open.set(record.intent_id, {
|
|
88
|
-
...attempt,
|
|
89
|
-
grantId: record.grant_id,
|
|
90
|
-
expiresAt: record.expires_at,
|
|
91
|
-
state: "CLAIMED",
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
open.delete(record.intent_id);
|
|
97
|
-
}
|
|
98
|
-
return [...open.values()];
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Folds a stream of records into the authorizations one intent was
|
|
102
|
-
* dispatched under, oldest first. Only a claimed attempt was dispatched: one
|
|
103
|
-
* opened and never claimed consumed no grant, and a claim with no opening
|
|
104
|
-
* record names no decision, so neither is anything to reconcile. Closing and
|
|
105
|
-
* reconciling records are ignored, because what an attempt was dispatched
|
|
106
|
-
* under does not change when its outcome becomes known.
|
|
107
|
-
*/
|
|
108
|
-
export function authorizationsFrom(records, intentId) {
|
|
109
|
-
const dispatched = [];
|
|
110
|
-
let opened = null;
|
|
111
|
-
for (const record of records) {
|
|
112
|
-
if (record.intent_id !== intentId)
|
|
113
|
-
continue;
|
|
114
|
-
if (record.record === "ATTEMPT_OPENED")
|
|
115
|
-
opened = record;
|
|
116
|
-
if (record.record === "GRANT_CLAIMED" && opened !== null) {
|
|
117
|
-
dispatched.push({
|
|
118
|
-
decisionId: opened.decision_id,
|
|
119
|
-
dossierId: opened.dossier_id,
|
|
120
|
-
grantId: record.grant_id,
|
|
121
|
-
intentHash: record.intent_hash,
|
|
122
|
-
expiresAt: record.expires_at,
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return dispatched;
|
|
127
|
-
}
|
|
7
|
+
export { authorizationsFrom, dispatchedUnderFrom, IDEMPOTENCY_KEY_DISPATCHED, JOURNAL_VERSION, JournalError, JournalRecordSchema, openAttemptsFrom, } from "@decionis/agent-safe-pipeline";
|
|
128
8
|
//# sourceMappingURL=ExecutionJournal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExecutionJournal.js","sourceRoot":"","sources":["../../src/journal/ExecutionJournal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ExecutionJournal.js","sourceRoot":"","sources":["../../src/journal/ExecutionJournal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,GAMjB,MAAM,+BAA+B,CAAC"}
|
|
@@ -27,6 +27,7 @@ export declare class FileExecutionJournal implements ExecutionJournal {
|
|
|
27
27
|
append(record: JournalRecord): Promise<void>;
|
|
28
28
|
openAttempts(): Promise<readonly OpenAttempt[]>;
|
|
29
29
|
authorizationsOf(intentId: string): Promise<readonly DispatchedAuthorization[]>;
|
|
30
|
+
dispatchedUnder(idempotencyKey: string): Promise<readonly DispatchedAuthorization[]>;
|
|
30
31
|
close(): void;
|
|
31
32
|
/** Every record in the retained files, oldest day first; a line that is not one is skipped. */
|
|
32
33
|
private records;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExecutionJournal.d.ts","sourceRoot":"","sources":["../../src/journal/FileExecutionJournal.ts"],"names":[],"mappings":"AAYA,OAAO,
|
|
1
|
+
{"version":3,"file":"FileExecutionJournal.d.ts","sourceRoot":"","sources":["../../src/journal/FileExecutionJournal.ts"],"names":[],"mappings":"AAYA,OAAO,EAML,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,uBAAuB,CAAC;AAE/B,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,QAAa,CAAC;AAG3C,MAAM,WAAW,2BAA2B;IAC1C,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB;IAMzD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAL5B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,MAAM,CAA8D;gBAGzD,SAAS,EAAE,MAAM,EAClC,OAAO,GAAE,2BAAgC;IAa9B,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAc5C,YAAY,IAAI,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC;IAI/C,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC;IAI/E,eAAe,CAC1B,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,SAAS,uBAAuB,EAAE,CAAC;IAIvC,KAAK,IAAI,IAAI;IAKpB,+FAA+F;IAC/F,OAAO,CAAC,OAAO;IAwBf,gEAAgE;IAChE,OAAO,CAAC,IAAI;IAeZ,0EAA0E;IAC1E,OAAO,CAAC,OAAO;IAuBf,OAAO,CAAC,MAAM,CAAC,GAAG;CAGnB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { closeSync, fstatSync, fsyncSync, mkdirSync, openSync, readFileSync, readdirSync, statSync, writeSync, } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { JournalError, JournalRecordSchema, authorizationsFrom, openAttemptsFrom, } from "./ExecutionJournal.js";
|
|
3
|
+
import { JournalError, JournalRecordSchema, authorizationsFrom, dispatchedUnderFrom, openAttemptsFrom, } from "./ExecutionJournal.js";
|
|
4
4
|
/** The most a single record may be, so one attempt cannot fill the volume. */
|
|
5
5
|
export const MAX_RECORD_BYTES = 256 * 1024;
|
|
6
6
|
const FILE_PATTERN = /^attempts-(\d{4}-\d{2}-\d{2})\.jsonl$/;
|
|
@@ -56,6 +56,9 @@ export class FileExecutionJournal {
|
|
|
56
56
|
async authorizationsOf(intentId) {
|
|
57
57
|
return await Promise.resolve(authorizationsFrom(this.records(), intentId));
|
|
58
58
|
}
|
|
59
|
+
async dispatchedUnder(idempotencyKey) {
|
|
60
|
+
return await Promise.resolve(dispatchedUnderFrom(this.records(), idempotencyKey));
|
|
61
|
+
}
|
|
59
62
|
close() {
|
|
60
63
|
if (this.handle !== null)
|
|
61
64
|
closeSync(this.handle.fd);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileExecutionJournal.js","sourceRoot":"","sources":["../../src/journal/FileExecutionJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,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,EAAQ;QACzB,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { authorizationsFrom, openAttemptsFrom, type ExecutionJournal, type JournalRecord, type JournalRecordKind } from "./ExecutionJournal.js";
|
|
1
|
+
import { authorizationsFrom, dispatchedUnderFrom, openAttemptsFrom, type ExecutionJournal, type JournalRecord, type JournalRecordKind } from "./ExecutionJournal.js";
|
|
2
2
|
/**
|
|
3
3
|
* A journal that keeps its records in memory. It is honest about what it is:
|
|
4
4
|
* nothing survives the process, so a deployment that needs an attempt to
|
|
@@ -19,6 +19,7 @@ export declare class InMemoryExecutionJournal implements ExecutionJournal {
|
|
|
19
19
|
append(record: JournalRecord): Promise<void>;
|
|
20
20
|
openAttempts(): Promise<ReturnType<typeof openAttemptsFrom>>;
|
|
21
21
|
authorizationsOf(intentId: string): Promise<ReturnType<typeof authorizationsFrom>>;
|
|
22
|
+
dispatchedUnder(idempotencyKey: string): Promise<ReturnType<typeof dispatchedUnderFrom>>;
|
|
22
23
|
close(): void;
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=InMemoryExecutionJournal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryExecutionJournal.d.ts","sourceRoot":"","sources":["../../src/journal/InMemoryExecutionJournal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAE/B;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,gBAAgB;IAC/D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAuB;IAC/C,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,WAAW,CAAkC;IAErD,mFAAmF;IAC5E,cAAc,CAAC,I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