@opscompass/harness-client 0.0.0-stage → 0.1.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.
@@ -0,0 +1,31 @@
1
+ /** Client-side lifecycle only. Every remote operation must independently authorize this requested scope. */
2
+ export interface RemoteScope {
3
+ readonly userId: string;
4
+ readonly companyId: string;
5
+ readonly sessionId: string;
6
+ }
7
+ export interface RemoteOperation extends RemoteScope {
8
+ readonly runId: string;
9
+ readonly operationId: string;
10
+ readonly kind: 'inference' | 'resource';
11
+ }
12
+ export type RemoteRunState = 'running' | 'completed' | 'cancelled' | 'interrupted';
13
+ /** A run cannot change company, resume after uncertainty, or silently retry an operation. */
14
+ export declare class RemoteRun {
15
+ readonly scope: Readonly<RemoteScope>;
16
+ readonly runId: string;
17
+ private readonly abortController;
18
+ private readonly operations;
19
+ private currentState;
20
+ private inferenceCount;
21
+ private resourceCount;
22
+ constructor(scope: RemoteScope, runId: string);
23
+ get state(): RemoteRunState;
24
+ get signal(): AbortSignal;
25
+ begin(kind: RemoteOperation['kind'], operationId: string): Readonly<RemoteOperation>;
26
+ accept(operation: RemoteOperation, sequence: number): boolean;
27
+ complete(): void;
28
+ cancel(): void;
29
+ interrupt(): void;
30
+ private stop;
31
+ }
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
+ "version": "0.1.0",
3
+ "type": "module",
4
+ "license": "UNLICENSED",
5
+ "files": [
6
+ "dist",
7
+ "README.md"
8
+ ],
9
+ "engines": {
10
+ "node": ">=22.19.0 <25"
11
+ },
2
12
  "name": "@opscompass/harness-client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
13
+ "description": "Browser-safe OpsCompass bounded orchestration client",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "build": "node ../../scripts/build-separated-packages.mjs client"
22
+ },
23
+ "devDependencies": {
24
+ "@earendil-works/pi-agent-core": "1.6.0",
25
+ "@earendil-works/pi-ai": "1.6.0",
26
+ "esbuild": "0.28.2",
27
+ "typescript": "5.9.3"
28
+ },
29
+ "overrides": {
30
+ "brace-expansion@^1.1.7": "^1.1.21",
31
+ "browserslist": "^4.29.4",
32
+ "js-yaml@^4.0.0": "^4.3.2",
33
+ "@istanbuljs/load-nyc-config": {
34
+ "js-yaml": "4.3.2"
35
+ },
36
+ "get-uri@7.0.0": {
37
+ "basic-ftp": "6.2.3"
38
+ },
39
+ "release-it": {
40
+ "undici": "7.30.1"
41
+ },
42
+ "@anthropic-ai/sandbox-runtime": {
43
+ "zod": "4.6.7",
44
+ "node-forge": "1.4.3"
45
+ },
46
+ "@earendil-works/pi-coding-agent": {
47
+ "undici": "8.12.4",
48
+ "minimatch": "11.0.3"
49
+ }
50
+ }
51
+ }