diff --git a/docs/content/1.guide/3.rpc.md b/docs/content/1.guide/3.rpc.md index 929074d3f..8ed1835fb 100644 --- a/docs/content/1.guide/3.rpc.md +++ b/docs/content/1.guide/3.rpc.md @@ -193,7 +193,6 @@ Add an `agent` field to expose the function to coding agents over MCP: defineRpcFunction({ name: 'get-modules', type: 'query', - jsonSerializable: true, args: [v.object({ limit: v.number() })], returns: v.array(v.object({ id: v.string(), size: v.number() })), agent: { @@ -207,7 +206,7 @@ defineRpcFunction({ }) ``` -Exposing a function over MCP requires `jsonSerializable: true`. +The `agent` field implicitly enables strict JSON serialization because MCP consumes JSON-shaped data. Set `jsonSerializable: true` directly when an RPC-only function also benefits from that contract. ## What's next diff --git a/docs/content/6.errors/DF0019.md b/docs/content/6.errors/DF0019.md index 027e864ad..e3955b9d9 100644 --- a/docs/content/6.errors/DF0019.md +++ b/docs/content/6.errors/DF0019.md @@ -1,15 +1,15 @@ --- title: 'DF0019: Agent Requires JSON-Serializable RPC' -description: 'RPC function "{name}" has agent set but jsonSerializable is not true; MCP requires JSON-serializable data.' +description: 'RPC function "{name}" has agent set but jsonSerializable is false; MCP requires JSON-serializable data.' --- ## Message -> RPC function "`{name}`" has `agent` set but `jsonSerializable` is not `true`; MCP requires JSON-serializable data. +> RPC function "`{name}`" has `agent` set but `jsonSerializable` is `false`; MCP requires JSON-serializable data. ## Cause -The `agent` field exposes an RPC function as an MCP tool, and MCP only consumes JSON-shaped data. A function with `agent` set is rejected unless it also declares `jsonSerializable: true`. +The `agent` field exposes an RPC function as an MCP tool and implicitly enables strict JSON serialization. An explicit `jsonSerializable: false` conflicts with MCP's JSON-shaped data. ## Example @@ -17,13 +17,14 @@ The `agent` field exposes an RPC function as an MCP tool, and MCP only consumes defineRpcFunction({ name: 'my-plugin:summary', agent: { description: 'Returns a summary' }, - handler: () => ({ items: [1, 2, 3] }), // ✗ throws DF0019: missing jsonSerializable: true + jsonSerializable: false, // ✗ throws DF0019 + handler: () => ({ items: [1, 2, 3] }), }) ``` ## Fix -Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only. +Remove `jsonSerializable: false` to use the implicit JSON contract, or remove `agent` to keep the function RPC-only. ```ts defineRpcFunction({ @@ -36,4 +37,4 @@ defineRpcFunction({ ## Source -- [`packages/devframe/src/rpc/collector.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/rpc/collector.ts): `RpcFunctionsCollectorBase.register()` throws `DF0019` when a definition has `agent` set but is not declared `jsonSerializable: true`. +- [`packages/devframe/src/rpc/agent-json-serialization.ts`](https://github.com/devframes/devframe/blob/main/packages/devframe/src/rpc/agent-json-serialization.ts): `ensureAgentJsonSerializable()` throws `DF0019` when a definition combines `agent` with `jsonSerializable: false` during registration or static dump collection. diff --git a/packages/devframe/src/rpc/agent-json-serialization.ts b/packages/devframe/src/rpc/agent-json-serialization.ts new file mode 100644 index 000000000..4675fa89d --- /dev/null +++ b/packages/devframe/src/rpc/agent-json-serialization.ts @@ -0,0 +1,16 @@ +import type { RpcFunctionDefinitionAny } from './types' +import { diagnostics } from './diagnostics' + +/** + * Prevents using a coding-agent-exposed RPC function that is explicitly + * marked as non-serializable, and marks these functions as serializable by + * default. + * + * @internal + */ +export function ensureAgentJsonSerializable(fnDef: RpcFunctionDefinitionAny): void { + if (fnDef.agent && fnDef.jsonSerializable === false) + throw diagnostics.DF0019({ name: fnDef.name }) + if (fnDef.agent && !fnDef.jsonSerializable) + fnDef.jsonSerializable = true +} diff --git a/packages/devframe/src/rpc/collector.test.ts b/packages/devframe/src/rpc/collector.test.ts index b5c833fb5..d067a509f 100644 --- a/packages/devframe/src/rpc/collector.test.ts +++ b/packages/devframe/src/rpc/collector.test.ts @@ -2,13 +2,14 @@ import { describe, expect, it, vi } from 'vitest' import { RpcFunctionsCollectorBase } from './collector' describe('agent gating (DF0019)', () => { - it('rejects registration when agent is set without jsonSerializable: true', () => { + it('infers jsonSerializable: true when agent is set', () => { const collector = new RpcFunctionsCollectorBase({}) - expect(() => collector.register({ + collector.register({ name: 'plugin:fn', agent: { description: 'x' }, handler: () => 0, - } as any)).toThrowError(/MCP requires JSON-serializable/) + } as any) + expect(collector.get('plugin:fn')?.jsonSerializable).toBe(true) }) it('rejects when agent + jsonSerializable: false', () => { @@ -40,14 +41,15 @@ describe('agent gating (DF0019)', () => { } as any)).not.toThrow() }) - it('also enforces the gate on update()', () => { + it('also infers jsonSerializable: true on update()', () => { const collector = new RpcFunctionsCollectorBase({}) collector.register({ name: 'plugin:fn', handler: () => 0 } as any) - expect(() => collector.update({ + collector.update({ name: 'plugin:fn', agent: { description: 'x' }, handler: () => 0, - } as any)).toThrowError(/MCP requires JSON-serializable/) + } as any) + expect(collector.get('plugin:fn')?.jsonSerializable).toBe(true) }) }) diff --git a/packages/devframe/src/rpc/collector.ts b/packages/devframe/src/rpc/collector.ts index 3025ce48a..4939f50b5 100644 --- a/packages/devframe/src/rpc/collector.ts +++ b/packages/devframe/src/rpc/collector.ts @@ -1,4 +1,5 @@ import type { RpcArgsSchema, RpcFunctionDefinition, RpcFunctionsCollector, RpcReturnSchema } from './types' +import { ensureAgentJsonSerializable } from './agent-json-serialization' import { diagnostics } from './diagnostics' import { getRpcHandler } from './handler' @@ -39,20 +40,20 @@ export class RpcFunctionsCollectorBase< }) as LocalFunctions } - register(fn: RpcFunctionDefinition, force = false): void { - if (this.definitions.has(fn.name) && !force) { - throw diagnostics.DF0021({ name: fn.name }) + register(fnDef: RpcFunctionDefinition, force = false): void { + if (this.definitions.has(fnDef.name) && !force) { + throw diagnostics.DF0021({ name: fnDef.name }) } - assertAgentJsonSerializable(fn) - this.definitions.set(fn.name, fn) - this._onChanged.forEach(cb => cb(fn.name)) + ensureAgentJsonSerializable(fnDef) + this.definitions.set(fnDef.name, fnDef) + this._onChanged.forEach(cb => cb(fnDef.name)) } update(fn: RpcFunctionDefinition, force = false): void { if (!this.definitions.has(fn.name) && !force) { throw diagnostics.DF0022({ name: fn.name }) } - assertAgentJsonSerializable(fn) + ensureAgentJsonSerializable(fn) this.definitions.set(fn.name, fn) this._onChanged.forEach(cb => cb(fn.name)) } @@ -93,10 +94,3 @@ export class RpcFunctionsCollectorBase< return Array.from(this.definitions.keys()) } } - -function assertAgentJsonSerializable( - fn: RpcFunctionDefinition, -): void { - if (fn.agent && fn.jsonSerializable !== true) - throw diagnostics.DF0019({ name: fn.name }) -} diff --git a/packages/devframe/src/rpc/diagnostics.ts b/packages/devframe/src/rpc/diagnostics.ts index a2173f988..180b4a633 100644 --- a/packages/devframe/src/rpc/diagnostics.ts +++ b/packages/devframe/src/rpc/diagnostics.ts @@ -5,8 +5,8 @@ export const diagnostics = defineDiagnostics({ codes: { DF0019: { why: (p: { name: string }) => - `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\`; MCP requires JSON-serializable data.`, - fix: 'Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only.', + `RPC function "${p.name}" has \`agent\` set but \`jsonSerializable\` is \`false\`; MCP requires JSON-serializable data.`, + fix: 'Remove `jsonSerializable: false`, or remove `agent` to keep it RPC-only.', }, DF0020: { why: (p: { name: string, type: string, path: string }) => diff --git a/packages/devframe/src/rpc/dump/__tests__/static.test.ts b/packages/devframe/src/rpc/dump/__tests__/static.test.ts index 472436c28..acb2969b0 100644 --- a/packages/devframe/src/rpc/dump/__tests__/static.test.ts +++ b/packages/devframe/src/rpc/dump/__tests__/static.test.ts @@ -25,6 +25,26 @@ describe('collectStaticRpcDump', () => { expect(result.files[expectedPath]?.serialization).toBe('json') }) + it('infers JSON serialization for directly collected coding-agent-exposed functions', async () => { + const getVersion = defineRpcFunction({ + name: 'test:agent-version', + type: 'static', + agent: { description: 'Return the current version.' }, + handler: () => '1.0.0', + }) + + const result = await collectStaticRpcDump([getVersion], {}) + const expectedPath = `${DEVFRAME_RPC_DUMP_DIRNAME}/test~agent-version.static.json` + + expect(getVersion.jsonSerializable).toBe(true) + expect(result.manifest['test:agent-version']).toEqual({ + type: 'static', + path: expectedPath, + serialization: 'json', + }) + expect(result.files[expectedPath]?.serialization).toBe('json') + }) + it('collects static rpc output into sharded file entries', async () => { const getVersion = defineRpcFunction({ name: 'test:get-version', diff --git a/packages/devframe/src/rpc/dump/static.ts b/packages/devframe/src/rpc/dump/static.ts index d980d4c49..8822a1841 100644 --- a/packages/devframe/src/rpc/dump/static.ts +++ b/packages/devframe/src/rpc/dump/static.ts @@ -2,6 +2,7 @@ import type { RpcDumpRecord, RpcFunctionDefinitionAny } from '../types' import { DEVFRAME_RPC_DUMP_DIRNAME, } from 'devframe/constants' +import { ensureAgentJsonSerializable } from '../agent-json-serialization' import { getRpcHandler } from '../handler' import { dumpFunctions } from './collect' @@ -131,6 +132,7 @@ export async function collectStaticRpcDump( const files: Record = {} for (const definition of definitions) { + ensureAgentJsonSerializable(definition) const type = definition.type ?? 'query' const serialization: StaticRpcDumpSerialization = definition.jsonSerializable === true ? 'json' : 'structured-clone' diff --git a/packages/devframe/src/rpc/types.test.ts b/packages/devframe/src/rpc/types.test.ts index 6e6a86dbb..1f2abf3a5 100644 --- a/packages/devframe/src/rpc/types.test.ts +++ b/packages/devframe/src/rpc/types.test.ts @@ -25,6 +25,20 @@ function schema(): StandardSchemaV1 { } describe('rpcFunctionDefinitionToFunction', () => { + it('requires args and returns schemas together', () => { + // @ts-expect-error args and returns schemas must be provided together + defineRpcFunction({ + name: 'missingReturns', + args: [v.string()], + }) + + // @ts-expect-error args and returns schemas must be provided together + defineRpcFunction({ + name: 'missingArgs', + returns: v.string(), + }) + }) + it('should infer types from generic parameters when no schemas', () => { const fn = defineRpcFunction({ name: 'noSchema', diff --git a/packages/devframe/src/rpc/types.ts b/packages/devframe/src/rpc/types.ts index 10bfdcd55..781ee9f59 100644 --- a/packages/devframe/src/rpc/types.ts +++ b/packages/devframe/src/rpc/types.ts @@ -162,28 +162,53 @@ export type RpcDump = | RpcDumpDefinition | RpcDumpGetter -/** - * Base function definition metadata. - */ -export interface RpcFunctionDefinitionBase { +/** Shared fields for an RPC function definition. */ +export interface RpcFunctionDefinitionBase< + NAME extends string = string, + TYPE extends RpcFunctionType = RpcFunctionType, + ARGS extends any[] = any[], + RETURN = any, + CONTEXT = any, +> { /** Function name (unique identifier) */ - name: string + name: NAME /** Function type (static, action, event, or query) */ - type?: RpcFunctionType + type?: TYPE + /** Whether the function results should be cached */ + cacheable?: boolean /** - * Declares whether this function's args/return are JSON-serializable, - * i.e. no `Map`, `Set`, `Date`, `BigInt`, class instances, circular - * references, `undefined` leaves, `Symbol`, or `Function` values. + * Selects the serialization format for arguments and return values. * - * - `true`: args and return are encoded with strict `JSON.stringify` - * on the wire and on disk. Misshapen values throw `DF0019` at the - * sender, surfacing the bug *during the offending call* rather than - * silently coercing to `{}` later. Required for `agent` exposure. - * - `false` (default): payloads use `structured-clone-es`, which - * round-trips Maps/Sets/cycles. Functions in this mode cannot be - * exposed via the `agent` field; registration throws `DF0018`. + * - `true`: uses strict JSON encoding (default when `agent` is set). + * - `false` (default otherwise): uses structured-clone encoding and supports values + * such as `Map`, `Set`, `Date`, and cycles. Functions using this mode + * cannot be agent-exposed. */ jsonSerializable?: boolean + /** + * Expose this function to agents (e.g. via the MCP adapter). + * When omitted, the function is not agent-exposed (default-deny). + */ + agent?: RpcFunctionAgentOptions + /** Setup function called with context to initialize handler and dump */ + setup?: (context: CONTEXT) => Thenable> + /** Function implementation (required if setup doesn't provide one) */ + handler?: (...args: ARGS) => RETURN + /** Dump definition (setup dump takes priority) */ + dump?: RpcDump + /** + * Sugar for "query in dev, single baked snapshot in build": when + * `true` and no `dump` is provided, the build adapter runs the + * handler once with no arguments and stores the result as both a + * no-args record and the fallback so any call variant resolves + * to the same snapshot. Only valid on `query` (or untyped) + * functions; `static` already has equivalent default behavior. + */ + snapshot?: boolean + /** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */ + __cache?: WeakMap>> + /** Single-slot fallback for primitive contexts. @internal */ + __promise?: Thenable> } /** @@ -192,13 +217,49 @@ export interface RpcFunctionDefinitionBase { */ export interface RpcDumpStore { /** Function definitions keyed by name */ - definitions: Record + definitions: Record> /** Records keyed by '---' or '---fallback' */ records: Record Promise)> /** @internal */ _functions?: T } +/** RPC function definition whose handler supplies its argument and return types. */ +export interface RpcFunctionDefinitionWithoutSchemas< + NAME extends string, + TYPE extends RpcFunctionType, + ARGS extends any[], + RETURN, + AS extends RpcArgsSchema | undefined, + RS extends RpcReturnSchema | undefined, + CONTEXT, +> extends RpcFunctionDefinitionBase { + /** Standard Schema array validating (and typing) the arguments */ + args?: AS + /** Standard Schema validating (and typing) the return value */ + returns?: RS +} + +/** RPC function definition whose argument and return types come from schemas. */ +export interface RpcFunctionDefinitionWithSchemas< + NAME extends string, + TYPE extends RpcFunctionType, + AS extends RpcArgsSchema | undefined, + RS extends RpcReturnSchema | undefined, + CONTEXT, +> extends RpcFunctionDefinitionBase< + NAME, + TYPE, + InferArgsType, + Thenable>, + CONTEXT + > { + /** Standard Schema array validating (and typing) the arguments */ + args: AS + /** Standard Schema validating (and typing) the resolved return value */ + returns: RS +} + /** * Dump client options. */ @@ -233,102 +294,8 @@ export type RpcFunctionDefinition< CONTEXT = undefined, > = [AS, RS] extends [undefined, undefined] - ? { - /** Function name (unique identifier) */ - name: NAME - /** Function type (static, action, event, or query) */ - type?: TYPE - /** Whether the function results should be cached */ - cacheable?: boolean - /** Standard Schema array validating (and typing) the arguments */ - args?: AS - /** Standard Schema validating (and typing) the return value */ - returns?: RS - /** - * Declares whether this function's args/return are JSON-serializable - * (no Map/Set/Date/BigInt/cycles/class instances/undefined/Symbol/Function). - * - * - `true`: wire and dump use strict `JSON.stringify`; misshapen - * values throw `DF0019` at the call site. Required for `agent`. - * - `false` (default): `structured-clone-es` round-trips fancy - * types. Cannot be `agent`-exposed (registration throws `DF0018`). - */ - jsonSerializable?: boolean - /** - * Expose this function to agents (e.g. via the MCP adapter). - * When omitted, the function is not agent-exposed (default-deny). - */ - agent?: RpcFunctionAgentOptions - /** Setup function called with context to initialize handler and dump */ - setup?: (context: CONTEXT) => Thenable> - /** Function implementation (required if setup doesn't provide one) */ - handler?: (...args: ARGS) => RETURN - /** Dump definition (setup dump takes priority) */ - dump?: RpcDump - /** - * Sugar for "query in dev, single baked snapshot in build": when - * `true` and no `dump` is provided, the build adapter runs the - * handler once with no arguments and stores the result as both a - * no-args record and the fallback so any call variant resolves - * to the same snapshot. Only valid on `query` (or untyped) - * functions; `static` already has equivalent default behavior. - */ - snapshot?: boolean - /** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */ - __cache?: WeakMap>> - /** Single-slot fallback for primitive contexts. @internal */ - __promise?: Thenable> - } - : { - /** Function name (unique identifier) */ - name: NAME - /** Function type (static, action, event, or query) */ - type?: TYPE - /** Whether the function results should be cached */ - cacheable?: boolean - /** Standard Schema array validating (and typing) the arguments */ - args: AS - /** Standard Schema validating (and typing) the return value */ - returns: RS - /** - * Declares whether this function's args/return are JSON-serializable - * (no Map/Set/Date/BigInt/cycles/class instances/undefined/Symbol/Function). - * - * - `true`: wire and dump use strict `JSON.stringify`; misshapen - * values throw `DF0019` at the call site. Required for `agent`. - * - `false` (default): `structured-clone-es` round-trips fancy - * types. Cannot be `agent`-exposed (registration throws `DF0018`). - */ - jsonSerializable?: boolean - /** - * Expose this function to agents (e.g. via the MCP adapter). - * When omitted, the function is not agent-exposed (default-deny). - */ - agent?: RpcFunctionAgentOptions - /** Setup function called with context to initialize handler and dump */ - setup?: (context: CONTEXT) => Thenable, Thenable>>> - /** - * Function implementation (required if setup doesn't provide one). - * The declared `returns` schema describes the *resolved* value: - * async handlers return a promise of it (the runtime always awaits). - */ - handler?: (...args: InferArgsType) => Thenable> - /** Dump definition (setup dump takes priority) */ - dump?: RpcDump, Thenable>, CONTEXT> - /** - * Sugar for "query in dev, single baked snapshot in build": when - * `true` and no `dump` is provided, the build adapter runs the - * handler once with no arguments and stores the result as both a - * no-args record and the fallback so any call variant resolves - * to the same snapshot. Only valid on `query` (or untyped) - * functions; `static` already has equivalent default behavior. - */ - snapshot?: boolean - /** Per-context setup-result cache, populated by `getRpcResolvedSetupResult`. @internal */ - __cache?: WeakMap, Thenable>>>> - /** Single-slot fallback for primitive contexts. @internal */ - __promise?: Thenable, Thenable>>> - } + ? RpcFunctionDefinitionWithoutSchemas + : RpcFunctionDefinitionWithSchemas export type RpcFunctionDefinitionToFunction = T extends { args: infer AS, returns: infer RS } diff --git a/tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.d.ts index e71d63c87..f57f05d5a 100644 --- a/tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.d.ts @@ -89,186 +89,20 @@ export declare function createSimpleClientScript(_: string | ((_: any) => void)) // #region Variables export declare const builtinHubRpcDeclarations: readonly RpcFunctionDefinitionAny[]; -export declare const hubCommandsExecute: { - name: "hub:commands:execute"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string, ...args: any[]) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, ...args: any[]], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubDocksActivate: { - name: "hub:docks:activate"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable; - }], Promise>>) | undefined; - handler?: ((input: { - dockId: string; - params?: Record; - }) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[input: { - dockId: string; - params?: Record; - }], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap; - }], Promise>>> | undefined; - __promise?: import("devframe/rpc").Thenable; - }], Promise>> | undefined; -}; -export declare const hubMessagesAdd: { - name: "hub:messages:add"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((input: DevframeMessageEntryInput) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[input: DevframeMessageEntryInput], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubMessagesClear: { - name: "hub:messages:clear"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubMessagesRemove: { - name: "hub:messages:remove"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubMessagesUpdate: { - name: "hub:messages:update"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable], Promise>>) | undefined; - handler?: ((id: string, patch: Partial) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, patch: Partial], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap], Promise>>> | undefined; - __promise?: import("devframe/rpc").Thenable], Promise>> | undefined; -}; -export declare const hubTerminalsRemove: { - name: "hub:terminals:remove"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubTerminalsResize: { - name: "hub:terminals:resize"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string, cols: number, rows: number) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, cols: number, rows: number], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubTerminalsRestart: { - name: "hub:terminals:restart"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubTerminalsTerminate: { - name: "hub:terminals:terminate"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const hubTerminalsWrite: { - name: "hub:terminals:write"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: DevframeHubContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string, data: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, data: string], Promise, DevframeHubContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; +export declare const hubCommandsExecute: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:commands:execute", "action", [id: string, ...args: any[]], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubDocksActivate: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:docks:activate", "action", [input: { + dockId: string; + params?: Record; +}], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubMessagesAdd: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:messages:add", "action", [input: DevframeMessageEntryInput], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubMessagesClear: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:messages:clear", "action", [], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubMessagesRemove: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:messages:remove", "action", [id: string], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubMessagesUpdate: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:messages:update", "action", [id: string, patch: Partial], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubTerminalsRemove: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:terminals:remove", "action", [id: string], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubTerminalsResize: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:terminals:resize", "action", [id: string, cols: number, rows: number], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubTerminalsRestart: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:terminals:restart", "action", [id: string], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubTerminalsTerminate: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:terminals:terminate", "action", [id: string], Promise, undefined, undefined, DevframeHubContext>; +export declare const hubTerminalsWrite: import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"hub:terminals:write", "action", [id: string, data: string], Promise, undefined, undefined, DevframeHubContext>; // #endregion // #region Referenced (internal) diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-assets/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-assets/rpc.snapshot.d.ts index ea7fff0ad..b8cf801a7 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-assets/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-assets/rpc.snapshot.d.ts @@ -28,1066 +28,220 @@ export declare const assetInfoSchema: import("devframe/utils/simple-schema").Sim mtime: number; fsPath?: string | undefined; }>; -export declare const capabilities: { - name: "devframes:plugin:assets:capabilities"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - write: boolean; - uploadExtensions: string[] | "*"; - }, { - write: boolean; - uploadExtensions: string[] | "*"; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const deleteAssets: { - name: "devframes:plugin:assets:delete"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - paths: string[]; - }, { - paths: string[]; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - deleted: string[]; - }, { - deleted: string[]; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - paths: string[]; - }) => import("devframe/rpc").Thenable<{ - deleted: string[]; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - paths: string[]; - }], import("devframe/rpc").Thenable<{ - deleted: string[]; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const list: { - name: "devframes:plugin:assets:list"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[], { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const mkdir: { - name: "devframes:plugin:assets:mkdir"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const readFunctions: readonly [{ - name: "devframes:plugin:assets:list"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[], { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; +export declare const capabilities: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:capabilities", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + write: boolean; + uploadExtensions: string[] | "*"; }, { - name: "devframes:plugin:assets:read-image-meta"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null, { - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string) => import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>) | undefined; - dump?: import("devframe/rpc").RpcDump<[string], import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + write: boolean; + uploadExtensions: string[] | "*"; +}>, import("devframe").DevframeNodeContext>; +export declare const deleteAssets: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:delete", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + paths: string[]; }, { - name: "devframes:plugin:assets:read-text"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string, args_1: number | undefined) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[string, number | undefined], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + paths: string[]; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + deleted: string[]; }, { - name: "devframes:plugin:assets:capabilities"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - write: boolean; - uploadExtensions: string[] | "*"; - }, { - write: boolean; - uploadExtensions: string[] | "*"; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; -export declare const readImageMeta: { - name: "devframes:plugin:assets:read-image-meta"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null, { - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string) => import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>) | undefined; - dump?: import("devframe/rpc").RpcDump<[string], import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const readText: { - name: "devframes:plugin:assets:read-text"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string, args_1: number | undefined) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[string, number | undefined], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const rename: { - name: "devframes:plugin:assets:rename"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - newName: string; - }, { - path: string; - newName: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }, { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - newName: string; - }) => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - newName: string; - }], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:assets:list"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[], { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }[]>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + deleted: string[]; +}>, import("devframe").DevframeNodeContext>; +export declare const list: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:list", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[], { + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[]>, import("devframe").DevframeNodeContext>; +export declare const mkdir: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:mkdir", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; }, { - name: "devframes:plugin:assets:read-image-meta"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null, { - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string) => import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>) | undefined; - dump?: import("devframe/rpc").RpcDump<[string], import("devframe/rpc").Thenable<{ - width?: number | undefined; - height?: number | undefined; - orientation?: number | undefined; - } | null>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>; +export declare const readFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:list", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[], { + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[]>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-image-meta", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema<{ + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null, { + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-text", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:capabilities", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + write: boolean; + uploadExtensions: string[] | "*"; }, { - name: "devframes:plugin:assets:read-text"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: string, args_1: number | undefined) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[string, number | undefined], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + write: boolean; + uploadExtensions: string[] | "*"; +}>, import("devframe").DevframeNodeContext>]; +export declare const readImageMeta: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-image-meta", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema<{ + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null, { + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null>, import("devframe").DevframeNodeContext>; +export declare const readText: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-text", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>; +export declare const rename: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:rename", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + newName: string; }, { - name: "devframes:plugin:assets:capabilities"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - write: boolean; - uploadExtensions: string[] | "*"; - }, { - write: boolean; - uploadExtensions: string[] | "*"; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - write: boolean; - uploadExtensions: string[] | "*"; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + path: string; + newName: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; }, { - name: "devframes:plugin:assets:upload"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - uploadId: string; - }, { - uploadId: string; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable<{ - uploadId: string; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable<{ - uploadId: string; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}>, import("devframe").DevframeNodeContext>; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:list", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[], { + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}[]>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-image-meta", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema<{ + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null, { + width?: number | undefined; + height?: number | undefined; + orientation?: number | undefined; +} | null>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:read-text", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema, import("devframe/utils/simple-schema").SimpleSchema], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:capabilities", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + write: boolean; + uploadExtensions: string[] | "*"; +}, { + write: boolean; + uploadExtensions: string[] | "*"; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:upload", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; +}, { + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + uploadId: string; +}, { + uploadId: string; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:rename", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + newName: string; +}, { + path: string; + newName: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}, { + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:delete", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + paths: string[]; +}, { + paths: string[]; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + deleted: string[]; +}, { + deleted: string[]; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:mkdir", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; }, { - name: "devframes:plugin:assets:rename"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - newName: string; - }, { - path: string; - newName: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }, { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - newName: string; - }) => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - newName: string; - }], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>]; +export declare const upload: import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:upload", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; }, { - name: "devframes:plugin:assets:delete"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - paths: string[]; - }, { - paths: string[]; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - deleted: string[]; - }, { - deleted: string[]; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - paths: string[]; - }) => import("devframe/rpc").Thenable<{ - deleted: string[]; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - paths: string[]; - }], import("devframe/rpc").Thenable<{ - deleted: string[]; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + uploadId: string; }, { - name: "devframes:plugin:assets:mkdir"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; -export declare const upload: { - name: "devframes:plugin:assets:upload"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - uploadId: string; - }, { - uploadId: string; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable<{ - uploadId: string; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable<{ - uploadId: string; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}; + uploadId: string; +}>, import("devframe").DevframeNodeContext>; export declare const UPLOAD_CHANNEL: string; -export declare const writeFunctions: readonly [{ - name: "devframes:plugin:assets:upload"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - uploadId: string; - }, { - uploadId: string; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable<{ - uploadId: string; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable<{ - uploadId: string; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; +export declare const writeFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:upload", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; +}, { + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + uploadId: string; +}, { + uploadId: string; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:rename", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + newName: string; +}, { + path: string; + newName: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}, { + path: string; + type: "image" | "font" | "video" | "audio" | "text" | "other"; + publicPath: string; + size: number; + mtime: number; + fsPath?: string | undefined; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:delete", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + paths: string[]; }, { - name: "devframes:plugin:assets:rename"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - newName: string; - }, { - path: string; - newName: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }, { - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - newName: string; - }) => import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - newName: string; - }], import("devframe/rpc").Thenable<{ - path: string; - type: "image" | "font" | "video" | "audio" | "text" | "other"; - publicPath: string; - size: number; - mtime: number; - fsPath?: string | undefined; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + paths: string[]; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + deleted: string[]; }, { - name: "devframes:plugin:assets:delete"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - paths: string[]; - }, { - paths: string[]; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - deleted: string[]; - }, { - deleted: string[]; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - paths: string[]; - }) => import("devframe/rpc").Thenable<{ - deleted: string[]; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - paths: string[]; - }], import("devframe/rpc").Thenable<{ - deleted: string[]; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + deleted: string[]; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:assets:mkdir", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + path: string; }, { - name: "devframes:plugin:assets:mkdir"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - path: string; - }, { - path: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - path: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - path: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; + path: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>]; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-code-server/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-code-server/rpc.snapshot.d.ts index ca1fb9171..355171ece 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-code-server/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-code-server/rpc.snapshot.d.ts @@ -2,61 +2,5 @@ * Generated by tsnapi — public API snapshot of `@devframes/plugin-code-server/rpc` */ // #region Variables -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:code-server:detect"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:code-server:status"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>) | undefined; - handler?: (() => CodeServerStatusResult) | undefined; - dump?: import("devframe/rpc").RpcDump<[], CodeServerStatusResult, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>> | undefined; - __promise?: import("devframe/rpc").Thenable> | undefined; -}, { - name: "devframes:plugin:code-server:start"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((req?: CodeServerStartRequest | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[req?: CodeServerStartRequest | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:code-server:stop"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>) | undefined; - handler?: (() => CodeServerStatusResult) | undefined; - dump?: import("devframe/rpc").RpcDump<[], CodeServerStatusResult, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>> | undefined; - __promise?: import("devframe/rpc").Thenable> | undefined; -}]; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:code-server:detect", "query", [], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:code-server:status", "query", [], CodeServerStatusResult, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:code-server:start", "action", [req?: CodeServerStartRequest | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:code-server:stop", "action", [], CodeServerStatusResult, undefined, undefined, import("devframe").DevframeNodeContext>]; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/node.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/node.snapshot.d.ts index d442f885d..29f12d022 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/node.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-data-inspector/node.snapshot.d.ts @@ -15,163 +15,13 @@ export declare function setupDataInspector(_: DevframeNodeContext, _?: SetupData // #region Variables export declare const DATA_CHANGED_EVENT: string; export declare const EXAMPLE_SOURCE_ID: string; -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:data-inspector:sources"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:query"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((sourceId: string, joraQuery: string, options?: ({ - maxDepth?: number; - maxEntries?: number; - } & FilterOptions) | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[sourceId: string, joraQuery: string, options?: ({ - maxDepth?: number; - maxEntries?: number; - } & FilterOptions) | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:queryPath"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((sourceId: string, joraQuery: string, path: NodePath, options?: ({ - maxDepth?: number; - maxEntries?: number; - } & FilterOptions) | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[sourceId: string, joraQuery: string, path: NodePath, options?: ({ - maxDepth?: number; - maxEntries?: number; - } & FilterOptions) | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:skeleton"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((sourceId: string, options?: FilterOptions | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[sourceId: string, options?: FilterOptions | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:suggest"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((sourceId: string, joraQuery: string, pos: number) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[sourceId: string, joraQuery: string, pos: number], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:saved:list"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:saved:save"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((input: SaveQueryInput) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[input: SaveQueryInput], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:saved:delete"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string, scope: SavedQueryScope) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, scope: SavedQueryScope], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:data-inspector:write"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((sourceId: string, request: WriteRequest, options?: WriteApplyOptions | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[sourceId: string, request: WriteRequest, options?: WriteApplyOptions | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:sources", "query", [], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:query", "query", [sourceId: string, joraQuery: string, options?: ({ + maxDepth?: number; + maxEntries?: number; +} & FilterOptions) | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:queryPath", "query", [sourceId: string, joraQuery: string, path: NodePath, options?: ({ + maxDepth?: number; + maxEntries?: number; +} & FilterOptions) | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:skeleton", "query", [sourceId: string, options?: FilterOptions | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:suggest", "query", [sourceId: string, joraQuery: string, pos: number], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:saved:list", "query", [], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:saved:save", "action", [input: SaveQueryInput], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:saved:delete", "action", [id: string, scope: SavedQueryScope], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:data-inspector:write", "action", [sourceId: string, request: WriteRequest, options?: WriteApplyOptions | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>]; export declare const SOURCES_CHANGED_EVENT: string; // #endregion diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-messages/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-messages/rpc.snapshot.d.ts index 1d267a3db..177725b0d 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-messages/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-messages/rpc.snapshot.d.ts @@ -2,75 +2,5 @@ * Generated by tsnapi — public API snapshot of `@devframes/plugin-messages/rpc` */ // #region Variables -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:messages:list"; - type?: "query" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((since?: number | null | undefined) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[since?: number | null | undefined], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:messages:add"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((input: import("@devframes/hub/types").DevframeMessageEntryInput) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[input: import("@devframes/hub/types").DevframeMessageEntryInput], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:messages:update"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable], Promise>>) | undefined; - handler?: ((id: string, patch: Partial) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string, patch: Partial], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap], Promise>>> | undefined; - __promise?: import("devframe/rpc").Thenable], Promise>> | undefined; -}, { - name: "devframes:plugin:messages:remove"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((id: string) => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[id: string], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}, { - name: "devframes:plugin:messages:clear"; - type?: "action" | undefined; - cacheable?: boolean; - args?: undefined; - returns?: undefined; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => Promise) | undefined; - dump?: import("devframe/rpc").RpcDump<[], Promise, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:messages:list", "query", [since?: number | null | undefined], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:messages:add", "action", [input: import("@devframes/hub/types").DevframeMessageEntryInput], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:messages:update", "action", [id: string, patch: Partial], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:messages:remove", "action", [id: string], Promise, undefined, undefined, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithoutSchemas<"devframes:plugin:messages:clear", "action", [], Promise, undefined, undefined, import("devframe").DevframeNodeContext>]; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-og/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-og/rpc.snapshot.d.ts index 2e344fa4b..4aae34817 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-og/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-og/rpc.snapshot.d.ts @@ -2,105 +2,31 @@ * Generated by tsnapi — public API snapshot of `@devframes/plugin-og/rpc` */ // #region Variables -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:og:resolve-metadata"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - url?: string | undefined; - }, { - url?: string | undefined; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - requestedUrl: string; - url: string; - status: number; - fetchedAt: number; - tags: { - tag: "html" | "link" | "meta" | "title"; - name: string; - value: string; - }[]; - }, { - requestedUrl: string; - url: string; - status: number; - fetchedAt: number; - tags: { - tag: "html" | "link" | "meta" | "title"; - name: string; - value: string; - }[]; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - url?: string | undefined; - }) => import("devframe/rpc").Thenable<{ - requestedUrl: string; - url: string; - status: number; - fetchedAt: number; - tags: { - tag: "html" | "link" | "meta" | "title"; - name: string; - value: string; - }[]; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - url?: string | undefined; - }], import("devframe/rpc").Thenable<{ - requestedUrl: string; - url: string; - status: number; - fetchedAt: number; - tags: { - tag: "html" | "link" | "meta" | "title"; - name: string; - value: string; - }[]; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:og:resolve-metadata", "query", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + url?: string | undefined; +}, { + url?: string | undefined; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + requestedUrl: string; + url: string; + status: number; + fetchedAt: number; + tags: { + tag: "html" | "link" | "meta" | "title"; + name: string; + value: string; + }[]; +}, { + requestedUrl: string; + url: string; + status: number; + fetchedAt: number; + tags: { + tag: "html" | "link" | "meta" | "title"; + name: string; + value: string; + }[]; +}>, import("devframe").DevframeNodeContext>]; // #endregion // #region Other diff --git a/tests/__snapshots__/tsnapi/@devframes/plugin-terminals/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/@devframes/plugin-terminals/rpc.snapshot.d.ts index 10ebb0f9f..7b7e306a6 100644 --- a/tests/__snapshots__/tsnapi/@devframes/plugin-terminals/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/@devframes/plugin-terminals/rpc.snapshot.d.ts @@ -2,775 +2,185 @@ * Generated by tsnapi — public API snapshot of `@devframes/plugin-terminals/rpc` */ // #region Variables -export declare const serverFunctions: readonly [{ - name: "devframes:plugin:terminals:list"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }[], { - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }[]>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }[]>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }[]>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; +export declare const serverFunctions: readonly [import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:list", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; +}[], { + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; +}[]>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:presets", "query", readonly [], import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + title: string; + command: string; + args: string[]; + mode: "interactive" | "readonly"; + icon?: string | undefined; +}[], { + id: string; + title: string; + command: string; + args: string[]; + mode: "interactive" | "readonly"; + icon?: string | undefined; +}[]>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:spawn", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + presetId?: string | undefined; + command?: string | undefined; + args?: string[] | undefined; + cwd?: string | undefined; + mode?: "interactive" | "readonly" | undefined; + title?: string | undefined; + cols?: number | undefined; + rows?: number | undefined; + env?: Record | undefined; }, { - name: "devframes:plugin:terminals:presets"; - type?: "query" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - title: string; - command: string; - args: string[]; - mode: "interactive" | "readonly"; - icon?: string | undefined; - }[], { - id: string; - title: string; - command: string; - args: string[]; - mode: "interactive" | "readonly"; - icon?: string | undefined; - }[]>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable<{ - id: string; - title: string; - command: string; - args: string[]; - mode: "interactive" | "readonly"; - icon?: string | undefined; - }[]>) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable<{ - id: string; - title: string; - command: string; - args: string[]; - mode: "interactive" | "readonly"; - icon?: string | undefined; - }[]>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + presetId?: string | undefined; + command?: string | undefined; + args?: string[] | undefined; + cwd?: string | undefined; + mode?: "interactive" | "readonly" | undefined; + title?: string | undefined; + cols?: number | undefined; + rows?: number | undefined; + env?: Record | undefined; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; }, { - name: "devframes:plugin:terminals:spawn"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - presetId?: string | undefined; - command?: string | undefined; - args?: string[] | undefined; - cwd?: string | undefined; - mode?: "interactive" | "readonly" | undefined; - title?: string | undefined; - cols?: number | undefined; - rows?: number | undefined; - env?: Record | undefined; - }, { - presetId?: string | undefined; - command?: string | undefined; - args?: string[] | undefined; - cwd?: string | undefined; - mode?: "interactive" | "readonly" | undefined; - title?: string | undefined; - cols?: number | undefined; - rows?: number | undefined; - env?: Record | undefined; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }, { - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable | undefined; - }], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>>>) | undefined; - handler?: ((args_0: { - presetId?: string | undefined; - command?: string | undefined; - args?: string[] | undefined; - cwd?: string | undefined; - mode?: "interactive" | "readonly" | undefined; - title?: string | undefined; - cols?: number | undefined; - rows?: number | undefined; - env?: Record | undefined; - }) => import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - presetId?: string | undefined; - command?: string | undefined; - args?: string[] | undefined; - cwd?: string | undefined; - mode?: "interactive" | "readonly" | undefined; - title?: string | undefined; - cols?: number | undefined; - rows?: number | undefined; - env?: Record | undefined; - }], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap | undefined; - }], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>>>> | undefined; - __promise?: import("devframe/rpc").Thenable | undefined; - }], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>>> | undefined; + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:write", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + data: string; }, { - name: "devframes:plugin:terminals:write"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - data: string; - }, { - id: string; - data: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - data: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - data: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; + data: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:resize", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + cols: number; + rows: number; }, { - name: "devframes:plugin:terminals:resize"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - cols: number; - rows: number; - }, { - id: string; - cols: number; - rows: number; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - cols: number; - rows: number; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - cols: number; - rows: number; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; + cols: number; + rows: number; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:terminate", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; }, { - name: "devframes:plugin:terminals:terminate"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - }, { - id: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:restart", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; }, { - name: "devframes:plugin:terminals:restart"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - }, { - id: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }, { - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - }) => import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - }], import("devframe/rpc").Thenable<{ - id: string; - title: string; - mode: "interactive" | "readonly"; - status: "running" | "exited" | "error"; - backend: "pty" | "pipe"; - command: string; - args: string[]; - cwd: string; - cols: number; - rows: number; - createdAt: number; - processName?: string | undefined; - customTitle?: string | undefined; - pid?: number | undefined; - exitCode?: number | undefined; - icon?: string | undefined; - channel?: string | undefined; - presetId?: string | undefined; - }>, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; +}>], import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; }, { - name: "devframes:plugin:terminals:rename"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - title: string; - }, { - id: string; - title: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - title: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - title: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; + title: string; + mode: "interactive" | "readonly"; + status: "running" | "exited" | "error"; + backend: "pty" | "pipe"; + command: string; + args: string[]; + cwd: string; + cols: number; + rows: number; + createdAt: number; + processName?: string | undefined; + customTitle?: string | undefined; + pid?: number | undefined; + exitCode?: number | undefined; + icon?: string | undefined; + channel?: string | undefined; + presetId?: string | undefined; +}>, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:rename", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; + title: string; }, { - name: "devframes:plugin:terminals:remove"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [import("devframe/utils/simple-schema").SimpleSchema<{ - id: string; - }, { - id: string; - }>]; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: ((args_0: { - id: string; - }) => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[{ - id: string; - }], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; + id: string; + title: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:remove", "action", readonly [import("devframe/utils/simple-schema").SimpleSchema<{ + id: string; }, { - name: "devframes:plugin:terminals:clear-exited"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly []; - returns: import("devframe/utils/simple-schema").SimpleSchema; - jsonSerializable?: boolean; - agent?: import("devframe").RpcFunctionAgentOptions; - setup?: ((context: import("devframe").DevframeNodeContext) => import("devframe/rpc").Thenable>>) | undefined; - handler?: (() => import("devframe/rpc").Thenable) | undefined; - dump?: import("devframe/rpc").RpcDump<[], import("devframe/rpc").Thenable, import("devframe").DevframeNodeContext> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: import("devframe/rpc").Thenable>> | undefined; -}]; + id: string; +}>], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>, import("devframe/rpc").RpcFunctionDefinitionWithSchemas<"devframes:plugin:terminals:clear-exited", "action", readonly [], import("devframe/utils/simple-schema").SimpleSchema, import("devframe").DevframeNodeContext>]; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts index bd3b8bd47..b7d58b197 100644 --- a/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/recipes/common-rpc-functions.snapshot.d.ts @@ -7,66 +7,10 @@ export type KnownEditor = 'atom' | 'subl' | 'sublime' | 'sublime_text' | 'wstorm // #region Variables /** @deprecated */ -export declare const commonRpcFunctions: readonly [{ - name: "devframe:open-in-editor"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [SimpleSchema, SimpleSchema]; - returns: SimpleSchema; - jsonSerializable?: boolean; - agent?: RpcFunctionAgentOptions; - setup?: ((context: undefined) => Thenable>>) | undefined; - handler?: ((args_0: string, args_1: KnownEditor | undefined) => Thenable) | undefined; - dump?: RpcDump<[string, KnownEditor | undefined], Thenable, undefined> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: Thenable>> | undefined; -}, { - name: "devframe:open-in-finder"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [SimpleSchema]; - returns: SimpleSchema; - jsonSerializable?: boolean; - agent?: RpcFunctionAgentOptions; - setup?: ((context: undefined) => Thenable>>) | undefined; - handler?: ((args_0: string) => Thenable) | undefined; - dump?: RpcDump<[string], Thenable, undefined> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: Thenable>> | undefined; -}]; +export declare const commonRpcFunctions: readonly [RpcFunctionDefinitionWithSchemas<"devframe:open-in-editor", "action", readonly [SimpleSchema, SimpleSchema], SimpleSchema, undefined>, RpcFunctionDefinitionWithSchemas<"devframe:open-in-finder", "action", readonly [SimpleSchema], SimpleSchema, undefined>]; export declare const KNOWN_EDITORS: KnownEditor[]; /** @deprecated */ -export declare const openInEditor: { - name: "devframe:open-in-editor"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [SimpleSchema, SimpleSchema]; - returns: SimpleSchema; - jsonSerializable?: boolean; - agent?: RpcFunctionAgentOptions; - setup?: ((context: undefined) => Thenable>>) | undefined; - handler?: ((args_0: string, args_1: KnownEditor | undefined) => Thenable) | undefined; - dump?: RpcDump<[string, KnownEditor | undefined], Thenable, undefined> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: Thenable>> | undefined; -}; +export declare const openInEditor: RpcFunctionDefinitionWithSchemas<"devframe:open-in-editor", "action", readonly [SimpleSchema, SimpleSchema], SimpleSchema, undefined>; /** @deprecated */ -export declare const openInFinder: { - name: "devframe:open-in-finder"; - type?: "action" | undefined; - cacheable?: boolean; - args: readonly [SimpleSchema]; - returns: SimpleSchema; - jsonSerializable?: boolean; - agent?: RpcFunctionAgentOptions; - setup?: ((context: undefined) => Thenable>>) | undefined; - handler?: ((args_0: string) => Thenable) | undefined; - dump?: RpcDump<[string], Thenable, undefined> | undefined; - snapshot?: boolean; - __cache?: WeakMap>>> | undefined; - __promise?: Thenable>> | undefined; -}; +export declare const openInFinder: RpcFunctionDefinitionWithSchemas<"devframe:open-in-finder", "action", readonly [SimpleSchema], SimpleSchema, undefined>; // #endregion \ No newline at end of file diff --git a/tests/__snapshots__/tsnapi/devframe/rpc.snapshot.d.ts b/tests/__snapshots__/tsnapi/devframe/rpc.snapshot.d.ts index ac6befa9b..0933493ae 100644 --- a/tests/__snapshots__/tsnapi/devframe/rpc.snapshot.d.ts +++ b/tests/__snapshots__/tsnapi/devframe/rpc.snapshot.d.ts @@ -29,6 +29,8 @@ export { RpcFunctionDefinitionAny } export { RpcFunctionDefinitionAnyWithContext } export { RpcFunctionDefinitionBase } export { RpcFunctionDefinitionToFunction } +export { RpcFunctionDefinitionWithoutSchemas } +export { RpcFunctionDefinitionWithSchemas } export { RpcFunctionsCollector } export { RpcFunctionsCollectorBase } export { RpcFunctionSetupResult }