@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.
@@ -5,6 +5,7 @@ export type NativeRemoteCapletsOptions = {
5
5
  url?: string;
6
6
  workspace?: string;
7
7
  fetch?: typeof fetch;
8
+ requestHeaders?: Record<string, string>;
8
9
  pollIntervalMs?: number;
9
10
  cloud?: NativeCloudPresenceInput;
10
11
  };
@@ -1,4 +1,4 @@
1
- import type { AttachCodeModeCaplet } from "../attach/api";
1
+ import { type AttachCodeModeCaplet, type AttachSessionMetadata } from "../attach/api";
2
2
  import type { CapletShadowingPolicy } from "../config";
3
3
  import type { ResolvedNativeCapletsServiceOptions } from "./options";
4
4
  import type { NativeCapletsService, NativeCapletsToolsChangedListener, NativeCapletTool } from "./service";
@@ -26,6 +26,7 @@ export type RemoteCapletsClientOptions = ResolvedNativeCapletsServiceOptions & {
26
26
  };
27
27
  export type SdkRemoteCapletsClientOptions = RemoteCapletsClientOptions["remote"] & {
28
28
  resolveRuntimeOptions?: () => Promise<RemoteCapletsClientOptions["remote"]>;
29
+ attachSessionMetadata?: AttachSessionMetadata | undefined;
29
30
  authKind?: "self_hosted_remote" | "hosted_cloud";
30
31
  writeErr?: (value: string) => void;
31
32
  };
@@ -1,11 +1,13 @@
1
1
  import type { NativeCapletsServiceResolutionInput } from "./options";
2
2
  import { resolveNativeCapletsServiceOptions } from "./options";
3
3
  import { type RemoteCapletsClient } from "./remote";
4
+ import type { RuntimeMode, TelemetryDebugSink, TelemetryDispatcher, TelemetrySurface, TelemetryVisibility } from "../telemetry";
4
5
  import type { CodeModeCallableCaplet } from "../code-mode/types";
5
6
  import { type CapletShadowingPolicy, type CapletsConfig } from "../config";
6
7
  import { generatedToolInputJsonSchemaForCaplet } from "../generated-tool-input-schema";
7
8
  export type NativeCapletsServiceOptions = NativeCapletsServiceResolutionInput & {
8
9
  configPath?: string;
10
+ projectRoot?: string;
9
11
  projectConfigPath?: string;
10
12
  authDir?: string;
11
13
  exposeLocalArtifactPaths?: boolean;
@@ -14,6 +16,14 @@ export type NativeCapletsServiceOptions = NativeCapletsServiceResolutionInput &
14
16
  writeErr?: (value: string) => void;
15
17
  remoteClientFactory?: (options: ResolvedNativeRemoteOptions) => RemoteCapletsClient;
16
18
  localServiceFactory?: (options: LocalNativeCapletsServiceOptions) => NativeCapletsService;
19
+ telemetryStateDir?: string | undefined;
20
+ telemetryEnv?: NodeJS.ProcessEnv | undefined;
21
+ telemetrySurface?: TelemetrySurface | undefined;
22
+ telemetryVisibility?: TelemetryVisibility | undefined;
23
+ telemetryRuntimeMode?: RuntimeMode | undefined;
24
+ telemetryIntegration?: "opencode" | "pi" | "native" | "unknown" | undefined;
25
+ telemetryDebugSink?: TelemetryDebugSink | undefined;
26
+ telemetryDispatcher?: TelemetryDispatcher | undefined;
17
27
  };
18
28
  export type NativeCapletTool = {
19
29
  caplet: string;
@@ -36,6 +46,10 @@ export type NativeCapletsToolsChangedListener = (tools: NativeCapletTool[]) => v
36
46
  export type NativeCapletsService = {
37
47
  listTools(): NativeCapletTool[];
38
48
  execute(capletId: string, request: unknown): Promise<unknown>;
49
+ captureCodeModeOutcome?(envelope: unknown, options: {
50
+ started: number;
51
+ timeoutMs?: number | undefined;
52
+ }): Promise<void>;
39
53
  codeModeService?(): NativeCapletsService;
40
54
  reload(): Promise<boolean>;
41
55
  onToolsChanged(listener: NativeCapletsToolsChangedListener): () => void;
package/dist/native.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as nativeCapletPromptGuidance, F as nativeCodeModeToolName, M as nativeCapletToolName, N as nativeCapletsSystemGuidance, P as nativeCodeModeToolId, h as createSdkRemoteCapletsClient, j as nativeCapletToolDescription, m as RemoteNativeCapletsService, t as createNativeCapletsService, v as resolveNativeCapletsServiceOptions } from "./service-BGGiZLHa.js";
1
+ import { B as nativeCodeModeToolId, I as nativeCapletPromptGuidance, L as nativeCapletToolDescription, R as nativeCapletToolName, V as nativeCodeModeToolName, h as createSdkRemoteCapletsClient, m as RemoteNativeCapletsService, t as createNativeCapletsService, w as resolveNativeCapletsServiceOptions, z as nativeCapletsSystemGuidance } from "./service-BfPCRxQ9.js";
2
2
  import { generatedToolInputJsonSchema, generatedToolInputSchema } from "./generated-tool-input-schema.js";
3
3
  //#region src/native/process-cleanup.ts
4
4
  function registerNativeCapletsProcessCleanup(service, options = {}) {