Skip to content

Commit 0750172

Browse files
committed
chore(plugin-inspect): remove storybook-static from git and fix lint errors
Removed the auto-generated storybook-static directory from git tracking, added it to .gitignore, and fixed minor ESLint warnings related to Vue props mutation in the Inspector.
1 parent fb0f35b commit 0750172

79 files changed

Lines changed: 187 additions & 58113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ playwright-report
2121
playwright/.cache
2222
blob-report
2323
.ecosystem
24+
storybook-static

packages/devframe/src/node/__tests__/rpc-streaming.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { createRpcClient } from 'devframe/rpc/client'
55
import { createRpcServer } from 'devframe/rpc/server'
66
import { createWsRpcChannel } from 'devframe/rpc/transports/ws-client'
77
import { attachWsRpcTransport } from 'devframe/rpc/transports/ws-server'
8+
import { getPort } from 'get-port-please'
89
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
910
import { WebSocket } from 'ws'
11+
1012
import { RpcFunctionsHost } from '../host-functions'
1113

1214
vi.stubGlobal('WebSocket', WebSocket)
1315

14-
import { getPort } from 'get-port-please'
15-
1616
interface Harness {
1717
port: number
1818
rpcHost: RpcFunctionsHost

plugins/inspect/.storybook/main.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import type { StorybookConfig } from '@storybook/vue3-vite';
2-
import { mergeConfig } from 'vite';
3-
import vue from '@vitejs/plugin-vue';
4-
import UnoCSS from 'unocss/vite';
5-
import { alias } from '../../../alias';
1+
import type { StorybookConfig } from '@storybook/vue3-vite'
2+
import vue from '@vitejs/plugin-vue'
3+
import UnoCSS from 'unocss/vite'
4+
import { mergeConfig } from 'vite'
5+
import { alias } from '../../../alias'
66

77
const config: StorybookConfig = {
88
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
@@ -16,7 +16,7 @@ const config: StorybookConfig = {
1616
return mergeConfig(config, {
1717
resolve: { alias },
1818
plugins: [vue(), UnoCSS()],
19-
});
19+
})
2020
},
21-
};
22-
export default config;
21+
}
22+
export default config

plugins/inspect/.storybook/preview.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Preview } from '@storybook/vue3';
1+
import type { Preview } from '@storybook/vue3'
22
import 'virtual:uno.css'
33
import '../src/spa/style.css'
44

@@ -24,6 +24,6 @@ const preview: Preview = {
2424
],
2525
},
2626
},
27-
};
27+
}
2828

29-
export default preview;
29+
export default preview

plugins/inspect/src/rpc/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { RpcDefinitionsToFunctions } from 'devframe/rpc'
22
import { describeAgent } from './functions/describe-agent'
33
import { invoke } from './functions/invoke'
4+
import { invokeAgentTool } from './functions/invoke-agent-tool'
45
import { listFunctions } from './functions/list-functions'
56
import { listStateKeys } from './functions/list-state-keys'
6-
import { invokeAgentTool } from './functions/invoke-agent-tool'
77
import { readAgentResource } from './functions/read-agent-resource'
88

99
/**

plugins/inspect/src/spa/App.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import { onMounted, ref } from 'vue'
33
import AgentSmart from './components/AgentSmart.vue'
44
import FunctionsSmart from './components/FunctionsSmart.vue'
5-
import StateSmart from './components/StateSmart.vue'
65
import HistorySmart from './components/HistorySmart.vue'
7-
import { connect, connection } from './composables/rpc'
6+
import StateSmart from './components/StateSmart.vue'
87
import { useRefresh } from './composables/refresh'
8+
import { connect, connection } from './composables/rpc'
99
1010
type Tab = 'functions' | 'state' | 'agent' | 'history'
1111

plugins/inspect/src/spa/components/AgentSmart.vue

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import type { AgentManifest, InvokeResult } from '@devframes/plugin-inspect/client'
33
import { onMounted, reactive, shallowRef } from 'vue'
4-
import { isStatic, useRpc } from '../composables/rpc'
54
import { useRefreshProvider } from '../composables/refresh'
5+
import { isStatic, useRpc } from '../composables/rpc'
66
import AgentView from './AgentView.vue'
77
88
const rpc = useRpc()
@@ -20,27 +20,33 @@ useRefreshProvider(fetchData)
2020
onMounted(fetchData)
2121
2222
async function onInvoke(id: string, parsedArgs: unknown) {
23-
if (!rpc.value) return
23+
if (!rpc.value)
24+
return
2425
pending[id] = true
2526
try {
2627
results[id] = await rpc.value.call('devframes-plugin-inspect:invoke-agent-tool', id, parsedArgs)
27-
} catch (e) {
28+
}
29+
catch (e) {
2830
const err = e as Error
2931
results[id] = { ok: false, error: { name: err?.name ?? 'Error', message: err?.message ?? String(e) } }
30-
} finally {
32+
}
33+
finally {
3134
pending[id] = false
3235
}
3336
}
3437
3538
async function onRead(id: string) {
36-
if (!rpc.value) return
39+
if (!rpc.value)
40+
return
3741
pending[id] = true
3842
try {
3943
results[id] = await rpc.value.call('devframes-plugin-inspect:read-agent-resource', id)
40-
} catch (e) {
44+
}
45+
catch (e) {
4146
const err = e as Error
4247
results[id] = { ok: false, error: { name: err?.name ?? 'Error', message: err?.message ?? String(e) } }
43-
} finally {
48+
}
49+
finally {
4450
pending[id] = false
4551
}
4652
}

plugins/inspect/src/spa/components/AgentView.stories.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Meta, StoryObj } from '@storybook/vue3';
2-
import AgentView from './AgentView.vue';
1+
import type { Meta, StoryObj } from '@storybook/vue3'
2+
import AgentView from './AgentView.vue'
33

44
const meta = {
55
title: 'Inspector/AgentView',
@@ -9,10 +9,10 @@ const meta = {
99
onInvoke: { action: 'invoked' },
1010
onRead: { action: 'read' },
1111
},
12-
} satisfies Meta<typeof AgentView>;
12+
} satisfies Meta<typeof AgentView>
1313

14-
export default meta;
15-
type Story = StoryObj<typeof meta>;
14+
export default meta
15+
type Story = StoryObj<typeof meta>
1616

1717
export const Default: Story = {
1818
args: {
@@ -34,7 +34,7 @@ export const Default: Story = {
3434
title: 'Tool 2',
3535
description: 'A destructive tool',
3636
safety: 'destructive',
37-
}
37+
},
3838
],
3939
resources: [
4040
{
@@ -43,7 +43,7 @@ export const Default: Story = {
4343
name: 'Resource 1',
4444
description: 'A sample resource',
4545
mimeType: 'application/json',
46-
}
46+
},
4747
],
4848
},
4949
isStatic: false,
@@ -55,11 +55,11 @@ export const Default: Story = {
5555
tool2: true,
5656
},
5757
},
58-
};
58+
}
5959

6060
export const StaticMode: Story = {
6161
args: {
6262
...Default.args,
6363
isStatic: true,
6464
},
65-
};
65+
}

plugins/inspect/src/spa/components/AgentView.vue

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import type { AgentManifest, InvokeResult } from '@devframes/plugin-inspect/client'
3-
import { ref, reactive } from 'vue'
3+
import { reactive, ref } from 'vue'
44
import JsonView from './JsonView.vue'
55
6-
const props = defineProps<{
6+
defineProps<{
77
manifest: AgentManifest | null
88
isStatic: boolean
99
results: Record<string, InvokeResult | { ok: false, error: { name: string, message: string } }>
@@ -30,7 +30,8 @@ function invokeTool(id: string) {
3030
try {
3131
const raw = JSON.parse(argsInput[id] || '{}')
3232
parsed = raw
33-
} catch (err) {
33+
}
34+
catch (err) {
3435
// Emitting error would be cleaner, for now we will throw to stop execution
3536
throw new Error(`Invalid JSON args: ${(err as Error).message}`)
3637
}
@@ -73,27 +74,35 @@ function readResource(id: string) {
7374
</div>
7475
<template v-if="expanded === tool.id">
7576
<template v-if="tool.inputSchema">
76-
<div class="label">Input schema</div>
77+
<div class="label">
78+
Input schema
79+
</div>
7780
<JsonView :value="tool.inputSchema" :expand-depth="1" />
7881
</template>
7982
<template v-if="tool.outputSchema">
80-
<div class="label">Output schema</div>
83+
<div class="label">
84+
Output schema
85+
</div>
8186
<JsonView :value="tool.outputSchema" :expand-depth="1" />
8287
</template>
8388
<template v-if="tool.examples && tool.examples.length">
84-
<div class="label">Examples</div>
89+
<div class="label">
90+
Examples
91+
</div>
8592
<JsonView :value="tool.examples" :expand-depth="1" />
8693
</template>
8794

88-
<div class="label">Invoke (MCP format)</div>
95+
<div class="label">
96+
Invoke (MCP format)
97+
</div>
8998
<textarea v-model="argsInput[tool.id]" class="args" spellcheck="false" placeholder="{}" />
9099
<div style="margin-top: 8px; display: flex; gap: 8px; align-items: center;">
91100
<button class="btn" :disabled="pending[tool.id] || isStatic" @click="invokeTool(tool.id)">
92101
{{ pending[tool.id] ? 'Invoking…' : 'Invoke' }}
93102
</button>
94103
<span v-if="isStatic" class="note">read-only static backend</span>
95104
</div>
96-
105+
97106
<div v-if="results[tool.id]" class="result">
98107
<div class="result-head">
99108
<span v-if="results[tool.id].ok" class="ok">✓ resolved</span>
@@ -138,7 +147,7 @@ function readResource(id: string) {
138147
</button>
139148
<span v-if="isStatic" class="note">read-only static backend</span>
140149
</div>
141-
150+
142151
<div v-if="results[res.id]" class="result">
143152
<div class="result-head">
144153
<span v-if="results[res.id].ok" class="ok">✓ resolved</span>

plugins/inspect/src/spa/components/FunctionsSmart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script setup lang="ts">
22
import type { InvokeResult, RpcFunctionInfo } from '@devframes/plugin-inspect/client'
33
import { onMounted, reactive, shallowRef } from 'vue'
4-
import { isStatic, useRpc } from '../composables/rpc'
54
import { useRefreshProvider } from '../composables/refresh'
5+
import { isStatic, useRpc } from '../composables/rpc'
66
import FunctionsView from './FunctionsView.vue'
77
88
const rpc = useRpc()

0 commit comments

Comments
 (0)