Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
953 lines (953 loc) · 35.1 KB
/
Copy pathopenapi.yaml
File metadata and controls
953 lines (953 loc) · 35.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
openapi: 3.0.3
info:
title: Nitrate AI Media Collaboration API
version: 0.2.0
description: >-
Authenticated contract for the Nitrate workflow: a lead creates a packet,
uploads real input files, hands it to an invited creator, the creator pulls
verified context and returns real media, and the lead records a decision.
Inputs and returns use metadata reservation followed by a raw byte upload.
servers:
- url: http://127.0.0.1:4173
description: Local reference service
security:
- bearerAuth: []
tags:
- name: Session
- name: Remote MCP
- name: Packets
- name: Inputs
- name: Assignments
- name: Returns
paths:
/healthz:
get:
tags: [Session]
summary: Check service health
security: []
responses:
'200':
description: Service is ready
content:
application/json:
schema:
type: object
required: [ok]
properties:
ok: { type: boolean }
versions: { type: integer }
/mcp:
post:
tags: [Remote MCP]
summary: Use Nitrate through remote Streamable HTTP MCP
description: >-
A standards-compliant MCP JSON-RPC transport for production workspaces
with custom remote MCP support. Send only a dedicated, expiring nmc_
connection token minted by POST /api/plugin/mcp-connections. Ordinary
plugin session tokens are rejected here, and this connection token is
rejected on ordinary REST routes. This OpenAPI operation documents the
HTTP transport; MCP initialization and tool input schemas are negotiated
by the MCP protocol rather than modelled as REST resources. The server
exposes only tools allowed by the active connection's role-scoped
capabilities: nitrate_whoami, nitrate_list_work,
nitrate_pull_assignment, nitrate_submit_return_from_url, and
nitrate_review_return.
security:
- mcpConnectionAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/McpJsonRpcRequest'
responses:
'200':
description: MCP JSON-RPC response over the Streamable HTTP transport.
content:
application/json:
schema: { $ref: '#/components/schemas/McpJsonRpcResponse' }
'401':
description: A valid, unexpired, unrevoked Nitrate MCP connection token is required.
headers:
WWW-Authenticate:
schema: { type: string, example: Bearer }
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
'403': { $ref: '#/components/responses/Forbidden' }
'413':
description: MCP JSON request exceeds the 256 KiB transport limit.
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/api/plugin/login:
post:
tags: [Session]
summary: Start a lead plugin session
description: >-
Bootstrap login for a team lead. Creators receive a scoped session by
accepting the one-time invite created during handoff. Production
deployments require the agency setup code in the bootstrap header; the
CLI sends --setup-code through this header and never saves it.
security: []
parameters:
- name: X-Nitrate-Bootstrap-Secret
in: header
required: true
description: Sensitive agency setup code for the first lead login.
schema: { type: string, minLength: 1 }
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LeadLoginInput'
responses:
'201':
description: Lead session created
content:
application/json:
schema:
$ref: '#/components/schemas/SessionResult'
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'503':
description: Lead bootstrap is not configured for this deployment.
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/api/plugin/invites/{token}/accept:
post:
tags: [Session]
summary: Accept a one-time creator handoff invite
description: Creates a creator session scoped to the invited assignment. A token can be accepted once.
security: []
parameters:
- $ref: '#/components/parameters/InviteToken'
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
name: { type: string, maxLength: 80 }
agent: { type: string, maxLength: 80 }
surface: { type: string, maxLength: 80 }
responses:
'200':
description: Invite accepted and creator session created
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SessionResult'
- type: object
properties:
project: { $ref: '#/components/schemas/Packet' }
assignment: { $ref: '#/components/schemas/Assignment' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'410':
description: Invite expired
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
/api/plugin/mcp-connections:
post:
tags: [Remote MCP]
summary: Create a dedicated remote MCP connection
description: >-
Requires an ordinary Nitrate plugin session. Mints a separately scoped,
expiring, independently revocable nmc_ bearer credential for POST /mcp.
The raw token is returned exactly once and is never included in later
list responses. Clients derive the endpoint from their API origin plus
/mcp; nitrate mcp:connect prints a paste-ready endpoint and Authorization
line without saving the secret locally.
requestBody:
required: false
content:
application/json:
schema: { $ref: '#/components/schemas/McpConnectionCreateInput' }
responses:
'201':
description: Connection created; save the raw token in the remote connector now because it cannot be retrieved again.
content:
application/json:
schema: { $ref: '#/components/schemas/McpConnectionCreateResult' }
'401': { $ref: '#/components/responses/Unauthorized' }
'422': { $ref: '#/components/responses/Unprocessable' }
get:
tags: [Remote MCP]
summary: List the current user's remote MCP connections
description: >-
Requires an ordinary Nitrate plugin session. Returns only connection
metadata owned by the current user in their agency; bearer secrets and
token hashes are never returned.
responses:
'200':
description: Connection metadata
content:
application/json:
schema:
type: object
required: [connections]
properties:
connections:
type: array
items: { $ref: '#/components/schemas/McpConnection' }
'401': { $ref: '#/components/responses/Unauthorized' }
/api/plugin/mcp-connections/{connectionId}:
delete:
tags: [Remote MCP]
summary: Revoke a dedicated remote MCP connection
description: >-
Requires the owning ordinary Nitrate plugin session. Revocation is
idempotent and prevents future /mcp calls and signed asset capability
redemption for that connection.
parameters:
- $ref: '#/components/parameters/McpConnectionId'
responses:
'200':
description: Connection metadata after revocation
content:
application/json:
schema:
type: object
required: [connection]
properties:
connection: { $ref: '#/components/schemas/McpConnection' }
'401': { $ref: '#/components/responses/Unauthorized' }
'404': { $ref: '#/components/responses/NotFound' }
/api/packets:
post:
tags: [Packets]
summary: Create a packet as a lead
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePacketInput'
responses:
'201':
description: Packet created
content:
application/json:
schema: { $ref: '#/components/schemas/Packet' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
/api/plugin/packets:
get:
tags: [Packets]
summary: List packets visible to the plugin session
description: >-
A lead sees owned packets and all their assignments and returns. A creator
sees only assigned packets, downloadable verified inputs, and related returns.
parameters:
- name: token
in: query
required: false
deprecated: true
description: Compatibility alternative to the Authorization header.
schema: { type: string }
responses:
'200':
description: Session inbox and activation state
content:
application/json:
schema:
$ref: '#/components/schemas/PacketInbox'
'401': { $ref: '#/components/responses/Unauthorized' }
/api/plugin/packets/{packetId}/inputs:
post:
tags: [Inputs]
summary: Reserve a packet input upload
description: >-
Lead-only phase one. The client computes size and SHA-256 before sending
metadata, then PUTs the original bytes to the returned uploadPath.
parameters:
- $ref: '#/components/parameters/PacketId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/FileReservationInput'
responses:
'201':
description: Input reserved; uploadPath is ready for raw bytes
content:
application/json:
schema: { $ref: '#/components/schemas/InputReservation' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'413': { $ref: '#/components/responses/TooLarge' }
/api/plugin/inputs/{inputId}/raw:
put:
tags: [Inputs]
summary: Upload reserved packet input bytes
description: Lead-only phase two. Size and SHA-256 must match the reservation. A completed reservation is immutable.
parameters:
- $ref: '#/components/parameters/InputId'
requestBody:
required: true
content:
application/octet-stream:
schema: { type: string, format: binary }
responses:
'200':
description: Input bytes verified and committed
content:
application/json:
schema: { $ref: '#/components/schemas/PacketInput' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'413': { $ref: '#/components/responses/TooLarge' }
get:
tags: [Inputs]
summary: Download a verified packet input
description: Available only to the packet's owning lead and assigned creator.
parameters:
- $ref: '#/components/parameters/InputId'
responses:
'200':
description: Immutable input bytes
headers:
Content-Disposition:
schema: { type: string }
content:
application/octet-stream:
schema: { type: string, format: binary }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/api/plugin/push:
post:
tags: [Assignments]
summary: Hand a packet to one or more creators
description: >-
Lead-only. The packet must already have at least one verified input. Each
assignment receives a hashed, expiring, one-time invite whose raw token
is returned only in this response.
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required: [packetId, assignments]
properties:
packetId: { type: string }
projectId: { type: string, description: Compatibility alias for packetId }
assignments:
type: array
minItems: 1
maxItems: 20
items: { $ref: '#/components/schemas/CreateAssignmentInput' }
responses:
'201':
description: Assignments and one-time invites created
content:
application/json:
schema:
type: object
required: [packetId, assignments, invitations]
properties:
packetId: { type: string }
project: { $ref: '#/components/schemas/Packet' }
assignments:
type: array
items: { $ref: '#/components/schemas/Assignment' }
invitations:
type: array
items: { $ref: '#/components/schemas/Invitation' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'422': { $ref: '#/components/responses/Unprocessable' }
/api/plugin/assignments/{assignmentId}:
patch:
tags: [Assignments]
summary: Update an assigned creator's workflow status
description: >-
A creator can update only their own assignment. Marking returned directly
is rejected; a successful raw return upload records that state.
parameters:
- $ref: '#/components/parameters/AssignmentId'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required: [status]
properties:
status:
type: string
enum: [delivered, pulled, working, returned, blocked]
responses:
'200':
description: Assignment updated
content:
application/json:
schema:
type: object
properties:
project: { $ref: '#/components/schemas/Packet' }
assignment: { $ref: '#/components/schemas/Assignment' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
/api/plugin/assignments/{assignmentId}/returns:
post:
tags: [Returns]
summary: Reserve a returned media upload
description: >-
Creator phase one. Validates the assignment, media type, expected output
path, prompt, and tool before issuing uploadPath.
parameters:
- $ref: '#/components/parameters/AssignmentId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ReturnReservationInput'
responses:
'201':
description: Return reserved; uploadPath is ready for raw media bytes
content:
application/json:
schema: { $ref: '#/components/schemas/ReturnReservation' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'413': { $ref: '#/components/responses/TooLarge' }
'422': { $ref: '#/components/responses/Unprocessable' }
/api/plugin/returns/{returnId}/raw:
put:
tags: [Returns]
summary: Upload reserved return bytes
description: Creator phase two. Commits an immutable return only when size and SHA-256 match the reservation.
parameters:
- $ref: '#/components/parameters/ReturnId'
requestBody:
required: true
content:
application/octet-stream:
schema: { type: string, format: binary }
responses:
'201':
description: Return bytes verified and committed for lead review
content:
application/json:
schema:
type: object
properties:
asset: { $ref: '#/components/schemas/Asset' }
version: { $ref: '#/components/schemas/Return' }
deduplicated: { type: boolean }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'413': { $ref: '#/components/responses/TooLarge' }
/api/plugin/returns/{returnId}:
patch:
tags: [Returns]
summary: Record a lead review decision
description: Lead-only. The decision attaches to the exact immutable return.
parameters:
- $ref: '#/components/parameters/ReturnId'
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required: [action]
properties:
action:
type: string
enum: [approve, request_changes, reject, reopen]
note: { type: string, maxLength: 2000 }
responses:
'200':
description: Decision recorded
content:
application/json:
schema: { $ref: '#/components/schemas/Return' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'422': { $ref: '#/components/responses/Unprocessable' }
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: opaque plugin session token
description: Ordinary Nitrate plugin/CLI session token. It cannot authenticate POST /mcp.
mcpConnectionAuth:
type: http
scheme: bearer
bearerFormat: nmc_ opaque remote MCP connection token
description: Dedicated, role-scoped, expiring and revocable token accepted only by POST /mcp.
parameters:
PacketId:
name: packetId
in: path
required: true
schema: { type: string }
AssignmentId:
name: assignmentId
in: path
required: true
schema: { type: string }
InputId:
name: inputId
in: path
required: true
schema: { type: string }
ReturnId:
name: returnId
in: path
required: true
schema: { type: string }
InviteToken:
name: token
in: path
required: true
schema: { type: string, minLength: 20 }
McpConnectionId:
name: connectionId
in: path
required: true
schema: { type: string, minLength: 3, maxLength: 120 }
responses:
BadRequest:
description: Invalid request or byte verification failed
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
Unauthorized:
description: Plugin login required
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
Forbidden:
description: Session cannot access this packet or action
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
NotFound:
description: Record unavailable
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
Conflict:
description: One-time action already completed or state no longer accepts the operation
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
TooLarge:
description: File exceeds the service upload limit
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
Unprocessable:
description: Handoff or return is missing required production context
content:
application/json:
schema: { $ref: '#/components/schemas/Error' }
schemas:
McpConnectionScope:
type: string
enum:
- identity:read
- work:read
- assets:read
- assignments:pull
- returns:submit
- returns:review
McpConnectionCreateInput:
type: object
description: >-
Scope values must be a non-empty subset allowed for the caller's role.
Creator scopes may include identity:read, work:read, assets:read,
assignments:pull, and returns:submit. Lead scopes may include
identity:read, work:read, assets:read, and returns:review.
properties:
label:
type: string
minLength: 1
maxLength: 100
default: Higgsfield Supercomputer
client:
type: string
minLength: 1
maxLength: 100
default: Higgsfield Supercomputer
expiresInSeconds:
type: integer
minimum: 300
maximum: 2592000
default: 604800
description: Default seven days; maximum 30 days.
scopes:
type: array
minItems: 1
uniqueItems: true
items: { $ref: '#/components/schemas/McpConnectionScope' }
McpConnection:
type: object
required: [id, agencyId, userId, label, client, audience, scopes, createdAt, expiresAt, revokedAt, lastUsedAt]
properties:
id: { type: string }
agencyId: { type: string }
userId: { type: string }
label: { type: string }
client: { type: string }
audience: { type: string, enum: [nitrate-mcp] }
scopes:
type: array
items: { $ref: '#/components/schemas/McpConnectionScope' }
createdAt: { type: string, format: date-time }
expiresAt: { type: string, format: date-time }
revokedAt: { type: string, format: date-time, nullable: true }
lastUsedAt: { type: string, format: date-time, nullable: true }
McpConnectionCreateResult:
type: object
required: [connection, token]
properties:
connection: { $ref: '#/components/schemas/McpConnection' }
token:
type: string
writeOnly: true
pattern: '^nmc_[A-Za-z0-9_-]+$'
description: "Returned exactly once. The CLI displays Authorization: Bearer nmc_… and never persists it."
McpJsonRpcRequest:
type: object
required: [jsonrpc, method]
description: Generic MCP JSON-RPC request. Tool argument schemas are returned by MCP tools/list.
properties:
jsonrpc: { type: string, enum: ['2.0'] }
id:
description: JSON-RPC request identifier, if the message expects a response.
method: { type: string, example: tools/call }
params: { type: object, additionalProperties: true }
additionalProperties: false
McpJsonRpcResponse:
type: object
required: [jsonrpc]
description: Generic MCP JSON-RPC response. Successful tool results may contain structuredContent.
properties:
jsonrpc: { type: string, enum: ['2.0'] }
id:
description: JSON-RPC response identifier.
result: { type: object, additionalProperties: true }
error:
type: object
properties:
code: { type: integer }
message: { type: string }
data: { type: object, additionalProperties: true }
Error:
type: object
required: [error]
properties:
error: { type: string }
User:
type: object
required: [id, name, role]
properties:
id: { type: string }
name: { type: string }
email: { type: string, format: email }
role: { type: string, enum: [team_lead, ai_creator] }
agent: { type: string }
PluginSession:
type: object
required: [id, userId, agent, surface, role, createdAt]
properties:
id: { type: string }
token: { type: string, writeOnly: true }
userId: { type: string }
agent: { type: string }
surface: { type: string }
role: { type: string, enum: [team_lead, ai_creator] }
createdAt: { type: string, format: date-time }
lastSeenAt: { type: string, format: date-time }
SessionResult:
type: object
required: [session, user]
properties:
session: { $ref: '#/components/schemas/PluginSession' }
user: { $ref: '#/components/schemas/User' }
LeadLoginInput:
type: object
additionalProperties: false
required: [email, agent]
properties:
role:
type: string
enum: [leader, team_lead]
default: leader
name: { type: string, maxLength: 80 }
email: { type: string, format: email }
agent: { type: string, maxLength: 80 }
surface: { type: string, maxLength: 80 }
CreatePacketInput:
type: object
additionalProperties: false
required: [name, brief]
properties:
name: { type: string, minLength: 2, maxLength: 80 }
client: { type: string, maxLength: 100 }
brief: { type: string, maxLength: 12000 }
inputAssets:
type: array
description: Optional display names; real files are uploaded separately.
maxItems: 50
items: { type: string }
outputStructure:
type: array
maxItems: 30
items:
type: string
description: Safe relative output folder, for example renders or notes.
reviewCriteria:
type: array
maxItems: 30
items: { type: string }
templateId: { type: string, nullable: true }
Packet:
type: object
required: [id, name, brief, outputStructure, reviewCriteria, assignments, createdAt]
properties:
id: { type: string }
name: { type: string }
client: { type: string }
brief: { type: string }
inputAssets:
type: array
items: { type: string }
outputStructure:
type: array
items: { type: string }
reviewCriteria:
type: array
items: { type: string }
assignments:
type: array
items: { $ref: '#/components/schemas/Assignment' }
inputs:
type: array
items: { $ref: '#/components/schemas/PacketInput' }
createdByUserId: { type: string, nullable: true }
createdAt: { type: string, format: date-time }
PacketInput:
type: object
required: [id, projectId, filename, mime, size, hash, createdAt]
properties:
id: { type: string }
projectId: { type: string }
name: { type: string }
filename: { type: string }
mime: { type: string }
size: { type: integer, minimum: 1 }
hash: { type: string, pattern: '^[a-f0-9]{64}$' }
createdBy: { type: string }
createdAt: { type: string, format: date-time }
uploadedAt: { type: string, format: date-time, nullable: true }
downloadPath: { type: string }
deduplicated: { type: boolean }
FileReservationInput:
type: object
required: [filename, mime, size, sha256]
properties:
name: { type: string, maxLength: 140 }
filename: { type: string, maxLength: 255 }
mime: { type: string, maxLength: 120 }
size: { type: integer, minimum: 1 }
sha256: { type: string, pattern: '^[a-f0-9]{64}$' }
InputReservation:
allOf:
- $ref: '#/components/schemas/PacketInput'
- type: object
required: [uploadPath]
properties:
uploadPath: { type: string }
CreateAssignmentInput:
type: object
additionalProperties: false
required: [email]
properties:
name: { type: string, maxLength: 80 }
email: { type: string, format: email }
agent: { type: string, maxLength: 80 }
task: { type: string, maxLength: 240 }
Assignment:
type: object
required: [id, userId, agent, status, task, pushedAt]
properties:
id: { type: string }
userId: { type: string }
agent: { type: string }
status: { type: string, enum: [delivered, pulled, working, returned, blocked] }
task: { type: string }
pushedAt: { type: string, format: date-time }
acceptedAt: { type: string, format: date-time, nullable: true }
pulledAt: { type: string, format: date-time, nullable: true }
returnedAt: { type: string, format: date-time, nullable: true }
assignee:
allOf:
- $ref: '#/components/schemas/User'
nullable: true
invitation:
type: object
nullable: true
properties:
status: { type: string, enum: [pending, accepted, expired] }
expiresAt: { type: string, format: date-time }
acceptedAt: { type: string, format: date-time, nullable: true }
Invitation:
type: object
required: [id, assignmentId, token, inviteUrl, expiresAt]
properties:
id: { type: string }
assignmentId: { type: string }
token: { type: string, writeOnly: true }
inviteUrl: { type: string, format: uri }
expiresAt: { type: string, format: date-time }
ReturnReservationInput:
allOf:
- $ref: '#/components/schemas/FileReservationInput'
- type: object
required: [prompt, madeWith, relativePath]
properties:
prompt: { type: string, minLength: 1, maxLength: 4000 }
madeWith: { type: string, minLength: 1, maxLength: 120 }
notes: { type: string, maxLength: 2000 }
relativePath: { type: string }
branch: { type: string, maxLength: 80 }
parentVersionId: { type: string, nullable: true }
ReturnReservation:
type: object
required: [id, projectId, assignmentId, filename, mime, size, hash, prompt, madeWith, relativePath, uploadPath]
properties:
id: { type: string }
projectId: { type: string }
assignmentId: { type: string }
filename: { type: string }
mime: { type: string }
size: { type: integer }
hash: { type: string, pattern: '^[a-f0-9]{64}$' }
prompt: { type: string }
madeWith: { type: string }
notes: { type: string }
relativePath: { type: string }
uploadPath: { type: string }
validation: { $ref: '#/components/schemas/ReturnValidation' }
ReturnValidation:
type: object
required: [hasMedia, hasPrompt, hasTool, inOutputFolder, complete, missing]
properties:
hasMedia: { type: boolean }
hasPrompt: { type: boolean }
hasTool: { type: boolean }
inOutputFolder: { type: boolean }
complete: { type: boolean }
missing:
type: array
items: { type: string }
Asset:
type: object
properties:
id: { type: string }
projectId: { type: string }
name: { type: string }
filename: { type: string }
mime: { type: string }
createdAt: { type: string, format: date-time }
Return:
type: object
required: [id, projectId, assetId, hash, size, mime, status, createdAt]
properties:
id: { type: string }
projectId: { type: string }
assetId: { type: string }
hash: { type: string, pattern: '^[a-f0-9]{64}$' }
size: { type: integer }
mime: { type: string }
status: { type: string, enum: [review, needs_review, approved, changes_requested, rejected] }
metadata:
type: object
properties:
prompt: { type: string }
model: { type: string }
notes: { type: string }
assignmentId: { type: string }
relativePath: { type: string }
parentVersionId: { type: string, nullable: true }
validation: { $ref: '#/components/schemas/ReturnValidation' }
decisions:
type: array
items:
type: object
properties:
id: { type: string }
action: { type: string, enum: [approve, request_changes, reject, reopen] }
note: { type: string }
actor: { type: string }
at: { type: string, format: date-time }
createdAt: { type: string, format: date-time }
Activation:
type: object
required: [uploadedInputCount, ahaReached, closedLoop]
properties:
packetCreatedAt: { type: string, format: date-time, nullable: true }
firstAssignmentAt: { type: string, format: date-time, nullable: true }
firstPullAt: { type: string, format: date-time, nullable: true }
firstReturnAt: { type: string, format: date-time, nullable: true }
firstDecisionAt: { type: string, format: date-time, nullable: true }
uploadedInputCount: { type: integer, minimum: 0 }
ahaReached: { type: boolean }
closedLoop: { type: boolean }
PacketInbox:
type: object
required: [user, mode, packets]
properties:
session: { $ref: '#/components/schemas/PluginSession' }
user: { $ref: '#/components/schemas/User' }
mode: { type: string, enum: [leader, team_member] }
packets:
type: array
items:
type: object
required: [project, assignments, returns, activation]
properties:
project: { $ref: '#/components/schemas/Packet' }
assignments:
type: array
items: { $ref: '#/components/schemas/Assignment' }
returns:
type: array
items: { $ref: '#/components/schemas/Return' }
activation: { $ref: '#/components/schemas/Activation' }