cueline 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +8 -0
- package/.codex-plugin/plugin.json +18 -0
- package/LICENSE +21 -0
- package/README.ja.md +144 -0
- package/README.ko.md +144 -0
- package/README.md +144 -0
- package/README.zh-CN.md +144 -0
- package/README.zh-TW.md +144 -0
- package/THIRD_PARTY_NOTICES.md +11 -0
- package/bin/cueline +14 -0
- package/config/routing.default.json +28 -0
- package/config/routing.schema.json +58 -0
- package/dist/src/api.d.ts +34 -0
- package/dist/src/api.js +153 -0
- package/dist/src/api.js.map +1 -0
- package/dist/src/browser/browser-adapter.d.ts +15 -0
- package/dist/src/browser/browser-adapter.js +2 -0
- package/dist/src/browser/browser-adapter.js.map +1 -0
- package/dist/src/browser/codex-iab/bootstrap.d.ts +66 -0
- package/dist/src/browser/codex-iab/bootstrap.js +41 -0
- package/dist/src/browser/codex-iab/bootstrap.js.map +1 -0
- package/dist/src/browser/codex-iab/chatgpt-client.d.ts +10 -0
- package/dist/src/browser/codex-iab/chatgpt-client.js +180 -0
- package/dist/src/browser/codex-iab/chatgpt-client.js.map +1 -0
- package/dist/src/browser/codex-iab/selectors.d.ts +3 -0
- package/dist/src/browser/codex-iab/selectors.js +17 -0
- package/dist/src/browser/codex-iab/selectors.js.map +1 -0
- package/dist/src/cli/main.d.ts +7 -0
- package/dist/src/cli/main.js +196 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/cli/skill-links.d.ts +2 -0
- package/dist/src/cli/skill-links.js +64 -0
- package/dist/src/cli/skill-links.js.map +1 -0
- package/dist/src/core/controller-loop.d.ts +36 -0
- package/dist/src/core/controller-loop.js +292 -0
- package/dist/src/core/controller-loop.js.map +1 -0
- package/dist/src/core/errors.d.ts +10 -0
- package/dist/src/core/errors.js +18 -0
- package/dist/src/core/errors.js.map +1 -0
- package/dist/src/core/ids.d.ts +5 -0
- package/dist/src/core/ids.js +51 -0
- package/dist/src/core/ids.js.map +1 -0
- package/dist/src/core/runtime.d.ts +12 -0
- package/dist/src/core/runtime.js +35 -0
- package/dist/src/core/runtime.js.map +1 -0
- package/dist/src/core/state-machine.d.ts +28 -0
- package/dist/src/core/state-machine.js +99 -0
- package/dist/src/core/state-machine.js.map +1 -0
- package/dist/src/jobs/locks.d.ts +8 -0
- package/dist/src/jobs/locks.js +24 -0
- package/dist/src/jobs/locks.js.map +1 -0
- package/dist/src/jobs/status.d.ts +22 -0
- package/dist/src/jobs/status.js +53 -0
- package/dist/src/jobs/status.js.map +1 -0
- package/dist/src/jobs/supervisor.d.ts +22 -0
- package/dist/src/jobs/supervisor.js +96 -0
- package/dist/src/jobs/supervisor.js.map +1 -0
- package/dist/src/protocol/parse-command.d.ts +2 -0
- package/dist/src/protocol/parse-command.js +23 -0
- package/dist/src/protocol/parse-command.js.map +1 -0
- package/dist/src/protocol/types.d.ts +67 -0
- package/dist/src/protocol/types.js +2 -0
- package/dist/src/protocol/types.js.map +1 -0
- package/dist/src/protocol/validate-command.d.ts +2 -0
- package/dist/src/protocol/validate-command.js +181 -0
- package/dist/src/protocol/validate-command.js.map +1 -0
- package/dist/src/router/availability.d.ts +3 -0
- package/dist/src/router/availability.js +55 -0
- package/dist/src/router/availability.js.map +1 -0
- package/dist/src/router/config-loader.d.ts +3 -0
- package/dist/src/router/config-loader.js +92 -0
- package/dist/src/router/config-loader.js.map +1 -0
- package/dist/src/router/materialize.d.ts +8 -0
- package/dist/src/router/materialize.js +39 -0
- package/dist/src/router/materialize.js.map +1 -0
- package/dist/src/router/resolver.d.ts +6 -0
- package/dist/src/router/resolver.js +55 -0
- package/dist/src/router/resolver.js.map +1 -0
- package/dist/src/router/types.d.ts +24 -0
- package/dist/src/router/types.js +2 -0
- package/dist/src/router/types.js.map +1 -0
- package/dist/src/runners/process-runner.d.ts +15 -0
- package/dist/src/runners/process-runner.js +124 -0
- package/dist/src/runners/process-runner.js.map +1 -0
- package/dist/src/runners/registry.d.ts +17 -0
- package/dist/src/runners/registry.js +57 -0
- package/dist/src/runners/registry.js.map +1 -0
- package/dist/src/runners/runner-adapter.d.ts +32 -0
- package/dist/src/runners/runner-adapter.js +4 -0
- package/dist/src/runners/runner-adapter.js.map +1 -0
- package/dist/src/state/atomic-write.d.ts +1 -0
- package/dist/src/state/atomic-write.js +27 -0
- package/dist/src/state/atomic-write.js.map +1 -0
- package/dist/src/state/event-log.d.ts +8 -0
- package/dist/src/state/event-log.js +56 -0
- package/dist/src/state/event-log.js.map +1 -0
- package/dist/src/state/paths.d.ts +9 -0
- package/dist/src/state/paths.js +37 -0
- package/dist/src/state/paths.js.map +1 -0
- package/dist/src/state/store.d.ts +23 -0
- package/dist/src/state/store.js +108 -0
- package/dist/src/state/store.js.map +1 -0
- package/dist/src/version.d.ts +1 -0
- package/dist/src/version.js +2 -0
- package/dist/src/version.js.map +1 -0
- package/docs/architecture.md +83 -0
- package/docs/assets/README.md +51 -0
- package/docs/assets/cueline-banner-dark.svg +41 -0
- package/docs/assets/cueline-banner-light.svg +41 -0
- package/docs/assets/cueline-loop-en.svg +77 -0
- package/docs/assets/cueline-loop-ja.svg +77 -0
- package/docs/assets/cueline-loop-ko.svg +77 -0
- package/docs/assets/cueline-loop-zh-CN.svg +77 -0
- package/docs/assets/cueline-loop-zh-TW.svg +77 -0
- package/docs/assets/cueline-mark-dark.svg +10 -0
- package/docs/assets/cueline-mark-light.svg +10 -0
- package/docs/assets/cueline-wordmark-dark.svg +19 -0
- package/docs/assets/cueline-wordmark-light.svg +19 -0
- package/docs/compatibility.md +60 -0
- package/docs/controller-protocol.md +106 -0
- package/docs/provenance.md +10 -0
- package/docs/runner-contract.md +61 -0
- package/docs/state-and-recovery.md +67 -0
- package/evals/evals.json +41 -0
- package/install.sh +70 -0
- package/package.json +73 -0
- package/schemas/controller-command.schema.json +53 -0
- package/schemas/controller-observation.schema.json +32 -0
- package/skills/cueline/SKILL.md +80 -0
- package/skills/cueline/agents/openai.yaml +4 -0
package/evals/evals.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "cueline",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Use CueLine with the ChatGPT Pro conversation already open in Codex's built-in browser. Ask it to act as controller and dispatch one advise-only architecture review of /tmp/sample-repo, then return the controller's final answer. Do not modify the repository.",
|
|
7
|
+
"expected_output": "CueLine uses the built-in IAB, keeps the job in advise mode, completes through a validated controller envelope, and returns finalDeliveryText verbatim with persisted run evidence.",
|
|
8
|
+
"files": [],
|
|
9
|
+
"expectations": [
|
|
10
|
+
"Uses CueLine rather than GPT Relay, Chrome automation, or direct web-to-local tools.",
|
|
11
|
+
"Does not convert the advise-only request into mutating work.",
|
|
12
|
+
"Reports completion only after a terminal CueLine result and preserves the run ID for recovery.",
|
|
13
|
+
"Returns the controller finalDeliveryText verbatim without a competing Codex conclusion."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": 2,
|
|
18
|
+
"prompt": "Run CueLine for a local implementation task where one required worker succeeds and a second required work-mode worker exits nonzero after it may have changed files. Let web ChatGPT inspect the evidence and decide whether to complete or block. Do not retry or silently fall back to another worker.",
|
|
19
|
+
"expected_output": "The unsuccessful work result is treated as potentially ambiguous, no post-spawn retry occurs, and ChatGPT receives the evidence and makes the explicit terminal decision.",
|
|
20
|
+
"files": [],
|
|
21
|
+
"expectations": [
|
|
22
|
+
"Does not retry or choose a fallback after the failed work process has started.",
|
|
23
|
+
"Presents both successful and failed worker evidence to the web controller.",
|
|
24
|
+
"Does not claim all local work succeeded merely because the controller can issue complete.",
|
|
25
|
+
"Returns either the controller's exact completion text or a clearly reported persisted blocked result."
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": 3,
|
|
30
|
+
"prompt": "A CueLine run was interrupted after controller round 2. Continue run ID run-eval-continuation using the same persisted CUELINE_HOME and the same already open ChatGPT conversation. Do not create a new run or resend jobs that are already in state.",
|
|
31
|
+
"expected_output": "CueLine loads and replays the existing run, reuses the persisted conversation, suppresses duplicate dispatch, and continues from the next round to a real terminal result.",
|
|
32
|
+
"files": [],
|
|
33
|
+
"expectations": [
|
|
34
|
+
"Calls continueCueLineRun with the existing run ID instead of starting a new run.",
|
|
35
|
+
"Reuses the same CueLine home and ChatGPT conversation without copying credentials.",
|
|
36
|
+
"Does not respawn a deterministic job already present in run state.",
|
|
37
|
+
"Distinguishes a real terminal result from a missing IAB session or other continuation blocker."
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
package/install.sh
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
ROOT=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
5
|
+
CODEX_ROOT=${CODEX_HOME:-"$HOME/.codex"}
|
|
6
|
+
SKILL_SOURCE="$ROOT/skills/cueline"
|
|
7
|
+
BIN_SOURCE="$ROOT/bin/cueline"
|
|
8
|
+
SKILL_TARGET="$CODEX_ROOT/skills/cueline"
|
|
9
|
+
BIN_TARGET="$HOME/.local/bin/cueline"
|
|
10
|
+
|
|
11
|
+
link_matches() {
|
|
12
|
+
target=$1
|
|
13
|
+
source=$2
|
|
14
|
+
test -L "$target" && test "$(readlink "$target")" = "$source"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
preflight_target() {
|
|
18
|
+
target=$1
|
|
19
|
+
source=$2
|
|
20
|
+
if link_matches "$target" "$source"; then
|
|
21
|
+
return 0
|
|
22
|
+
fi
|
|
23
|
+
if test -e "$target" || test -L "$target"; then
|
|
24
|
+
printf 'CueLine: refusing to replace foreign path: %s\n' "$target" >&2
|
|
25
|
+
return 1
|
|
26
|
+
fi
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
install_links() {
|
|
30
|
+
test -f "$SKILL_SOURCE/SKILL.md" || {
|
|
31
|
+
printf 'CueLine: missing skill source: %s\n' "$SKILL_SOURCE/SKILL.md" >&2
|
|
32
|
+
exit 1
|
|
33
|
+
}
|
|
34
|
+
test -x "$BIN_SOURCE" || {
|
|
35
|
+
printf 'CueLine: missing executable CLI source: %s\n' "$BIN_SOURCE" >&2
|
|
36
|
+
exit 1
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
preflight_target "$SKILL_TARGET" "$SKILL_SOURCE" || exit 2
|
|
40
|
+
preflight_target "$BIN_TARGET" "$BIN_SOURCE" || exit 2
|
|
41
|
+
mkdir -p "$(dirname -- "$SKILL_TARGET")" "$(dirname -- "$BIN_TARGET")"
|
|
42
|
+
link_matches "$SKILL_TARGET" "$SKILL_SOURCE" || ln -s "$SKILL_SOURCE" "$SKILL_TARGET"
|
|
43
|
+
link_matches "$BIN_TARGET" "$BIN_SOURCE" || ln -s "$BIN_SOURCE" "$BIN_TARGET"
|
|
44
|
+
printf 'CueLine installed:\n skill: %s\n CLI: %s\n' "$SKILL_TARGET" "$BIN_TARGET"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
remove_owned_link() {
|
|
48
|
+
target=$1
|
|
49
|
+
source=$2
|
|
50
|
+
if link_matches "$target" "$source"; then
|
|
51
|
+
unlink "$target"
|
|
52
|
+
printf 'removed %s\n' "$target"
|
|
53
|
+
elif test -e "$target" || test -L "$target"; then
|
|
54
|
+
printf 'preserved foreign path %s\n' "$target"
|
|
55
|
+
fi
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
uninstall_links() {
|
|
59
|
+
remove_owned_link "$SKILL_TARGET" "$SKILL_SOURCE"
|
|
60
|
+
remove_owned_link "$BIN_TARGET" "$BIN_SOURCE"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
case ${1:-} in
|
|
64
|
+
"") install_links ;;
|
|
65
|
+
--uninstall) uninstall_links ;;
|
|
66
|
+
*)
|
|
67
|
+
printf 'usage: %s [--uninstall]\n' "$0" >&2
|
|
68
|
+
exit 2
|
|
69
|
+
;;
|
|
70
|
+
esac
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cueline",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A ChatGPT web conversation directs; CueLine validates each command and runs the work on your machine, with a durable record of both.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"chatgpt",
|
|
7
|
+
"codex",
|
|
8
|
+
"controller",
|
|
9
|
+
"orchestration",
|
|
10
|
+
"agent",
|
|
11
|
+
"control-loop",
|
|
12
|
+
"cli",
|
|
13
|
+
"typescript"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/Seraphim0916/cueline#readme",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/Seraphim0916/cueline.git"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/Seraphim0916/cueline/issues"
|
|
22
|
+
},
|
|
23
|
+
"author": "CueLine contributors",
|
|
24
|
+
"type": "module",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"private": false,
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"cueline": "bin/cueline"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/src/api.d.ts",
|
|
36
|
+
"import": "./dist/src/api.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
".claude-plugin",
|
|
41
|
+
".codex-plugin",
|
|
42
|
+
"bin",
|
|
43
|
+
"config",
|
|
44
|
+
"dist/src",
|
|
45
|
+
"docs",
|
|
46
|
+
"!docs/superpowers",
|
|
47
|
+
"evals",
|
|
48
|
+
"schemas",
|
|
49
|
+
"skills",
|
|
50
|
+
"install.sh",
|
|
51
|
+
"LICENSE",
|
|
52
|
+
"README.md",
|
|
53
|
+
"README.ja.md",
|
|
54
|
+
"README.ko.md",
|
|
55
|
+
"README.zh-CN.md",
|
|
56
|
+
"README.zh-TW.md",
|
|
57
|
+
"THIRD_PARTY_NOTICES.md"
|
|
58
|
+
],
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc -p tsconfig.json",
|
|
61
|
+
"prepack": "npm run build",
|
|
62
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
63
|
+
"test": "npm run build && node --test dist/test/unit/*.test.js dist/test/integration/*.test.js dist/test/smoke/*.test.js",
|
|
64
|
+
"test:unit": "npm run build && node --test dist/test/unit/*.test.js",
|
|
65
|
+
"test:integration": "npm run build && node --test dist/test/integration/*.test.js",
|
|
66
|
+
"smoke:fake": "npm run build && node --test dist/test/smoke/fake-smoke.test.js",
|
|
67
|
+
"validate:plugin": "python3 \"${CODEX_HOME:-$HOME/.codex}/skills/.system/plugin-creator/scripts/validate_plugin.py\" ."
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@types/node": "^22.20.1",
|
|
71
|
+
"typescript": "^7.0.2"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cueline.dev/schemas/controller-command.schema.json",
|
|
4
|
+
"title": "CueLine controller command",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["protocol", "run_id", "round", "request_id", "action"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"protocol": { "const": "cueline/0.1" },
|
|
9
|
+
"run_id": { "type": "string", "minLength": 1 },
|
|
10
|
+
"round": { "type": "integer", "minimum": 1 },
|
|
11
|
+
"request_id": { "type": "string", "minLength": 1 },
|
|
12
|
+
"action": { "enum": ["dispatch", "wait", "inspect", "complete", "blocked"] },
|
|
13
|
+
"jobs": {
|
|
14
|
+
"type": "array",
|
|
15
|
+
"minItems": 1,
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["job_key", "lane", "mode", "task"],
|
|
20
|
+
"properties": {
|
|
21
|
+
"job_key": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$" },
|
|
22
|
+
"lane": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$" },
|
|
23
|
+
"mode": { "enum": ["advise", "work"] },
|
|
24
|
+
"task": { "type": "string", "minLength": 1 },
|
|
25
|
+
"required": { "type": "boolean" },
|
|
26
|
+
"timeout_ms": { "type": "integer", "minimum": 1, "maximum": 86400000 },
|
|
27
|
+
"runner": { "type": "string", "minLength": 1 },
|
|
28
|
+
"workdir": { "type": "string", "minLength": 1 },
|
|
29
|
+
"background": { "type": "boolean" }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"job_ids": { "type": "array", "items": { "type": "string", "minLength": 1 } },
|
|
34
|
+
"wait_ms": { "type": "integer", "minimum": 1, "maximum": 300000 },
|
|
35
|
+
"final_delivery_text": { "type": "string", "minLength": 1 },
|
|
36
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
37
|
+
},
|
|
38
|
+
"allOf": [
|
|
39
|
+
{
|
|
40
|
+
"if": { "properties": { "action": { "const": "dispatch" } } },
|
|
41
|
+
"then": { "required": ["jobs"] }
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"if": { "properties": { "action": { "const": "complete" } } },
|
|
45
|
+
"then": { "required": ["final_delivery_text"] }
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"if": { "properties": { "action": { "const": "blocked" } } },
|
|
49
|
+
"then": { "required": ["reason"] }
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"additionalProperties": false
|
|
53
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://cueline.dev/schemas/controller-observation.schema.json",
|
|
4
|
+
"title": "CueLine controller observation",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["protocol", "run_id", "round", "request_id", "user_request", "jobs", "notices"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"protocol": { "const": "cueline/0.1" },
|
|
10
|
+
"run_id": { "type": "string", "minLength": 1 },
|
|
11
|
+
"round": { "type": "integer", "minimum": 1 },
|
|
12
|
+
"request_id": { "type": "string", "minLength": 1 },
|
|
13
|
+
"user_request": { "type": "string", "minLength": 1 },
|
|
14
|
+
"jobs": {
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["job_id", "job_key", "required", "status"],
|
|
19
|
+
"properties": {
|
|
20
|
+
"job_id": { "type": "string" },
|
|
21
|
+
"job_key": { "type": "string" },
|
|
22
|
+
"required": { "type": "boolean" },
|
|
23
|
+
"status": { "enum": ["pending", "running", "succeeded", "failed", "timed_out", "ambiguous"] },
|
|
24
|
+
"output": { "type": "string" },
|
|
25
|
+
"error": { "type": "string" }
|
|
26
|
+
},
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"notices": { "type": "array", "items": { "type": "string" } }
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cueline
|
|
3
|
+
description: Use CueLine whenever the user wants a ChatGPT web Pro conversation to be the top-level controller that plans, delegates, reviews evidence, or decides completion while Codex performs the permitted local execution. Trigger for requests to let web ChatGPT lead Codex, combine browser advice with local workers, run a durable controller loop, or continue an existing CueLine run. CueLine is text-only in v0.1 and uses Codex's built-in in-app Browser.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# CueLine
|
|
7
|
+
|
|
8
|
+
Use CueLine to put the current ChatGPT web conversation in charge of planning and next-step decisions while Codex remains the local intermediary and executor. The web page has no direct machine access; it sends validated text commands that CueLine applies through local policy.
|
|
9
|
+
|
|
10
|
+
## Preconditions
|
|
11
|
+
|
|
12
|
+
1. Confirm the current host, operator, and work directory before local work.
|
|
13
|
+
2. Run `cueline doctor` and require Node.js 22 or newer plus at least one usable lane. Run `cueline api path` and require the returned API module to exist. The bundled default lane needs the `codex` CLI on `PATH`.
|
|
14
|
+
3. Use Codex's persistent Node REPL/runtime together with the built-in in-app Browser (IAB), not a separate plain `node` child, Chrome automation, or GPT Relay. Claim the logged-in `chatgpt.com` tab intended for this run.
|
|
15
|
+
4. Do not request, read, copy, or print cookies, access tokens, browser session material, or private environment values.
|
|
16
|
+
5. Keep v0.1 controller traffic text-only. Do not attempt model switching, images, file upload, Deep Research, Projects, or Apps.
|
|
17
|
+
|
|
18
|
+
If live IAB, authentication, build output, or a required runner is missing, report that exact prerequisite. Do not claim a live run from fake or read-only evidence.
|
|
19
|
+
|
|
20
|
+
## Start a run
|
|
21
|
+
|
|
22
|
+
Drive CueLine from Codex's Node runtime so the injected IAB object remains available. First run `cueline api path` in the local shell. In the Node REPL, assign its exact one-line output to `cuelineApiPath`; do not guess an npm prefix or repository location. Import the built public API; do not import Omnilane or GPT Relay.
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
var cuelineApiPath = "/exact/output/from/cueline/api/path";
|
|
26
|
+
const {
|
|
27
|
+
createCodexIabAdapter,
|
|
28
|
+
runCueLine,
|
|
29
|
+
startCueLineRun,
|
|
30
|
+
} = await import(cuelineApiPath);
|
|
31
|
+
|
|
32
|
+
const browser = createCodexIabAdapter({
|
|
33
|
+
// Optional: conversationUrl: "https://chatgpt.com/c/..."
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const result = await runCueLine({
|
|
37
|
+
request: USER_REQUEST,
|
|
38
|
+
browser,
|
|
39
|
+
// Optional: conversationUrl, routingConfig/routingConfigPath, home, cwd,
|
|
40
|
+
// environment, defaultTimeoutMs, maxRounds, maxRepairAttempts.
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Pass the user's request faithfully. Do not silently widen it, and do not turn an analysis-only request into `work`. Use `startCueLineRun` when the caller needs the explicit start entry point; use `runCueLine` for the normal start-and-drive path.
|
|
45
|
+
|
|
46
|
+
The web controller decides `dispatch`, `wait`, `inspect`, `complete`, or `blocked`. CueLine validates the exact pending identity, selects only an available pre-spawn route, persists transitions, and prevents automatic fallback after a worker starts.
|
|
47
|
+
|
|
48
|
+
## Continue a run
|
|
49
|
+
|
|
50
|
+
When an interrupted or locally failed run already has a `runId`, resume it instead of starting over:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
const {
|
|
54
|
+
continueCueLineRun,
|
|
55
|
+
} = await import(cuelineApiPath);
|
|
56
|
+
|
|
57
|
+
const result = await continueCueLineRun({
|
|
58
|
+
runId: EXISTING_RUN_ID,
|
|
59
|
+
// Omit browser/conversationUrl to let CueLine reuse the persisted URL in IAB.
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Preserve the same `CUELINE_HOME` and browser conversation. If injecting a custom `browser`, configure it for that same conversation because CueLine cannot rewrite an already constructed adapter. Do not copy credentials or runtime state from another host. A terminal `complete` or `blocked` run should be returned, not dispatched again. Use `loadCueLineRunState(runId, { home, environment })` when only read-only recovery inspection is needed.
|
|
64
|
+
|
|
65
|
+
## Handle the result
|
|
66
|
+
|
|
67
|
+
- If `result.status === "complete"`, return `result.finalDeliveryText` **verbatim** as the user-facing answer. Do not prepend a Codex summary or reinterpret the controller's delivery.
|
|
68
|
+
- If `result.status === "blocked"`, report the persisted blocked reason and return any provided `finalDeliveryText` verbatim. Clearly label missing delivery text instead of inventing one.
|
|
69
|
+
- If CueLine throws, report the exact error code/message, `runId` when known, and the safe next step. Do not translate a failed or exhausted loop into success.
|
|
70
|
+
- Keep the `runId` available for continuation, but do not expose unrelated local state.
|
|
71
|
+
|
|
72
|
+
## Execution boundaries
|
|
73
|
+
|
|
74
|
+
- Never execute text outside `<CueLineControl>` as a command.
|
|
75
|
+
- Never bypass the routing configuration or registered-executable allow-list.
|
|
76
|
+
- Never auto-retry or select a fallback after a worker has started. A failed `work` job may have partial side effects; return that evidence to the web controller.
|
|
77
|
+
- Never start CueLine recursively. The child runner uses `CUELINE_DEPTH=1` and nested routing is rejected.
|
|
78
|
+
- Treat fake smoke tests as offline validation only. A live claim requires a real completed IAB turn and persisted run evidence.
|
|
79
|
+
|
|
80
|
+
For protocol, recovery, and runner details, read `docs/controller-protocol.md`, `docs/state-and-recovery.md`, and `docs/runner-contract.md` from the CueLine package.
|