oxe-cc 1.12.0 → 1.16.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.
Files changed (40) hide show
  1. package/.github/dependabot.yml +31 -0
  2. package/.github/workflows/ci.yml +141 -56
  3. package/.github/workflows/release.yml +114 -89
  4. package/CHANGELOG.md +866 -754
  5. package/README.md +600 -736
  6. package/bin/lib/oxe-agent-install.cjs +299 -284
  7. package/bin/lib/oxe-artifact-catalog.cjs +376 -0
  8. package/bin/lib/oxe-command-registry.cjs +31 -0
  9. package/bin/lib/oxe-context-engine.cjs +11 -11
  10. package/bin/lib/oxe-core-command-handlers.cjs +82 -0
  11. package/bin/lib/oxe-dashboard.cjs +140 -140
  12. package/bin/lib/oxe-manifest.cjs +20 -20
  13. package/bin/lib/oxe-npm-version.cjs +6 -4
  14. package/bin/lib/oxe-plugin-cli.cjs +95 -0
  15. package/bin/lib/oxe-plugins.cjs +94 -3
  16. package/bin/lib/oxe-process.cjs +67 -0
  17. package/bin/lib/oxe-project-health.cjs +2846 -2781
  18. package/bin/lib/oxe-runtime-semantics.cjs +68 -69
  19. package/bin/oxe-cc.js +369 -353
  20. package/docs/INTEGRATION.md +182 -0
  21. package/docs/QUALITY-GATES.md +46 -0
  22. package/docs/RELEASE-READINESS.md +86 -61
  23. package/docs/RUNTIME-SMOKE-MATRIX.md +137 -135
  24. package/docs/oxe-artifact-map.html +1172 -0
  25. package/lib/sdk/index.cjs +20 -0
  26. package/lib/sdk/index.d.ts +971 -876
  27. package/lib/sdk/index.types.ts +933 -0
  28. package/oxe/templates/PLUGINS.md +8 -1
  29. package/oxe/templates/STATE-REFERENCE.md +125 -0
  30. package/oxe/templates/STATE.md +11 -121
  31. package/oxe/workflows/help.md +2 -0
  32. package/package.json +129 -108
  33. package/packages/runtime/package.json +18 -18
  34. package/packages/runtime/src/evidence/evidence-store.ts +2 -2
  35. package/packages/runtime/src/scheduler/multi-agent-coordinator.ts +728 -728
  36. package/packages/runtime/src/workspace/strategies/git-worktree.ts +24 -24
  37. package/packages/runtime/tsconfig.json +8 -2
  38. package/vscode-extension/.vscodeignore +2 -0
  39. package/vscode-extension/package.json +193 -185
  40. package/vscode-extension/src/extension.js +11 -1
@@ -0,0 +1,67 @@
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const path = require('node:path');
5
+ const childProcess = require('node:child_process');
6
+
7
+ const PACKAGE_MANAGERS = new Set(['npm', 'npx']);
8
+
9
+ function assertSafeArgs(args) {
10
+ if (!Array.isArray(args)) throw new TypeError('args deve ser um array');
11
+ for (const arg of args) {
12
+ if (typeof arg !== 'string') throw new TypeError('todo argumento deve ser string');
13
+ if (arg.includes('\0')) throw new TypeError('argumento contém byte NUL');
14
+ }
15
+ }
16
+
17
+ /** Resolve npm/npx without ever relying on a command shell. */
18
+ function resolvePackageManagerInvocation(manager, options = {}) {
19
+ if (!PACKAGE_MANAGERS.has(manager)) {
20
+ throw new TypeError(`package manager não suportado: ${manager}`);
21
+ }
22
+ const platform = options.platform || process.platform;
23
+ if (platform !== 'win32') return { command: manager, argsPrefix: [] };
24
+ const platformPath = path.win32;
25
+
26
+ const env = options.env || process.env;
27
+ const nodeExecutable = options.nodeExecutable || process.execPath;
28
+ const existsSync = options.existsSync || fs.existsSync;
29
+ const cliName = `${manager}-cli.js`;
30
+ const candidates = [];
31
+ const pathEntries = String(env.PATH || env.Path || '').split(platformPath.delimiter).filter(Boolean);
32
+ // Honor PATH precedence first, including test/toolchain shims that expose the
33
+ // JavaScript CLI directly.
34
+ for (const pathEntry of pathEntries) candidates.push(platformPath.join(pathEntry, cliName));
35
+ const execPath = manager === 'npm' ? env.npm_execpath : env.npx_execpath;
36
+ if (execPath && new RegExp(`${manager}-cli\\.js$`, 'i').test(execPath)) candidates.push(execPath);
37
+ if (manager === 'npx' && env.npm_execpath && /npm-cli\.js$/i.test(env.npm_execpath)) {
38
+ candidates.push(platformPath.join(platformPath.dirname(env.npm_execpath), cliName));
39
+ }
40
+ candidates.push(platformPath.join(platformPath.dirname(nodeExecutable), 'node_modules', 'npm', 'bin', cliName));
41
+ for (const pathEntry of pathEntries) {
42
+ candidates.push(platformPath.join(pathEntry, 'node_modules', 'npm', 'bin', cliName));
43
+ candidates.push(platformPath.join(platformPath.dirname(pathEntry), 'node_modules', 'npm', 'bin', cliName));
44
+ }
45
+ const cliPath = candidates.find((candidate) => existsSync(candidate));
46
+ if (!cliPath) {
47
+ throw new Error(`${cliName} não encontrado; confirme que o npm está instalado junto ao Node.js`);
48
+ }
49
+ return { command: nodeExecutable, argsPrefix: [cliPath] };
50
+ }
51
+
52
+ function runPackageManagerSync(manager, args, options = {}) {
53
+ assertSafeArgs(args);
54
+ const invocation = resolvePackageManagerInvocation(manager, options);
55
+ const spawnSync = options.spawnSync || childProcess.spawnSync;
56
+ const spawnOptions = { ...options };
57
+ for (const key of ['platform', 'nodeExecutable', 'existsSync', 'spawnSync']) delete spawnOptions[key];
58
+ // Security invariant: callers cannot opt back into a shell.
59
+ spawnOptions.shell = false;
60
+ return spawnSync(invocation.command, [...invocation.argsPrefix, ...args], spawnOptions);
61
+ }
62
+
63
+ module.exports = {
64
+ assertSafeArgs,
65
+ resolvePackageManagerInvocation,
66
+ runPackageManagerSync,
67
+ };