@aeolus-fleet/common 0.27.0 → 0.28.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/fleet/core-version.d.ts +20 -0
- package/dist/fleet/core-version.js +59 -0
- package/dist/fleet/core-version.js.map +1 -0
- package/dist/fleet/index.d.ts +27 -4
- package/dist/fleet/index.js +43 -2
- package/dist/fleet/index.js.map +1 -1
- package/dist/ids/index.d.ts +3 -0
- package/dist/ids/index.js +2 -0
- package/dist/ids/index.js.map +1 -1
- package/dist/schemas/account-token.d.ts +49 -0
- package/dist/schemas/account-token.js +51 -0
- package/dist/schemas/account-token.js.map +1 -0
- package/dist/schemas/console.d.ts +8 -0
- package/dist/schemas/console.js +3 -1
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/delivery.d.ts +69 -3
- package/dist/schemas/delivery.js +35 -3
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +40 -2
- package/dist/schemas/fleet.js +21 -4
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +14 -0
- package/dist/schemas/history.d.ts +111 -9
- package/dist/schemas/history.js +19 -3
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/installation.d.ts +12 -0
- package/dist/schemas/installation.js +14 -1
- package/dist/schemas/installation.js.map +1 -1
- package/dist/schemas/label.d.ts +19 -5
- package/dist/schemas/label.js +7 -2
- package/dist/schemas/label.js.map +1 -1
- package/dist/schemas/network.d.ts +409 -90
- package/dist/schemas/network.js +76 -51
- package/dist/schemas/network.js.map +1 -1
- package/dist/schemas/statement.d.ts +94 -4
- package/dist/schemas/statement.js +33 -4
- package/dist/schemas/statement.js.map +1 -1
- package/dist/schemas/verified-fact.d.ts +109 -0
- package/dist/schemas/verified-fact.js +57 -0
- package/dist/schemas/verified-fact.js.map +1 -0
- package/dist/trierarch/crew-settings.js +1 -1
- package/dist/trierarch/report-details.js +2 -2
- package/package.json +1 -3
package/dist/schemas/network.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { idSchema } from '../ids/index.js';
|
|
3
|
+
import { accountIdSchema } from './account-token.js';
|
|
3
4
|
import { carriedLabelSchema } from './label.js';
|
|
4
5
|
/**
|
|
5
6
|
* Network rules (decision 0034): which ships may send to, read or manage
|
|
@@ -8,7 +9,7 @@ import { carriedLabelSchema } from './label.js';
|
|
|
8
9
|
* holds for every ship). Allow-only. The limits are the decision's; the server
|
|
9
10
|
* checks them, so every refusal names it.
|
|
10
11
|
*/
|
|
11
|
-
/** The most rules of
|
|
12
|
+
/** The most rules of its own one fleet may hold, beside the rules its ships declared (decision 0037). */
|
|
12
13
|
export const NETWORK_RULES_MAX = 200;
|
|
13
14
|
/** The most rules one ship may declare (decision 0037). */
|
|
14
15
|
export const DECLARED_NETWORK_RULES_MAX = 20;
|
|
@@ -39,55 +40,54 @@ export const labelSelectorSchema = z.array(selectorTermSchema);
|
|
|
39
40
|
export const NETWORK_VERBS = ['send', 'read', 'manage'];
|
|
40
41
|
/** One rule: the ships matching `from` may do its verb to the ships matching `to`. */
|
|
41
42
|
export const networkRuleSchema = z.object({ verb: z.enum(NETWORK_VERBS), from: labelSelectorSchema, to: labelSelectorSchema });
|
|
42
|
-
/**
|
|
43
|
-
export const
|
|
43
|
+
/** The fleet's own rules: the whole list, or none for all-to-all, open on (decision 0034). */
|
|
44
|
+
export const networkRulesSchema = z.array(networkRuleSchema).nullable();
|
|
45
|
+
/** Input of `fleet.saveNetworkRulesDraft` (fleet:network): the draft of the fleet's own rules, a whole list or none for all-to-all. */
|
|
46
|
+
export const saveNetworkRulesDraftInputSchema = z.object({ rules: networkRulesSchema });
|
|
47
|
+
/** Output of `fleet.saveNetworkRulesDraft`: the settings version the draft was saved against, which its apply names. */
|
|
48
|
+
export const saveNetworkRulesDraftOutputSchema = z.object({ savedAgainstVersion: z.int().min(0) });
|
|
49
|
+
/** Input of `fleet.applyNetworkRules` (fleet:network): the settings version the caller saw the draft against; a moved one refuses the apply. */
|
|
50
|
+
export const applyNetworkRulesInputSchema = z.object({ version: z.int().min(0) });
|
|
44
51
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* which argo turns off or on; and open, every ship to every ship, one per
|
|
49
|
-
* verb, which the networking plugin turns off or on.
|
|
52
|
+
* Output of `fleet.networkRules` (fleet:network): the applied rules at the
|
|
53
|
+
* settings version, none for a fleet that never set any, and the draft, with
|
|
54
|
+
* when it was saved and against which version, or none.
|
|
50
55
|
*/
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
.refine((input) => (input.rule === 'open') === (input.verb !== undefined), { message: 'open names its verb, and no other built-in rule names one', path: ['verb'] });
|
|
56
|
+
export const networkRulesOutputSchema = z.object({
|
|
57
|
+
applied: z.object({ rules: networkRulesSchema, version: z.int().min(0) }),
|
|
58
|
+
draft: z.object({ rules: networkRulesSchema, savedAt: z.iso.datetime(), savedAgainstVersion: z.int().min(0) }).nullable(),
|
|
59
|
+
});
|
|
60
|
+
/** Output of `fleet.discardNetworkRulesDraft`. */
|
|
61
|
+
export const discardNetworkRulesDraftOutputSchema = z.object({});
|
|
58
62
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
63
|
+
* The built-in rules, core's own (decision 0034): argo to and from every ship,
|
|
64
|
+
* the owner's ship to the ships it owns, an answer to the sender of the
|
|
65
|
+
* message it answers, and a connected plugin's ship reading every ship, which
|
|
66
|
+
* are never off; the viewer reading every ship,
|
|
67
|
+
* which an actor holding fleet:network turns off or on; the installation
|
|
68
|
+
* managing person ships and the ships they own, never off (decision 0020); and
|
|
69
|
+
* open, every ship to every ship by every verb, on exactly while the fleet has
|
|
70
|
+
* no rules applied.
|
|
61
71
|
*/
|
|
62
|
-
export const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
72
|
+
export const BUILT_IN_RULES = ['argo', 'owner', 'answer', 'pluginRead', 'viewerRead', 'installation', 'open'];
|
|
73
|
+
/** The built-in rules that are never off. */
|
|
74
|
+
export const FIXED_BUILT_IN_RULES = ['argo', 'owner', 'answer', 'pluginRead', 'installation'];
|
|
75
|
+
/** Input of `fleet.setBuiltInRule` (fleet:network): a built-in rule turned on or off; the server turns only the viewer reading. */
|
|
76
|
+
export const setBuiltInRuleInputSchema = z.object({ rule: z.enum(BUILT_IN_RULES), isOn: z.boolean() });
|
|
77
|
+
/** One built-in rule as it is now, and whether it is on; the fixed ones always are. */
|
|
78
|
+
export const builtInRuleStateSchema = z.object({ rule: z.enum(BUILT_IN_RULES), isOn: z.boolean() });
|
|
66
79
|
/** Output of `fleet.builtInRules` (fleet:network): every built-in rule as it is now, in the order the rule list shows them, first (decision 0034). */
|
|
67
80
|
export const builtInRulesOutputSchema = z.array(builtInRuleStateSchema);
|
|
68
|
-
/** Output of `fleet.
|
|
69
|
-
export const
|
|
81
|
+
/** Output of `fleet.applyNetworkRules` and `fleet.setBuiltInRule`: the version the fleet's network settings have now. */
|
|
82
|
+
export const networkVersionOutputSchema = z.object({ version: z.int().min(0) });
|
|
70
83
|
/** Input of `fleet.declareNetworkRules` (labels:define): every rule the ship declares from now on, on labels it owns; an empty list withdraws them (decision 0037). */
|
|
71
84
|
export const declareNetworkRulesInputSchema = z.object({ rules: z.array(networkRuleSchema) });
|
|
72
85
|
/** Output of `fleet.declareNetworkRules`: how many rules the ship declares now. */
|
|
73
86
|
export const declareNetworkRulesOutputSchema = z.object({ rules: z.int().min(0) });
|
|
74
|
-
/**
|
|
75
|
-
export const
|
|
76
|
-
/**
|
|
77
|
-
|
|
78
|
-
* (decision 0035): every send refused but the fixed exceptions, every send
|
|
79
|
-
* allowed, or the rules it supplied last kept.
|
|
80
|
-
*/
|
|
81
|
-
export const WHILE_UNAVAILABLE = ['block-all', 'open-all', 'keep-latest'];
|
|
82
|
-
/** The least time without a call from its ship after which a networking plugin is not responding: longer than a receive waits. */
|
|
83
|
-
export const NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MIN_SECONDS = 60;
|
|
84
|
-
/** The most: a day. */
|
|
85
|
-
export const NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MAX_SECONDS = 86_400;
|
|
86
|
-
/** Input of `fleet.registerNetworkPlugin` (fleet:network): what happens while the plugin is unavailable, and after how long without a call it is not responding. */
|
|
87
|
-
export const registerNetworkPluginInputSchema = z.object({
|
|
88
|
-
whileUnavailable: z.enum(WHILE_UNAVAILABLE),
|
|
89
|
-
notRespondingAfterSeconds: z.int().min(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MIN_SECONDS).max(NETWORK_PLUGIN_NOT_RESPONDING_AFTER_MAX_SECONDS),
|
|
90
|
-
});
|
|
87
|
+
/** Who declared network rules (decisions 0037, 0052): a ship, or the installation on the labels it owns. */
|
|
88
|
+
export const declarerSchema = z.discriminatedUnion('kind', [z.object({ kind: z.literal('ship'), shipId: idSchema('ship') }), z.object({ kind: z.literal('installation') })]);
|
|
89
|
+
/** Output of `fleet.declaredNetworkRules` (fleet:network): each declarer of rules, with its whole list. */
|
|
90
|
+
export const declaredNetworkRulesOutputSchema = z.array(z.object({ declarer: declarerSchema, rules: z.array(networkRuleSchema) }));
|
|
91
91
|
/** A ship as a reach refusal saw it: its id, its name, the label values it carried then and its owner's ship then, none for argo and the viewer (decision 0045). */
|
|
92
92
|
const refusedShipSchema = z.object({
|
|
93
93
|
id: idSchema('ship'),
|
|
@@ -101,11 +101,26 @@ const refusedShipSchema = z.object({
|
|
|
101
101
|
* (decision 0034). Any other call refuses it.
|
|
102
102
|
*/
|
|
103
103
|
export const ON_BEHALF_OF_HEADER = 'aeolus-on-behalf-of';
|
|
104
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Who a refusal refused (decision 0057): a ship as it was; an account by
|
|
106
|
+
* its id only, never an email, with the `group` values its token carried
|
|
107
|
+
* that the fleet defines and its person ship then; or the installation.
|
|
108
|
+
*/
|
|
109
|
+
const refusedActorSchema = z.discriminatedUnion('kind', [
|
|
110
|
+
refusedShipSchema.extend({ kind: z.literal('ship') }),
|
|
111
|
+
z.object({
|
|
112
|
+
kind: z.literal('account'),
|
|
113
|
+
accountId: accountIdSchema,
|
|
114
|
+
labels: z.array(carriedLabelSchema),
|
|
115
|
+
personShip: z.object({ id: idSchema('ship'), name: z.string() }).nullable(),
|
|
116
|
+
}),
|
|
117
|
+
z.object({ kind: z.literal('installation') }),
|
|
118
|
+
]);
|
|
119
|
+
/** One refused call: who tried to reach whom by which verb, the actor and the ship as they were with their owners, the settings version that refused it and when. */
|
|
105
120
|
export const reachRefusalSchema = z.object({
|
|
106
121
|
id: idSchema('reachRefusal'),
|
|
107
122
|
at: z.iso.datetime(),
|
|
108
|
-
sender:
|
|
123
|
+
sender: refusedActorSchema,
|
|
109
124
|
/** The plugin ship that read on behalf of the sender (decision 0034), as it was then; null for the sender's own call. */
|
|
110
125
|
askedBy: refusedShipSchema.nullable(),
|
|
111
126
|
recipient: z.discriminatedUnion('kind', [
|
|
@@ -116,25 +131,35 @@ export const reachRefusalSchema = z.object({
|
|
|
116
131
|
/** What the sender tried to do: send, the one verb checked so far. */
|
|
117
132
|
verb: z.enum(NETWORK_VERBS),
|
|
118
133
|
settingsVersion: z.int().min(1),
|
|
119
|
-
/** What the plugin declared for while it is unavailable, when it refused because the plugin was not responding (decision 0035); null otherwise. */
|
|
120
|
-
whilePluginUnavailable: z.enum(['block-all', 'keep-latest']).nullable(),
|
|
121
134
|
});
|
|
122
135
|
/** Output of `fleet.reachRefusals` (argo only): the fleet's latest refusals, newest first, at most REACH_REFUSALS_READ_MAX. */
|
|
123
136
|
export const reachRefusalsOutputSchema = z.array(reachRefusalSchema);
|
|
124
|
-
/** Input of `fleet.explainReach` (
|
|
125
|
-
export const explainReachInputSchema = z.object({ fromShipId: idSchema('ship'), toShipId: idSchema('ship').optional() });
|
|
137
|
+
/** Input of `fleet.explainReach` (fleet:explain): the ship to explain from, the one ship asked about or none for every ship, and the rules to explain against: the applied ones, or the draft. */
|
|
138
|
+
export const explainReachInputSchema = z.object({ fromShipId: idSchema('ship'), toShipId: idSchema('ship').optional(), against: z.enum(['applied', 'draft']).optional() });
|
|
126
139
|
/**
|
|
127
140
|
* The rule that lets one ship reach another (decision 0034): a built-in rule;
|
|
128
|
-
*
|
|
129
|
-
* or a rule
|
|
130
|
-
* list (decision 0037).
|
|
141
|
+
* one of the fleet's own rules, by its place in the fleet's list;
|
|
142
|
+
* or a declared rule, by its declarer, a ship or the installation, and its
|
|
143
|
+
* place in that declarer's list (decision 0037).
|
|
131
144
|
*/
|
|
132
145
|
export const reachRuleSchema = z.union([
|
|
133
146
|
z.object({ builtIn: z.enum(BUILT_IN_RULES) }),
|
|
134
|
-
z.object({
|
|
135
|
-
z.object({ declared:
|
|
147
|
+
z.object({ rule: z.int().min(0) }),
|
|
148
|
+
z.object({ declared: declarerSchema, index: z.int().min(0) }),
|
|
136
149
|
]);
|
|
137
150
|
const reachedShipsSchema = z.array(z.object({ shipId: idSchema('ship'), rule: reachRuleSchema }));
|
|
138
151
|
/** Output of `fleet.explainReach`: per verb, the ships it reaches now, each with the rule that allows it. */
|
|
139
152
|
export const explainReachOutputSchema = z.object({ send: reachedShipsSchema, read: reachedShipsSchema, manage: reachedShipsSchema });
|
|
153
|
+
const reachChangesSchema = z.array(z.object({ fromShipId: idSchema('ship'), toShipId: idSchema('ship'), rule: reachRuleSchema }));
|
|
154
|
+
/**
|
|
155
|
+
* Output of `fleet.networkRulesDraftChanges` (fleet:network): per verb, the
|
|
156
|
+
* pairs of ships the caller reads whose reach the draft gains, each with the
|
|
157
|
+
* draft's rule that allows it, and loses, each with the applied rule that
|
|
158
|
+
* allows it now (decision 0034).
|
|
159
|
+
*/
|
|
160
|
+
export const networkRulesDraftChangesOutputSchema = z.object({
|
|
161
|
+
send: z.object({ gained: reachChangesSchema, lost: reachChangesSchema }),
|
|
162
|
+
read: z.object({ gained: reachChangesSchema, lost: reachChangesSchema }),
|
|
163
|
+
manage: z.object({ gained: reachChangesSchema, lost: reachChangesSchema }),
|
|
164
|
+
});
|
|
140
165
|
//# sourceMappingURL=network.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/schemas/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AAEH,
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/schemas/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD;;;;;;GAMG;AAEH,yGAAyG;AACzG,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC,2DAA2D;AAC3D,MAAM,CAAC,MAAM,0BAA0B,GAAG,EAAE,CAAC;AAE7C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAY,CAAC;AAE5C,wGAAwG;AACxG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAY,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,QAAQ,CAAC,YAAY,CAAC;IACtB,CAAC,CAAC,MAAM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,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;IACxE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;CAC3E,CAAC,CAAC"}
|
|
@@ -3,14 +3,20 @@ import { z } from 'zod';
|
|
|
3
3
|
* A ship's statement (decision 0047): what it is and what it offers, stated
|
|
4
4
|
* by its crew and read by the ships that can send to it. A short summary and
|
|
5
5
|
* capabilities, each borrowing MCP's tool fields (name, title, description,
|
|
6
|
-
* inputSchema, outputSchema) and A2A's skill fields for media
|
|
7
|
-
* (inputModes, outputModes), so a later gateway maps them as they are
|
|
8
|
-
* (decision 0048)
|
|
6
|
+
* inputSchema, outputSchema, annotations) and A2A's skill fields for media
|
|
7
|
+
* types (inputModes, outputModes), so a later gateway maps them as they are
|
|
8
|
+
* (decision 0048), and what a call through the gateway needs: its wait, its
|
|
9
|
+
* deadline and whether it is repeatable (interop 3.4, 5.2, 5.3). Core checks
|
|
10
|
+
* the shape and acts on none of it.
|
|
9
11
|
*/
|
|
10
12
|
/** The most a statement holds: 64 KB as the UTF-8 bytes of its JSON, as a payload does (decision 0006). */
|
|
11
13
|
export declare const STATEMENT_MAX_BYTES: number;
|
|
12
14
|
/** The longest a statement's summary may be. */
|
|
13
15
|
export declare const STATEMENT_SUMMARY_MAX_LENGTH = 1000;
|
|
16
|
+
/** The longest a capability may ask the gateway to hold an outside call for its reply: 2 minutes (interop 5.3). */
|
|
17
|
+
export declare const CAPABILITY_WAIT_MAX_MS = 120000;
|
|
18
|
+
/** The longest deadline a capability may state for a call: 7 days (interop 3.4). */
|
|
19
|
+
export declare const CAPABILITY_DEADLINE_MAX_MS: number;
|
|
14
20
|
/** One thing a ship offers: MCP's tool fields and A2A's input and output modes. */
|
|
15
21
|
export declare const capabilitySchema: z.ZodObject<{
|
|
16
22
|
name: z.ZodString;
|
|
@@ -20,6 +26,16 @@ export declare const capabilitySchema: z.ZodObject<{
|
|
|
20
26
|
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
21
27
|
inputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
22
28
|
outputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
29
|
+
waitMs: z.ZodOptional<z.ZodInt>;
|
|
30
|
+
deadlineMs: z.ZodOptional<z.ZodInt>;
|
|
31
|
+
repeatable: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
title: z.ZodOptional<z.ZodString>;
|
|
34
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, z.core.$strict>>;
|
|
23
39
|
}, z.core.$strict>;
|
|
24
40
|
export type Capability = z.infer<typeof capabilitySchema>;
|
|
25
41
|
/** The size of a statement: the UTF-8 bytes of its JSON. */
|
|
@@ -35,6 +51,16 @@ export declare const statementSchema: z.ZodObject<{
|
|
|
35
51
|
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
36
52
|
inputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
37
53
|
outputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
waitMs: z.ZodOptional<z.ZodInt>;
|
|
55
|
+
deadlineMs: z.ZodOptional<z.ZodInt>;
|
|
56
|
+
repeatable: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
title: z.ZodOptional<z.ZodString>;
|
|
59
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
62
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
+
}, z.core.$strict>>;
|
|
38
64
|
}, z.core.$strict>>;
|
|
39
65
|
}, z.core.$strict>;
|
|
40
66
|
export type Statement = z.infer<typeof statementSchema>;
|
|
@@ -49,6 +75,16 @@ export declare const setStatementInputSchema: z.ZodObject<{
|
|
|
49
75
|
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
50
76
|
inputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
51
77
|
outputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
78
|
+
waitMs: z.ZodOptional<z.ZodInt>;
|
|
79
|
+
deadlineMs: z.ZodOptional<z.ZodInt>;
|
|
80
|
+
repeatable: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
82
|
+
title: z.ZodOptional<z.ZodString>;
|
|
83
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
}, z.core.$strict>>;
|
|
52
88
|
}, z.core.$strict>>;
|
|
53
89
|
}, z.core.$strict>;
|
|
54
90
|
/** Output of `setStatement`: the statement's version now. */
|
|
@@ -72,6 +108,16 @@ export declare const discoveredStatementSchema: z.ZodNullable<z.ZodDiscriminated
|
|
|
72
108
|
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
73
109
|
inputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
74
110
|
outputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
111
|
+
waitMs: z.ZodOptional<z.ZodInt>;
|
|
112
|
+
deadlineMs: z.ZodOptional<z.ZodInt>;
|
|
113
|
+
repeatable: z.ZodOptional<z.ZodBoolean>;
|
|
114
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
title: z.ZodOptional<z.ZodString>;
|
|
116
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
117
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
119
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
}, z.core.$strict>>;
|
|
75
121
|
}, z.core.$strict>>;
|
|
76
122
|
}, z.core.$strip>, z.ZodObject<{
|
|
77
123
|
by: z.ZodLiteral<"commission">;
|
|
@@ -80,7 +126,7 @@ export declare const discoveredStatementSchema: z.ZodNullable<z.ZodDiscriminated
|
|
|
80
126
|
export type DiscoveredStatement = z.infer<typeof discoveredStatementSchema>;
|
|
81
127
|
/**
|
|
82
128
|
* Output of `discover` (messages:send): the ships the caller may send to now,
|
|
83
|
-
* each with its name, type, kind, status and
|
|
129
|
+
* each with its name, type, kind, status, statement and verified facts, and each type with
|
|
84
130
|
* how many of its ships it reaches (decision 0047). Ships, never rules.
|
|
85
131
|
*/
|
|
86
132
|
export declare const discoverOutputSchema: z.ZodObject<{
|
|
@@ -112,11 +158,55 @@ export declare const discoverOutputSchema: z.ZodObject<{
|
|
|
112
158
|
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
113
159
|
inputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
160
|
outputModes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
161
|
+
waitMs: z.ZodOptional<z.ZodInt>;
|
|
162
|
+
deadlineMs: z.ZodOptional<z.ZodInt>;
|
|
163
|
+
repeatable: z.ZodOptional<z.ZodBoolean>;
|
|
164
|
+
annotations: z.ZodOptional<z.ZodObject<{
|
|
165
|
+
title: z.ZodOptional<z.ZodString>;
|
|
166
|
+
readOnlyHint: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
destructiveHint: z.ZodOptional<z.ZodBoolean>;
|
|
168
|
+
idempotentHint: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
openWorldHint: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strict>>;
|
|
115
171
|
}, z.core.$strict>>;
|
|
116
172
|
}, z.core.$strip>, z.ZodObject<{
|
|
117
173
|
by: z.ZodLiteral<"commission">;
|
|
118
174
|
note: z.ZodString;
|
|
119
175
|
}, z.core.$strip>], "by">>;
|
|
176
|
+
verified: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
177
|
+
checked: z.ZodEnum<{
|
|
178
|
+
clientIdDocumentDomain: "clientIdDocumentDomain";
|
|
179
|
+
tlsHost: "tlsHost";
|
|
180
|
+
a2aCardDomain: "a2aCardDomain";
|
|
181
|
+
}>;
|
|
182
|
+
value: z.ZodString;
|
|
183
|
+
by: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
184
|
+
kind: z.ZodLiteral<"ship">;
|
|
185
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
186
|
+
name: z.ZodString;
|
|
187
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
188
|
+
kind: z.ZodLiteral<"account">;
|
|
189
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
190
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
191
|
+
kind: z.ZodLiteral<"installation">;
|
|
192
|
+
}, z.core.$strict>], "kind">;
|
|
193
|
+
at: z.ZodISODateTime;
|
|
194
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
195
|
+
checked: z.ZodLiteral<"oauthSubject">;
|
|
196
|
+
issuer: z.ZodString;
|
|
197
|
+
value: z.ZodString;
|
|
198
|
+
by: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
199
|
+
kind: z.ZodLiteral<"ship">;
|
|
200
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
201
|
+
name: z.ZodString;
|
|
202
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
203
|
+
kind: z.ZodLiteral<"account">;
|
|
204
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
205
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
206
|
+
kind: z.ZodLiteral<"installation">;
|
|
207
|
+
}, z.core.$strict>], "kind">;
|
|
208
|
+
at: z.ZodISODateTime;
|
|
209
|
+
}, z.core.$strict>], "checked">>;
|
|
120
210
|
}, z.core.$strip>>;
|
|
121
211
|
types: z.ZodArray<z.ZodObject<{
|
|
122
212
|
type: z.ZodString;
|
|
@@ -2,13 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
import { shipKindSchema, shipStatusSchema } from '../fleet/index.js';
|
|
3
3
|
import { idSchema } from '../ids/index.js';
|
|
4
4
|
import { contentTypeSchema } from './message.js';
|
|
5
|
+
import { discoveredVerifiedFactSchema } from './verified-fact.js';
|
|
5
6
|
/**
|
|
6
7
|
* A ship's statement (decision 0047): what it is and what it offers, stated
|
|
7
8
|
* by its crew and read by the ships that can send to it. A short summary and
|
|
8
9
|
* capabilities, each borrowing MCP's tool fields (name, title, description,
|
|
9
|
-
* inputSchema, outputSchema) and A2A's skill fields for media
|
|
10
|
-
* (inputModes, outputModes), so a later gateway maps them as they are
|
|
11
|
-
* (decision 0048)
|
|
10
|
+
* inputSchema, outputSchema, annotations) and A2A's skill fields for media
|
|
11
|
+
* types (inputModes, outputModes), so a later gateway maps them as they are
|
|
12
|
+
* (decision 0048), and what a call through the gateway needs: its wait, its
|
|
13
|
+
* deadline and whether it is repeatable (interop 3.4, 5.2, 5.3). Core checks
|
|
14
|
+
* the shape and acts on none of it.
|
|
12
15
|
*/
|
|
13
16
|
/** The most a statement holds: 64 KB as the UTF-8 bytes of its JSON, as a payload does (decision 0006). */
|
|
14
17
|
export const STATEMENT_MAX_BYTES = 64 * 1024;
|
|
@@ -19,6 +22,18 @@ const CAPABILITY_NAME = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
|
19
22
|
const CAPABILITY_NAME_MESSAGE = 'A capability name is 1 to 128 letters, digits, _, - or ., as MCP names a tool';
|
|
20
23
|
/** A JSON Schema as MCP's tool takes one: a JSON object, never read by the fleet. */
|
|
21
24
|
const jsonSchemaSchema = z.record(z.string(), z.json());
|
|
25
|
+
/** The longest a capability may ask the gateway to hold an outside call for its reply: 2 minutes (interop 5.3). */
|
|
26
|
+
export const CAPABILITY_WAIT_MAX_MS = 120_000;
|
|
27
|
+
/** The longest deadline a capability may state for a call: 7 days (interop 3.4). */
|
|
28
|
+
export const CAPABILITY_DEADLINE_MAX_MS = 7 * 24 * 60 * 60 * 1000;
|
|
29
|
+
/** MCP's tool annotations as MCP defines them: hints a client trusts only from a trusted server. */
|
|
30
|
+
const toolAnnotationsSchema = z.strictObject({
|
|
31
|
+
title: z.string().optional(),
|
|
32
|
+
readOnlyHint: z.boolean().optional(),
|
|
33
|
+
destructiveHint: z.boolean().optional(),
|
|
34
|
+
idempotentHint: z.boolean().optional(),
|
|
35
|
+
openWorldHint: z.boolean().optional(),
|
|
36
|
+
});
|
|
22
37
|
/** Media types, as A2A's skill lists them: at least one, the first the one to use. */
|
|
23
38
|
const modesSchema = z.array(contentTypeSchema).min(1, 'Name at least one media type');
|
|
24
39
|
/** One thing a ship offers: MCP's tool fields and A2A's input and output modes. */
|
|
@@ -32,6 +47,18 @@ export const capabilitySchema = z.strictObject({
|
|
|
32
47
|
inputModes: modesSchema.optional(),
|
|
33
48
|
/** The media types that come back, the first the one to expect (A2A's skill outputModes). */
|
|
34
49
|
outputModes: modesSchema.optional(),
|
|
50
|
+
/**
|
|
51
|
+
* How long the gateway may hold an outside call for the reply, in
|
|
52
|
+
* milliseconds, capped by its configuration; none is 0, answered at once
|
|
53
|
+
* with a task or a handle (interop 5.3).
|
|
54
|
+
*/
|
|
55
|
+
waitMs: z.int().min(0).max(CAPABILITY_WAIT_MAX_MS).optional(),
|
|
56
|
+
/** How long a call may take before the gateway fails it, in milliseconds; none is no deadline (interop 3.4). */
|
|
57
|
+
deadlineMs: z.int().min(1).max(CAPABILITY_DEADLINE_MAX_MS).optional(),
|
|
58
|
+
/** Whether a call that died before it was confirmed may be handed again; none is not (interop 5.2). */
|
|
59
|
+
repeatable: z.boolean().optional(),
|
|
60
|
+
/** MCP's tool annotations, as the outside server gave them. */
|
|
61
|
+
annotations: toolAnnotationsSchema.optional(),
|
|
35
62
|
});
|
|
36
63
|
const utf8 = new TextEncoder();
|
|
37
64
|
/** The size of a statement: the UTF-8 bytes of its JSON. */
|
|
@@ -71,7 +98,7 @@ export const discoveredStatementSchema = z
|
|
|
71
98
|
.nullable();
|
|
72
99
|
/**
|
|
73
100
|
* Output of `discover` (messages:send): the ships the caller may send to now,
|
|
74
|
-
* each with its name, type, kind, status and
|
|
101
|
+
* each with its name, type, kind, status, statement and verified facts, and each type with
|
|
75
102
|
* how many of its ships it reaches (decision 0047). Ships, never rules.
|
|
76
103
|
*/
|
|
77
104
|
export const discoverOutputSchema = z.object({
|
|
@@ -82,6 +109,8 @@ export const discoverOutputSchema = z.object({
|
|
|
82
109
|
kind: shipKindSchema,
|
|
83
110
|
status: shipStatusSchema,
|
|
84
111
|
statement: discoveredStatementSchema,
|
|
112
|
+
/** The facts actors checked about it, oldest first, each naming its writer (decision 0059). */
|
|
113
|
+
verified: z.array(discoveredVerifiedFactSchema),
|
|
85
114
|
})),
|
|
86
115
|
types: z.array(z.object({ type: z.string(), reachable: z.int().min(1) })),
|
|
87
116
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statement.js","sourceRoot":"","sources":["../../src/schemas/statement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,c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,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;CAC1E,CAAC,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A verified fact (decision 0059): what an actor checked about a ship, stored
|
|
4
|
+
* as its writer wrote it and shown beside the ship's statement in discovery,
|
|
5
|
+
* naming the writer. One fixed shape: what was checked, from a closed list,
|
|
6
|
+
* the value the check found, and the issuer only where a value means
|
|
7
|
+
* something under one. Core checks the shape and acts on none of it.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* What a writer may have checked: the domain a client id document came from,
|
|
11
|
+
* the host a TLS certificate was valid for, the domain an A2A card came from,
|
|
12
|
+
* and the subject an OAuth issuer issued a credential to.
|
|
13
|
+
*/
|
|
14
|
+
export declare const VERIFIED_CHECKS: readonly ["clientIdDocumentDomain", "tlsHost", "a2aCardDomain", "oauthSubject"];
|
|
15
|
+
export declare const verifiedCheckSchema: z.ZodEnum<{
|
|
16
|
+
clientIdDocumentDomain: "clientIdDocumentDomain";
|
|
17
|
+
tlsHost: "tlsHost";
|
|
18
|
+
a2aCardDomain: "a2aCardDomain";
|
|
19
|
+
oauthSubject: "oauthSubject";
|
|
20
|
+
}>;
|
|
21
|
+
export type VerifiedCheck = z.infer<typeof verifiedCheckSchema>;
|
|
22
|
+
/** The longest value a fact holds: a domain, a host or a subject. */
|
|
23
|
+
export declare const VERIFIED_FACT_VALUE_MAX_LENGTH = 255;
|
|
24
|
+
/** The longest issuer a fact names. */
|
|
25
|
+
export declare const VERIFIED_FACT_ISSUER_MAX_LENGTH = 2048;
|
|
26
|
+
/** The most facts one writer holds about one ship. */
|
|
27
|
+
export declare const VERIFIED_FACTS_MAX = 10;
|
|
28
|
+
/** One fact as its writer writes it: an OAuth subject with its issuer, every other check without one. */
|
|
29
|
+
export declare const verifiedFactSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
+
checked: z.ZodEnum<{
|
|
31
|
+
clientIdDocumentDomain: "clientIdDocumentDomain";
|
|
32
|
+
tlsHost: "tlsHost";
|
|
33
|
+
a2aCardDomain: "a2aCardDomain";
|
|
34
|
+
}>;
|
|
35
|
+
value: z.ZodString;
|
|
36
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
+
checked: z.ZodLiteral<"oauthSubject">;
|
|
38
|
+
issuer: z.ZodString;
|
|
39
|
+
value: z.ZodString;
|
|
40
|
+
}, z.core.$strict>], "checked">;
|
|
41
|
+
export type VerifiedFact = z.infer<typeof verifiedFactSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* Input of `fleet.setVerifiedFacts` (fleet:verify): the ship written about
|
|
44
|
+
* and the caller's facts about it, whole, each fact once; none withdraws
|
|
45
|
+
* them.
|
|
46
|
+
*/
|
|
47
|
+
export declare const setVerifiedFactsInputSchema: z.ZodObject<{
|
|
48
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
49
|
+
facts: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
50
|
+
checked: z.ZodEnum<{
|
|
51
|
+
clientIdDocumentDomain: "clientIdDocumentDomain";
|
|
52
|
+
tlsHost: "tlsHost";
|
|
53
|
+
a2aCardDomain: "a2aCardDomain";
|
|
54
|
+
}>;
|
|
55
|
+
value: z.ZodString;
|
|
56
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
57
|
+
checked: z.ZodLiteral<"oauthSubject">;
|
|
58
|
+
issuer: z.ZodString;
|
|
59
|
+
value: z.ZodString;
|
|
60
|
+
}, z.core.$strict>], "checked">>;
|
|
61
|
+
}, z.core.$strip>;
|
|
62
|
+
/** Output of `fleet.setVerifiedFacts`: nothing; the OK is the answer. */
|
|
63
|
+
export declare const setVerifiedFactsOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
64
|
+
/** Who wrote a fact, as discovery names an actor (decision 0057): a ship by id and name, an account by its id only, or the installation. */
|
|
65
|
+
export declare const factWriterSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
+
kind: z.ZodLiteral<"ship">;
|
|
67
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"account">;
|
|
71
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
72
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"installation">;
|
|
74
|
+
}, z.core.$strict>], "kind">;
|
|
75
|
+
export declare const discoveredVerifiedFactSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
76
|
+
checked: z.ZodEnum<{
|
|
77
|
+
clientIdDocumentDomain: "clientIdDocumentDomain";
|
|
78
|
+
tlsHost: "tlsHost";
|
|
79
|
+
a2aCardDomain: "a2aCardDomain";
|
|
80
|
+
}>;
|
|
81
|
+
value: z.ZodString;
|
|
82
|
+
by: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
83
|
+
kind: z.ZodLiteral<"ship">;
|
|
84
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
85
|
+
name: z.ZodString;
|
|
86
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
87
|
+
kind: z.ZodLiteral<"account">;
|
|
88
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"installation">;
|
|
91
|
+
}, z.core.$strict>], "kind">;
|
|
92
|
+
at: z.ZodISODateTime;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
checked: z.ZodLiteral<"oauthSubject">;
|
|
95
|
+
issuer: z.ZodString;
|
|
96
|
+
value: z.ZodString;
|
|
97
|
+
by: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
+
kind: z.ZodLiteral<"ship">;
|
|
99
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
102
|
+
kind: z.ZodLiteral<"account">;
|
|
103
|
+
id: z.core.$ZodBranded<z.ZodString, "AccountId", "out">;
|
|
104
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
105
|
+
kind: z.ZodLiteral<"installation">;
|
|
106
|
+
}, z.core.$strict>], "kind">;
|
|
107
|
+
at: z.ZodISODateTime;
|
|
108
|
+
}, z.core.$strict>], "checked">;
|
|
109
|
+
export type DiscoveredVerifiedFact = z.infer<typeof discoveredVerifiedFactSchema>;
|