@shipfox/api-agent 7.1.0 → 8.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/core/validation-catalog.d.ts +4 -0
- package/dist/core/validation-catalog.d.ts.map +1 -0
- package/dist/core/validation-catalog.js +23 -0
- package/dist/core/validation-catalog.js.map +1 -0
- package/dist/presentation/inter-module.d.ts.map +1 -1
- package/dist/presentation/inter-module.js +2 -0
- package/dist/presentation/inter-module.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/core/validation-catalog.ts +27 -0
- package/src/presentation/inter-module.ts +2 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
$ shipfox-swc
|
|
2
|
-
Successfully compiled:
|
|
2
|
+
Successfully compiled: 51 files with swc (494.7ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @shipfox/api-agent
|
|
2
2
|
|
|
3
|
+
## 8.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- de559bb: Moves Agent validation policy behind a versioned inter-module catalog and injects it into Definitions normalization.
|
|
8
|
+
- Updated dependencies [de559bb]
|
|
9
|
+
- @shipfox/api-agent-dto@8.0.0
|
|
10
|
+
|
|
3
11
|
## 7.1.0
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AgentValidationCatalog } from '@shipfox/api-agent-dto/inter-module';
|
|
2
|
+
/** Produces the versioned, JSON-safe policy snapshot consumed by Definitions. */
|
|
3
|
+
export declare function getAgentValidationCatalog(): AgentValidationCatalog;
|
|
4
|
+
//# sourceMappingURL=validation-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation-catalog.d.ts","sourceRoot":"","sources":["../../src/core/validation-catalog.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,qCAAqC,CAAC;AAGhF,iFAAiF;AACjF,wBAAgB,yBAAyB,IAAI,sBAAsB,CAgBlE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { getModelProviderEntry, listEnabledHarnessTools, listHarnessDescriptors, MODEL_PROVIDER_IDS } from '@shipfox/api-agent-dto';
|
|
2
|
+
import { harnessToolDeploymentConfig } from '#config.js';
|
|
3
|
+
/** Produces the versioned, JSON-safe policy snapshot consumed by Definitions. */ export function getAgentValidationCatalog() {
|
|
4
|
+
return {
|
|
5
|
+
version: 1,
|
|
6
|
+
providers: MODEL_PROVIDER_IDS.map((id)=>({
|
|
7
|
+
id,
|
|
8
|
+
support_status: getModelProviderEntry(id)?.support_status ?? 'unsupported'
|
|
9
|
+
})),
|
|
10
|
+
harnesses: listHarnessDescriptors().map((harness)=>({
|
|
11
|
+
id: harness.id,
|
|
12
|
+
supported_provider_ids: [
|
|
13
|
+
...harness.supportedProviderIds
|
|
14
|
+
],
|
|
15
|
+
thinking_levels: [
|
|
16
|
+
...harness.thinkingLevels
|
|
17
|
+
],
|
|
18
|
+
effective_tools: listEnabledHarnessTools(harness.id, harnessToolDeploymentConfig).map((tool)=>tool.name)
|
|
19
|
+
}))
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=validation-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/validation-catalog.ts"],"sourcesContent":["import {\n getModelProviderEntry,\n listEnabledHarnessTools,\n listHarnessDescriptors,\n MODEL_PROVIDER_IDS,\n} from '@shipfox/api-agent-dto';\nimport type {AgentValidationCatalog} from '@shipfox/api-agent-dto/inter-module';\nimport {harnessToolDeploymentConfig} from '#config.js';\n\n/** Produces the versioned, JSON-safe policy snapshot consumed by Definitions. */\nexport function getAgentValidationCatalog(): AgentValidationCatalog {\n return {\n version: 1,\n providers: MODEL_PROVIDER_IDS.map((id) => ({\n id,\n support_status: getModelProviderEntry(id)?.support_status ?? 'unsupported',\n })),\n harnesses: listHarnessDescriptors().map((harness) => ({\n id: harness.id,\n supported_provider_ids: [...harness.supportedProviderIds],\n thinking_levels: [...harness.thinkingLevels],\n effective_tools: listEnabledHarnessTools(harness.id, harnessToolDeploymentConfig).map(\n (tool) => tool.name,\n ),\n })),\n };\n}\n"],"names":["getModelProviderEntry","listEnabledHarnessTools","listHarnessDescriptors","MODEL_PROVIDER_IDS","harnessToolDeploymentConfig","getAgentValidationCatalog","version","providers","map","id","support_status","harnesses","harness","supported_provider_ids","supportedProviderIds","thinking_levels","thinkingLevels","effective_tools","tool","name"],"mappings":"AAAA,SACEA,qBAAqB,EACrBC,uBAAuB,EACvBC,sBAAsB,EACtBC,kBAAkB,QACb,yBAAyB;AAEhC,SAAQC,2BAA2B,QAAO,aAAa;AAEvD,+EAA+E,GAC/E,OAAO,SAASC;IACd,OAAO;QACLC,SAAS;QACTC,WAAWJ,mBAAmBK,GAAG,CAAC,CAACC,KAAQ,CAAA;gBACzCA;gBACAC,gBAAgBV,sBAAsBS,KAAKC,kBAAkB;YAC/D,CAAA;QACAC,WAAWT,yBAAyBM,GAAG,CAAC,CAACI,UAAa,CAAA;gBACpDH,IAAIG,QAAQH,EAAE;gBACdI,wBAAwB;uBAAID,QAAQE,oBAAoB;iBAAC;gBACzDC,iBAAiB;uBAAIH,QAAQI,cAAc;iBAAC;gBAC5CC,iBAAiBhB,wBAAwBW,QAAQH,EAAE,EAAEL,6BAA6BI,GAAG,CACnF,CAACU,OAASA,KAAKC,IAAI;YAEvB,CAAA;IACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"inter-module.d.ts","sourceRoot":"","sources":["../../src/presentation/inter-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,wBAAwB,EAAC,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAGL,KAAK,uBAAuB,EAE7B,MAAM,uBAAuB,CAAC;AAU/B,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,yBAAyB,CAAC;AAIhE,wBAAgB,kCAAkC,CAAC,MAAM,EAAE;IACzD,OAAO,EAAE,kBAAkB,CAAC;CAC7B,GAAG,uBAAuB,CAAC,OAAO,wBAAwB,CAAC,CAsB3D"}
|
|
@@ -4,9 +4,11 @@ import { createInterModuleKnownError, defineInterModulePresentation, isInterModu
|
|
|
4
4
|
import { InvalidAgentModelError, ModelProviderConfigNotFoundError, UnsupportedHarnessProviderError, UnsupportedHarnessThinkingError, UnsupportedModelProviderError } from '#core/errors.js';
|
|
5
5
|
import { resolveAgentConfig } from '#core/resolve-agent-config.js';
|
|
6
6
|
import { resolveRuntimeCredentials } from '#core/resolve-runtime-credentials.js';
|
|
7
|
+
import { getAgentValidationCatalog } from '#core/validation-catalog.js';
|
|
7
8
|
import { createWorkspaceAgentDefaultsResolver } from '#core/workspace-agent-defaults-resolver.js';
|
|
8
9
|
export function createAgentInterModulePresentation(params) {
|
|
9
10
|
return defineInterModulePresentation(agentInterModuleContract, {
|
|
11
|
+
getValidationCatalog: ()=>getAgentValidationCatalog(),
|
|
10
12
|
resolveAgentConfig: async ({ workspaceId, config })=>{
|
|
11
13
|
try {
|
|
12
14
|
const resolve = workspaceId === null ? resolveAgentConfig : await createWorkspaceAgentDefaultsResolver(workspaceId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {agentInterModuleContract} from '@shipfox/api-agent-dto/inter-module';\nimport {secretsInterModuleContract} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n createInterModuleKnownError,\n defineInterModulePresentation,\n type InterModulePresentation,\n isInterModuleKnownError,\n} from '@shipfox/inter-module';\nimport {\n InvalidAgentModelError,\n ModelProviderConfigNotFoundError,\n UnsupportedHarnessProviderError,\n UnsupportedHarnessThinkingError,\n UnsupportedModelProviderError,\n} from '#core/errors.js';\nimport {resolveAgentConfig} from '#core/resolve-agent-config.js';\nimport {resolveRuntimeCredentials} from '#core/resolve-runtime-credentials.js';\nimport type {AgentSecretsClient} from '#core/secrets-client.js';\nimport {createWorkspaceAgentDefaultsResolver} from '#core/workspace-agent-defaults-resolver.js';\n\nexport function createAgentInterModulePresentation(params: {\n secrets: AgentSecretsClient;\n}): InterModulePresentation<typeof agentInterModuleContract> {\n return defineInterModulePresentation(agentInterModuleContract, {\n resolveAgentConfig: async ({workspaceId, config}) => {\n try {\n const resolve =\n workspaceId === null\n ? resolveAgentConfig\n : await createWorkspaceAgentDefaultsResolver(workspaceId);\n return await resolve(config);\n } catch (error) {\n throw toResolveAgentConfigKnownError(error);\n }\n },\n resolveRuntimeCredentials: async (input) => {\n try {\n return await resolveRuntimeCredentials(input, {secrets: params.secrets});\n } catch (error) {\n throw toResolveRuntimeCredentialsKnownError(error);\n }\n },\n });\n}\n\nfunction toResolveAgentConfigKnownError(error: unknown): unknown {\n if (\n error instanceof InvalidAgentModelError ||\n error instanceof UnsupportedHarnessProviderError ||\n error instanceof UnsupportedHarnessThinkingError ||\n error instanceof UnsupportedModelProviderError\n ) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveAgentConfig,\n 'agent-config-invalid',\n {},\n );\n }\n return error;\n}\n\nfunction toResolveRuntimeCredentialsKnownError(error: unknown): unknown {\n if (error instanceof ModelProviderConfigNotFoundError) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveRuntimeCredentials,\n 'model-provider-not-configured',\n {},\n );\n }\n if (isInterModuleKnownError(secretsInterModuleContract.methods.getSecretsByNamespace, error)) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveRuntimeCredentials,\n 'model-provider-credentials-invalid',\n {},\n );\n }\n return error;\n}\n"],"names":["agentInterModuleContract","secretsInterModuleContract","createInterModuleKnownError","defineInterModulePresentation","isInterModuleKnownError","InvalidAgentModelError","ModelProviderConfigNotFoundError","UnsupportedHarnessProviderError","UnsupportedHarnessThinkingError","UnsupportedModelProviderError","resolveAgentConfig","resolveRuntimeCredentials","createWorkspaceAgentDefaultsResolver","createAgentInterModulePresentation","params","workspaceId","config","resolve","error","toResolveAgentConfigKnownError","input","secrets","toResolveRuntimeCredentialsKnownError","methods","getSecretsByNamespace"],"mappings":"AAAA,SAAQA,wBAAwB,QAAO,sCAAsC;AAC7E,SAAQC,0BAA0B,QAAO,wCAAwC;AACjF,SACEC,2BAA2B,EAC3BC,6BAA6B,EAE7BC,uBAAuB,QAClB,wBAAwB;AAC/B,SACEC,sBAAsB,EACtBC,gCAAgC,EAChCC,+BAA+B,EAC/BC,+BAA+B,EAC/BC,6BAA6B,QACxB,kBAAkB;AACzB,SAAQC,kBAAkB,QAAO,gCAAgC;AACjE,SAAQC,yBAAyB,QAAO,uCAAuC;AAE/E,SAAQC,oCAAoC,QAAO,6CAA6C;AAEhG,OAAO,SAASC,mCAAmCC,MAElD;IACC,
|
|
1
|
+
{"version":3,"sources":["../../src/presentation/inter-module.ts"],"sourcesContent":["import {agentInterModuleContract} from '@shipfox/api-agent-dto/inter-module';\nimport {secretsInterModuleContract} from '@shipfox/api-secrets-dto/inter-module';\nimport {\n createInterModuleKnownError,\n defineInterModulePresentation,\n type InterModulePresentation,\n isInterModuleKnownError,\n} from '@shipfox/inter-module';\nimport {\n InvalidAgentModelError,\n ModelProviderConfigNotFoundError,\n UnsupportedHarnessProviderError,\n UnsupportedHarnessThinkingError,\n UnsupportedModelProviderError,\n} from '#core/errors.js';\nimport {resolveAgentConfig} from '#core/resolve-agent-config.js';\nimport {resolveRuntimeCredentials} from '#core/resolve-runtime-credentials.js';\nimport type {AgentSecretsClient} from '#core/secrets-client.js';\nimport {getAgentValidationCatalog} from '#core/validation-catalog.js';\nimport {createWorkspaceAgentDefaultsResolver} from '#core/workspace-agent-defaults-resolver.js';\n\nexport function createAgentInterModulePresentation(params: {\n secrets: AgentSecretsClient;\n}): InterModulePresentation<typeof agentInterModuleContract> {\n return defineInterModulePresentation(agentInterModuleContract, {\n getValidationCatalog: () => getAgentValidationCatalog(),\n resolveAgentConfig: async ({workspaceId, config}) => {\n try {\n const resolve =\n workspaceId === null\n ? resolveAgentConfig\n : await createWorkspaceAgentDefaultsResolver(workspaceId);\n return await resolve(config);\n } catch (error) {\n throw toResolveAgentConfigKnownError(error);\n }\n },\n resolveRuntimeCredentials: async (input) => {\n try {\n return await resolveRuntimeCredentials(input, {secrets: params.secrets});\n } catch (error) {\n throw toResolveRuntimeCredentialsKnownError(error);\n }\n },\n });\n}\n\nfunction toResolveAgentConfigKnownError(error: unknown): unknown {\n if (\n error instanceof InvalidAgentModelError ||\n error instanceof UnsupportedHarnessProviderError ||\n error instanceof UnsupportedHarnessThinkingError ||\n error instanceof UnsupportedModelProviderError\n ) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveAgentConfig,\n 'agent-config-invalid',\n {},\n );\n }\n return error;\n}\n\nfunction toResolveRuntimeCredentialsKnownError(error: unknown): unknown {\n if (error instanceof ModelProviderConfigNotFoundError) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveRuntimeCredentials,\n 'model-provider-not-configured',\n {},\n );\n }\n if (isInterModuleKnownError(secretsInterModuleContract.methods.getSecretsByNamespace, error)) {\n return createInterModuleKnownError(\n agentInterModuleContract.methods.resolveRuntimeCredentials,\n 'model-provider-credentials-invalid',\n {},\n );\n }\n return error;\n}\n"],"names":["agentInterModuleContract","secretsInterModuleContract","createInterModuleKnownError","defineInterModulePresentation","isInterModuleKnownError","InvalidAgentModelError","ModelProviderConfigNotFoundError","UnsupportedHarnessProviderError","UnsupportedHarnessThinkingError","UnsupportedModelProviderError","resolveAgentConfig","resolveRuntimeCredentials","getAgentValidationCatalog","createWorkspaceAgentDefaultsResolver","createAgentInterModulePresentation","params","getValidationCatalog","workspaceId","config","resolve","error","toResolveAgentConfigKnownError","input","secrets","toResolveRuntimeCredentialsKnownError","methods","getSecretsByNamespace"],"mappings":"AAAA,SAAQA,wBAAwB,QAAO,sCAAsC;AAC7E,SAAQC,0BAA0B,QAAO,wCAAwC;AACjF,SACEC,2BAA2B,EAC3BC,6BAA6B,EAE7BC,uBAAuB,QAClB,wBAAwB;AAC/B,SACEC,sBAAsB,EACtBC,gCAAgC,EAChCC,+BAA+B,EAC/BC,+BAA+B,EAC/BC,6BAA6B,QACxB,kBAAkB;AACzB,SAAQC,kBAAkB,QAAO,gCAAgC;AACjE,SAAQC,yBAAyB,QAAO,uCAAuC;AAE/E,SAAQC,yBAAyB,QAAO,8BAA8B;AACtE,SAAQC,oCAAoC,QAAO,6CAA6C;AAEhG,OAAO,SAASC,mCAAmCC,MAElD;IACC,OAAOZ,8BAA8BH,0BAA0B;QAC7DgB,sBAAsB,IAAMJ;QAC5BF,oBAAoB,OAAO,EAACO,WAAW,EAAEC,MAAM,EAAC;YAC9C,IAAI;gBACF,MAAMC,UACJF,gBAAgB,OACZP,qBACA,MAAMG,qCAAqCI;gBACjD,OAAO,MAAME,QAAQD;YACvB,EAAE,OAAOE,OAAO;gBACd,MAAMC,+BAA+BD;YACvC;QACF;QACAT,2BAA2B,OAAOW;YAChC,IAAI;gBACF,OAAO,MAAMX,0BAA0BW,OAAO;oBAACC,SAASR,OAAOQ,OAAO;gBAAA;YACxE,EAAE,OAAOH,OAAO;gBACd,MAAMI,sCAAsCJ;YAC9C;QACF;IACF;AACF;AAEA,SAASC,+BAA+BD,KAAc;IACpD,IACEA,iBAAiBf,0BACjBe,iBAAiBb,mCACjBa,iBAAiBZ,mCACjBY,iBAAiBX,+BACjB;QACA,OAAOP,4BACLF,yBAAyByB,OAAO,CAACf,kBAAkB,EACnD,wBACA,CAAC;IAEL;IACA,OAAOU;AACT;AAEA,SAASI,sCAAsCJ,KAAc;IAC3D,IAAIA,iBAAiBd,kCAAkC;QACrD,OAAOJ,4BACLF,yBAAyByB,OAAO,CAACd,yBAAyB,EAC1D,iCACA,CAAC;IAEL;IACA,IAAIP,wBAAwBH,2BAA2BwB,OAAO,CAACC,qBAAqB,EAAEN,QAAQ;QAC5F,OAAOlB,4BACLF,yBAAyByB,OAAO,CAACd,yBAAyB,EAC1D,sCACA,CAAC;IAEL;IACA,OAAOS;AACT"}
|