overleaf-codex 0.1.0-rc.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.
Potentially problematic release.
This version of overleaf-codex might be problematic. Click here for more details.
- package/LICENSE +21 -0
- package/NOTICE.md +25 -0
- package/README.md +217 -0
- package/assets/olcx-mark.svg +22 -0
- package/dist/auth/projectAuth.d.ts +19 -0
- package/dist/auth/projectAuth.js +163 -0
- package/dist/auth/projectAuth.js.map +1 -0
- package/dist/auth/redact.d.ts +3 -0
- package/dist/auth/redact.js +7 -0
- package/dist/auth/redact.js.map +1 -0
- package/dist/auth/types.d.ts +10 -0
- package/dist/auth/types.js +4 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/backend/index.d.ts +6 -0
- package/dist/backend/index.js +2 -0
- package/dist/backend/index.js.map +1 -0
- package/dist/backend/olcli/client.d.ts +329 -0
- package/dist/backend/olcli/client.js +1757 -0
- package/dist/backend/olcli/client.js.map +1 -0
- package/dist/backend/olcli/index.d.ts +2 -0
- package/dist/backend/olcli/index.js +2 -0
- package/dist/backend/olcli/index.js.map +1 -0
- package/dist/backend/overleafBackend.d.ts +41 -0
- package/dist/backend/overleafBackend.js +200 -0
- package/dist/backend/overleafBackend.js.map +1 -0
- package/dist/backend/types.d.ts +73 -0
- package/dist/backend/types.js +2 -0
- package/dist/backend/types.js.map +1 -0
- package/dist/cli-behavior.d.ts +14 -0
- package/dist/cli-behavior.js +59 -0
- package/dist/cli-behavior.js.map +1 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.js +441 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +21 -0
- package/dist/commands/auth.js +104 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/compile.d.ts +7 -0
- package/dist/commands/compile.js +73 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/doctor.d.ts +11 -0
- package/dist/commands/doctor.js +9 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/endpoint.d.ts +23 -0
- package/dist/commands/endpoint.js +69 -0
- package/dist/commands/endpoint.js.map +1 -0
- package/dist/commands/init.d.ts +14 -0
- package/dist/commands/init.js +48 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/status.d.ts +4 -0
- package/dist/commands/status.js +5 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +26 -0
- package/dist/commands/sync.js +139 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/watch.d.ts +28 -0
- package/dist/commands/watch.js +124 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/compile/compileFlow.d.ts +32 -0
- package/dist/compile/compileFlow.js +290 -0
- package/dist/compile/compileFlow.js.map +1 -0
- package/dist/compile/pdfOutput.d.ts +12 -0
- package/dist/compile/pdfOutput.js +64 -0
- package/dist/compile/pdfOutput.js.map +1 -0
- package/dist/config/ignoreRules.d.ts +5 -0
- package/dist/config/ignoreRules.js +53 -0
- package/dist/config/ignoreRules.js.map +1 -0
- package/dist/config/overleafProject.d.ts +9 -0
- package/dist/config/overleafProject.js +61 -0
- package/dist/config/overleafProject.js.map +1 -0
- package/dist/config/projectConfig.d.ts +6 -0
- package/dist/config/projectConfig.js +180 -0
- package/dist/config/projectConfig.js.map +1 -0
- package/dist/config/projectRoot.d.ts +1 -0
- package/dist/config/projectRoot.js +36 -0
- package/dist/config/projectRoot.js.map +1 -0
- package/dist/config/types.d.ts +50 -0
- package/dist/config/types.js +34 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/vscode.d.ts +10 -0
- package/dist/config/vscode.js +134 -0
- package/dist/config/vscode.js.map +1 -0
- package/dist/diagnostics/doctor.d.ts +8 -0
- package/dist/diagnostics/doctor.js +209 -0
- package/dist/diagnostics/doctor.js.map +1 -0
- package/dist/diagnostics/status.d.ts +6 -0
- package/dist/diagnostics/status.js +110 -0
- package/dist/diagnostics/status.js.map +1 -0
- package/dist/diagnostics/types.d.ts +33 -0
- package/dist/diagnostics/types.js +2 -0
- package/dist/diagnostics/types.js.map +1 -0
- package/dist/endpoint/overleafEndpoint.d.ts +36 -0
- package/dist/endpoint/overleafEndpoint.js +105 -0
- package/dist/endpoint/overleafEndpoint.js.map +1 -0
- package/dist/errors.d.ts +32 -0
- package/dist/errors.js +53 -0
- package/dist/errors.js.map +1 -0
- package/dist/sync/apply.d.ts +14 -0
- package/dist/sync/apply.js +92 -0
- package/dist/sync/apply.js.map +1 -0
- package/dist/sync/conflicts.d.ts +7 -0
- package/dist/sync/conflicts.js +59 -0
- package/dist/sync/conflicts.js.map +1 -0
- package/dist/sync/ignore.d.ts +5 -0
- package/dist/sync/ignore.js +74 -0
- package/dist/sync/ignore.js.map +1 -0
- package/dist/sync/plan.d.ts +3 -0
- package/dist/sync/plan.js +197 -0
- package/dist/sync/plan.js.map +1 -0
- package/dist/sync/snapshot.d.ts +13 -0
- package/dist/sync/snapshot.js +82 -0
- package/dist/sync/snapshot.js.map +1 -0
- package/dist/sync/state.d.ts +16 -0
- package/dist/sync/state.js +214 -0
- package/dist/sync/state.js.map +1 -0
- package/dist/sync/types.d.ts +113 -0
- package/dist/sync/types.js +4 -0
- package/dist/sync/types.js.map +1 -0
- package/dist/testing/fakeBackend.d.ts +27 -0
- package/dist/testing/fakeBackend.js +213 -0
- package/dist/testing/fakeBackend.js.map +1 -0
- package/dist/watch/queue.d.ts +2 -0
- package/dist/watch/queue.js +91 -0
- package/dist/watch/queue.js.map +1 -0
- package/dist/watch/types.d.ts +52 -0
- package/dist/watch/types.js +2 -0
- package/dist/watch/types.js.map +1 -0
- package/dist/watch/watcher.d.ts +6 -0
- package/dist/watch/watcher.js +58 -0
- package/dist/watch/watcher.js.map +1 -0
- package/dist/watch/workflow.d.ts +30 -0
- package/dist/watch/workflow.js +62 -0
- package/dist/watch/workflow.js.map +1 -0
- package/docs/architecture.md +603 -0
- package/docs/auth.md +65 -0
- package/docs/cli-behavior.md +95 -0
- package/docs/compile.md +51 -0
- package/docs/design.md +82 -0
- package/docs/endpoint.md +84 -0
- package/docs/npm-packaging.md +148 -0
- package/docs/quickdev-queue-audit.md +193 -0
- package/docs/release-gates.md +119 -0
- package/docs/release-notes-v1.md +97 -0
- package/docs/security.md +61 -0
- package/docs/sync-state.md +305 -0
- package/docs/sync.md +50 -0
- package/docs/troubleshooting.md +124 -0
- package/docs/usage.md +184 -0
- package/examples/minimal-paper/.olcx/auth.local.example.json +7 -0
- package/examples/minimal-paper/.olcx/config.json +23 -0
- package/examples/minimal-paper/README.md +88 -0
- package/examples/minimal-paper/main.tex +23 -0
- package/package.json +66 -0
- package/src/backend/olcli/LICENSE +21 -0
- package/src/backend/olcli/README.md +26 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Troubleshooting
|
|
2
|
+
|
|
3
|
+
Use `olcx status` and `olcx doctor` first. They are local checks and do not
|
|
4
|
+
contact Overleaf by default.
|
|
5
|
+
|
|
6
|
+
For workflow detail, see [Auth](auth.md), [Sync](sync.md), and
|
|
7
|
+
[Compile](compile.md).
|
|
8
|
+
|
|
9
|
+
## Auth Failure
|
|
10
|
+
|
|
11
|
+
Symptoms: `AUTH_ERROR`, missing `.olcx/auth.local.json`, invalid local auth, or
|
|
12
|
+
Overleaf rejecting the current session.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
olcx status
|
|
16
|
+
olcx doctor
|
|
17
|
+
export OLCX_OVERLEAF_SESSION='<replace-with-session-cookie>'
|
|
18
|
+
olcx auth --from-env OLCX_OVERLEAF_SESSION
|
|
19
|
+
unset OLCX_OVERLEAF_SESSION
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Next actions: regenerate project-local auth, keep `.olcx/auth.local.json`
|
|
23
|
+
ignored, and retry the command that failed. Do not paste cookies into tracked
|
|
24
|
+
docs, issues, tests, or handoff files.
|
|
25
|
+
|
|
26
|
+
## Project Binding Failure
|
|
27
|
+
|
|
28
|
+
Symptoms: missing `.olcx/config.json`, invalid config, or a repository already
|
|
29
|
+
bound to a different Overleaf project.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
olcx status
|
|
33
|
+
cat .olcx/config.json
|
|
34
|
+
olcx init --project https://www.overleaf.com/project/<your-project-id>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Next actions: confirm you are in the intended paper repository. If the repo is
|
|
38
|
+
already bound to another project, edit `.olcx/config.json` intentionally or use a
|
|
39
|
+
fresh repository; `olcx init` will not silently rebind it.
|
|
40
|
+
|
|
41
|
+
## Sync Conflict
|
|
42
|
+
|
|
43
|
+
Symptoms: `SYNC_CONFLICT`, watch paused after sync, or a conflict report under
|
|
44
|
+
`.olcx/state/conflicts.json`.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
olcx sync --dry-run
|
|
48
|
+
cat .olcx/state/conflicts.json
|
|
49
|
+
olcx sync
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Next actions: review each listed path locally and in Overleaf, choose local,
|
|
53
|
+
remote, or a manual merge, then rerun `olcx sync --dry-run`. Run `olcx sync`
|
|
54
|
+
only after the dry run is clean.
|
|
55
|
+
|
|
56
|
+
## Compile Failure
|
|
57
|
+
|
|
58
|
+
Symptoms: `COMPILE_FAILED`, `COMPILE_TIMEOUT`, missing package errors, or fast
|
|
59
|
+
fallback warnings.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
olcx compile
|
|
63
|
+
olcx compile --disable-fast-fallback
|
|
64
|
+
olcx compile --fast-fallback-timeout 60000
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Next actions: inspect the compile log summary printed by `olcx compile`, fix the
|
|
68
|
+
LaTeX source on Overleaf or locally, and retry. `olcx` does not require local
|
|
69
|
+
LaTeX for the core workflow.
|
|
70
|
+
|
|
71
|
+
## PDF Not Updated
|
|
72
|
+
|
|
73
|
+
Symptoms: compile succeeds but the preview still shows an old PDF, or
|
|
74
|
+
`build/overleaf/main.pdf` is missing.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
olcx compile
|
|
78
|
+
ls -l build/overleaf/main.pdf
|
|
79
|
+
olcx status
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Next actions: confirm `pdfPath` in `.olcx/config.json` is
|
|
83
|
+
`build/overleaf/main.pdf` or the path you expect, then open that exact file in
|
|
84
|
+
your previewer. If the file timestamp does not change, rerun `olcx compile` and
|
|
85
|
+
check for PDF retrieval errors.
|
|
86
|
+
|
|
87
|
+
## Watch Loop
|
|
88
|
+
|
|
89
|
+
Symptoms: `olcx watch` repeatedly reacts to generated files, pauses after a
|
|
90
|
+
workflow failure, or keeps compiling when no paper source changed.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
olcx watch --debounce 2500
|
|
94
|
+
olcx sync --dry-run
|
|
95
|
+
olcx compile
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Next actions: confirm `.gitignore` contains `build/overleaf/`, `.olcx/state/`,
|
|
99
|
+
`.olcx/auth.local.json`, `.olcx/*.local.json`, `.olcx/*.secret.json`,
|
|
100
|
+
`*.local.json`, and `*.secret.json`. Stop watch, fix the sync or compile issue
|
|
101
|
+
manually, then restart `olcx watch`.
|
|
102
|
+
|
|
103
|
+
## Network Problems
|
|
104
|
+
|
|
105
|
+
Symptoms: `NETWORK_ERROR`, backend protocol errors, timeouts while talking to
|
|
106
|
+
Overleaf, or commands that fail only when remote access is needed.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
olcx endpoint status
|
|
110
|
+
olcx endpoint test
|
|
111
|
+
olcx endpoint set cn
|
|
112
|
+
olcx endpoint test --apply
|
|
113
|
+
olcx doctor
|
|
114
|
+
olcx sync --dry-run
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Next actions: check local network access, proxy or firewall settings, and
|
|
118
|
+
Overleaf availability. `olcx endpoint test` probes only public `/project`
|
|
119
|
+
reachability for `https://www.overleaf.com` and `https://cn.overleaf.com`.
|
|
120
|
+
`olcx endpoint set cn` and `olcx endpoint test --apply` update
|
|
121
|
+
`overleaf.baseUrl` in `.olcx/config.json`. Retry the failing command after
|
|
122
|
+
network access is restored. `olcx doctor` is offline by default, so a passing
|
|
123
|
+
doctor result does not prove the current Overleaf session or network path is
|
|
124
|
+
valid.
|
package/docs/usage.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Usage
|
|
2
|
+
|
|
3
|
+
This page shows the common install, bind, auth, sync, compile, and watch flow for
|
|
4
|
+
one local paper repository bound to one Overleaf project.
|
|
5
|
+
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
Published package:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g overleaf-codex
|
|
12
|
+
olcx --help
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Local checkout:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install
|
|
19
|
+
npm run build
|
|
20
|
+
npm link
|
|
21
|
+
olcx --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Users do not need to install `olcli` separately, and the core workflow does not
|
|
25
|
+
require local LaTeX.
|
|
26
|
+
|
|
27
|
+
## Bind
|
|
28
|
+
|
|
29
|
+
From a paper repository:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
olcx init --project https://www.overleaf.com/project/<overleaf-project-id>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This creates `.olcx/config.json`, updates ignore rules for local secrets and
|
|
36
|
+
generated PDF output, and creates or merges local VS Code settings/tasks by
|
|
37
|
+
default. The default binding model is one paper repository to one Overleaf
|
|
38
|
+
project.
|
|
39
|
+
|
|
40
|
+
## Authorize
|
|
41
|
+
|
|
42
|
+
Interactive terminal:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
olcx auth
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Headless Linux/macOS shell:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
export OLCX_OVERLEAF_SESSION='<copied-session-cookie>'
|
|
52
|
+
olcx auth --from-env OLCX_OVERLEAF_SESSION
|
|
53
|
+
unset OLCX_OVERLEAF_SESSION
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Headless Windows PowerShell:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
$env:OLCX_OVERLEAF_SESSION = '<copied-session-cookie>'
|
|
60
|
+
olcx auth --from-env OLCX_OVERLEAF_SESSION
|
|
61
|
+
Remove-Item Env:OLCX_OVERLEAF_SESSION
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
One-shot paste:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
olcx auth --cookie '<copied-session-cookie>'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Auth is stored in `.olcx/auth.local.json` for the current paper repository only.
|
|
71
|
+
That file is ignored by Git.
|
|
72
|
+
|
|
73
|
+
## Inspect
|
|
74
|
+
|
|
75
|
+
Use local diagnostics before changing remote state:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
olcx status
|
|
79
|
+
olcx doctor
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`olcx status` summarizes binding, auth presence, and sync state. `olcx doctor`
|
|
83
|
+
checks local prerequisites and config without requiring a local LaTeX
|
|
84
|
+
installation.
|
|
85
|
+
|
|
86
|
+
## Endpoint
|
|
87
|
+
|
|
88
|
+
Inspect and choose the Overleaf web endpoint for this paper repository:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
olcx endpoint status
|
|
92
|
+
olcx endpoint test
|
|
93
|
+
olcx endpoint set cn
|
|
94
|
+
olcx endpoint test --apply
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The configured value is stored as `overleaf.baseUrl` in `.olcx/config.json` and
|
|
98
|
+
is either `https://www.overleaf.com` or `https://cn.overleaf.com`. `olcx
|
|
99
|
+
endpoint test` is read-only by default and probes only public `/project`
|
|
100
|
+
reachability. `olcx endpoint test --apply` is the only automatic selection mode;
|
|
101
|
+
it writes config only when at least one endpoint is available.
|
|
102
|
+
|
|
103
|
+
## Manual Sync
|
|
104
|
+
|
|
105
|
+
Always preview remote-changing operations first:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
olcx sync --dry-run
|
|
109
|
+
olcx sync
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
If `olcx` reports `SYNC_CONFLICT`, review `.olcx/state/conflicts.json` and
|
|
113
|
+
resolve the listed files intentionally before rerunning `olcx sync --dry-run`.
|
|
114
|
+
Sync must not silently overwrite local or remote changes.
|
|
115
|
+
|
|
116
|
+
## Manual Compile
|
|
117
|
+
|
|
118
|
+
Compile on Overleaf and download the PDF:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
olcx compile
|
|
122
|
+
olcx compile --pdf build/overleaf/main.pdf
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The default PDF path is:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
build/overleaf/main.pdf
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Watch
|
|
132
|
+
|
|
133
|
+
Run the normal authoring loop:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
olcx watch
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The watcher detects local file changes, debounces them, runs sync, compiles on
|
|
140
|
+
Overleaf, and downloads the PDF. Generated PDFs, `.olcx/state/`, and local auth
|
|
141
|
+
files are ignored so the watch loop does not react to its own outputs.
|
|
142
|
+
|
|
143
|
+
## Headless Use
|
|
144
|
+
|
|
145
|
+
Set `OLCX_NON_INTERACTIVE=1` or `CI=true` when a command must fail fast instead
|
|
146
|
+
of prompting for auth input. For real Overleaf E2E smoke checks that should not
|
|
147
|
+
read a developer machine's `.env.e2e.local`, run:
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
OLCX_E2E_IGNORE_LOCAL_ENV=1 OLCX_E2E_ENABLE_REAL=0 npm run test:e2e:real
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Conflict Handling
|
|
154
|
+
|
|
155
|
+
When sync detects both local and remote edits to the same path, it exits with
|
|
156
|
+
`SYNC_CONFLICT`, writes `.olcx/state/conflicts.json`, and leaves both sides
|
|
157
|
+
unchanged. Inspect the report, merge or choose the intended content manually,
|
|
158
|
+
then confirm with:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
olcx sync --dry-run
|
|
162
|
+
cat .olcx/state/conflicts.json
|
|
163
|
+
olcx sync
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Platform Notes
|
|
167
|
+
|
|
168
|
+
`olcx watch` uses Node and chokidar. It listens for local `add`, `change`, and
|
|
169
|
+
`unlink` events, normalizes Windows and POSIX paths to repository-relative
|
|
170
|
+
`/`-separated paths, then runs one sync/compile cycle at a time.
|
|
171
|
+
|
|
172
|
+
Ctrl-C sends `SIGINT` in common Linux, macOS, and Windows terminals. `olcx watch`
|
|
173
|
+
also handles `SIGTERM` for process managers. Filesystem watchers can coalesce or
|
|
174
|
+
delay events on network drives, WSL, and synced folders, so use `olcx sync
|
|
175
|
+
--dry-run` and `olcx compile` when debugging a paused watch loop.
|
|
176
|
+
|
|
177
|
+
## More Detail
|
|
178
|
+
|
|
179
|
+
- [Auth](auth.md)
|
|
180
|
+
- [Endpoint](endpoint.md)
|
|
181
|
+
- [Sync](sync.md)
|
|
182
|
+
- [Compile](compile.md)
|
|
183
|
+
- [Troubleshooting](troubleshooting.md)
|
|
184
|
+
- [npm Packaging](npm-packaging.md)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"projectId": "<overleaf-project-id>",
|
|
4
|
+
"projectUrl": "https://www.overleaf.com/project/<overleaf-project-id>",
|
|
5
|
+
"overleaf": {
|
|
6
|
+
"baseUrl": "https://www.overleaf.com"
|
|
7
|
+
},
|
|
8
|
+
"rootDocument": "main.tex",
|
|
9
|
+
"pdfPath": "build/overleaf/main.pdf",
|
|
10
|
+
"sync": {
|
|
11
|
+
"mode": "bidirectional",
|
|
12
|
+
"conflictPolicy": "pause",
|
|
13
|
+
"ignore": []
|
|
14
|
+
},
|
|
15
|
+
"compile": {
|
|
16
|
+
"timeoutMs": 120000,
|
|
17
|
+
"fastFallback": {
|
|
18
|
+
"enabled": true,
|
|
19
|
+
"attempts": 1,
|
|
20
|
+
"timeoutMs": 30000
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Minimal Paper Example
|
|
2
|
+
|
|
3
|
+
This is a sanitized olcx paper repository example. It is safe to inspect because
|
|
4
|
+
`.olcx/config.json` uses `<overleaf-project-id>` and the real local auth file
|
|
5
|
+
`.olcx/auth.local.json` is not included.
|
|
6
|
+
|
|
7
|
+
The example does not contact Overleaf by default. Commands that need Overleaf,
|
|
8
|
+
such as `olcx sync`, `olcx compile`, and `olcx watch`, require you to replace the
|
|
9
|
+
placeholder project id and create local auth first.
|
|
10
|
+
|
|
11
|
+
## Files
|
|
12
|
+
|
|
13
|
+
- `main.tex` is a minimal paper source with generic example text.
|
|
14
|
+
- `.olcx/config.json` is the shareable olcx project config.
|
|
15
|
+
- `.olcx/auth.local.example.json` shows the auth file shape without a usable
|
|
16
|
+
cookie.
|
|
17
|
+
- `.gitignore` keeps `.olcx/auth.local.json`, other local or secret JSON files,
|
|
18
|
+
local environment files, `.olcx/state/`, LaTeX build artifacts, and
|
|
19
|
+
`build/overleaf/` out of Git.
|
|
20
|
+
|
|
21
|
+
## Config
|
|
22
|
+
|
|
23
|
+
`.olcx/config.json` binds one local paper repository to one Overleaf project:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"projectId": "<overleaf-project-id>",
|
|
28
|
+
"overleaf": {
|
|
29
|
+
"baseUrl": "https://www.overleaf.com"
|
|
30
|
+
},
|
|
31
|
+
"rootDocument": "main.tex",
|
|
32
|
+
"pdfPath": "build/overleaf/main.pdf"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Replace `<overleaf-project-id>` and `projectUrl` with your own Overleaf project
|
|
37
|
+
before running Overleaf-backed commands. If this is your real paper repository,
|
|
38
|
+
the safer path is to run:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
olcx init --project https://www.overleaf.com/project/<your-project-id>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Use `olcx endpoint set cn` if this paper repository should use
|
|
45
|
+
`https://cn.overleaf.com` instead.
|
|
46
|
+
|
|
47
|
+
## Auth
|
|
48
|
+
|
|
49
|
+
Real auth belongs only in `.olcx/auth.local.json`, which must stay ignored by
|
|
50
|
+
Git. The tracked file `.olcx/auth.local.example.json` is only a shape example.
|
|
51
|
+
|
|
52
|
+
For a headless shell:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
export OLCX_OVERLEAF_SESSION='<replace-with-session-cookie>'
|
|
56
|
+
olcx auth --from-env OLCX_OVERLEAF_SESSION
|
|
57
|
+
unset OLCX_OVERLEAF_SESSION
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For an interactive terminal:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
olcx auth
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## PDF Output
|
|
67
|
+
|
|
68
|
+
Remote compilation downloads the PDF to:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
build/overleaf/main.pdf
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
That path is generated output and is ignored by Git.
|
|
75
|
+
|
|
76
|
+
## Watch Flow
|
|
77
|
+
|
|
78
|
+
After replacing the placeholder project binding and authenticating:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
olcx sync --dry-run
|
|
82
|
+
olcx compile
|
|
83
|
+
olcx watch
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`olcx watch` detects local edits, runs safe sync, compiles on Overleaf, downloads
|
|
87
|
+
`build/overleaf/main.pdf`, and ignores that generated PDF so it does not trigger
|
|
88
|
+
a watch loop.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
\documentclass{article}
|
|
2
|
+
|
|
3
|
+
\title{olcx Minimal Example}
|
|
4
|
+
\author{Example Author}
|
|
5
|
+
\date{}
|
|
6
|
+
|
|
7
|
+
\begin{document}
|
|
8
|
+
|
|
9
|
+
\maketitle
|
|
10
|
+
|
|
11
|
+
\section{Purpose}
|
|
12
|
+
|
|
13
|
+
This sanitized paper exists only to demonstrate an olcx project layout. It does
|
|
14
|
+
not contain private research notes, real account data, or a real Overleaf
|
|
15
|
+
project id.
|
|
16
|
+
|
|
17
|
+
\section{Workflow}
|
|
18
|
+
|
|
19
|
+
Edit this file locally, run \texttt{olcx watch} after replacing the placeholder
|
|
20
|
+
project binding and adding project-local auth, then preview the downloaded PDF
|
|
21
|
+
at \texttt{build/overleaf/main.pdf}.
|
|
22
|
+
|
|
23
|
+
\end{document}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "overleaf-codex",
|
|
3
|
+
"version": "0.1.0-rc.1",
|
|
4
|
+
"description": "Local Git, VS Code, and Codex workflow bridge for Overleaf-backed LaTeX compilation.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/umiskky/overleaf-codex.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/umiskky/overleaf-codex/issues"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/umiskky/overleaf-codex#readme",
|
|
14
|
+
"bin": {
|
|
15
|
+
"olcx": "dist/cli.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"assets",
|
|
19
|
+
"dist",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"NOTICE.md",
|
|
23
|
+
"docs",
|
|
24
|
+
"examples",
|
|
25
|
+
"src/backend/olcli/LICENSE",
|
|
26
|
+
"src/backend/olcli/README.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"dev": "tsx src/cli.ts",
|
|
31
|
+
"e2e:real": "tsx scripts/run-real-overleaf-e2e.ts",
|
|
32
|
+
"prepublish:check": "tsx scripts/prepublish-check.ts",
|
|
33
|
+
"prepublishOnly": "npm run prepublish:check",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:e2e:real": "vitest run --reporter=verbose tests/e2e/real-overleaf.e2e.ts",
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"overleaf",
|
|
40
|
+
"latex",
|
|
41
|
+
"codex",
|
|
42
|
+
"vscode",
|
|
43
|
+
"cli",
|
|
44
|
+
"pdf",
|
|
45
|
+
"sync"
|
|
46
|
+
],
|
|
47
|
+
"author": "",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"sideEffects": false,
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=20"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"adm-zip": "0.5.16",
|
|
55
|
+
"cheerio": "1.0.0",
|
|
56
|
+
"chokidar": "^4.0.3",
|
|
57
|
+
"commander": "^12.1.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/adm-zip": "0.5.7",
|
|
61
|
+
"@types/node": "^22.0.0",
|
|
62
|
+
"tsx": "^4.7.0",
|
|
63
|
+
"typescript": "^5.4.0",
|
|
64
|
+
"vitest": "^4.1.9"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexander Loth
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# olcli Backend Source
|
|
2
|
+
|
|
3
|
+
This directory contains backend-private code copied or adapted from `@aloth/olcli@0.5.0`.
|
|
4
|
+
|
|
5
|
+
- Source repository: https://github.com/aloth/olcli
|
|
6
|
+
- Source tag: `v0.5.0`
|
|
7
|
+
- Source commit: `524c30b11328a847a9c0bcf4447d2b3468160f8c`
|
|
8
|
+
- npm tarball: https://registry.npmjs.org/@aloth/olcli/-/olcli-0.5.0.tgz
|
|
9
|
+
- npm integrity: `sha512-kFstYGK6htjDiOlX0H/nmjzugwRYN2RlBufK+bAA648h21GqQOVxeHr5po2ybwxetoccT9ky3YV2ch7c3b6GmQ==`
|
|
10
|
+
- Upstream file: `src/client.ts`
|
|
11
|
+
- olcx file: `src/backend/olcli/client.ts`
|
|
12
|
+
- License: MIT
|
|
13
|
+
- Copyright: Copyright (c) 2026 Alexander Loth
|
|
14
|
+
|
|
15
|
+
The upstream MIT license text is copied in `src/backend/olcli/LICENSE`.
|
|
16
|
+
|
|
17
|
+
## olcx Adaptations
|
|
18
|
+
|
|
19
|
+
- The upstream `src/client.ts` file was moved into the backend-private `src/backend/olcli/` directory.
|
|
20
|
+
- The import-time upstream `package.json` version lookup was removed so the built package can import the module without requiring an adjacent source `package.json`.
|
|
21
|
+
- The user agent is fixed as `olcx/0.1.0 olcli/0.5.0`.
|
|
22
|
+
- Upstream CLI, MCP server, global `Conf` config, global auth-file behavior, and ignore helper entrypoints were not copied.
|
|
23
|
+
|
|
24
|
+
Only backend adapter modules may import from this directory. Commands, sync, compile, watch, diagnostics, and tests for public behavior should depend on the stable `OverleafBackend` adapter introduced by the later backend adapter task.
|
|
25
|
+
|
|
26
|
+
`olcx` is not an official Overleaf project and is not an official `olcli` project.
|