@usecontextlayer/ctxs 0.5.29 → 0.6.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.mjs +71 -42
- package/dist/cli.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c93ba44e-cf84-5e20-b897-0d3cb6781373")}catch(e){}}();
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import * as Sentry from "@sentry/node";
|
|
6
6
|
import * as fs$2 from "node:fs/promises";
|
|
@@ -4913,7 +4913,7 @@ function normalizedKey(event) {
|
|
|
4913
4913
|
|
|
4914
4914
|
//#endregion
|
|
4915
4915
|
//#region package.json
|
|
4916
|
-
var version$1 = "0.
|
|
4916
|
+
var version$1 = "0.6.0";
|
|
4917
4917
|
|
|
4918
4918
|
//#endregion
|
|
4919
4919
|
//#region sentry.ts
|
|
@@ -60142,7 +60142,7 @@ function createScheduleApiClient(config) {
|
|
|
60142
60142
|
})
|
|
60143
60143
|
};
|
|
60144
60144
|
}
|
|
60145
|
-
const SERVER_VERSION = "0.
|
|
60145
|
+
const SERVER_VERSION = "0.6.0";
|
|
60146
60146
|
/** The most operations one OperationSet will carry. The service's own ceiling. */
|
|
60147
60147
|
const MAX_OPERATIONS = 200;
|
|
60148
60148
|
/**
|
|
@@ -97816,7 +97816,7 @@ function isJsonPath(relPath) {
|
|
|
97816
97816
|
}
|
|
97817
97817
|
|
|
97818
97818
|
//#endregion
|
|
97819
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
97819
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/query.js
|
|
97820
97820
|
const originCache = /* @__PURE__ */ new Map();
|
|
97821
97821
|
const originStackCache = /* @__PURE__ */ new Map();
|
|
97822
97822
|
const originError = Symbol("OriginError");
|
|
@@ -97952,7 +97952,7 @@ function cachedError(xs) {
|
|
|
97952
97952
|
}
|
|
97953
97953
|
|
|
97954
97954
|
//#endregion
|
|
97955
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
97955
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/errors.js
|
|
97956
97956
|
var PostgresError = class extends Error {
|
|
97957
97957
|
constructor(x) {
|
|
97958
97958
|
super(x.message);
|
|
@@ -97997,7 +97997,7 @@ function notSupported(x) {
|
|
|
97997
97997
|
}
|
|
97998
97998
|
|
|
97999
97999
|
//#endregion
|
|
98000
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
98000
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/types.js
|
|
98001
98001
|
const types = {
|
|
98002
98002
|
string: {
|
|
98003
98003
|
to: 25,
|
|
@@ -98277,7 +98277,7 @@ const kebab = { ...toKebab };
|
|
|
98277
98277
|
kebab.column.to = fromKebab;
|
|
98278
98278
|
|
|
98279
98279
|
//#endregion
|
|
98280
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
98280
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/result.js
|
|
98281
98281
|
var Result = class extends Array {
|
|
98282
98282
|
constructor() {
|
|
98283
98283
|
super();
|
|
@@ -98310,7 +98310,7 @@ var Result = class extends Array {
|
|
|
98310
98310
|
};
|
|
98311
98311
|
|
|
98312
98312
|
//#endregion
|
|
98313
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
98313
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/queue.js
|
|
98314
98314
|
var queue_default = Queue;
|
|
98315
98315
|
function Queue(initial = []) {
|
|
98316
98316
|
let xs = initial.slice();
|
|
@@ -98336,7 +98336,7 @@ function Queue(initial = []) {
|
|
|
98336
98336
|
}
|
|
98337
98337
|
|
|
98338
98338
|
//#endregion
|
|
98339
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
98339
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/bytes.js
|
|
98340
98340
|
const size = 256;
|
|
98341
98341
|
let buffer = Buffer.allocUnsafe(size);
|
|
98342
98342
|
const messages = "BCcDdEFfHPpQSX".split("").reduce((acc, x) => {
|
|
@@ -98409,7 +98409,7 @@ function reset() {
|
|
|
98409
98409
|
}
|
|
98410
98410
|
|
|
98411
98411
|
//#endregion
|
|
98412
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
98412
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/connection.js
|
|
98413
98413
|
var connection_default = Connection;
|
|
98414
98414
|
let uid = 1;
|
|
98415
98415
|
const Sync = b$1().S().end();
|
|
@@ -98546,6 +98546,12 @@ function Connection(options, queues = {}, { onopen = noop$1, onend = noop$1, onc
|
|
|
98546
98546
|
return true;
|
|
98547
98547
|
}
|
|
98548
98548
|
function nextWrite(fn) {
|
|
98549
|
+
if (socket === null) {
|
|
98550
|
+
nextWriteTimer !== null && clearImmediate(nextWriteTimer);
|
|
98551
|
+
chunk = nextWriteTimer = null;
|
|
98552
|
+
fn && fn(Errors.connection("CONNECTION_CLOSED", options, socket));
|
|
98553
|
+
return false;
|
|
98554
|
+
}
|
|
98549
98555
|
const x = socket.write(chunk, fn);
|
|
98550
98556
|
nextWriteTimer !== null && clearImmediate(nextWriteTimer);
|
|
98551
98557
|
chunk = nextWriteTimer = null;
|
|
@@ -98642,6 +98648,7 @@ function Connection(options, queues = {}, { onopen = noop$1, onend = noop$1, onc
|
|
|
98642
98648
|
}
|
|
98643
98649
|
function errored(err) {
|
|
98644
98650
|
stream && (stream.destroy(err), stream = null);
|
|
98651
|
+
final && (final(err), final = null);
|
|
98645
98652
|
query && queryError(query, err);
|
|
98646
98653
|
initial && (queryError(initial, err), initial = null);
|
|
98647
98654
|
}
|
|
@@ -98901,6 +98908,8 @@ function Connection(options, queues = {}, { onopen = noop$1, onend = noop$1, onc
|
|
|
98901
98908
|
if (query) {
|
|
98902
98909
|
(query.cursorFn || query.describeFirst) && write(Sync);
|
|
98903
98910
|
errorResponse = Errors.postgres(parseError(x));
|
|
98911
|
+
stream && (stream.destroy(errorResponse), stream = null);
|
|
98912
|
+
final && (final(errorResponse), final = null);
|
|
98904
98913
|
} else errored(Errors.postgres(parseError(x)));
|
|
98905
98914
|
}
|
|
98906
98915
|
function retry(q, error) {
|
|
@@ -99086,7 +99095,7 @@ function timer(fn, seconds) {
|
|
|
99086
99095
|
}
|
|
99087
99096
|
|
|
99088
99097
|
//#endregion
|
|
99089
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
99098
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/subscribe.js
|
|
99090
99099
|
const noop = () => {};
|
|
99091
99100
|
function Subscribe(postgres, options) {
|
|
99092
99101
|
const subscribers = /* @__PURE__ */ new Map(), slot = "postgresjs_" + Math.random().toString(36).slice(2), state = {};
|
|
@@ -99293,7 +99302,7 @@ function parseEvent(x) {
|
|
|
99293
99302
|
}
|
|
99294
99303
|
|
|
99295
99304
|
//#endregion
|
|
99296
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
99305
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/large.js
|
|
99297
99306
|
function largeObject(sql, oid, mode = 393216) {
|
|
99298
99307
|
return new Promise(async (resolve, reject) => {
|
|
99299
99308
|
await sql.begin(async (sql) => {
|
|
@@ -99351,7 +99360,7 @@ function largeObject(sql, oid, mode = 393216) {
|
|
|
99351
99360
|
}
|
|
99352
99361
|
|
|
99353
99362
|
//#endregion
|
|
99354
|
-
//#region ../../node_modules/.pnpm/postgres@3.4.
|
|
99363
|
+
//#region ../../node_modules/.pnpm/postgres@3.4.9_patch_hash=3c6ad14249311b1009d0b5dc63a6223155b601ddf5a35abede25e8e10d200935/node_modules/postgres/src/index.js
|
|
99355
99364
|
Object.assign(Postgres, {
|
|
99356
99365
|
PostgresError,
|
|
99357
99366
|
toPascal,
|
|
@@ -99841,7 +99850,7 @@ async function provisionEphemeralDatabases(opts) {
|
|
|
99841
99850
|
}
|
|
99842
99851
|
|
|
99843
99852
|
//#endregion
|
|
99844
|
-
//#region ../slate-bridge/dist/platform-harness
|
|
99853
|
+
//#region ../slate-bridge/dist/platform-harness--cbzxZ44.mjs
|
|
99845
99854
|
const nonEmptyStringSchema = string$5().trim().min(1);
|
|
99846
99855
|
const portSchema = number$3().int().min(0).max(65535).default(7777);
|
|
99847
99856
|
const envSchema = object$4({
|
|
@@ -99850,7 +99859,7 @@ const envSchema = object$4({
|
|
|
99850
99859
|
CTX_PLATFORM_URL: url().default("http://127.0.0.1:3010").transform((url) => url.replace(/\/+$/, "")),
|
|
99851
99860
|
CTX_WEB_URL: url().default("http://localhost:3000").transform((url) => url.replace(/\/+$/, "")),
|
|
99852
99861
|
CTXS_BRIDGE_PORT: portSchema,
|
|
99853
|
-
CTXS_CLAUDE_IMAGE: nonEmptyStringSchema.default("ghcr.io/usecontextlayer/ctx-sandbox:0.
|
|
99862
|
+
CTXS_CLAUDE_IMAGE: nonEmptyStringSchema.default("ghcr.io/usecontextlayer/ctx-sandbox:0.6.0"),
|
|
99854
99863
|
CTXS_CLAUDE_MODEL: nonEmptyStringSchema.default("opus"),
|
|
99855
99864
|
CTXS_HOST_CLAUDE_JSON_PATH: nonEmptyStringSchema.default(() => path.join(os.homedir(), ".claude.json")),
|
|
99856
99865
|
NODE_ENV: _enum$1([
|
|
@@ -99887,30 +99896,49 @@ You are working in the user's workspace: a directory of documents that is also a
|
|
|
99887
99896
|
Do this bookkeeping quietly. Don't narrate routine git operations — mention git only when something needs the user's attention: a conflict, a rejected push you cannot heal, or work you found and preserved.
|
|
99888
99897
|
|
|
99889
99898
|
The workspace's synced source data — email, meetings, tasks, whatever the user connected — lives in a Postgres database called the base. Query it with the \`ctxb\` CLI, following the contextbase skill. \`CTXB_DATABASE_URL\` is already set when this workspace has a base; if it is unset, no base is connected. Answer data questions from the base, not from memory.`;
|
|
99890
|
-
const
|
|
99891
|
-
"
|
|
99892
|
-
|
|
99893
|
-
"
|
|
99894
|
-
"
|
|
99895
|
-
"
|
|
99896
|
-
"
|
|
99897
|
-
"
|
|
99898
|
-
"
|
|
99899
|
-
"
|
|
99900
|
-
"
|
|
99901
|
-
"
|
|
99902
|
-
"
|
|
99903
|
-
"
|
|
99904
|
-
"
|
|
99905
|
-
"
|
|
99906
|
-
"
|
|
99907
|
-
"
|
|
99908
|
-
"
|
|
99909
|
-
"
|
|
99910
|
-
"
|
|
99911
|
-
"
|
|
99912
|
-
|
|
99913
|
-
|
|
99899
|
+
const BUILTIN_TOOL_DISPOSITIONS = {
|
|
99900
|
+
AskUserQuestion: "deny",
|
|
99901
|
+
Bash: "allow",
|
|
99902
|
+
CronCreate: "ask",
|
|
99903
|
+
CronDelete: "ask",
|
|
99904
|
+
CronList: "ask",
|
|
99905
|
+
DesignSync: "ask",
|
|
99906
|
+
Edit: "allow",
|
|
99907
|
+
EnterPlanMode: "allow",
|
|
99908
|
+
EnterWorktree: "ask",
|
|
99909
|
+
ExitPlanMode: "allow",
|
|
99910
|
+
ExitWorktree: "ask",
|
|
99911
|
+
Glob: "allow",
|
|
99912
|
+
Grep: "allow",
|
|
99913
|
+
ListAgents: "ask",
|
|
99914
|
+
ListMcpResourcesTool: "allow",
|
|
99915
|
+
Monitor: "ask",
|
|
99916
|
+
NotebookEdit: "allow",
|
|
99917
|
+
PushNotification: "ask",
|
|
99918
|
+
Read: "allow",
|
|
99919
|
+
ReadMcpResourceDirTool: "allow",
|
|
99920
|
+
ReadMcpResourceTool: "allow",
|
|
99921
|
+
RemoteTrigger: "ask",
|
|
99922
|
+
ReportFindings: "ask",
|
|
99923
|
+
ScheduleWakeup: "ask",
|
|
99924
|
+
SendMessage: "ask",
|
|
99925
|
+
Skill: "allow",
|
|
99926
|
+
Task: "allow",
|
|
99927
|
+
TaskCreate: "allow",
|
|
99928
|
+
TaskGet: "allow",
|
|
99929
|
+
TaskList: "allow",
|
|
99930
|
+
TaskOutput: "allow",
|
|
99931
|
+
TaskStop: "allow",
|
|
99932
|
+
TaskUpdate: "allow",
|
|
99933
|
+
ToolSearch: "allow",
|
|
99934
|
+
WebFetch: "allow",
|
|
99935
|
+
WebSearch: "allow",
|
|
99936
|
+
Workflow: "ask",
|
|
99937
|
+
Write: "allow"
|
|
99938
|
+
};
|
|
99939
|
+
function builtinToolsWithDisposition(disposition) {
|
|
99940
|
+
return Object.entries(BUILTIN_TOOL_DISPOSITIONS).filter(([, value]) => value === disposition).map(([tool]) => tool);
|
|
99941
|
+
}
|
|
99914
99942
|
const CLAUDE_ARGS = [
|
|
99915
99943
|
"--input-format",
|
|
99916
99944
|
"stream-json",
|
|
@@ -99936,12 +99964,12 @@ function resolveChatBaseId(baseIds, workspaceId) {
|
|
|
99936
99964
|
}
|
|
99937
99965
|
function buildChatSpawnPlan(input) {
|
|
99938
99966
|
const { allowedTools, disallowedTools } = input.mcpToolRules;
|
|
99939
|
-
const deniedTools = [...
|
|
99967
|
+
const deniedTools = [...builtinToolsWithDisposition("deny"), ...disallowedTools];
|
|
99940
99968
|
return {
|
|
99941
99969
|
args: [
|
|
99942
99970
|
...CLAUDE_ARGS,
|
|
99943
99971
|
"--allowedTools",
|
|
99944
|
-
[...
|
|
99972
|
+
[...builtinToolsWithDisposition("allow"), ...allowedTools].join(","),
|
|
99945
99973
|
...deniedTools.length > 0 ? ["--disallowedTools", deniedTools.join(",")] : [],
|
|
99946
99974
|
...input.mcpConfigArgs ?? [],
|
|
99947
99975
|
"--model",
|
|
@@ -101198,6 +101226,7 @@ const PARITY_SCENARIOS = [
|
|
|
101198
101226
|
}, "Reply with exactly one word: continued"]
|
|
101199
101227
|
}
|
|
101200
101228
|
];
|
|
101229
|
+
const goldenStreamSchema = array$1(looseObject$1({ type: string$5() }));
|
|
101201
101230
|
function resolveGoldensDir() {
|
|
101202
101231
|
let dir = path.dirname(fileURLToPath(import.meta.url));
|
|
101203
101232
|
while (true) {
|
|
@@ -105403,4 +105432,4 @@ runCli().catch((error) => {
|
|
|
105403
105432
|
//#endregion
|
|
105404
105433
|
export { createProgram, runCli };
|
|
105405
105434
|
//# sourceMappingURL=cli.mjs.map
|
|
105406
|
-
//# debugId=
|
|
105435
|
+
//# debugId=c93ba44e-cf84-5e20-b897-0d3cb6781373
|