codex-overleaf-link 2.5.0 → 2.6.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/README.md +155 -392
- package/README.zh-CN.md +154 -393
- package/extension/bootstrap/background.js +52 -9
- package/extension/bootstrap/manifest.template.json +1 -1
- package/extension/bootstrap/popup.html +1 -0
- package/extension/bootstrap/popupFallback.js +55 -0
- package/extension/bootstrap/updateStatus.js +1 -0
- package/extension/src/background.js +283 -55
- package/extension/src/backgroundBootstrapMigration.js +181 -0
- package/extension/src/backgroundSharedSessions.js +129 -16
- package/extension/src/backgroundUpdateCoordinator.js +242 -29
- package/extension/src/backgroundUpdateSafety.js +173 -0
- package/extension/src/content/activeTurnControl.js +171 -8
- package/extension/src/content/applyResultFormatters.js +46 -73
- package/extension/src/content/assetTransferBroker.js +72 -14
- package/extension/src/content/composerAttachments.js +104 -47
- package/extension/src/content/composerPanel.js +110 -12
- package/extension/src/content/contentRuntime.js +1555 -926
- package/extension/src/content/contextTray.js +8 -2
- package/extension/src/content/contextUsageView.js +267 -0
- package/extension/src/content/diagnosticsController.js +122 -96
- package/extension/src/content/diagnosticsExport.js +19 -5
- package/extension/src/content/diagnosticsPanel.js +48 -0
- package/extension/src/content/directoryCleanupRecovery.js +54 -0
- package/extension/src/content/generated/content.bundle.js +11077 -3412
- package/extension/src/content/generated/content.bundle.meta.json +14 -3
- package/extension/src/content/globalPreferencesController.js +1 -1
- package/extension/src/content/legacyGlobalRegistry.js +10 -0
- package/extension/src/content/localSkillsPanel.js +104 -14
- package/extension/src/content/markdownDomRenderer.js +5 -3
- package/extension/src/content/markdownText.js +47 -11
- package/extension/src/content/modelPicker.js +8 -4
- package/extension/src/content/nativeCompatibilityController.js +74 -30
- package/extension/src/content/otWarmMirror.js +5 -6
- package/extension/src/content/otWarmMirrorController.js +17 -20
- package/extension/src/content/pageBridgeClient.js +17 -4
- package/extension/src/content/panelMaintenance.js +46 -14
- package/extension/src/content/panelRenderer.js +57 -27
- package/extension/src/content/pendingInputView.js +1 -1
- package/extension/src/content/projectProviderSelection.js +13 -4
- package/extension/src/content/projectSessionCleanup.js +109 -62
- package/extension/src/content/projectSettingsCoordinator.js +67 -6
- package/extension/src/content/providerSettingsCoordinator.js +46 -8
- package/extension/src/content/providerSettingsDialog.js +73 -14
- package/extension/src/content/recentProjects.js +15 -8
- package/extension/src/content/runActivitySummary.js +160 -18
- package/extension/src/content/runCompletionMeta.js +532 -0
- package/extension/src/content/runController.js +39 -15
- package/extension/src/content/runFailureNotice.js +29 -13
- package/extension/src/content/runGuidanceController.js +72 -27
- package/extension/src/content/runGuidanceView.js +59 -10
- package/extension/src/content/runPresence.js +18 -8
- package/extension/src/content/runQueueScheduler.js +157 -47
- package/extension/src/content/runRecoveryActions.js +147 -0
- package/extension/src/content/runResultActions.js +28 -143
- package/extension/src/content/runReviewController.js +633 -0
- package/extension/src/content/runScrollLayout.js +21 -2
- package/extension/src/content/runTimelineView.js +367 -175
- package/extension/src/content/scopedPersistencePanelState.js +134 -20
- package/extension/src/content/selectionContextView.js +1 -1
- package/extension/src/content/sensitivePreflight.js +153 -0
- package/extension/src/content/sessionForkController.js +80 -17
- package/extension/src/content/sessionManager.js +50 -4
- package/extension/src/content/sessionMenuView.js +54 -18
- package/extension/src/content/sessionPersistence.js +25 -5
- package/extension/src/content/settingsPanel.js +22 -5
- package/extension/src/content/settingsWorkbench.js +132 -89
- package/extension/src/content/sharedSessionViewSync.js +49 -11
- package/extension/src/content/subagentActivityView.js +23 -7
- package/extension/src/content/updateIdle.js +4 -1
- package/extension/src/content/updateNotice.js +118 -12
- package/extension/src/content/updateSafetyReceiver.js +58 -0
- package/extension/src/content/writebackController.js +53 -4
- package/extension/src/content/writebackOrchestrator.js +116 -94
- package/extension/src/content/writingStyleSettings.js +35 -11
- package/extension/src/page/binaryAssetUploader.js +136 -14
- package/extension/src/page/compileBridge.js +193 -180
- package/extension/src/page/fileMover.js +256 -0
- package/extension/src/page/overleafCapabilities.js +4 -1
- package/extension/src/page/ownedDirectoryCleanup.js +94 -0
- package/extension/src/page/referenceProjects.js +1 -0
- package/extension/src/page/reviewContext.js +113 -0
- package/extension/src/page/saveState.js +6 -4
- package/extension/src/page/snapshotRouter.js +84 -39
- package/extension/src/page/textCoordinates.js +17 -1
- package/extension/src/page/textFileCreator.js +114 -26
- package/extension/src/page/trackedChangeCapture.js +12 -2
- package/extension/src/page/trackedChangeOwnership.js +19 -1
- package/extension/src/page/trackedChangeReplay.js +41 -21
- package/extension/src/page/trackedChangesLifecycle.js +217 -199
- package/extension/src/page/treeOperations.js +7 -10
- package/extension/src/page/updateSafetyProbe.js +41 -0
- package/extension/src/page/writebackReceiptJournal.js +2 -0
- package/extension/src/page/writebackRouter.js +103 -155
- package/extension/src/pageBridge.js +126 -69
- package/extension/src/popup.js +62 -10
- package/extension/src/shared/agentTranscript.js +373 -17
- package/extension/src/shared/auditRecords.js +4 -0
- package/extension/src/shared/compatibility.js +22 -6
- package/extension/src/shared/compileAdapter.js +129 -66
- package/extension/src/shared/composerAttachmentDraft.js +156 -0
- package/extension/src/shared/contextUsage.js +125 -0
- package/extension/src/shared/directoryCleanupProof.js +43 -0
- package/extension/src/shared/failureReasons.js +349 -4
- package/extension/src/shared/globalPreferences.js +30 -13
- package/extension/src/shared/governanceRules.js +4 -37
- package/extension/src/shared/i18n.js +590 -24
- package/extension/src/shared/lineReferences.js +38 -31
- package/extension/src/shared/managedUpdateProjection.js +2 -2
- package/extension/src/shared/nativeRequestIdentity.js +1 -0
- package/extension/src/shared/pageRpcContract.js +5 -4
- package/extension/src/shared/panelIcons.js +39 -0
- package/extension/src/shared/projectFiles.js +21 -44
- package/extension/src/shared/providerProfiles.js +5 -3
- package/extension/src/shared/reviewing.js +130 -1
- package/extension/src/shared/runActivityModel.js +70 -4
- package/extension/src/shared/runExecutionSnapshot.js +13 -0
- package/extension/src/shared/runInputQueue.js +48 -5
- package/extension/src/shared/selectionContext.js +12 -3
- package/extension/src/shared/sessionState.js +132 -28
- package/extension/src/shared/sessionTitle.js +14 -1
- package/extension/src/shared/settlementFacts.js +10 -2
- package/extension/src/shared/sharedSessionBridge.js +118 -27
- package/extension/src/shared/sharedSessionTransfer.js +140 -0
- package/extension/src/shared/staleGuard.js +166 -52
- package/extension/src/shared/storageDb.js +90 -26
- package/extension/src/shared/storageMigration.js +78 -112
- package/extension/src/shared/storageRunActions.js +267 -30
- package/extension/src/shared/subagentActivityModel.js +1 -1
- package/extension/src/shared/undoOperations.js +253 -32
- package/extension/src/shared/updateConsent.js +6 -4
- package/extension/src/shared/updateRuntimeIdentity.js +17 -3
- package/extension/src/shared/writebackIntent.js +16 -0
- package/extension/src/shared/writebackOperationEvidence.js +4 -15
- package/extension/src/shared/writebackSettlement.js +58 -40
- package/extension/styles/panel.css +1123 -493
- package/native-host/src/anthropicBridgeRequest.js +4 -2
- package/native-host/src/anthropicBridgeResponse.js +6 -2
- package/native-host/src/anthropicMessagesBridge.js +24 -16
- package/native-host/src/bootstrapMigration.js +296 -0
- package/native-host/src/bootstrapMigrationContract.js +101 -0
- package/native-host/src/bootstrapUpdate.js +269 -0
- package/native-host/src/bootstrapUpdateWatchdog.js +44 -0
- package/native-host/src/chatBridgeRequest.js +60 -6
- package/native-host/src/chatBridgeResponse.js +20 -1
- package/native-host/src/chatCompletionsBridge.js +48 -15
- package/native-host/src/codexConfigPaths.js +106 -0
- package/native-host/src/codexHome.js +66 -73
- package/native-host/src/codexHomeScope.js +124 -0
- package/native-host/src/codexInheritedAuth.js +90 -0
- package/native-host/src/codexLocalSkills.js +301 -0
- package/native-host/src/codexPromptAssembly.js +114 -127
- package/native-host/src/codexProviderTest.js +24 -26
- package/native-host/src/codexSessionRunner.js +234 -198
- package/native-host/src/codexSessionTiming.js +18 -8
- package/native-host/src/codexSkillIsolation.js +170 -0
- package/native-host/src/codexThreadFork.js +19 -3
- package/native-host/src/index.js +19 -7
- package/native-host/src/managedInstall.js +110 -35
- package/native-host/src/managedInstallRecovery.js +140 -0
- package/native-host/src/managedRuntimeEvidence.js +57 -0
- package/native-host/src/mirrorWorkspace.js +92 -22
- package/native-host/src/nativeDoctor.js +15 -0
- package/native-host/src/nativeHelperLifecycle.js +21 -0
- package/native-host/src/nativeHostRegistration.js +33 -0
- package/native-host/src/nativeRunLifecycle.js +71 -0
- package/native-host/src/processStopBarrier.js +42 -7
- package/native-host/src/projectPathPlatform.js +30 -0
- package/native-host/src/providerContextError.js +20 -0
- package/native-host/src/providerHttp.js +80 -0
- package/native-host/src/providerProfile.js +4 -2
- package/native-host/src/providerReasoning.js +2 -7
- package/native-host/src/providerRuntime.js +1 -0
- package/native-host/src/providerStore.js +72 -14
- package/native-host/src/responsesPassthroughBridge.js +266 -52
- package/native-host/src/runtimeInstaller.js +21 -1
- package/native-host/src/selectionScope.js +36 -8
- package/native-host/src/subagentAdmission.js +26 -0
- package/native-host/src/subagentBroker.js +79 -66
- package/native-host/src/subagentTelemetry.js +19 -10
- package/native-host/src/subagentWorkspacePath.js +5 -2
- package/native-host/src/taskRunnerRuntime.js +92 -57
- package/native-host/src/textPatch.js +473 -377
- package/native-host/src/tomlStatements.js +140 -0
- package/native-host/src/updateManager.js +409 -46
- package/native-host/src/writingStyleRuntime.js +57 -29
- package/native-host/src/writingStyleStore.js +73 -0
- package/package.json +5 -8
- package/scripts/install-managed.mjs +1 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Preserve TOML source text while finding complete logical statements. This is
|
|
4
|
+
// a lexical boundary scanner, not a TOML value/schema parser. Filters must never
|
|
5
|
+
// treat an apparent key or table header inside a multiline value as syntax.
|
|
6
|
+
function splitTomlStatements(content) {
|
|
7
|
+
const text = String(content || '').replace(/\r\n/g, '\n');
|
|
8
|
+
const statements = [];
|
|
9
|
+
const containers = [];
|
|
10
|
+
let start = 0;
|
|
11
|
+
let quote = '';
|
|
12
|
+
let multiline = false;
|
|
13
|
+
let comment = false;
|
|
14
|
+
|
|
15
|
+
for (let index = 0; index < text.length; index++) {
|
|
16
|
+
const char = text[index];
|
|
17
|
+
if (comment) {
|
|
18
|
+
if (char !== '\n') continue;
|
|
19
|
+
comment = false;
|
|
20
|
+
}
|
|
21
|
+
if (quote) {
|
|
22
|
+
if (quote === '"' && char === '\\') {
|
|
23
|
+
// Basic strings escape the next character, including the first quote
|
|
24
|
+
// of a potential delimiter. Literal strings have no escape syntax.
|
|
25
|
+
index++;
|
|
26
|
+
} else if (char === quote) {
|
|
27
|
+
if (!multiline) {
|
|
28
|
+
quote = '';
|
|
29
|
+
} else if (text.slice(index, index + 3) === quote.repeat(3)) {
|
|
30
|
+
// A legal closing delimiter can have one or two literal quotes just
|
|
31
|
+
// before it: consume all four/five instead of opening another string.
|
|
32
|
+
let count = 3;
|
|
33
|
+
while (count < 5 && text[index + count] === quote) count++;
|
|
34
|
+
index += count - 1;
|
|
35
|
+
quote = '';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (char === '#') {
|
|
41
|
+
comment = true;
|
|
42
|
+
} else if (char === '"' || char === "'") {
|
|
43
|
+
quote = char;
|
|
44
|
+
multiline = text.slice(index, index + 3) === char.repeat(3);
|
|
45
|
+
if (multiline) index += 2;
|
|
46
|
+
} else if (char === '[' || char === '{') {
|
|
47
|
+
containers.push(char);
|
|
48
|
+
} else if (char === ']' || char === '}') {
|
|
49
|
+
const opener = char === ']' ? '[' : '{';
|
|
50
|
+
if (containers.pop() !== opener) throw incompleteValue();
|
|
51
|
+
} else if (char === '\n' && containers.length === 0) {
|
|
52
|
+
statements.push(text.slice(start, index + 1));
|
|
53
|
+
start = index + 1;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Do not silently remove the remaining config if a selected value is broken.
|
|
58
|
+
// The caller prepares the full string before writing the destination file.
|
|
59
|
+
if (quote || containers.length) throw incompleteValue();
|
|
60
|
+
if (start < text.length) statements.push(text.slice(start));
|
|
61
|
+
return statements;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function incompleteValue() {
|
|
65
|
+
return new Error('Codex configuration contains an unterminated or mismatched TOML value.');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Parse only a statement's key path, leaving its value and original formatting
|
|
69
|
+
// untouched. A quoted dot belongs to a key; an unquoted dot separates keys.
|
|
70
|
+
function readTomlStatementPath(statement) {
|
|
71
|
+
const text = String(statement || '');
|
|
72
|
+
let index = 0;
|
|
73
|
+
const whitespace = () => { while (text[index] === ' ' || text[index] === '\t') index++; };
|
|
74
|
+
whitespace();
|
|
75
|
+
if (!text[index] || text[index] === '#' || text[index] === '\n') return null;
|
|
76
|
+
const table = text[index] === '[';
|
|
77
|
+
let brackets = 0;
|
|
78
|
+
if (table) {
|
|
79
|
+
brackets = text[index + 1] === '[' ? 2 : 1;
|
|
80
|
+
index += brackets;
|
|
81
|
+
}
|
|
82
|
+
const keys = [];
|
|
83
|
+
while (true) {
|
|
84
|
+
whitespace();
|
|
85
|
+
let key = '';
|
|
86
|
+
const quote = text[index];
|
|
87
|
+
if (quote === '"' || quote === "'") {
|
|
88
|
+
index++;
|
|
89
|
+
while (index < text.length && text[index] !== quote) {
|
|
90
|
+
const char = text[index++];
|
|
91
|
+
if (char === '\n' || char === '\r') throw invalidKey();
|
|
92
|
+
if (quote !== '"' || char !== '\\') { key += char; continue; }
|
|
93
|
+
const escape = text[index++];
|
|
94
|
+
const simple = { b: '\b', t: '\t', n: '\n', f: '\f', r: '\r', '"': '"', '\\': '\\' };
|
|
95
|
+
if (Object.prototype.hasOwnProperty.call(simple, escape)) { key += simple[escape]; continue; }
|
|
96
|
+
const count = escape === 'u' ? 4 : escape === 'U' ? 8 : 0;
|
|
97
|
+
const hex = text.slice(index, index + count);
|
|
98
|
+
if (!count || hex.length !== count || !/^[0-9a-f]+$/i.test(hex)) throw invalidKey();
|
|
99
|
+
const point = Number.parseInt(hex, 16);
|
|
100
|
+
if (point > 0x10ffff || (point >= 0xd800 && point <= 0xdfff)) throw invalidKey();
|
|
101
|
+
key += String.fromCodePoint(point);
|
|
102
|
+
index += count;
|
|
103
|
+
}
|
|
104
|
+
if (text[index++] !== quote) throw invalidKey();
|
|
105
|
+
} else {
|
|
106
|
+
const match = text.slice(index).match(/^[A-Za-z0-9_-]+/);
|
|
107
|
+
if (!match) return null;
|
|
108
|
+
key = match[0]; index += key.length;
|
|
109
|
+
}
|
|
110
|
+
keys.push(key);
|
|
111
|
+
whitespace();
|
|
112
|
+
if (text[index] !== '.') break;
|
|
113
|
+
index++;
|
|
114
|
+
}
|
|
115
|
+
if (table) {
|
|
116
|
+
if (text.slice(index, index + brackets) !== ']'.repeat(brackets)) return null;
|
|
117
|
+
index += brackets; whitespace();
|
|
118
|
+
if (text[index] && text[index] !== '#' && text[index] !== '\n') return null;
|
|
119
|
+
} else if (text[index] !== '=') return null;
|
|
120
|
+
return { table, keys, ...(table ? {} : { valueStart: index + 1 }) };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function filterTomlRootKeys(content, excludedKeys) {
|
|
124
|
+
const excluded = new Set(excludedKeys);
|
|
125
|
+
const output = [];
|
|
126
|
+
let section = [];
|
|
127
|
+
for (const statement of splitTomlStatements(content)) {
|
|
128
|
+
const parsed = readTomlStatementPath(statement);
|
|
129
|
+
if (parsed?.table) section = parsed.keys;
|
|
130
|
+
const root = section.length ? section[0] : parsed?.keys[0];
|
|
131
|
+
if (!excluded.has(root)) output.push(statement);
|
|
132
|
+
}
|
|
133
|
+
return output.join('');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function invalidKey() {
|
|
137
|
+
return new Error('Codex configuration contains an invalid TOML key.');
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
module.exports = { splitTomlStatements, filterTomlRootKeys, readTomlStatementPath };
|