nosana-mcp 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +128 -0
- package/dist/cli/commands/account.d.ts +7 -0
- package/dist/cli/commands/account.js +108 -0
- package/dist/cli/commands/account.js.map +1 -0
- package/dist/cli/commands/deploy.d.ts +3 -0
- package/dist/cli/commands/deploy.js +311 -0
- package/dist/cli/commands/deploy.js.map +1 -0
- package/dist/cli/commands/gpus.d.ts +3 -0
- package/dist/cli/commands/gpus.js +38 -0
- package/dist/cli/commands/gpus.js.map +1 -0
- package/dist/cli/commands/job.d.ts +3 -0
- package/dist/cli/commands/job.js +31 -0
- package/dist/cli/commands/job.js.map +1 -0
- package/dist/cli/commands/run.d.ts +33 -0
- package/dist/cli/commands/run.js +365 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/templates.d.ts +3 -0
- package/dist/cli/commands/templates.js +115 -0
- package/dist/cli/commands/templates.js.map +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +45 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/client.d.ts +23 -0
- package/dist/core/client.js +38 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/config.d.ts +18 -0
- package/dist/core/config.js +52 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/credits.d.ts +9 -0
- package/dist/core/credits.js +9 -0
- package/dist/core/credits.js.map +1 -0
- package/dist/core/deploy.d.ts +146 -0
- package/dist/core/deploy.js +400 -0
- package/dist/core/deploy.js.map +1 -0
- package/dist/core/format.d.ts +25 -0
- package/dist/core/format.js +144 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/markets.d.ts +74 -0
- package/dist/core/markets.js +146 -0
- package/dist/core/markets.js.map +1 -0
- package/dist/core/templates.d.ts +61 -0
- package/dist/core/templates.js +190 -0
- package/dist/core/templates.js.map +1 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +73 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/tools.d.ts +52 -0
- package/dist/mcp/tools.js +994 -0
- package/dist/mcp/tools.js.map +1 -0
- package/docs/CLI.md +144 -0
- package/docs/COST.md +32 -0
- package/docs/MINIMAX-H3.md +79 -0
- package/examples/hello-world.json +18 -0
- package/examples/minimax-h3-i2v-32gb.json +56 -0
- package/package.json +66 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type NosanaClient } from '@nosana/kit';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { type Network } from '../core/config.js';
|
|
4
|
+
import { type GpuMarket } from '../core/markets.js';
|
|
5
|
+
import { type TemplateInfo } from '../core/templates.js';
|
|
6
|
+
export declare const WAIT_DEFAULT_SECONDS = 30;
|
|
7
|
+
/** MCP clients time out requests after 60 s by default; stay well under it. */
|
|
8
|
+
export declare const WAIT_MAX_SECONDS = 45;
|
|
9
|
+
export declare const NO_KEY_MESSAGE = "No Nosana API key. Add NOSANA_API_KEY to the MCP server environment (create one at https://deploy.nosana.com under Account > API Keys), or run `nosana-deploy login` once on this machine.";
|
|
10
|
+
/** Every tool returns this envelope as JSON text and as structuredContent. */
|
|
11
|
+
export interface Envelope {
|
|
12
|
+
ok: boolean;
|
|
13
|
+
message: string;
|
|
14
|
+
next_tool?: string | null;
|
|
15
|
+
next_args?: Record<string, unknown>;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare class ToolContext {
|
|
19
|
+
readonly network: Network;
|
|
20
|
+
private client?;
|
|
21
|
+
private templatesCache?;
|
|
22
|
+
private catalogCache;
|
|
23
|
+
constructor(network: Network);
|
|
24
|
+
hasKey(): boolean;
|
|
25
|
+
get(): NosanaClient;
|
|
26
|
+
templates(): Promise<TemplateInfo[]>;
|
|
27
|
+
catalog(includeAll?: boolean, onchain?: boolean): Promise<GpuMarket[]>;
|
|
28
|
+
}
|
|
29
|
+
export interface ToolAnnotations {
|
|
30
|
+
readOnlyHint?: boolean;
|
|
31
|
+
destructiveHint?: boolean;
|
|
32
|
+
idempotentHint?: boolean;
|
|
33
|
+
openWorldHint?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ToolDefinition {
|
|
36
|
+
name: string;
|
|
37
|
+
title: string;
|
|
38
|
+
description: string;
|
|
39
|
+
shape: z.ZodRawShape;
|
|
40
|
+
annotations: ToolAnnotations;
|
|
41
|
+
run: (ctx: ToolContext, args: unknown) => Promise<Envelope>;
|
|
42
|
+
}
|
|
43
|
+
export declare const tools: ToolDefinition[];
|
|
44
|
+
export declare function templatesResource(ctx: ToolContext): Promise<string>;
|
|
45
|
+
export declare function gpusResource(ctx: ToolContext): Promise<string>;
|
|
46
|
+
export declare const prompts: {
|
|
47
|
+
deploy_template(workload: string, gpu?: string, timeout?: string): string;
|
|
48
|
+
deploy_llm(model?: string): string;
|
|
49
|
+
deploy_comfy(workflow?: string): string;
|
|
50
|
+
deploy_minimax_h3(variant?: string, gpu?: string): string;
|
|
51
|
+
stop_when_done(): string;
|
|
52
|
+
};
|