@shipfox/api-agent-dto 13.1.0 → 14.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-dto",
3
3
  "license": "MIT",
4
- "version": "13.1.0",
4
+ "version": "14.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/ShipfoxHQ/shipfox.git",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "zod": "^4.4.3",
26
26
  "@shipfox/inter-module": "0.2.3",
27
- "@shipfox/workflow-document": "3.0.1"
27
+ "@shipfox/workflow-document": "3.1.0"
28
28
  },
29
29
  "imports": {
30
30
  "#*": "./dist/*"
package/src/index.ts CHANGED
@@ -68,6 +68,7 @@ export {
68
68
  MAX_MODEL_COUNT,
69
69
  type ManagedModelApi,
70
70
  type ManagedModelEntry,
71
+ type ManagedModelMetadata,
71
72
  type ManagedModelProvider,
72
73
  type ManagedProviderRuntimeConfig,
73
74
  type MaterializedAgentIntegrationConfigDto,
@@ -87,6 +88,7 @@ export {
87
88
  type ModelProviderRef,
88
89
  type ModelProviderSupportStatus,
89
90
  managedModelApiSchema,
91
+ managedModelMetadataSchema,
90
92
  materializedAgentIntegrationSchema,
91
93
  materializedAgentIntegrationToolSchema,
92
94
  materializedAgentStepConfigSchema,
@@ -117,6 +119,7 @@ export {
117
119
  setDefaultModelProviderResponseSchema,
118
120
  supportedModelProviderIdSchema,
119
121
  thinkingLevelsForHarness,
122
+ toCustomAgentModelDto,
120
123
  UNSUPPORTED_MODEL_PROVIDER_IDS,
121
124
  type UpdateCustomModelProviderBodyDto,
122
125
  type UpdateCustomModelProviderHeaderRequestDto,
@@ -84,9 +84,12 @@ export {
84
84
  export {
85
85
  type ManagedModelApi,
86
86
  type ManagedModelEntry,
87
+ type ManagedModelMetadata,
87
88
  type ManagedModelProvider,
88
89
  type ManagedProviderRuntimeConfig,
89
90
  managedModelApiSchema,
91
+ managedModelMetadataSchema,
92
+ toCustomAgentModelDto,
90
93
  } from './managed-provider.js';
91
94
  export {
92
95
  AGENT_INTEGRATION_MCP_AUTH,
@@ -1,5 +1,6 @@
1
1
  import type {AgentThinking} from '@shipfox/workflow-document';
2
2
  import {z} from 'zod';
3
+ import {type CustomAgentModelDto, customAgentModelSchema} from './custom-model-provider.js';
3
4
 
4
5
  export const managedModelApiSchema = z.enum([
5
6
  'anthropic-messages',
@@ -9,12 +10,33 @@ export const managedModelApiSchema = z.enum([
9
10
 
10
11
  export type ManagedModelApi = z.infer<typeof managedModelApiSchema>;
11
12
 
12
- export interface ManagedModelEntry {
13
+ export const managedModelMetadataSchema = customAgentModelSchema.omit({
14
+ id: true,
15
+ label: true,
16
+ });
17
+
18
+ export type ManagedModelMetadata = z.infer<typeof managedModelMetadataSchema>;
19
+
20
+ /**
21
+ * Optional model metadata passed through to Pi's custom-provider adapter.
22
+ * Omitted properties retain the adapter's defaults.
23
+ */
24
+ export interface ManagedModelEntry extends Readonly<ManagedModelMetadata> {
13
25
  readonly id: string;
14
26
  readonly label: string;
15
27
  readonly api: ManagedModelApi;
16
28
  }
17
29
 
30
+ export function toCustomAgentModelDto(
31
+ model: Pick<ManagedModelEntry, 'id' | 'label'> & ManagedModelMetadata,
32
+ ): CustomAgentModelDto {
33
+ return {
34
+ id: model.id,
35
+ label: model.label,
36
+ ...managedModelMetadataSchema.parse(model),
37
+ };
38
+ }
39
+
18
40
  export interface ManagedProviderRuntimeConfig {
19
41
  readonly api: ManagedModelApi;
20
42
  readonly baseUrl: string;