@bramblex/codex-workbench 0.1.17 → 0.1.18
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 +2 -0
- package/package.json +1 -1
- package/src/providers/codex.js +8 -0
- package/src/providers/pi.js +12 -4
- package/src/services/session-sources.js +5 -8
package/README.md
CHANGED
|
@@ -140,6 +140,8 @@ codex-workbench auto-detects installed backends by checking their session direct
|
|
|
140
140
|
|
|
141
141
|
Session metadata such as custom names, notes, and archive state is stored in workbench's own metadata file, not inside backend session files.
|
|
142
142
|
|
|
143
|
+
Every provider owns the full workbench command surface it advertises: new, resume, fork, archive, unarchive, and delete. A provider can implement an operation through its native CLI, workbench metadata, or file operations, but callers should not need provider-specific fallback logic.
|
|
144
|
+
|
|
143
145
|
---
|
|
144
146
|
|
|
145
147
|
## CLI commands
|
package/package.json
CHANGED
package/src/providers/codex.js
CHANGED
|
@@ -249,6 +249,14 @@ function runSessionCommand(command, session, args, inherit) {
|
|
|
249
249
|
module.exports = {
|
|
250
250
|
id: 'codex',
|
|
251
251
|
label: 'Codex',
|
|
252
|
+
capabilities: {
|
|
253
|
+
new: true,
|
|
254
|
+
resume: true,
|
|
255
|
+
fork: true,
|
|
256
|
+
archive: true,
|
|
257
|
+
unarchive: true,
|
|
258
|
+
delete: true,
|
|
259
|
+
},
|
|
252
260
|
isAvailable,
|
|
253
261
|
getSessionFiles,
|
|
254
262
|
parseSession,
|
package/src/providers/pi.js
CHANGED
|
@@ -8,7 +8,7 @@ const fs = require('fs');
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
const { spawn, spawnSync } = require('child_process');
|
|
10
10
|
const { HOME, PI_CODING_AGENT_DIR } = require('../config');
|
|
11
|
-
const { updateMetadata } = require('../model/metadata');
|
|
11
|
+
const { removeMetadata, updateMetadata } = require('../model/metadata');
|
|
12
12
|
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
14
|
// Paths
|
|
@@ -272,9 +272,9 @@ function runSessionCommand(command, session, args, inherit) {
|
|
|
272
272
|
return runArgv(argv, cwd, inherit);
|
|
273
273
|
}
|
|
274
274
|
case 'delete': {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
return
|
|
275
|
+
fs.unlinkSync(session.file);
|
|
276
|
+
removeMetadata(session);
|
|
277
|
+
return 0;
|
|
278
278
|
}
|
|
279
279
|
case 'archive':
|
|
280
280
|
case 'unarchive': {
|
|
@@ -312,6 +312,14 @@ function resolveBin() {
|
|
|
312
312
|
module.exports = {
|
|
313
313
|
id: 'pi',
|
|
314
314
|
label: 'pi',
|
|
315
|
+
capabilities: {
|
|
316
|
+
new: true,
|
|
317
|
+
resume: true,
|
|
318
|
+
fork: true,
|
|
319
|
+
archive: true,
|
|
320
|
+
unarchive: true,
|
|
321
|
+
delete: true,
|
|
322
|
+
},
|
|
315
323
|
isAvailable,
|
|
316
324
|
getSessionFiles,
|
|
317
325
|
parseSession,
|
|
@@ -105,6 +105,7 @@ function providerSummary(provider) {
|
|
|
105
105
|
return {
|
|
106
106
|
id: provider.id,
|
|
107
107
|
label: provider.label || provider.id,
|
|
108
|
+
capabilities: provider.capabilities || {},
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
111
|
|
|
@@ -121,19 +122,15 @@ function listSourceBackends(source) {
|
|
|
121
122
|
.map((backend) => ({
|
|
122
123
|
id: String(backend.id),
|
|
123
124
|
label: backend.label ? String(backend.label) : String(backend.id),
|
|
125
|
+
capabilities: backend.capabilities && typeof backend.capabilities === 'object'
|
|
126
|
+
? backend.capabilities
|
|
127
|
+
: {},
|
|
124
128
|
}));
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
function runSourceSessionCommand(session, command, args) {
|
|
128
132
|
if (!session.sourceRemote) {
|
|
129
|
-
|
|
130
|
-
// If the provider returns -1 (e.g. pi delete = file-based), fall through to file deletion
|
|
131
|
-
if (status === -1) {
|
|
132
|
-
const { deleteSessionFile } = require('../model/session-store');
|
|
133
|
-
deleteSessionFile(session);
|
|
134
|
-
return 0;
|
|
135
|
-
}
|
|
136
|
-
return status;
|
|
133
|
+
return runCodexCommand(command, session, args);
|
|
137
134
|
}
|
|
138
135
|
const source = configuredSourceOrThrow(session.sourceId);
|
|
139
136
|
const tty = command === 'resume' || command === 'fork';
|