@shipfox/api-agent 11.0.0 → 12.2.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +36 -0
- package/dist/config.d.ts +2 -2
- package/dist/core/errors.d.ts +2 -2
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/resolve-agent-config.d.ts +2 -1
- package/dist/core/resolve-agent-config.d.ts.map +1 -1
- package/dist/core/resolve-agent-config.js +3 -2
- package/dist/core/resolve-agent-config.js.map +1 -1
- package/dist/core/validation-catalog.d.ts.map +1 -1
- package/dist/core/validation-catalog.js +5 -0
- package/dist/core/validation-catalog.js.map +1 -1
- package/dist/db/db.d.ts +10 -10
- package/dist/db/schema/agent-workspace-settings.d.ts +1 -1
- package/dist/db/schema/model-provider-configs.d.ts +4 -4
- package/dist/metrics/instance.d.ts +4 -4
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +11 -11
- package/src/core/errors.ts +1 -1
- package/src/core/resolve-agent-config.ts +5 -3
- package/src/core/validation-catalog.test.ts +16 -0
- package/src/core/validation-catalog.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/api-agent",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "12.2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -39,18 +39,18 @@
|
|
|
39
39
|
"drizzle-orm": "^0.45.2",
|
|
40
40
|
"zod": "^4.4.3",
|
|
41
41
|
"@shipfox/node-error-monitoring": "0.3.0",
|
|
42
|
-
"@shipfox/api-agent-dto": "
|
|
43
|
-
"@shipfox/api-auth-context": "
|
|
44
|
-
"@shipfox/api-secrets-dto": "
|
|
45
|
-
"@shipfox/inter-module": "0.2.
|
|
42
|
+
"@shipfox/api-agent-dto": "12.2.0",
|
|
43
|
+
"@shipfox/api-auth-context": "12.2.0",
|
|
44
|
+
"@shipfox/api-secrets-dto": "12.0.0",
|
|
45
|
+
"@shipfox/inter-module": "0.2.3",
|
|
46
46
|
"@shipfox/config": "1.2.4",
|
|
47
|
-
"@shipfox/node-drizzle": "0.3.
|
|
47
|
+
"@shipfox/node-drizzle": "0.3.5",
|
|
48
48
|
"@shipfox/node-egress-guard": "0.1.3",
|
|
49
|
-
"@shipfox/node-fastify": "0.4.
|
|
50
|
-
"@shipfox/node-module": "1.0.
|
|
51
|
-
"@shipfox/node-opentelemetry": "0.6.
|
|
52
|
-
"@shipfox/node-postgres": "0.
|
|
53
|
-
"@shipfox/redact": "0.2.
|
|
49
|
+
"@shipfox/node-fastify": "0.4.2",
|
|
50
|
+
"@shipfox/node-module": "1.0.6",
|
|
51
|
+
"@shipfox/node-opentelemetry": "0.6.4",
|
|
52
|
+
"@shipfox/node-postgres": "0.5.0",
|
|
53
|
+
"@shipfox/redact": "0.2.6"
|
|
54
54
|
},
|
|
55
55
|
"imports": {
|
|
56
56
|
"#*": "./dist/*"
|
package/src/core/errors.ts
CHANGED
|
@@ -48,7 +48,7 @@ export class UnsupportedHarnessProviderError extends Error {
|
|
|
48
48
|
export class UnsupportedHarnessThinkingError extends Error {
|
|
49
49
|
constructor(
|
|
50
50
|
public readonly harness: Harness,
|
|
51
|
-
public readonly thinking:
|
|
51
|
+
public readonly thinking: string,
|
|
52
52
|
public readonly supportedLevels: readonly AgentThinking[],
|
|
53
53
|
) {
|
|
54
54
|
super(
|
|
@@ -21,7 +21,8 @@ export interface ContextualAgentConfig {
|
|
|
21
21
|
readonly harness?: Harness | undefined;
|
|
22
22
|
readonly provider?: string | undefined;
|
|
23
23
|
readonly model?: string | undefined;
|
|
24
|
-
|
|
24
|
+
/** A resolved template can carry any string. `resolveThinking` validates it. */
|
|
25
|
+
readonly thinking?: string | undefined;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export interface ResolvedAgentConfig {
|
|
@@ -249,14 +250,15 @@ function resolveThinking(params: {
|
|
|
249
250
|
const descriptor = getHarnessDescriptor(params.harness);
|
|
250
251
|
|
|
251
252
|
if (params.step.thinking !== undefined) {
|
|
252
|
-
|
|
253
|
+
const parsed = thinkingSchema.safeParse(params.step.thinking);
|
|
254
|
+
if (!parsed.success) {
|
|
253
255
|
throw new UnsupportedHarnessThinkingError(
|
|
254
256
|
params.harness,
|
|
255
257
|
params.step.thinking,
|
|
256
258
|
descriptor.thinkingLevels,
|
|
257
259
|
);
|
|
258
260
|
}
|
|
259
|
-
return
|
|
261
|
+
return parsed.data;
|
|
260
262
|
}
|
|
261
263
|
|
|
262
264
|
const candidates = [
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import {getAgentValidationCatalog} from './validation-catalog.js';
|
|
2
|
+
|
|
3
|
+
describe('getAgentValidationCatalog', () => {
|
|
4
|
+
it('includes the model allowlist for each harness/provider pair', () => {
|
|
5
|
+
const catalog = getAgentValidationCatalog();
|
|
6
|
+
const pi = catalog.harnesses.find((harness) => harness.id === 'pi');
|
|
7
|
+
const claude = catalog.harnesses.find((harness) => harness.id === 'claude');
|
|
8
|
+
|
|
9
|
+
expect(Object.keys(pi?.model_ids_by_provider ?? {})).toEqual(
|
|
10
|
+
expect.arrayContaining(pi?.supported_provider_ids ?? []),
|
|
11
|
+
);
|
|
12
|
+
expect(pi?.model_ids_by_provider?.anthropic).toContain('claude-opus-4-8');
|
|
13
|
+
expect(pi?.model_ids_by_provider?.openai).toContain('gpt-5.5-pro');
|
|
14
|
+
expect(claude?.model_ids_by_provider?.anthropic).toContain('claude-opus-4-8');
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
} from '@shipfox/api-agent-dto';
|
|
6
6
|
import type {AgentValidationCatalog} from '@shipfox/api-agent-dto/inter-module';
|
|
7
7
|
import {harnessToolDeploymentConfig} from '#config.js';
|
|
8
|
+
import {listHarnessProviderModels} from './harness/index.js';
|
|
8
9
|
import {getModelProviderEntry} from './model-provider-policy.js';
|
|
9
10
|
|
|
10
11
|
/** Produces the versioned, JSON-safe policy snapshot consumed by Definitions. */
|
|
@@ -18,6 +19,12 @@ export function getAgentValidationCatalog(): AgentValidationCatalog {
|
|
|
18
19
|
harnesses: listHarnessDescriptors().map((harness) => ({
|
|
19
20
|
id: harness.id,
|
|
20
21
|
supported_provider_ids: [...harness.supportedProviderIds],
|
|
22
|
+
model_ids_by_provider: Object.fromEntries(
|
|
23
|
+
harness.supportedProviderIds.map((providerId) => [
|
|
24
|
+
providerId,
|
|
25
|
+
listHarnessProviderModels(harness.id, providerId).map((model) => model.id),
|
|
26
|
+
]),
|
|
27
|
+
),
|
|
21
28
|
thinking_levels: [...harness.thinkingLevels],
|
|
22
29
|
effective_tools: listEnabledHarnessTools(harness.id, harnessToolDeploymentConfig).map(
|
|
23
30
|
(tool) => tool.name,
|