@shipfox/client-agent 12.0.2 → 13.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 +22 -0
- package/dist/feature.d.ts +2 -2
- package/dist/feature.js +2 -2
- package/dist/feature.js.map +1 -1
- package/dist/routes/inputs.d.ts +1 -1
- package/dist/routes/inputs.d.ts.map +1 -1
- package/dist/routes/inputs.js +3 -3
- package/dist/routes/inputs.js.map +1 -1
- package/dist/routes/model-provider.d.ts.map +1 -1
- package/dist/routes/model-provider.js +6 -5
- package/dist/routes/model-provider.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/feature.ts +2 -2
- package/src/routes/inputs.test.ts +6 -4
- package/src/routes/inputs.ts +5 -4
- package/src/routes/model-provider.tsx +5 -4
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/client-agent",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "13.0.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"@swc/helpers": "^0.5.17",
|
|
29
29
|
"@tanstack/react-form": "^1.32.0",
|
|
30
30
|
"@tanstack/react-query": "^5.101.0",
|
|
31
|
-
"@shipfox/api-agent-dto": "
|
|
31
|
+
"@shipfox/api-agent-dto": "12.0.0",
|
|
32
32
|
"@shipfox/client-api": "6.0.1",
|
|
33
|
-
"@shipfox/client-shell": "
|
|
34
|
-
"@shipfox/client-ui": "
|
|
35
|
-
"@shipfox/react-ui": "0.
|
|
33
|
+
"@shipfox/client-shell": "13.0.0",
|
|
34
|
+
"@shipfox/client-ui": "13.0.0",
|
|
35
|
+
"@shipfox/react-ui": "0.4.0"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"@tanstack/react-query": "^5.101.0",
|
package/src/feature.ts
CHANGED
|
@@ -14,12 +14,12 @@ export const agentFeature = defineClientFeature({
|
|
|
14
14
|
id: 'shipfox.agent',
|
|
15
15
|
routes: [
|
|
16
16
|
{
|
|
17
|
-
path: '/
|
|
17
|
+
path: '/w/$workspaceSlug/model-provider',
|
|
18
18
|
parent: 'workspaceLayout',
|
|
19
19
|
impl: '@shipfox/client-agent/routes/model-provider',
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
|
-
path: '/
|
|
22
|
+
path: '/w/$workspaceSlug/settings/agents',
|
|
23
23
|
parent: 'workspaceSettings',
|
|
24
24
|
impl: '@shipfox/client-agent/routes/agents-settings',
|
|
25
25
|
},
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {modelProviderRouteParams} from './inputs.js';
|
|
2
2
|
|
|
3
3
|
describe('model provider route inputs', () => {
|
|
4
|
-
it('requires a non-empty workspace
|
|
5
|
-
expect(modelProviderRouteParams({
|
|
6
|
-
|
|
4
|
+
it('requires a non-empty workspace slug', () => {
|
|
5
|
+
expect(modelProviderRouteParams({workspaceSlug: 'workspace-1'})).toEqual({
|
|
6
|
+
workspaceSlug: 'workspace-1',
|
|
7
|
+
});
|
|
8
|
+
expect(() => modelProviderRouteParams({workspaceSlug: ''})).toThrow(
|
|
7
9
|
'Model provider route is missing the workspace path parameter.',
|
|
8
10
|
);
|
|
9
|
-
expect(() => modelProviderRouteParams({
|
|
11
|
+
expect(() => modelProviderRouteParams({workspaceSlug: 42})).toThrow();
|
|
10
12
|
});
|
|
11
13
|
});
|
package/src/routes/inputs.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export function modelProviderRouteParams(input: Record<string, unknown>): {
|
|
2
|
-
const
|
|
3
|
-
if (!
|
|
4
|
-
|
|
1
|
+
export function modelProviderRouteParams(input: Record<string, unknown>): {workspaceSlug: string} {
|
|
2
|
+
const workspaceSlug = stringParam(input.workspaceSlug);
|
|
3
|
+
if (!workspaceSlug)
|
|
4
|
+
throw new Error('Model provider route is missing the workspace path parameter.');
|
|
5
|
+
return {workspaceSlug};
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
function stringParam(value: unknown): string | undefined {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {defineRoute, useRouteParams} from '@shipfox/client-shell/runtime';
|
|
1
|
+
import {defineRoute, useActiveWorkspace, useRouteParams} from '@shipfox/client-shell/runtime';
|
|
2
2
|
import {useNavigate} from '@tanstack/react-router';
|
|
3
3
|
import {ModelProviderOnboardingPage} from '#pages/model-provider-onboarding-page.js';
|
|
4
4
|
import {modelProviderRouteParams} from './inputs.js';
|
|
5
5
|
|
|
6
6
|
export default defineRoute({
|
|
7
7
|
component: () => {
|
|
8
|
-
const {
|
|
8
|
+
const {workspaceSlug} = useRouteParams(modelProviderRouteParams);
|
|
9
|
+
const workspace = useActiveWorkspace();
|
|
9
10
|
const navigate = useNavigate();
|
|
10
11
|
const goToProjectCreation = () => {
|
|
11
|
-
void navigate({to: '/
|
|
12
|
+
void navigate({to: '/w/$workspaceSlug/projects/new', params: {workspaceSlug}, replace: true});
|
|
12
13
|
};
|
|
13
14
|
return (
|
|
14
15
|
<ModelProviderOnboardingPage
|
|
15
|
-
workspaceId={
|
|
16
|
+
workspaceId={workspace.id}
|
|
16
17
|
onSkip={goToProjectCreation}
|
|
17
18
|
onConfigured={goToProjectCreation}
|
|
18
19
|
/>
|