codex-chatgpt-control 0.1.0-alpha.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 +5 -0
- package/LICENSE +21 -0
- package/README.md +54 -0
- package/contracts/v1/fixtures/backend-capabilities.json +54 -0
- package/contracts/v1/fixtures/backend-error-event-missing-stream-input.json +10 -0
- package/contracts/v1/fixtures/backend-error-missing-run-input.json +10 -0
- package/contracts/v1/fixtures/backend-runner-plan-request.json +12 -0
- package/contracts/v1/fixtures/backend-version.json +10 -0
- package/contracts/v1/fixtures/command-descriptors.json +803 -0
- package/contracts/v1/fixtures/describe-runner-run.json +31 -0
- package/contracts/v1/fixtures/doctor-bridge-upload.json +34 -0
- package/contracts/v1/fixtures/help-root.json +6 -0
- package/contracts/v1/fixtures/named-plan-two-turn.json +39 -0
- package/contracts/v1/fixtures/output-json-parse-success.json +115 -0
- package/contracts/v1/fixtures/primitive-bootstrap-blocker.json +43 -0
- package/contracts/v1/fixtures/report-redaction-default.json +16 -0
- package/contracts/v1/fixtures/reports-create-redacted.json +16 -0
- package/contracts/v1/fixtures/reports-summarize-redacted.json +26 -0
- package/contracts/v1/fixtures/responses-basic-success.json +27 -0
- package/contracts/v1/fixtures/responses-hidden-instructions-unsupported.json +22 -0
- package/contracts/v1/fixtures/responses-unknown-field-unsupported.json +22 -0
- package/contracts/v1/fixtures/responses-unsupported-previous-response-id.json +22 -0
- package/contracts/v1/fixtures/responses-unsupported-temperature.json +22 -0
- package/contracts/v1/fixtures/run-basic-success.json +36 -0
- package/contracts/v1/fixtures/run-browser-bridge-blocker.json +180 -0
- package/contracts/v1/fixtures/run-file-attach-success.json +63 -0
- package/contracts/v1/fixtures/run-report-redacted.json +52 -0
- package/contracts/v1/fixtures/run-selector-drift-blocker.json +60 -0
- package/contracts/v1/fixtures/run-timeout-partial.json +81 -0
- package/contracts/v1/fixtures/run-two-turn-success.json +83 -0
- package/contracts/v1/fixtures/run-upload-permission-blocker.json +56 -0
- package/contracts/v1/fixtures/runner-budget-blocker.json +106 -0
- package/contracts/v1/fixtures/runner-full-agent-config.json +50 -0
- package/contracts/v1/fixtures/runner-input-items-and-files-plan.json +53 -0
- package/contracts/v1/fixtures/runner-metadata-only-plan.json +31 -0
- package/contracts/v1/fixtures/runner-visible-prefix-plan.json +28 -0
- package/contracts/v1/fixtures/runner-visible-setup-plan.json +37 -0
- package/contracts/v1/fixtures/stream-basic.ndjson +3 -0
- package/contracts/v1/fixtures/stream-blocked.ndjson +2 -0
- package/contracts/v1/fixtures/stream-submitted-completed.ndjson +3 -0
- package/contracts/v1/fixtures/workflow-ask-success.json +67 -0
- package/contracts/v1/manifest.json +210 -0
- package/contracts/v1/parity-suite.json +635 -0
- package/contracts/v1/schemas/agent.schema.json +52 -0
- package/contracts/v1/schemas/backend-event.schema.json +74 -0
- package/contracts/v1/schemas/backend-request.schema.json +59 -0
- package/contracts/v1/schemas/backend-response.schema.json +42 -0
- package/contracts/v1/schemas/capabilities.schema.json +33 -0
- package/contracts/v1/schemas/command-descriptor.schema.json +31 -0
- package/contracts/v1/schemas/command-result.schema.json +99 -0
- package/contracts/v1/schemas/manifest.schema.json +69 -0
- package/contracts/v1/schemas/response.schema.json +51 -0
- package/contracts/v1/schemas/run-result.schema.json +138 -0
- package/contracts/v1/schemas/sequence-plan.schema.json +44 -0
- package/contracts/v1/schemas/stream-event.schema.json +25 -0
- package/dist/codex-chatgpt-control-backend.mjs +5284 -0
- package/dist/codex-chatgpt-control.bundle.mjs +6013 -0
- package/dist/src/backend/client.d.ts +129 -0
- package/dist/src/backend/client.js +415 -0
- package/dist/src/backend/protocol.d.ts +74 -0
- package/dist/src/backend/protocol.js +128 -0
- package/dist/src/backend/session.d.ts +11 -0
- package/dist/src/backend/session.js +223 -0
- package/dist/src/backend/stdio-server.d.ts +9 -0
- package/dist/src/backend/stdio-server.js +88 -0
- package/dist/src/browser/attach.d.ts +8 -0
- package/dist/src/browser/attach.js +456 -0
- package/dist/src/browser/clipboard.d.ts +2 -0
- package/dist/src/browser/clipboard.js +26 -0
- package/dist/src/browser/downloads.d.ts +7 -0
- package/dist/src/browser/downloads.js +29 -0
- package/dist/src/browser/page-state.d.ts +17 -0
- package/dist/src/browser/page-state.js +66 -0
- package/dist/src/client.d.ts +167 -0
- package/dist/src/client.js +666 -0
- package/dist/src/commands/confirmations.d.ts +9 -0
- package/dist/src/commands/confirmations.js +33 -0
- package/dist/src/commands/context.d.ts +2 -0
- package/dist/src/commands/context.js +32 -0
- package/dist/src/commands/doctor.d.ts +16 -0
- package/dist/src/commands/doctor.js +120 -0
- package/dist/src/commands/files.d.ts +4 -0
- package/dist/src/commands/files.js +314 -0
- package/dist/src/commands/helpers.d.ts +16 -0
- package/dist/src/commands/helpers.js +128 -0
- package/dist/src/commands/messages.d.ts +16 -0
- package/dist/src/commands/messages.js +538 -0
- package/dist/src/commands/modes.d.ts +9 -0
- package/dist/src/commands/modes.js +323 -0
- package/dist/src/commands/output.d.ts +5 -0
- package/dist/src/commands/output.js +31 -0
- package/dist/src/commands/registry.d.ts +17 -0
- package/dist/src/commands/registry.js +275 -0
- package/dist/src/commands/reports.d.ts +14 -0
- package/dist/src/commands/reports.js +47 -0
- package/dist/src/commands/response-actions.d.ts +2 -0
- package/dist/src/commands/response-actions.js +141 -0
- package/dist/src/commands/sequence.d.ts +9 -0
- package/dist/src/commands/sequence.js +228 -0
- package/dist/src/commands/session.d.ts +2 -0
- package/dist/src/commands/session.js +25 -0
- package/dist/src/commands/threads.d.ts +6 -0
- package/dist/src/commands/threads.js +300 -0
- package/dist/src/dom/fixtures.d.ts +1 -0
- package/dist/src/dom/fixtures.js +8 -0
- package/dist/src/dom/menus.d.ts +8 -0
- package/dist/src/dom/menus.js +40 -0
- package/dist/src/dom/message-format.d.ts +30 -0
- package/dist/src/dom/message-format.js +593 -0
- package/dist/src/dom/messages.d.ts +40 -0
- package/dist/src/dom/messages.js +127 -0
- package/dist/src/dom/selectors.d.ts +20 -0
- package/dist/src/dom/selectors.js +72 -0
- package/dist/src/dom/visible-text.d.ts +5 -0
- package/dist/src/dom/visible-text.js +27 -0
- package/dist/src/errors.d.ts +32 -0
- package/dist/src/errors.js +127 -0
- package/dist/src/index.d.ts +34 -0
- package/dist/src/index.js +34 -0
- package/dist/src/logger.d.ts +15 -0
- package/dist/src/logger.js +25 -0
- package/dist/src/runner/agent.d.ts +2 -0
- package/dist/src/runner/agent.js +17 -0
- package/dist/src/runner/index.d.ts +7 -0
- package/dist/src/runner/index.js +7 -0
- package/dist/src/runner/interruptions.d.ts +3 -0
- package/dist/src/runner/interruptions.js +65 -0
- package/dist/src/runner/responses.d.ts +30 -0
- package/dist/src/runner/responses.js +171 -0
- package/dist/src/runner/result.d.ts +3 -0
- package/dist/src/runner/result.js +128 -0
- package/dist/src/runner/resume.d.ts +11 -0
- package/dist/src/runner/resume.js +26 -0
- package/dist/src/runner/stream.d.ts +13 -0
- package/dist/src/runner/stream.js +66 -0
- package/dist/src/runner/types.d.ts +264 -0
- package/dist/src/runner/types.js +1 -0
- package/dist/src/safety/blockers.d.ts +7 -0
- package/dist/src/safety/blockers.js +60 -0
- package/dist/src/safety/redaction.d.ts +2 -0
- package/dist/src/safety/redaction.js +18 -0
- package/dist/src/safety/report-redaction.d.ts +8 -0
- package/dist/src/safety/report-redaction.js +74 -0
- package/dist/src/safety/risk.d.ts +26 -0
- package/dist/src/safety/risk.js +28 -0
- package/dist/src/scripts/backend-server.d.ts +2 -0
- package/dist/src/scripts/backend-server.js +7 -0
- package/dist/src/scripts/check-parity-suite.d.ts +1 -0
- package/dist/src/scripts/check-parity-suite.js +10 -0
- package/dist/src/scripts/continue-thread.d.ts +27 -0
- package/dist/src/scripts/continue-thread.js +388 -0
- package/dist/src/scripts/live-smoke/harness.d.ts +11 -0
- package/dist/src/scripts/live-smoke/harness.js +151 -0
- package/dist/src/scripts/live-smoke/scenarios.d.ts +3 -0
- package/dist/src/scripts/live-smoke/scenarios.js +648 -0
- package/dist/src/scripts/live-smoke/types.d.ts +53 -0
- package/dist/src/scripts/live-smoke/types.js +1 -0
- package/dist/src/scripts/live-smoke-module.d.ts +3 -0
- package/dist/src/scripts/live-smoke-module.js +2 -0
- package/dist/src/scripts/live-smoke.d.ts +1 -0
- package/dist/src/scripts/live-smoke.js +54 -0
- package/dist/src/scripts/smoke-attach-file.d.ts +1 -0
- package/dist/src/scripts/smoke-attach-file.js +39 -0
- package/dist/src/scripts/smoke-hi.d.ts +1 -0
- package/dist/src/scripts/smoke-hi.js +25 -0
- package/dist/src/scripts/smoke-search-open-read.d.ts +1 -0
- package/dist/src/scripts/smoke-search-open-read.js +41 -0
- package/dist/src/testing/parity-suite.d.ts +12 -0
- package/dist/src/testing/parity-suite.js +213 -0
- package/dist/src/types.d.ts +495 -0
- package/dist/src/types.js +1 -0
- package/package.json +81 -0
- package/references/agents-runner.md +32 -0
- package/references/backend-protocol.md +238 -0
- package/references/python-parity.md +168 -0
- package/references/responses-adapter.md +28 -0
- package/references/safety.md +14 -0
- package/references/streaming.md +15 -0
- package/references/troubleshooting.md +91 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/agent.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["kind", "name", "instructionsMode", "defaults", "tools", "guardrails"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"kind": { "const": "chatgpt_browser_agent" },
|
|
9
|
+
"name": { "type": "string", "minLength": 1 },
|
|
10
|
+
"instructions": { "type": "string" },
|
|
11
|
+
"instructionsMode": {
|
|
12
|
+
"enum": ["visible_prefix", "visible_setup_message", "metadata_only"]
|
|
13
|
+
},
|
|
14
|
+
"defaults": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": true
|
|
17
|
+
},
|
|
18
|
+
"tools": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": ["name", "command"],
|
|
23
|
+
"additionalProperties": true,
|
|
24
|
+
"properties": {
|
|
25
|
+
"name": { "type": "string", "minLength": 1 },
|
|
26
|
+
"command": { "type": "string", "minLength": 1 },
|
|
27
|
+
"risk": { "enum": ["low", "medium", "high"] }
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"guardrails": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"required": ["name", "scope"],
|
|
36
|
+
"additionalProperties": true,
|
|
37
|
+
"properties": {
|
|
38
|
+
"name": { "type": "string", "minLength": 1 },
|
|
39
|
+
"scope": { "enum": ["input", "plan", "step", "output", "report"] }
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"output": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"additionalProperties": true
|
|
46
|
+
},
|
|
47
|
+
"metadata": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"additionalProperties": true
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/backend-event.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "type"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": "chatgpt.browser_control.backend_event.v1" },
|
|
9
|
+
"requestId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"type": {
|
|
11
|
+
"enum": ["run_item_stream_event", "agent_updated_stream_event", "completed", "error"]
|
|
12
|
+
},
|
|
13
|
+
"name": { "type": "string", "minLength": 1 },
|
|
14
|
+
"item": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": true
|
|
17
|
+
},
|
|
18
|
+
"agent": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": true
|
|
21
|
+
},
|
|
22
|
+
"result": {},
|
|
23
|
+
"error": { "$ref": "#/$defs/protocolError" }
|
|
24
|
+
},
|
|
25
|
+
"oneOf": [
|
|
26
|
+
{
|
|
27
|
+
"required": ["name", "item"],
|
|
28
|
+
"properties": {
|
|
29
|
+
"type": { "const": "run_item_stream_event" },
|
|
30
|
+
"name": { "type": "string", "minLength": 1 },
|
|
31
|
+
"item": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"additionalProperties": true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"required": ["agent"],
|
|
39
|
+
"properties": {
|
|
40
|
+
"type": { "const": "agent_updated_stream_event" },
|
|
41
|
+
"agent": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"additionalProperties": true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"required": ["result"],
|
|
49
|
+
"properties": {
|
|
50
|
+
"type": { "const": "completed" },
|
|
51
|
+
"result": {}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"required": ["error"],
|
|
56
|
+
"properties": {
|
|
57
|
+
"type": { "const": "error" },
|
|
58
|
+
"error": { "$ref": "#/$defs/protocolError" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"$defs": {
|
|
63
|
+
"protocolError": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"required": ["code", "message", "recoverable"],
|
|
66
|
+
"additionalProperties": false,
|
|
67
|
+
"properties": {
|
|
68
|
+
"code": { "type": "string", "minLength": 1 },
|
|
69
|
+
"message": { "type": "string", "minLength": 1 },
|
|
70
|
+
"recoverable": { "type": "boolean" }
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/backend-request.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "command"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": "chatgpt.browser_control.backend_request.v1" },
|
|
9
|
+
"requestId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"command": {
|
|
11
|
+
"enum": [
|
|
12
|
+
"backend.version",
|
|
13
|
+
"backend.health",
|
|
14
|
+
"backend.capabilities",
|
|
15
|
+
"runner.run",
|
|
16
|
+
"runner.plan",
|
|
17
|
+
"runner.stream",
|
|
18
|
+
"responses.create",
|
|
19
|
+
"ask",
|
|
20
|
+
"askInThread",
|
|
21
|
+
"askWithFiles",
|
|
22
|
+
"askAndDownload",
|
|
23
|
+
"runMessages",
|
|
24
|
+
"openThread",
|
|
25
|
+
"readLatest",
|
|
26
|
+
"copyLatest",
|
|
27
|
+
"downloadLatest",
|
|
28
|
+
"runPlan",
|
|
29
|
+
"doctor",
|
|
30
|
+
"createReport",
|
|
31
|
+
"reports.create",
|
|
32
|
+
"reports.redact",
|
|
33
|
+
"reports.summarize",
|
|
34
|
+
"commands",
|
|
35
|
+
"describe",
|
|
36
|
+
"help",
|
|
37
|
+
"session.bootstrap",
|
|
38
|
+
"threads.new",
|
|
39
|
+
"threads.search",
|
|
40
|
+
"threads.open",
|
|
41
|
+
"messages.compose",
|
|
42
|
+
"messages.submit",
|
|
43
|
+
"messages.ask",
|
|
44
|
+
"messages.wait",
|
|
45
|
+
"messages.readLatest",
|
|
46
|
+
"messages.waitAndRead",
|
|
47
|
+
"files.attach",
|
|
48
|
+
"files.downloadLatest",
|
|
49
|
+
"modes.set",
|
|
50
|
+
"tools.select",
|
|
51
|
+
"response.copy"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"payload": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"additionalProperties": true
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/backend-response.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "ok"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": "chatgpt.browser_control.backend_response.v1" },
|
|
9
|
+
"requestId": { "type": "string", "minLength": 1 },
|
|
10
|
+
"ok": { "type": "boolean" },
|
|
11
|
+
"result": {},
|
|
12
|
+
"error": { "$ref": "#/$defs/protocolError" }
|
|
13
|
+
},
|
|
14
|
+
"oneOf": [
|
|
15
|
+
{
|
|
16
|
+
"required": ["result"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"ok": { "const": true },
|
|
19
|
+
"result": {}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"required": ["error"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"ok": { "const": false },
|
|
26
|
+
"error": { "$ref": "#/$defs/protocolError" }
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"$defs": {
|
|
31
|
+
"protocolError": {
|
|
32
|
+
"type": "object",
|
|
33
|
+
"required": ["code", "message", "recoverable"],
|
|
34
|
+
"additionalProperties": false,
|
|
35
|
+
"properties": {
|
|
36
|
+
"code": { "type": "string", "minLength": 1 },
|
|
37
|
+
"message": { "type": "string", "minLength": 1 },
|
|
38
|
+
"recoverable": { "type": "boolean" }
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/capabilities.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["protocolVersion", "commands", "transports", "streaming"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"protocolVersion": { "const": "chatgpt.browser_control.backend_request.v1" },
|
|
9
|
+
"commands": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"minItems": 1,
|
|
12
|
+
"items": { "type": "string", "minLength": 1 }
|
|
13
|
+
},
|
|
14
|
+
"transports": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"minItems": 1,
|
|
17
|
+
"items": { "enum": ["stdio", "http"] }
|
|
18
|
+
},
|
|
19
|
+
"streaming": {
|
|
20
|
+
"type": "object",
|
|
21
|
+
"required": ["modes", "tokenDeltas"],
|
|
22
|
+
"additionalProperties": false,
|
|
23
|
+
"properties": {
|
|
24
|
+
"modes": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"minItems": 1,
|
|
27
|
+
"items": { "enum": ["ndjson", "sse"] }
|
|
28
|
+
},
|
|
29
|
+
"tokenDeltas": { "const": false }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/command-descriptor.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["name", "layer", "summary", "risk", "args", "defaults", "retryPolicy", "blockers", "examples"],
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": { "type": "string", "minLength": 1 },
|
|
9
|
+
"layer": { "type": "string", "minLength": 1 },
|
|
10
|
+
"summary": { "type": "string", "minLength": 1 },
|
|
11
|
+
"risk": { "enum": ["low", "medium", "high"] },
|
|
12
|
+
"defaultTimeoutMs": { "type": "integer", "minimum": 0 },
|
|
13
|
+
"args": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": { "type": "string" }
|
|
16
|
+
},
|
|
17
|
+
"defaults": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"additionalProperties": true
|
|
20
|
+
},
|
|
21
|
+
"retryPolicy": { "type": "string", "minLength": 1 },
|
|
22
|
+
"blockers": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "type": "string", "minLength": 1 }
|
|
25
|
+
},
|
|
26
|
+
"examples": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": { "type": "string" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/command-result.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["ok", "status", "warnings", "context"],
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"ok": { "type": "boolean" },
|
|
9
|
+
"status": { "$ref": "#/$defs/commandStatus" },
|
|
10
|
+
"data": {},
|
|
11
|
+
"output_text": { "type": "string" },
|
|
12
|
+
"warnings": {
|
|
13
|
+
"type": "array",
|
|
14
|
+
"items": { "type": "string" }
|
|
15
|
+
},
|
|
16
|
+
"reportPath": { "type": "string" },
|
|
17
|
+
"error": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["name", "message", "recoverable"],
|
|
20
|
+
"additionalProperties": true,
|
|
21
|
+
"properties": {
|
|
22
|
+
"name": { "type": "string", "minLength": 1 },
|
|
23
|
+
"message": { "type": "string", "minLength": 1 },
|
|
24
|
+
"recoverable": { "type": "boolean" }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"blocker": {
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": ["kind", "message"],
|
|
30
|
+
"additionalProperties": true,
|
|
31
|
+
"properties": {
|
|
32
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
33
|
+
"message": { "type": "string", "minLength": 1 },
|
|
34
|
+
"visibleText": { "type": "string" },
|
|
35
|
+
"code": { "type": "string" },
|
|
36
|
+
"fieldPath": { "type": "string" },
|
|
37
|
+
"remediation": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": ["label", "instruction", "userActionRequired"],
|
|
42
|
+
"additionalProperties": true,
|
|
43
|
+
"properties": {
|
|
44
|
+
"label": { "type": "string", "minLength": 1 },
|
|
45
|
+
"instruction": { "type": "string", "minLength": 1 },
|
|
46
|
+
"userActionRequired": { "type": "boolean" }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"candidates": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "object",
|
|
54
|
+
"required": ["label"],
|
|
55
|
+
"additionalProperties": true,
|
|
56
|
+
"properties": {
|
|
57
|
+
"label": { "type": "string", "minLength": 1 },
|
|
58
|
+
"role": { "type": "string" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"resumable": { "type": "boolean" }
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"context": {
|
|
66
|
+
"type": "object",
|
|
67
|
+
"required": ["timestamp"],
|
|
68
|
+
"additionalProperties": true,
|
|
69
|
+
"properties": {
|
|
70
|
+
"timestamp": { "type": "string", "minLength": 1 }
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"steps": {
|
|
74
|
+
"type": "array",
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"required": ["id", "command", "status", "ok", "startedAt", "endedAt", "warnings"],
|
|
78
|
+
"additionalProperties": true,
|
|
79
|
+
"properties": {
|
|
80
|
+
"id": { "type": "string", "minLength": 1 },
|
|
81
|
+
"command": { "type": "string", "minLength": 1 },
|
|
82
|
+
"status": { "$ref": "#/$defs/commandStatus" },
|
|
83
|
+
"ok": { "type": "boolean" },
|
|
84
|
+
"startedAt": { "type": "string", "minLength": 1 },
|
|
85
|
+
"endedAt": { "type": "string", "minLength": 1 },
|
|
86
|
+
"warnings": {
|
|
87
|
+
"type": "array",
|
|
88
|
+
"items": { "type": "string" }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"$defs": {
|
|
95
|
+
"commandStatus": {
|
|
96
|
+
"enum": ["ok", "partial", "timeout", "blocked", "needs_confirmation", "not_found", "unsupported", "error"]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/manifest.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["schemaVersion", "contractVersion", "wireCase", "schemas", "fixtures"],
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"schemaVersion": { "const": "chatgpt.browser_control.contract_manifest.v1" },
|
|
9
|
+
"contractVersion": { "type": "string", "minLength": 1 },
|
|
10
|
+
"wireCase": { "const": "camelCaseWithDocumentedAliases" },
|
|
11
|
+
"schemas": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": [
|
|
14
|
+
"runResult",
|
|
15
|
+
"response",
|
|
16
|
+
"streamEvent",
|
|
17
|
+
"commandDescriptor",
|
|
18
|
+
"commandResult",
|
|
19
|
+
"sequencePlan",
|
|
20
|
+
"agent",
|
|
21
|
+
"backendRequest",
|
|
22
|
+
"backendResponse",
|
|
23
|
+
"backendEvent",
|
|
24
|
+
"capabilities"
|
|
25
|
+
],
|
|
26
|
+
"additionalProperties": false,
|
|
27
|
+
"properties": {
|
|
28
|
+
"runResult": { "type": "string", "minLength": 1 },
|
|
29
|
+
"response": { "type": "string", "minLength": 1 },
|
|
30
|
+
"streamEvent": { "type": "string", "minLength": 1 },
|
|
31
|
+
"commandDescriptor": { "type": "string", "minLength": 1 },
|
|
32
|
+
"commandResult": { "type": "string", "minLength": 1 },
|
|
33
|
+
"sequencePlan": { "type": "string", "minLength": 1 },
|
|
34
|
+
"agent": { "type": "string", "minLength": 1 },
|
|
35
|
+
"backendRequest": { "type": "string", "minLength": 1 },
|
|
36
|
+
"backendResponse": { "type": "string", "minLength": 1 },
|
|
37
|
+
"backendEvent": { "type": "string", "minLength": 1 },
|
|
38
|
+
"capabilities": { "type": "string", "minLength": 1 }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"fixtures": {
|
|
42
|
+
"type": "array",
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "object",
|
|
45
|
+
"required": ["file", "schema", "case"],
|
|
46
|
+
"additionalProperties": false,
|
|
47
|
+
"properties": {
|
|
48
|
+
"file": { "type": "string", "minLength": 1 },
|
|
49
|
+
"schema": {
|
|
50
|
+
"enum": [
|
|
51
|
+
"runResult",
|
|
52
|
+
"response",
|
|
53
|
+
"streamEvent",
|
|
54
|
+
"commandDescriptor",
|
|
55
|
+
"commandResult",
|
|
56
|
+
"sequencePlan",
|
|
57
|
+
"agent",
|
|
58
|
+
"backendRequest",
|
|
59
|
+
"backendResponse",
|
|
60
|
+
"backendEvent",
|
|
61
|
+
"capabilities"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"case": { "type": "string", "minLength": 1 }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/response.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["id", "object", "created_at", "status", "output_text", "output", "browser_control"],
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"id": { "type": "string", "minLength": 1 },
|
|
9
|
+
"object": { "const": "chatgpt.browser.response" },
|
|
10
|
+
"created_at": { "type": "integer", "minimum": 0 },
|
|
11
|
+
"status": { "$ref": "#/$defs/commandStatus" },
|
|
12
|
+
"output_text": { "type": "string" },
|
|
13
|
+
"output": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"items": { "type": "object" }
|
|
16
|
+
},
|
|
17
|
+
"browser_control": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"required": ["visibleUi", "resultStatus"],
|
|
20
|
+
"additionalProperties": true,
|
|
21
|
+
"properties": {
|
|
22
|
+
"visibleUi": { "type": "boolean" },
|
|
23
|
+
"resultStatus": { "$ref": "#/$defs/commandStatus" },
|
|
24
|
+
"thread": {
|
|
25
|
+
"type": "object",
|
|
26
|
+
"additionalProperties": true
|
|
27
|
+
},
|
|
28
|
+
"reportPath": { "type": "string" },
|
|
29
|
+
"unsupported": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"items": { "$ref": "#/$defs/unsupportedField" }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"$defs": {
|
|
37
|
+
"commandStatus": {
|
|
38
|
+
"enum": ["ok", "partial", "timeout", "blocked", "needs_confirmation", "not_found", "unsupported", "error"]
|
|
39
|
+
},
|
|
40
|
+
"unsupportedField": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"required": ["path", "reason"],
|
|
43
|
+
"additionalProperties": true,
|
|
44
|
+
"properties": {
|
|
45
|
+
"path": { "type": "string", "minLength": 1 },
|
|
46
|
+
"reason": { "type": "string", "minLength": 1 },
|
|
47
|
+
"alternative": { "type": "string" }
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://local.codex-chatgpt-control/contracts/v1/run-result.schema.json",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": [
|
|
6
|
+
"ok",
|
|
7
|
+
"status",
|
|
8
|
+
"output_text",
|
|
9
|
+
"output",
|
|
10
|
+
"newItems",
|
|
11
|
+
"interruptions",
|
|
12
|
+
"state",
|
|
13
|
+
"warnings",
|
|
14
|
+
"context"
|
|
15
|
+
],
|
|
16
|
+
"additionalProperties": true,
|
|
17
|
+
"properties": {
|
|
18
|
+
"ok": { "type": "boolean" },
|
|
19
|
+
"status": { "$ref": "#/$defs/commandStatus" },
|
|
20
|
+
"output_text": { "type": "string" },
|
|
21
|
+
"finalOutput": {},
|
|
22
|
+
"output": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": { "$ref": "#/$defs/runItem" }
|
|
25
|
+
},
|
|
26
|
+
"newItems": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": { "$ref": "#/$defs/runItem" }
|
|
29
|
+
},
|
|
30
|
+
"interruptions": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": { "$ref": "#/$defs/interruption" }
|
|
33
|
+
},
|
|
34
|
+
"state": { "$ref": "#/$defs/runState" },
|
|
35
|
+
"activeAgentName": { "type": "string" },
|
|
36
|
+
"lastAgentName": { "type": "string" },
|
|
37
|
+
"warnings": {
|
|
38
|
+
"type": "array",
|
|
39
|
+
"items": { "type": "string" }
|
|
40
|
+
},
|
|
41
|
+
"context": {
|
|
42
|
+
"type": "object",
|
|
43
|
+
"required": ["timestamp"],
|
|
44
|
+
"additionalProperties": true,
|
|
45
|
+
"properties": {
|
|
46
|
+
"timestamp": { "type": "string", "minLength": 1 }
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"blocker": { "$ref": "#/$defs/blocker" },
|
|
50
|
+
"reportPath": { "type": "string" }
|
|
51
|
+
},
|
|
52
|
+
"$defs": {
|
|
53
|
+
"commandStatus": {
|
|
54
|
+
"enum": ["ok", "partial", "timeout", "blocked", "needs_confirmation", "not_found", "unsupported", "error"]
|
|
55
|
+
},
|
|
56
|
+
"runState": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["id", "resumable"],
|
|
59
|
+
"additionalProperties": true,
|
|
60
|
+
"properties": {
|
|
61
|
+
"id": { "type": "string", "minLength": 1 },
|
|
62
|
+
"resumable": { "type": "boolean" },
|
|
63
|
+
"thread": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": true
|
|
66
|
+
},
|
|
67
|
+
"nextStepId": { "type": "string" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"blocker": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"required": ["kind", "message"],
|
|
73
|
+
"additionalProperties": true,
|
|
74
|
+
"properties": {
|
|
75
|
+
"kind": { "type": "string", "minLength": 1 },
|
|
76
|
+
"message": { "type": "string", "minLength": 1 },
|
|
77
|
+
"visibleText": { "type": "string" },
|
|
78
|
+
"code": { "type": "string" },
|
|
79
|
+
"fieldPath": { "type": "string" },
|
|
80
|
+
"remediation": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"required": ["label", "instruction", "userActionRequired"],
|
|
85
|
+
"additionalProperties": true,
|
|
86
|
+
"properties": {
|
|
87
|
+
"label": { "type": "string", "minLength": 1 },
|
|
88
|
+
"instruction": { "type": "string", "minLength": 1 },
|
|
89
|
+
"userActionRequired": { "type": "boolean" }
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"candidates": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"required": ["label"],
|
|
98
|
+
"additionalProperties": true,
|
|
99
|
+
"properties": {
|
|
100
|
+
"label": { "type": "string", "minLength": 1 },
|
|
101
|
+
"role": { "type": "string" }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"resumable": { "type": "boolean" }
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"interruption": {
|
|
109
|
+
"type": "object",
|
|
110
|
+
"required": ["id", "type", "status", "message", "resume"],
|
|
111
|
+
"additionalProperties": true,
|
|
112
|
+
"properties": {
|
|
113
|
+
"id": { "type": "string", "minLength": 1 },
|
|
114
|
+
"type": { "type": "string", "minLength": 1 },
|
|
115
|
+
"status": { "$ref": "#/$defs/commandStatus" },
|
|
116
|
+
"message": { "type": "string", "minLength": 1 },
|
|
117
|
+
"resume": {
|
|
118
|
+
"type": "object",
|
|
119
|
+
"required": ["supported"],
|
|
120
|
+
"additionalProperties": true,
|
|
121
|
+
"properties": {
|
|
122
|
+
"supported": { "type": "boolean" },
|
|
123
|
+
"stateId": { "type": "string" },
|
|
124
|
+
"reason": { "type": "string" }
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"runItem": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["type"],
|
|
132
|
+
"additionalProperties": true,
|
|
133
|
+
"properties": {
|
|
134
|
+
"type": { "type": "string", "minLength": 1 }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|