@caplets/core 0.27.0 → 0.28.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/dist/attach/api.d.ts +8 -0
- package/dist/cli/code-mode.d.ts +3 -2
- package/dist/cli/commands.d.ts +3 -1
- package/dist/cli.d.ts +4 -0
- package/dist/code-mode/types.d.ts +1 -0
- package/dist/{completion-1wDjwHkC.js → completion-CjE0EnbF.js} +13 -2
- package/dist/config/paths.d.ts +9 -0
- package/dist/config.d.ts +3 -1
- package/dist/engine.d.ts +18 -0
- package/dist/esm-Db9dhnIG.js +7488 -0
- package/dist/index.js +829 -481
- package/dist/native/options.d.ts +1 -0
- package/dist/native/remote.d.ts +2 -1
- package/dist/native/service.d.ts +14 -0
- package/dist/native.js +1 -1
- package/dist/node-BgWIvSVP.js +17214 -0
- package/dist/rolldown-runtime-CE-6LUnI.js +44 -0
- package/dist/serve/http.d.ts +16 -1
- package/dist/serve/options.d.ts +2 -0
- package/dist/{service-BGGiZLHa.js → service-BfPCRxQ9.js} +1688 -121
- package/dist/src-Cd2QIUm1.js +813 -0
- package/dist/telemetry/context.d.ts +13 -0
- package/dist/telemetry/debug.d.ts +10 -0
- package/dist/telemetry/delivery.d.ts +1 -0
- package/dist/telemetry/events.d.ts +70 -0
- package/dist/telemetry/identity.d.ts +1 -0
- package/dist/telemetry/index.d.ts +8 -0
- package/dist/telemetry/intake.generated.d.ts +2 -0
- package/dist/telemetry/notice.d.ts +8 -0
- package/dist/telemetry/privacy.d.ts +3 -0
- package/dist/telemetry/providers.d.ts +21 -0
- package/dist/telemetry/runtime.d.ts +40 -0
- package/dist/telemetry/state.d.ts +53 -0
- package/package.json +3 -1
package/dist/attach/api.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import type { CapletsEngine } from "../engine";
|
|
2
2
|
import type { CapletShadowingPolicy } from "../config";
|
|
3
|
+
import type { NativeCapletsService } from "../native/service";
|
|
4
|
+
export declare const CAPLETS_ATTACH_SESSION_HEADER = "caplets-attach-session-id";
|
|
5
|
+
export type AttachSessionMetadata = {
|
|
6
|
+
projectRoot?: string | undefined;
|
|
7
|
+
projectConfigPath?: string | undefined;
|
|
8
|
+
};
|
|
3
9
|
export type AttachExportKind = "caplet" | "tool" | "resource" | "resourceTemplate" | "prompt" | "completion";
|
|
4
10
|
export type AttachInvokeRequest = {
|
|
5
11
|
revision: string;
|
|
@@ -105,6 +111,8 @@ export type AttachProjection = {
|
|
|
105
111
|
routes: Map<string, AttachRoute>;
|
|
106
112
|
};
|
|
107
113
|
export declare function buildAttachProjection(engine: CapletsEngine): Promise<AttachProjection>;
|
|
114
|
+
export declare function buildNativeAttachProjection(service: NativeCapletsService): Promise<AttachProjection>;
|
|
115
|
+
export declare function invokeNativeAttachExport(service: NativeCapletsService, projection: AttachProjection, request: AttachInvokeRequest): Promise<unknown>;
|
|
108
116
|
export declare function invokeAttachExport(engine: CapletsEngine, projection: AttachProjection, request: AttachInvokeRequest): Promise<unknown>;
|
|
109
117
|
export declare function attachErrorResponse(error: unknown): {
|
|
110
118
|
status: 400 | 404 | 409 | 500;
|
package/dist/cli/code-mode.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type CodeModeCliOptions = {
|
|
|
3
3
|
configPath?: string | undefined;
|
|
4
4
|
projectConfigPath?: string | undefined;
|
|
5
5
|
authDir?: string | undefined;
|
|
6
|
+
telemetryStateDir?: string | undefined;
|
|
6
7
|
inlineCode?: string | undefined;
|
|
7
8
|
file?: string | undefined;
|
|
8
9
|
timeoutMs?: number | undefined;
|
|
@@ -14,6 +15,6 @@ export type CodeModeCliOptions = {
|
|
|
14
15
|
setExitCode: (code: number) => void;
|
|
15
16
|
};
|
|
16
17
|
export declare function runCodeModeCli(options: CodeModeCliOptions): Promise<void>;
|
|
17
|
-
export declare function runCodeModeReplCli(options: Pick<CodeModeCliOptions, "env" | "configPath" | "projectConfigPath" | "authDir" | "sessionId" | "recoveryRef" | "json" | "writeOut" | "setExitCode">): Promise<void>;
|
|
18
|
-
export declare function codeModeTypesCli(options: Pick<CodeModeCliOptions, "env" | "configPath" | "projectConfigPath" | "authDir" | "json" | "writeOut">): Promise<void>;
|
|
18
|
+
export declare function runCodeModeReplCli(options: Pick<CodeModeCliOptions, "env" | "configPath" | "projectConfigPath" | "authDir" | "telemetryStateDir" | "sessionId" | "recoveryRef" | "json" | "writeOut" | "setExitCode">): Promise<void>;
|
|
19
|
+
export declare function codeModeTypesCli(options: Pick<CodeModeCliOptions, "env" | "configPath" | "projectConfigPath" | "authDir" | "telemetryStateDir" | "json" | "writeOut">): Promise<void>;
|
|
19
20
|
export declare function readCodeModeCliCode(options: Pick<CodeModeCliOptions, "inlineCode" | "file" | "readStdin">): Promise<string>;
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -32,8 +32,9 @@ export declare const cliCommands: {
|
|
|
32
32
|
readonly config: "config";
|
|
33
33
|
readonly auth: "auth";
|
|
34
34
|
readonly vault: "vault";
|
|
35
|
+
readonly telemetry: "telemetry";
|
|
35
36
|
};
|
|
36
|
-
export declare const topLevelCommandNames: readonly ["serve", "daemon", "code-mode", "attach", "remote", "cloud", "init", "setup", "doctor", "list", "install", "add", "inspect", "check-backend", "list-tools", "search-tools", "get-tool", "call-tool", "list-resources", "search-resources", "list-resource-templates", "read-resource", "list-prompts", "search-prompts", "get-prompt", "complete", "config", "auth", "vault", "completion"];
|
|
37
|
+
export declare const topLevelCommandNames: readonly ["serve", "daemon", "code-mode", "attach", "remote", "cloud", "init", "setup", "doctor", "list", "install", "add", "inspect", "check-backend", "list-tools", "search-tools", "get-tool", "call-tool", "list-resources", "search-resources", "list-resource-templates", "read-resource", "list-prompts", "search-prompts", "get-prompt", "complete", "config", "auth", "vault", "telemetry", "completion"];
|
|
37
38
|
export declare const cliSubcommands: {
|
|
38
39
|
readonly add: readonly ["cli", "mcp", "openapi", "google-discovery", "graphql", "http"];
|
|
39
40
|
readonly auth: readonly ["login", "logout", "list", "refresh"];
|
|
@@ -44,6 +45,7 @@ export declare const cliSubcommands: {
|
|
|
44
45
|
readonly config: readonly ["path", "paths"];
|
|
45
46
|
readonly daemon: readonly ["install", "uninstall", "start", "restart", "stop", "status", "logs"];
|
|
46
47
|
readonly setup: readonly ["codex", "claude-code", "opencode", "pi", "mcp-client"];
|
|
48
|
+
readonly telemetry: readonly ["status", "enable", "disable", "delete-id", "rotate-id", "debug"];
|
|
47
49
|
readonly vault: readonly ["set", "get", "list", "delete", "access"];
|
|
48
50
|
};
|
|
49
51
|
export declare const cliNestedSubcommands: {
|
package/dist/cli.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { type AttachServeOptions } from "./attach/options";
|
|
|
4
4
|
import type { ProjectBindingWebSocketFactory } from "./project-binding/transport";
|
|
5
5
|
import { type DaemonOperationOptions } from "./daemon";
|
|
6
6
|
import { type ServeOptions } from "./serve";
|
|
7
|
+
import { TelemetryDebugSink } from "./telemetry";
|
|
7
8
|
export { initConfig, starterConfig } from "./cli/init";
|
|
8
9
|
export { installCaplets, normalizeGitRepo } from "./cli/install";
|
|
9
10
|
export { addCliCaplet, addGoogleDiscoveryCaplet, addGraphqlCaplet, addHttpCaplet, addMcpCaplet, addOpenApiCaplet, } from "./cli/add";
|
|
@@ -15,6 +16,9 @@ type CliIO = {
|
|
|
15
16
|
signal?: AbortSignal;
|
|
16
17
|
projectBindingWebSocketFactory?: ProjectBindingWebSocketFactory;
|
|
17
18
|
authDir?: string;
|
|
19
|
+
telemetryStateDir?: string;
|
|
20
|
+
stderrIsTTY?: boolean;
|
|
21
|
+
telemetryDebugSink?: TelemetryDebugSink;
|
|
18
22
|
version?: string;
|
|
19
23
|
setExitCode?: (code: number) => void;
|
|
20
24
|
serve?: (options: ServeOptions) => Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as __exportAll } from "./rolldown-runtime-CE-6LUnI.js";
|
|
2
|
+
import { Dt as loadConfigWithSources, cn as resolveCapletsRoot, dn as resolveProjectConfigPath, en as DEFAULT_AUTH_DIR, ln as resolveConfigPath, tn as DEFAULT_COMPLETION_CACHE_DIR } from "./service-BfPCRxQ9.js";
|
|
2
3
|
import { d as CapletsError } from "./validation-CWzd2gtn.js";
|
|
3
4
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
4
5
|
import { dirname, join } from "node:path";
|
|
@@ -42,7 +43,8 @@ const cliCommands = {
|
|
|
42
43
|
complete: "complete",
|
|
43
44
|
config: "config",
|
|
44
45
|
auth: "auth",
|
|
45
|
-
vault: "vault"
|
|
46
|
+
vault: "vault",
|
|
47
|
+
telemetry: "telemetry"
|
|
46
48
|
};
|
|
47
49
|
const topLevelCommandNames = [
|
|
48
50
|
cliCommands.serve,
|
|
@@ -74,6 +76,7 @@ const topLevelCommandNames = [
|
|
|
74
76
|
cliCommands.config,
|
|
75
77
|
cliCommands.auth,
|
|
76
78
|
cliCommands.vault,
|
|
79
|
+
cliCommands.telemetry,
|
|
77
80
|
cliCommands.completion
|
|
78
81
|
];
|
|
79
82
|
const cliSubcommands = {
|
|
@@ -117,6 +120,14 @@ const cliSubcommands = {
|
|
|
117
120
|
"pi",
|
|
118
121
|
"mcp-client"
|
|
119
122
|
],
|
|
123
|
+
[cliCommands.telemetry]: [
|
|
124
|
+
"status",
|
|
125
|
+
"enable",
|
|
126
|
+
"disable",
|
|
127
|
+
"delete-id",
|
|
128
|
+
"rotate-id",
|
|
129
|
+
"debug"
|
|
130
|
+
],
|
|
120
131
|
[cliCommands.vault]: [
|
|
121
132
|
"set",
|
|
122
133
|
"get",
|
package/dist/config/paths.d.ts
CHANGED
|
@@ -5,17 +5,26 @@ export declare function defaultStateBaseDir(env?: PathEnv, home?: string, platfo
|
|
|
5
5
|
export declare function defaultCacheBaseDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
6
6
|
export declare function defaultConfigPath(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
7
7
|
export declare function defaultAuthDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
8
|
+
export declare function defaultTelemetryStateDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
9
|
+
export declare function defaultTelemetryIdentityPath(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
10
|
+
export declare function defaultTelemetryNoticePath(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
11
|
+
export declare function defaultTelemetryDeliveryHealthPath(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
8
12
|
export declare function defaultArtifactDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
9
13
|
export declare function defaultCompletionCacheDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
10
14
|
export declare function defaultObservedOutputShapeCacheDir(env?: PathEnv, home?: string, platform?: Platform): string;
|
|
11
15
|
export declare const DEFAULT_CONFIG_PATH: string;
|
|
12
16
|
export declare const DEFAULT_AUTH_DIR: string;
|
|
13
17
|
export declare const DEFAULT_ARTIFACT_DIR: string;
|
|
18
|
+
export declare const DEFAULT_TELEMETRY_STATE_DIR: string;
|
|
19
|
+
export declare const DEFAULT_TELEMETRY_IDENTITY_PATH: string;
|
|
20
|
+
export declare const DEFAULT_TELEMETRY_NOTICE_PATH: string;
|
|
21
|
+
export declare const DEFAULT_TELEMETRY_DELIVERY_HEALTH_PATH: string;
|
|
14
22
|
export declare const DEFAULT_COMPLETION_CACHE_DIR: string;
|
|
15
23
|
export declare const DEFAULT_OBSERVED_OUTPUT_SHAPE_CACHE_DIR: string;
|
|
16
24
|
export declare const PROJECT_CONFIG_FILE: string;
|
|
17
25
|
export declare function resolveConfigPath(path?: string): string;
|
|
18
26
|
export declare function resolveProjectConfigPath(cwd?: string): string;
|
|
19
27
|
export declare function resolveCapletsRoot(configPath?: string): string;
|
|
28
|
+
export declare function resolveTelemetryStateDir(path?: string): string;
|
|
20
29
|
export declare function resolveProjectCapletsRoot(cwd?: string): string;
|
|
21
30
|
export {};
|
package/dist/config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { FileVaultStore, type VaultConfigOrigin } from "./vault";
|
|
3
|
-
export { DEFAULT_AUTH_DIR, DEFAULT_COMPLETION_CACHE_DIR, DEFAULT_CONFIG_PATH, PROJECT_CONFIG_FILE, defaultCacheBaseDir, defaultCompletionCacheDir, resolveCapletsRoot, resolveConfigPath, resolveProjectCapletsRoot, resolveProjectConfigPath, } from "./config/paths";
|
|
3
|
+
export { DEFAULT_AUTH_DIR, DEFAULT_COMPLETION_CACHE_DIR, DEFAULT_CONFIG_PATH, DEFAULT_TELEMETRY_STATE_DIR, PROJECT_CONFIG_FILE, defaultCacheBaseDir, defaultCompletionCacheDir, defaultTelemetryStateDir, resolveCapletsRoot, resolveConfigPath, resolveProjectCapletsRoot, resolveProjectConfigPath, resolveTelemetryStateDir, } from "./config/paths";
|
|
4
4
|
export type RemoteAuthConfig = {
|
|
5
5
|
type: "none";
|
|
6
6
|
} | {
|
|
@@ -281,6 +281,7 @@ export type CompletionConfig = {
|
|
|
281
281
|
};
|
|
282
282
|
export type CapletsConfig = {
|
|
283
283
|
version: 1;
|
|
284
|
+
telemetry?: boolean | undefined;
|
|
284
285
|
options: CapletsOptions;
|
|
285
286
|
namespaceAliases: NamespaceAliasesConfig;
|
|
286
287
|
mcpServers: Record<string, CapletServerConfig>;
|
|
@@ -338,6 +339,7 @@ export declare const configFileSchema: z.ZodObject<{
|
|
|
338
339
|
version: z.ZodDefault<z.ZodLiteral<1>>;
|
|
339
340
|
defaultSearchLimit: z.ZodDefault<z.ZodNumber>;
|
|
340
341
|
maxSearchLimit: z.ZodDefault<z.ZodNumber>;
|
|
342
|
+
telemetry: z.ZodOptional<z.ZodBoolean>;
|
|
341
343
|
completion: z.ZodDefault<z.ZodObject<{
|
|
342
344
|
discoveryTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
343
345
|
overallTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
package/dist/engine.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { type CapletConfig, type CapletsConfig, type LocalOverlayConfigWarning } from "./config";
|
|
2
2
|
import { type ObservedOutputShapeKey, type ObservedOutputShapeStore } from "./observed-output-shapes";
|
|
3
3
|
import { type ExposureSnapshot } from "./exposure/discovery";
|
|
4
|
+
import { type RuntimeMode } from "./telemetry";
|
|
5
|
+
import type { TelemetryDebugSink, TelemetryDispatcher, TelemetrySurface, TelemetryVisibility } from "./telemetry";
|
|
4
6
|
export type CapletsEngineOptions = {
|
|
5
7
|
configPath?: string;
|
|
6
8
|
projectConfigPath?: string;
|
|
@@ -18,6 +20,14 @@ export type CapletsEngineOptions = {
|
|
|
18
20
|
observedOutputShapeCacheDir?: string | undefined;
|
|
19
21
|
projectFingerprint?: string | undefined;
|
|
20
22
|
vaultRecoveryTarget?: "global" | "remote" | undefined;
|
|
23
|
+
telemetryStateDir?: string | undefined;
|
|
24
|
+
telemetryEnv?: NodeJS.ProcessEnv | undefined;
|
|
25
|
+
telemetrySurface?: TelemetrySurface | undefined;
|
|
26
|
+
telemetryVisibility?: TelemetryVisibility | undefined;
|
|
27
|
+
telemetryRuntimeMode?: RuntimeMode | undefined;
|
|
28
|
+
telemetryIntegration?: "opencode" | "pi" | "native" | "unknown" | undefined;
|
|
29
|
+
telemetryDebugSink?: TelemetryDebugSink | undefined;
|
|
30
|
+
telemetryDispatcher?: TelemetryDispatcher | undefined;
|
|
21
31
|
};
|
|
22
32
|
export type CapletsEngineReloadEvent = {
|
|
23
33
|
previous: CapletsConfig;
|
|
@@ -41,6 +51,8 @@ export declare class CapletsEngine {
|
|
|
41
51
|
private readonly observedOutputShapeStore;
|
|
42
52
|
private readonly observedOutputShapeScope;
|
|
43
53
|
private readonly projectFingerprint;
|
|
54
|
+
private readonly telemetry;
|
|
55
|
+
private readonly telemetryExecuteExposureMode;
|
|
44
56
|
private readonly reloadListeners;
|
|
45
57
|
private lastExposureSnapshot;
|
|
46
58
|
private watchers;
|
|
@@ -65,6 +77,10 @@ export declare class CapletsEngine {
|
|
|
65
77
|
readDirectResource(serverId: string, downstreamUri: string): Promise<unknown>;
|
|
66
78
|
getDirectPrompt(serverId: string, promptName: string, args: Record<string, unknown>): Promise<unknown>;
|
|
67
79
|
completeCliWords(words: string[]): Promise<string[]>;
|
|
80
|
+
captureCodeModeOutcome(envelope: unknown, options: {
|
|
81
|
+
started: number;
|
|
82
|
+
timeoutMs?: number | undefined;
|
|
83
|
+
}): Promise<void>;
|
|
68
84
|
close(): Promise<void>;
|
|
69
85
|
private listCompletionTools;
|
|
70
86
|
private listTools;
|
|
@@ -80,4 +96,6 @@ export declare class CapletsEngine {
|
|
|
80
96
|
private watchEntry;
|
|
81
97
|
private watchDirectoryTree;
|
|
82
98
|
private scheduleWatcherRefresh;
|
|
99
|
+
private captureReliabilityError;
|
|
100
|
+
private captureToolActivation;
|
|
83
101
|
}
|