@botiverse/raft-daemon 0.63.4 → 0.63.5-play.20260622140740
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/{chunk-RUGCYI7A.js → chunk-ZGGFS72W.js} +168 -36
- package/dist/cli/index.js +177 -13
- package/dist/core.js +5 -1
- package/dist/{dist-4KV4FRQE.js → dist-LRTPHCPD.js} +175 -13
- package/dist/index.js +5 -3
- package/package.json +1 -1
|
@@ -1039,11 +1039,36 @@ var integrationApproveAgentLoginOperationSchema = z.object({
|
|
|
1039
1039
|
scopes: z.array(z.string().trim().min(1).max(120)).max(64),
|
|
1040
1040
|
draftHint: draftHintSchema
|
|
1041
1041
|
});
|
|
1042
|
+
var integrationAppDraftFieldsSchema = z.object({
|
|
1043
|
+
name: z.string().trim().min(1).max(120).optional(),
|
|
1044
|
+
description: z.string().trim().max(1e3).optional(),
|
|
1045
|
+
homepageUrl: z.string().trim().max(2e3).optional(),
|
|
1046
|
+
returnUrl: z.string().trim().max(2e3).optional(),
|
|
1047
|
+
agentManifestUrl: z.string().trim().max(2e3).optional()
|
|
1048
|
+
});
|
|
1049
|
+
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
1050
|
+
type: z.literal("integration:register_app"),
|
|
1051
|
+
name: z.string().trim().min(1).max(120),
|
|
1052
|
+
clientKey: z.string().trim().min(1).max(120),
|
|
1053
|
+
returnUrl: z.string().trim().min(1).max(2e3),
|
|
1054
|
+
scopes: z.array(z.string().trim().min(1).max(120)).max(64).default([]),
|
|
1055
|
+
unsafeDemoUrlOverride: z.boolean().optional(),
|
|
1056
|
+
draftHint: draftHintSchema
|
|
1057
|
+
});
|
|
1058
|
+
var integrationUpdateAppRegistrationOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
1059
|
+
type: z.literal("integration:update_app_registration"),
|
|
1060
|
+
clientKey: z.string().trim().min(1).max(120),
|
|
1061
|
+
scopes: z.array(z.string().trim().min(1).max(120)).max(64).optional(),
|
|
1062
|
+
unsafeDemoUrlOverride: z.boolean().optional(),
|
|
1063
|
+
draftHint: draftHintSchema
|
|
1064
|
+
});
|
|
1042
1065
|
var actionCardActionSchema = z.discriminatedUnion("type", [
|
|
1043
1066
|
channelCreateOperationSchema,
|
|
1044
1067
|
agentCreateOperationSchema,
|
|
1045
1068
|
channelAddMemberOperationSchema,
|
|
1046
|
-
integrationApproveAgentLoginOperationSchema
|
|
1069
|
+
integrationApproveAgentLoginOperationSchema,
|
|
1070
|
+
integrationRegisterAppOperationSchema,
|
|
1071
|
+
integrationUpdateAppRegistrationOperationSchema
|
|
1047
1072
|
]);
|
|
1048
1073
|
|
|
1049
1074
|
// ../shared/src/agentInbox.ts
|
|
@@ -1540,8 +1565,8 @@ var PLAN_CONFIG = {
|
|
|
1540
1565
|
displayFeatures: [
|
|
1541
1566
|
"Channels",
|
|
1542
1567
|
"Tasks",
|
|
1543
|
-
"
|
|
1544
|
-
"Agent
|
|
1568
|
+
"Agents on your own computers",
|
|
1569
|
+
"Agent reminders",
|
|
1545
1570
|
"Basic observability",
|
|
1546
1571
|
"30 days of message history",
|
|
1547
1572
|
"100 MB file uploads/month"
|
|
@@ -1572,12 +1597,13 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
1572
1597
|
priceCadence: "/ seat pack / month",
|
|
1573
1598
|
extraAgentPrice: 0,
|
|
1574
1599
|
displayFeatures: [
|
|
1575
|
-
"
|
|
1600
|
+
"Everything in Free",
|
|
1576
1601
|
"Unlimited message history",
|
|
1577
1602
|
"Higher file upload limits",
|
|
1578
|
-
"Joint
|
|
1603
|
+
"Joint channels",
|
|
1579
1604
|
"More professional features coming soon"
|
|
1580
1605
|
],
|
|
1606
|
+
displayDescription: "For builders and teams scaling agent collaboration.",
|
|
1581
1607
|
displayNote: "$17.60 / seat pack / month when billed yearly"
|
|
1582
1608
|
},
|
|
1583
1609
|
enterprise: {
|
|
@@ -1589,14 +1615,18 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
1589
1615
|
priceCadence: null,
|
|
1590
1616
|
extraAgentPrice: 0,
|
|
1591
1617
|
displayFeatures: [
|
|
1592
|
-
"
|
|
1593
|
-
"
|
|
1594
|
-
"
|
|
1595
|
-
"
|
|
1596
|
-
]
|
|
1618
|
+
"Everything in Pro",
|
|
1619
|
+
"Private deployment options",
|
|
1620
|
+
"SSO and advanced access control",
|
|
1621
|
+
"Dedicated onboarding and rollout support"
|
|
1622
|
+
],
|
|
1623
|
+
displayDescription: "For advanced deployment and governance needs."
|
|
1597
1624
|
}
|
|
1598
1625
|
};
|
|
1599
1626
|
var FREE_MONTHLY_FILE_UPLOAD_LIMIT_BYTES = 100 * 1024 * 1024;
|
|
1627
|
+
var TRIAL_START_DATE = /* @__PURE__ */ new Date("2026-04-18T00:00:00Z");
|
|
1628
|
+
var TRIAL_END_DATE = /* @__PURE__ */ new Date("2026-06-23T12:00:00Z");
|
|
1629
|
+
var TRIAL_DURATION_DAYS = (TRIAL_END_DATE.getTime() - TRIAL_START_DATE.getTime()) / (24 * 60 * 60 * 1e3);
|
|
1600
1630
|
|
|
1601
1631
|
// src/agentProcessManager.ts
|
|
1602
1632
|
import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync6, readdirSync as readdirSync4, statSync, writeFileSync as writeFileSync4 } from "fs";
|
|
@@ -2582,6 +2612,19 @@ function listLegacySlockStatePaths(slockHome = resolveSlockHome(), homeDir = os.
|
|
|
2582
2612
|
return candidates.filter((candidate) => existsSync(candidate.path));
|
|
2583
2613
|
}
|
|
2584
2614
|
|
|
2615
|
+
// src/authEnv.ts
|
|
2616
|
+
var DAEMON_API_KEY_ENV = "SLOCK_MACHINE_API_KEY";
|
|
2617
|
+
var SLOCK_AGENT_TOKEN_ENV = "SLOCK_AGENT_TOKEN";
|
|
2618
|
+
function scrubDaemonAuthEnv(env) {
|
|
2619
|
+
delete env[DAEMON_API_KEY_ENV];
|
|
2620
|
+
return env;
|
|
2621
|
+
}
|
|
2622
|
+
function scrubDaemonChildEnv(env) {
|
|
2623
|
+
delete env[DAEMON_API_KEY_ENV];
|
|
2624
|
+
delete env[SLOCK_AGENT_TOKEN_ENV];
|
|
2625
|
+
return env;
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2585
2628
|
// src/agentCredentialProxy.ts
|
|
2586
2629
|
import { randomBytes } from "crypto";
|
|
2587
2630
|
import http from "http";
|
|
@@ -4148,7 +4191,9 @@ var LOOPBACK_NO_PROXY = "127.0.0.1,localhost";
|
|
|
4148
4191
|
var CLI_TRANSPORT_TRACE_DIR_ENV = "SLOCK_CLI_TRANSPORT_TRACE_DIR";
|
|
4149
4192
|
var safePathPart = (value) => value.replace(/[^a-zA-Z0-9_.-]/g, "_");
|
|
4150
4193
|
var RAW_CREDENTIAL_ENV_DENYLIST = [
|
|
4151
|
-
"
|
|
4194
|
+
"SLOCK_AGENT_TOKEN",
|
|
4195
|
+
"SLOCK_AGENT_CREDENTIAL_KEY",
|
|
4196
|
+
"SLOCK_AGENT_CREDENTIAL_KEY_FILE"
|
|
4152
4197
|
];
|
|
4153
4198
|
var WORKSPACE_CLI_TRANSPORT_FILENAMES = [
|
|
4154
4199
|
"agent-token",
|
|
@@ -4500,7 +4545,7 @@ set "SLOCK_AGENT_ACTIVE_CAPABILITIES=${DEFAULT_ACTIVE_CAPABILITIES}"\r
|
|
|
4500
4545
|
SLOCK_SERVER_URL: ctx.config.serverUrl,
|
|
4501
4546
|
PATH: `${slockDir}${path2.delimiter}${process.env.PATH ?? ""}`
|
|
4502
4547
|
};
|
|
4503
|
-
|
|
4548
|
+
scrubDaemonChildEnv(spawnEnv);
|
|
4504
4549
|
for (const key of RAW_CREDENTIAL_ENV_DENYLIST) {
|
|
4505
4550
|
delete spawnEnv[key];
|
|
4506
4551
|
}
|
|
@@ -5022,7 +5067,7 @@ function requiresWindowsShell(command, platform = process.platform) {
|
|
|
5022
5067
|
}
|
|
5023
5068
|
function resolveCommandOnPath(command, deps = {}) {
|
|
5024
5069
|
const platform = deps.platform ?? process.platform;
|
|
5025
|
-
const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
|
|
5070
|
+
const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
|
|
5026
5071
|
const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
|
|
5027
5072
|
const existsSyncFn = deps.existsSyncFn ?? existsSync3;
|
|
5028
5073
|
if (platform === "win32") {
|
|
@@ -5048,7 +5093,7 @@ function firstExistingPath(candidates, deps = {}) {
|
|
|
5048
5093
|
return null;
|
|
5049
5094
|
}
|
|
5050
5095
|
function readCommandVersion(command, args = [], deps = {}) {
|
|
5051
|
-
const env = withWindowsUserEnvironment(deps.env ?? process.env, deps);
|
|
5096
|
+
const env = scrubDaemonChildEnv({ ...withWindowsUserEnvironment(deps.env ?? process.env, deps) });
|
|
5052
5097
|
const execFileSyncFn = deps.execFileSyncFn ?? execFileSync;
|
|
5053
5098
|
try {
|
|
5054
5099
|
const output = normalizeExecOutput(execFileSyncFn(command, [...args, "--version"], {
|
|
@@ -7128,11 +7173,11 @@ function detectCursorModels(runCommand = runCursorModelsCommand) {
|
|
|
7128
7173
|
return parseCursorModelsOutput(String(result.stdout || ""));
|
|
7129
7174
|
}
|
|
7130
7175
|
function buildCursorModelProbeEnv(deps = {}) {
|
|
7131
|
-
return withWindowsUserEnvironment({
|
|
7176
|
+
return scrubDaemonChildEnv(withWindowsUserEnvironment({
|
|
7132
7177
|
...deps.env ?? process.env,
|
|
7133
7178
|
FORCE_COLOR: "0",
|
|
7134
7179
|
NO_COLOR: "1"
|
|
7135
|
-
}, deps);
|
|
7180
|
+
}, deps));
|
|
7136
7181
|
}
|
|
7137
7182
|
function runCursorModelsCommand() {
|
|
7138
7183
|
return spawnSync("cursor-agent", ["models"], {
|
|
@@ -7188,7 +7233,7 @@ function resolveGeminiSpawn(commandArgs, deps = {}) {
|
|
|
7188
7233
|
}
|
|
7189
7234
|
const execFileSyncFn = deps.execFileSyncFn ?? execFileSync3;
|
|
7190
7235
|
const existsSyncFn = deps.existsSyncFn ?? existsSync5;
|
|
7191
|
-
const env = deps.env ?? process.env;
|
|
7236
|
+
const env = scrubDaemonChildEnv({ ...deps.env ?? process.env });
|
|
7192
7237
|
const winPath = path8.win32;
|
|
7193
7238
|
let geminiEntry = null;
|
|
7194
7239
|
try {
|
|
@@ -7325,12 +7370,15 @@ var GeminiDriver = class {
|
|
|
7325
7370
|
// src/drivers/kimi.ts
|
|
7326
7371
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
7327
7372
|
import { spawn as spawn7 } from "child_process";
|
|
7328
|
-
import { existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
7373
|
+
import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
7329
7374
|
import os4 from "os";
|
|
7330
7375
|
import path9 from "path";
|
|
7331
7376
|
var KIMI_WIRE_PROTOCOL_VERSION = "1.3";
|
|
7332
7377
|
var KIMI_SYSTEM_PROMPT_FILE = ".slock-kimi-system.md";
|
|
7333
7378
|
var KIMI_AGENT_FILE = ".slock-kimi-agent.yaml";
|
|
7379
|
+
var KIMI_GENERATED_CONFIG_FILE = ".slock-kimi-config.toml";
|
|
7380
|
+
var SLOCK_KIMI_CONFIG_CONTENT_ENV = "SLOCK_KIMI_CONFIG_CONTENT";
|
|
7381
|
+
var SLOCK_KIMI_CONFIG_FILE_ENV = "SLOCK_KIMI_CONFIG_FILE";
|
|
7334
7382
|
function parseToolArguments(raw) {
|
|
7335
7383
|
if (typeof raw !== "string") return raw;
|
|
7336
7384
|
try {
|
|
@@ -7339,6 +7387,73 @@ function parseToolArguments(raw) {
|
|
|
7339
7387
|
return raw;
|
|
7340
7388
|
}
|
|
7341
7389
|
}
|
|
7390
|
+
function readKimiConfigSource(home = os4.homedir(), env = process.env) {
|
|
7391
|
+
const inlineConfig = env[SLOCK_KIMI_CONFIG_CONTENT_ENV];
|
|
7392
|
+
if (inlineConfig && inlineConfig.trim()) {
|
|
7393
|
+
return {
|
|
7394
|
+
raw: inlineConfig,
|
|
7395
|
+
explicitPath: null,
|
|
7396
|
+
sourcePath: SLOCK_KIMI_CONFIG_CONTENT_ENV
|
|
7397
|
+
};
|
|
7398
|
+
}
|
|
7399
|
+
const explicitPath = env[SLOCK_KIMI_CONFIG_FILE_ENV];
|
|
7400
|
+
const configPath = explicitPath && explicitPath.trim() ? explicitPath : path9.join(home, ".kimi", "config.toml");
|
|
7401
|
+
try {
|
|
7402
|
+
return {
|
|
7403
|
+
raw: readFileSync3(configPath, "utf8"),
|
|
7404
|
+
explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
|
|
7405
|
+
sourcePath: configPath
|
|
7406
|
+
};
|
|
7407
|
+
} catch {
|
|
7408
|
+
return {
|
|
7409
|
+
raw: null,
|
|
7410
|
+
explicitPath: explicitPath && explicitPath.trim() ? explicitPath : null,
|
|
7411
|
+
sourcePath: configPath
|
|
7412
|
+
};
|
|
7413
|
+
}
|
|
7414
|
+
}
|
|
7415
|
+
function buildKimiSpawnEnv(env = process.env) {
|
|
7416
|
+
const spawnEnv = { ...env, FORCE_COLOR: "0", NO_COLOR: "1" };
|
|
7417
|
+
delete spawnEnv[SLOCK_KIMI_CONFIG_CONTENT_ENV];
|
|
7418
|
+
delete spawnEnv[SLOCK_KIMI_CONFIG_FILE_ENV];
|
|
7419
|
+
return scrubDaemonChildEnv(spawnEnv);
|
|
7420
|
+
}
|
|
7421
|
+
function buildKimiEffectiveEnv(ctx, overrideEnv) {
|
|
7422
|
+
return {
|
|
7423
|
+
...process.env,
|
|
7424
|
+
...ctx.config.envVars || {},
|
|
7425
|
+
...overrideEnv || {}
|
|
7426
|
+
};
|
|
7427
|
+
}
|
|
7428
|
+
function buildKimiLaunchOptions(ctx, opts = {}) {
|
|
7429
|
+
const env = buildKimiEffectiveEnv(ctx, opts.env);
|
|
7430
|
+
const source = readKimiConfigSource(opts.home ?? os4.homedir(), env);
|
|
7431
|
+
const args = [];
|
|
7432
|
+
let configFilePath = null;
|
|
7433
|
+
let configContent = null;
|
|
7434
|
+
if (source.explicitPath) {
|
|
7435
|
+
configFilePath = source.explicitPath;
|
|
7436
|
+
} else if (source.raw !== null && source.sourcePath === SLOCK_KIMI_CONFIG_CONTENT_ENV) {
|
|
7437
|
+
configFilePath = path9.join(ctx.workingDirectory, KIMI_GENERATED_CONFIG_FILE);
|
|
7438
|
+
configContent = source.raw;
|
|
7439
|
+
if (opts.writeGeneratedConfig !== false) {
|
|
7440
|
+
writeFileSync3(configFilePath, source.raw, { encoding: "utf8", mode: 384 });
|
|
7441
|
+
chmodSync(configFilePath, 384);
|
|
7442
|
+
}
|
|
7443
|
+
}
|
|
7444
|
+
if (configFilePath) {
|
|
7445
|
+
args.push("--config-file", configFilePath);
|
|
7446
|
+
}
|
|
7447
|
+
if (ctx.config.model && ctx.config.model !== "default") {
|
|
7448
|
+
args.push("--model", ctx.config.model);
|
|
7449
|
+
}
|
|
7450
|
+
return {
|
|
7451
|
+
args,
|
|
7452
|
+
env: buildKimiSpawnEnv(env),
|
|
7453
|
+
configFilePath,
|
|
7454
|
+
configContent
|
|
7455
|
+
};
|
|
7456
|
+
}
|
|
7342
7457
|
function resolveKimiSpawn(commandArgs, deps = {}) {
|
|
7343
7458
|
return {
|
|
7344
7459
|
command: resolveCommandOnPath("kimi", deps) ?? "kimi",
|
|
@@ -7362,7 +7477,25 @@ var KimiDriver = class {
|
|
|
7362
7477
|
};
|
|
7363
7478
|
model = {
|
|
7364
7479
|
detectedModelsVerifiedAs: "launchable",
|
|
7365
|
-
toLaunchSpec: (modelId) =>
|
|
7480
|
+
toLaunchSpec: (modelId, ctx, opts) => {
|
|
7481
|
+
if (!ctx) return { args: ["--model", modelId] };
|
|
7482
|
+
const launchCtx = {
|
|
7483
|
+
...ctx,
|
|
7484
|
+
config: {
|
|
7485
|
+
...ctx.config,
|
|
7486
|
+
model: modelId
|
|
7487
|
+
}
|
|
7488
|
+
};
|
|
7489
|
+
const launch = buildKimiLaunchOptions(launchCtx, {
|
|
7490
|
+
home: opts?.home,
|
|
7491
|
+
writeGeneratedConfig: false
|
|
7492
|
+
});
|
|
7493
|
+
return {
|
|
7494
|
+
args: launch.args,
|
|
7495
|
+
env: launch.env,
|
|
7496
|
+
configFiles: launch.configFilePath ? [launch.configFilePath] : void 0
|
|
7497
|
+
};
|
|
7498
|
+
}
|
|
7366
7499
|
};
|
|
7367
7500
|
supportsStdinNotification = true;
|
|
7368
7501
|
busyDeliveryMode = "direct";
|
|
@@ -7386,21 +7519,23 @@ var KimiDriver = class {
|
|
|
7386
7519
|
` system_prompt_path: ./${KIMI_SYSTEM_PROMPT_FILE}`,
|
|
7387
7520
|
""
|
|
7388
7521
|
].join("\n"), "utf8");
|
|
7522
|
+
const launch = buildKimiLaunchOptions(ctx);
|
|
7389
7523
|
const args = [
|
|
7390
7524
|
"--wire",
|
|
7391
7525
|
"--yolo",
|
|
7392
7526
|
"--agent-file",
|
|
7393
7527
|
agentFilePath,
|
|
7394
7528
|
"--session",
|
|
7395
|
-
this.sessionId
|
|
7529
|
+
this.sessionId,
|
|
7530
|
+
...launch.args
|
|
7396
7531
|
];
|
|
7397
7532
|
const launchRuntimeFields = runtimeConfigToLaunchFields(ctx.config);
|
|
7398
7533
|
if (launchRuntimeFields.model && launchRuntimeFields.model !== "default") {
|
|
7399
7534
|
args.push("--model", launchRuntimeFields.model);
|
|
7400
7535
|
}
|
|
7401
7536
|
const spawnEnv = (await prepareCliTransport(ctx, { NO_COLOR: "1" })).spawnEnv;
|
|
7402
|
-
const
|
|
7403
|
-
const proc = spawn7(
|
|
7537
|
+
const spawnTarget = resolveKimiSpawn(args);
|
|
7538
|
+
const proc = spawn7(spawnTarget.command, spawnTarget.args, {
|
|
7404
7539
|
cwd: ctx.workingDirectory,
|
|
7405
7540
|
stdio: ["pipe", "pipe", "pipe"],
|
|
7406
7541
|
env: spawnEnv,
|
|
@@ -7408,7 +7543,7 @@ var KimiDriver = class {
|
|
|
7408
7543
|
// and has an 8191-character command-line limit. Kimi's official
|
|
7409
7544
|
// installer/uv entrypoint is an executable, so launch it directly and
|
|
7410
7545
|
// keep prompts on stdin / files instead of routing through cmd.exe.
|
|
7411
|
-
shell:
|
|
7546
|
+
shell: spawnTarget.shell
|
|
7412
7547
|
});
|
|
7413
7548
|
proc.stdin?.write(JSON.stringify({
|
|
7414
7549
|
jsonrpc: "2.0",
|
|
@@ -7521,14 +7656,9 @@ var KimiDriver = class {
|
|
|
7521
7656
|
return detectKimiModels();
|
|
7522
7657
|
}
|
|
7523
7658
|
};
|
|
7524
|
-
function detectKimiModels(home = os4.homedir()) {
|
|
7525
|
-
const
|
|
7526
|
-
|
|
7527
|
-
try {
|
|
7528
|
-
raw = readFileSync3(configPath, "utf8");
|
|
7529
|
-
} catch {
|
|
7530
|
-
return null;
|
|
7531
|
-
}
|
|
7659
|
+
function detectKimiModels(home = os4.homedir(), opts = {}) {
|
|
7660
|
+
const raw = readKimiConfigSource(home, opts.env).raw;
|
|
7661
|
+
if (raw === null) return null;
|
|
7532
7662
|
const models = [];
|
|
7533
7663
|
const sectionRe = /^\s*\[models(?:\.([^\]]+)|"\.[^"]+"|\."[^"]+")\s*\]\s*$/gm;
|
|
7534
7664
|
const lineRe = /^\s*\[models\.(.+?)\s*\]\s*$/gm;
|
|
@@ -8252,7 +8382,7 @@ function runOpenCodeModelsCommand(home, deps = {}) {
|
|
|
8252
8382
|
const platform = deps.platform ?? process.platform;
|
|
8253
8383
|
const spawnSyncFn = deps.spawnSyncFn ?? spawnSync2;
|
|
8254
8384
|
const result = spawnSyncFn("opencode", ["models"], {
|
|
8255
|
-
env: { ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" },
|
|
8385
|
+
env: scrubDaemonChildEnv({ ...process.env, HOME: home, FORCE_COLOR: "0", NO_COLOR: "1" }),
|
|
8256
8386
|
encoding: "utf8",
|
|
8257
8387
|
timeout: 5e3,
|
|
8258
8388
|
shell: platform === "win32"
|
|
@@ -16934,7 +17064,7 @@ var DAEMON_CORE_TRACE_ATTR_CONTRACTS = {
|
|
|
16934
17064
|
spanAttrs: ["agentId", "event_kind", "runtime"]
|
|
16935
17065
|
}
|
|
16936
17066
|
};
|
|
16937
|
-
var DAEMON_CLI_USAGE =
|
|
17067
|
+
var DAEMON_CLI_USAGE = `Usage: slock-daemon --server-url <url> (--api-key <key> or ${DAEMON_API_KEY_ENV}=<key>)`;
|
|
16938
17068
|
var RunnerCredentialMintError2 = class extends Error {
|
|
16939
17069
|
code;
|
|
16940
17070
|
retryable;
|
|
@@ -16970,9 +17100,9 @@ function runnerCredentialErrorDetail2(error) {
|
|
|
16970
17100
|
async function waitForRunnerCredentialRetry2() {
|
|
16971
17101
|
await new Promise((resolve) => setTimeout(resolve, RUNNER_CREDENTIAL_MINT_RETRY_DELAY_MS2));
|
|
16972
17102
|
}
|
|
16973
|
-
function parseDaemonCliArgs(args) {
|
|
17103
|
+
function parseDaemonCliArgs(args, env = {}) {
|
|
16974
17104
|
let serverUrl = "";
|
|
16975
|
-
let apiKey = "";
|
|
17105
|
+
let apiKey = env[DAEMON_API_KEY_ENV] ?? "";
|
|
16976
17106
|
for (let i = 0; i < args.length; i++) {
|
|
16977
17107
|
if (args[i] === "--server-url" && args[i + 1]) serverUrl = args[++i];
|
|
16978
17108
|
if (args[i] === "--api-key" && args[i + 1]) apiKey = args[++i];
|
|
@@ -17009,7 +17139,7 @@ function resolveSlockCliPathOrEmpty(moduleUrl = import.meta.url) {
|
|
|
17009
17139
|
}
|
|
17010
17140
|
async function runBundledSlockCli(argv) {
|
|
17011
17141
|
process.argv = [process.execPath, "slock", ...argv];
|
|
17012
|
-
await import("./dist-
|
|
17142
|
+
await import("./dist-LRTPHCPD.js");
|
|
17013
17143
|
}
|
|
17014
17144
|
function detectRuntimes(tracer = noopTracer) {
|
|
17015
17145
|
const ids = [];
|
|
@@ -17897,6 +18027,8 @@ var DaemonCore = class {
|
|
|
17897
18027
|
|
|
17898
18028
|
export {
|
|
17899
18029
|
subscribeDaemonLogs,
|
|
18030
|
+
DAEMON_API_KEY_ENV,
|
|
18031
|
+
scrubDaemonAuthEnv,
|
|
17900
18032
|
resolveWorkspaceDirectoryPath,
|
|
17901
18033
|
scanWorkspaceDirectories,
|
|
17902
18034
|
deleteWorkspaceDirectory,
|
package/dist/cli/index.js
CHANGED
|
@@ -15443,11 +15443,36 @@ var integrationApproveAgentLoginOperationSchema = external_exports.object({
|
|
|
15443
15443
|
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64),
|
|
15444
15444
|
draftHint: draftHintSchema
|
|
15445
15445
|
});
|
|
15446
|
+
var integrationAppDraftFieldsSchema = external_exports.object({
|
|
15447
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
15448
|
+
description: external_exports.string().trim().max(1e3).optional(),
|
|
15449
|
+
homepageUrl: external_exports.string().trim().max(2e3).optional(),
|
|
15450
|
+
returnUrl: external_exports.string().trim().max(2e3).optional(),
|
|
15451
|
+
agentManifestUrl: external_exports.string().trim().max(2e3).optional()
|
|
15452
|
+
});
|
|
15453
|
+
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
15454
|
+
type: external_exports.literal("integration:register_app"),
|
|
15455
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
15456
|
+
clientKey: external_exports.string().trim().min(1).max(120),
|
|
15457
|
+
returnUrl: external_exports.string().trim().min(1).max(2e3),
|
|
15458
|
+
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).default([]),
|
|
15459
|
+
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
15460
|
+
draftHint: draftHintSchema
|
|
15461
|
+
});
|
|
15462
|
+
var integrationUpdateAppRegistrationOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
15463
|
+
type: external_exports.literal("integration:update_app_registration"),
|
|
15464
|
+
clientKey: external_exports.string().trim().min(1).max(120),
|
|
15465
|
+
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).optional(),
|
|
15466
|
+
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
15467
|
+
draftHint: draftHintSchema
|
|
15468
|
+
});
|
|
15446
15469
|
var actionCardActionSchema = external_exports.discriminatedUnion("type", [
|
|
15447
15470
|
channelCreateOperationSchema,
|
|
15448
15471
|
agentCreateOperationSchema,
|
|
15449
15472
|
channelAddMemberOperationSchema,
|
|
15450
|
-
integrationApproveAgentLoginOperationSchema
|
|
15473
|
+
integrationApproveAgentLoginOperationSchema,
|
|
15474
|
+
integrationRegisterAppOperationSchema,
|
|
15475
|
+
integrationUpdateAppRegistrationOperationSchema
|
|
15451
15476
|
]);
|
|
15452
15477
|
function validateActionCardAction(action) {
|
|
15453
15478
|
if (action.type === "agent:create") {
|
|
@@ -15461,6 +15486,12 @@ function validateActionCardAction(action) {
|
|
|
15461
15486
|
return "channel:add_member must include at least one human or agent";
|
|
15462
15487
|
}
|
|
15463
15488
|
}
|
|
15489
|
+
if (action.type === "integration:update_app_registration") {
|
|
15490
|
+
const hasMetadataPatch = action.name !== void 0 || action.description !== void 0 || action.homepageUrl !== void 0 || action.returnUrl !== void 0 || action.agentManifestUrl !== void 0 || action.scopes !== void 0;
|
|
15491
|
+
if (!hasMetadataPatch) {
|
|
15492
|
+
return "integration:update_app_registration must include at least one field to update";
|
|
15493
|
+
}
|
|
15494
|
+
}
|
|
15464
15495
|
return null;
|
|
15465
15496
|
}
|
|
15466
15497
|
|
|
@@ -15864,8 +15895,8 @@ var PLAN_CONFIG = {
|
|
|
15864
15895
|
displayFeatures: [
|
|
15865
15896
|
"Channels",
|
|
15866
15897
|
"Tasks",
|
|
15867
|
-
"
|
|
15868
|
-
"Agent
|
|
15898
|
+
"Agents on your own computers",
|
|
15899
|
+
"Agent reminders",
|
|
15869
15900
|
"Basic observability",
|
|
15870
15901
|
"30 days of message history",
|
|
15871
15902
|
"100 MB file uploads/month"
|
|
@@ -15896,12 +15927,13 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
15896
15927
|
priceCadence: "/ seat pack / month",
|
|
15897
15928
|
extraAgentPrice: 0,
|
|
15898
15929
|
displayFeatures: [
|
|
15899
|
-
"
|
|
15930
|
+
"Everything in Free",
|
|
15900
15931
|
"Unlimited message history",
|
|
15901
15932
|
"Higher file upload limits",
|
|
15902
|
-
"Joint
|
|
15933
|
+
"Joint channels",
|
|
15903
15934
|
"More professional features coming soon"
|
|
15904
15935
|
],
|
|
15936
|
+
displayDescription: "For builders and teams scaling agent collaboration.",
|
|
15905
15937
|
displayNote: "$17.60 / seat pack / month when billed yearly"
|
|
15906
15938
|
},
|
|
15907
15939
|
enterprise: {
|
|
@@ -15913,14 +15945,18 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
15913
15945
|
priceCadence: null,
|
|
15914
15946
|
extraAgentPrice: 0,
|
|
15915
15947
|
displayFeatures: [
|
|
15916
|
-
"
|
|
15917
|
-
"
|
|
15918
|
-
"
|
|
15919
|
-
"
|
|
15920
|
-
]
|
|
15948
|
+
"Everything in Pro",
|
|
15949
|
+
"Private deployment options",
|
|
15950
|
+
"SSO and advanced access control",
|
|
15951
|
+
"Dedicated onboarding and rollout support"
|
|
15952
|
+
],
|
|
15953
|
+
displayDescription: "For advanced deployment and governance needs."
|
|
15921
15954
|
}
|
|
15922
15955
|
};
|
|
15923
15956
|
var FREE_MONTHLY_FILE_UPLOAD_LIMIT_BYTES = 100 * 1024 * 1024;
|
|
15957
|
+
var TRIAL_START_DATE = /* @__PURE__ */ new Date("2026-04-18T00:00:00Z");
|
|
15958
|
+
var TRIAL_END_DATE = /* @__PURE__ */ new Date("2026-06-23T12:00:00Z");
|
|
15959
|
+
var TRIAL_DURATION_DAYS = (TRIAL_END_DATE.getTime() - TRIAL_START_DATE.getTime()) / (24 * 60 * 60 * 1e3);
|
|
15924
15960
|
|
|
15925
15961
|
// src/agentCommsCore/bridge.ts
|
|
15926
15962
|
var AGENT_COMMS_PROTOCOL_VERSION = "agent-comms-core.v1";
|
|
@@ -17232,7 +17268,7 @@ var actionPrepareCommand = defineCommand(
|
|
|
17232
17268
|
options: [
|
|
17233
17269
|
{
|
|
17234
17270
|
flags: "--target <target>",
|
|
17235
|
-
description: "Channel/DM/thread target to post the card. Same format as raft message send: '#channel', 'dm:@peer', '#channel:shortid'"
|
|
17271
|
+
description: "Channel/DM/thread target to post the card. Same format as raft message send: '#channel', 'dm:@peer', '#channel:shortid', 'dm:@peer:shortid'"
|
|
17236
17272
|
}
|
|
17237
17273
|
]
|
|
17238
17274
|
},
|
|
@@ -19098,8 +19134,10 @@ var attachmentUploadCommand = defineCommand(
|
|
|
19098
19134
|
form
|
|
19099
19135
|
);
|
|
19100
19136
|
if (!res.ok) {
|
|
19101
|
-
const code = res.status >= 500 ? "SERVER_5XX" : "UPLOAD_FAILED";
|
|
19102
|
-
throw cliError(code, res.error ?? `HTTP ${res.status}
|
|
19137
|
+
const code = res.errorCode ?? (res.status >= 500 ? "SERVER_5XX" : "UPLOAD_FAILED");
|
|
19138
|
+
throw cliError(code, res.error ?? `HTTP ${res.status}`, {
|
|
19139
|
+
suggestedNextAction: res.suggestedNextAction ?? void 0
|
|
19140
|
+
});
|
|
19103
19141
|
}
|
|
19104
19142
|
const d = res.data;
|
|
19105
19143
|
writeText(ctx.io, `File uploaded: ${d.filename} (${(d.sizeBytes / 1024).toFixed(1)}KB)
|
|
@@ -20520,6 +20558,131 @@ function registerIntegrationEnvCommand(parent, runtimeOptions = {}) {
|
|
|
20520
20558
|
registerCliCommand(parent, integrationEnvCommand, runtimeOptions);
|
|
20521
20559
|
}
|
|
20522
20560
|
|
|
20561
|
+
// src/commands/integration/app.ts
|
|
20562
|
+
function normalizeScopes2(raw) {
|
|
20563
|
+
if (!raw || raw.length === 0) return void 0;
|
|
20564
|
+
const scopes = Array.from(new Set(
|
|
20565
|
+
raw.flatMap((value) => value.split(",")).map((value) => value.trim()).filter(Boolean)
|
|
20566
|
+
)).sort();
|
|
20567
|
+
if (scopes.length === 0) {
|
|
20568
|
+
throw cliError("INVALID_ARG", "--scope must include at least one non-empty scope");
|
|
20569
|
+
}
|
|
20570
|
+
return scopes;
|
|
20571
|
+
}
|
|
20572
|
+
function requiredTrimmed(value, flag) {
|
|
20573
|
+
const trimmed = value?.trim() ?? "";
|
|
20574
|
+
if (!trimmed) throw cliError("INVALID_ARG", `${flag} is required`);
|
|
20575
|
+
return trimmed;
|
|
20576
|
+
}
|
|
20577
|
+
function optionalTrimmed(value) {
|
|
20578
|
+
return value?.trim() || void 0;
|
|
20579
|
+
}
|
|
20580
|
+
function formatAppPrepare(data) {
|
|
20581
|
+
const lines = [
|
|
20582
|
+
`Integration app ${data.mode} card prepared`,
|
|
20583
|
+
`client key: ${data.action.clientKey}`,
|
|
20584
|
+
`card: ${data.actionCardMessageId}`,
|
|
20585
|
+
`target: ${data.target}`
|
|
20586
|
+
];
|
|
20587
|
+
if (data.action.name) lines.push(`name: ${data.action.name}`);
|
|
20588
|
+
if (data.action.homepageUrl) lines.push(`app URL: ${data.action.homepageUrl}`);
|
|
20589
|
+
if (data.action.returnUrl) lines.push(`redirect URL: ${data.action.returnUrl}`);
|
|
20590
|
+
if (data.action.agentManifestUrl) lines.push(`agent manifest: ${data.action.agentManifestUrl}`);
|
|
20591
|
+
if (data.action.scopes) lines.push(`scopes: ${data.action.scopes.length > 0 ? data.action.scopes.join(", ") : "-"}`);
|
|
20592
|
+
if (data.action.unsafeDemoUrlOverride) lines.push("unsafe demo URL override: requested");
|
|
20593
|
+
lines.push("next: ask a server owner/admin to review and execute the action card");
|
|
20594
|
+
lines.push("secret: not stored in the card; after owner/admin execution, the requester agent receives a private one-time handoff");
|
|
20595
|
+
return lines.join("\n");
|
|
20596
|
+
}
|
|
20597
|
+
async function prepareApp(mode, ctx, opts) {
|
|
20598
|
+
const target = requiredTrimmed(opts.target, "--target");
|
|
20599
|
+
const clientKey = requiredTrimmed(opts.clientKey, "--client-key");
|
|
20600
|
+
const scopes = normalizeScopes2([...opts.scope ?? [], ...opts.scopes ?? []]);
|
|
20601
|
+
const agentContext = ctx.loadAgentContext();
|
|
20602
|
+
const client = ctx.createApiClient(agentContext);
|
|
20603
|
+
const body = {
|
|
20604
|
+
mode,
|
|
20605
|
+
target,
|
|
20606
|
+
clientKey,
|
|
20607
|
+
name: optionalTrimmed(opts.name),
|
|
20608
|
+
description: optionalTrimmed(opts.description),
|
|
20609
|
+
homepageUrl: optionalTrimmed(opts.homepageUrl) ?? optionalTrimmed(opts.appUrl),
|
|
20610
|
+
returnUrl: optionalTrimmed(opts.redirectUrl),
|
|
20611
|
+
agentManifestUrl: optionalTrimmed(opts.agentManifestUrl),
|
|
20612
|
+
scopes,
|
|
20613
|
+
unsafeDemoUrlOverride: opts.unsafeDemoUrlOverride === true
|
|
20614
|
+
};
|
|
20615
|
+
if (mode === "register") {
|
|
20616
|
+
requiredTrimmed(body.name, "--name");
|
|
20617
|
+
requiredTrimmed(body.returnUrl, "--redirect-url");
|
|
20618
|
+
}
|
|
20619
|
+
const res = await client.request(
|
|
20620
|
+
"POST",
|
|
20621
|
+
`/internal/agent/${encodeURIComponent(agentContext.agentId)}/integrations/app/prepare`,
|
|
20622
|
+
body
|
|
20623
|
+
);
|
|
20624
|
+
if (!res.ok || !res.data) {
|
|
20625
|
+
const code = res.status >= 500 ? "SERVER_5XX" : "INTEGRATION_APP_PREPARE_FAILED";
|
|
20626
|
+
throw cliError(code, res.error ?? `HTTP ${res.status}`);
|
|
20627
|
+
}
|
|
20628
|
+
if (opts.json) {
|
|
20629
|
+
writeJson(ctx.io, { ok: true, data: res.data });
|
|
20630
|
+
return;
|
|
20631
|
+
}
|
|
20632
|
+
writeText(ctx.io, `${formatAppPrepare(res.data)}
|
|
20633
|
+
`);
|
|
20634
|
+
}
|
|
20635
|
+
var sharedOptions = [
|
|
20636
|
+
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update" },
|
|
20637
|
+
{ flags: "--name <name>", description: "App display name" },
|
|
20638
|
+
{ flags: "--redirect-url <url>", description: "OAuth redirect/callback URL" },
|
|
20639
|
+
{ flags: "--app-url <url>", description: "App homepage URL" },
|
|
20640
|
+
{ flags: "--homepage-url <url>", description: "App homepage URL (alias-friendly explicit name)" },
|
|
20641
|
+
{ flags: "--description <text>", description: "App description" },
|
|
20642
|
+
{ flags: "--agent-manifest-url <url>", description: "Optional agent behavior manifest URL" },
|
|
20643
|
+
{
|
|
20644
|
+
flags: "--scope <scope>",
|
|
20645
|
+
description: "Requested/displayed scope; can be repeated or comma-separated",
|
|
20646
|
+
parse: (value, previous = []) => {
|
|
20647
|
+
previous.push(value);
|
|
20648
|
+
return previous;
|
|
20649
|
+
}
|
|
20650
|
+
},
|
|
20651
|
+
{
|
|
20652
|
+
flags: "--scopes <scopes>",
|
|
20653
|
+
description: "Requested/displayed scopes; alias for --scope, comma-separated",
|
|
20654
|
+
parse: (value, previous = []) => {
|
|
20655
|
+
previous.push(value);
|
|
20656
|
+
return previous;
|
|
20657
|
+
}
|
|
20658
|
+
},
|
|
20659
|
+
{ flags: "--unsafe-demo-url-override", description: "Explicitly mark localhost/private URL use as an unsafe demo override" },
|
|
20660
|
+
{ flags: "--target <target>", description: "Channel/DM/thread target to post the human action card" },
|
|
20661
|
+
{ flags: "--json", description: "Emit machine-readable JSON" }
|
|
20662
|
+
];
|
|
20663
|
+
var integrationAppPrepareRegisterCommand = defineCommand(
|
|
20664
|
+
{
|
|
20665
|
+
name: "register",
|
|
20666
|
+
description: "Prepare a third-party app registration action card for a human owner/admin to commit",
|
|
20667
|
+
options: sharedOptions
|
|
20668
|
+
},
|
|
20669
|
+
async (ctx, opts) => prepareApp("register", ctx, opts)
|
|
20670
|
+
);
|
|
20671
|
+
var integrationAppPrepareUpdateCommand = defineCommand(
|
|
20672
|
+
{
|
|
20673
|
+
name: "update",
|
|
20674
|
+
description: "Prepare a third-party app registration update action card for a human owner/admin to commit",
|
|
20675
|
+
options: sharedOptions
|
|
20676
|
+
},
|
|
20677
|
+
async (ctx, opts) => prepareApp("update", ctx, opts)
|
|
20678
|
+
);
|
|
20679
|
+
function registerIntegrationAppCommands(parent, runtimeOptions = {}) {
|
|
20680
|
+
const appCmd = parent.command("app").description("Third-party app registration preparation");
|
|
20681
|
+
const prepareCmd = appCmd.command("prepare").description("Prepare app registration/update action cards");
|
|
20682
|
+
registerCliCommand(prepareCmd, integrationAppPrepareRegisterCommand, runtimeOptions);
|
|
20683
|
+
registerCliCommand(prepareCmd, integrationAppPrepareUpdateCommand, runtimeOptions);
|
|
20684
|
+
}
|
|
20685
|
+
|
|
20523
20686
|
// src/commands/reminder/_format.ts
|
|
20524
20687
|
var MODIFY_HINT = "(to modify: snooze/update/cancel; raft reminder --help)";
|
|
20525
20688
|
function formatReminder(r) {
|
|
@@ -20976,6 +21139,7 @@ var integrationCmd = program.command("integration").description("Third-party ser
|
|
|
20976
21139
|
registerIntegrationListCommand(integrationCmd);
|
|
20977
21140
|
registerIntegrationLoginCommand(integrationCmd);
|
|
20978
21141
|
registerIntegrationEnvCommand(integrationCmd);
|
|
21142
|
+
registerIntegrationAppCommands(integrationCmd);
|
|
20979
21143
|
var reminderCmd = program.command("reminder").description("Reminder operations");
|
|
20980
21144
|
registerReminderScheduleCommand(reminderCmd);
|
|
20981
21145
|
registerReminderListCommand(reminderCmd);
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
DAEMON_API_KEY_ENV,
|
|
2
3
|
DAEMON_CLI_USAGE,
|
|
3
4
|
DaemonCore,
|
|
4
5
|
deleteWorkspaceDirectory,
|
|
@@ -10,9 +11,11 @@ import {
|
|
|
10
11
|
resolveWorkspaceDirectoryPath,
|
|
11
12
|
runBundledSlockCli,
|
|
12
13
|
scanWorkspaceDirectories,
|
|
14
|
+
scrubDaemonAuthEnv,
|
|
13
15
|
subscribeDaemonLogs
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZGGFS72W.js";
|
|
15
17
|
export {
|
|
18
|
+
DAEMON_API_KEY_ENV,
|
|
16
19
|
DAEMON_CLI_USAGE,
|
|
17
20
|
DaemonCore,
|
|
18
21
|
deleteWorkspaceDirectory,
|
|
@@ -24,5 +27,6 @@ export {
|
|
|
24
27
|
resolveWorkspaceDirectoryPath,
|
|
25
28
|
runBundledSlockCli,
|
|
26
29
|
scanWorkspaceDirectories,
|
|
30
|
+
scrubDaemonAuthEnv,
|
|
27
31
|
subscribeDaemonLogs
|
|
28
32
|
};
|
|
@@ -15259,11 +15259,36 @@ var integrationApproveAgentLoginOperationSchema = external_exports.object({
|
|
|
15259
15259
|
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64),
|
|
15260
15260
|
draftHint: draftHintSchema
|
|
15261
15261
|
});
|
|
15262
|
+
var integrationAppDraftFieldsSchema = external_exports.object({
|
|
15263
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
15264
|
+
description: external_exports.string().trim().max(1e3).optional(),
|
|
15265
|
+
homepageUrl: external_exports.string().trim().max(2e3).optional(),
|
|
15266
|
+
returnUrl: external_exports.string().trim().max(2e3).optional(),
|
|
15267
|
+
agentManifestUrl: external_exports.string().trim().max(2e3).optional()
|
|
15268
|
+
});
|
|
15269
|
+
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
15270
|
+
type: external_exports.literal("integration:register_app"),
|
|
15271
|
+
name: external_exports.string().trim().min(1).max(120),
|
|
15272
|
+
clientKey: external_exports.string().trim().min(1).max(120),
|
|
15273
|
+
returnUrl: external_exports.string().trim().min(1).max(2e3),
|
|
15274
|
+
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).default([]),
|
|
15275
|
+
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
15276
|
+
draftHint: draftHintSchema
|
|
15277
|
+
});
|
|
15278
|
+
var integrationUpdateAppRegistrationOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
15279
|
+
type: external_exports.literal("integration:update_app_registration"),
|
|
15280
|
+
clientKey: external_exports.string().trim().min(1).max(120),
|
|
15281
|
+
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).optional(),
|
|
15282
|
+
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
15283
|
+
draftHint: draftHintSchema
|
|
15284
|
+
});
|
|
15262
15285
|
var actionCardActionSchema = external_exports.discriminatedUnion("type", [
|
|
15263
15286
|
channelCreateOperationSchema,
|
|
15264
15287
|
agentCreateOperationSchema,
|
|
15265
15288
|
channelAddMemberOperationSchema,
|
|
15266
|
-
integrationApproveAgentLoginOperationSchema
|
|
15289
|
+
integrationApproveAgentLoginOperationSchema,
|
|
15290
|
+
integrationRegisterAppOperationSchema,
|
|
15291
|
+
integrationUpdateAppRegistrationOperationSchema
|
|
15267
15292
|
]);
|
|
15268
15293
|
function validateActionCardAction(action) {
|
|
15269
15294
|
if (action.type === "agent:create") {
|
|
@@ -15277,6 +15302,12 @@ function validateActionCardAction(action) {
|
|
|
15277
15302
|
return "channel:add_member must include at least one human or agent";
|
|
15278
15303
|
}
|
|
15279
15304
|
}
|
|
15305
|
+
if (action.type === "integration:update_app_registration") {
|
|
15306
|
+
const hasMetadataPatch = action.name !== void 0 || action.description !== void 0 || action.homepageUrl !== void 0 || action.returnUrl !== void 0 || action.agentManifestUrl !== void 0 || action.scopes !== void 0;
|
|
15307
|
+
if (!hasMetadataPatch) {
|
|
15308
|
+
return "integration:update_app_registration must include at least one field to update";
|
|
15309
|
+
}
|
|
15310
|
+
}
|
|
15280
15311
|
return null;
|
|
15281
15312
|
}
|
|
15282
15313
|
function formatAgentInboxSnapshot(rows) {
|
|
@@ -15668,8 +15699,8 @@ var PLAN_CONFIG = {
|
|
|
15668
15699
|
displayFeatures: [
|
|
15669
15700
|
"Channels",
|
|
15670
15701
|
"Tasks",
|
|
15671
|
-
"
|
|
15672
|
-
"Agent
|
|
15702
|
+
"Agents on your own computers",
|
|
15703
|
+
"Agent reminders",
|
|
15673
15704
|
"Basic observability",
|
|
15674
15705
|
"30 days of message history",
|
|
15675
15706
|
"100 MB file uploads/month"
|
|
@@ -15700,12 +15731,13 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
15700
15731
|
priceCadence: "/ seat pack / month",
|
|
15701
15732
|
extraAgentPrice: 0,
|
|
15702
15733
|
displayFeatures: [
|
|
15703
|
-
"
|
|
15734
|
+
"Everything in Free",
|
|
15704
15735
|
"Unlimited message history",
|
|
15705
15736
|
"Higher file upload limits",
|
|
15706
|
-
"Joint
|
|
15737
|
+
"Joint channels",
|
|
15707
15738
|
"More professional features coming soon"
|
|
15708
15739
|
],
|
|
15740
|
+
displayDescription: "For builders and teams scaling agent collaboration.",
|
|
15709
15741
|
displayNote: "$17.60 / seat pack / month when billed yearly"
|
|
15710
15742
|
},
|
|
15711
15743
|
enterprise: {
|
|
@@ -15717,14 +15749,18 @@ var DISPLAY_PLAN_CONFIG = {
|
|
|
15717
15749
|
priceCadence: null,
|
|
15718
15750
|
extraAgentPrice: 0,
|
|
15719
15751
|
displayFeatures: [
|
|
15720
|
-
"
|
|
15721
|
-
"
|
|
15722
|
-
"
|
|
15723
|
-
"
|
|
15724
|
-
]
|
|
15752
|
+
"Everything in Pro",
|
|
15753
|
+
"Private deployment options",
|
|
15754
|
+
"SSO and advanced access control",
|
|
15755
|
+
"Dedicated onboarding and rollout support"
|
|
15756
|
+
],
|
|
15757
|
+
displayDescription: "For advanced deployment and governance needs."
|
|
15725
15758
|
}
|
|
15726
15759
|
};
|
|
15727
15760
|
var FREE_MONTHLY_FILE_UPLOAD_LIMIT_BYTES = 100 * 1024 * 1024;
|
|
15761
|
+
var TRIAL_START_DATE = /* @__PURE__ */ new Date("2026-04-18T00:00:00Z");
|
|
15762
|
+
var TRIAL_END_DATE = /* @__PURE__ */ new Date("2026-06-23T12:00:00Z");
|
|
15763
|
+
var TRIAL_DURATION_DAYS = (TRIAL_END_DATE.getTime() - TRIAL_START_DATE.getTime()) / (24 * 60 * 60 * 1e3);
|
|
15728
15764
|
var AGENT_COMMS_PROTOCOL_VERSION = "agent-comms-core.v1";
|
|
15729
15765
|
var AGENT_PROOF_SCHEMA_VERSION = "agent-proof.v1";
|
|
15730
15766
|
var AgentCommsBridgeLockError = class extends Error {
|
|
@@ -17028,7 +17064,7 @@ var actionPrepareCommand = defineCommand(
|
|
|
17028
17064
|
options: [
|
|
17029
17065
|
{
|
|
17030
17066
|
flags: "--target <target>",
|
|
17031
|
-
description: "Channel/DM/thread target to post the card. Same format as raft message send: '#channel', 'dm:@peer', '#channel:shortid'"
|
|
17067
|
+
description: "Channel/DM/thread target to post the card. Same format as raft message send: '#channel', 'dm:@peer', '#channel:shortid', 'dm:@peer:shortid'"
|
|
17032
17068
|
}
|
|
17033
17069
|
]
|
|
17034
17070
|
},
|
|
@@ -18844,8 +18880,10 @@ var attachmentUploadCommand = defineCommand(
|
|
|
18844
18880
|
form
|
|
18845
18881
|
);
|
|
18846
18882
|
if (!res.ok) {
|
|
18847
|
-
const code = res.status >= 500 ? "SERVER_5XX" : "UPLOAD_FAILED";
|
|
18848
|
-
throw cliError(code, res.error ?? `HTTP ${res.status}
|
|
18883
|
+
const code = res.errorCode ?? (res.status >= 500 ? "SERVER_5XX" : "UPLOAD_FAILED");
|
|
18884
|
+
throw cliError(code, res.error ?? `HTTP ${res.status}`, {
|
|
18885
|
+
suggestedNextAction: res.suggestedNextAction ?? void 0
|
|
18886
|
+
});
|
|
18849
18887
|
}
|
|
18850
18888
|
const d = res.data;
|
|
18851
18889
|
writeText(ctx.io, `File uploaded: ${d.filename} (${(d.sizeBytes / 1024).toFixed(1)}KB)
|
|
@@ -20221,6 +20259,129 @@ var integrationEnvCommand = defineCommand(
|
|
|
20221
20259
|
function registerIntegrationEnvCommand(parent, runtimeOptions = {}) {
|
|
20222
20260
|
registerCliCommand(parent, integrationEnvCommand, runtimeOptions);
|
|
20223
20261
|
}
|
|
20262
|
+
function normalizeScopes2(raw) {
|
|
20263
|
+
if (!raw || raw.length === 0) return void 0;
|
|
20264
|
+
const scopes = Array.from(new Set(
|
|
20265
|
+
raw.flatMap((value) => value.split(",")).map((value) => value.trim()).filter(Boolean)
|
|
20266
|
+
)).sort();
|
|
20267
|
+
if (scopes.length === 0) {
|
|
20268
|
+
throw cliError("INVALID_ARG", "--scope must include at least one non-empty scope");
|
|
20269
|
+
}
|
|
20270
|
+
return scopes;
|
|
20271
|
+
}
|
|
20272
|
+
function requiredTrimmed(value, flag) {
|
|
20273
|
+
const trimmed = value?.trim() ?? "";
|
|
20274
|
+
if (!trimmed) throw cliError("INVALID_ARG", `${flag} is required`);
|
|
20275
|
+
return trimmed;
|
|
20276
|
+
}
|
|
20277
|
+
function optionalTrimmed(value) {
|
|
20278
|
+
return value?.trim() || void 0;
|
|
20279
|
+
}
|
|
20280
|
+
function formatAppPrepare(data) {
|
|
20281
|
+
const lines = [
|
|
20282
|
+
`Integration app ${data.mode} card prepared`,
|
|
20283
|
+
`client key: ${data.action.clientKey}`,
|
|
20284
|
+
`card: ${data.actionCardMessageId}`,
|
|
20285
|
+
`target: ${data.target}`
|
|
20286
|
+
];
|
|
20287
|
+
if (data.action.name) lines.push(`name: ${data.action.name}`);
|
|
20288
|
+
if (data.action.homepageUrl) lines.push(`app URL: ${data.action.homepageUrl}`);
|
|
20289
|
+
if (data.action.returnUrl) lines.push(`redirect URL: ${data.action.returnUrl}`);
|
|
20290
|
+
if (data.action.agentManifestUrl) lines.push(`agent manifest: ${data.action.agentManifestUrl}`);
|
|
20291
|
+
if (data.action.scopes) lines.push(`scopes: ${data.action.scopes.length > 0 ? data.action.scopes.join(", ") : "-"}`);
|
|
20292
|
+
if (data.action.unsafeDemoUrlOverride) lines.push("unsafe demo URL override: requested");
|
|
20293
|
+
lines.push("next: ask a server owner/admin to review and execute the action card");
|
|
20294
|
+
lines.push("secret: not stored in the card; after owner/admin execution, the requester agent receives a private one-time handoff");
|
|
20295
|
+
return lines.join("\n");
|
|
20296
|
+
}
|
|
20297
|
+
async function prepareApp(mode, ctx, opts) {
|
|
20298
|
+
const target = requiredTrimmed(opts.target, "--target");
|
|
20299
|
+
const clientKey = requiredTrimmed(opts.clientKey, "--client-key");
|
|
20300
|
+
const scopes = normalizeScopes2([...opts.scope ?? [], ...opts.scopes ?? []]);
|
|
20301
|
+
const agentContext = ctx.loadAgentContext();
|
|
20302
|
+
const client = ctx.createApiClient(agentContext);
|
|
20303
|
+
const body = {
|
|
20304
|
+
mode,
|
|
20305
|
+
target,
|
|
20306
|
+
clientKey,
|
|
20307
|
+
name: optionalTrimmed(opts.name),
|
|
20308
|
+
description: optionalTrimmed(opts.description),
|
|
20309
|
+
homepageUrl: optionalTrimmed(opts.homepageUrl) ?? optionalTrimmed(opts.appUrl),
|
|
20310
|
+
returnUrl: optionalTrimmed(opts.redirectUrl),
|
|
20311
|
+
agentManifestUrl: optionalTrimmed(opts.agentManifestUrl),
|
|
20312
|
+
scopes,
|
|
20313
|
+
unsafeDemoUrlOverride: opts.unsafeDemoUrlOverride === true
|
|
20314
|
+
};
|
|
20315
|
+
if (mode === "register") {
|
|
20316
|
+
requiredTrimmed(body.name, "--name");
|
|
20317
|
+
requiredTrimmed(body.returnUrl, "--redirect-url");
|
|
20318
|
+
}
|
|
20319
|
+
const res = await client.request(
|
|
20320
|
+
"POST",
|
|
20321
|
+
`/internal/agent/${encodeURIComponent(agentContext.agentId)}/integrations/app/prepare`,
|
|
20322
|
+
body
|
|
20323
|
+
);
|
|
20324
|
+
if (!res.ok || !res.data) {
|
|
20325
|
+
const code = res.status >= 500 ? "SERVER_5XX" : "INTEGRATION_APP_PREPARE_FAILED";
|
|
20326
|
+
throw cliError(code, res.error ?? `HTTP ${res.status}`);
|
|
20327
|
+
}
|
|
20328
|
+
if (opts.json) {
|
|
20329
|
+
writeJson(ctx.io, { ok: true, data: res.data });
|
|
20330
|
+
return;
|
|
20331
|
+
}
|
|
20332
|
+
writeText(ctx.io, `${formatAppPrepare(res.data)}
|
|
20333
|
+
`);
|
|
20334
|
+
}
|
|
20335
|
+
var sharedOptions = [
|
|
20336
|
+
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update" },
|
|
20337
|
+
{ flags: "--name <name>", description: "App display name" },
|
|
20338
|
+
{ flags: "--redirect-url <url>", description: "OAuth redirect/callback URL" },
|
|
20339
|
+
{ flags: "--app-url <url>", description: "App homepage URL" },
|
|
20340
|
+
{ flags: "--homepage-url <url>", description: "App homepage URL (alias-friendly explicit name)" },
|
|
20341
|
+
{ flags: "--description <text>", description: "App description" },
|
|
20342
|
+
{ flags: "--agent-manifest-url <url>", description: "Optional agent behavior manifest URL" },
|
|
20343
|
+
{
|
|
20344
|
+
flags: "--scope <scope>",
|
|
20345
|
+
description: "Requested/displayed scope; can be repeated or comma-separated",
|
|
20346
|
+
parse: (value, previous = []) => {
|
|
20347
|
+
previous.push(value);
|
|
20348
|
+
return previous;
|
|
20349
|
+
}
|
|
20350
|
+
},
|
|
20351
|
+
{
|
|
20352
|
+
flags: "--scopes <scopes>",
|
|
20353
|
+
description: "Requested/displayed scopes; alias for --scope, comma-separated",
|
|
20354
|
+
parse: (value, previous = []) => {
|
|
20355
|
+
previous.push(value);
|
|
20356
|
+
return previous;
|
|
20357
|
+
}
|
|
20358
|
+
},
|
|
20359
|
+
{ flags: "--unsafe-demo-url-override", description: "Explicitly mark localhost/private URL use as an unsafe demo override" },
|
|
20360
|
+
{ flags: "--target <target>", description: "Channel/DM/thread target to post the human action card" },
|
|
20361
|
+
{ flags: "--json", description: "Emit machine-readable JSON" }
|
|
20362
|
+
];
|
|
20363
|
+
var integrationAppPrepareRegisterCommand = defineCommand(
|
|
20364
|
+
{
|
|
20365
|
+
name: "register",
|
|
20366
|
+
description: "Prepare a third-party app registration action card for a human owner/admin to commit",
|
|
20367
|
+
options: sharedOptions
|
|
20368
|
+
},
|
|
20369
|
+
async (ctx, opts) => prepareApp("register", ctx, opts)
|
|
20370
|
+
);
|
|
20371
|
+
var integrationAppPrepareUpdateCommand = defineCommand(
|
|
20372
|
+
{
|
|
20373
|
+
name: "update",
|
|
20374
|
+
description: "Prepare a third-party app registration update action card for a human owner/admin to commit",
|
|
20375
|
+
options: sharedOptions
|
|
20376
|
+
},
|
|
20377
|
+
async (ctx, opts) => prepareApp("update", ctx, opts)
|
|
20378
|
+
);
|
|
20379
|
+
function registerIntegrationAppCommands(parent, runtimeOptions = {}) {
|
|
20380
|
+
const appCmd = parent.command("app").description("Third-party app registration preparation");
|
|
20381
|
+
const prepareCmd = appCmd.command("prepare").description("Prepare app registration/update action cards");
|
|
20382
|
+
registerCliCommand(prepareCmd, integrationAppPrepareRegisterCommand, runtimeOptions);
|
|
20383
|
+
registerCliCommand(prepareCmd, integrationAppPrepareUpdateCommand, runtimeOptions);
|
|
20384
|
+
}
|
|
20224
20385
|
var MODIFY_HINT = "(to modify: snooze/update/cancel; raft reminder --help)";
|
|
20225
20386
|
function formatReminder(r) {
|
|
20226
20387
|
const ref = r.msgRef ? ` ref=${r.msgRef}` : "";
|
|
@@ -20658,6 +20819,7 @@ var integrationCmd = program.command("integration").description("Third-party ser
|
|
|
20658
20819
|
registerIntegrationListCommand(integrationCmd);
|
|
20659
20820
|
registerIntegrationLoginCommand(integrationCmd);
|
|
20660
20821
|
registerIntegrationEnvCommand(integrationCmd);
|
|
20822
|
+
registerIntegrationAppCommands(integrationCmd);
|
|
20661
20823
|
var reminderCmd = program.command("reminder").description("Reminder operations");
|
|
20662
20824
|
registerReminderScheduleCommand(reminderCmd);
|
|
20663
20825
|
registerReminderListCommand(reminderCmd);
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
DAEMON_CLI_USAGE,
|
|
4
4
|
DaemonCore,
|
|
5
|
-
parseDaemonCliArgs
|
|
6
|
-
|
|
5
|
+
parseDaemonCliArgs,
|
|
6
|
+
scrubDaemonAuthEnv
|
|
7
|
+
} from "./chunk-ZGGFS72W.js";
|
|
7
8
|
|
|
8
9
|
// src/index.ts
|
|
9
|
-
var parsedArgs = parseDaemonCliArgs(process.argv.slice(2));
|
|
10
|
+
var parsedArgs = parseDaemonCliArgs(process.argv.slice(2), process.env);
|
|
11
|
+
scrubDaemonAuthEnv(process.env);
|
|
10
12
|
if (!parsedArgs) {
|
|
11
13
|
console.error(DAEMON_CLI_USAGE);
|
|
12
14
|
process.exit(1);
|