@cline/shared 0.0.38 → 0.0.39
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/hub.d.ts +3 -1
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +14 -14
- package/dist/index.d.ts +4 -0
- package/dist/index.js +66 -55
- package/dist/remote-config/artifact-store.d.ts +13 -0
- package/dist/remote-config/blob-storage.d.ts +47 -0
- package/dist/remote-config/bundle.d.ts +136 -0
- package/dist/remote-config/index.d.ts +9 -0
- package/dist/remote-config/index.js +76 -0
- package/dist/remote-config/materializer.d.ts +4 -0
- package/dist/remote-config/paths.d.ts +10 -0
- package/dist/remote-config/runtime.d.ts +20 -0
- package/dist/remote-config/telemetry.d.ts +9 -0
- package/dist/runtime/cline-environment.d.ts +17 -0
- package/package.json +6 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RemoteConfigBundle, RemoteConfigBundleStore, RemoteConfigManagedArtifactStore } from "./bundle";
|
|
2
|
+
export declare class FileRemoteConfigBundleStore implements RemoteConfigBundleStore {
|
|
3
|
+
private readonly filePath;
|
|
4
|
+
constructor(filePath: string);
|
|
5
|
+
read(): Promise<RemoteConfigBundle | undefined>;
|
|
6
|
+
write(bundle: RemoteConfigBundle): Promise<void>;
|
|
7
|
+
clear(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare class FileSystemRemoteConfigManagedArtifactStore implements RemoteConfigManagedArtifactStore {
|
|
10
|
+
writeText(filePath: string, contents: string): Promise<void>;
|
|
11
|
+
remove(targetPath: string): Promise<void>;
|
|
12
|
+
removeChildren(directoryPath: string): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PromptUploading, RemoteConfig } from "./schema";
|
|
2
|
+
export interface RemoteConfigBlobStoreSettings {
|
|
3
|
+
bucket: string;
|
|
4
|
+
adapterType: "s3" | "r2" | "azure";
|
|
5
|
+
accessKeyId: string;
|
|
6
|
+
secretAccessKey: string;
|
|
7
|
+
region?: string;
|
|
8
|
+
endpoint?: string;
|
|
9
|
+
accountId?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RemoteConfigBlobStoreTarget {
|
|
12
|
+
bucket: string;
|
|
13
|
+
adapterType: "s3" | "r2" | "azure";
|
|
14
|
+
region?: string;
|
|
15
|
+
endpoint?: string;
|
|
16
|
+
accountId?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RemoteConfigBlobStorageAdapter {
|
|
19
|
+
write(path: string, value: string): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
export interface RemoteConfigSessionBlobUploadMetadata {
|
|
22
|
+
version: 1;
|
|
23
|
+
storage: RemoteConfigBlobStoreTarget;
|
|
24
|
+
keyPrefix?: string;
|
|
25
|
+
userDistinctId?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface RemoteConfigSessionMetadataRow {
|
|
28
|
+
metadata?: Record<string, unknown> | null;
|
|
29
|
+
}
|
|
30
|
+
export interface RemoteConfigSessionMessagesUploadInput {
|
|
31
|
+
sessionId: string;
|
|
32
|
+
path: string;
|
|
33
|
+
contents: string;
|
|
34
|
+
row?: RemoteConfigSessionMetadataRow;
|
|
35
|
+
}
|
|
36
|
+
export interface RemoteConfigSessionMessagesArtifactUploader {
|
|
37
|
+
uploadMessagesFile(input: RemoteConfigSessionMessagesUploadInput): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
export declare const REMOTE_CONFIG_SESSION_BLOB_UPLOAD_METADATA_KEY = "enterprise.blobUpload";
|
|
40
|
+
export declare function resolveBlobStoreSettingsFromPromptUploading(promptUploading: PromptUploading | undefined): RemoteConfigBlobStoreSettings | undefined;
|
|
41
|
+
export declare function resolveBlobStoreSettingsFromRemoteConfig(remoteConfig: RemoteConfig | undefined): RemoteConfigBlobStoreSettings | undefined;
|
|
42
|
+
export declare function buildRemoteConfigSessionBlobUploadMetadata(remoteConfig: RemoteConfig | undefined, userDistinctId?: string): RemoteConfigSessionBlobUploadMetadata | undefined;
|
|
43
|
+
export declare function registerRemoteConfigSessionBlobUpload(sessionId: string, remoteConfig: RemoteConfig | undefined, userDistinctId?: string): RemoteConfigSessionBlobUploadMetadata | undefined;
|
|
44
|
+
export declare function clearRemoteConfigSessionBlobUpload(sessionId: string): void;
|
|
45
|
+
export declare function createRemoteConfigBlobStorageAdapter(settings: RemoteConfigBlobStoreSettings): RemoteConfigBlobStorageAdapter | undefined;
|
|
46
|
+
export declare function readRemoteConfigSessionBlobUploadMetadata(row: RemoteConfigSessionMetadataRow | undefined): RemoteConfigSessionBlobUploadMetadata | undefined;
|
|
47
|
+
export declare function createRemoteConfigSessionMessagesArtifactUploader(): RemoteConfigSessionMessagesArtifactUploader;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { AgentExtension } from "../agents/types";
|
|
2
|
+
import type { BasicLogger } from "../logging/logger";
|
|
3
|
+
import type { OpenTelemetryClientConfig } from "../services/telemetry";
|
|
4
|
+
import type { GlobalInstructionsFile, RemoteConfig } from "./schema";
|
|
5
|
+
export interface RemoteConfigIdentityClaims {
|
|
6
|
+
subject: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
roles?: string[];
|
|
9
|
+
groups?: string[];
|
|
10
|
+
organizationId?: string;
|
|
11
|
+
projectIds?: string[];
|
|
12
|
+
rawClaims?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export type RemoteConfigManagedInstructionKind = "rule" | "workflow" | "skill";
|
|
15
|
+
export interface RemoteConfigManagedInstructionFile {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
kind: RemoteConfigManagedInstructionKind;
|
|
19
|
+
contents: string;
|
|
20
|
+
alwaysEnabled?: boolean;
|
|
21
|
+
description?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface RemoteConfigBundle {
|
|
25
|
+
source: string;
|
|
26
|
+
version: string;
|
|
27
|
+
remoteConfig?: RemoteConfig;
|
|
28
|
+
managedInstructions?: RemoteConfigManagedInstructionFile[];
|
|
29
|
+
telemetry?: Record<string, unknown>;
|
|
30
|
+
claims?: RemoteConfigIdentityClaims;
|
|
31
|
+
metadata?: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
export interface RemoteConfigProjectContext {
|
|
34
|
+
projectId?: string;
|
|
35
|
+
workspaceId?: string;
|
|
36
|
+
organizationId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface RemoteConfigSyncContext {
|
|
39
|
+
workspacePath: string;
|
|
40
|
+
rootPath?: string;
|
|
41
|
+
context?: RemoteConfigProjectContext;
|
|
42
|
+
logger?: BasicLogger;
|
|
43
|
+
signal?: AbortSignal;
|
|
44
|
+
now?: number;
|
|
45
|
+
}
|
|
46
|
+
export interface RemoteConfigControlPlaneFetchInput extends RemoteConfigSyncContext {
|
|
47
|
+
}
|
|
48
|
+
export interface RemoteConfigControlPlane {
|
|
49
|
+
name: string;
|
|
50
|
+
fetchBundle(input: RemoteConfigControlPlaneFetchInput): Promise<RemoteConfigBundle | undefined>;
|
|
51
|
+
}
|
|
52
|
+
export interface RemoteConfigBundleStore {
|
|
53
|
+
read(): Promise<RemoteConfigBundle | undefined>;
|
|
54
|
+
write(bundle: RemoteConfigBundle): Promise<void>;
|
|
55
|
+
clear(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export interface RemoteConfigManagedArtifactStore {
|
|
58
|
+
writeText(filePath: string, contents: string): Promise<void>;
|
|
59
|
+
remove(targetPath: string): Promise<void>;
|
|
60
|
+
removeChildren(directoryPath: string): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export interface RemoteConfigManagedPaths {
|
|
63
|
+
pluginName: string;
|
|
64
|
+
pluginPath: string;
|
|
65
|
+
workflowsPath: string;
|
|
66
|
+
skillsPath: string;
|
|
67
|
+
bundleCachePath: string;
|
|
68
|
+
manifestPath: string;
|
|
69
|
+
rulesFilePath: string;
|
|
70
|
+
}
|
|
71
|
+
export interface RemoteConfigMaterializationInput {
|
|
72
|
+
bundle: RemoteConfigBundle;
|
|
73
|
+
paths: RemoteConfigManagedPaths;
|
|
74
|
+
artifactStore: RemoteConfigManagedArtifactStore;
|
|
75
|
+
}
|
|
76
|
+
export interface RemoteConfigMaterializedInstructionFile {
|
|
77
|
+
kind: RemoteConfigManagedInstructionKind;
|
|
78
|
+
filePath: string;
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
}
|
|
82
|
+
export interface RemoteConfigMaterializationResult {
|
|
83
|
+
paths: RemoteConfigManagedPaths;
|
|
84
|
+
rulesFilePath?: string;
|
|
85
|
+
files: RemoteConfigMaterializedInstructionFile[];
|
|
86
|
+
}
|
|
87
|
+
export interface RemoteConfigPolicyMaterializer {
|
|
88
|
+
materialize(input: RemoteConfigMaterializationInput): Promise<RemoteConfigMaterializationResult>;
|
|
89
|
+
}
|
|
90
|
+
export interface RemoteConfigTelemetryAdapter {
|
|
91
|
+
name: string;
|
|
92
|
+
resolveTelemetry(bundle: RemoteConfigBundle, context: RemoteConfigSyncContext): Promise<Partial<OpenTelemetryClientConfig> | undefined> | Partial<OpenTelemetryClientConfig> | undefined;
|
|
93
|
+
}
|
|
94
|
+
export interface RemoteConfigClaimsMapper<TRole extends string = string> {
|
|
95
|
+
mapClaimsToRoles(claims: RemoteConfigIdentityClaims): TRole[];
|
|
96
|
+
}
|
|
97
|
+
export interface RemoteConfigSyncServiceOptions {
|
|
98
|
+
controlPlane: RemoteConfigControlPlane;
|
|
99
|
+
bundleStore: RemoteConfigBundleStore;
|
|
100
|
+
materializer: RemoteConfigPolicyMaterializer;
|
|
101
|
+
artifactStore: RemoteConfigManagedArtifactStore;
|
|
102
|
+
telemetryAdapter?: RemoteConfigTelemetryAdapter;
|
|
103
|
+
claimsMapper?: RemoteConfigClaimsMapper;
|
|
104
|
+
logger?: BasicLogger;
|
|
105
|
+
}
|
|
106
|
+
export interface RemoteConfigSyncResult {
|
|
107
|
+
bundle: RemoteConfigBundle;
|
|
108
|
+
materialized: RemoteConfigMaterializationResult;
|
|
109
|
+
telemetry?: Partial<OpenTelemetryClientConfig>;
|
|
110
|
+
roles: string[];
|
|
111
|
+
claims?: RemoteConfigIdentityClaims;
|
|
112
|
+
}
|
|
113
|
+
export interface PrepareRemoteConfigRuntimeOptions extends RemoteConfigSyncContext {
|
|
114
|
+
pluginName?: string;
|
|
115
|
+
controlPlane?: RemoteConfigControlPlane;
|
|
116
|
+
bundleStore?: RemoteConfigBundleStore;
|
|
117
|
+
artifactStore?: RemoteConfigManagedArtifactStore;
|
|
118
|
+
materializer?: RemoteConfigPolicyMaterializer;
|
|
119
|
+
telemetryAdapter?: RemoteConfigTelemetryAdapter;
|
|
120
|
+
claimsMapper?: RemoteConfigClaimsMapper;
|
|
121
|
+
useCachedBundle?: boolean;
|
|
122
|
+
requireBundle?: boolean;
|
|
123
|
+
}
|
|
124
|
+
export interface PreparedRemoteConfigRuntime {
|
|
125
|
+
pluginName: string;
|
|
126
|
+
pluginDefinition: AgentExtension;
|
|
127
|
+
paths: RemoteConfigManagedPaths;
|
|
128
|
+
bundle?: RemoteConfigBundle;
|
|
129
|
+
telemetry?: Partial<OpenTelemetryClientConfig>;
|
|
130
|
+
roles: string[];
|
|
131
|
+
claims?: RemoteConfigIdentityClaims;
|
|
132
|
+
usedCachedBundle: boolean;
|
|
133
|
+
workflowsDirectories: readonly string[];
|
|
134
|
+
skillsDirectories: readonly string[];
|
|
135
|
+
}
|
|
136
|
+
export declare function remoteConfigInstructionToManagedFile(kind: Extract<RemoteConfigManagedInstructionKind, "rule" | "workflow">, file: GlobalInstructionsFile, suffix: string): RemoteConfigManagedInstructionFile;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./artifact-store";
|
|
2
|
+
export * from "./blob-storage";
|
|
3
|
+
export * from "./bundle";
|
|
4
|
+
export * from "./constants";
|
|
5
|
+
export * from "./materializer";
|
|
6
|
+
export * from "./paths";
|
|
7
|
+
export * from "./runtime";
|
|
8
|
+
export * from "./schema";
|
|
9
|
+
export * from "./telemetry";
|