@shipfox/api-agent 10.2.0 → 12.0.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shipfox/api-agent",
3
3
  "license": "MIT",
4
- "version": "10.2.0",
4
+ "version": "12.0.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": "10.0.0",
43
- "@shipfox/api-auth-context": "10.2.0",
44
- "@shipfox/api-secrets-dto": "9.0.2",
45
- "@shipfox/inter-module": "0.2.2",
42
+ "@shipfox/api-agent-dto": "12.0.0",
43
+ "@shipfox/api-auth-context": "12.0.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.4",
47
+ "@shipfox/node-drizzle": "0.3.5",
48
48
  "@shipfox/node-egress-guard": "0.1.3",
49
- "@shipfox/node-fastify": "0.4.0",
50
- "@shipfox/node-module": "1.0.4",
49
+ "@shipfox/node-fastify": "0.4.1",
50
+ "@shipfox/node-module": "1.0.5",
51
51
  "@shipfox/node-opentelemetry": "0.6.3",
52
- "@shipfox/node-postgres": "0.4.4",
53
- "@shipfox/redact": "0.2.5"
52
+ "@shipfox/node-postgres": "0.5.0",
53
+ "@shipfox/redact": "0.2.6"
54
54
  },
55
55
  "imports": {
56
56
  "#*": "./dist/*"
@@ -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: AgentThinking,
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
- readonly thinking?: AgentThinking | undefined;
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
- if (!thinkingSchema.safeParse(params.step.thinking).success) {
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 params.step.thinking;
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,
@@ -75,7 +75,7 @@ describe('model provider config routes', () => {
75
75
  stopReason: 'stop',
76
76
  timestamp: Date.now(),
77
77
  });
78
- authenticatedMemberships = [{workspaceId, role: 'admin'}];
78
+ authenticatedMemberships = [{workspaceId, role: 'admin', workspaceStatus: 'active'}];
79
79
  app = await createApp({
80
80
  auth: [fakeUserAuth],
81
81
  routes: agentRoutes,