@moltzap/protocol 2026.505.5 → 2026.506.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/methods/apps.d.ts +28 -204
- package/dist/app/methods/apps.d.ts.map +1 -1
- package/dist/app/methods/apps.js +42 -82
- package/dist/app/methods/apps.js.map +1 -1
- package/dist/network/actor-model.d.ts +23 -29
- package/dist/network/actor-model.d.ts.map +1 -1
- package/dist/network/actor-model.js +9 -27
- package/dist/network/actor-model.js.map +1 -1
- package/dist/network/index.d.ts +0 -1
- package/dist/network/index.d.ts.map +1 -1
- package/dist/network/index.js +0 -1
- package/dist/network/index.js.map +1 -1
- package/dist/rpc-registry.d.ts +45 -225
- package/dist/rpc-registry.d.ts.map +1 -1
- package/dist/rpc-registry.js +16 -10
- package/dist/rpc-registry.js.map +1 -1
- package/dist/schema/apps.d.ts +1 -10
- package/dist/schema/apps.d.ts.map +1 -1
- package/dist/schema/apps.js +11 -6
- package/dist/schema/apps.js.map +1 -1
- package/dist/schema/errors.d.ts +1 -1
- package/dist/schema/errors.d.ts.map +1 -1
- package/dist/schema/errors.js +6 -1
- package/dist/schema/errors.js.map +1 -1
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +0 -1
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/notifications.d.ts.map +1 -1
- package/dist/schema/notifications.js +4 -3
- package/dist/schema/notifications.js.map +1 -1
- package/dist/schema/tasks.d.ts +1 -1
- package/dist/schema/tasks.d.ts.map +1 -1
- package/dist/schema/tasks.js +5 -1
- package/dist/schema/tasks.js.map +1 -1
- package/dist/task/methods/tasks.d.ts +42 -4
- package/dist/task/methods/tasks.d.ts.map +1 -1
- package/dist/task/methods/tasks.js +33 -0
- package/dist/task/methods/tasks.js.map +1 -1
- package/dist/testing/conformance/boundary.d.ts.map +1 -1
- package/dist/testing/conformance/boundary.js +8 -6
- package/dist/testing/conformance/boundary.js.map +1 -1
- package/dist/testing/conformance/rpc-semantics.js +2 -2
- package/dist/testing/conformance/rpc-semantics.js.map +1 -1
- package/dist/testing/test-client.d.ts +2 -2
- package/dist/testing/test-client.d.ts.map +1 -1
- package/dist/testing/test-client.js +2 -2
- package/dist/testing/test-client.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +1 -1
- package/dist/validators.d.ts +2 -11
- package/dist/validators.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/network/methods/endpoints.d.ts +0 -16
- package/dist/network/methods/endpoints.d.ts.map +0 -1
- package/dist/network/methods/endpoints.js +0 -17
- package/dist/network/methods/endpoints.js.map +0 -1
|
@@ -15,16 +15,7 @@ export declare const AppsRegister: import("../../rpc.js").RpcDefinition<"apps/re
|
|
|
15
15
|
}>;
|
|
16
16
|
}>>>;
|
|
17
17
|
hooks: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
18
|
-
|
|
19
|
-
timeout_ms: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
20
|
-
}>>;
|
|
21
|
-
before_dispatch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
22
|
-
timeout_ms: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
23
|
-
}>>;
|
|
24
|
-
on_close: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
25
|
-
timeout_ms: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
26
|
-
}>>;
|
|
27
|
-
on_session_active: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
18
|
+
task_authorize_dispatch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
28
19
|
timeout_ms: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
29
20
|
}>>;
|
|
30
21
|
}>>;
|
|
@@ -33,9 +24,17 @@ export declare const AppsRegister: import("../../rpc.js").RpcDefinition<"apps/re
|
|
|
33
24
|
appId: import("@sinclair/typebox").TString;
|
|
34
25
|
}>>;
|
|
35
26
|
/**
|
|
36
|
-
* Verdict from a `
|
|
37
|
-
* `decision`: `grant` (allow; optional lease for held
|
|
38
|
-
* (reject), `hold` (defer behind a lease the
|
|
27
|
+
* Verdict from a `task/authorizeDispatch` admission round-trip.
|
|
28
|
+
* Discriminated by `decision`: `grant` (allow; optional lease for held
|
|
29
|
+
* delivery), `deny` (reject), `hold` (defer behind a lease the TM will
|
|
30
|
+
* release later).
|
|
31
|
+
*
|
|
32
|
+
* Phase 9b consumer-migration (sub-issue #460): the verdict shape stays
|
|
33
|
+
* frozen across the rename `apps/onBeforeDispatch → task/authorizeDispatch`
|
|
34
|
+
* because werewolf actively uses each variant for game-rule scheduling.
|
|
35
|
+
* Pre-rename, this schema lived alongside the deleted `before_dispatch`
|
|
36
|
+
* server-side framing; post-rename it is the receive-side TM-as-endpoint
|
|
37
|
+
* gate.
|
|
39
38
|
*/
|
|
40
39
|
export declare const DispatchAdmissionDecisionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
41
40
|
decision: import("@sinclair/typebox").TLiteral<"grant">;
|
|
@@ -132,43 +131,24 @@ export declare const AppsAuthorizeDispatch: import("../../rpc.js").RpcDefinition
|
|
|
132
131
|
}>]>;
|
|
133
132
|
}>>;
|
|
134
133
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
134
|
+
* Lifecycle-agent schema reused by notifications carrying actor identity
|
|
135
|
+
* (`task/closed`'s `closedBy` field). Phase 9b consumer-migration
|
|
136
|
+
* (sub-issue #460): the lifecycle hook RPCs that originally introduced
|
|
137
|
+
* this shape (`apps/onClose`'s context) retired; the notification frame
|
|
138
|
+
* still carries the same shape, so the export survives.
|
|
138
139
|
*/
|
|
139
|
-
export declare const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
type: import("@sinclair/typebox").TLiteral<"text">;
|
|
145
|
-
text: import("@sinclair/typebox").TString;
|
|
146
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
147
|
-
type: import("@sinclair/typebox").TLiteral<"image">;
|
|
148
|
-
url: import("@sinclair/typebox").TString;
|
|
149
|
-
altText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
150
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
151
|
-
type: import("@sinclair/typebox").TLiteral<"file">;
|
|
152
|
-
url: import("@sinclair/typebox").TString;
|
|
153
|
-
name: import("@sinclair/typebox").TString;
|
|
154
|
-
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
155
|
-
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
156
|
-
}>]>>;
|
|
157
|
-
}>>;
|
|
158
|
-
feedback: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
159
|
-
type: import("@sinclair/typebox").TString & {
|
|
160
|
-
static: "error" | "warning" | "info";
|
|
161
|
-
};
|
|
162
|
-
content: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
163
|
-
retry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
164
|
-
}>>;
|
|
140
|
+
export declare const LifecycleAgentSchema: import("@sinclair/typebox").TObject<{
|
|
141
|
+
agentId: import("@sinclair/typebox").TString & {
|
|
142
|
+
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
143
|
+
};
|
|
144
|
+
ownerId: import("@sinclair/typebox").TString;
|
|
165
145
|
}>;
|
|
166
|
-
export type HookResult = Static<typeof HookResultSchema>;
|
|
167
146
|
/**
|
|
168
|
-
* Context passed to a `
|
|
169
|
-
* server-side `
|
|
147
|
+
* Context passed to a `task/authorizeDispatch` admission round-trip.
|
|
148
|
+
* Mirrors the server-side `TaskAuthorizeDispatchContext` minus runtime-only
|
|
149
|
+
* fields (`signal`).
|
|
170
150
|
*/
|
|
171
|
-
export declare const
|
|
151
|
+
export declare const TaskAuthorizeDispatchContextSchema: import("@sinclair/typebox").TObject<{
|
|
172
152
|
taskId: import("@sinclair/typebox").TString & {
|
|
173
153
|
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
174
154
|
};
|
|
@@ -244,80 +224,8 @@ export declare const BeforeDispatchContextSchema: import("@sinclair/typebox").TO
|
|
|
244
224
|
}>]>>>;
|
|
245
225
|
}>>>;
|
|
246
226
|
}>;
|
|
247
|
-
export type
|
|
248
|
-
|
|
249
|
-
* Context passed to a `before_message_delivery` admission handler.
|
|
250
|
-
*/
|
|
251
|
-
export declare const BeforeMessageDeliveryContextSchema: import("@sinclair/typebox").TObject<{
|
|
252
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
253
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
254
|
-
};
|
|
255
|
-
appId: import("@sinclair/typebox").TString;
|
|
256
|
-
conversationId: import("@sinclair/typebox").TString & {
|
|
257
|
-
static: import("../../brands.js").BrandedString<"ConversationId">;
|
|
258
|
-
};
|
|
259
|
-
sender: import("@sinclair/typebox").TObject<{
|
|
260
|
-
agentId: import("@sinclair/typebox").TString & {
|
|
261
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
262
|
-
};
|
|
263
|
-
ownerId: import("@sinclair/typebox").TString;
|
|
264
|
-
}>;
|
|
265
|
-
message: import("@sinclair/typebox").TObject<{
|
|
266
|
-
parts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
267
|
-
type: import("@sinclair/typebox").TLiteral<"text">;
|
|
268
|
-
text: import("@sinclair/typebox").TString;
|
|
269
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
270
|
-
type: import("@sinclair/typebox").TLiteral<"image">;
|
|
271
|
-
url: import("@sinclair/typebox").TString;
|
|
272
|
-
altText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
273
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
274
|
-
type: import("@sinclair/typebox").TLiteral<"file">;
|
|
275
|
-
url: import("@sinclair/typebox").TString;
|
|
276
|
-
name: import("@sinclair/typebox").TString;
|
|
277
|
-
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
278
|
-
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
279
|
-
}>]>>;
|
|
280
|
-
replyToId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
281
|
-
static: import("../../brands.js").BrandedString<"MessageId">;
|
|
282
|
-
}>;
|
|
283
|
-
dispatchLeaseId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
284
|
-
}>;
|
|
285
|
-
}>;
|
|
286
|
-
export type BeforeMessageDeliveryContext = Static<typeof BeforeMessageDeliveryContextSchema>;
|
|
287
|
-
export declare const LifecycleAgentSchema: import("@sinclair/typebox").TObject<{
|
|
288
|
-
agentId: import("@sinclair/typebox").TString & {
|
|
289
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
290
|
-
};
|
|
291
|
-
ownerId: import("@sinclair/typebox").TString;
|
|
292
|
-
}>;
|
|
293
|
-
/** Context passed to an `on_close` lifecycle handler. */
|
|
294
|
-
export declare const OnCloseContextSchema: import("@sinclair/typebox").TObject<{
|
|
295
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
296
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
297
|
-
};
|
|
298
|
-
appId: import("@sinclair/typebox").TString;
|
|
299
|
-
conversations: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
300
|
-
closedBy: import("@sinclair/typebox").TObject<{
|
|
301
|
-
agentId: import("@sinclair/typebox").TString & {
|
|
302
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
303
|
-
};
|
|
304
|
-
ownerId: import("@sinclair/typebox").TString;
|
|
305
|
-
}>;
|
|
306
|
-
}>;
|
|
307
|
-
export type OnCloseContext = Static<typeof OnCloseContextSchema>;
|
|
308
|
-
/** Context passed to an `on_session_active` lifecycle handler. */
|
|
309
|
-
export declare const OnSessionActiveContextSchema: import("@sinclair/typebox").TObject<{
|
|
310
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
311
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
312
|
-
};
|
|
313
|
-
appId: import("@sinclair/typebox").TString;
|
|
314
|
-
conversations: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
315
|
-
admittedAgentIds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString & {
|
|
316
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
317
|
-
}>;
|
|
318
|
-
}>;
|
|
319
|
-
export type OnSessionActiveContext = Static<typeof OnSessionActiveContextSchema>;
|
|
320
|
-
export declare const AppsOnBeforeDispatch: import("../../rpc.js").RpcDefinition<"apps/onBeforeDispatch", import("@sinclair/typebox").TObject<{
|
|
227
|
+
export type TaskAuthorizeDispatchContext = Static<typeof TaskAuthorizeDispatchContextSchema>;
|
|
228
|
+
export declare const TaskAuthorizeDispatch: import("../../rpc.js").RpcDefinition<"task/authorizeDispatch", import("@sinclair/typebox").TObject<{
|
|
321
229
|
taskId: import("@sinclair/typebox").TString & {
|
|
322
230
|
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
323
231
|
};
|
|
@@ -408,88 +316,4 @@ export declare const AppsOnBeforeDispatch: import("../../rpc.js").RpcDefinition<
|
|
|
408
316
|
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
409
317
|
}>]>;
|
|
410
318
|
}>>;
|
|
411
|
-
export declare const AppsOnBeforeMessageDelivery: import("../../rpc.js").RpcDefinition<"apps/onBeforeMessageDelivery", import("@sinclair/typebox").TObject<{
|
|
412
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
413
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
414
|
-
};
|
|
415
|
-
appId: import("@sinclair/typebox").TString;
|
|
416
|
-
conversationId: import("@sinclair/typebox").TString & {
|
|
417
|
-
static: import("../../brands.js").BrandedString<"ConversationId">;
|
|
418
|
-
};
|
|
419
|
-
sender: import("@sinclair/typebox").TObject<{
|
|
420
|
-
agentId: import("@sinclair/typebox").TString & {
|
|
421
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
422
|
-
};
|
|
423
|
-
ownerId: import("@sinclair/typebox").TString;
|
|
424
|
-
}>;
|
|
425
|
-
message: import("@sinclair/typebox").TObject<{
|
|
426
|
-
parts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
427
|
-
type: import("@sinclair/typebox").TLiteral<"text">;
|
|
428
|
-
text: import("@sinclair/typebox").TString;
|
|
429
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
430
|
-
type: import("@sinclair/typebox").TLiteral<"image">;
|
|
431
|
-
url: import("@sinclair/typebox").TString;
|
|
432
|
-
altText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
433
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
434
|
-
type: import("@sinclair/typebox").TLiteral<"file">;
|
|
435
|
-
url: import("@sinclair/typebox").TString;
|
|
436
|
-
name: import("@sinclair/typebox").TString;
|
|
437
|
-
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
438
|
-
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
439
|
-
}>]>>;
|
|
440
|
-
replyToId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString & {
|
|
441
|
-
static: import("../../brands.js").BrandedString<"MessageId">;
|
|
442
|
-
}>;
|
|
443
|
-
dispatchLeaseId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
444
|
-
}>;
|
|
445
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
446
|
-
block: import("@sinclair/typebox").TBoolean;
|
|
447
|
-
reason: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
448
|
-
patch: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
449
|
-
parts: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TObject<{
|
|
450
|
-
type: import("@sinclair/typebox").TLiteral<"text">;
|
|
451
|
-
text: import("@sinclair/typebox").TString;
|
|
452
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
453
|
-
type: import("@sinclair/typebox").TLiteral<"image">;
|
|
454
|
-
url: import("@sinclair/typebox").TString;
|
|
455
|
-
altText: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
456
|
-
}>, import("@sinclair/typebox").TObject<{
|
|
457
|
-
type: import("@sinclair/typebox").TLiteral<"file">;
|
|
458
|
-
url: import("@sinclair/typebox").TString;
|
|
459
|
-
name: import("@sinclair/typebox").TString;
|
|
460
|
-
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
461
|
-
size: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
462
|
-
}>]>>;
|
|
463
|
-
}>>;
|
|
464
|
-
feedback: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TObject<{
|
|
465
|
-
type: import("@sinclair/typebox").TString & {
|
|
466
|
-
static: "error" | "warning" | "info";
|
|
467
|
-
};
|
|
468
|
-
content: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TUnknown>;
|
|
469
|
-
retry: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TBoolean>;
|
|
470
|
-
}>>;
|
|
471
|
-
}>>;
|
|
472
|
-
export declare const AppsOnSessionActive: import("../../rpc.js").RpcDefinition<"apps/onSessionActive", import("@sinclair/typebox").TObject<{
|
|
473
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
474
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
475
|
-
};
|
|
476
|
-
appId: import("@sinclair/typebox").TString;
|
|
477
|
-
conversations: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
478
|
-
admittedAgentIds: import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString & {
|
|
479
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
480
|
-
}>;
|
|
481
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
482
|
-
export declare const AppsOnClose: import("../../rpc.js").RpcDefinition<"apps/onClose", import("@sinclair/typebox").TObject<{
|
|
483
|
-
taskId: import("@sinclair/typebox").TString & {
|
|
484
|
-
static: import("../../brands.js").BrandedString<"TaskId">;
|
|
485
|
-
};
|
|
486
|
-
appId: import("@sinclair/typebox").TString;
|
|
487
|
-
conversations: import("@sinclair/typebox").TRecord<import("@sinclair/typebox").TString, import("@sinclair/typebox").TString>;
|
|
488
|
-
closedBy: import("@sinclair/typebox").TObject<{
|
|
489
|
-
agentId: import("@sinclair/typebox").TString & {
|
|
490
|
-
static: import("../../brands.js").BrandedString<"AgentId">;
|
|
491
|
-
};
|
|
492
|
-
ownerId: import("@sinclair/typebox").TString;
|
|
493
|
-
}>;
|
|
494
|
-
}>, import("@sinclair/typebox").TObject<{}>>;
|
|
495
319
|
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/app/methods/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAatD,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/app/methods/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAatD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;GAcvB,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;IAwB1C,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyChC,CAAC;AA8BH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;EAMhC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwC9C,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,MAAM,CAC/C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOhC,CAAC"}
|
package/dist/app/methods/apps.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AgentId, ConversationId, MessageId, TaskId, } from "../../schema/primit
|
|
|
3
3
|
import { AppManifestSchema } from "../../schema/apps.js";
|
|
4
4
|
import { PartSchema } from "../../schema/messages.js";
|
|
5
5
|
import { LogicalClockSchema } from "../../schema/logical-clock.js";
|
|
6
|
-
import { DateTimeString
|
|
6
|
+
import { DateTimeString } from "../../helpers.js";
|
|
7
7
|
import { defineRpc } from "../../rpc.js";
|
|
8
8
|
export const AppsRegister = defineRpc({
|
|
9
9
|
name: "apps/register",
|
|
@@ -15,9 +15,17 @@ export const AppsRegister = defineRpc({
|
|
|
15
15
|
}, { additionalProperties: false }),
|
|
16
16
|
});
|
|
17
17
|
/**
|
|
18
|
-
* Verdict from a `
|
|
19
|
-
* `decision`: `grant` (allow; optional lease for held
|
|
20
|
-
* (reject), `hold` (defer behind a lease the
|
|
18
|
+
* Verdict from a `task/authorizeDispatch` admission round-trip.
|
|
19
|
+
* Discriminated by `decision`: `grant` (allow; optional lease for held
|
|
20
|
+
* delivery), `deny` (reject), `hold` (defer behind a lease the TM will
|
|
21
|
+
* release later).
|
|
22
|
+
*
|
|
23
|
+
* Phase 9b consumer-migration (sub-issue #460): the verdict shape stays
|
|
24
|
+
* frozen across the rename `apps/onBeforeDispatch → task/authorizeDispatch`
|
|
25
|
+
* because werewolf actively uses each variant for game-rule scheduling.
|
|
26
|
+
* Pre-rename, this schema lived alongside the deleted `before_dispatch`
|
|
27
|
+
* server-side framing; post-rename it is the receive-side TM-as-endpoint
|
|
28
|
+
* gate.
|
|
21
29
|
*/
|
|
22
30
|
export const DispatchAdmissionDecisionSchema = Type.Union([
|
|
23
31
|
Type.Object({
|
|
@@ -60,43 +68,45 @@ export const AppsAuthorizeDispatch = defineRpc({
|
|
|
60
68
|
}, { additionalProperties: false }),
|
|
61
69
|
});
|
|
62
70
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
63
|
-
//
|
|
71
|
+
// task/authorizeDispatch — receive-side admission round-trip.
|
|
64
72
|
//
|
|
65
|
-
//
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
73
|
+
// Phase 9b consumer-migration (sub-issue #460, plan §2.4 + §2.4.a):
|
|
74
|
+
// renamed from the deleted `apps/onBeforeDispatch`. The wire RPC is still
|
|
75
|
+
// server-initiated awaitable — server asks the recipient's TM whether to
|
|
76
|
+
// admit the inbound message — but the framing drops the "before_dispatch"
|
|
77
|
+
// hook vocabulary in favour of the TM-as-endpoint topology. Verdict shape
|
|
78
|
+
// (`DispatchAdmissionDecisionSchema`) is preserved so werewolf's dispatch
|
|
79
|
+
// state machine continues to work without arena-side changes (Phase 11
|
|
80
|
+
// absorbs arena's submodule cutover).
|
|
69
81
|
//
|
|
70
|
-
//
|
|
71
|
-
// `
|
|
72
|
-
//
|
|
73
|
-
//
|
|
82
|
+
// The other three pre-rename appCallback verbs (`apps/onBeforeMessageDelivery`,
|
|
83
|
+
// `apps/onSessionActive`, `apps/onClose`) are deleted in Phase 9b (plan
|
|
84
|
+
// §2.4): the TM's main message handler IS the gate now, and lifecycle
|
|
85
|
+
// notifications (`task/admissionComplete`, `task/closed`) replace the
|
|
86
|
+
// awaitable lifecycle hooks. The shared `appCallbackRpcMethods` group
|
|
87
|
+
// retires; `taskCallbackRpcMethods` houses the renamed verb.
|
|
74
88
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
75
89
|
const HookSenderSchema = Type.Object({
|
|
76
90
|
agentId: AgentId,
|
|
77
91
|
ownerId: Type.String(),
|
|
78
92
|
}, { additionalProperties: false });
|
|
79
|
-
const HookFeedbackSchema = Type.Object({
|
|
80
|
-
type: stringEnum(["error", "warning", "info"]),
|
|
81
|
-
content: Type.Record(Type.String(), Type.Unknown()),
|
|
82
|
-
retry: Type.Optional(Type.Boolean()),
|
|
83
|
-
}, { additionalProperties: false });
|
|
84
93
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
94
|
+
* Lifecycle-agent schema reused by notifications carrying actor identity
|
|
95
|
+
* (`task/closed`'s `closedBy` field). Phase 9b consumer-migration
|
|
96
|
+
* (sub-issue #460): the lifecycle hook RPCs that originally introduced
|
|
97
|
+
* this shape (`apps/onClose`'s context) retired; the notification frame
|
|
98
|
+
* still carries the same shape, so the export survives.
|
|
88
99
|
*/
|
|
89
|
-
export const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
patch: Type.Optional(Type.Object({ parts: Type.Array(PartSchema, { minItems: 1, maxItems: 10 }) }, { additionalProperties: false })),
|
|
93
|
-
feedback: Type.Optional(HookFeedbackSchema),
|
|
100
|
+
export const LifecycleAgentSchema = Type.Object({
|
|
101
|
+
agentId: AgentId,
|
|
102
|
+
ownerId: Type.String(),
|
|
94
103
|
}, { additionalProperties: false });
|
|
95
104
|
/**
|
|
96
|
-
* Context passed to a `
|
|
97
|
-
* server-side `
|
|
105
|
+
* Context passed to a `task/authorizeDispatch` admission round-trip.
|
|
106
|
+
* Mirrors the server-side `TaskAuthorizeDispatchContext` minus runtime-only
|
|
107
|
+
* fields (`signal`).
|
|
98
108
|
*/
|
|
99
|
-
export const
|
|
109
|
+
export const TaskAuthorizeDispatchContextSchema = Type.Object({
|
|
100
110
|
taskId: TaskId,
|
|
101
111
|
appId: Type.String(),
|
|
102
112
|
conversationId: ConversationId,
|
|
@@ -119,59 +129,9 @@ export const BeforeDispatchContextSchema = Type.Object({
|
|
|
119
129
|
parts: Type.Optional(Type.Array(PartSchema, { minItems: 1, maxItems: 10 })),
|
|
120
130
|
}, { additionalProperties: false }), { maxItems: 100 })),
|
|
121
131
|
}, { additionalProperties: false });
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
export const BeforeMessageDeliveryContextSchema = Type.Object({
|
|
126
|
-
taskId: TaskId,
|
|
127
|
-
appId: Type.String(),
|
|
128
|
-
conversationId: ConversationId,
|
|
129
|
-
sender: HookSenderSchema,
|
|
130
|
-
message: Type.Object({
|
|
131
|
-
parts: Type.Array(PartSchema, { minItems: 1, maxItems: 10 }),
|
|
132
|
-
replyToId: Type.Optional(MessageId),
|
|
133
|
-
dispatchLeaseId: Type.Optional(Type.String()),
|
|
134
|
-
}, { additionalProperties: false }),
|
|
135
|
-
}, { additionalProperties: false });
|
|
136
|
-
export const LifecycleAgentSchema = Type.Object({
|
|
137
|
-
agentId: AgentId,
|
|
138
|
-
ownerId: Type.String(),
|
|
139
|
-
}, { additionalProperties: false });
|
|
140
|
-
/** Context passed to an `on_close` lifecycle handler. */
|
|
141
|
-
export const OnCloseContextSchema = Type.Object({
|
|
142
|
-
taskId: TaskId,
|
|
143
|
-
appId: Type.String(),
|
|
144
|
-
conversations: Type.Record(Type.String(), Type.String()),
|
|
145
|
-
closedBy: LifecycleAgentSchema,
|
|
146
|
-
}, { additionalProperties: false });
|
|
147
|
-
/** Context passed to an `on_session_active` lifecycle handler. */
|
|
148
|
-
export const OnSessionActiveContextSchema = Type.Object({
|
|
149
|
-
taskId: TaskId,
|
|
150
|
-
appId: Type.String(),
|
|
151
|
-
conversations: Type.Record(Type.String(), Type.String()),
|
|
152
|
-
admittedAgentIds: Type.Array(AgentId),
|
|
153
|
-
}, { additionalProperties: false });
|
|
154
|
-
/** Empty result envelope for awaitable-void appCallback hooks. The reply still
|
|
155
|
-
* round-trips so AppHost can `Deferred.await` and apply manifest timeout. */
|
|
156
|
-
const VoidHookResultSchema = Type.Object({}, { additionalProperties: false });
|
|
157
|
-
export const AppsOnBeforeDispatch = defineRpc({
|
|
158
|
-
name: "apps/onBeforeDispatch",
|
|
159
|
-
params: BeforeDispatchContextSchema,
|
|
132
|
+
export const TaskAuthorizeDispatch = defineRpc({
|
|
133
|
+
name: "task/authorizeDispatch",
|
|
134
|
+
params: TaskAuthorizeDispatchContextSchema,
|
|
160
135
|
result: Type.Object({ admission: DispatchAdmissionDecisionSchema }, { additionalProperties: false }),
|
|
161
136
|
});
|
|
162
|
-
export const AppsOnBeforeMessageDelivery = defineRpc({
|
|
163
|
-
name: "apps/onBeforeMessageDelivery",
|
|
164
|
-
params: BeforeMessageDeliveryContextSchema,
|
|
165
|
-
result: HookResultSchema,
|
|
166
|
-
});
|
|
167
|
-
export const AppsOnSessionActive = defineRpc({
|
|
168
|
-
name: "apps/onSessionActive",
|
|
169
|
-
params: OnSessionActiveContextSchema,
|
|
170
|
-
result: VoidHookResultSchema,
|
|
171
|
-
});
|
|
172
|
-
export const AppsOnClose = defineRpc({
|
|
173
|
-
name: "apps/onClose",
|
|
174
|
-
params: OnCloseContextSchema,
|
|
175
|
-
result: VoidHookResultSchema,
|
|
176
|
-
});
|
|
177
137
|
//# sourceMappingURL=apps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/app/methods/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,EACT,MAAM,GACP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../../src/app/methods/apps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAe,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,OAAO,EACP,cAAc,EACd,SAAS,EACT,MAAM,GACP,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,eAAe;IACrB,MAAM,EAAE,IAAI,CAAC,MAAM,CACjB;QACE,QAAQ,EAAE,iBAAiB;KAC5B,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC;IACD,MAAM,EAAE,IAAI,CAAC,MAAM,CACjB;QACE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE;KACrB,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CA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C1B,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;QACxC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAClB,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CACtD;KACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,EACD,EAAE,QAAQ,EAAE,GAAG,EAAE,CAClB,CACF;CACF,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC,CAAC;AAMF,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,CAAC;IAC7C,IAAI,EAAE,wBAAwB;IAC9B,MAAM,EAAE,kCAAkC;IAC1C,MAAM,EAAE,IAAI,CAAC,MAAM,CACjB,EAAE,SAAS,EAAE,+BAA+B,EAAE,EAC9C,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAChC;CACF,CAAC,CAAC"}
|
|
@@ -16,38 +16,31 @@ export declare const agentId: (value: string) => AgentId;
|
|
|
16
16
|
* A reachable address in the actor-model network.
|
|
17
17
|
*
|
|
18
18
|
* Stable across reconnects for registered task-manager endpoints (durable in
|
|
19
|
-
* the `tasks.tm_endpoint_address` column).
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* the `tasks.tm_endpoint_address` column).
|
|
20
|
+
*
|
|
21
|
+
* Phase 9b consumer-migration (sub-issue #460 amendment): `EndpointAddress`
|
|
22
|
+
* is durable-only. Per-connection routing uses `ConnectionId` directly
|
|
23
|
+
* inside `AgentEndpointResolver`'s reverse index — the `agent-conn` kind
|
|
24
|
+
* that previously wrapped `connId` as an `EndpointAddress` was internal
|
|
25
|
+
* leakage (never appeared on the wire, never appeared in any DB column,
|
|
26
|
+
* never accepted from any client) and has been removed.
|
|
22
27
|
*/
|
|
23
28
|
export type EndpointAddress = BrandedString<"EndpointAddress">;
|
|
24
29
|
/**
|
|
25
30
|
* Endpoint kinds that may appear at the address prefix. Extending this list
|
|
26
31
|
* is the single edit point for new endpoint kinds.
|
|
27
32
|
*
|
|
28
|
-
* Phase
|
|
29
|
-
*
|
|
33
|
+
* Phase 9b consumer-migration (sub-issue #460 amendment): the
|
|
34
|
+
* `agent-conn` kind retired. The volatile per-WebSocket-connection
|
|
35
|
+
* lookup primitive lives entirely inside `AgentEndpointResolver` keyed
|
|
36
|
+
* by `ConnectionId`; nothing on the wire serializes it. `agent` carries
|
|
37
|
+
* the durable agent-id form `tm:agent:<agentId>` minted by
|
|
30
38
|
* {@link makeEndpointAddress} for task-manager registration (column
|
|
31
|
-
* `tasks.tm_endpoint_address`). `
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* authenticated agent. `app` is reserved for app-TM registrations the
|
|
35
|
-
* Phase-9 topology dispatches via in-process loopback or real WS.
|
|
36
|
-
*
|
|
37
|
-
* The split exists because routing semantics differ — `agent` resolves
|
|
38
|
-
* to "any connection of agentId" via the resolver's forward map, while
|
|
39
|
-
* `agent-conn` resolves to exactly one connection via the reverse
|
|
40
|
-
* index. Without distinct kinds, durable TM-routed `network.send`
|
|
41
|
-
* collapses into the per-connection reverse lookup and silently fails
|
|
42
|
-
* with `RecipientNotResolved` for any address whose tail is an agent id
|
|
43
|
-
* rather than a connection id.
|
|
44
|
-
*
|
|
45
|
-
* Order matters: the longer prefix `agent-conn:` MUST appear before
|
|
46
|
-
* `agent:` in the loops below so `startsWith("agent:")` does not
|
|
47
|
-
* pre-empt the `agent-conn` match. The const tuple's declaration order
|
|
48
|
-
* is the sole source of truth for that ordering.
|
|
39
|
+
* `tasks.tm_endpoint_address`). `app` is reserved for app-TM
|
|
40
|
+
* registrations the Phase-9 topology dispatches via in-process loopback
|
|
41
|
+
* or real WS.
|
|
49
42
|
*/
|
|
50
|
-
export declare const ENDPOINT_ADDRESS_KINDS: readonly ["agent
|
|
43
|
+
export declare const ENDPOINT_ADDRESS_KINDS: readonly ["agent", "app"];
|
|
51
44
|
export type EndpointAddressKind = (typeof ENDPOINT_ADDRESS_KINDS)[number];
|
|
52
45
|
/**
|
|
53
46
|
* Common prefix for every {@link EndpointAddress} on the wire — `tm:`.
|
|
@@ -92,13 +85,14 @@ export declare const makeEndpointAddress: (kind: EndpointAddressKind, uuid: stri
|
|
|
92
85
|
*
|
|
93
86
|
* Disambiguation: this is the legacy registration-tag union used by
|
|
94
87
|
* {@link EndpointRegistration}, NOT the address-prefix-driven
|
|
95
|
-
* {@link EndpointAddressKind}. `EndpointAddressKind` (`"agent
|
|
96
|
-
*
|
|
97
|
-
*
|
|
88
|
+
* {@link EndpointAddressKind}. `EndpointAddressKind` (`"agent"`, `"app"`)
|
|
89
|
+
* parses the wire-format `tm:<kind>:<uuid>` string; `EndpointKind` here
|
|
90
|
+
* labels a registration record's discriminator.
|
|
98
91
|
*
|
|
99
92
|
* - `"agent"` — a registered agent-identity endpoint. The resolver
|
|
100
|
-
* multimap keys by `AgentId`; the matching wire address
|
|
101
|
-
* `agent
|
|
93
|
+
* multimap keys by `AgentId`; the matching wire address kind is
|
|
94
|
+
* `agent` (durable per-agent). Per-connection routing is internal to
|
|
95
|
+
* the resolver and uses `ConnectionId` directly.
|
|
102
96
|
* - `"taskManager"` — a registered TM endpoint, durable in the `tasks`
|
|
103
97
|
* row. Persists across the TM's reconnect window.
|
|
104
98
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor-model.d.ts","sourceRoot":"","sources":["../../src/network/actor-model.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,qEAAqE;AACrE,MAAM,MAAM,MAAM,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,KAAG,MAA4B,CAAC;AAEpE,iFAAiF;AACjF,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;AAE/C,2FAA2F;AAC3F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AAO,GAAG,aAAa,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;CACnC,CAAC;AAMN;;;;;;;;GAQG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
|
@@ -29,29 +29,17 @@ export const agentId = (value) => AgentIdBrand(value);
|
|
|
29
29
|
* Endpoint kinds that may appear at the address prefix. Extending this list
|
|
30
30
|
* is the single edit point for new endpoint kinds.
|
|
31
31
|
*
|
|
32
|
-
* Phase
|
|
33
|
-
*
|
|
32
|
+
* Phase 9b consumer-migration (sub-issue #460 amendment): the
|
|
33
|
+
* `agent-conn` kind retired. The volatile per-WebSocket-connection
|
|
34
|
+
* lookup primitive lives entirely inside `AgentEndpointResolver` keyed
|
|
35
|
+
* by `ConnectionId`; nothing on the wire serializes it. `agent` carries
|
|
36
|
+
* the durable agent-id form `tm:agent:<agentId>` minted by
|
|
34
37
|
* {@link makeEndpointAddress} for task-manager registration (column
|
|
35
|
-
* `tasks.tm_endpoint_address`). `
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* authenticated agent. `app` is reserved for app-TM registrations the
|
|
39
|
-
* Phase-9 topology dispatches via in-process loopback or real WS.
|
|
40
|
-
*
|
|
41
|
-
* The split exists because routing semantics differ — `agent` resolves
|
|
42
|
-
* to "any connection of agentId" via the resolver's forward map, while
|
|
43
|
-
* `agent-conn` resolves to exactly one connection via the reverse
|
|
44
|
-
* index. Without distinct kinds, durable TM-routed `network.send`
|
|
45
|
-
* collapses into the per-connection reverse lookup and silently fails
|
|
46
|
-
* with `RecipientNotResolved` for any address whose tail is an agent id
|
|
47
|
-
* rather than a connection id.
|
|
48
|
-
*
|
|
49
|
-
* Order matters: the longer prefix `agent-conn:` MUST appear before
|
|
50
|
-
* `agent:` in the loops below so `startsWith("agent:")` does not
|
|
51
|
-
* pre-empt the `agent-conn` match. The const tuple's declaration order
|
|
52
|
-
* is the sole source of truth for that ordering.
|
|
38
|
+
* `tasks.tm_endpoint_address`). `app` is reserved for app-TM
|
|
39
|
+
* registrations the Phase-9 topology dispatches via in-process loopback
|
|
40
|
+
* or real WS.
|
|
53
41
|
*/
|
|
54
|
-
export const ENDPOINT_ADDRESS_KINDS = ["agent
|
|
42
|
+
export const ENDPOINT_ADDRESS_KINDS = ["agent", "app"];
|
|
55
43
|
/**
|
|
56
44
|
* Common prefix for every {@link EndpointAddress} on the wire — `tm:`.
|
|
57
45
|
* Exported so server-side code that mints addresses or routes by kind
|
|
@@ -67,8 +55,6 @@ export const isEndpointAddress = (value) => {
|
|
|
67
55
|
if (!value.startsWith(ENDPOINT_ADDRESS_PREFIX))
|
|
68
56
|
return false;
|
|
69
57
|
const rest = value.slice(ENDPOINT_ADDRESS_PREFIX.length);
|
|
70
|
-
// Walk in declaration order so `agent-conn:` is tried before `agent:`.
|
|
71
|
-
// See ENDPOINT_ADDRESS_KINDS doc for the longest-prefix invariant.
|
|
72
58
|
for (const kind of ENDPOINT_ADDRESS_KINDS) {
|
|
73
59
|
const kindPrefix = `${kind}:`;
|
|
74
60
|
if (rest.startsWith(kindPrefix)) {
|
|
@@ -100,10 +86,6 @@ export const endpointAddress = (value) => EndpointAddressBrand(value);
|
|
|
100
86
|
export const endpointAddressKind = (address) => {
|
|
101
87
|
const raw = address;
|
|
102
88
|
const rest = raw.slice(ENDPOINT_ADDRESS_PREFIX.length);
|
|
103
|
-
// Walk in declaration order — `agent-conn:` must precede `agent:` so
|
|
104
|
-
// the longer prefix wins (a `tm:agent-conn:<uuid>` value would also
|
|
105
|
-
// satisfy `startsWith("agent:")` if `agent` came first, which would
|
|
106
|
-
// mis-classify the kind).
|
|
107
89
|
for (const kind of ENDPOINT_ADDRESS_KINDS) {
|
|
108
90
|
if (rest.startsWith(`${kind}:`))
|
|
109
91
|
return kind;
|