@sidecar-ai/compiler 0.1.0-alpha.1 → 0.1.0-alpha.11
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/dist/index.d.ts +11 -134
- package/dist/index.js +1301 -253
- package/dist/index.js.map +1 -1
- package/package.json +9 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,138 +1,9 @@
|
|
|
1
|
+
import { JsonSchema } from '@sidecar-ai/core';
|
|
1
2
|
import { SourceFile } from 'ts-morph';
|
|
2
|
-
import {
|
|
3
|
+
import { h as SidecarTarget, i as SidecarToolManifestEntry, g as SidecarSourceVariant, B as BuildProjectOptions, c as SidecarManifest, S as SidecarCompilerConfig, d as SidecarPromptManifestEntry, e as SidecarResourceManifestEntry } from '../types-CWHwikML.js';
|
|
4
|
+
export { P as ProjectIdentity, a as SidecarDiagnostic, b as SidecarHost, f as SidecarResourceTemplateManifestEntry, j as SidecarWidgetManifestEntry, k as collectProjectDiagnostics, l as formatDiagnostic } from '../types-CWHwikML.js';
|
|
3
5
|
|
|
4
|
-
/**
|
|
5
|
-
type DiagnosticSeverity = "warning" | "error";
|
|
6
|
-
/** Stable diagnostic emitted for a concrete project source location. */
|
|
7
|
-
type SidecarDiagnostic = {
|
|
8
|
-
severity: DiagnosticSeverity;
|
|
9
|
-
code: string;
|
|
10
|
-
message: string;
|
|
11
|
-
filePath: string;
|
|
12
|
-
line: number;
|
|
13
|
-
column: number;
|
|
14
|
-
hint?: string;
|
|
15
|
-
};
|
|
16
|
-
/** Collects project-level warnings that do not block compilation by default. */
|
|
17
|
-
declare function collectProjectDiagnostics(rootDir: string, input: SidecarToolManifestEntry[] | {
|
|
18
|
-
tools: SidecarToolManifestEntry[];
|
|
19
|
-
resources?: SidecarResourceManifestEntry[];
|
|
20
|
-
prompts?: SidecarPromptManifestEntry[];
|
|
21
|
-
config?: SidecarCompilerConfig;
|
|
22
|
-
}): Promise<SidecarDiagnostic[]>;
|
|
23
|
-
/** Formats diagnostics in a TypeScript-style shape understood by many editors. */
|
|
24
|
-
declare function formatDiagnostic(diagnostic: SidecarDiagnostic): string;
|
|
25
|
-
|
|
26
|
-
/** Manifest and option types shared across the Sidecar compiler modules. */
|
|
27
|
-
|
|
28
|
-
/** Build target profile selected by reserved platform file suffixes. */
|
|
29
|
-
type SidecarTarget = "mcp" | "chatgpt" | "claude";
|
|
30
|
-
/** Platform suffix chosen for a reserved tool or widget file. */
|
|
31
|
-
type SidecarSourceVariant = "shared" | "openai" | "anthropic";
|
|
32
|
-
/** Tool entry emitted into `manifest.sidecar.json`. */
|
|
33
|
-
type SidecarToolManifestEntry = {
|
|
34
|
-
sourceFile: string;
|
|
35
|
-
variant: SidecarSourceVariant;
|
|
36
|
-
target: SidecarTarget;
|
|
37
|
-
directory: string;
|
|
38
|
-
id: string;
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
inputSchema: JsonSchema;
|
|
42
|
-
outputSchema?: JsonSchema;
|
|
43
|
-
annotations?: ToolAnnotations;
|
|
44
|
-
visibility?: ToolVisibility;
|
|
45
|
-
widget?: SidecarWidgetManifestEntry;
|
|
46
|
-
descriptor: McpToolDescriptor;
|
|
47
|
-
};
|
|
48
|
-
/** Widget resource linked to a tool entry. */
|
|
49
|
-
type SidecarWidgetManifestEntry = {
|
|
50
|
-
sourceFile: string;
|
|
51
|
-
variant: SidecarSourceVariant;
|
|
52
|
-
resourceUri: string;
|
|
53
|
-
resourceMeta?: Record<string, unknown>;
|
|
54
|
-
outputFile?: string;
|
|
55
|
-
options?: ToolWidgetOptions;
|
|
56
|
-
};
|
|
57
|
-
/** Static resource entry emitted into `manifest.sidecar.json`. */
|
|
58
|
-
type SidecarResourceManifestEntry = {
|
|
59
|
-
sourceFile: string;
|
|
60
|
-
directory: string;
|
|
61
|
-
uri: string;
|
|
62
|
-
name: string;
|
|
63
|
-
title?: string;
|
|
64
|
-
description?: string;
|
|
65
|
-
mimeType?: string;
|
|
66
|
-
size?: number;
|
|
67
|
-
annotations?: ResourceAnnotations;
|
|
68
|
-
subscribe?: boolean;
|
|
69
|
-
descriptor: McpResourceDescriptor;
|
|
70
|
-
};
|
|
71
|
-
/** Static resource template entry emitted into `manifest.sidecar.json`. */
|
|
72
|
-
type SidecarResourceTemplateManifestEntry = {
|
|
73
|
-
uriTemplate: string;
|
|
74
|
-
name: string;
|
|
75
|
-
title?: string;
|
|
76
|
-
description?: string;
|
|
77
|
-
mimeType?: string;
|
|
78
|
-
annotations?: ResourceAnnotations;
|
|
79
|
-
descriptor: McpResourceTemplateDescriptor;
|
|
80
|
-
};
|
|
81
|
-
/** Static prompt entry emitted into `manifest.sidecar.json`. */
|
|
82
|
-
type SidecarPromptManifestEntry = {
|
|
83
|
-
sourceFile: string;
|
|
84
|
-
directory: string;
|
|
85
|
-
name: string;
|
|
86
|
-
title: string;
|
|
87
|
-
description?: string;
|
|
88
|
-
args?: PromptArgsDefinition;
|
|
89
|
-
descriptor: McpPromptDescriptor;
|
|
90
|
-
};
|
|
91
|
-
/** Serializable project config subset recorded in build manifests. */
|
|
92
|
-
type SidecarCompilerConfig = {
|
|
93
|
-
resources: {
|
|
94
|
-
subscribe: boolean;
|
|
95
|
-
listChanged: boolean;
|
|
96
|
-
};
|
|
97
|
-
prompts: {
|
|
98
|
-
listChanged: boolean;
|
|
99
|
-
};
|
|
100
|
-
tools: {
|
|
101
|
-
listChanged: boolean;
|
|
102
|
-
};
|
|
103
|
-
pagination: {
|
|
104
|
-
pageSize: number;
|
|
105
|
-
hasOverride: boolean;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/** Build manifest produced for a Sidecar MCP output. */
|
|
109
|
-
type SidecarManifest = {
|
|
110
|
-
version: 1;
|
|
111
|
-
target: SidecarTarget;
|
|
112
|
-
rootDir: string;
|
|
113
|
-
generatedAt: string;
|
|
114
|
-
config: SidecarCompilerConfig;
|
|
115
|
-
tools: SidecarToolManifestEntry[];
|
|
116
|
-
resources: SidecarResourceManifestEntry[];
|
|
117
|
-
resourceTemplates: SidecarResourceTemplateManifestEntry[];
|
|
118
|
-
prompts: SidecarPromptManifestEntry[];
|
|
119
|
-
diagnostics?: SidecarDiagnostic[];
|
|
120
|
-
};
|
|
121
|
-
/** Options accepted by `buildProject()`. */
|
|
122
|
-
type BuildProjectOptions = {
|
|
123
|
-
rootDir: string;
|
|
124
|
-
outDir?: string;
|
|
125
|
-
plugins?: boolean;
|
|
126
|
-
strict?: boolean;
|
|
127
|
-
target?: SidecarTarget;
|
|
128
|
-
};
|
|
129
|
-
/** Project identity used by generated plugin packages. */
|
|
130
|
-
type ProjectIdentity = {
|
|
131
|
-
name: string;
|
|
132
|
-
slug: string;
|
|
133
|
-
version: string;
|
|
134
|
-
description: string;
|
|
135
|
-
};
|
|
6
|
+
/** Static analysis for reserved server tool files. */
|
|
136
7
|
|
|
137
8
|
type AuthScopeCatalog = Record<string, {
|
|
138
9
|
id: string;
|
|
@@ -147,6 +18,7 @@ declare function analyzeToolFile(sourceFile: SourceFile, rootDir: string, option
|
|
|
147
18
|
target?: SidecarTarget;
|
|
148
19
|
variant?: SidecarSourceVariant;
|
|
149
20
|
authScopes?: AuthScopeCatalog;
|
|
21
|
+
inputSchema?: JsonSchema;
|
|
150
22
|
}): SidecarToolManifestEntry;
|
|
151
23
|
|
|
152
24
|
/** Builds the MCP output, generated types, and optional plugin packages. */
|
|
@@ -172,4 +44,9 @@ declare function analyzeProjectResources(rootDir: string): Promise<SidecarResour
|
|
|
172
44
|
/** Analyzes one `resource.ts` source file into a compiler manifest entry. */
|
|
173
45
|
declare function analyzeResourceFile(sourceFile: SourceFile, rootDir: string): SidecarResourceManifestEntry;
|
|
174
46
|
|
|
175
|
-
|
|
47
|
+
/** Relative location of the generated server entrypoint inside a build output. */
|
|
48
|
+
declare const SERVER_ENTRYPOINT = "server/index.js";
|
|
49
|
+
/** Relative location of the Vercel Build Output API function entrypoint. */
|
|
50
|
+
declare const VERCEL_ENTRYPOINT = "functions/api/sidecar.func/index.js";
|
|
51
|
+
|
|
52
|
+
export { BuildProjectOptions, CompilerError, SERVER_ENTRYPOINT, SidecarCompilerConfig, SidecarManifest, SidecarPromptManifestEntry, SidecarResourceManifestEntry, SidecarSourceVariant, SidecarTarget, SidecarToolManifestEntry, VERCEL_ENTRYPOINT, analyzeProjectConfig, analyzeProjectPrompts, analyzeProjectResources, analyzeProjectTools, analyzePromptFile, analyzeResourceFile, analyzeToolFile, buildProject };
|