code60-transmission-server 0.1.0-staging.3 → 0.1.0-staging.6
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/README.engine.md +64 -2
- package/README.md +66 -5
- package/dist/src/broker/native/README.md +15 -0
- package/dist/src/broker/native/build.js +3 -0
- package/dist/src/broker/native/command-helper.c +93 -0
- package/dist/src/cli/configure.js +193 -0
- package/dist/src/cli/daemon.js +5 -1
- package/dist/src/cli/helpers.js +12 -4
- package/dist/src/cli/main.js +12 -3
- package/dist/src/cli/runtime-build.js +38 -0
- package/dist/src/config/coding-policy.js +4 -0
- package/dist/src/config/deployment.js +26 -10
- package/dist/src/config/workflow-schema.json +11 -0
- package/dist/src/engine/commands.js +35 -4
- package/dist/src/engine/workflow-engine.js +70 -15
- package/dist/src/main.js +4 -1
- package/dist/src/mcp/main.js +4 -2
- package/dist/src/mcp/server.js +37 -6
- package/dist/src/runtime/engine-driver.js +11 -2
- package/dist/src/runtime/provider-bridge.js +4 -2
- package/dist/src/runtime/provider-transport.js +7 -5
- package/dist/src/server/api-contract.json +530 -2
- package/dist/src/server/application.js +9 -3
- package/dist/src/server/coding.js +254 -0
- package/dist/src/server/deployment.js +18 -6
- package/dist/src/server/history-handlers.js +16 -2
- package/dist/src/server/workspace-handlers.js +1 -1
- package/dist/src/tools/checks.js +12 -1
- package/dist/src/tools/command-check.js +34 -0
- package/dist/src/tools/commands.js +310 -0
- package/dist/src/tools/developer.js +351 -0
- package/dist/src/tools/index.js +19 -2
- package/dist/src/workspaces/index.js +244 -22
- package/dist/src/workspaces/source.js +295 -0
- package/package.json +4 -2
- package/scripts/postinstall.mjs +2 -1
|
@@ -5993,6 +5993,303 @@
|
|
|
5993
5993
|
}
|
|
5994
5994
|
}
|
|
5995
5995
|
}
|
|
5996
|
+
},
|
|
5997
|
+
"/readiness": {
|
|
5998
|
+
"get": {
|
|
5999
|
+
"operationId": "getCodingReadiness",
|
|
6000
|
+
"summary": "Check setup, runtime, command execution, and source limits before starting a coding task",
|
|
6001
|
+
"x-audience": "operator",
|
|
6002
|
+
"parameters": [],
|
|
6003
|
+
"responses": {
|
|
6004
|
+
"200": {
|
|
6005
|
+
"description": "Check setup, runtime, command execution, and source limits before starting a coding task",
|
|
6006
|
+
"content": {
|
|
6007
|
+
"application/json": {
|
|
6008
|
+
"schema": {
|
|
6009
|
+
"$ref": "#/components/schemas/CodingReadiness"
|
|
6010
|
+
}
|
|
6011
|
+
}
|
|
6012
|
+
}
|
|
6013
|
+
}
|
|
6014
|
+
},
|
|
6015
|
+
"security": [
|
|
6016
|
+
{
|
|
6017
|
+
"OperatorAuth": []
|
|
6018
|
+
}
|
|
6019
|
+
],
|
|
6020
|
+
"tags": [
|
|
6021
|
+
"Coding"
|
|
6022
|
+
]
|
|
6023
|
+
}
|
|
6024
|
+
},
|
|
6025
|
+
"/coding-tasks": {
|
|
6026
|
+
"post": {
|
|
6027
|
+
"operationId": "startCodingTask",
|
|
6028
|
+
"summary": "Start a coding task in the current folder; preserve existing edits and leave the result uncommitted",
|
|
6029
|
+
"x-audience": "operator",
|
|
6030
|
+
"parameters": [
|
|
6031
|
+
{
|
|
6032
|
+
"$ref": "#/components/parameters/IdempotencyKey"
|
|
6033
|
+
}
|
|
6034
|
+
],
|
|
6035
|
+
"requestBody": {
|
|
6036
|
+
"required": true,
|
|
6037
|
+
"content": {
|
|
6038
|
+
"application/json": {
|
|
6039
|
+
"schema": {
|
|
6040
|
+
"$ref": "#/components/schemas/CodingTaskCreate"
|
|
6041
|
+
}
|
|
6042
|
+
}
|
|
6043
|
+
}
|
|
6044
|
+
},
|
|
6045
|
+
"responses": {
|
|
6046
|
+
"202": {
|
|
6047
|
+
"description": "Start a coding task in the current folder; preserve existing edits and leave the result uncommitted",
|
|
6048
|
+
"content": {
|
|
6049
|
+
"application/json": {
|
|
6050
|
+
"schema": {
|
|
6051
|
+
"$ref": "#/components/schemas/Run"
|
|
6052
|
+
}
|
|
6053
|
+
}
|
|
6054
|
+
}
|
|
6055
|
+
}
|
|
6056
|
+
},
|
|
6057
|
+
"security": [
|
|
6058
|
+
{
|
|
6059
|
+
"OperatorAuth": []
|
|
6060
|
+
}
|
|
6061
|
+
],
|
|
6062
|
+
"tags": [
|
|
6063
|
+
"Coding"
|
|
6064
|
+
]
|
|
6065
|
+
}
|
|
6066
|
+
},
|
|
6067
|
+
"/runs/{runId}/result": {
|
|
6068
|
+
"get": {
|
|
6069
|
+
"operationId": "getCodingTaskResult",
|
|
6070
|
+
"summary": "Get the run-only diff and check evidence. Supply commandId to page command logs.",
|
|
6071
|
+
"x-audience": "operator",
|
|
6072
|
+
"parameters": [
|
|
6073
|
+
{
|
|
6074
|
+
"name": "runId",
|
|
6075
|
+
"in": "path",
|
|
6076
|
+
"required": true,
|
|
6077
|
+
"schema": {
|
|
6078
|
+
"$ref": "#/components/schemas/Id"
|
|
6079
|
+
}
|
|
6080
|
+
},
|
|
6081
|
+
{
|
|
6082
|
+
"name": "cursor",
|
|
6083
|
+
"in": "query",
|
|
6084
|
+
"schema": {
|
|
6085
|
+
"type": "integer",
|
|
6086
|
+
"minimum": 0
|
|
6087
|
+
}
|
|
6088
|
+
},
|
|
6089
|
+
{
|
|
6090
|
+
"name": "limit",
|
|
6091
|
+
"in": "query",
|
|
6092
|
+
"schema": {
|
|
6093
|
+
"type": "integer",
|
|
6094
|
+
"minimum": 1,
|
|
6095
|
+
"maximum": 262144
|
|
6096
|
+
}
|
|
6097
|
+
},
|
|
6098
|
+
{
|
|
6099
|
+
"name": "commandId",
|
|
6100
|
+
"in": "query",
|
|
6101
|
+
"description": "Command ID from this task's commands. Omit to read only the diff.",
|
|
6102
|
+
"schema": {
|
|
6103
|
+
"type": "string"
|
|
6104
|
+
}
|
|
6105
|
+
},
|
|
6106
|
+
{
|
|
6107
|
+
"name": "stream",
|
|
6108
|
+
"in": "query",
|
|
6109
|
+
"schema": {
|
|
6110
|
+
"enum": [
|
|
6111
|
+
"stdout",
|
|
6112
|
+
"stderr"
|
|
6113
|
+
]
|
|
6114
|
+
}
|
|
6115
|
+
},
|
|
6116
|
+
{
|
|
6117
|
+
"name": "outputCursor",
|
|
6118
|
+
"in": "query",
|
|
6119
|
+
"description": "Byte offset into the selected command stream.",
|
|
6120
|
+
"schema": {
|
|
6121
|
+
"type": "integer",
|
|
6122
|
+
"minimum": 0
|
|
6123
|
+
}
|
|
6124
|
+
},
|
|
6125
|
+
{
|
|
6126
|
+
"name": "outputLimit",
|
|
6127
|
+
"in": "query",
|
|
6128
|
+
"schema": {
|
|
6129
|
+
"type": "integer",
|
|
6130
|
+
"minimum": 1,
|
|
6131
|
+
"maximum": 262144
|
|
6132
|
+
}
|
|
6133
|
+
}
|
|
6134
|
+
],
|
|
6135
|
+
"responses": {
|
|
6136
|
+
"200": {
|
|
6137
|
+
"description": "Get the run-only diff, command/check evidence, and explicit verification status",
|
|
6138
|
+
"content": {
|
|
6139
|
+
"application/json": {
|
|
6140
|
+
"schema": {
|
|
6141
|
+
"$ref": "#/components/schemas/CodingTaskResult"
|
|
6142
|
+
}
|
|
6143
|
+
}
|
|
6144
|
+
}
|
|
6145
|
+
}
|
|
6146
|
+
},
|
|
6147
|
+
"security": [
|
|
6148
|
+
{
|
|
6149
|
+
"OperatorAuth": []
|
|
6150
|
+
}
|
|
6151
|
+
],
|
|
6152
|
+
"tags": [
|
|
6153
|
+
"Coding"
|
|
6154
|
+
]
|
|
6155
|
+
}
|
|
6156
|
+
},
|
|
6157
|
+
"/runs/{runId}/messages": {
|
|
6158
|
+
"post": {
|
|
6159
|
+
"operationId": "sendTaskMessage",
|
|
6160
|
+
"summary": "Queue user guidance at the next safe agent boundary before acceptance",
|
|
6161
|
+
"x-audience": "operator",
|
|
6162
|
+
"parameters": [
|
|
6163
|
+
{
|
|
6164
|
+
"name": "runId",
|
|
6165
|
+
"in": "path",
|
|
6166
|
+
"required": true,
|
|
6167
|
+
"schema": {
|
|
6168
|
+
"$ref": "#/components/schemas/Id"
|
|
6169
|
+
}
|
|
6170
|
+
},
|
|
6171
|
+
{
|
|
6172
|
+
"$ref": "#/components/parameters/IdempotencyKey"
|
|
6173
|
+
}
|
|
6174
|
+
],
|
|
6175
|
+
"requestBody": {
|
|
6176
|
+
"required": true,
|
|
6177
|
+
"content": {
|
|
6178
|
+
"application/json": {
|
|
6179
|
+
"schema": {
|
|
6180
|
+
"$ref": "#/components/schemas/TaskMessageCreate"
|
|
6181
|
+
}
|
|
6182
|
+
}
|
|
6183
|
+
}
|
|
6184
|
+
},
|
|
6185
|
+
"responses": {
|
|
6186
|
+
"202": {
|
|
6187
|
+
"description": "Queue user guidance at the next safe agent boundary before acceptance",
|
|
6188
|
+
"content": {
|
|
6189
|
+
"application/json": {
|
|
6190
|
+
"schema": {
|
|
6191
|
+
"$ref": "#/components/schemas/TaskMessage"
|
|
6192
|
+
}
|
|
6193
|
+
}
|
|
6194
|
+
}
|
|
6195
|
+
}
|
|
6196
|
+
},
|
|
6197
|
+
"security": [
|
|
6198
|
+
{
|
|
6199
|
+
"OperatorAuth": []
|
|
6200
|
+
}
|
|
6201
|
+
],
|
|
6202
|
+
"tags": [
|
|
6203
|
+
"Coding"
|
|
6204
|
+
]
|
|
6205
|
+
}
|
|
6206
|
+
},
|
|
6207
|
+
"/runs/{runId}/questions": {
|
|
6208
|
+
"get": {
|
|
6209
|
+
"operationId": "listTaskQuestions",
|
|
6210
|
+
"summary": "Read pending worker questions and blockers",
|
|
6211
|
+
"x-audience": "operator",
|
|
6212
|
+
"parameters": [
|
|
6213
|
+
{
|
|
6214
|
+
"name": "runId",
|
|
6215
|
+
"in": "path",
|
|
6216
|
+
"required": true,
|
|
6217
|
+
"schema": {
|
|
6218
|
+
"$ref": "#/components/schemas/Id"
|
|
6219
|
+
}
|
|
6220
|
+
}
|
|
6221
|
+
],
|
|
6222
|
+
"responses": {
|
|
6223
|
+
"200": {
|
|
6224
|
+
"description": "Read pending worker questions and blockers",
|
|
6225
|
+
"content": {
|
|
6226
|
+
"application/json": {
|
|
6227
|
+
"schema": {
|
|
6228
|
+
"$ref": "#/components/schemas/CodingQuestions"
|
|
6229
|
+
}
|
|
6230
|
+
}
|
|
6231
|
+
}
|
|
6232
|
+
}
|
|
6233
|
+
},
|
|
6234
|
+
"security": [
|
|
6235
|
+
{
|
|
6236
|
+
"OperatorAuth": []
|
|
6237
|
+
}
|
|
6238
|
+
],
|
|
6239
|
+
"tags": [
|
|
6240
|
+
"Coding"
|
|
6241
|
+
]
|
|
6242
|
+
}
|
|
6243
|
+
},
|
|
6244
|
+
"/questions/{questionId}/answers": {
|
|
6245
|
+
"post": {
|
|
6246
|
+
"operationId": "answerTaskQuestion",
|
|
6247
|
+
"summary": "Answer a worker question and resume the preserved conversation exactly once",
|
|
6248
|
+
"x-audience": "operator",
|
|
6249
|
+
"parameters": [
|
|
6250
|
+
{
|
|
6251
|
+
"name": "questionId",
|
|
6252
|
+
"in": "path",
|
|
6253
|
+
"required": true,
|
|
6254
|
+
"schema": {
|
|
6255
|
+
"$ref": "#/components/schemas/Id"
|
|
6256
|
+
}
|
|
6257
|
+
},
|
|
6258
|
+
{
|
|
6259
|
+
"$ref": "#/components/parameters/IdempotencyKey"
|
|
6260
|
+
}
|
|
6261
|
+
],
|
|
6262
|
+
"requestBody": {
|
|
6263
|
+
"required": true,
|
|
6264
|
+
"content": {
|
|
6265
|
+
"application/json": {
|
|
6266
|
+
"schema": {
|
|
6267
|
+
"$ref": "#/components/schemas/QuestionAnswerCreate"
|
|
6268
|
+
}
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
},
|
|
6272
|
+
"responses": {
|
|
6273
|
+
"202": {
|
|
6274
|
+
"description": "Answer a worker question and resume the preserved conversation exactly once",
|
|
6275
|
+
"content": {
|
|
6276
|
+
"application/json": {
|
|
6277
|
+
"schema": {
|
|
6278
|
+
"$ref": "#/components/schemas/WorkerQuestion"
|
|
6279
|
+
}
|
|
6280
|
+
}
|
|
6281
|
+
}
|
|
6282
|
+
}
|
|
6283
|
+
},
|
|
6284
|
+
"security": [
|
|
6285
|
+
{
|
|
6286
|
+
"OperatorAuth": []
|
|
6287
|
+
}
|
|
6288
|
+
],
|
|
6289
|
+
"tags": [
|
|
6290
|
+
"Coding"
|
|
6291
|
+
]
|
|
6292
|
+
}
|
|
5996
6293
|
}
|
|
5997
6294
|
},
|
|
5998
6295
|
"components": {
|
|
@@ -6693,6 +6990,10 @@
|
|
|
6693
6990
|
"minLength": 1
|
|
6694
6991
|
},
|
|
6695
6992
|
"uniqueItems": true
|
|
6993
|
+
},
|
|
6994
|
+
"sourceTracking": {
|
|
6995
|
+
"type": "boolean",
|
|
6996
|
+
"description": "Use Git-aware source manifests, excluding ignored dependencies and build output. Defaults to true for HTTP registration."
|
|
6696
6997
|
}
|
|
6697
6998
|
},
|
|
6698
6999
|
"required": [
|
|
@@ -7039,6 +7340,20 @@
|
|
|
7039
7340
|
},
|
|
7040
7341
|
"agentProfiles": {
|
|
7041
7342
|
"$ref": "#/components/schemas/AgentProfileBindings"
|
|
7343
|
+
},
|
|
7344
|
+
"resultMode": {
|
|
7345
|
+
"enum": [
|
|
7346
|
+
"working_tree",
|
|
7347
|
+
"commit"
|
|
7348
|
+
],
|
|
7349
|
+
"description": "working_tree accepts a reviewed revision without changing HEAD or staging. Existing workflows default to commit."
|
|
7350
|
+
},
|
|
7351
|
+
"inputs": {},
|
|
7352
|
+
"inputArtifacts": {
|
|
7353
|
+
"type": "array",
|
|
7354
|
+
"items": {
|
|
7355
|
+
"$ref": "#/components/schemas/EncodedDocument"
|
|
7356
|
+
}
|
|
7042
7357
|
}
|
|
7043
7358
|
},
|
|
7044
7359
|
"required": [
|
|
@@ -7104,6 +7419,34 @@
|
|
|
7104
7419
|
},
|
|
7105
7420
|
"approvalWait": {
|
|
7106
7421
|
"$ref": "#/components/schemas/ApprovalWait"
|
|
7422
|
+
},
|
|
7423
|
+
"resultMode": {
|
|
7424
|
+
"enum": [
|
|
7425
|
+
"working_tree",
|
|
7426
|
+
"commit"
|
|
7427
|
+
]
|
|
7428
|
+
},
|
|
7429
|
+
"inputWait": {
|
|
7430
|
+
"type": "object",
|
|
7431
|
+
"properties": {
|
|
7432
|
+
"status": {
|
|
7433
|
+
"enum": [
|
|
7434
|
+
"none",
|
|
7435
|
+
"waiting"
|
|
7436
|
+
]
|
|
7437
|
+
},
|
|
7438
|
+
"pendingQuestionIds": {
|
|
7439
|
+
"type": "array",
|
|
7440
|
+
"items": {
|
|
7441
|
+
"$ref": "#/components/schemas/Id"
|
|
7442
|
+
}
|
|
7443
|
+
}
|
|
7444
|
+
},
|
|
7445
|
+
"required": [
|
|
7446
|
+
"status",
|
|
7447
|
+
"pendingQuestionIds"
|
|
7448
|
+
],
|
|
7449
|
+
"additionalProperties": false
|
|
7107
7450
|
}
|
|
7108
7451
|
},
|
|
7109
7452
|
"required": [
|
|
@@ -7342,6 +7685,9 @@
|
|
|
7342
7685
|
},
|
|
7343
7686
|
"agentProfiles": {
|
|
7344
7687
|
"$ref": "#/components/schemas/AgentProfileBindings"
|
|
7688
|
+
},
|
|
7689
|
+
"acceptedRevisionId": {
|
|
7690
|
+
"$ref": "#/components/schemas/Id"
|
|
7345
7691
|
}
|
|
7346
7692
|
},
|
|
7347
7693
|
"required": [
|
|
@@ -7971,7 +8317,9 @@
|
|
|
7971
8317
|
"verdict",
|
|
7972
8318
|
"guidance",
|
|
7973
8319
|
"evidence",
|
|
7974
|
-
"schema_snapshot"
|
|
8320
|
+
"schema_snapshot",
|
|
8321
|
+
"input",
|
|
8322
|
+
"check_evidence"
|
|
7975
8323
|
]
|
|
7976
8324
|
},
|
|
7977
8325
|
"document": {
|
|
@@ -8598,6 +8946,26 @@
|
|
|
8598
8946
|
"reason": {
|
|
8599
8947
|
"type": "string",
|
|
8600
8948
|
"minLength": 1
|
|
8949
|
+
},
|
|
8950
|
+
"commandResolution": {
|
|
8951
|
+
"type": "object",
|
|
8952
|
+
"properties": {
|
|
8953
|
+
"sourceDigest": {
|
|
8954
|
+
"type": "string",
|
|
8955
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
8956
|
+
},
|
|
8957
|
+
"action": {
|
|
8958
|
+
"enum": [
|
|
8959
|
+
"preserve_changes",
|
|
8960
|
+
"rollback"
|
|
8961
|
+
]
|
|
8962
|
+
}
|
|
8963
|
+
},
|
|
8964
|
+
"required": [
|
|
8965
|
+
"sourceDigest",
|
|
8966
|
+
"action"
|
|
8967
|
+
],
|
|
8968
|
+
"additionalProperties": false
|
|
8601
8969
|
}
|
|
8602
8970
|
},
|
|
8603
8971
|
"required": [
|
|
@@ -8774,7 +9142,11 @@
|
|
|
8774
9142
|
"approval_expired",
|
|
8775
9143
|
"approval_invalidated",
|
|
8776
9144
|
"approval_consumed",
|
|
8777
|
-
"approval_wait_changed"
|
|
9145
|
+
"approval_wait_changed",
|
|
9146
|
+
"artifact_accepted",
|
|
9147
|
+
"task_message",
|
|
9148
|
+
"worker_question",
|
|
9149
|
+
"check_completed"
|
|
8778
9150
|
]
|
|
8779
9151
|
},
|
|
8780
9152
|
"resourceType": {
|
|
@@ -11080,6 +11452,162 @@
|
|
|
11080
11452
|
"nextCursor"
|
|
11081
11453
|
],
|
|
11082
11454
|
"additionalProperties": false
|
|
11455
|
+
},
|
|
11456
|
+
"CommandCheck": {
|
|
11457
|
+
"type": "object",
|
|
11458
|
+
"properties": {
|
|
11459
|
+
"id": {
|
|
11460
|
+
"$ref": "#/components/schemas/Id"
|
|
11461
|
+
},
|
|
11462
|
+
"description": {
|
|
11463
|
+
"type": "string"
|
|
11464
|
+
},
|
|
11465
|
+
"version": {
|
|
11466
|
+
"type": "string"
|
|
11467
|
+
},
|
|
11468
|
+
"command": {
|
|
11469
|
+
"type": "string"
|
|
11470
|
+
},
|
|
11471
|
+
"cwd": {
|
|
11472
|
+
"type": "string"
|
|
11473
|
+
},
|
|
11474
|
+
"env": {
|
|
11475
|
+
"type": "object",
|
|
11476
|
+
"additionalProperties": {
|
|
11477
|
+
"type": "string"
|
|
11478
|
+
}
|
|
11479
|
+
},
|
|
11480
|
+
"timeoutMs": {
|
|
11481
|
+
"type": "integer",
|
|
11482
|
+
"minimum": 1,
|
|
11483
|
+
"maximum": 86400000
|
|
11484
|
+
}
|
|
11485
|
+
},
|
|
11486
|
+
"required": [
|
|
11487
|
+
"id",
|
|
11488
|
+
"description",
|
|
11489
|
+
"version",
|
|
11490
|
+
"command"
|
|
11491
|
+
],
|
|
11492
|
+
"additionalProperties": false
|
|
11493
|
+
},
|
|
11494
|
+
"CodingTaskCreate": {
|
|
11495
|
+
"type": "object",
|
|
11496
|
+
"oneOf": [
|
|
11497
|
+
{
|
|
11498
|
+
"required": [
|
|
11499
|
+
"repositoryPath"
|
|
11500
|
+
]
|
|
11501
|
+
},
|
|
11502
|
+
{
|
|
11503
|
+
"required": [
|
|
11504
|
+
"workspaceId"
|
|
11505
|
+
]
|
|
11506
|
+
}
|
|
11507
|
+
],
|
|
11508
|
+
"properties": {
|
|
11509
|
+
"resultMode": {
|
|
11510
|
+
"description": "Leave an uncommitted result by default. Commit mode requires clean source.",
|
|
11511
|
+
"enum": [
|
|
11512
|
+
"working_tree",
|
|
11513
|
+
"commit"
|
|
11514
|
+
],
|
|
11515
|
+
"default": "working_tree"
|
|
11516
|
+
},
|
|
11517
|
+
"repositoryPath": {
|
|
11518
|
+
"type": "string",
|
|
11519
|
+
"minLength": 1,
|
|
11520
|
+
"maxLength": 4096,
|
|
11521
|
+
"pattern": "^/"
|
|
11522
|
+
},
|
|
11523
|
+
"workspaceId": {
|
|
11524
|
+
"$ref": "#/components/schemas/Id"
|
|
11525
|
+
},
|
|
11526
|
+
"task": {
|
|
11527
|
+
"type": "string",
|
|
11528
|
+
"minLength": 1,
|
|
11529
|
+
"maxLength": 131072
|
|
11530
|
+
},
|
|
11531
|
+
"inputs": {},
|
|
11532
|
+
"inputArtifacts": {
|
|
11533
|
+
"type": "array",
|
|
11534
|
+
"items": {
|
|
11535
|
+
"$ref": "#/components/schemas/EncodedDocument"
|
|
11536
|
+
}
|
|
11537
|
+
},
|
|
11538
|
+
"profileVersionId": {
|
|
11539
|
+
"$ref": "#/components/schemas/Id"
|
|
11540
|
+
},
|
|
11541
|
+
"checks": {
|
|
11542
|
+
"type": "array",
|
|
11543
|
+
"items": {
|
|
11544
|
+
"$ref": "#/components/schemas/CommandCheck"
|
|
11545
|
+
}
|
|
11546
|
+
}
|
|
11547
|
+
},
|
|
11548
|
+
"required": [
|
|
11549
|
+
"task"
|
|
11550
|
+
],
|
|
11551
|
+
"additionalProperties": false
|
|
11552
|
+
},
|
|
11553
|
+
"TaskMessageCreate": {
|
|
11554
|
+
"type": "object",
|
|
11555
|
+
"properties": {
|
|
11556
|
+
"text": {
|
|
11557
|
+
"type": "string",
|
|
11558
|
+
"minLength": 1,
|
|
11559
|
+
"maxLength": 65536
|
|
11560
|
+
}
|
|
11561
|
+
},
|
|
11562
|
+
"required": [
|
|
11563
|
+
"text"
|
|
11564
|
+
],
|
|
11565
|
+
"additionalProperties": false
|
|
11566
|
+
},
|
|
11567
|
+
"QuestionAnswerCreate": {
|
|
11568
|
+
"type": "object",
|
|
11569
|
+
"properties": {
|
|
11570
|
+
"answer": {
|
|
11571
|
+
"type": "string",
|
|
11572
|
+
"minLength": 1,
|
|
11573
|
+
"maxLength": 65536
|
|
11574
|
+
}
|
|
11575
|
+
},
|
|
11576
|
+
"required": [
|
|
11577
|
+
"answer"
|
|
11578
|
+
],
|
|
11579
|
+
"additionalProperties": false
|
|
11580
|
+
},
|
|
11581
|
+
"CodingReadiness": {
|
|
11582
|
+
"type": "object",
|
|
11583
|
+
"additionalProperties": true
|
|
11584
|
+
},
|
|
11585
|
+
"CodingTaskResult": {
|
|
11586
|
+
"type": "object",
|
|
11587
|
+
"additionalProperties": true
|
|
11588
|
+
},
|
|
11589
|
+
"WorkerQuestion": {
|
|
11590
|
+
"type": "object",
|
|
11591
|
+
"additionalProperties": true
|
|
11592
|
+
},
|
|
11593
|
+
"CodingQuestions": {
|
|
11594
|
+
"type": "object",
|
|
11595
|
+
"properties": {
|
|
11596
|
+
"items": {
|
|
11597
|
+
"type": "array",
|
|
11598
|
+
"items": {
|
|
11599
|
+
"$ref": "#/components/schemas/WorkerQuestion"
|
|
11600
|
+
}
|
|
11601
|
+
}
|
|
11602
|
+
},
|
|
11603
|
+
"required": [
|
|
11604
|
+
"items"
|
|
11605
|
+
],
|
|
11606
|
+
"additionalProperties": false
|
|
11607
|
+
},
|
|
11608
|
+
"TaskMessage": {
|
|
11609
|
+
"type": "object",
|
|
11610
|
+
"additionalProperties": true
|
|
11083
11611
|
}
|
|
11084
11612
|
}
|
|
11085
11613
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { CodingService } from './coding.js';
|
|
2
|
+
import { ApiError } from './errors.js';
|
|
1
3
|
import { RunCommands } from '../engine/commands.js';
|
|
2
4
|
import { WorkflowEngine } from '../engine/workflow-engine.js';
|
|
3
5
|
import { SqliteCoordinator } from '../storage/coordinator.js';
|
|
@@ -19,17 +21,21 @@ export function createApplication(services) {
|
|
|
19
21
|
coordinator.assertOutsideTransaction();
|
|
20
22
|
let engine;
|
|
21
23
|
const commands = new RunCommands({ store, auth, publication, broker, workspaces, pins,
|
|
22
|
-
checkNames: () => checks.list().map(check => check.name), work: id => engine.work(id), wake: id => engine.wake(id),
|
|
24
|
+
checkNames: () => checks.list().map(check => check.name), ...(services.coding ? { commandRecoveryRequired: (id) => services.coding.runner.recoveryRequired(id) } : {}), work: id => engine.work(id), wake: id => engine.wake(id),
|
|
23
25
|
...(services.now ? { now: services.now } : {}) });
|
|
24
26
|
engine = new WorkflowEngine({ commands, workspaces, pins, schemas, checks, driver, validation,
|
|
27
|
+
...(services.coding ? { commandCapabilities: () => ({ ...services.coding.runner.settings }) } : {}),
|
|
28
|
+
...(services.coding ? { reconcileCommands: (id) => services.coding.runner.reconcile(id), additionalWork: (id) => services.coding.runner.activeWork(id), inputWaiting: (id) => services.coding.developer.waiting(id), closeCommands: async () => { await services.coding.developer.close(); await services.coding.runner.close(); }, ...(services.coding.configuration.contextBytes ? { contextBytes: services.coding.configuration.contextBytes } : {}) } : {}),
|
|
25
29
|
deploymentPolicy: services.deploymentPolicy, workspaceInstructions: services.workspaceInstructions });
|
|
30
|
+
const coding = services.coding ? new CodingService({ ...services.coding, store, auth, workspaces, publication, checks, commands, assignEvidence: (sessionId, artifactId) => engine.addInput(sessionId, artifactId), wake: id => engine.wake(id) }) : undefined;
|
|
31
|
+
const codingHandlers = coding?.handlers() ?? new Map(['getCodingReadiness', 'startCodingTask', 'getCodingTaskResult', 'sendTaskMessage', 'listTaskQuestions', 'answerTaskQuestion'].map(name => [name, () => { throw new ApiError(503, 'coding_unavailable', 'This deployment does not have coding services configured.'); }]));
|
|
26
32
|
const paging = new Paging(coordinator);
|
|
27
33
|
const handlers = new Map([...controlPlaneHandlers(store, publication, paging, checks),
|
|
28
34
|
...historyHandlers(store, auth, paging), ...brokerHandlers(store, broker, auth, paging, id => commands.binding(id), engine.projection),
|
|
29
|
-
...workspaceHandlers(store, workspaces, auth, paging), ...toolEventHandlers(store, auth, id => commands.binding(id)), ...commands.handlers()]);
|
|
35
|
+
...workspaceHandlers(store, workspaces, auth, paging), ...toolEventHandlers(store, auth, id => commands.binding(id)), ...commands.handlers(), ...codingHandlers]);
|
|
30
36
|
const app = createHttpServer({ auth, validation, handlers, requireComplete: true });
|
|
31
37
|
coordinator.setQuiescenceProbe(id => engine.quiet(id));
|
|
32
|
-
return { app, engine, commands, handlers,
|
|
38
|
+
return { app, engine, commands, handlers, coding,
|
|
33
39
|
start(recover = false) { if (recover)
|
|
34
40
|
engine.restoreInterrupted(); engine.start(); },
|
|
35
41
|
/** Native services, worker pool and database remain deployment-owned. */
|