@caplets/core 0.23.0 → 0.24.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/cli/code-mode.d.ts +3 -0
- package/dist/code-mode/api.d.ts +3 -1
- package/dist/code-mode/diagnostics.d.ts +8 -0
- package/dist/code-mode/index.d.ts +1 -1
- package/dist/code-mode/journal.d.ts +103 -0
- package/dist/code-mode/runner.d.ts +5 -0
- package/dist/code-mode/runtime-api.generated.d.ts +1 -1
- package/dist/code-mode/sandbox.d.ts +14 -1
- package/dist/code-mode/sessions.d.ts +53 -0
- package/dist/code-mode/tool.d.ts +5 -0
- package/dist/code-mode/types.d.ts +30 -0
- package/dist/code-mode.js +3 -1
- package/dist/{completion-BC4BNWo0.js → completion-CzHdM9B_.js} +1 -1
- package/dist/index.js +93 -28
- package/dist/native/options.d.ts +3 -6
- package/dist/native/remote.d.ts +2 -0
- package/dist/native/service.d.ts +1 -0
- package/dist/native/tools.d.ts +1 -0
- package/dist/native.js +1 -1
- package/dist/remote/options.d.ts +1 -1
- package/dist/serve/session.d.ts +1 -0
- package/dist/{service-CSRCJfpA.js → service-BCT_Ls_3.js} +2175 -182
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as GoogleDiscoveryManager, $t as ListPromptsRequestSchema, A as emptyCodeModeRunMeta, At as ReadBuffer, B as codeModeDeclarationHash, Bt as CompleteRequestSchema, C as nativeCapletToolDescription, Cn as safeParse, Ct as defaultCacheBaseDir, Dt as resolveConfigPath, Et as resolveCapletsRoot, F as createCodeModeCapletsApi, Ft as Protocol, G as resolveExposure, Gt as ElicitResultSchema, H as generateCodeModeRunToolDescription, Ht as CreateMessageResultWithToolsSchema, I as listCodeModeCallableCaplets, It as mergeCapabilities, J as findProjectRoot, Jt as GetPromptRequestSchema, K as decodeDirectResourceUri, Kt as EmptyResultSchema, L as CodeModeJournalStore, Lt as toJsonSchemaCompat, M as CodeModeSessionManager, Mt as assertClientRequestTaskCapability, N as QuickJsCodeModeSandbox, Nt as assertToolsCallTaskCapability, O as codeModeRunInputSchema, Ot as resolveProjectCapletsRoot, P as diagnoseCodeModeTypeScript, Pt as AjvJsonSchemaValidator, Q as capabilityDescription, Qt as LATEST_PROTOCOL_VERSION, R as CodeModeLogStore, Rt as CallToolRequestSchema, S as nativeCapletPromptGuidance, Sn as objectFromShape, St as DEFAULT_OBSERVED_OUTPUT_SHAPE_CACHE_DIR, Tt as defaultStateBaseDir, U as minifyCodeModeDeclarationText, Ut as CreateTaskResultSchema, V as generateCodeModeDeclarations, Vt as CreateMessageResultSchema, W as CapletsEngine, X as handleServerTool, Xt as InitializedNotificationSchema, Y as fingerprintProjectRoot, Yt as InitializeRequestSchema, Z as ServerRegistry, Zt as JSONRPCMessageSchema, _ as resolveHostedCloudRemote, _n as getParseErrorMessage, _t as deleteTokenBundle, a as projectBindingError, an as McpError, at as parseConfig, b as parseServerBaseUrl, bn as isZ4Schema, c as cloudAuthPath, cn as SetLevelRequestSchema, ct as loadCapletFilesFromMap, d as CloudAuthClient, dn as isInitializeRequest, dt as markdownStructuredContent, en as ListResourceTemplatesRequestSchema, et as loadConfig, fn as isJSONRPCErrorResponse, ft as refreshOAuthTokenBundle, g as resolveCapletsRemote, gn as getObjectShape, gt as startOAuthFlow, hn as getLiteralValue, ht as startGenericOAuthFlow, i as ProjectBindingError, in as LoggingLevelSchema, it as loadProjectConfig, j as runCodeMode, jt as serializeMessage, k as codeModeRunParamsSchema, kt as resolveProjectConfigPath, l as migrateCredentials, ln as assertCompleteRequestPrompt, lt as hasRenderableStructuredContent, m as buildProjectSyncManifest, mn as isJSONRPCResultResponse, mt as runOAuthFlow, n as resolveRemoteSelection, nn as ListRootsResultSchema, nt as loadGlobalConfig, o as projectBindingRecovery, on as ReadResourceRequestSchema, ot as discoverCapletFiles, p as createSdkRemoteCapletsClient, pn as isJSONRPCRequest, pt as runGenericOAuthFlow, q as directResourceUriMatchesTemplate, qt as ErrorCode, r as PROJECT_BINDING_ERROR_CODES, rn as ListToolsRequestSchema, rt as loadLocalOverlayConfigWithSources, s as CloudAuthStore, sn as SUPPORTED_PROTOCOL_VERSIONS, st as validateCapletFile, t as createNativeCapletsService, tn as ListResourcesRequestSchema, tt as loadConfigWithSources, u as redactedCloudAuthStatus, un as assertCompleteRequestResourceTemplate, ut as markdownCallToolResultContent, v as resolveRemoteMode, vn as getSchemaDescription, vt as isTokenBundleExpired, w as nativeCapletToolName, wn as safeParseAsync, wt as defaultConfigBaseDir, x as resolveCapletsServer, xn as normalizeObjectSchema, y as controlUrlForBase, yn as isSchemaOptional, yt as readTokenBundle, z as redactCodeModeLogText, zt as CallToolResultSchema } from "./service-BCT_Ls_3.js";
|
|
2
2
|
import { _ as record, b as unknown, d as literal, m as object, n as ZodOptional, o as array, p as number, r as _enum, s as boolean, v as string, x as url } from "./schemas-C0PNPwjS.js";
|
|
3
3
|
import { f as redactSecrets, i as SERVER_ID_PATTERN, l as CAPLETS_ERROR_CODES, p as toSafeError, u as CapletsError } from "./validation-DgxCzt-A.js";
|
|
4
4
|
import { generatedToolInputJsonSchemaForCaplet, generatedToolInputSchema, generatedToolInputSchemaForCaplet } from "./generated-tool-input-schema.js";
|
|
5
5
|
import { f as observedOutputShapeKey, g as stableJsonStringify, h as schemaHash, i as observeOutputShape, u as FileObservedOutputShapeStore } from "./observed-output-shapes-D2k2-q8K.js";
|
|
6
|
-
import { a as formatCapletList, c as resolveCliConfigPaths, l as cliCommands$1, n as completionScript, o as formatConfigPaths, s as listCaplets, t as completeCliWords, u as completionShells } from "./completion-
|
|
6
|
+
import { a as formatCapletList, c as resolveCliConfigPaths, l as cliCommands$1, n as completionScript, o as formatConfigPaths, s as listCaplets, t as completeCliWords, u as completionShells } from "./completion-CzHdM9B_.js";
|
|
7
7
|
import { n as normalizeCapletSourcePath, t as FilesystemCapletSource } from "./filesystem-Kkg32TOJ.js";
|
|
8
8
|
import { parseConfig as parseConfig$1 } from "./config-runtime.js";
|
|
9
9
|
import fs, { accessSync, chmodSync, closeSync, constants, copyFileSync, cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
@@ -1553,7 +1553,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
1553
1553
|
} };
|
|
1554
1554
|
//#endregion
|
|
1555
1555
|
//#region package.json
|
|
1556
|
-
var version = "0.
|
|
1556
|
+
var version = "0.24.0";
|
|
1557
1557
|
//#endregion
|
|
1558
1558
|
//#region src/serve/session.ts
|
|
1559
1559
|
var CapletsMcpSession = class {
|
|
@@ -1563,6 +1563,7 @@ var CapletsMcpSession = class {
|
|
|
1563
1563
|
resources = /* @__PURE__ */ new Map();
|
|
1564
1564
|
prompts = /* @__PURE__ */ new Map();
|
|
1565
1565
|
codeModeTool;
|
|
1566
|
+
codeModeSessions = new CodeModeSessionManager();
|
|
1566
1567
|
unsubscribeReload;
|
|
1567
1568
|
closed = false;
|
|
1568
1569
|
constructor(engine, options = {}) {
|
|
@@ -1592,6 +1593,7 @@ var CapletsMcpSession = class {
|
|
|
1592
1593
|
if (this.closed) return;
|
|
1593
1594
|
this.closed = true;
|
|
1594
1595
|
this.unsubscribeReload();
|
|
1596
|
+
this.codeModeSessions.close();
|
|
1595
1597
|
this.clearRegistrations();
|
|
1596
1598
|
await this.server.close();
|
|
1597
1599
|
}
|
|
@@ -1675,7 +1677,11 @@ var CapletsMcpSession = class {
|
|
|
1675
1677
|
code: parsed.data.code,
|
|
1676
1678
|
service: new EngineNativeCapletsService(this.engine),
|
|
1677
1679
|
...parsed.data.timeoutMs === void 0 ? {} : { timeoutMs: parsed.data.timeoutMs },
|
|
1678
|
-
|
|
1680
|
+
...parsed.data.sessionId === void 0 ? {} : { sessionId: parsed.data.sessionId },
|
|
1681
|
+
logStore: new CodeModeLogStore(),
|
|
1682
|
+
journalStore: new CodeModeJournalStore(),
|
|
1683
|
+
sessionManager: this.codeModeSessions,
|
|
1684
|
+
runtimeScope: "mcp"
|
|
1679
1685
|
}) : {
|
|
1680
1686
|
ok: false,
|
|
1681
1687
|
error: {
|
|
@@ -1689,14 +1695,7 @@ var CapletsMcpSession = class {
|
|
|
1689
1695
|
truncated: false,
|
|
1690
1696
|
stored: false
|
|
1691
1697
|
},
|
|
1692
|
-
meta:
|
|
1693
|
-
runId: "",
|
|
1694
|
-
traceId: "",
|
|
1695
|
-
declarationHash: "",
|
|
1696
|
-
durationMs: 0,
|
|
1697
|
-
timeoutMs: 0,
|
|
1698
|
-
maxTimeoutMs: 0
|
|
1699
|
-
}
|
|
1698
|
+
meta: emptyCodeModeRunMeta()
|
|
1700
1699
|
};
|
|
1701
1700
|
return {
|
|
1702
1701
|
content: [{
|
|
@@ -5525,10 +5524,31 @@ async function runCodeModeCli(options) {
|
|
|
5525
5524
|
...options.authDir ? { authDir: options.authDir } : {}
|
|
5526
5525
|
});
|
|
5527
5526
|
try {
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5527
|
+
if (options.sessionId !== void 0) {
|
|
5528
|
+
const result = {
|
|
5529
|
+
ok: false,
|
|
5530
|
+
error: {
|
|
5531
|
+
code: "SESSION_NOT_FOUND",
|
|
5532
|
+
message: "Code Mode one-shot CLI runs do not support --session-id. Omit --session-id to start a fresh one-shot run."
|
|
5533
|
+
},
|
|
5534
|
+
diagnostics: [],
|
|
5535
|
+
logs: {
|
|
5536
|
+
entries: [],
|
|
5537
|
+
truncated: false,
|
|
5538
|
+
stored: false
|
|
5539
|
+
},
|
|
5540
|
+
meta: emptyCodeModeRunMeta()
|
|
5541
|
+
};
|
|
5542
|
+
if (options.json) options.writeOut(`${JSON.stringify(result, null, 2)}\n`);
|
|
5543
|
+
else options.writeOut(`${result.error.code}: ${result.error.message}\n`);
|
|
5544
|
+
options.setExitCode(1);
|
|
5545
|
+
return;
|
|
5546
|
+
}
|
|
5547
|
+
const result = await runCodeMode({
|
|
5548
|
+
code: await readCodeModeCliCode(options),
|
|
5549
|
+
service: service.codeModeService?.() ?? service,
|
|
5550
|
+
...options.timeoutMs === void 0 ? {} : { timeoutMs: options.timeoutMs },
|
|
5551
|
+
runtimeScope: "cli-one-shot"
|
|
5532
5552
|
});
|
|
5533
5553
|
if (options.json) options.writeOut(`${JSON.stringify(result, null, 2)}\n`);
|
|
5534
5554
|
else if (result.ok) options.writeOut(`${formatHumanValue(result.value)}\n`);
|
|
@@ -5541,6 +5561,25 @@ async function runCodeModeCli(options) {
|
|
|
5541
5561
|
await service.close();
|
|
5542
5562
|
}
|
|
5543
5563
|
}
|
|
5564
|
+
async function runCodeModeReplCli(options) {
|
|
5565
|
+
const envelope = {
|
|
5566
|
+
ok: false,
|
|
5567
|
+
error: {
|
|
5568
|
+
code: "UNSUPPORTED_OPERATION",
|
|
5569
|
+
message: "Code Mode REPL sessions are not available in this build. Use `caplets code-mode` for one-shot runs."
|
|
5570
|
+
},
|
|
5571
|
+
diagnostics: [],
|
|
5572
|
+
logs: {
|
|
5573
|
+
entries: [],
|
|
5574
|
+
truncated: false,
|
|
5575
|
+
stored: false
|
|
5576
|
+
},
|
|
5577
|
+
meta: emptyCodeModeRunMeta()
|
|
5578
|
+
};
|
|
5579
|
+
if (options.json) options.writeOut(`${JSON.stringify(envelope, null, 2)}\n`);
|
|
5580
|
+
else options.writeOut(`${envelope.error.code}: ${envelope.error.message}\n`);
|
|
5581
|
+
options.setExitCode(1);
|
|
5582
|
+
}
|
|
5544
5583
|
async function codeModeTypesCli(options) {
|
|
5545
5584
|
const engine = new CapletsEngine({
|
|
5546
5585
|
...options.configPath ? { configPath: options.configPath } : {},
|
|
@@ -6968,7 +7007,7 @@ function setupDefinition(id, options) {
|
|
|
6968
7007
|
}
|
|
6969
7008
|
}
|
|
6970
7009
|
function remoteSetupDefinition(id, options) {
|
|
6971
|
-
const serverUrl = nonEmpty$1(options.remoteUrl) ?? nonEmpty$1(options.serverUrl) ?? nonEmpty$1(options.env?.CAPLETS_REMOTE_URL) ??
|
|
7010
|
+
const serverUrl = nonEmpty$1(options.remoteUrl) ?? nonEmpty$1(options.serverUrl) ?? nonEmpty$1(options.env?.CAPLETS_REMOTE_URL) ?? "https://caplets.example.com/caplets";
|
|
6972
7011
|
if (id === "opencode") return {
|
|
6973
7012
|
name: "OpenCode",
|
|
6974
7013
|
actions: [{
|
|
@@ -6981,7 +7020,7 @@ function remoteSetupDefinition(id, options) {
|
|
|
6981
7020
|
"--global"
|
|
6982
7021
|
]
|
|
6983
7022
|
}],
|
|
6984
|
-
nextSteps: [`Run OpenCode with CAPLETS_MODE=remote and
|
|
7023
|
+
nextSteps: [`Run OpenCode with CAPLETS_MODE=remote and CAPLETS_REMOTE_URL=${serverUrl}.`, "Keep CAPLETS_REMOTE_TOKEN or CAPLETS_REMOTE_PASSWORD in your shell or secret manager."]
|
|
6985
7024
|
};
|
|
6986
7025
|
if (id === "pi") return {
|
|
6987
7026
|
name: "Pi",
|
|
@@ -6991,7 +7030,7 @@ function remoteSetupDefinition(id, options) {
|
|
|
6991
7030
|
command: "pi",
|
|
6992
7031
|
args: ["install", "npm:@caplets/pi"]
|
|
6993
7032
|
}],
|
|
6994
|
-
nextSteps: [`Start Pi with CAPLETS_MODE=remote and
|
|
7033
|
+
nextSteps: [`Start Pi with CAPLETS_MODE=remote and CAPLETS_REMOTE_URL=${serverUrl}.`, "Keep CAPLETS_REMOTE_TOKEN or CAPLETS_REMOTE_PASSWORD in your shell or secret manager."]
|
|
6995
7034
|
};
|
|
6996
7035
|
if (id === "codex") return {
|
|
6997
7036
|
name: "Codex",
|
|
@@ -7030,7 +7069,7 @@ function remoteSetupDefinition(id, options) {
|
|
|
7030
7069
|
path: options.output,
|
|
7031
7070
|
content: `${JSON.stringify({ mcpServers: { caplets: { url: `${serverUrl.replace(/\/$/, "")}/v1/mcp` } } }, null, 2)}\n`
|
|
7032
7071
|
}],
|
|
7033
|
-
nextSteps: ["Add Basic Auth credentials through your agent's secret mechanism.", "Do not hardcode
|
|
7072
|
+
nextSteps: ["Add Basic Auth credentials through your agent's secret mechanism.", "Do not hardcode CAPLETS_REMOTE_TOKEN or CAPLETS_REMOTE_PASSWORD in a committed config file."]
|
|
7034
7073
|
};
|
|
7035
7074
|
}
|
|
7036
7075
|
function parseSetupIntegrationId(value) {
|
|
@@ -11791,11 +11830,8 @@ function createAttachNativeService(options, io) {
|
|
|
11791
11830
|
mode: options.selection.kind === "hosted_cloud" ? "cloud" : "remote",
|
|
11792
11831
|
configPath: options.configPath,
|
|
11793
11832
|
projectConfigPath: options.projectConfigPath,
|
|
11794
|
-
server: {
|
|
11795
|
-
url: options.selection.remote.baseUrl.toString(),
|
|
11796
|
-
...options.selection.remote.fetch ? { fetch: options.selection.remote.fetch } : {}
|
|
11797
|
-
},
|
|
11798
11833
|
remote: {
|
|
11834
|
+
url: options.selection.remote.baseUrl.toString(),
|
|
11799
11835
|
...options.selection.remote.fetch ? { fetch: options.selection.remote.fetch } : {},
|
|
11800
11836
|
...options.selection.kind === "hosted_cloud" ? { cloud: {
|
|
11801
11837
|
url: options.selection.cloudPresence.url.toString(),
|
|
@@ -12958,7 +12994,35 @@ function createProgram(io = {}) {
|
|
|
12958
12994
|
}
|
|
12959
12995
|
if (suggestions.length > 0) writeOut(`${suggestions.join("\n")}\n`);
|
|
12960
12996
|
});
|
|
12961
|
-
program.command(cliCommands$1.codeMode).description("Run, inspect, and debug Caplets Code Mode.").argument("[code]", "inline TypeScript code to run").option("--file <path>", "read TypeScript code from a file relative to the current directory").option("--timeout-ms <ms>", "execution timeout in milliseconds", parsePositiveInteger).option("--json", "print the structured run envelope").action(async (code, options) => {
|
|
12997
|
+
program.command(cliCommands$1.codeMode).description("Run, inspect, and debug Caplets Code Mode.").argument("[code]", "inline TypeScript code to run").option("--file <path>", "read TypeScript code from a file relative to the current directory").option("--session-id <id>", "optional Code Mode session identifier").option("--recover <ref>", "recover a prior Code Mode REPL session when supported").option("--timeout-ms <ms>", "execution timeout in milliseconds", parsePositiveInteger).option("--json", "print the structured run envelope").action(async (code, options) => {
|
|
12998
|
+
if (code === "repl" && options.file === void 0) {
|
|
12999
|
+
await runCodeModeReplCli({
|
|
13000
|
+
env,
|
|
13001
|
+
...currentConfigPath() ? { configPath: currentConfigPath() } : {},
|
|
13002
|
+
projectConfigPath: envProjectConfigPath(env),
|
|
13003
|
+
...io.authDir ? { authDir: io.authDir } : {},
|
|
13004
|
+
...options.sessionId === void 0 ? {} : { sessionId: options.sessionId },
|
|
13005
|
+
...options.recover === void 0 ? {} : { recoveryRef: options.recover },
|
|
13006
|
+
...options.json === void 0 ? {} : { json: options.json },
|
|
13007
|
+
writeOut,
|
|
13008
|
+
setExitCode
|
|
13009
|
+
});
|
|
13010
|
+
return;
|
|
13011
|
+
}
|
|
13012
|
+
if (options.recover !== void 0) {
|
|
13013
|
+
await runCodeModeReplCli({
|
|
13014
|
+
env,
|
|
13015
|
+
...currentConfigPath() ? { configPath: currentConfigPath() } : {},
|
|
13016
|
+
projectConfigPath: envProjectConfigPath(env),
|
|
13017
|
+
...io.authDir ? { authDir: io.authDir } : {},
|
|
13018
|
+
...options.sessionId === void 0 ? {} : { sessionId: options.sessionId },
|
|
13019
|
+
recoveryRef: options.recover,
|
|
13020
|
+
...options.json === void 0 ? {} : { json: options.json },
|
|
13021
|
+
writeOut,
|
|
13022
|
+
setExitCode
|
|
13023
|
+
});
|
|
13024
|
+
return;
|
|
13025
|
+
}
|
|
12962
13026
|
await runCodeModeCli({
|
|
12963
13027
|
env,
|
|
12964
13028
|
...currentConfigPath() ? { configPath: currentConfigPath() } : {},
|
|
@@ -12966,6 +13030,7 @@ function createProgram(io = {}) {
|
|
|
12966
13030
|
...io.authDir ? { authDir: io.authDir } : {},
|
|
12967
13031
|
...code === void 0 ? {} : { inlineCode: code },
|
|
12968
13032
|
...options.file === void 0 ? {} : { file: options.file },
|
|
13033
|
+
...options.sessionId === void 0 ? {} : { sessionId: options.sessionId },
|
|
12969
13034
|
...options.timeoutMs === void 0 ? {} : { timeoutMs: options.timeoutMs },
|
|
12970
13035
|
...options.json === void 0 ? {} : { json: options.json },
|
|
12971
13036
|
...io.readStdin ? { readStdin: io.readStdin } : {},
|
|
@@ -13715,8 +13780,8 @@ function envConfigPath(env) {
|
|
|
13715
13780
|
}
|
|
13716
13781
|
function remoteClientForCli(io) {
|
|
13717
13782
|
const env = io.env ?? process.env;
|
|
13718
|
-
if (
|
|
13719
|
-
return new RemoteControlClient(
|
|
13783
|
+
if (resolveRemoteMode({}, env).mode !== "remote") return;
|
|
13784
|
+
return new RemoteControlClient(resolveCapletsRemote(io.fetch ? { fetch: io.fetch } : {}, env));
|
|
13720
13785
|
}
|
|
13721
13786
|
async function openBrowser(url) {
|
|
13722
13787
|
const { spawn } = await import("node:child_process");
|
|
@@ -13831,7 +13896,7 @@ async function remoteAuthLogin(remote, serverId, open, writeOut) {
|
|
|
13831
13896
|
}
|
|
13832
13897
|
function requireRemoteClientForTarget(io) {
|
|
13833
13898
|
const remote = remoteClientForCli(io);
|
|
13834
|
-
if (!remote) throw new CapletsError("REQUEST_INVALID", "--remote requires CAPLETS_MODE=remote and
|
|
13899
|
+
if (!remote) throw new CapletsError("REQUEST_INVALID", "--remote requires CAPLETS_MODE=remote and CAPLETS_REMOTE_URL");
|
|
13835
13900
|
return remote;
|
|
13836
13901
|
}
|
|
13837
13902
|
function collect(value, previous) {
|
package/dist/native/options.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type CapletsRemoteEnv } from "../remote/options";
|
|
1
|
+
import { type CapletsRemoteEnv, type CapletsRemoteInput } from "../remote/options";
|
|
3
2
|
type CapletsMode = "auto" | "local" | "remote" | "cloud";
|
|
4
3
|
export type NativeCapletsMode = CapletsMode;
|
|
5
|
-
export type NativeRemoteCapletsOptions = {
|
|
4
|
+
export type NativeRemoteCapletsOptions = CapletsRemoteInput & {
|
|
6
5
|
pollIntervalMs?: number;
|
|
7
|
-
fetch?: typeof fetch;
|
|
8
6
|
cloud?: NativeCloudPresenceInput;
|
|
9
7
|
};
|
|
10
8
|
export type NativeCloudPresenceInput = {
|
|
@@ -16,10 +14,9 @@ export type NativeCloudPresenceInput = {
|
|
|
16
14
|
};
|
|
17
15
|
export type NativeCapletsServiceResolutionInput = {
|
|
18
16
|
mode?: NativeCapletsMode;
|
|
19
|
-
server?: CapletsServerInput;
|
|
20
17
|
remote?: NativeRemoteCapletsOptions;
|
|
21
18
|
};
|
|
22
|
-
export type NativeCapletsEnv =
|
|
19
|
+
export type NativeCapletsEnv = CapletsRemoteEnv & Partial<Record<"CAPLETS_CLOUD_URL" | "CAPLETS_CLOUD_TOKEN" | "CAPLETS_CLOUD_WORKSPACE_ID" | "CAPLETS_PROJECT_ROOT", string>>;
|
|
23
20
|
export type NativeRemoteAuthOptions = {
|
|
24
21
|
enabled: false;
|
|
25
22
|
user: string;
|
package/dist/native/remote.d.ts
CHANGED
|
@@ -40,11 +40,13 @@ export declare class RemoteNativeCapletsService implements NativeCapletsService
|
|
|
40
40
|
private client;
|
|
41
41
|
private unsubscribeRemote;
|
|
42
42
|
private readonly pollTimer;
|
|
43
|
+
private readonly codeModeSessions;
|
|
43
44
|
private closed;
|
|
44
45
|
private resetInFlight;
|
|
45
46
|
constructor(options: RemoteNativeCapletsServiceOptions);
|
|
46
47
|
listTools(): NativeCapletTool[];
|
|
47
48
|
execute(capletId: string, request: unknown): Promise<unknown>;
|
|
49
|
+
codeModeService(): NativeCapletsService;
|
|
48
50
|
reload(): Promise<boolean>;
|
|
49
51
|
onToolsChanged(listener: NativeCapletsToolsChangedListener): () => void;
|
|
50
52
|
close(): Promise<void>;
|
package/dist/native/service.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type NativeCapletsToolsChangedListener = (tools: NativeCapletTool[]) => v
|
|
|
36
36
|
export type NativeCapletsService = {
|
|
37
37
|
listTools(): NativeCapletTool[];
|
|
38
38
|
execute(capletId: string, request: unknown): Promise<unknown>;
|
|
39
|
+
codeModeService?(): NativeCapletsService;
|
|
39
40
|
reload(): Promise<boolean>;
|
|
40
41
|
onToolsChanged(listener: NativeCapletsToolsChangedListener): () => void;
|
|
41
42
|
close(): Promise<void>;
|
package/dist/native/tools.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export declare const nativeCodeModeToolId = "code_mode";
|
|
|
3
3
|
export declare const nativeCodeModeToolName = "caplets__code_mode";
|
|
4
4
|
export declare function nativeCapletToolName(capletId: string): string;
|
|
5
5
|
export declare function nativeCapletsSystemGuidance(toolNames: string[]): string;
|
|
6
|
+
export declare function nativeCodeModePromptGuidance(): string[];
|
|
6
7
|
export declare function nativeCapletPromptGuidance(toolName: string, caplet: CapletConfig): string[];
|
|
7
8
|
export declare function nativeCapletToolDescription(toolName: string, caplet: CapletConfig): string;
|
package/dist/native.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as
|
|
1
|
+
import { C as nativeCapletToolDescription, D as nativeCodeModeToolName, E as nativeCodeModeToolId, S as nativeCapletPromptGuidance, T as nativeCapletsSystemGuidance, f as RemoteNativeCapletsService, h as resolveNativeCapletsServiceOptions, p as createSdkRemoteCapletsClient, t as createNativeCapletsService, w as nativeCapletToolName } from "./service-BCT_Ls_3.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 = {}) {
|
package/dist/remote/options.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type CapletsRemoteEnv = Partial<Record<"CAPLETS_MODE" | "CAPLETS_REMOTE_URL" | "CAPLETS_REMOTE_USER" | "CAPLETS_REMOTE_PASSWORD" | "CAPLETS_REMOTE_TOKEN" | "CAPLETS_REMOTE_WORKSPACE"
|
|
1
|
+
export type CapletsRemoteEnv = Partial<Record<"CAPLETS_MODE" | "CAPLETS_REMOTE_URL" | "CAPLETS_REMOTE_USER" | "CAPLETS_REMOTE_PASSWORD" | "CAPLETS_REMOTE_TOKEN" | "CAPLETS_REMOTE_WORKSPACE", string>>;
|
|
2
2
|
export type CapletsRemoteModeInput = {
|
|
3
3
|
mode?: string;
|
|
4
4
|
remoteUrl?: string;
|
package/dist/serve/session.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export declare class CapletsMcpSession {
|
|
|
13
13
|
private readonly resources;
|
|
14
14
|
private readonly prompts;
|
|
15
15
|
private codeModeTool;
|
|
16
|
+
private readonly codeModeSessions;
|
|
16
17
|
private readonly unsubscribeReload;
|
|
17
18
|
private closed;
|
|
18
19
|
constructor(engine: CapletsEngine, options?: CapletsMcpSessionOptions);
|