@huynle/hub 0.10.1 → 0.11.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/CHANGELOG.md +80 -0
- package/README.md +36 -8
- package/package.json +1 -1
- package/packages/claude-code/package.json +1 -1
- package/packages/claude-code/src/sessions.ts +4 -1
- package/packages/cli/dist/hub-cli.js +851 -466
- package/packages/cli/package.json +1 -1
- package/packages/cli/src/cli.ts +12 -7
- package/packages/cli/src/decisions.ts +52 -4
- package/packages/cli/src/format.ts +9 -0
- package/packages/cli/src/grants-mcp.ts +65 -0
- package/packages/cli/src/mcp-operations.ts +49 -0
- package/packages/cli/src/mcp.ts +26 -4
- package/packages/cli/src/subscriptions-mcp.ts +76 -0
- package/packages/cli/src/team-intake-mcp.ts +2 -1
- package/packages/cli/src/teams-mcp.ts +9 -3
- package/packages/codex/package.json +1 -1
- package/packages/codex/src/sessions.ts +14 -3
- package/packages/node/package.json +1 -1
- package/packages/preset/package.json +1 -1
- package/packages/protocol/package.json +1 -1
- package/packages/protocol/schema/api/v1/_root.json +119 -0
- package/packages/protocol/schema/api/v1/account.json +419 -0
- package/packages/protocol/schema/api/v1/decisions.json +635 -0
- package/packages/protocol/schema/api/v1/discovery.json +110 -0
- package/packages/protocol/schema/api/v1/events.json +679 -0
- package/packages/protocol/schema/api/v1/session-actions.json +660 -0
- package/packages/protocol/schema/api/v1/sessions.json +2055 -0
- package/packages/protocol/schema/api/v1/speech.json +492 -0
- package/packages/protocol/schema/api/v1/unspecified.json +282 -0
- package/packages/protocol/schema/app-delivery/v1.schema.json +67 -5
- package/packages/protocol/schema/app-front/v1.schema.json +7 -3
- package/packages/protocol/src/api-v1.ts +8 -0
- package/packages/protocol/src/index.ts +2 -0
- package/packages/protocol/src/teams.ts +16 -0
- package/packages/protocol/src/voice-recording.ts +39 -2
- package/packages/runtime-openshell/image/entry.sh +3 -1
- package/packages/runtime-openshell/image/start.sh +3 -1
- package/packages/runtime-openshell/package.json +1 -1
- package/packages/runtime-sdk/package.json +1 -1
- package/packages/sdk/package.json +1 -1
- package/packages/sdk/src/app-front.ts +2 -2
- package/packages/sdk/src/ask-fields.ts +76 -0
- package/packages/sdk/src/client.ts +24 -2
- package/packages/sdk/src/envelope.ts +3 -2
- package/packages/sdk/src/index.ts +1 -0
- package/packages/sdk/src/team-intake.ts +6 -0
- package/packages/sdk/src/teams.ts +4 -0
- package/packages/sdk/src/types.ts +36 -4
- package/packages/sdk/src/wake.ts +9 -4
- package/packages/spoke-sdk/package.json +1 -1
- package/src/central/agent/agent-limits.ts +185 -0
- package/src/central/agent/app-decisions.ts +6 -5
- package/src/central/agent/decisions.ts +136 -9
- package/src/central/agent/delivery.ts +164 -22
- package/src/central/agent/errors.ts +2 -1
- package/src/central/agent/events.ts +20 -2
- package/src/central/agent/grant-routes.ts +14 -1
- package/src/central/agent/grants.ts +23 -0
- package/src/central/agent/launch-engine.ts +9 -6
- package/src/central/agent/message-limits.ts +6 -0
- package/src/central/agent/message-routes.ts +33 -6
- package/src/central/agent/messages.ts +7 -0
- package/src/central/agent/placement.ts +4 -2
- package/src/central/agent/read-routes.ts +5 -0
- package/src/central/agent/routes.ts +13 -0
- package/src/central/agent/subscriptions.ts +15 -4
- package/src/central/api-v1.ts +115 -0
- package/src/central/artifacts/store.ts +4 -2
- package/src/central/concierge/board-results.ts +2 -1
- package/src/central/concierge/notifier.ts +4 -2
- package/src/central/config.ts +24 -3
- package/src/central/health/classify.ts +209 -0
- package/src/central/http.ts +380 -36
- package/src/central/recording/export.ts +57 -3
- package/src/central/recording/index.ts +236 -17
- package/src/central/recording/ingest.ts +11 -2
- package/src/central/recording/routes.ts +61 -7
- package/src/central/recording/schema.ts +68 -3
- package/src/central/recording/settings.ts +19 -5
- package/src/central/recording/store.ts +19 -0
- package/src/central/recording/taps.ts +45 -1
- package/src/central/registry.ts +34 -3
- package/src/central/speech/openai.ts +4 -4
- package/src/central/speech/openrouter.ts +4 -4
- package/src/central/speech/provider.ts +32 -1
- package/src/central/speech/service.ts +6 -5
- package/src/central/teams/budgets.ts +144 -0
- package/src/central/teams/hop-stalls.ts +80 -0
- package/src/central/teams/intake.ts +38 -6
- package/src/central/teams/involvement.ts +95 -0
- package/src/central/teams/item-decisions.ts +60 -0
- package/src/central/teams/item-eligibility.ts +35 -0
- package/src/central/teams/item-stalls.ts +87 -0
- package/src/central/teams/loops.ts +40 -0
- package/src/central/teams/policy.ts +10 -0
- package/src/central/teams/progress.ts +154 -0
- package/src/central/teams/routes.ts +2 -0
- package/src/central/teams/seats.ts +3 -3
- package/src/central/teams/staffing.ts +5 -0
- package/src/central/teams/store.ts +20 -1
- package/src/central/teams/validation.ts +16 -2
- package/src/central/workspaces/coordinator.ts +3 -1
- package/src/spoke/hub-tool.ts +26 -11
- package/web/dist/assets/{ArtifactPage-CsPjam8D.js → ArtifactPage-TbFJi59n.js} +1 -1
- package/web/dist/assets/{ArtifactPane-B9weO8L6.js → ArtifactPane-7D-M-Ich.js} +1 -1
- package/web/dist/assets/{ArtifactWorkbench-DzKhMs3l.js → ArtifactWorkbench-DlCLEjut.js} +1 -1
- package/web/dist/assets/{Diagram-CuRIffka.js → Diagram-PvOPetOI.js} +1 -1
- package/web/dist/assets/{Library-rv5DGtrm.js → Library-Cdi83pOV.js} +2 -2
- package/web/dist/assets/{ProfilesDestination-DUuQ9jmd.js → ProfilesDestination-cryC7P6j.js} +1 -1
- package/web/dist/assets/TeamsPage-B4xrlGhp.js +1 -0
- package/web/dist/assets/Watchtower-60B1JX_J.js +2 -0
- package/web/dist/assets/{artifacts-But87Jfo.js → artifacts-DlQEYmDl.js} +1 -1
- package/web/dist/assets/index-DA0gKIzv.js +33 -0
- package/web/dist/assets/{index-rW6LKQj1.css → index-Dyq-jBeE.css} +1 -1
- package/web/dist/assets/live-B2IfKm37.js +5 -0
- package/web/dist/assets/{live-BUofsQpz.css → live-De-kd3eW.css} +1 -1
- package/web/dist/assets/{pane-layout-BW0RdX5a.js → pane-layout-BAuu_pA3.js} +1 -1
- package/web/dist/assets/{renderer2d-DyANQ1WS.js → renderer2d-CsZnF3_o.js} +1 -1
- package/web/dist/assets/{renderer3d-vYYKFAJq.js → renderer3d-BIMA0wFn.js} +2 -2
- package/web/dist/assets/{safe-area-B2Bk__FK.js → safe-area-dtrnw9NF.js} +1 -1
- package/web/dist/assets/{silero-worker-e802lB5T.js → silero-worker-CC2etKS3.js} +1 -1
- package/web/dist/assets/{source-C-De8L3s.js → source-GYayxUxS.js} +1 -1
- package/web/dist/assets/{toast-CXTwTvDw.js → toast-q818mjUF.js} +1 -1
- package/web/dist/index.html +5 -5
- package/web/dist/assets/TeamsPage-D_17MkvN.js +0 -1
- package/web/dist/assets/Watchtower-DlrNOJ7X.js +0 -2
- package/web/dist/assets/index-bX8B6NLo.js +0 -33
- package/web/dist/assets/live-BGLA-peO.js +0 -5
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
{
|
|
2
|
+
"paths": {
|
|
3
|
+
"/api/v1/decisions": {
|
|
4
|
+
"get": {
|
|
5
|
+
"operationId": "listDecisions",
|
|
6
|
+
"tags": ["decisions"],
|
|
7
|
+
"x-hub-access": "user",
|
|
8
|
+
"summary": "The user's Decisions",
|
|
9
|
+
"description": "What agents and apps asked the user (an ask to @me). Fails with 400 invalid for an unknown state.",
|
|
10
|
+
"parameters": [
|
|
11
|
+
{
|
|
12
|
+
"name": "state",
|
|
13
|
+
"in": "query",
|
|
14
|
+
"description": "Only Decisions in this state.",
|
|
15
|
+
"schema": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"enum": ["open", "answered", "expired", "closed"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"responses": {
|
|
22
|
+
"200": {
|
|
23
|
+
"description": "Newest first.",
|
|
24
|
+
"content": {
|
|
25
|
+
"application/json": {
|
|
26
|
+
"schema": {
|
|
27
|
+
"$ref": "#/components/schemas/DecisionList"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"default": {
|
|
33
|
+
"$ref": "#/components/responses/Error"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"/api/v1/decisions/{id}": {
|
|
39
|
+
"get": {
|
|
40
|
+
"operationId": "getDecision",
|
|
41
|
+
"tags": ["decisions"],
|
|
42
|
+
"x-hub-access": "user",
|
|
43
|
+
"summary": "One Decision",
|
|
44
|
+
"description": "Fails with 404 not_found for an unknown ID or another user's.",
|
|
45
|
+
"parameters": [
|
|
46
|
+
{
|
|
47
|
+
"name": "id",
|
|
48
|
+
"in": "path",
|
|
49
|
+
"required": true,
|
|
50
|
+
"description": "The Decision's ID (dec_…).",
|
|
51
|
+
"schema": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"responses": {
|
|
57
|
+
"200": {
|
|
58
|
+
"description": "The Decision.",
|
|
59
|
+
"content": {
|
|
60
|
+
"application/json": {
|
|
61
|
+
"schema": {
|
|
62
|
+
"$ref": "#/components/schemas/DecisionDetail"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"default": {
|
|
68
|
+
"$ref": "#/components/responses/Error"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"/api/v1/decisions/{id}/answer": {
|
|
74
|
+
"post": {
|
|
75
|
+
"operationId": "answerDecision",
|
|
76
|
+
"tags": ["decisions"],
|
|
77
|
+
"x-hub-access": "user",
|
|
78
|
+
"summary": "Answer a Decision",
|
|
79
|
+
"description": "An option (with an optional note in text), or text alone for a Decision without options. The first answer wins: later ones fail with 409 gone, as does an expired Decision. A tap-tier Decision is answered only from the signed-in console (the device cookie): with a device token it fails with 403 forbidden. Voice and text answers (via) are for confirm-tier Decisions the Concierge panel admits, and pick only once-off options (else 403 forbidden). Other failures: 400 invalid (no such option, no text), 404 not_found; a Decision whose action fails opens again.",
|
|
80
|
+
"parameters": [
|
|
81
|
+
{
|
|
82
|
+
"name": "id",
|
|
83
|
+
"in": "path",
|
|
84
|
+
"required": true,
|
|
85
|
+
"description": "The Decision's ID (dec_…).",
|
|
86
|
+
"schema": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"requestBody": {
|
|
92
|
+
"required": true,
|
|
93
|
+
"content": {
|
|
94
|
+
"application/json": {
|
|
95
|
+
"schema": {
|
|
96
|
+
"$ref": "#/components/schemas/DecisionAnswerRequest"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"responses": {
|
|
102
|
+
"200": {
|
|
103
|
+
"description": "The answered Decision and the reply the asker got.",
|
|
104
|
+
"content": {
|
|
105
|
+
"application/json": {
|
|
106
|
+
"schema": {
|
|
107
|
+
"$ref": "#/components/schemas/AnsweredDecision"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"default": {
|
|
113
|
+
"$ref": "#/components/responses/Error"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"components": {
|
|
120
|
+
"schemas": {
|
|
121
|
+
"DecisionList": {
|
|
122
|
+
"type": "object",
|
|
123
|
+
"required": ["decisions"],
|
|
124
|
+
"properties": {
|
|
125
|
+
"decisions": {
|
|
126
|
+
"type": "array",
|
|
127
|
+
"items": {
|
|
128
|
+
"$ref": "#/components/schemas/Decision"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"DecisionDetail": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"required": ["decision"],
|
|
136
|
+
"properties": {
|
|
137
|
+
"decision": {
|
|
138
|
+
"$ref": "#/components/schemas/Decision"
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"AnsweredDecision": {
|
|
143
|
+
"type": "object",
|
|
144
|
+
"required": ["decision"],
|
|
145
|
+
"properties": {
|
|
146
|
+
"decision": {
|
|
147
|
+
"$ref": "#/components/schemas/Decision"
|
|
148
|
+
},
|
|
149
|
+
"reply": {
|
|
150
|
+
"$ref": "#/components/schemas/AgentMessage",
|
|
151
|
+
"description": "The user's reply to the ask (absent when the ask could not be replied to)."
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"DecisionAnswerRequest": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"description": "An option, text, or both; for a Decision with choices, picks (one option per group), text, or both.",
|
|
158
|
+
"properties": {
|
|
159
|
+
"option": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"description": "The ID of the option picked."
|
|
162
|
+
},
|
|
163
|
+
"picks": {
|
|
164
|
+
"type": "object",
|
|
165
|
+
"additionalProperties": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
},
|
|
168
|
+
"description": "A Decision with choices: the option picked in every group ({group: option}). Text alone is accepted instead."
|
|
169
|
+
},
|
|
170
|
+
"text": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"description": "A note with the option, or the answer of a Decision without options (at most 4000 characters)."
|
|
173
|
+
},
|
|
174
|
+
"via": {
|
|
175
|
+
"type": "string",
|
|
176
|
+
"enum": ["tap", "voice", "text"],
|
|
177
|
+
"description": "How the user answered (default tap). voice and text only in the Concierge panel."
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"Decision": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"description": "A question an agent or app asked the user (an ask to @me).",
|
|
184
|
+
"required": ["id", "messageID", "from", "about", "question", "options", "urgency", "tier", "state", "at", "expiresAt"],
|
|
185
|
+
"properties": {
|
|
186
|
+
"id": {
|
|
187
|
+
"type": "string"
|
|
188
|
+
},
|
|
189
|
+
"messageID": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"description": "The ask (to @me) that carries it."
|
|
192
|
+
},
|
|
193
|
+
"from": {
|
|
194
|
+
"$ref": "#/components/schemas/Party"
|
|
195
|
+
},
|
|
196
|
+
"about": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"items": {
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
201
|
+
"description": "The sessions it concerns."
|
|
202
|
+
},
|
|
203
|
+
"sessionID": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"description": "The session a notification opens (about[0])."
|
|
206
|
+
},
|
|
207
|
+
"question": {
|
|
208
|
+
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
"options": {
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"$ref": "#/components/schemas/DecisionOption"
|
|
214
|
+
},
|
|
215
|
+
"description": "At most 8; none: the user answers with text."
|
|
216
|
+
},
|
|
217
|
+
"recommendation": {
|
|
218
|
+
"$ref": "#/components/schemas/DecisionRecommendation"
|
|
219
|
+
},
|
|
220
|
+
"choices": {
|
|
221
|
+
"type": "array",
|
|
222
|
+
"items": {
|
|
223
|
+
"$ref": "#/components/schemas/DecisionChoice"
|
|
224
|
+
},
|
|
225
|
+
"description": "Structured choices (1–12 groups), instead of options: the user picks one option in each group."
|
|
226
|
+
},
|
|
227
|
+
"kind": {
|
|
228
|
+
"type": "string",
|
|
229
|
+
"x-hub-known": ["question", "plan", "merge", "release"],
|
|
230
|
+
"description": "What it is about; absent: a question."
|
|
231
|
+
},
|
|
232
|
+
"urgency": {
|
|
233
|
+
"type": "string",
|
|
234
|
+
"x-hub-known": ["low", "normal", "high"]
|
|
235
|
+
},
|
|
236
|
+
"tier": {
|
|
237
|
+
"type": "string",
|
|
238
|
+
"x-hub-known": ["confirm", "tap"],
|
|
239
|
+
"description": "confirm: any of the user's signed-in devices answers; tap: only the signed-in console (the device cookie)."
|
|
240
|
+
},
|
|
241
|
+
"deadline": {
|
|
242
|
+
"type": "integer",
|
|
243
|
+
"format": "int64",
|
|
244
|
+
"description": "When it times out, in epoch milliseconds."
|
|
245
|
+
},
|
|
246
|
+
"onTimeout": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"description": "The (safe) option picked at the deadline. Without one the Decision stays open and is escalated."
|
|
249
|
+
},
|
|
250
|
+
"state": {
|
|
251
|
+
"type": "string",
|
|
252
|
+
"x-hub-known": ["open", "answered", "expired", "closed"],
|
|
253
|
+
"description": "closed: it ended without an answer because what it asked about went away."
|
|
254
|
+
},
|
|
255
|
+
"at": {
|
|
256
|
+
"type": "integer",
|
|
257
|
+
"format": "int64",
|
|
258
|
+
"description": "When it was asked, in epoch milliseconds."
|
|
259
|
+
},
|
|
260
|
+
"expiresAt": {
|
|
261
|
+
"type": "integer",
|
|
262
|
+
"format": "int64",
|
|
263
|
+
"description": "When it expires with its ask, in epoch milliseconds."
|
|
264
|
+
},
|
|
265
|
+
"escalatedAt": {
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"format": "int64",
|
|
268
|
+
"description": "When it passed its deadline without an onTimeout (notified again), in epoch milliseconds."
|
|
269
|
+
},
|
|
270
|
+
"answer": {
|
|
271
|
+
"$ref": "#/components/schemas/DecisionAnswer"
|
|
272
|
+
},
|
|
273
|
+
"closed": {
|
|
274
|
+
"$ref": "#/components/schemas/DecisionClosed"
|
|
275
|
+
},
|
|
276
|
+
"action": {
|
|
277
|
+
"$ref": "#/components/schemas/DecisionAction"
|
|
278
|
+
},
|
|
279
|
+
"as": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"x-hub-known": ["concierge"],
|
|
282
|
+
"description": "concierge: asked by one of the user's Concierge sessions."
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"DecisionOption": {
|
|
287
|
+
"type": "object",
|
|
288
|
+
"required": ["id", "label"],
|
|
289
|
+
"properties": {
|
|
290
|
+
"id": {
|
|
291
|
+
"type": "string"
|
|
292
|
+
},
|
|
293
|
+
"label": {
|
|
294
|
+
"type": "string"
|
|
295
|
+
},
|
|
296
|
+
"safe": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"description": "onTimeout may pick only a safe option."
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"DecisionChoice": {
|
|
303
|
+
"type": "object",
|
|
304
|
+
"required": ["id", "label", "options"],
|
|
305
|
+
"properties": {
|
|
306
|
+
"id": {
|
|
307
|
+
"type": "string",
|
|
308
|
+
"description": "The group's ID (1–8 letters, digits, - or _), e.g. D1."
|
|
309
|
+
},
|
|
310
|
+
"label": {
|
|
311
|
+
"type": "string"
|
|
312
|
+
},
|
|
313
|
+
"options": {
|
|
314
|
+
"type": "array",
|
|
315
|
+
"items": {
|
|
316
|
+
"$ref": "#/components/schemas/DecisionChoiceOption"
|
|
317
|
+
},
|
|
318
|
+
"description": "2–6 options."
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
"DecisionChoiceOption": {
|
|
323
|
+
"type": "object",
|
|
324
|
+
"required": ["id", "label"],
|
|
325
|
+
"properties": {
|
|
326
|
+
"id": {
|
|
327
|
+
"type": "string"
|
|
328
|
+
},
|
|
329
|
+
"label": {
|
|
330
|
+
"type": "string"
|
|
331
|
+
},
|
|
332
|
+
"recommended": {
|
|
333
|
+
"type": "boolean",
|
|
334
|
+
"description": "The asker's recommendation (at most one per group)."
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"DecisionRecommendation": {
|
|
339
|
+
"type": "object",
|
|
340
|
+
"required": ["option"],
|
|
341
|
+
"properties": {
|
|
342
|
+
"option": {
|
|
343
|
+
"type": "string",
|
|
344
|
+
"description": "An option's ID."
|
|
345
|
+
},
|
|
346
|
+
"why": {
|
|
347
|
+
"type": "string"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"DecisionAnswer": {
|
|
352
|
+
"type": "object",
|
|
353
|
+
"required": ["answeredBy", "at"],
|
|
354
|
+
"properties": {
|
|
355
|
+
"option": {
|
|
356
|
+
"type": "string"
|
|
357
|
+
},
|
|
358
|
+
"picks": {
|
|
359
|
+
"type": "object",
|
|
360
|
+
"additionalProperties": {
|
|
361
|
+
"type": "string"
|
|
362
|
+
},
|
|
363
|
+
"description": "A Decision with choices: the option picked in each group."
|
|
364
|
+
},
|
|
365
|
+
"text": {
|
|
366
|
+
"type": "string"
|
|
367
|
+
},
|
|
368
|
+
"answeredBy": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"x-hub-known": ["user", "timeout", "app"],
|
|
371
|
+
"description": "user; timeout: onTimeout picked it; app: an app answered a Decision of its own session."
|
|
372
|
+
},
|
|
373
|
+
"at": {
|
|
374
|
+
"type": "integer",
|
|
375
|
+
"format": "int64",
|
|
376
|
+
"description": "In epoch milliseconds."
|
|
377
|
+
},
|
|
378
|
+
"deviceID": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"description": "The device the user answered from."
|
|
381
|
+
},
|
|
382
|
+
"via": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"x-hub-known": ["voice", "text"],
|
|
385
|
+
"description": "Absent: a tap."
|
|
386
|
+
},
|
|
387
|
+
"app": {
|
|
388
|
+
"type": "string",
|
|
389
|
+
"description": "answeredBy app: the app's party (app:<tokenID>)."
|
|
390
|
+
},
|
|
391
|
+
"appLabel": {
|
|
392
|
+
"type": "string",
|
|
393
|
+
"description": "answeredBy app: its label."
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
"DecisionClosed": {
|
|
398
|
+
"type": "object",
|
|
399
|
+
"description": "Why it closed without an answer.",
|
|
400
|
+
"required": ["at", "reason"],
|
|
401
|
+
"properties": {
|
|
402
|
+
"at": {
|
|
403
|
+
"type": "integer",
|
|
404
|
+
"format": "int64",
|
|
405
|
+
"description": "In epoch milliseconds."
|
|
406
|
+
},
|
|
407
|
+
"reason": {
|
|
408
|
+
"type": "string"
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"DecisionAction": {
|
|
413
|
+
"description": "What answering does besides replying, set by the hub: an escalated permission request, a grant request, a Concierge proposal or a team's hop budget renewal.",
|
|
414
|
+
"oneOf": [
|
|
415
|
+
{
|
|
416
|
+
"$ref": "#/components/schemas/PermissionDecisionAction"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"$ref": "#/components/schemas/GrantDecisionAction"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"$ref": "#/components/schemas/ActDecisionAction"
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
"$ref": "#/components/schemas/TeamHopRenewDecisionAction"
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
"$ref": "#/components/schemas/TeamItemDecisionAction"
|
|
429
|
+
}
|
|
430
|
+
],
|
|
431
|
+
"discriminator": {
|
|
432
|
+
"propertyName": "kind",
|
|
433
|
+
"mapping": {
|
|
434
|
+
"permission": "#/components/schemas/PermissionDecisionAction",
|
|
435
|
+
"grant": "#/components/schemas/GrantDecisionAction",
|
|
436
|
+
"act": "#/components/schemas/ActDecisionAction",
|
|
437
|
+
"teamHopRenew": "#/components/schemas/TeamHopRenewDecisionAction",
|
|
438
|
+
"teamItem": "#/components/schemas/TeamItemDecisionAction"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
"x-hub-union": true
|
|
442
|
+
},
|
|
443
|
+
"PermissionDecisionAction": {
|
|
444
|
+
"type": "object",
|
|
445
|
+
"description": "An escalated permission request: the answer replies to it as the user.",
|
|
446
|
+
"required": ["kind", "requestID", "rootID", "sessionID", "always"],
|
|
447
|
+
"properties": {
|
|
448
|
+
"kind": {
|
|
449
|
+
"type": "string",
|
|
450
|
+
"enum": ["permission"]
|
|
451
|
+
},
|
|
452
|
+
"requestID": {
|
|
453
|
+
"type": "string"
|
|
454
|
+
},
|
|
455
|
+
"rootID": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"description": "The tree the request is pending in."
|
|
458
|
+
},
|
|
459
|
+
"sessionID": {
|
|
460
|
+
"type": "string",
|
|
461
|
+
"description": "The session that asked."
|
|
462
|
+
},
|
|
463
|
+
"always": {
|
|
464
|
+
"type": "boolean",
|
|
465
|
+
"description": "The agent asked to approve it always."
|
|
466
|
+
},
|
|
467
|
+
"request": {
|
|
468
|
+
"$ref": "#/components/schemas/DecisionRequest"
|
|
469
|
+
},
|
|
470
|
+
"reason": {
|
|
471
|
+
"type": "string",
|
|
472
|
+
"description": "Why the hub sent it to the user."
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"GrantDecisionAction": {
|
|
477
|
+
"type": "object",
|
|
478
|
+
"description": "A grant an agent requested: approving creates it as the user.",
|
|
479
|
+
"required": ["kind", "requester", "grant"],
|
|
480
|
+
"properties": {
|
|
481
|
+
"kind": {
|
|
482
|
+
"type": "string",
|
|
483
|
+
"enum": ["grant"]
|
|
484
|
+
},
|
|
485
|
+
"requester": {
|
|
486
|
+
"type": "string",
|
|
487
|
+
"description": "The requester's party key."
|
|
488
|
+
},
|
|
489
|
+
"grant": {
|
|
490
|
+
"$ref": "#/components/schemas/JsonValue",
|
|
491
|
+
"description": "The grant body requested (an object; described with the grants area)."
|
|
492
|
+
},
|
|
493
|
+
"managed": {
|
|
494
|
+
"type": "boolean",
|
|
495
|
+
"description": "The Concierge's own request."
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
"ActDecisionAction": {
|
|
500
|
+
"type": "object",
|
|
501
|
+
"description": "A Concierge proposal: go runs the verb as the user; hold does nothing.",
|
|
502
|
+
"required": ["kind", "verb", "target", "input"],
|
|
503
|
+
"properties": {
|
|
504
|
+
"kind": {
|
|
505
|
+
"type": "string",
|
|
506
|
+
"enum": ["act"]
|
|
507
|
+
},
|
|
508
|
+
"verb": {
|
|
509
|
+
"type": "string",
|
|
510
|
+
"x-hub-known": ["stop", "deny", "prompt", "answer"]
|
|
511
|
+
},
|
|
512
|
+
"target": {
|
|
513
|
+
"type": "string",
|
|
514
|
+
"description": "The session it was proposed for."
|
|
515
|
+
},
|
|
516
|
+
"input": {
|
|
517
|
+
"$ref": "#/components/schemas/JsonValue",
|
|
518
|
+
"description": "The verb's input (an object: requestID, formID, answer, text)."
|
|
519
|
+
},
|
|
520
|
+
"request": {
|
|
521
|
+
"$ref": "#/components/schemas/DecisionRequest"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"TeamHopRenewDecisionAction": {
|
|
526
|
+
"type": "object",
|
|
527
|
+
"description": "Renewing a team's hop budget (tap only).",
|
|
528
|
+
"required": ["kind", "teamID"],
|
|
529
|
+
"properties": {
|
|
530
|
+
"kind": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"enum": ["teamHopRenew"]
|
|
533
|
+
},
|
|
534
|
+
"teamID": {
|
|
535
|
+
"type": "string"
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
"TeamItemDecisionAction": {
|
|
540
|
+
"type": "object",
|
|
541
|
+
"description": "Extend or Stop one intake item that spent its budget or whose seat pair loops without progress (tap only, hub-created).",
|
|
542
|
+
"required": ["kind", "teamID", "item", "reason"],
|
|
543
|
+
"properties": {
|
|
544
|
+
"kind": {
|
|
545
|
+
"type": "string",
|
|
546
|
+
"enum": ["teamItem"]
|
|
547
|
+
},
|
|
548
|
+
"teamID": {
|
|
549
|
+
"type": "string"
|
|
550
|
+
},
|
|
551
|
+
"item": {
|
|
552
|
+
"type": "string",
|
|
553
|
+
"description": "The intake item (itk_…)."
|
|
554
|
+
},
|
|
555
|
+
"reason": {
|
|
556
|
+
"type": "string",
|
|
557
|
+
"x-hub-known": ["budget", "loop"],
|
|
558
|
+
"description": "budget: the item spent its wake or time budget; loop: a seat pair loops without progress."
|
|
559
|
+
},
|
|
560
|
+
"pair": {
|
|
561
|
+
"type": "array",
|
|
562
|
+
"items": {
|
|
563
|
+
"type": "string"
|
|
564
|
+
},
|
|
565
|
+
"description": "reason loop: the two seat sessions that loop, sorted."
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
"DecisionRequest": {
|
|
570
|
+
"type": "object",
|
|
571
|
+
"description": "A permission request as a Decision shows it.",
|
|
572
|
+
"required": ["action", "resources"],
|
|
573
|
+
"properties": {
|
|
574
|
+
"action": {
|
|
575
|
+
"type": "string"
|
|
576
|
+
},
|
|
577
|
+
"resources": {
|
|
578
|
+
"type": "array",
|
|
579
|
+
"items": {
|
|
580
|
+
"type": "string"
|
|
581
|
+
},
|
|
582
|
+
"description": "At most 20, each at most 2000 characters."
|
|
583
|
+
},
|
|
584
|
+
"save": {
|
|
585
|
+
"type": "array",
|
|
586
|
+
"items": {
|
|
587
|
+
"type": "string"
|
|
588
|
+
},
|
|
589
|
+
"description": "The patterns an always would save."
|
|
590
|
+
},
|
|
591
|
+
"resourcesTotal": {
|
|
592
|
+
"type": "integer",
|
|
593
|
+
"format": "int32",
|
|
594
|
+
"description": "How many resources the request had, when more than were kept."
|
|
595
|
+
},
|
|
596
|
+
"savesTotal": {
|
|
597
|
+
"type": "integer",
|
|
598
|
+
"format": "int32",
|
|
599
|
+
"description": "How many save patterns it had, when more than were kept."
|
|
600
|
+
},
|
|
601
|
+
"cut": {
|
|
602
|
+
"type": "array",
|
|
603
|
+
"items": {
|
|
604
|
+
"$ref": "#/components/schemas/DecisionRequestCut"
|
|
605
|
+
},
|
|
606
|
+
"description": "Items that were shortened, with their full length."
|
|
607
|
+
},
|
|
608
|
+
"truncated": {
|
|
609
|
+
"type": "boolean",
|
|
610
|
+
"description": "The hub received the request already shortened."
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
"DecisionRequestCut": {
|
|
615
|
+
"type": "object",
|
|
616
|
+
"required": ["field", "index", "length"],
|
|
617
|
+
"properties": {
|
|
618
|
+
"field": {
|
|
619
|
+
"type": "string",
|
|
620
|
+
"x-hub-known": ["resources", "save"]
|
|
621
|
+
},
|
|
622
|
+
"index": {
|
|
623
|
+
"type": "integer",
|
|
624
|
+
"format": "int32"
|
|
625
|
+
},
|
|
626
|
+
"length": {
|
|
627
|
+
"type": "integer",
|
|
628
|
+
"format": "int32",
|
|
629
|
+
"description": "Its full length."
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}
|