apexrest 0.5.0 → 1.0.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/NOTICE +0 -6
- package/README.md +13 -36
- package/README.uk.md +13 -36
- package/dist/codex-compat/plugins/apexrest-apex/.codex-plugin/plugin.json +4 -4
- package/dist/codex-compat/plugins/apexrest-apex/NOTICE +0 -6
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/index.html +4 -11
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.css +4 -182
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/panel.js +61 -383
- package/dist/codex-compat/plugins/apexrest-apex/resources/playwright/package.json +1 -1
- package/dist/codex-compat/plugins/apexrest-apex/resources/schemas/operations.schema.json +0 -327
- package/dist/codex-compat/plugins/apexrest-apex/runtime/apexrest.mjs +12 -43
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-QDAKHEPF.mjs → chunk-3XRCAA5S.mjs} +4 -4
- package/dist/{runtime/chunk-HYOURJBW.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-4GIV3RLJ.mjs} +2 -2
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-RF4XQO6I.mjs → chunk-CJC3ESO4.mjs} +2 -2
- package/dist/{runtime/chunk-XKBZJ36H.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-DLUIX7FA.mjs} +20 -62
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-JWX4UQAZ.mjs → chunk-EG2NPDAF.mjs} +1 -1
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-EMRXOSVH.mjs +14 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-FPOEB42H.mjs → chunk-JN3KZCDI.mjs} +1 -1
- package/dist/{runtime/chunk-QLRGI23I.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-K5BV3TBZ.mjs} +9 -108
- package/dist/{runtime/chunk-QWQVXUVG.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-MNYOWIHJ.mjs} +24 -77
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-TTVGX5LP.mjs → chunk-NHYXXMBY.mjs} +21 -213
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-2SZCZZ3J.mjs → chunk-R6MER5QH.mjs} +0 -1
- package/dist/{runtime/chunk-XEK2R5AU.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-SVB7G3KQ.mjs} +5 -7
- package/dist/{runtime/chunk-L7BXN3LU.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-SWW7SKB4.mjs} +19 -42
- package/dist/{runtime/chunk-KJOSAKHX.mjs → codex-compat/plugins/apexrest-apex/runtime/chunk-XZNIV6UL.mjs} +5 -6
- package/dist/codex-compat/plugins/apexrest-apex/runtime/{chunk-DNJL7OYO.mjs → chunk-YXHLPFQX.mjs} +15 -13
- package/dist/codex-compat/plugins/apexrest-apex/runtime/mcp.mjs +7 -8
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-apexlang/SKILL.md +1 -1
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-database/SKILL.md +0 -2
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-debug/SKILL.md +0 -2
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/SKILL.md +13 -14
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-menu/references/cli-catalog.md +14 -15
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/SKILL.md +4 -10
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-panel/agents/openai.yaml +3 -3
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-project/SKILL.md +1 -1
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/SKILL.md +5 -8
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-work/agents/openai.yaml +3 -3
- package/dist/resources/panel/index.html +4 -11
- package/dist/resources/panel/panel.css +4 -182
- package/dist/resources/panel/panel.js +61 -383
- package/dist/resources/playwright/package.json +1 -1
- package/dist/resources/schemas/operations.schema.json +0 -327
- package/dist/runtime/apexrest.mjs +12 -43
- package/dist/runtime/{chunk-QDAKHEPF.mjs → chunk-3XRCAA5S.mjs} +4 -4
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-HYOURJBW.mjs → runtime/chunk-4GIV3RLJ.mjs} +2 -2
- package/dist/runtime/{chunk-RF4XQO6I.mjs → chunk-CJC3ESO4.mjs} +2 -2
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-XKBZJ36H.mjs → runtime/chunk-DLUIX7FA.mjs} +20 -62
- package/dist/runtime/{chunk-JWX4UQAZ.mjs → chunk-EG2NPDAF.mjs} +1 -1
- package/dist/runtime/chunk-EMRXOSVH.mjs +14 -0
- package/dist/runtime/{chunk-FPOEB42H.mjs → chunk-JN3KZCDI.mjs} +1 -1
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-QLRGI23I.mjs → runtime/chunk-K5BV3TBZ.mjs} +9 -108
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-QWQVXUVG.mjs → runtime/chunk-MNYOWIHJ.mjs} +24 -77
- package/dist/runtime/{chunk-TTVGX5LP.mjs → chunk-NHYXXMBY.mjs} +21 -213
- package/dist/runtime/{chunk-2SZCZZ3J.mjs → chunk-R6MER5QH.mjs} +0 -1
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-XEK2R5AU.mjs → runtime/chunk-SVB7G3KQ.mjs} +5 -7
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-L7BXN3LU.mjs → runtime/chunk-SWW7SKB4.mjs} +19 -42
- package/dist/{codex-compat/plugins/apexrest-apex/runtime/chunk-KJOSAKHX.mjs → runtime/chunk-XZNIV6UL.mjs} +5 -6
- package/dist/runtime/{chunk-DNJL7OYO.mjs → chunk-YXHLPFQX.mjs} +15 -13
- package/dist/runtime/mcp.mjs +7 -8
- package/package.json +1 -2
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/LICENCE.txt +0 -118
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/bulbasaur.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/charmander.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/mewtwo.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/pikachu.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/sources.json +0 -36
- package/dist/codex-compat/plugins/apexrest-apex/resources/panel/assets/squirtle.png +0 -0
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-ED2YPDPS.mjs +0 -1123
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-GFRSRK3K.mjs +0 -16
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-N5G4ADI7.mjs +0 -15
- package/dist/codex-compat/plugins/apexrest-apex/runtime/chunk-VPCUV5QA.mjs +0 -237
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/SKILL.md +0 -24
- package/dist/codex-compat/plugins/apexrest-apex/skills/apexrest-team/agents/openai.yaml +0 -4
- package/dist/resources/panel/assets/LICENCE.txt +0 -118
- package/dist/resources/panel/assets/bulbasaur.png +0 -0
- package/dist/resources/panel/assets/charmander.png +0 -0
- package/dist/resources/panel/assets/mewtwo.png +0 -0
- package/dist/resources/panel/assets/pikachu.png +0 -0
- package/dist/resources/panel/assets/sources.json +0 -36
- package/dist/resources/panel/assets/squirtle.png +0 -0
- package/dist/runtime/chunk-ED2YPDPS.mjs +0 -1123
- package/dist/runtime/chunk-GFRSRK3K.mjs +0 -16
- package/dist/runtime/chunk-N5G4ADI7.mjs +0 -15
- package/dist/runtime/chunk-VPCUV5QA.mjs +0 -237
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
openVerificationBrowser,
|
|
8
|
-
recordedExecutionMode,
|
|
9
|
-
teamStartSchema,
|
|
10
|
-
workPreferences,
|
|
11
|
-
workPreferencesSchema
|
|
12
|
-
} from "./chunk-QLRGI23I.mjs";
|
|
3
|
+
browserPreferences,
|
|
4
|
+
browserPreferencesSchema,
|
|
5
|
+
openVerificationBrowser
|
|
6
|
+
} from "./chunk-K5BV3TBZ.mjs";
|
|
13
7
|
import {
|
|
14
8
|
VERSION
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3XRCAA5S.mjs";
|
|
16
10
|
import {
|
|
17
11
|
OracleAdapter,
|
|
18
12
|
configureConnection,
|
|
@@ -30,7 +24,7 @@ import {
|
|
|
30
24
|
savedConnectionName,
|
|
31
25
|
sqlclConfig,
|
|
32
26
|
sqlclConfigSchema
|
|
33
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-R6MER5QH.mjs";
|
|
34
28
|
import {
|
|
35
29
|
Fault,
|
|
36
30
|
contained,
|
|
@@ -42,16 +36,10 @@ import {
|
|
|
42
36
|
|
|
43
37
|
// packages/core/src/panel-schema.ts
|
|
44
38
|
var panelPreferencesSchema = external_exports.strictObject({
|
|
45
|
-
|
|
46
|
-
multiAgentEnabled: workPreferencesSchema.shape.multiAgentEnabled.removeDefault().optional(),
|
|
47
|
-
browserMode: workPreferencesSchema.shape.browserMode.removeDefault().optional(),
|
|
48
|
-
developers: workPreferencesSchema.shape.developers.removeDefault().optional(),
|
|
49
|
-
sandbox: workPreferencesSchema.shape.sandbox.removeDefault().optional(),
|
|
50
|
-
timeoutSeconds: workPreferencesSchema.shape.timeoutSeconds.removeDefault().optional()
|
|
39
|
+
browserMode: browserPreferencesSchema.shape.browserMode.removeDefault().optional()
|
|
51
40
|
});
|
|
52
41
|
var panelReadSchema = external_exports.strictObject({
|
|
53
|
-
project: external_exports.string().min(1).max(4096).optional()
|
|
54
|
-
team: external_exports.uuid().optional()
|
|
42
|
+
project: external_exports.string().min(1).max(4096).optional()
|
|
55
43
|
});
|
|
56
44
|
var connectionActionSchema = external_exports.strictObject({
|
|
57
45
|
kind: external_exports.literal("connection"),
|
|
@@ -68,9 +56,6 @@ var panelActionSchema = external_exports.strictObject({
|
|
|
68
56
|
external_exports.strictObject({ kind: external_exports.literal("sqlcl"), settings: sqlclConfigSchema }),
|
|
69
57
|
external_exports.strictObject({ kind: external_exports.literal("saved-connections") }),
|
|
70
58
|
connectionActionSchema,
|
|
71
|
-
external_exports.strictObject({ kind: external_exports.literal("start"), request: teamStartSchema.omit({ project: true }) }),
|
|
72
|
-
external_exports.strictObject({ kind: external_exports.literal("message"), id: external_exports.uuid(), message: external_exports.string().trim().min(1).max(8e3) }),
|
|
73
|
-
external_exports.strictObject({ kind: external_exports.literal("cancel-team"), id: external_exports.uuid() }),
|
|
74
59
|
external_exports.strictObject({ kind: external_exports.literal("cancel-job"), id: external_exports.uuid() }),
|
|
75
60
|
external_exports.strictObject({ kind: external_exports.literal("validate") }),
|
|
76
61
|
external_exports.strictObject({ kind: external_exports.literal("browser"), env: external_exports.string().min(1).max(100) }),
|
|
@@ -214,6 +199,8 @@ async function executeJob(ctx, id, execute) {
|
|
|
214
199
|
}
|
|
215
200
|
|
|
216
201
|
// packages/core/src/panel.ts
|
|
202
|
+
import path2 from "node:path";
|
|
203
|
+
import { fileURLToPath } from "node:url";
|
|
217
204
|
import { readdir, realpath, stat } from "node:fs/promises";
|
|
218
205
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
219
206
|
var safe = (value) => sanitized(value);
|
|
@@ -225,7 +212,7 @@ var PanelService = class {
|
|
|
225
212
|
root;
|
|
226
213
|
oracle;
|
|
227
214
|
async preferences() {
|
|
228
|
-
return
|
|
215
|
+
return browserPreferences(this.root);
|
|
229
216
|
}
|
|
230
217
|
async records(folder) {
|
|
231
218
|
const base = await contained(this.root, ".apexrest/" + folder);
|
|
@@ -266,38 +253,20 @@ var PanelService = class {
|
|
|
266
253
|
})
|
|
267
254
|
);
|
|
268
255
|
}
|
|
269
|
-
async snapshot(
|
|
256
|
+
async snapshot() {
|
|
270
257
|
this.root = await realpath(this.root);
|
|
271
|
-
if (selectedTeam) parse(external_exports.uuid(), selectedTeam);
|
|
272
258
|
const ctx = await loadProject(this.root).catch((error) => {
|
|
273
259
|
if (error instanceof Fault && error.code === "PROJECT_NOT_CONFIGURED") return null;
|
|
274
260
|
throw error;
|
|
275
261
|
});
|
|
276
|
-
const [prefs, sqlcl, refs, security,
|
|
262
|
+
const [prefs, sqlcl, refs, security, jobRecords, deploymentRecords] = await Promise.all([
|
|
277
263
|
this.preferences(),
|
|
278
264
|
sqlclConfig(),
|
|
279
265
|
connections(),
|
|
280
266
|
policy(),
|
|
281
|
-
this.records("teams"),
|
|
282
267
|
this.records("jobs"),
|
|
283
268
|
this.records("deployments")
|
|
284
269
|
]);
|
|
285
|
-
const teams = teamRecords.map((row) => ({
|
|
286
|
-
id: String(row.id),
|
|
287
|
-
status: String(row.status),
|
|
288
|
-
phase: String(row.phase ?? "unknown"),
|
|
289
|
-
revision: Number(row.revision ?? 0),
|
|
290
|
-
updatedAt: String(row.updatedAt ?? ""),
|
|
291
|
-
members: Array.isArray(row.members) ? row.members.length : 0,
|
|
292
|
-
executionMode: recordedExecutionMode(row)
|
|
293
|
-
})).map(
|
|
294
|
-
(row) => ["queued", "running"].includes(row.status) && Date.parse(row.updatedAt) + 6e4 < Date.now() ? { ...row, status: "outcome_unknown" } : row
|
|
295
|
-
);
|
|
296
|
-
const chosen = selectedTeam ?? teams.find((t) => ["running", "queued"].includes(t.status))?.id ?? teams[0]?.id;
|
|
297
|
-
const team = ctx && chosen ? await new TeamService(ctx).snapshot(chosen) : null;
|
|
298
|
-
const assignment = ctx && chosen ? await readJson(await contained(this.root, ".apexrest/teams/" + chosen + "/request.json")).catch(
|
|
299
|
-
() => null
|
|
300
|
-
) : null;
|
|
301
270
|
const jobs = await Promise.all(
|
|
302
271
|
jobRecords.map(async (row) => {
|
|
303
272
|
const state = ctx ? await new JobService(ctx).status(String(row.id)) : row;
|
|
@@ -349,9 +318,6 @@ var PanelService = class {
|
|
|
349
318
|
preferences: prefs,
|
|
350
319
|
connections: refs,
|
|
351
320
|
toolchain,
|
|
352
|
-
teams,
|
|
353
|
-
team,
|
|
354
|
-
task: typeof assignment?.task === "string" ? assignment.task.slice(0, 2e3) : null,
|
|
355
321
|
jobs,
|
|
356
322
|
deployments,
|
|
357
323
|
changes,
|
|
@@ -367,17 +333,8 @@ var PanelService = class {
|
|
|
367
333
|
if (action.kind === "saved-connections") return this.oracle.savedConnections();
|
|
368
334
|
if (action.kind === "preferences") {
|
|
369
335
|
const settings = { ...await this.preferences(), ...action.settings };
|
|
370
|
-
if (!settings.multiAgentEnabled) {
|
|
371
|
-
if (action.settings.executionMode === "team")
|
|
372
|
-
throw new Fault(
|
|
373
|
-
"MULTI_AGENT_DISABLED",
|
|
374
|
-
"Explicitly enable multiAgentEnabled in Settings to select a team.",
|
|
375
|
-
2
|
|
376
|
-
);
|
|
377
|
-
settings.executionMode = "single";
|
|
378
|
-
}
|
|
379
336
|
await writeJson(await contained(this.root, ".apexrest/panel/preferences.json"), settings);
|
|
380
|
-
return { saved: true, appliesTo: "
|
|
337
|
+
return { saved: true, appliesTo: "browser-verification" };
|
|
381
338
|
}
|
|
382
339
|
if (action.kind === "sqlcl") {
|
|
383
340
|
return configureSqlcl(
|
|
@@ -387,15 +344,16 @@ var PanelService = class {
|
|
|
387
344
|
);
|
|
388
345
|
}
|
|
389
346
|
if (action.kind === "connection") return configureConnection(action.name, action);
|
|
390
|
-
const ctx = await loadProject(this.root)
|
|
391
|
-
if (action.kind === "start") return team.start({ ...action.request, project: this.root });
|
|
347
|
+
const ctx = await loadProject(this.root);
|
|
392
348
|
if (action.kind === "browser") return openVerificationBrowser(ctx, action.env);
|
|
393
|
-
if (action.kind === "message") return team.message(action.id, action.message);
|
|
394
|
-
if (action.kind === "cancel-team") return team.cancel(action.id);
|
|
395
349
|
if (action.kind === "cancel-job") return new JobService(ctx).cancel(action.id);
|
|
396
350
|
const operation = action.kind === "validate" ? "apex.validate" : action.kind === "plan" ? "deploy.plan" : "test.run";
|
|
397
351
|
const input = action.kind === "plan" ? { env: action.env, out: ".apexrest/plans/" + randomUUID2() + ".json" } : action.kind === "test" ? { suite: action.suite, ...action.env ? { env: action.env } : {} } : {};
|
|
398
|
-
return new JobService(ctx).start(
|
|
352
|
+
return new JobService(ctx).start(
|
|
353
|
+
operation,
|
|
354
|
+
input,
|
|
355
|
+
path2.join(path2.dirname(fileURLToPath(import.meta.url)), "apexrest.mjs")
|
|
356
|
+
);
|
|
399
357
|
}
|
|
400
358
|
};
|
|
401
359
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
startMcp
|
|
4
|
+
} from "./chunk-SWW7SKB4.mjs";
|
|
5
|
+
import "./chunk-NHYXXMBY.mjs";
|
|
6
|
+
import "./chunk-YXHLPFQX.mjs";
|
|
7
|
+
import "./chunk-DLUIX7FA.mjs";
|
|
8
|
+
import "./chunk-K5BV3TBZ.mjs";
|
|
9
|
+
import "./chunk-3XRCAA5S.mjs";
|
|
10
|
+
import "./chunk-R6MER5QH.mjs";
|
|
11
|
+
import "./chunk-IPU64TJI.mjs";
|
|
12
|
+
export {
|
|
13
|
+
startMcp
|
|
14
|
+
};
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
runtimeState,
|
|
15
15
|
sqlLiteral,
|
|
16
16
|
sqlclToken
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-R6MER5QH.mjs";
|
|
18
18
|
import {
|
|
19
19
|
Fault,
|
|
20
20
|
artifactPage,
|
|
@@ -1142,99 +1142,13 @@ end;
|
|
|
1142
1142
|
}
|
|
1143
1143
|
};
|
|
1144
1144
|
|
|
1145
|
-
// packages/core/src/
|
|
1146
|
-
var
|
|
1147
|
-
|
|
1148
|
-
browserMode: external_exports.enum(["codex", "external"]).default("codex"),
|
|
1149
|
-
developers: external_exports.number().int().min(1).max(3).default(1),
|
|
1150
|
-
sandbox: external_exports.enum(["read-only", "workspace-write"]).default("workspace-write"),
|
|
1151
|
-
timeoutSeconds: external_exports.number().int().min(30).max(3600).default(900)
|
|
1145
|
+
// packages/core/src/browser-preferences.ts
|
|
1146
|
+
var browserPreferencesSchema = external_exports.strictObject({
|
|
1147
|
+
browserMode: external_exports.enum(["codex", "external"]).default("codex")
|
|
1152
1148
|
});
|
|
1153
|
-
|
|
1154
|
-
// Legacy executionMode: team was also written by unrelated settings saves.
|
|
1155
|
-
// Only this explicit settings opt-in authorizes new multi-agent runs.
|
|
1156
|
-
multiAgentEnabled: external_exports.boolean().default(false)
|
|
1157
|
-
});
|
|
1158
|
-
var teamStartSchema = external_exports.strictObject({
|
|
1159
|
-
executionMode: workPreferencesSchema.shape.executionMode.removeDefault().optional(),
|
|
1160
|
-
browserMode: workPreferencesSchema.shape.browserMode.removeDefault().optional(),
|
|
1161
|
-
developers: workPreferencesSchema.shape.developers.removeDefault().optional(),
|
|
1162
|
-
sandbox: workPreferencesSchema.shape.sandbox.removeDefault().optional(),
|
|
1163
|
-
timeoutSeconds: workPreferencesSchema.shape.timeoutSeconds.removeDefault().optional(),
|
|
1164
|
-
project: external_exports.string().optional(),
|
|
1165
|
-
task: external_exports.string().trim().min(1).max(16e3)
|
|
1166
|
-
});
|
|
1167
|
-
var resolvedTeamStartSchema = workOptionsSchema.extend({
|
|
1168
|
-
project: external_exports.string().optional(),
|
|
1169
|
-
task: teamStartSchema.shape.task
|
|
1170
|
-
});
|
|
1171
|
-
var queuedWorkSchema = resolvedTeamStartSchema.extend({
|
|
1172
|
-
multiAgentEnabled: external_exports.boolean().default(false)
|
|
1173
|
-
});
|
|
1174
|
-
function recordedExecutionMode(state) {
|
|
1175
|
-
if (state.executionMode === "single" || state.executionMode === "team") return state.executionMode;
|
|
1176
|
-
const reviewed = [state.reviews, state.qa].some((rows) => Array.isArray(rows) && rows.length > 0);
|
|
1177
|
-
const peers = Array.isArray(state.members) && state.members.some(
|
|
1178
|
-
(member) => member && ["manager", "qa", "developer-2", "developer-3"].includes(member.role)
|
|
1179
|
-
);
|
|
1180
|
-
return reviewed || peers ? "team" : "single";
|
|
1181
|
-
}
|
|
1182
|
-
var teamIdSchema = external_exports.strictObject({ project: external_exports.string().optional(), id: external_exports.uuid() });
|
|
1183
|
-
var workStartSchema = teamStartSchema.extend({ requestId: external_exports.uuid() });
|
|
1184
|
-
var teamWaitSchema = teamIdSchema.extend({
|
|
1185
|
-
cursor: external_exports.string().regex(/^[a-f0-9]{64}$/).optional(),
|
|
1186
|
-
waitSeconds: external_exports.number().int().min(1).max(30).default(25)
|
|
1187
|
-
});
|
|
1188
|
-
var teamMessageSchema = teamIdSchema.extend({ message: external_exports.string().trim().min(1).max(8e3) });
|
|
1189
|
-
var planningSchema = external_exports.strictObject({
|
|
1190
|
-
plan: external_exports.string().min(1).max(6e3),
|
|
1191
|
-
complexity: external_exports.enum(["simple", "standard", "complex"]),
|
|
1192
|
-
reason: external_exports.string().min(1).max(600)
|
|
1193
|
-
});
|
|
1194
|
-
var reviewSchema = external_exports.strictObject({
|
|
1195
|
-
decision: external_exports.enum(["approve", "revise"]),
|
|
1196
|
-
summary: external_exports.string().min(1).max(4e3),
|
|
1197
|
-
findings: external_exports.array(external_exports.string().min(1).max(2e3)).max(20)
|
|
1198
|
-
});
|
|
1199
|
-
var routedReviewSchema = reviewSchema.extend({
|
|
1200
|
-
revisionCause: external_exports.enum(["none", "implementation", "prerequisite"])
|
|
1201
|
-
});
|
|
1202
|
-
var qaSchema = external_exports.strictObject({
|
|
1203
|
-
decision: external_exports.enum(["pass", "fail", "blocked"]),
|
|
1204
|
-
summary: external_exports.string().min(1).max(4e3),
|
|
1205
|
-
checks: external_exports.array(
|
|
1206
|
-
external_exports.strictObject({
|
|
1207
|
-
name: external_exports.string().min(1).max(500),
|
|
1208
|
-
status: external_exports.enum(["passed", "failed", "not_run"]),
|
|
1209
|
-
evidence: external_exports.string().min(1).max(2e3)
|
|
1210
|
-
})
|
|
1211
|
-
).min(1).max(20)
|
|
1212
|
-
});
|
|
1213
|
-
|
|
1214
|
-
// packages/core/src/work-preferences.ts
|
|
1215
|
-
async function workPreferences(root) {
|
|
1149
|
+
async function browserPreferences(root) {
|
|
1216
1150
|
const file = await contained(root, ".apexrest/panel/preferences.json");
|
|
1217
|
-
|
|
1218
|
-
if (!preferences.multiAgentEnabled) preferences.executionMode = "single";
|
|
1219
|
-
return preferences;
|
|
1220
|
-
}
|
|
1221
|
-
async function resolveWorkRequest(root, input) {
|
|
1222
|
-
const fields = parse(teamStartSchema, input);
|
|
1223
|
-
const overrides = Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== void 0));
|
|
1224
|
-
const { multiAgentEnabled, ...preferences } = await workPreferences(root);
|
|
1225
|
-
const request = resolvedTeamStartSchema.parse({
|
|
1226
|
-
...preferences,
|
|
1227
|
-
...overrides,
|
|
1228
|
-
project: root
|
|
1229
|
-
});
|
|
1230
|
-
if (request.executionMode === "team" && !multiAgentEnabled)
|
|
1231
|
-
throw new Fault(
|
|
1232
|
-
"MULTI_AGENT_DISABLED",
|
|
1233
|
-
"Multi-agent work is disabled. The user must explicitly enable multiAgentEnabled in Settings before starting a team.",
|
|
1234
|
-
2
|
|
1235
|
-
);
|
|
1236
|
-
if (request.executionMode === "single") request.developers = 1;
|
|
1237
|
-
return request;
|
|
1151
|
+
return parse(external_exports.object(browserPreferencesSchema.shape), await exists(file) ? await readJson(file) : {});
|
|
1238
1152
|
}
|
|
1239
1153
|
|
|
1240
1154
|
// packages/core/src/browser.ts
|
|
@@ -1262,8 +1176,7 @@ async function openVerificationBrowser(ctx, name, launch = runProcess, browserMo
|
|
|
1262
1176
|
new URL(target.baseUrl).origin,
|
|
1263
1177
|
...target.allowedOrigins
|
|
1264
1178
|
]).toString();
|
|
1265
|
-
const
|
|
1266
|
-
const mode = pinned === "external" || pinned === "codex" ? pinned : browserMode ?? (await workPreferences(ctx.root)).browserMode;
|
|
1179
|
+
const mode = browserMode ?? (await browserPreferences(ctx.root)).browserMode;
|
|
1267
1180
|
const common = {
|
|
1268
1181
|
browserMode: mode,
|
|
1269
1182
|
environment: name,
|
|
@@ -1284,23 +1197,11 @@ async function openVerificationBrowser(ctx, name, launch = runProcess, browserMo
|
|
|
1284
1197
|
}
|
|
1285
1198
|
|
|
1286
1199
|
export {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
resolvedTeamStartSchema,
|
|
1290
|
-
queuedWorkSchema,
|
|
1291
|
-
recordedExecutionMode,
|
|
1292
|
-
teamIdSchema,
|
|
1293
|
-
workStartSchema,
|
|
1294
|
-
teamWaitSchema,
|
|
1295
|
-
teamMessageSchema,
|
|
1296
|
-
planningSchema,
|
|
1297
|
-
routedReviewSchema,
|
|
1298
|
-
qaSchema,
|
|
1200
|
+
browserPreferencesSchema,
|
|
1201
|
+
browserPreferences,
|
|
1299
1202
|
DeploymentService,
|
|
1300
1203
|
ArtifactService,
|
|
1301
1204
|
TestService,
|
|
1302
|
-
workPreferences,
|
|
1303
|
-
resolveWorkRequest,
|
|
1304
1205
|
browserInstructions,
|
|
1305
1206
|
externalBrowserCommand,
|
|
1306
1207
|
openVerificationBrowser
|
|
@@ -4,16 +4,12 @@ import {
|
|
|
4
4
|
paint,
|
|
5
5
|
wrap
|
|
6
6
|
} from "./chunk-ZQFJ2BNZ.mjs";
|
|
7
|
-
import {
|
|
8
|
-
teamLabel
|
|
9
|
-
} from "./chunk-GFRSRK3K.mjs";
|
|
10
7
|
import {
|
|
11
8
|
PanelService
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-2SZCZZ3J.mjs";
|
|
9
|
+
} from "./chunk-DLUIX7FA.mjs";
|
|
10
|
+
import "./chunk-K5BV3TBZ.mjs";
|
|
11
|
+
import "./chunk-3XRCAA5S.mjs";
|
|
12
|
+
import "./chunk-R6MER5QH.mjs";
|
|
17
13
|
import {
|
|
18
14
|
Fault
|
|
19
15
|
} from "./chunk-IPU64TJI.mjs";
|
|
@@ -21,14 +17,12 @@ import {
|
|
|
21
17
|
// packages/cli/src/panel-tui.ts
|
|
22
18
|
import { emitKeypressEvents } from "node:readline";
|
|
23
19
|
function panelLines(data, tab) {
|
|
24
|
-
|
|
25
|
-
if (tab === 3)
|
|
20
|
+
if (tab === 2)
|
|
26
21
|
return [
|
|
27
22
|
`Database network: ${data.sqlcl.databaseTransport === "ords" ? "ORDS HTTP(S)" : "Direct Oracle listener"}`,
|
|
28
23
|
`SQLcl execution: ${data.sqlcl.mode.toUpperCase()} \xB7 restriction ${data.sqlcl.mcpRestrictLevel}`,
|
|
29
24
|
`Trusted: ${data.trusted} \xB7 configured: ${data.configured}`,
|
|
30
|
-
"
|
|
31
|
-
"Model selection: Auto (task complexity and implementation repair results; no manual override).",
|
|
25
|
+
"Verification browser: " + data.preferences.browserMode,
|
|
32
26
|
...JSON.stringify(
|
|
33
27
|
{
|
|
34
28
|
project: data.configuration,
|
|
@@ -40,7 +34,7 @@ function panelLines(data, tab) {
|
|
|
40
34
|
2
|
|
41
35
|
).split("\n")
|
|
42
36
|
];
|
|
43
|
-
if (tab ===
|
|
37
|
+
if (tab === 1)
|
|
44
38
|
return [
|
|
45
39
|
"APEX OPERATIONS",
|
|
46
40
|
...data.jobs.flatMap((job) => [`${job.operation} \xB7 ${job.status}`, job.summary]),
|
|
@@ -52,67 +46,20 @@ function panelLines(data, tab) {
|
|
|
52
46
|
"Commands: apexrest apex validate \xB7 apexrest test unit \xB7 apexrest deploy plan --env NAME --out PATH",
|
|
53
47
|
"Existing project trust and deployment authorization remain required."
|
|
54
48
|
];
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
""
|
|
49
|
+
return [
|
|
50
|
+
"CURRENT CODEX SESSION",
|
|
51
|
+
"Describe changes and review results in your open Codex conversation.",
|
|
52
|
+
"This panel runs APEX operations and manages project settings.",
|
|
53
|
+
"",
|
|
54
|
+
`Application: ${data.configuration?.application.alias ?? "Not configured"}`,
|
|
55
|
+
`Source: ${data.configuration?.application.sourceDir ?? "Not configured"}`,
|
|
56
|
+
"Environments: " + (Object.keys(data.configuration?.environments ?? {}).join(", ") || "None configured"),
|
|
57
|
+
"Required suites: " + (data.configuration?.tests.requiredSuites.join(", ") || "None declared"),
|
|
58
|
+
`Trusted: ${data.trusted} \xB7 configured: ${data.configured}`,
|
|
59
|
+
"",
|
|
60
|
+
"WORKING CHANGES",
|
|
61
|
+
...data.changes.files.length ? data.changes.files : [data.changes.status === "available" ? "No uncommitted Git changes." : "Git status unavailable."]
|
|
58
62
|
];
|
|
59
|
-
if (data.task) lines.push(data.task, "");
|
|
60
|
-
if (team?.modelPolicy)
|
|
61
|
-
lines.push("Auto models \xB7 " + team.modelPolicy.complexity + " \xB7 " + team.modelPolicy.reason);
|
|
62
|
-
if (team?.limits) lines.push("Task time limit: " + team.limits.timeoutSeconds + " seconds");
|
|
63
|
-
if (team?.members.length)
|
|
64
|
-
lines.push("Tokens are cumulative, including cached input; not a cost estimate.", "");
|
|
65
|
-
for (const member of team?.members ?? [])
|
|
66
|
-
lines.push(
|
|
67
|
-
`${teamLabel(member.role)} \xB7 ${member.status}`,
|
|
68
|
-
member.currentAction?.title ?? "No active tool reported",
|
|
69
|
-
[
|
|
70
|
-
member.configuration?.model,
|
|
71
|
-
member.configuration?.reasoningEffort,
|
|
72
|
-
member.configuration?.sandbox,
|
|
73
|
-
member.totalTokens == null ? "" : member.totalTokens + " tokens"
|
|
74
|
-
].filter(Boolean).join(" \xB7 "),
|
|
75
|
-
member.selection ? "Auto \xB7 " + member.selection.tier + " \xB7 " + member.selection.reason : "",
|
|
76
|
-
member.tokenUsage ? [
|
|
77
|
-
member.tokenUsage.inputTokens == null ? "" : "Input " + member.tokenUsage.inputTokens,
|
|
78
|
-
member.tokenUsage.cachedInputTokens == null ? "" : "Cached input " + member.tokenUsage.cachedInputTokens,
|
|
79
|
-
member.tokenUsage.outputTokens == null ? "" : "Output " + member.tokenUsage.outputTokens,
|
|
80
|
-
member.tokenUsage.reasoningOutputTokens == null ? "" : "Reasoning output " + member.tokenUsage.reasoningOutputTokens
|
|
81
|
-
].filter(Boolean).join(" \xB7 ") : "",
|
|
82
|
-
""
|
|
83
|
-
);
|
|
84
|
-
if (tab === 1) {
|
|
85
|
-
lines.push(
|
|
86
|
-
(team?.executionMode ?? data.preferences.executionMode) === "single" ? "AGENT VERIFICATION" : "MANDATORY REVIEWS"
|
|
87
|
-
);
|
|
88
|
-
for (const v of team?.verification ?? [])
|
|
89
|
-
lines.push(
|
|
90
|
-
`${v.report.decision} \xB7 revision ${v.revision}`,
|
|
91
|
-
v.report.summary,
|
|
92
|
-
...v.report.checks.map((c) => `${c.status} \xB7 ${c.name}: ${c.evidence}`)
|
|
93
|
-
);
|
|
94
|
-
for (const r of team?.reviews ?? [])
|
|
95
|
-
lines.push(
|
|
96
|
-
`${r.phase}: ${r.report.decision} \xB7 revision ${r.revision}`,
|
|
97
|
-
r.report.summary,
|
|
98
|
-
...r.report.findings
|
|
99
|
-
);
|
|
100
|
-
for (const q of team?.qa ?? [])
|
|
101
|
-
lines.push(
|
|
102
|
-
`QA: ${q.report.decision} \xB7 revision ${q.revision}`,
|
|
103
|
-
q.report.summary,
|
|
104
|
-
...q.report.checks.map((c) => `${c.status} \xB7 ${c.name}: ${c.evidence}`)
|
|
105
|
-
);
|
|
106
|
-
lines.push("", "PEER MESSAGES");
|
|
107
|
-
for (const m of team?.messages ?? [])
|
|
108
|
-
lines.push(`${teamLabel(m.from)} \u2192 ${teamLabel(m.to)} \xB7 ${m.status}`, m.text);
|
|
109
|
-
} else {
|
|
110
|
-
lines.push("WORKING CHANGES", ...data.changes.files, "", "OBSERVED AGENT STEPS");
|
|
111
|
-
for (const o of [...team?.observations ?? []].reverse())
|
|
112
|
-
lines.push(`${teamLabel(o.role)} \xB7 ${o.kind}`, o.detail);
|
|
113
|
-
}
|
|
114
|
-
if (team?.diagnostics.length) lines.push("", ...team.diagnostics);
|
|
115
|
-
return lines;
|
|
116
63
|
}
|
|
117
64
|
async function runPanelTui(root) {
|
|
118
65
|
if (!process.stdin.isTTY || !process.stdout.isTTY || process.env.TERM === "dumb")
|
|
@@ -128,10 +75,10 @@ async function runPanelTui(root) {
|
|
|
128
75
|
const lines = [
|
|
129
76
|
paint(" APEXREST \xB7 Development panel", "accent", color),
|
|
130
77
|
clip(" " + root, width),
|
|
131
|
-
["Overview", "
|
|
78
|
+
["Overview", "APEX operations", "Settings"].map((name, i) => `${i + 1} ${i === tab ? "[" + name + "]" : name}`).join(" "),
|
|
132
79
|
error ? "Disconnected \xB7 " + error : data ? "Live \xB7 " + new Date(data.updatedAt).toLocaleTimeString() : "Connecting\u2026",
|
|
133
80
|
...body.slice(offset, offset + height - 6),
|
|
134
|
-
"1\
|
|
81
|
+
"1\u20133 / \u2190\u2192 views \xB7 \u2191\u2193 scroll \xB7 r refresh \xB7 q exit | Actions: apexrest panel action --help"
|
|
135
82
|
];
|
|
136
83
|
output.write("\x1B[H\x1B[2J" + lines.map((line, i) => i === 0 ? line : clip(line, width)).join("\r\n"));
|
|
137
84
|
};
|
|
@@ -169,12 +116,12 @@ async function runPanelTui(root) {
|
|
|
169
116
|
};
|
|
170
117
|
const key = (_text, k) => {
|
|
171
118
|
if (k.name === "q" || k.ctrl && k.name === "c") return close();
|
|
172
|
-
if (/^[1-
|
|
119
|
+
if (/^[1-3]$/.test(k.name ?? "")) {
|
|
173
120
|
tab = Number(k.name) - 1;
|
|
174
121
|
offset = 0;
|
|
175
122
|
}
|
|
176
123
|
if (k.name === "right" || k.name === "left") {
|
|
177
|
-
tab = (tab + (k.name === "right" ? 1 :
|
|
124
|
+
tab = (tab + (k.name === "right" ? 1 : 2)) % 3;
|
|
178
125
|
offset = 0;
|
|
179
126
|
}
|
|
180
127
|
if (k.name === "up") offset--;
|