@caplets/core 0.26.0 → 0.27.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 +2 -1
- package/dist/caplet-files-bundle.d.ts +1 -0
- package/dist/caplet-source.js +39 -3
- package/dist/cli/inspection.d.ts +2 -1
- package/dist/cli.d.ts +5 -0
- package/dist/code-mode/types.d.ts +1 -1
- package/dist/{completion-DaYL-XQN.js → completion-1wDjwHkC.js} +4 -3
- package/dist/config/validation.d.ts +2 -0
- package/dist/config-runtime.d.ts +6 -1
- package/dist/config-runtime.js +34 -3
- package/dist/config.d.ts +10 -1
- package/dist/daemon/host-path.d.ts +8 -0
- package/dist/errors.d.ts +1 -1
- package/dist/exposure/namespace.d.ts +39 -0
- package/dist/index.js +830 -173
- package/dist/native/remote.d.ts +2 -1
- package/dist/native/service.d.ts +2 -2
- package/dist/native.js +1 -1
- package/dist/project-binding/errors.d.ts +1 -1
- package/dist/remote/profile-store.d.ts +2 -0
- package/dist/remote/profiles.d.ts +2 -0
- package/dist/remote/server-credential-store.d.ts +100 -1
- package/dist/remote/server-credentials.d.ts +18 -0
- package/dist/serve/http.d.ts +5 -0
- package/dist/{service-rvZ7z6FI.js → service-BGGiZLHa.js} +413 -47
- package/dist/{validation-C4tYXw6G.js → validation-CWzd2gtn.js} +4 -1
- package/package.json +1 -1
package/dist/native/remote.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { AttachCodeModeCaplet } from "../attach/api";
|
|
2
|
+
import type { CapletShadowingPolicy } from "../config";
|
|
2
3
|
import type { ResolvedNativeCapletsServiceOptions } from "./options";
|
|
3
4
|
import type { NativeCapletsService, NativeCapletsToolsChangedListener, NativeCapletTool } from "./service";
|
|
4
5
|
export type RemoteCapletsTool = {
|
|
5
6
|
name: string;
|
|
6
7
|
capletId?: string | undefined;
|
|
7
8
|
sourceCapletId?: string | undefined;
|
|
8
|
-
shadowing?:
|
|
9
|
+
shadowing?: CapletShadowingPolicy | undefined;
|
|
9
10
|
title?: string | undefined;
|
|
10
11
|
description?: string | undefined;
|
|
11
12
|
inputSchema?: unknown;
|
package/dist/native/service.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { NativeCapletsServiceResolutionInput } from "./options";
|
|
|
2
2
|
import { resolveNativeCapletsServiceOptions } from "./options";
|
|
3
3
|
import { type RemoteCapletsClient } from "./remote";
|
|
4
4
|
import type { CodeModeCallableCaplet } from "../code-mode/types";
|
|
5
|
-
import { type CapletsConfig } from "../config";
|
|
5
|
+
import { type CapletShadowingPolicy, type CapletsConfig } from "../config";
|
|
6
6
|
import { generatedToolInputJsonSchemaForCaplet } from "../generated-tool-input-schema";
|
|
7
7
|
export type NativeCapletsServiceOptions = NativeCapletsServiceResolutionInput & {
|
|
8
8
|
configPath?: string;
|
|
@@ -18,7 +18,7 @@ export type NativeCapletsServiceOptions = NativeCapletsServiceResolutionInput &
|
|
|
18
18
|
export type NativeCapletTool = {
|
|
19
19
|
caplet: string;
|
|
20
20
|
sourceCaplet?: string;
|
|
21
|
-
shadowing?:
|
|
21
|
+
shadowing?: CapletShadowingPolicy;
|
|
22
22
|
toolName: string;
|
|
23
23
|
title: string;
|
|
24
24
|
description: string;
|
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-
|
|
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";
|
|
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 = {}) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CapletsError } from "../errors";
|
|
2
|
-
export declare const PROJECT_BINDING_ERROR_CODES: readonly ["cloud_auth_required", "cloud_auth_expired", "cloud_auth_revoked", "workspace_selection_required", "workspace_switch_required", "workspace_forbidden", "project_binding_forbidden", "endpoint_unavailable", "websocket_upgrade_required", "sync_required", "sync_failed", "sync_size_limit_exceeded", "lease_conflict", "lease_expired", "policy_denied", "usage_limit_reached", "billing_required", "subscription_past_due", "email_verification_required", "remote_credentials_required", "remote_auth_failed"];
|
|
2
|
+
export declare const PROJECT_BINDING_ERROR_CODES: readonly ["cloud_auth_required", "cloud_auth_expired", "cloud_auth_revoked", "workspace_selection_required", "workspace_switch_required", "workspace_forbidden", "project_binding_forbidden", "endpoint_unavailable", "websocket_upgrade_required", "sync_required", "sync_failed", "sync_size_limit_exceeded", "lease_conflict", "lease_expired", "policy_denied", "usage_limit_reached", "billing_required", "subscription_past_due", "email_verification_required", "remote_credentials_required", "remote_credentials_revoked", "remote_auth_failed"];
|
|
3
3
|
export type ProjectBindingErrorCode = (typeof PROJECT_BINDING_ERROR_CODES)[number];
|
|
4
4
|
export type ProjectBindingRecovery = {
|
|
5
5
|
code: ProjectBindingErrorCode;
|
|
@@ -16,6 +16,7 @@ export type CloudProfileLookup = {
|
|
|
16
16
|
};
|
|
17
17
|
export type SaveSelfHostedProfileInput = {
|
|
18
18
|
hostUrl: string;
|
|
19
|
+
hostIdentity?: string | undefined;
|
|
19
20
|
clientId: string;
|
|
20
21
|
clientLabel?: string | undefined;
|
|
21
22
|
credentials: RemoteProfileCredential;
|
|
@@ -23,6 +24,7 @@ export type SaveSelfHostedProfileInput = {
|
|
|
23
24
|
};
|
|
24
25
|
export type SelfHostedProfileLookup = {
|
|
25
26
|
hostUrl: string;
|
|
27
|
+
hostIdentity?: string | undefined;
|
|
26
28
|
};
|
|
27
29
|
export type RefreshSelfHostedProfileInput = SelfHostedProfileLookup & {
|
|
28
30
|
needsRefresh: (credential: RemoteProfileCredential) => boolean;
|
|
@@ -16,6 +16,7 @@ export type RemoteProfileCredential = {
|
|
|
16
16
|
export type RemoteProfileStatusInput = {
|
|
17
17
|
kind: RemoteProfileKind;
|
|
18
18
|
hostUrl: string;
|
|
19
|
+
hostIdentity?: string | undefined;
|
|
19
20
|
key?: string | undefined;
|
|
20
21
|
workspaceId?: string | undefined;
|
|
21
22
|
workspaceSlug?: string | undefined;
|
|
@@ -31,6 +32,7 @@ export type RemoteProfileStatus = {
|
|
|
31
32
|
kind: RemoteProfileKind;
|
|
32
33
|
key: string;
|
|
33
34
|
hostUrl: string;
|
|
35
|
+
hostIdentity?: string | undefined;
|
|
34
36
|
workspaceId?: string | undefined;
|
|
35
37
|
workspaceSlug?: string | undefined;
|
|
36
38
|
clientId?: string | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type VaultEncryptedRecord } from "../vault/crypto";
|
|
2
|
+
import type { IssuedRemoteClientCredentials, RemoteClientStatus, RemotePendingLoginStatus, RemotePendingLoginState, ValidatedRemoteClient } from "./server-credentials";
|
|
2
3
|
export type RemoteServerCredentialStoreOptions = {
|
|
3
4
|
dir: string;
|
|
4
5
|
};
|
|
@@ -25,6 +26,29 @@ export type RefreshClientCredentialsInput = {
|
|
|
25
26
|
refreshToken: string;
|
|
26
27
|
now?: Date | undefined;
|
|
27
28
|
};
|
|
29
|
+
export type CreatePendingLoginInput = {
|
|
30
|
+
hostUrl: string;
|
|
31
|
+
hostIdentity?: string | undefined;
|
|
32
|
+
clientLabel?: string | undefined;
|
|
33
|
+
clientFingerprint?: string | undefined;
|
|
34
|
+
sourceHint?: string | undefined;
|
|
35
|
+
now?: Date | undefined;
|
|
36
|
+
};
|
|
37
|
+
export type PendingLoginPossessionInput = {
|
|
38
|
+
flowId: string;
|
|
39
|
+
pendingCompletionSecret: string;
|
|
40
|
+
now?: Date | undefined;
|
|
41
|
+
};
|
|
42
|
+
export type RefreshPendingLoginInput = PendingLoginPossessionInput & {
|
|
43
|
+
pendingRefreshSecret: string;
|
|
44
|
+
};
|
|
45
|
+
export type ApprovePendingLoginInput = {
|
|
46
|
+
operatorCode: string;
|
|
47
|
+
now?: Date | undefined;
|
|
48
|
+
};
|
|
49
|
+
export type CompletePendingLoginInput = PendingLoginPossessionInput & {
|
|
50
|
+
hostUrl: string;
|
|
51
|
+
};
|
|
28
52
|
type StoredPairingCode = {
|
|
29
53
|
codeId: string;
|
|
30
54
|
hostUrl: string;
|
|
@@ -49,18 +73,91 @@ type StoredRemoteClient = {
|
|
|
49
73
|
lastUsedAt?: string | undefined;
|
|
50
74
|
revokedAt?: string | undefined;
|
|
51
75
|
};
|
|
76
|
+
type PendingLoginStatus = RemotePendingLoginState;
|
|
77
|
+
type StoredPendingLogin = {
|
|
78
|
+
flowId: string;
|
|
79
|
+
hostUrl: string;
|
|
80
|
+
hostIdentity?: string | undefined;
|
|
81
|
+
operatorCodeHash: string;
|
|
82
|
+
pendingRefreshHash: string;
|
|
83
|
+
supersededPendingRefreshHashes: SupersededRefreshToken[];
|
|
84
|
+
pendingRefreshReplay?: PendingRefreshReplay | undefined;
|
|
85
|
+
pendingCompletionHash: string;
|
|
86
|
+
completionReplay?: CompletionReplay | undefined;
|
|
87
|
+
clientLabel: string;
|
|
88
|
+
clientFingerprint?: string | undefined;
|
|
89
|
+
sourceHint?: string | undefined;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
codeExpiresAt: string;
|
|
92
|
+
flowExpiresAt: string;
|
|
93
|
+
status: PendingLoginStatus;
|
|
94
|
+
operatorCodeFingerprint?: string | undefined;
|
|
95
|
+
approvedAt?: string | undefined;
|
|
96
|
+
deniedAt?: string | undefined;
|
|
97
|
+
cancelledAt?: string | undefined;
|
|
98
|
+
exchangedAt?: string | undefined;
|
|
99
|
+
};
|
|
52
100
|
type SupersededRefreshToken = {
|
|
53
101
|
hash: string;
|
|
54
102
|
supersededAt: string;
|
|
55
103
|
};
|
|
104
|
+
type PendingRefreshReplay = {
|
|
105
|
+
refreshHash: string;
|
|
106
|
+
expiresAt: string;
|
|
107
|
+
encryptedResponse: VaultEncryptedRecord;
|
|
108
|
+
};
|
|
109
|
+
type CompletionReplay = {
|
|
110
|
+
expiresAt: string;
|
|
111
|
+
encryptedCredentials: VaultEncryptedRecord;
|
|
112
|
+
};
|
|
56
113
|
type RemoteServerCredentialState = {
|
|
57
114
|
version: 1;
|
|
58
115
|
pairingCodes: StoredPairingCode[];
|
|
116
|
+
pendingLogins: StoredPendingLogin[];
|
|
59
117
|
clients: StoredRemoteClient[];
|
|
60
118
|
};
|
|
61
119
|
export declare class RemoteServerCredentialStore {
|
|
62
120
|
readonly dir: string;
|
|
63
121
|
constructor(options: RemoteServerCredentialStoreOptions);
|
|
122
|
+
createPendingLogin(input: CreatePendingLoginInput): {
|
|
123
|
+
flowId: string;
|
|
124
|
+
operatorCode: string;
|
|
125
|
+
operatorCodeFingerprint: string;
|
|
126
|
+
pendingRefreshSecret: string;
|
|
127
|
+
pendingCompletionSecret: string;
|
|
128
|
+
codeExpiresAt: string;
|
|
129
|
+
flowExpiresAt: string;
|
|
130
|
+
intervalSeconds: number;
|
|
131
|
+
};
|
|
132
|
+
pollPendingLogin(input: PendingLoginPossessionInput): {
|
|
133
|
+
flowId: string;
|
|
134
|
+
status: PendingLoginStatus;
|
|
135
|
+
};
|
|
136
|
+
refreshPendingLogin(input: RefreshPendingLoginInput): {
|
|
137
|
+
flowId: string;
|
|
138
|
+
operatorCode: string;
|
|
139
|
+
operatorCodeFingerprint: string;
|
|
140
|
+
pendingRefreshSecret: string;
|
|
141
|
+
codeExpiresAt: string;
|
|
142
|
+
flowExpiresAt: string;
|
|
143
|
+
intervalSeconds: number;
|
|
144
|
+
};
|
|
145
|
+
denyPendingLogin(input: ApprovePendingLoginInput): {
|
|
146
|
+
flowId: string;
|
|
147
|
+
status: "denied";
|
|
148
|
+
};
|
|
149
|
+
cancelPendingLogin(input: PendingLoginPossessionInput): {
|
|
150
|
+
flowId: string;
|
|
151
|
+
status: "cancelled";
|
|
152
|
+
};
|
|
153
|
+
approvePendingLogin(input: ApprovePendingLoginInput): {
|
|
154
|
+
flowId: string;
|
|
155
|
+
status: "approved";
|
|
156
|
+
clientLabel: string;
|
|
157
|
+
clientFingerprint?: string | undefined;
|
|
158
|
+
sourceHint?: string | undefined;
|
|
159
|
+
};
|
|
160
|
+
completePendingLogin(input: CompletePendingLoginInput): IssuedRemoteClientCredentials;
|
|
64
161
|
createPairingCode(input: CreatePairingCodeInput): {
|
|
65
162
|
codeId: string;
|
|
66
163
|
code: string;
|
|
@@ -68,6 +165,7 @@ export declare class RemoteServerCredentialStore {
|
|
|
68
165
|
};
|
|
69
166
|
exchangePairingCode(input: ExchangePairingCodeInput): IssuedRemoteClientCredentials;
|
|
70
167
|
listClients(): RemoteClientStatus[];
|
|
168
|
+
listPendingLogins(now?: Date): RemotePendingLoginStatus[];
|
|
71
169
|
revokeClient(clientId: string, now?: Date): boolean;
|
|
72
170
|
validateAccessToken(input: ValidateAccessTokenInput): ValidatedRemoteClient;
|
|
73
171
|
refreshClientCredentials(input: RefreshClientCredentialsInput): IssuedRemoteClientCredentials;
|
|
@@ -80,5 +178,6 @@ export declare class RemoteServerCredentialStore {
|
|
|
80
178
|
private acquireLock;
|
|
81
179
|
private releaseLock;
|
|
82
180
|
private clearStaleLock;
|
|
181
|
+
private pendingLoginForCompletion;
|
|
83
182
|
}
|
|
84
183
|
export {};
|
|
@@ -16,6 +16,24 @@ export type RemoteClientStatus = {
|
|
|
16
16
|
lastUsedAt?: string | undefined;
|
|
17
17
|
revokedAt?: string | undefined;
|
|
18
18
|
};
|
|
19
|
+
export type RemotePendingLoginState = "pending" | "approved" | "denied" | "cancelled" | "expired" | "exchanged";
|
|
20
|
+
export type RemotePendingLoginStatus = {
|
|
21
|
+
flowId: string;
|
|
22
|
+
hostUrl: string;
|
|
23
|
+
hostIdentity?: string | undefined;
|
|
24
|
+
status: RemotePendingLoginState;
|
|
25
|
+
operatorCodeFingerprint?: string | undefined;
|
|
26
|
+
clientLabel: string;
|
|
27
|
+
clientFingerprint?: string | undefined;
|
|
28
|
+
sourceHint?: string | undefined;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
codeExpiresAt: string;
|
|
31
|
+
flowExpiresAt: string;
|
|
32
|
+
approvedAt?: string | undefined;
|
|
33
|
+
deniedAt?: string | undefined;
|
|
34
|
+
cancelledAt?: string | undefined;
|
|
35
|
+
exchangedAt?: string | undefined;
|
|
36
|
+
};
|
|
19
37
|
export type ValidatedRemoteClient = RemoteClientStatus & {
|
|
20
38
|
tokenType: "Bearer";
|
|
21
39
|
};
|
package/dist/serve/http.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export declare function servicePaths(base: string): {
|
|
|
35
35
|
attachInvoke: string;
|
|
36
36
|
projectBindings: string;
|
|
37
37
|
pairingExchange: string;
|
|
38
|
+
remoteLoginStart: string;
|
|
39
|
+
remoteLoginPoll: string;
|
|
40
|
+
remoteLoginRefresh: string;
|
|
41
|
+
remoteLoginComplete: string;
|
|
42
|
+
remoteLoginCancel: string;
|
|
38
43
|
remoteRefresh: string;
|
|
39
44
|
remoteClient: string;
|
|
40
45
|
health: string;
|