@gobing-ai/ts-ai-runner 0.4.42 → 0.4.44
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/dist/doctor-runner.d.ts +7 -0
- package/dist/doctor-runner.d.ts.map +1 -1
- package/dist/doctor-runner.js +14 -8
- package/package.json +4 -4
- package/src/doctor-runner.ts +20 -9
package/dist/doctor-runner.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ export interface DoctorRunnerOptions {
|
|
|
67
67
|
probeRegistry?: ModelHealthProbeRegistry;
|
|
68
68
|
/** Model health probe timeout in milliseconds (default 10s). */
|
|
69
69
|
probeTimeoutMs?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Probe authentication during health checks. Default `true` (existing behavior).
|
|
72
|
+
* When `false`, results report `authenticated: 'unknown'` — the probe is skipped
|
|
73
|
+
* entirely: no auth subprocess and no credential-file read.
|
|
74
|
+
*/
|
|
75
|
+
probeAuth?: boolean;
|
|
70
76
|
}
|
|
71
77
|
/** Runs installation, liveness, and auth health checks for supported coding agents. */
|
|
72
78
|
export declare class DoctorRunner {
|
|
@@ -79,6 +85,7 @@ export declare class DoctorRunner {
|
|
|
79
85
|
private readonly executors;
|
|
80
86
|
private readonly probeRegistry;
|
|
81
87
|
private readonly probeTimeoutMs;
|
|
88
|
+
private readonly probeAuth;
|
|
82
89
|
constructor(options?: DoctorRunnerOptions);
|
|
83
90
|
/** Create the default probe registry with OmpModelProbe for all known omp providers. */
|
|
84
91
|
private createDefaultRegistry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-runner.d.ts","sourceRoot":"","sources":["../src/doctor-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAwB,KAAK,UAAU,EAAiB,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AACrE,O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,SAAS,CAAmB;IAC7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA2B;IACzD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAU;gBAExB,OAAO,GAAE,mBAAwB;IAa7C,wFAAwF;IACxF,OAAO,CAAC,qBAAqB;IAS7B,kDAAkD;IAC5C,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAqBvC;;;OAGG;YACW,mBAAmB;IAsBjC,uCAAuC;IACjC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAelD,wDAAwD;YAC1C,UAAU;IAwBxB,gFAAgF;IAChF,OAAO,CAAC,aAAa;YAIP,WAAW;CA+B5B"}
|
package/dist/doctor-runner.js
CHANGED
|
@@ -17,6 +17,7 @@ export class DoctorRunner {
|
|
|
17
17
|
executors;
|
|
18
18
|
probeRegistry;
|
|
19
19
|
probeTimeoutMs;
|
|
20
|
+
probeAuth;
|
|
20
21
|
constructor(options = {}) {
|
|
21
22
|
this.runner = options.runner ?? new AiRunner();
|
|
22
23
|
this.detector = options.agentDetector ?? new AgentDetector({ runner: this.runner });
|
|
@@ -27,6 +28,7 @@ export class DoctorRunner {
|
|
|
27
28
|
this.executors = options.executors ?? [];
|
|
28
29
|
this.probeTimeoutMs = options.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
29
30
|
this.probeRegistry = options.probeRegistry ?? this.createDefaultRegistry();
|
|
31
|
+
this.probeAuth = options.probeAuth ?? true;
|
|
30
32
|
}
|
|
31
33
|
/** Create the default probe registry with OmpModelProbe for all known omp providers. */
|
|
32
34
|
createDefaultRegistry() {
|
|
@@ -124,14 +126,18 @@ export class DoctorRunner {
|
|
|
124
126
|
const canonical = resolveAgentName(detected.name) ?? null;
|
|
125
127
|
const tier = canonical !== null && TIER2_AGENTS.has(canonical) ? 2 : 1;
|
|
126
128
|
this.logger.debug('checking agent', { agent: detected.name, installed: detected.installed, tier });
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
129
|
+
// 'unauthenticated' would be a claim; a suppressed probe claims nothing,
|
|
130
|
+
// so the skip path reports 'unknown'.
|
|
131
|
+
const authenticated = !this.probeAuth
|
|
132
|
+
? 'unknown'
|
|
133
|
+
: detected.installed && canonical !== null
|
|
134
|
+
? await isAuthenticated(canonical, {
|
|
135
|
+
runner: this.runner,
|
|
136
|
+
env: this.env,
|
|
137
|
+
fileSystem: this.fs,
|
|
138
|
+
timeout: this.timeout,
|
|
139
|
+
})
|
|
140
|
+
: 'unauthenticated';
|
|
135
141
|
return {
|
|
136
142
|
agent: detected.name,
|
|
137
143
|
installed: detected.installed,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gobing-ai/ts-ai-runner",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.44",
|
|
4
4
|
"description": "@gobing-ai/ts-ai-runner — Coding-agent shims, detection, doctor checks, and prompt execution.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"release": "echo 'Manual publish is disabled. Releases go through GitHub Actions via Trusted Publishing — push a tag: git tag @gobing-ai/ts-ai-runner-v<version> && git push --tags' && exit 1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@gobing-ai/ts-infra": "^0.4.
|
|
51
|
-
"@gobing-ai/ts-runtime": "^0.4.
|
|
50
|
+
"@gobing-ai/ts-infra": "^0.4.44",
|
|
51
|
+
"@gobing-ai/ts-runtime": "^0.4.44"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/bun": "1.3.14",
|
|
55
|
-
"@gobing-ai/ts-db": "^0.4.
|
|
55
|
+
"@gobing-ai/ts-db": "^0.4.44"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
package/src/doctor-runner.ts
CHANGED
|
@@ -77,6 +77,12 @@ export interface DoctorRunnerOptions {
|
|
|
77
77
|
probeRegistry?: ModelHealthProbeRegistry;
|
|
78
78
|
/** Model health probe timeout in milliseconds (default 10s). */
|
|
79
79
|
probeTimeoutMs?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Probe authentication during health checks. Default `true` (existing behavior).
|
|
82
|
+
* When `false`, results report `authenticated: 'unknown'` — the probe is skipped
|
|
83
|
+
* entirely: no auth subprocess and no credential-file read.
|
|
84
|
+
*/
|
|
85
|
+
probeAuth?: boolean;
|
|
80
86
|
}
|
|
81
87
|
|
|
82
88
|
const DEFAULT_TIMEOUT_MS = 5_000;
|
|
@@ -92,6 +98,7 @@ export class DoctorRunner {
|
|
|
92
98
|
private readonly executors: ExecutorConfig[];
|
|
93
99
|
private readonly probeRegistry: ModelHealthProbeRegistry;
|
|
94
100
|
private readonly probeTimeoutMs: number;
|
|
101
|
+
private readonly probeAuth: boolean;
|
|
95
102
|
|
|
96
103
|
constructor(options: DoctorRunnerOptions = {}) {
|
|
97
104
|
this.runner = options.runner ?? new AiRunner();
|
|
@@ -103,6 +110,7 @@ export class DoctorRunner {
|
|
|
103
110
|
this.executors = options.executors ?? [];
|
|
104
111
|
this.probeTimeoutMs = options.probeTimeoutMs ?? DEFAULT_PROBE_TIMEOUT_MS;
|
|
105
112
|
this.probeRegistry = options.probeRegistry ?? this.createDefaultRegistry();
|
|
113
|
+
this.probeAuth = options.probeAuth ?? true;
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
/** Create the default probe registry with OmpModelProbe for all known omp providers. */
|
|
@@ -213,15 +221,18 @@ export class DoctorRunner {
|
|
|
213
221
|
const canonical = resolveAgentName(detected.name) ?? null;
|
|
214
222
|
const tier = canonical !== null && TIER2_AGENTS.has(canonical) ? 2 : 1;
|
|
215
223
|
this.logger.debug('checking agent', { agent: detected.name, installed: detected.installed, tier });
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
// 'unauthenticated' would be a claim; a suppressed probe claims nothing,
|
|
225
|
+
// so the skip path reports 'unknown'.
|
|
226
|
+
const authenticated: AuthState = !this.probeAuth
|
|
227
|
+
? 'unknown'
|
|
228
|
+
: detected.installed && canonical !== null
|
|
229
|
+
? await isAuthenticated(canonical, {
|
|
230
|
+
runner: this.runner,
|
|
231
|
+
env: this.env,
|
|
232
|
+
fileSystem: this.fs,
|
|
233
|
+
timeout: this.timeout,
|
|
234
|
+
})
|
|
235
|
+
: 'unauthenticated';
|
|
225
236
|
return {
|
|
226
237
|
agent: detected.name,
|
|
227
238
|
installed: detected.installed,
|