@opscompass/opscompass-cli 1.3.10 → 1.3.11

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 CHANGED
@@ -162,37 +162,14 @@ The MLSS source-selection feature requires staged deployment: MLSS service first
162
162
 
163
163
  ## AI Chat Documents host integration
164
164
 
165
- The CLI pins the released npm package `@opscompass/harness-core@0.7.3`; a local harness checkout/link is no longer required. Fully restart Studio after adopting the published CLI so its main process loads the new runtime.
165
+ The standalone CLI does not start or install a chat runtime. Studio owns its Harness runtime and can still use the CLI commands and the Documents facade. Release the Studio migration before distributing this CLI to Studio users: older Studio builds need their existing pinned CLI for chat.
166
166
 
167
- Harness 0.7.3 includes public/custom model catalog metadata and GPT-6.1 Terra support, preserves local model configuration across failed refreshes, and keeps Windows chat independent of the unsupported generic Bash adapter. New Artifact collection output must be root-level Markdown; historical reads and exports outside the collection remain available. These fixes arrive through the shared Harness without additional CLI adapter changes.
168
-
169
- Only failure to find the top-level `@opscompass/harness-core` package becomes the friendly AI-chat-unavailable error. Missing transitive packages and internal harness modules retain their original loader errors, including when the importer path contains the harness package name.
170
-
171
- The CLI supplies a trusted per-prompt run budget of **120 tool executions**, **5 identical calls**, and **10 minutes** to `createCliAiChatRuntime`; Studio inherits this through its selected CLI. These values do not alter Harness's library defaults or reset when a skill changes. Shared generic file and Bash calls count toward the same run ceiling; only tools with trusted skill ownership also consume that skill's allowance.
172
-
173
- Trusted host code may explicitly pass `runBudget: { maxToolCalls, maxIdenticalCalls, maxDurationMs }` alongside `cliInvocation`. An explicit object completely replaces the CLI budget and is forwarded unchanged for Harness validation; omitted fields in that object use Harness's library defaults (20 executions, 5 identical calls, 10 minutes). Model output and renderer input must not supply this configuration. Both the CLI default and explicit budgets require `EXECUTION_POLICY_VERSION === 1`, and embedded invocation independently requires `supportsCliInvocation === true`; either missing capability fails before creating a conversation. No separate numeric Studio override is needed.
174
-
175
- The CLI lockfile pins published Harness `0.7.3`, which includes public Skills `0.2.3` with shared Resources (60 calls) and Oracle Licensing (40 calls) limits. The bundle routes inventory-only requests to `resources list` and rejects oversized stdout from the shared CLI runner rather than returning clipped JSON; the bulk workflow's separate JSON runner is unchanged. It retains embedded invocation and warning-safe JSON, and bundles Sandbox `0.0.81` with unmodified upstream Forge `1.4.2`. Pi 1.2.0 retains the Undici 8.12.3 correction and uses official minimatch 11.0.3 in both its installed dependency and rebuilt CLI/RPC bundle. Installation needs no customer patch script or additional registry credentials.
176
-
177
- The production audit gate accepts only a valid, successful report with zero production vulnerabilities; no advisory exception remains. Regression tests exercise PEM Buffer handling, malformed-signature rejection, and Sandbox certificate/TLS behavior through the actual installed dependencies.
178
-
179
- Studio can create the local Documents facade from the runtime harness:
167
+ The Documents facade takes an already-created Harness from the host:
180
168
 
181
169
  ```js
182
- import { createCliAiChatRuntime } from "./lib/aiChatRuntime.js";
183
170
  import { createCliAiChatDocuments } from "./lib/aiChatDocuments.js";
184
171
 
185
- const harness = await createCliAiChatRuntime({ workspaceRoot, onEvent });
186
172
  const documents = createCliAiChatDocuments({ harness, onChanged });
187
173
  ```
188
174
 
189
175
  The facade provides `list(directory?)`, `mkdir(path)`, `importFile(sourcePath, destinationPath)`, `preview(path)`, `exportFile(path, destinationPath)`, `delete(path)`, and `dispose()`. Import takes the native-dialog absolute source path and a Documents-root-relative destination; export takes a Documents-root-relative source and the native save-dialog absolute destination. Renderer requests contain only relative document paths, with the host consumer supplying dialog paths in main. The host consumer owns the facade lifecycle: call `documents.dispose()` when replacing the runtime; it waits for local operations but does not dispose the harness.
190
-
191
-
192
- The AI Chat adapter exports `supportsCliInvocation` and accepts optional host-owned
193
- `cliInvocation: { executable, args, env }`. This lets a packaged desktop host run
194
- its selected JavaScript CLI through its embedded runtime while preserving the
195
- CLI command identity, defaults home and cancellation. An explicit environment is
196
- complete, not an ambient overlay. The adapter rejects older Harness versions
197
- that cannot honor the invocation; the matching public Skills bundle must support
198
- it too. Standalone callers can omit the option.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opscompass/opscompass-cli",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "Calls OpsCompass's APIs",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -28,8 +28,7 @@
28
28
  "node": "^22.19.0 || ^24.0.0"
29
29
  },
30
30
  "dependencies": {
31
- "@opscompass/harness-core": "0.7.3",
32
- "@opscompass/opscompass-api": "^1.3.9",
31
+ "@opscompass/opscompass-api": "^1.3.10",
33
32
  "adm-zip": "^0.6.1",
34
33
  "axios": "^1.20.0",
35
34
  "better-sqlite3": "^13.0.1",
@@ -38,7 +37,7 @@
38
37
  "open": "^8.2.1",
39
38
  "openpgp": "6.2.2",
40
39
  "semver": "^7.3.7",
41
- "tar": "^7.5.22"
40
+ "tar": "8.1.0"
42
41
  },
43
42
  "devDependencies": {
44
43
  "jest": "^30.4.2"
@@ -1,51 +0,0 @@
1
- import { cliCommand, opscompassHome } from "../environment/current.js";
2
-
3
- // DECISION: the selected CLI package owns this adapter so Studio uses the
4
- // same CLI home, executable, and packaged harness runtime.
5
- let harnessCoreLoader = () => import("@opscompass/harness-core");
6
-
7
- export function __setHarnessCoreLoaderForTesting(loader) {
8
- harnessCoreLoader = loader;
9
- }
10
-
11
- export const supportsCliInvocation = true;
12
-
13
- // DECISION: The CLI owns the approved run ceiling; Harness library defaults stay compatible.
14
- /**
15
- * @param {{workspaceRoot: string, onEvent: Function, cliEntryPoint?: string,
16
- * cliInvocation?: import('@opscompass/harness-core').CliInvocation,
17
- * runBudget?: import('@opscompass/harness-core').RunBudgetOptions}} options
18
- */
19
- export async function createCliAiChatRuntime({ workspaceRoot, onEvent, cliEntryPoint = cliCommand, cliInvocation,
20
- runBudget = { maxToolCalls: 120, maxIdenticalCalls: 5, maxDurationMs: 600_000 } }) {
21
- let core;
22
- try {
23
- core = await harnessCoreLoader();
24
- } catch (error) {
25
- if (
26
- error &&
27
- error.code === "ERR_MODULE_NOT_FOUND" &&
28
- /^Cannot find package '@opscompass\/harness-core' imported from /.test(error.message)
29
- ) {
30
- throw new Error("Opscompass AI chat is unavailable because the harness dependency could not be loaded.");
31
- }
32
- throw error;
33
- }
34
- if (cliInvocation && core.supportsCliInvocation !== true) {
35
- throw new Error("Packaged AI chat requires an updated Harness with CLI invocation support.");
36
- }
37
- if (core.EXECUTION_POLICY_VERSION !== 1) {
38
- throw new Error("This AI chat runtime does not support execution budgets. Install a compatible CLI/Harness release.");
39
- }
40
- const harnessOptions = {
41
- workspaceRoot,
42
- opscompassHome,
43
- cliExecutable: cliCommand,
44
- onEvent,
45
- cliEntryPoint,
46
- modelAccessSource: "customer",
47
- ...(cliInvocation ? { cliInvocation } : {}),
48
- runBudget,
49
- };
50
- return core.createOpscompassHarness(harnessOptions);
51
- }