@ixo/flow-work 0.1.1 → 0.3.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/capability.d.ts +56 -2
- package/dist/capability.d.ts.map +1 -1
- package/dist/capability.js.map +1 -1
- package/dist/flow-work.plugin.d.ts +1 -3
- package/dist/flow-work.plugin.d.ts.map +1 -1
- package/dist/flow-work.plugin.js +20 -11
- package/dist/flow-work.plugin.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/listener.d.ts +33 -20
- package/dist/listener.d.ts.map +1 -1
- package/dist/listener.js +360 -112
- package/dist/listener.js.map +1 -1
- package/dist/matrix-port.d.ts +20 -8
- package/dist/matrix-port.d.ts.map +1 -1
- package/dist/matrix-port.js +51 -17
- package/dist/matrix-port.js.map +1 -1
- package/dist/protocol.d.ts +144 -17
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +165 -16
- package/dist/protocol.js.map +1 -1
- package/package.json +1 -1
package/dist/matrix-port.d.ts
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
import type * as sdk from 'matrix-js-sdk';
|
|
2
2
|
/**
|
|
3
|
-
* The narrow slice of Matrix the flow-work listener needs.
|
|
4
|
-
*
|
|
5
|
-
* client (adaptMatrixClient), tests provide an in-memory implementation.
|
|
3
|
+
* The narrow slice of Matrix the flow-work listener needs. Production wraps
|
|
4
|
+
* matrix-js-sdk; tests can provide a deterministic in-memory implementation.
|
|
6
5
|
*/
|
|
7
6
|
declare module 'matrix-js-sdk' {
|
|
8
7
|
interface TimelineEvents {
|
|
9
8
|
[key: `ixo.flow.work.${string}`]: Record<string, unknown>;
|
|
10
9
|
}
|
|
10
|
+
interface StateEvents {
|
|
11
|
+
[key: `ixo.flow.work.${string}`]: Record<string, unknown>;
|
|
12
|
+
}
|
|
11
13
|
}
|
|
14
|
+
type FlowWorkEventType = `ixo.flow.work.${string}`;
|
|
12
15
|
export interface FlowWorkRoomEvent {
|
|
13
16
|
roomId: string;
|
|
14
17
|
type: string;
|
|
15
18
|
content: unknown;
|
|
16
19
|
sender?: string;
|
|
20
|
+
/** Present for Matrix state events, including an empty state key. */
|
|
21
|
+
stateKey?: string;
|
|
22
|
+
eventId?: string;
|
|
17
23
|
}
|
|
18
24
|
export interface FlowWorkInvite {
|
|
19
25
|
roomId: string;
|
|
20
26
|
inviterUserId: string;
|
|
21
27
|
}
|
|
22
28
|
export interface FlowWorkMatrixPort {
|
|
23
|
-
/** Register an invite handler. Returns an unsubscribe function. */
|
|
24
29
|
onInvite(handler: (invite: FlowWorkInvite) => void): () => void;
|
|
25
|
-
/** Register a room-event handler (decrypted where applicable). Returns unsubscribe. */
|
|
26
30
|
onRoomEvent(handler: (event: FlowWorkRoomEvent) => void): () => void;
|
|
27
31
|
joinRoom(roomId: string): Promise<void>;
|
|
28
|
-
sendEvent(roomId: string, type:
|
|
29
|
-
|
|
32
|
+
sendEvent(roomId: string, type: FlowWorkEventType, content: Record<string, unknown>): Promise<void>;
|
|
33
|
+
sendStateEvent(roomId: string, type: FlowWorkEventType, stateKey: string, content: Record<string, unknown>): Promise<void>;
|
|
34
|
+
/** Legacy timeline access retained for transport consumers. */
|
|
30
35
|
recentEvents(roomId: string, limit: number): FlowWorkRoomEvent[];
|
|
36
|
+
/** Durable current-state read; receipt replay never depends on timeline depth. */
|
|
37
|
+
stateEvents(roomId: string, type: string): FlowWorkRoomEvent[];
|
|
38
|
+
getJoinedRoomIds(): string[];
|
|
39
|
+
getPendingInvites(): FlowWorkInvite[];
|
|
40
|
+
/** Authenticated local Matrix sender, used to reject forged receipt state. */
|
|
41
|
+
getUserId(): string | null;
|
|
31
42
|
}
|
|
32
|
-
/** Wrap a live matrix-js-sdk client in the port interface. */
|
|
43
|
+
/** Wrap a live matrix-js-sdk client in the flow-work port interface. */
|
|
33
44
|
export declare function adaptMatrixClient(client: sdk.MatrixClient): FlowWorkMatrixPort;
|
|
45
|
+
export {};
|
|
34
46
|
//# sourceMappingURL=matrix-port.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-port.d.ts","sourceRoot":"","sources":["../src/matrix-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,eAAe,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"matrix-port.d.ts","sourceRoot":"","sources":["../src/matrix-port.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,GAAG,MAAM,eAAe,CAAC;AAE1C;;;GAGG;AAEH,OAAO,QAAQ,eAAe,CAAC;IAC7B,UAAU,cAAc;QACtB,CAAC,GAAG,EAAE,iBAAiB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3D;IACD,UAAU,WAAW;QACnB,CAAC,GAAG,EAAE,iBAAiB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAC3D;CACF;AAED,KAAK,iBAAiB,GAAG,iBAAiB,MAAM,EAAE,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAChE,WAAW,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IACrE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,SAAS,CACP,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CACZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,+DAA+D;IAC/D,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;IACjE,kFAAkF;IAClF,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,iBAAiB,EAAE,CAAC;IAC/D,gBAAgB,IAAI,MAAM,EAAE,CAAC;IAC7B,iBAAiB,IAAI,cAAc,EAAE,CAAC;IACtC,8EAA8E;IAC9E,SAAS,IAAI,MAAM,GAAG,IAAI,CAAC;CAC5B;AAaD,wEAAwE;AACxE,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,GAAG,CAAC,YAAY,GACvB,kBAAkB,CAkHpB"}
|
package/dist/matrix-port.js
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
function roomEvent(roomId, event) {
|
|
2
|
+
return {
|
|
3
|
+
roomId,
|
|
4
|
+
type: event.getType(),
|
|
5
|
+
content: event.getContent(),
|
|
6
|
+
sender: event.getSender(),
|
|
7
|
+
...(event.isState() ? { stateKey: event.getStateKey() ?? '' } : {}),
|
|
8
|
+
eventId: event.getId(),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** Wrap a live matrix-js-sdk client in the flow-work port interface. */
|
|
2
12
|
export function adaptMatrixClient(client) {
|
|
3
13
|
return {
|
|
4
14
|
onInvite(handler) {
|
|
@@ -15,20 +25,14 @@ export function adaptMatrixClient(client) {
|
|
|
15
25
|
return () => client.removeListener('RoomMember.membership', membershipHandler);
|
|
16
26
|
},
|
|
17
27
|
onRoomEvent(handler) {
|
|
18
|
-
const emit = (event) => {
|
|
28
|
+
const emit = (event, decrypted = false) => {
|
|
19
29
|
const roomId = event.getRoomId();
|
|
20
|
-
if (!roomId || event.isEncrypted())
|
|
30
|
+
if (!roomId || (event.isEncrypted() && !decrypted))
|
|
21
31
|
return;
|
|
22
|
-
handler(
|
|
23
|
-
roomId,
|
|
24
|
-
type: event.getType(),
|
|
25
|
-
content: event.getContent(),
|
|
26
|
-
sender: event.getSender(),
|
|
27
|
-
});
|
|
32
|
+
handler(roomEvent(roomId, event));
|
|
28
33
|
};
|
|
29
34
|
const timelineHandler = (event) => emit(event);
|
|
30
|
-
|
|
31
|
-
const decryptedHandler = (event) => emit(event);
|
|
35
|
+
const decryptedHandler = (event) => emit(event, true);
|
|
32
36
|
client.on('Room.timeline', timelineHandler);
|
|
33
37
|
client.on('Event.decrypted', decryptedHandler);
|
|
34
38
|
return () => {
|
|
@@ -42,6 +46,9 @@ export function adaptMatrixClient(client) {
|
|
|
42
46
|
async sendEvent(roomId, type, content) {
|
|
43
47
|
await client.sendEvent(roomId, type, content);
|
|
44
48
|
},
|
|
49
|
+
async sendStateEvent(roomId, type, stateKey, content) {
|
|
50
|
+
await client.sendStateEvent(roomId, type, content, stateKey);
|
|
51
|
+
},
|
|
45
52
|
recentEvents(roomId, limit) {
|
|
46
53
|
const room = client.getRoom(roomId);
|
|
47
54
|
if (!room)
|
|
@@ -51,12 +58,39 @@ export function adaptMatrixClient(client) {
|
|
|
51
58
|
.getEvents()
|
|
52
59
|
.slice(-limit)
|
|
53
60
|
.reverse()
|
|
54
|
-
.map((event) => (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
.map((event) => roomEvent(roomId, event));
|
|
62
|
+
},
|
|
63
|
+
stateEvents(roomId, type) {
|
|
64
|
+
const events = client.getRoom(roomId)?.currentState.getStateEvents(type);
|
|
65
|
+
if (!events)
|
|
66
|
+
return [];
|
|
67
|
+
const list = Array.isArray(events) ? events : [events];
|
|
68
|
+
return list.map((event) => roomEvent(roomId, event));
|
|
69
|
+
},
|
|
70
|
+
getJoinedRoomIds() {
|
|
71
|
+
return client
|
|
72
|
+
.getRooms()
|
|
73
|
+
.filter((room) => room.getMyMembership() === 'join')
|
|
74
|
+
.map((room) => room.roomId);
|
|
75
|
+
},
|
|
76
|
+
getPendingInvites() {
|
|
77
|
+
const userId = client.getUserId();
|
|
78
|
+
if (!userId)
|
|
79
|
+
return [];
|
|
80
|
+
return client
|
|
81
|
+
.getRooms()
|
|
82
|
+
.filter((room) => room.getMyMembership() === 'invite')
|
|
83
|
+
.map((room) => {
|
|
84
|
+
const membership = room.currentState.getStateEvents('m.room.member', userId);
|
|
85
|
+
const event = Array.isArray(membership) ? membership[0] : membership;
|
|
86
|
+
return {
|
|
87
|
+
roomId: room.roomId,
|
|
88
|
+
inviterUserId: event?.getSender() ?? '',
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
getUserId() {
|
|
93
|
+
return client.getUserId();
|
|
60
94
|
},
|
|
61
95
|
};
|
|
62
96
|
}
|
package/dist/matrix-port.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-port.js","sourceRoot":"","sources":["../src/matrix-port.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"matrix-port.js","sourceRoot":"","sources":["../src/matrix-port.ts"],"names":[],"mappings":"AA0DA,SAAS,SAAS,CAAC,MAAc,EAAE,KAAsB;IACvD,OAAO;QACL,MAAM;QACN,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE;QACrB,OAAO,EAAE,KAAK,CAAC,UAAU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E,IAAI,CAAC,MAAM;oBACnB,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE;iBACxC,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED,SAAS;YACP,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/protocol.d.ts
CHANGED
|
@@ -1,32 +1,159 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* The flow-work wire protocol — the Matrix events flow-manager and helper
|
|
4
|
-
* oracles exchange. Mirror of flow-manager's oracle-delegation plugin
|
|
5
|
-
* (apps/app/src/plugins/oracle-delegation/oracle-room.ts). If these shapes
|
|
6
|
-
* change, both sides change together; until this lives in a shared package
|
|
7
|
-
* the duplication is deliberate and must be kept in sync.
|
|
8
|
-
*/
|
|
2
|
+
/** Matrix event names for flow-work protocol v2. */
|
|
9
3
|
export declare const FLOW_WORK_ASSIGN_EVENT = "ixo.flow.work.assign";
|
|
4
|
+
export declare const FLOW_WORK_READY_EVENT = "ixo.flow.work.ready";
|
|
10
5
|
export declare const FLOW_WORK_INVOKE_EVENT = "ixo.flow.work.invoke";
|
|
11
6
|
export declare const FLOW_WORK_RECEIPT_EVENT = "ixo.flow.work.receipt";
|
|
12
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Immutable routing and authorization binding shared by assign, ready, invoke,
|
|
9
|
+
* and receipt. Every hop repeats these fields so no event can be spliced into
|
|
10
|
+
* a different contract.
|
|
11
|
+
*/
|
|
12
|
+
export declare const flowWorkBindingSchema: z.ZodObject<{
|
|
13
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
14
|
+
invocationId: z.ZodString;
|
|
15
|
+
managerDid: z.ZodString;
|
|
16
|
+
audience: z.ZodString;
|
|
17
|
+
capability: z.ZodString;
|
|
18
|
+
actionType: z.ZodString;
|
|
19
|
+
nodeId: z.ZodString;
|
|
20
|
+
resource: z.ZodString;
|
|
21
|
+
inputHash: z.ZodString;
|
|
22
|
+
attempt: z.ZodNumber;
|
|
23
|
+
deadline: z.ZodNumber;
|
|
24
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type FlowWorkBinding = z.infer<typeof flowWorkBindingSchema>;
|
|
27
|
+
export declare const flowWorkAssignSchema: z.ZodObject<{
|
|
28
|
+
oracleMatrixId: z.ZodString;
|
|
29
|
+
assignedAt: z.ZodString;
|
|
30
|
+
status: z.ZodLiteral<"invited">;
|
|
31
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
32
|
+
invocationId: z.ZodString;
|
|
33
|
+
managerDid: z.ZodString;
|
|
34
|
+
audience: z.ZodString;
|
|
35
|
+
capability: z.ZodString;
|
|
36
|
+
actionType: z.ZodString;
|
|
37
|
+
nodeId: z.ZodString;
|
|
38
|
+
resource: z.ZodString;
|
|
39
|
+
inputHash: z.ZodString;
|
|
40
|
+
attempt: z.ZodNumber;
|
|
41
|
+
deadline: z.ZodNumber;
|
|
42
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export type FlowWorkAssign = z.infer<typeof flowWorkAssignSchema>;
|
|
45
|
+
export declare const flowWorkReadySchema: z.ZodObject<{
|
|
46
|
+
status: z.ZodLiteral<"ready">;
|
|
47
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
13
48
|
invocationId: z.ZodString;
|
|
49
|
+
managerDid: z.ZodString;
|
|
50
|
+
audience: z.ZodString;
|
|
14
51
|
capability: z.ZodString;
|
|
15
52
|
actionType: z.ZodString;
|
|
16
53
|
nodeId: z.ZodString;
|
|
54
|
+
resource: z.ZodString;
|
|
55
|
+
inputHash: z.ZodString;
|
|
56
|
+
attempt: z.ZodNumber;
|
|
57
|
+
deadline: z.ZodNumber;
|
|
58
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
export type FlowWorkReady = z.infer<typeof flowWorkReadySchema>;
|
|
61
|
+
export declare const flowWorkInvokeSchema: z.ZodObject<{
|
|
17
62
|
inputs: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
18
63
|
delegation: z.ZodString;
|
|
64
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
65
|
+
invocationId: z.ZodString;
|
|
66
|
+
managerDid: z.ZodString;
|
|
19
67
|
audience: z.ZodString;
|
|
20
|
-
|
|
68
|
+
capability: z.ZodString;
|
|
69
|
+
actionType: z.ZodString;
|
|
70
|
+
nodeId: z.ZodString;
|
|
71
|
+
resource: z.ZodString;
|
|
72
|
+
inputHash: z.ZodString;
|
|
73
|
+
attempt: z.ZodNumber;
|
|
74
|
+
deadline: z.ZodNumber;
|
|
75
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
76
|
+
}, z.core.$strict>;
|
|
21
77
|
export type FlowWorkInvoke = z.infer<typeof flowWorkInvokeSchema>;
|
|
22
|
-
export
|
|
23
|
-
|
|
78
|
+
export declare const flowWorkErrorCodeSchema: z.ZodEnum<{
|
|
79
|
+
assignment_missing: "assignment_missing";
|
|
80
|
+
sender_untrusted: "sender_untrusted";
|
|
81
|
+
binding_mismatch: "binding_mismatch";
|
|
82
|
+
deadline_expired: "deadline_expired";
|
|
83
|
+
delegation_invalid: "delegation_invalid";
|
|
84
|
+
delegation_expired: "delegation_expired";
|
|
85
|
+
capability_not_declared: "capability_not_declared";
|
|
86
|
+
input_invalid: "input_invalid";
|
|
87
|
+
output_invalid: "output_invalid";
|
|
88
|
+
tool_error: "tool_error";
|
|
89
|
+
}>;
|
|
90
|
+
export type FlowWorkErrorCode = z.infer<typeof flowWorkErrorCodeSchema>;
|
|
91
|
+
export declare const flowWorkReceiptSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
92
|
+
status: z.ZodLiteral<"success">;
|
|
93
|
+
output: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
error: z.ZodNull;
|
|
95
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
96
|
+
invocationId: z.ZodString;
|
|
97
|
+
managerDid: z.ZodString;
|
|
98
|
+
audience: z.ZodString;
|
|
99
|
+
capability: z.ZodString;
|
|
100
|
+
actionType: z.ZodString;
|
|
101
|
+
nodeId: z.ZodString;
|
|
102
|
+
resource: z.ZodString;
|
|
103
|
+
inputHash: z.ZodString;
|
|
104
|
+
attempt: z.ZodNumber;
|
|
105
|
+
deadline: z.ZodNumber;
|
|
106
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
107
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
108
|
+
status: z.ZodLiteral<"failure">;
|
|
109
|
+
output: z.ZodNull;
|
|
110
|
+
error: z.ZodObject<{
|
|
111
|
+
code: z.ZodEnum<{
|
|
112
|
+
assignment_missing: "assignment_missing";
|
|
113
|
+
sender_untrusted: "sender_untrusted";
|
|
114
|
+
binding_mismatch: "binding_mismatch";
|
|
115
|
+
deadline_expired: "deadline_expired";
|
|
116
|
+
delegation_invalid: "delegation_invalid";
|
|
117
|
+
delegation_expired: "delegation_expired";
|
|
118
|
+
capability_not_declared: "capability_not_declared";
|
|
119
|
+
input_invalid: "input_invalid";
|
|
120
|
+
output_invalid: "output_invalid";
|
|
121
|
+
tool_error: "tool_error";
|
|
122
|
+
}>;
|
|
123
|
+
message: z.ZodString;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
protocolVersion: z.ZodLiteral<2>;
|
|
126
|
+
invocationId: z.ZodString;
|
|
127
|
+
managerDid: z.ZodString;
|
|
128
|
+
audience: z.ZodString;
|
|
129
|
+
capability: z.ZodString;
|
|
130
|
+
actionType: z.ZodString;
|
|
131
|
+
nodeId: z.ZodString;
|
|
132
|
+
resource: z.ZodString;
|
|
133
|
+
inputHash: z.ZodString;
|
|
134
|
+
attempt: z.ZodNumber;
|
|
135
|
+
deadline: z.ZodNumber;
|
|
136
|
+
contractCaveats: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
137
|
+
}, z.core.$strict>], "status">;
|
|
138
|
+
export type FlowWorkReceipt = z.infer<typeof flowWorkReceiptSchema>;
|
|
139
|
+
/** The nb fields which must be present, with no additions, in the UCAN grant. */
|
|
140
|
+
export interface FlowWorkNb {
|
|
141
|
+
protocolVersion: 2;
|
|
24
142
|
invocationId: string;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
143
|
+
managerDid: string;
|
|
144
|
+
audience: string;
|
|
145
|
+
actionType: string;
|
|
146
|
+
nodeId: string;
|
|
147
|
+
inputHash: string;
|
|
148
|
+
attempt: number;
|
|
149
|
+
deadline: number;
|
|
150
|
+
delegationDepth: 0;
|
|
151
|
+
[caveat: string]: unknown;
|
|
31
152
|
}
|
|
153
|
+
export declare function flowWorkNbFor(binding: FlowWorkBinding): FlowWorkNb;
|
|
154
|
+
export declare function sameFlowWorkNb(actual: Record<string, unknown> | undefined, binding: FlowWorkBinding): boolean;
|
|
155
|
+
export declare const FLOW_WORK_BINDING_FIELDS: readonly ["protocolVersion", "invocationId", "managerDid", "audience", "capability", "actionType", "nodeId", "resource", "inputHash", "attempt", "deadline", "contractCaveats"];
|
|
156
|
+
export declare function sameFlowWorkBinding(left: FlowWorkBinding, right: FlowWorkBinding): boolean;
|
|
157
|
+
/** Stable JSON hash used by assignment to commit to later invoke inputs. */
|
|
158
|
+
export declare function computeFlowWorkInputHash(inputs: Record<string, unknown>): string;
|
|
32
159
|
//# sourceMappingURL=protocol.d.ts.map
|
package/dist/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.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AAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3B;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,UAAU,CAclE;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,OAAO,EAAE,eAAe,GACvB,OAAO,CAKT;AAED,eAAO,MAAM,wBAAwB,iLAakB,CAAC;AAExD,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,eAAe,GACrB,OAAO,CAMT;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,MAAM,CAER"}
|
package/dist/protocol.js
CHANGED
|
@@ -1,23 +1,172 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* The flow-work wire protocol — the Matrix events flow-manager and helper
|
|
4
|
-
* oracles exchange. Mirror of flow-manager's oracle-delegation plugin
|
|
5
|
-
* (apps/app/src/plugins/oracle-delegation/oracle-room.ts). If these shapes
|
|
6
|
-
* change, both sides change together; until this lives in a shared package
|
|
7
|
-
* the duplication is deliberate and must be kept in sync.
|
|
8
|
-
*/
|
|
3
|
+
/** Matrix event names for flow-work protocol v2. */
|
|
9
4
|
export const FLOW_WORK_ASSIGN_EVENT = 'ixo.flow.work.assign';
|
|
5
|
+
export const FLOW_WORK_READY_EVENT = 'ixo.flow.work.ready';
|
|
10
6
|
export const FLOW_WORK_INVOKE_EVENT = 'ixo.flow.work.invoke';
|
|
11
7
|
export const FLOW_WORK_RECEIPT_EVENT = 'ixo.flow.work.receipt';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const nonEmpty = z.string().trim().min(1);
|
|
9
|
+
const reservedNbKeys = new Set([
|
|
10
|
+
'protocolVersion',
|
|
11
|
+
'invocationId',
|
|
12
|
+
'managerDid',
|
|
13
|
+
'audience',
|
|
14
|
+
'actionType',
|
|
15
|
+
'nodeId',
|
|
16
|
+
'inputHash',
|
|
17
|
+
'attempt',
|
|
18
|
+
'deadline',
|
|
19
|
+
'delegationDepth',
|
|
20
|
+
]);
|
|
21
|
+
const contractCaveatsSchema = z
|
|
22
|
+
.record(z.string(), z.unknown())
|
|
23
|
+
.refine((value) => Object.keys(value).every((key) => !reservedNbKeys.has(key)), 'contractCaveats cannot override flow-work protocol bindings');
|
|
24
|
+
const bindingShape = {
|
|
25
|
+
protocolVersion: z.literal(2),
|
|
26
|
+
invocationId: nonEmpty,
|
|
27
|
+
managerDid: nonEmpty,
|
|
28
|
+
/** Entity DID of the oracle contracted for this invocation. */
|
|
29
|
+
audience: nonEmpty,
|
|
30
|
+
capability: nonEmpty,
|
|
31
|
+
actionType: nonEmpty,
|
|
32
|
+
nodeId: nonEmpty,
|
|
33
|
+
/** UCAN resource, and therefore the exact value of capability.with. */
|
|
34
|
+
resource: nonEmpty,
|
|
35
|
+
inputHash: z.string().regex(/^sha256:[0-9a-f]{64}$/),
|
|
36
|
+
attempt: z.number().int().safe().min(1),
|
|
37
|
+
/** Absolute Unix epoch deadline in milliseconds. */
|
|
38
|
+
deadline: z.number().int().safe().positive(),
|
|
39
|
+
/** Service-contract caveats copied exactly into the UCAN nb object. */
|
|
40
|
+
contractCaveats: contractCaveatsSchema,
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Immutable routing and authorization binding shared by assign, ready, invoke,
|
|
44
|
+
* and receipt. Every hop repeats these fields so no event can be spliced into
|
|
45
|
+
* a different contract.
|
|
46
|
+
*/
|
|
47
|
+
export const flowWorkBindingSchema = z.object(bindingShape).strict();
|
|
48
|
+
export const flowWorkAssignSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
...bindingShape,
|
|
51
|
+
/** Exact Matrix operator user id contracted for this entity DID. */
|
|
52
|
+
oracleMatrixId: nonEmpty,
|
|
53
|
+
assignedAt: z.string().datetime(),
|
|
54
|
+
status: z.literal('invited'),
|
|
55
|
+
})
|
|
56
|
+
.strict();
|
|
57
|
+
export const flowWorkReadySchema = z
|
|
58
|
+
.object({
|
|
59
|
+
...bindingShape,
|
|
60
|
+
status: z.literal('ready'),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
export const flowWorkInvokeSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
...bindingShape,
|
|
17
66
|
inputs: z.record(z.string(), z.unknown()),
|
|
18
67
|
/** Serialized UCAN delegation (base64 CAR) authorizing this work. */
|
|
19
|
-
delegation:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
68
|
+
delegation: nonEmpty,
|
|
69
|
+
})
|
|
70
|
+
.strict();
|
|
71
|
+
export const flowWorkErrorCodeSchema = z.enum([
|
|
72
|
+
'assignment_missing',
|
|
73
|
+
'sender_untrusted',
|
|
74
|
+
'binding_mismatch',
|
|
75
|
+
'deadline_expired',
|
|
76
|
+
'delegation_invalid',
|
|
77
|
+
'delegation_expired',
|
|
78
|
+
'capability_not_declared',
|
|
79
|
+
'input_invalid',
|
|
80
|
+
'output_invalid',
|
|
81
|
+
'tool_error',
|
|
82
|
+
]);
|
|
83
|
+
export const flowWorkReceiptSchema = z.discriminatedUnion('status', [
|
|
84
|
+
z
|
|
85
|
+
.object({
|
|
86
|
+
...bindingShape,
|
|
87
|
+
status: z.literal('success'),
|
|
88
|
+
output: z.record(z.string(), z.unknown()).nullable(),
|
|
89
|
+
error: z.null(),
|
|
90
|
+
})
|
|
91
|
+
.strict(),
|
|
92
|
+
z
|
|
93
|
+
.object({
|
|
94
|
+
...bindingShape,
|
|
95
|
+
status: z.literal('failure'),
|
|
96
|
+
output: z.null(),
|
|
97
|
+
error: z
|
|
98
|
+
.object({
|
|
99
|
+
code: flowWorkErrorCodeSchema,
|
|
100
|
+
message: z.string(),
|
|
101
|
+
})
|
|
102
|
+
.strict(),
|
|
103
|
+
})
|
|
104
|
+
.strict(),
|
|
105
|
+
]);
|
|
106
|
+
export function flowWorkNbFor(binding) {
|
|
107
|
+
return {
|
|
108
|
+
protocolVersion: binding.protocolVersion,
|
|
109
|
+
invocationId: binding.invocationId,
|
|
110
|
+
managerDid: binding.managerDid,
|
|
111
|
+
audience: binding.audience,
|
|
112
|
+
actionType: binding.actionType,
|
|
113
|
+
nodeId: binding.nodeId,
|
|
114
|
+
inputHash: binding.inputHash,
|
|
115
|
+
attempt: binding.attempt,
|
|
116
|
+
deadline: binding.deadline,
|
|
117
|
+
delegationDepth: 0,
|
|
118
|
+
...binding.contractCaveats,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export function sameFlowWorkNb(actual, binding) {
|
|
122
|
+
return (actual !== undefined &&
|
|
123
|
+
canonicalJson(actual) === canonicalJson(flowWorkNbFor(binding)));
|
|
124
|
+
}
|
|
125
|
+
export const FLOW_WORK_BINDING_FIELDS = [
|
|
126
|
+
'protocolVersion',
|
|
127
|
+
'invocationId',
|
|
128
|
+
'managerDid',
|
|
129
|
+
'audience',
|
|
130
|
+
'capability',
|
|
131
|
+
'actionType',
|
|
132
|
+
'nodeId',
|
|
133
|
+
'resource',
|
|
134
|
+
'inputHash',
|
|
135
|
+
'attempt',
|
|
136
|
+
'deadline',
|
|
137
|
+
'contractCaveats',
|
|
138
|
+
];
|
|
139
|
+
export function sameFlowWorkBinding(left, right) {
|
|
140
|
+
return FLOW_WORK_BINDING_FIELDS.every((field) => field === 'contractCaveats'
|
|
141
|
+
? canonicalJson(left[field]) === canonicalJson(right[field])
|
|
142
|
+
: left[field] === right[field]);
|
|
143
|
+
}
|
|
144
|
+
/** Stable JSON hash used by assignment to commit to later invoke inputs. */
|
|
145
|
+
export function computeFlowWorkInputHash(inputs) {
|
|
146
|
+
return `sha256:${createHash('sha256').update(canonicalJson(inputs)).digest('hex')}`;
|
|
147
|
+
}
|
|
148
|
+
function canonicalJson(value) {
|
|
149
|
+
if (value === null)
|
|
150
|
+
return 'null';
|
|
151
|
+
if (typeof value === 'string' || typeof value === 'boolean') {
|
|
152
|
+
return JSON.stringify(value);
|
|
153
|
+
}
|
|
154
|
+
if (typeof value === 'number') {
|
|
155
|
+
return Number.isFinite(value) ? JSON.stringify(value) : 'null';
|
|
156
|
+
}
|
|
157
|
+
if (Array.isArray(value)) {
|
|
158
|
+
return `[${value.map((entry) => canonicalJson(entry ?? null)).join(',')}]`;
|
|
159
|
+
}
|
|
160
|
+
if (typeof value === 'object') {
|
|
161
|
+
const record = value;
|
|
162
|
+
return `{${Object.keys(record)
|
|
163
|
+
.sort()
|
|
164
|
+
.filter((key) => record[key] !== undefined)
|
|
165
|
+
.map((key) => `${JSON.stringify(key)}:${canonicalJson(record[key])}`)
|
|
166
|
+
.join(',')}}`;
|
|
167
|
+
}
|
|
168
|
+
if (value === undefined)
|
|
169
|
+
return 'null';
|
|
170
|
+
throw new TypeError(`Cannot hash non-JSON input value of type ${typeof value}`);
|
|
171
|
+
}
|
|
23
172
|
//# sourceMappingURL=protocol.js.map
|
package/dist/protocol.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EA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AQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACjE,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAC7E,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;aAC3B,IAAI,EAAE;aACN,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC;aAC1C,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;aACpE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IAClB,CAAC;IACD,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACvC,MAAM,IAAI,SAAS,CACjB,4CAA4C,OAAO,KAAK,EAAE,CAC3D,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ixo/flow-work",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Oracle-side flow-work plugin: accept UCAN-delegated ixo.flow.work invocations from the IXO flow-manager over Matrix and post receipts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|