jupyterlab-codex-sidebar 0.1.4 → 0.1.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/.claude/settings.local.json +9 -0
- package/.github/workflows/unit-tests.yml +27 -0
- package/.jupyterlab-playwright.log +0 -0
- package/README.md +83 -9
- package/docs/images/codex-sidebar-screenshot.png +0 -0
- package/jupyterlab_codex/handlers.py +938 -297
- package/jupyterlab_codex/labextension/package.json +13 -3
- package/jupyterlab_codex/labextension/static/525.224526d045c727069de6.js +2 -0
- package/jupyterlab_codex/labextension/static/737.e7de3ad9dd6ded798340.js +1 -0
- package/jupyterlab_codex/labextension/static/remoteEntry.6ef5e7167763a316c000.js +1 -0
- package/jupyterlab_codex/protocol.py +297 -0
- package/jupyterlab_codex/runner.py +58 -15
- package/jupyterlab_codex/sessions.py +582 -97
- package/lib/codexChat.d.ts +13 -0
- package/lib/codexChat.js +2506 -0
- package/lib/codexChat.js.map +1 -0
- package/lib/codexChatAttachmentDedup.d.ts +10 -0
- package/lib/codexChatAttachmentDedup.js +35 -0
- package/lib/codexChatAttachmentDedup.js.map +1 -0
- package/lib/codexChatAttachmentLimit.d.ts +18 -0
- package/lib/codexChatAttachmentLimit.js +50 -0
- package/lib/codexChatAttachmentLimit.js.map +1 -0
- package/lib/codexChatAttachmentState.d.ts +15 -0
- package/lib/codexChatAttachmentState.js +16 -0
- package/lib/codexChatAttachmentState.js.map +1 -0
- package/lib/codexChatDocumentUtils.d.ts +70 -0
- package/lib/codexChatDocumentUtils.js +506 -0
- package/lib/codexChatDocumentUtils.js.map +1 -0
- package/lib/codexChatFormatting.d.ts +11 -0
- package/lib/codexChatFormatting.js +83 -0
- package/lib/codexChatFormatting.js.map +1 -0
- package/lib/codexChatNotice.d.ts +3 -0
- package/lib/codexChatNotice.js +74 -0
- package/lib/codexChatNotice.js.map +1 -0
- package/lib/codexChatPersistence.d.ts +35 -0
- package/lib/codexChatPersistence.js +158 -0
- package/lib/codexChatPersistence.js.map +1 -0
- package/lib/codexChatPrimitives.d.ts +44 -0
- package/lib/codexChatPrimitives.js +156 -0
- package/lib/codexChatPrimitives.js.map +1 -0
- package/lib/codexChatRender.d.ts +24 -0
- package/lib/codexChatRender.js +293 -0
- package/lib/codexChatRender.js.map +1 -0
- package/lib/codexChatSessionFactory.d.ts +15 -0
- package/lib/codexChatSessionFactory.js +45 -0
- package/lib/codexChatSessionFactory.js.map +1 -0
- package/lib/codexChatSessionKey.d.ts +3 -0
- package/lib/codexChatSessionKey.js +14 -0
- package/lib/codexChatSessionKey.js.map +1 -0
- package/lib/codexChatStorage.d.ts +4 -0
- package/lib/codexChatStorage.js +37 -0
- package/lib/codexChatStorage.js.map +1 -0
- package/lib/codexSessionResolver.d.ts +12 -0
- package/lib/codexSessionResolver.js +38 -0
- package/lib/codexSessionResolver.js.map +1 -0
- package/lib/handlers/activitySummarizer.d.ts +15 -0
- package/lib/handlers/activitySummarizer.js +327 -0
- package/lib/handlers/activitySummarizer.js.map +1 -0
- package/lib/handlers/codexMessageTypes.d.ts +30 -0
- package/lib/handlers/codexMessageTypes.js +2 -0
- package/lib/handlers/codexMessageTypes.js.map +1 -0
- package/lib/handlers/codexMessageUtils.d.ts +46 -0
- package/lib/handlers/codexMessageUtils.js +144 -0
- package/lib/handlers/codexMessageUtils.js.map +1 -0
- package/lib/handlers/handleCodexSocketMessage.d.ts +107 -0
- package/lib/handlers/handleCodexSocketMessage.js +78 -0
- package/lib/handlers/handleCodexSocketMessage.js.map +1 -0
- package/lib/handlers/sessionSyncHandler.d.ts +34 -0
- package/lib/handlers/sessionSyncHandler.js +181 -0
- package/lib/handlers/sessionSyncHandler.js.map +1 -0
- package/lib/hooks/useCodexSocket.d.ts +15 -0
- package/lib/hooks/useCodexSocket.js +84 -0
- package/lib/hooks/useCodexSocket.js.map +1 -0
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/panel.d.ts +1 -11
- package/lib/panel.js +1 -2815
- package/lib/panel.js.map +1 -1
- package/lib/protocol.d.ts +235 -0
- package/lib/protocol.js +278 -0
- package/lib/protocol.js.map +1 -0
- package/package.json +13 -3
- package/playwright.config.cjs +27 -0
- package/playwright.unit.config.cjs +19 -0
- package/pyproject.toml +1 -1
- package/release.sh +52 -14
- package/scripts/run_playwright_e2e.sh +96 -0
- package/scripts/run_playwright_freeze_repro.sh +58 -0
- package/scripts/run_playwright_queue_repro.sh +60 -0
- package/scripts/run_playwright_repro.sh +55 -0
- package/src/codexChat.tsx +3914 -0
- package/src/codexChatAttachmentDedup.ts +47 -0
- package/src/codexChatAttachmentLimit.ts +81 -0
- package/src/codexChatAttachmentState.ts +37 -0
- package/src/codexChatDocumentUtils.ts +644 -0
- package/src/codexChatFormatting.ts +94 -0
- package/src/codexChatNotice.ts +95 -0
- package/src/codexChatPersistence.ts +191 -0
- package/src/codexChatPrimitives.tsx +446 -0
- package/src/codexChatRender.tsx +376 -0
- package/src/codexChatSessionFactory.ts +79 -0
- package/src/codexChatSessionKey.ts +16 -0
- package/src/codexChatStorage.ts +36 -0
- package/src/codexSessionResolver.ts +56 -0
- package/src/handlers/activitySummarizer.ts +369 -0
- package/src/handlers/codexMessageTypes.ts +34 -0
- package/src/handlers/codexMessageUtils.ts +217 -0
- package/src/handlers/handleCodexSocketMessage.ts +204 -0
- package/src/handlers/sessionSyncHandler.ts +308 -0
- package/src/hooks/useCodexSocket.ts +109 -0
- package/src/index.ts +1 -1
- package/src/panel.tsx +1 -4184
- package/src/protocol.ts +582 -0
- package/style/index.css +480 -11
- package/test-results/.last-run.json +4 -0
- package/test.py +0 -0
- package/tests/e2e/cell-output-error-tail.spec.js +156 -0
- package/tests/e2e/codex-ui-test-helpers.js +138 -0
- package/tests/e2e/fixtures/notebooks/error-output-tail.ipynb +58 -0
- package/tests/e2e/fixtures/notebooks/error-output-tail.py +19 -0
- package/tests/e2e/fixtures/notebooks/tab1.ipynb +322 -0
- package/tests/e2e/fixtures/notebooks/tab1.py +272 -0
- package/tests/e2e/fixtures/notebooks/tab2.ipynb +252 -0
- package/tests/e2e/fixtures/notebooks/tab2.py +231 -0
- package/tests/e2e/fixtures/notebooks/tab3.ipynb +403 -0
- package/tests/e2e/fixtures/notebooks/tab3.py +331 -0
- package/tests/e2e/fixtures/notebooks/tab4.py +339 -0
- package/tests/e2e/freeze-notebook-tabs-repro.spec.js +295 -0
- package/tests/e2e/mock-codex-cli-flood.py +127 -0
- package/tests/e2e/mock-codex-cli-prompt-echo.py +88 -0
- package/tests/e2e/mock-codex-cli.py +95 -0
- package/tests/e2e/queue-multitab-repro.spec.js +189 -0
- package/tests/test_handlers.py +116 -0
- package/tests/test_protocol.py +169 -0
- package/tests/test_session_store_limits.py +50 -0
- package/tests/unit/codexChatAttachmentDedup.spec.ts +56 -0
- package/tests/unit/codexChatAttachmentLimit.spec.ts +57 -0
- package/tests/unit/codexChatAttachmentState.spec.ts +71 -0
- package/tests/unit/codexChatDocumentUtils.spec.ts +63 -0
- package/tests/unit/codexChatLimit.spec.ts +18 -0
- package/tests/unit/codexChatNotice.spec.ts +45 -0
- package/tests/unit/codexChatPersistence.spec.ts +199 -0
- package/tests/unit/codexChatSessionFactory.spec.ts +94 -0
- package/tests/unit/codexChatSessionKey.spec.ts +18 -0
- package/tests/unit/codexMessageUtils.spec.ts +89 -0
- package/tests/unit/codexSessionResolver.spec.ts +92 -0
- package/tests/unit/handleCodexSocketMessage.spec.ts +476 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/webpack.config.js +6 -0
- package/jupyterlab_codex/labextension/static/504.335f3447c84ba3d74517.js +0 -2
- package/jupyterlab_codex/labextension/static/972.8e856719e40acc1ef4cb.js +0 -1
- package/jupyterlab_codex/labextension/static/remoteEntry.a2982f776a1f0f515640.js +0 -1
- /package/jupyterlab_codex/labextension/static/{504.335f3447c84ba3d74517.js.LICENSE.txt → 525.224526d045c727069de6.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
if [ -z "${BASH_VERSION:-}" ]; then
|
|
4
|
+
exec bash "$0" "$@"
|
|
5
|
+
fi
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
+
cd "$ROOT_DIR"
|
|
11
|
+
|
|
12
|
+
HOST="${JUPYTERLAB_HOST:-127.0.0.1}"
|
|
13
|
+
DEFAULT_PORT="${JUPYTERLAB_PORT:-8888}"
|
|
14
|
+
FALLBACK_PORTS_RAW="${JUPYTERLAB_FALLBACK_PORTS:-$DEFAULT_PORT 8889 8890 8891 8892 8893}"
|
|
15
|
+
if [[ "${PLAYWRIGHT_BASE_URL:-}" != "" ]]; then
|
|
16
|
+
BASE_URL_CANDIDATES=("$PLAYWRIGHT_BASE_URL")
|
|
17
|
+
else
|
|
18
|
+
# shellcheck disable=SC2206
|
|
19
|
+
FALLBACK_PORTS=(${FALLBACK_PORTS_RAW})
|
|
20
|
+
BASE_URL_CANDIDATES=()
|
|
21
|
+
for port in "${FALLBACK_PORTS[@]}"; do
|
|
22
|
+
BASE_URL_CANDIDATES+=("http://${HOST}:${port}/lab")
|
|
23
|
+
done
|
|
24
|
+
fi
|
|
25
|
+
BASE_URL=""
|
|
26
|
+
for candidate in "${BASE_URL_CANDIDATES[@]}"; do
|
|
27
|
+
if curl -fsS "$candidate" >/dev/null 2>&1; then
|
|
28
|
+
BASE_URL="$candidate"
|
|
29
|
+
break
|
|
30
|
+
fi
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
if [[ -z "$BASE_URL" ]]; then
|
|
34
|
+
echo "[playwright] JupyterLab is not reachable."
|
|
35
|
+
if [[ "${PLAYWRIGHT_BASE_URL:-}" != "" ]]; then
|
|
36
|
+
echo "[playwright] Tried: $PLAYWRIGHT_BASE_URL"
|
|
37
|
+
else
|
|
38
|
+
echo "[playwright] Tried: ${FALLBACK_PORTS_RAW}"
|
|
39
|
+
fi
|
|
40
|
+
echo "[playwright] Start JupyterLab first and retry, or run:"
|
|
41
|
+
echo "[playwright] npm run test:e2e:repro-local"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "[playwright] running queue reproduction e2e against $BASE_URL"
|
|
46
|
+
if [ -x "$ROOT_DIR/node_modules/.bin/playwright" ]; then
|
|
47
|
+
env \
|
|
48
|
+
PLAYWRIGHT_BASE_URL="$BASE_URL" \
|
|
49
|
+
PLAYWRIGHT_CODEX_COMMAND="${PLAYWRIGHT_CODEX_COMMAND:-$ROOT_DIR/tests/e2e/mock-codex-cli.py}" \
|
|
50
|
+
MOCK_CODEX_DELAY_MS="${MOCK_CODEX_DELAY_MS:-2600}" \
|
|
51
|
+
"$ROOT_DIR/node_modules/.bin/playwright" \
|
|
52
|
+
test tests/e2e/queue-multitab-repro.spec.js "$@"
|
|
53
|
+
else
|
|
54
|
+
env \
|
|
55
|
+
PLAYWRIGHT_BASE_URL="$BASE_URL" \
|
|
56
|
+
PLAYWRIGHT_CODEX_COMMAND="${PLAYWRIGHT_CODEX_COMMAND:-$ROOT_DIR/tests/e2e/mock-codex-cli.py}" \
|
|
57
|
+
MOCK_CODEX_DELAY_MS="${MOCK_CODEX_DELAY_MS:-2600}" \
|
|
58
|
+
npx playwright \
|
|
59
|
+
test tests/e2e/queue-multitab-repro.spec.js "$@"
|
|
60
|
+
fi
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
if [ -z "${BASH_VERSION:-}" ]; then
|
|
4
|
+
exec bash "$0" "$@"
|
|
5
|
+
fi
|
|
6
|
+
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
10
|
+
cd "$ROOT_DIR"
|
|
11
|
+
|
|
12
|
+
PORT="${JUPYTERLAB_PORT:-8888}"
|
|
13
|
+
HOST="${JUPYTERLAB_HOST:-127.0.0.1}"
|
|
14
|
+
BASE_URL="${PLAYWRIGHT_BASE_URL:-http://${HOST}:${PORT}/lab}"
|
|
15
|
+
MOCK_CODEX="${PLAYWRIGHT_CODEX_COMMAND:-$ROOT_DIR/tests/e2e/mock-codex-cli.py}"
|
|
16
|
+
LOG_FILE="${PLAYWRIGHT_JUPYTER_LOG:-$ROOT_DIR/.jupyterlab-playwright.log}"
|
|
17
|
+
|
|
18
|
+
cleanup() {
|
|
19
|
+
if [ -n "${JUPYTER_PID:-}" ] && kill -0 "$JUPYTER_PID" >/dev/null 2>&1; then
|
|
20
|
+
kill "$JUPYTER_PID" >/dev/null 2>&1 || true
|
|
21
|
+
wait "$JUPYTER_PID" >/dev/null 2>&1 || true
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
trap cleanup EXIT
|
|
25
|
+
|
|
26
|
+
echo "[playwright] launching JupyterLab on ${BASE_URL}"
|
|
27
|
+
jupyter lab \
|
|
28
|
+
--no-browser \
|
|
29
|
+
--ServerApp.open_browser=False \
|
|
30
|
+
--ServerApp.port="$PORT" \
|
|
31
|
+
--ServerApp.ip="$HOST" \
|
|
32
|
+
--IdentityProvider.token='' \
|
|
33
|
+
--ServerApp.token='' \
|
|
34
|
+
--ServerApp.password='' \
|
|
35
|
+
>"$LOG_FILE" 2>&1 &
|
|
36
|
+
JUPYTER_PID=$!
|
|
37
|
+
|
|
38
|
+
echo "[playwright] waiting for JupyterLab to be ready..."
|
|
39
|
+
for _ in $(seq 1 60); do
|
|
40
|
+
if curl -fsS "$BASE_URL" >/dev/null 2>&1; then
|
|
41
|
+
break
|
|
42
|
+
fi
|
|
43
|
+
sleep 1
|
|
44
|
+
done
|
|
45
|
+
|
|
46
|
+
if ! curl -fsS "$BASE_URL" >/dev/null 2>&1; then
|
|
47
|
+
echo "[playwright] JupyterLab failed to start. Log: $LOG_FILE"
|
|
48
|
+
exit 1
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
echo "[playwright] running queue reproduction e2e"
|
|
52
|
+
PLAYWRIGHT_BASE_URL="$BASE_URL" \
|
|
53
|
+
PLAYWRIGHT_CODEX_COMMAND="$MOCK_CODEX" \
|
|
54
|
+
MOCK_CODEX_DELAY_MS="${MOCK_CODEX_DELAY_MS:-2600}" \
|
|
55
|
+
jlpm test:e2e:queue-repro "$@"
|