@bastani/atomic 0.9.35-alpha.4 → 0.9.35-alpha.5
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/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +12 -0
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +114 -45
- package/dist/builtin/workflows/src/index.js +98 -34
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +2 -0
- package/dist/core/settings-schema.d.ts +1 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +5 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/docs/settings.md +3 -0
- package/docs/workflows/api-reference.md +4 -1
- package/docs/workflows/operations.md +2 -0
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
- package/schemas/settings.schema.json +6 -0
|
@@ -3037,8 +3037,7 @@ async function reconcileDbosAdmission(sdk, metadata, repairMissing, checkReady)
|
|
|
3037
3037
|
}
|
|
3038
3038
|
if (!repairMissing || metadata.completedCheckpoints > 0 || metadata.pendingPrompts > 0)
|
|
3039
3039
|
return false;
|
|
3040
|
-
|
|
3041
|
-
await sdk.startWorkflow(id, metadata.name, metadata.inputs);
|
|
3040
|
+
await sdk.startWorkflow(id, metadata.name, metadata.inputs);
|
|
3042
3041
|
signal.throwIfAborted();
|
|
3043
3042
|
const accepted = await sdk.retrieveWorkflow(id);
|
|
3044
3043
|
signal.throwIfAborted();
|
|
@@ -3065,6 +3064,27 @@ var init_dbos_admission_recovery = __esm(() => {
|
|
|
3065
3064
|
init_dbos_metadata();
|
|
3066
3065
|
});
|
|
3067
3066
|
|
|
3067
|
+
// dist/builtin/workflows/src/durable/dbos-pool-size.ts
|
|
3068
|
+
function validateDbosPoolSize(poolSize, name = "durability.poolSize") {
|
|
3069
|
+
if (typeof poolSize !== "number" || !Number.isInteger(poolSize) || poolSize < 2) {
|
|
3070
|
+
throw new TypeError(`${name} must be an integer of at least 2 (one ownership connection and one transaction connection)`);
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
function resolvedDbosPoolSize() {
|
|
3074
|
+
return getDbosProcessOwner().poolSize ?? 10;
|
|
3075
|
+
}
|
|
3076
|
+
function requestDbosPoolSize(poolSize) {
|
|
3077
|
+
validateDbosPoolSize(poolSize);
|
|
3078
|
+
const owner = getDbosProcessOwner();
|
|
3079
|
+
if ((owner.configured !== undefined || owner.wrappers !== undefined) && resolvedDbosPoolSize() !== poolSize) {
|
|
3080
|
+
throw new Error(`Workflow durability is already configured for this process with poolSize ${resolvedDbosPoolSize()}; DBOS cannot switch to poolSize ${poolSize} until the process restarts.`);
|
|
3081
|
+
}
|
|
3082
|
+
owner.poolSize = poolSize;
|
|
3083
|
+
}
|
|
3084
|
+
var init_dbos_pool_size = __esm(() => {
|
|
3085
|
+
init_dbos_process_owner();
|
|
3086
|
+
});
|
|
3087
|
+
|
|
3068
3088
|
// dist/builtin/workflows/src/durable/dbos-prompt-reservations.ts
|
|
3069
3089
|
function emptyDbosPromptReservationState(baseline = 0, epoch = crypto.randomUUID()) {
|
|
3070
3090
|
const normalized = Math.max(0, Math.trunc(baseline));
|
|
@@ -3731,6 +3751,7 @@ class DbosOwnerFence {
|
|
|
3731
3751
|
pool;
|
|
3732
3752
|
executorId;
|
|
3733
3753
|
endPool;
|
|
3754
|
+
compactionPool;
|
|
3734
3755
|
lifetime;
|
|
3735
3756
|
endedClients = new WeakSet;
|
|
3736
3757
|
protectedClients = new Set;
|
|
@@ -3743,10 +3764,11 @@ class DbosOwnerFence {
|
|
|
3743
3764
|
get invalidated() {
|
|
3744
3765
|
return this.lost;
|
|
3745
3766
|
}
|
|
3746
|
-
constructor(pool, executorId, endPool) {
|
|
3767
|
+
constructor(pool, executorId, endPool, compactionPool = pool) {
|
|
3747
3768
|
this.pool = pool;
|
|
3748
3769
|
this.executorId = executorId;
|
|
3749
3770
|
this.endPool = endPool;
|
|
3771
|
+
this.compactionPool = compactionPool;
|
|
3750
3772
|
}
|
|
3751
3773
|
fail() {
|
|
3752
3774
|
this.lost = true;
|
|
@@ -3806,14 +3828,16 @@ class DbosOwnerFence {
|
|
|
3806
3828
|
async recover(executorId, callback) {
|
|
3807
3829
|
if (!isDatabaseExecutor(executorId))
|
|
3808
3830
|
return;
|
|
3809
|
-
const
|
|
3831
|
+
const context = writeContext.getStore();
|
|
3832
|
+
const client = context?.fence === this ? context.client : await this.pool().connect();
|
|
3810
3833
|
const fail = () => {
|
|
3811
3834
|
this.fail();
|
|
3812
3835
|
};
|
|
3813
3836
|
client.on("error", fail);
|
|
3814
3837
|
client.on("end", fail);
|
|
3815
3838
|
try {
|
|
3816
|
-
|
|
3839
|
+
if (context?.fence !== this)
|
|
3840
|
+
await client.query("BEGIN");
|
|
3817
3841
|
const result = await client.query("SELECT pg_try_advisory_xact_lock($1, $2) AS held", [
|
|
3818
3842
|
...lockKey(executorId)
|
|
3819
3843
|
]);
|
|
@@ -3822,11 +3846,13 @@ class DbosOwnerFence {
|
|
|
3822
3846
|
return await callback();
|
|
3823
3847
|
} finally {
|
|
3824
3848
|
try {
|
|
3825
|
-
|
|
3849
|
+
if (context?.fence !== this)
|
|
3850
|
+
await client.query("ROLLBACK");
|
|
3826
3851
|
} finally {
|
|
3827
3852
|
client.removeListener("error", fail);
|
|
3828
3853
|
client.removeListener("end", fail);
|
|
3829
|
-
|
|
3854
|
+
if (context?.fence !== this)
|
|
3855
|
+
client.release();
|
|
3830
3856
|
}
|
|
3831
3857
|
}
|
|
3832
3858
|
}
|
|
@@ -3870,7 +3896,7 @@ class DbosOwnerFence {
|
|
|
3870
3896
|
}
|
|
3871
3897
|
if (this.lost)
|
|
3872
3898
|
throw this.fail();
|
|
3873
|
-
return await writeContext.run({ fence: this, workflows: new Map([...active ?? [], [workflowId, claim]]) }, callback);
|
|
3899
|
+
return await writeContext.run({ fence: this, workflows: new Map([...active ?? [], [workflowId, claim]]), client }, callback);
|
|
3874
3900
|
} finally {
|
|
3875
3901
|
try {
|
|
3876
3902
|
await client.query("ROLLBACK");
|
|
@@ -3890,7 +3916,7 @@ class DbosOwnerFence {
|
|
|
3890
3916
|
const metadataId = `${authority.root}:checkpoint:__atomic_metadata`;
|
|
3891
3917
|
if (retainedId !== metadataId && !retainedId.startsWith(`${metadataId}:`))
|
|
3892
3918
|
throw new Error("Metadata compaction requires a metadata checkpoint");
|
|
3893
|
-
const client = await this.
|
|
3919
|
+
const client = await this.compactionPool().connect();
|
|
3894
3920
|
try {
|
|
3895
3921
|
await installDbosRowGuard(client);
|
|
3896
3922
|
await client.query("BEGIN");
|
|
@@ -4086,7 +4112,7 @@ function getAtomicExecutorId() {
|
|
|
4086
4112
|
owner.executorId ??= `atomic-db-${crypto.randomUUID()}`;
|
|
4087
4113
|
return owner.executorId;
|
|
4088
4114
|
}
|
|
4089
|
-
function createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, fence, previousExecutorIds = []) {
|
|
4115
|
+
function createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, fence, previousExecutorIds = [], options = {}) {
|
|
4090
4116
|
const checkpointId = (workflowId, stepName) => `${workflowId}:checkpoint:${stepName}`;
|
|
4091
4117
|
async function stepRecord(status, prefix) {
|
|
4092
4118
|
if (status.status !== "SUCCESS")
|
|
@@ -4115,24 +4141,43 @@ function createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, fence, pre
|
|
|
4115
4141
|
}
|
|
4116
4142
|
return records;
|
|
4117
4143
|
}
|
|
4144
|
+
async function retrieveMatchingRootMarker(workflowId, name, inputs) {
|
|
4145
|
+
const existing = await raw.retrieveWorkflow(workflowId);
|
|
4146
|
+
if (existing === undefined)
|
|
4147
|
+
return;
|
|
4148
|
+
if (existing.name !== name || !isDeepStrictEqual2(existing.inputs, inputs))
|
|
4149
|
+
throw new Error("Workflow root identity changed during admission");
|
|
4150
|
+
return dbos.retrieveWorkflow(workflowId);
|
|
4151
|
+
}
|
|
4152
|
+
async function startRoot(workflowId, name, inputs) {
|
|
4153
|
+
if (fence !== undefined) {
|
|
4154
|
+
const existing = await retrieveMatchingRootMarker(workflowId, name, inputs);
|
|
4155
|
+
if (existing !== undefined)
|
|
4156
|
+
return existing;
|
|
4157
|
+
}
|
|
4158
|
+
try {
|
|
4159
|
+
return await dbos.startWorkflow(mainWorkflow, { workflowID: workflowId })(name, { ...inputs });
|
|
4160
|
+
} catch (err) {
|
|
4161
|
+
if (!isDbosDuplicateWorkflowError(err))
|
|
4162
|
+
throw err;
|
|
4163
|
+
const raced = await retrieveMatchingRootMarker(workflowId, name, inputs);
|
|
4164
|
+
if (raced === undefined)
|
|
4165
|
+
throw err;
|
|
4166
|
+
return raced;
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
async function settleMarker(marker) {
|
|
4170
|
+
if (!options.settleRootMarker || marker === undefined)
|
|
4171
|
+
return;
|
|
4172
|
+
await boundedAdmission(async () => {
|
|
4173
|
+
await marker.getResult();
|
|
4174
|
+
}, dbosAdmissionContext.getStore(), undefined, "Workflow database root marker settlement timed out.");
|
|
4175
|
+
}
|
|
4118
4176
|
const raw = {
|
|
4119
4177
|
launch: () => dbos.launch(),
|
|
4120
4178
|
shutdown: () => dbos.shutdown(),
|
|
4121
4179
|
async startWorkflow(workflowId, name, inputs) {
|
|
4122
|
-
|
|
4123
|
-
const existing = await raw.retrieveWorkflow(workflowId);
|
|
4124
|
-
if (existing !== undefined) {
|
|
4125
|
-
if (existing.name !== name || !isDeepStrictEqual2(existing.inputs, inputs))
|
|
4126
|
-
throw new Error("Workflow root identity changed during admission");
|
|
4127
|
-
return;
|
|
4128
|
-
}
|
|
4129
|
-
}
|
|
4130
|
-
try {
|
|
4131
|
-
await dbos.startWorkflow(mainWorkflow, { workflowID: workflowId })(name, { ...inputs });
|
|
4132
|
-
} catch (err) {
|
|
4133
|
-
if (!isDbosDuplicateWorkflowError(err))
|
|
4134
|
-
throw err;
|
|
4135
|
-
}
|
|
4180
|
+
await settleMarker(await startRoot(workflowId, name, inputs));
|
|
4136
4181
|
},
|
|
4137
4182
|
async retrieveWorkflow(workflowId) {
|
|
4138
4183
|
const statuses = await dbos.listWorkflows({ workflowIDs: [workflowId], loadInput: true, limit: 1 });
|
|
@@ -4270,10 +4315,7 @@ function createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, fence, pre
|
|
|
4270
4315
|
if (next === undefined)
|
|
4271
4316
|
throw new Error("Workflow ownership fence cannot create a recovery generation");
|
|
4272
4317
|
fence.close().catch(() => {});
|
|
4273
|
-
return createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, next, [
|
|
4274
|
-
...previousExecutorIds,
|
|
4275
|
-
fence.executorId
|
|
4276
|
-
]);
|
|
4318
|
+
return createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, next, [...previousExecutorIds, fence.executorId], options);
|
|
4277
4319
|
},
|
|
4278
4320
|
adoptPreviousGeneration: async (workflowId) => {
|
|
4279
4321
|
if (previousExecutorIds.length === 0)
|
|
@@ -4345,7 +4387,13 @@ function createRealDbosHandle(dbos, mainWorkflow, checkpointWorkflow, fence, pre
|
|
|
4345
4387
|
}
|
|
4346
4388
|
return await claim();
|
|
4347
4389
|
}, true),
|
|
4348
|
-
startWorkflow: (id, name, inputs) =>
|
|
4390
|
+
startWorkflow: async (id, name, inputs) => {
|
|
4391
|
+
let marker;
|
|
4392
|
+
await mutate(id, async () => {
|
|
4393
|
+
marker = await startRoot(id, name, inputs);
|
|
4394
|
+
});
|
|
4395
|
+
await settleMarker(marker);
|
|
4396
|
+
},
|
|
4349
4397
|
cancelWorkflow: (id) => mutate(id, () => raw.cancelWorkflow(id)),
|
|
4350
4398
|
resumeWorkflow: (id) => mutate(id, () => raw.resumeWorkflow(id)),
|
|
4351
4399
|
recordStepOutput: (id, step, output) => mutate(id, () => raw.recordStepOutput(id, step, output), { name: step, output }),
|
|
@@ -4376,6 +4424,7 @@ function statusToInfo(status, fallbackId) {
|
|
|
4376
4424
|
return info;
|
|
4377
4425
|
}
|
|
4378
4426
|
var init_dbos_sdk_handle = __esm(() => {
|
|
4427
|
+
init_dbos_admission();
|
|
4379
4428
|
init_dbos_metadata();
|
|
4380
4429
|
init_dbos_owner_fence();
|
|
4381
4430
|
init_dbos_process_owner();
|
|
@@ -34711,9 +34760,10 @@ function resolvedPostgresHealth(url) {
|
|
|
34711
34760
|
|
|
34712
34761
|
// dist/builtin/workflows/src/durable/dbos-recoverable-pool.ts
|
|
34713
34762
|
function createRecoverablePostgresPool(initialUrl, options = {}) {
|
|
34714
|
-
const
|
|
34763
|
+
const poolSize = options.poolSize ?? 10;
|
|
34764
|
+
const pool = new Pool({ ...import_datasource.getPGClientConfig(initialUrl), max: poolSize });
|
|
34715
34765
|
const endFacade = pool.end.bind(pool);
|
|
34716
|
-
const createPool = options.createPool ?? ((url) => new Pool(import_datasource.getPGClientConfig(url)));
|
|
34766
|
+
const createPool = options.createPool ?? ((url) => new Pool({ ...import_datasource.getPGClientConfig(url), max: poolSize }));
|
|
34717
34767
|
const draining = new Set;
|
|
34718
34768
|
const checkouts = new Map;
|
|
34719
34769
|
let current;
|
|
@@ -34872,6 +34922,7 @@ function configureAdmissionDatabase(sdk, config, launchLock = withDbosLaunchLock
|
|
|
34872
34922
|
const createPool = (fenced = true) => {
|
|
34873
34923
|
let unsubscribe;
|
|
34874
34924
|
const managed = createRecoverablePostgresPool(systemDatabaseUrl, {
|
|
34925
|
+
poolSize: resolvedDbosPoolSize(),
|
|
34875
34926
|
beforeConnect: health === undefined ? undefined : () => health.check(),
|
|
34876
34927
|
afterConnect: health === undefined ? undefined : (client) => health.validate(client),
|
|
34877
34928
|
onConnectionError: () => health?.invalidate(),
|
|
@@ -34884,7 +34935,7 @@ function configureAdmissionDatabase(sdk, config, launchLock = withDbosLaunchLock
|
|
|
34884
34935
|
let pool = createPool();
|
|
34885
34936
|
const createFence = (executorId) => {
|
|
34886
34937
|
const fencePool = createPool(false);
|
|
34887
|
-
const created = new DbosOwnerFence(() => fencePool, executorId, () => fencePool.end());
|
|
34938
|
+
const created = new DbosOwnerFence(() => fencePool, executorId, () => fencePool.end(), () => pool);
|
|
34888
34939
|
const owner = getDbosProcessOwner();
|
|
34889
34940
|
owner.executorFences ??= new Set;
|
|
34890
34941
|
owner.executorFences.add(created);
|
|
@@ -34931,6 +34982,7 @@ var init_dbos_admission_config = __esm(() => {
|
|
|
34931
34982
|
init_dbos_admission_pool();
|
|
34932
34983
|
init_dbos_launch_lock();
|
|
34933
34984
|
init_dbos_owner_fence();
|
|
34985
|
+
init_dbos_pool_size();
|
|
34934
34986
|
init_dbos_process_owner();
|
|
34935
34987
|
init_dbos_recoverable_pool();
|
|
34936
34988
|
import_datasource2 = __toESM(require_datasource(), 1);
|
|
@@ -34943,6 +34995,8 @@ function effectiveSystemDatabaseUrl(configUrl, envUrl = explicitDbosSystemDataba
|
|
|
34943
34995
|
return url === undefined || url.length === 0 ? undefined : url;
|
|
34944
34996
|
}
|
|
34945
34997
|
async function configureDbosDurableBackend(config) {
|
|
34998
|
+
if (config?.poolSize !== undefined)
|
|
34999
|
+
requestDbosPoolSize(config.poolSize);
|
|
34946
35000
|
const sdk = await importDbosSdk();
|
|
34947
35001
|
const owner = getDbosProcessOwner();
|
|
34948
35002
|
const existing = owner.wrappers;
|
|
@@ -34973,7 +35027,7 @@ async function configureDbosDurableBackend(config) {
|
|
|
34973
35027
|
owner.wrappers = { mainWorkflow, checkpointWorkflow };
|
|
34974
35028
|
}
|
|
34975
35029
|
let backendFence = owner.executorFence;
|
|
34976
|
-
let backend = new DbosDurableBackend(createRealDbosHandle(sdk, mainWorkflow, checkpointWorkflow, backendFence), {
|
|
35030
|
+
let backend = new DbosDurableBackend(createRealDbosHandle(sdk, mainWorkflow, checkpointWorkflow, backendFence, [], { settleRootMarker: true }), {
|
|
34977
35031
|
checkReady
|
|
34978
35032
|
});
|
|
34979
35033
|
return {
|
|
@@ -34984,7 +35038,9 @@ async function configureDbosDurableBackend(config) {
|
|
|
34984
35038
|
await launch();
|
|
34985
35039
|
if (backendFence !== owner.executorFence && backendFence?.closed) {
|
|
34986
35040
|
backendFence = owner.executorFence;
|
|
34987
|
-
backend = new DbosDurableBackend(createRealDbosHandle(sdk, mainWorkflow, checkpointWorkflow, backendFence
|
|
35041
|
+
backend = new DbosDurableBackend(createRealDbosHandle(sdk, mainWorkflow, checkpointWorkflow, backendFence, [], {
|
|
35042
|
+
settleRootMarker: true
|
|
35043
|
+
}), { checkReady });
|
|
34988
35044
|
}
|
|
34989
35045
|
},
|
|
34990
35046
|
shutdown: async (options) => {
|
|
@@ -35749,6 +35805,10 @@ class DbosDurableBackend {
|
|
|
35749
35805
|
return { kind: deletion === "current" ? "deleted" : "malformed" };
|
|
35750
35806
|
}
|
|
35751
35807
|
const metadata = classifyLatestMetadata(records, info.workflowId);
|
|
35808
|
+
if (metadata.kind === "unavailable" && records.length === 0) {
|
|
35809
|
+
await this.suppressWorkflow(info.workflowId);
|
|
35810
|
+
return { kind: "absent" };
|
|
35811
|
+
}
|
|
35752
35812
|
if (metadata.kind !== "current" || expected !== undefined && (metadata.metadata.name !== expected.name || !isDeepStrictEqual3(metadata.metadata.inputs, expected.inputs))) {
|
|
35753
35813
|
await this.suppressWorkflow(info.workflowId);
|
|
35754
35814
|
return { kind: "malformed" };
|
|
@@ -35881,6 +35941,7 @@ var init_dbos_backend = __esm(() => {
|
|
|
35881
35941
|
init_dbos_admission_recovery();
|
|
35882
35942
|
init_dbos_envelope();
|
|
35883
35943
|
init_dbos_metadata();
|
|
35944
|
+
init_dbos_pool_size();
|
|
35884
35945
|
init_dbos_prompt_reservations();
|
|
35885
35946
|
init_dbos_status_transition();
|
|
35886
35947
|
init_dbos_tombstone();
|
|
@@ -58271,6 +58332,7 @@ async function run(def, inputs, opts = {}) {
|
|
|
58271
58332
|
init_backend();
|
|
58272
58333
|
init_backend_process_owner();
|
|
58273
58334
|
init_dbos_lifecycle();
|
|
58335
|
+
init_dbos_pool_size();
|
|
58274
58336
|
init_dbos_system_database_url();
|
|
58275
58337
|
init_factory();
|
|
58276
58338
|
|
|
@@ -58290,6 +58352,8 @@ async function run2(def, inputs, callerOpts = {}) {
|
|
|
58290
58352
|
return await run(def, inputs, { ...opts, durableBackend: new InMemoryDurableBackend });
|
|
58291
58353
|
}
|
|
58292
58354
|
const durableRequested = durability?.mode === "durable";
|
|
58355
|
+
if (durability?.poolSize !== undefined)
|
|
58356
|
+
requestDbosPoolSize(durability.poolSize);
|
|
58293
58357
|
const presetBackend = opts.durableBackend ?? getDurableBackendProcessOwner().injectedBackend;
|
|
58294
58358
|
if (presetBackend !== undefined) {
|
|
58295
58359
|
if (durableRequested && !presetBackend.persistent) {
|
|
@@ -203,6 +203,8 @@ export type WorkflowDurability = {
|
|
|
203
203
|
readonly mode: "durable";
|
|
204
204
|
/** Postgres URL for the DBOS system database, used when `DBOS_SYSTEM_DATABASE_URL` is unset; otherwise the managed database. */
|
|
205
205
|
readonly systemDatabaseUrl?: string;
|
|
206
|
+
/** Maximum connections per workflow database pool; integer of at least 2, defaults to 10. */
|
|
207
|
+
readonly poolSize?: number;
|
|
206
208
|
};
|
|
207
209
|
export interface RunOpts {
|
|
208
210
|
readonly adapters?: StageAdapters;
|
|
@@ -185,6 +185,7 @@ export declare const SettingsSchema: Type.TObject<{
|
|
|
185
185
|
workflows: Type.TOptional<Type.TUnion<[Type.TArray<Type.TString>, Type.TObject<{
|
|
186
186
|
paths: Type.TOptional<Type.TArray<Type.TString>>;
|
|
187
187
|
durability: Type.TOptional<Type.TObject<{
|
|
188
|
+
poolSize: Type.TOptional<Type.TInteger>;
|
|
188
189
|
systemDatabaseUrl: Type.TOptional<Type.TString>;
|
|
189
190
|
systemDatabaseUrlFile: Type.TOptional<Type.TString>;
|
|
190
191
|
}>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-schema.d.ts","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAuB,IAAI,EAAE,MAAM,SAAS,CAAC;AAkBjE,QAAA,MAAM,6BAA6B;;;EAGjC,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;EAiC5B,CAAC;AAEH,QAAA,MAAM,2BAA2B;;;EAa/B,CAAC;AAEH,QAAA,MAAM,4BAA4B;;EAOhC,CAAC;AAEH,QAAA,MAAM,2BAA2B;;;;EAS/B,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;;;;;;;EAsBvB,CAAC;AAEH,QAAA,MAAM,sBAAsB;;;;;;;;EAwC1B,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;EAavB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;EAaxB,CAAC;AAEH,QAAA,MAAM,6BAA6B;;EAQjC,CAAC;AAWH,QAAA,MAAM,0BAA0B;;;;;EA6B/B,CAAC;AAcF,QAAA,MAAM,6BAA6B;;;;;EAA4B,CAAC;AAEhE,QAAA,MAAM,sBAAsB;;;;EAa1B,CAAC;AAEH,QAAA,MAAM,qBAAqB;;EAEzB,CAAC;AAMH,QAAA,MAAM,kBAAkB,2DAAiB,CAAC;AAE1C,QAAA,MAAM,sBAAsB;;;EAe1B,CAAC;AAEH,QAAA,MAAM,mBAAmB;;;;;;;;;IAoBxB,CAAC;
|
|
1
|
+
{"version":3,"file":"settings-schema.d.ts","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAuB,IAAI,EAAE,MAAM,SAAS,CAAC;AAkBjE,QAAA,MAAM,6BAA6B;;;EAGjC,CAAC;AAEH,QAAA,MAAM,wBAAwB;;;;;;;;;;EAiC5B,CAAC;AAEH,QAAA,MAAM,2BAA2B;;;EAa/B,CAAC;AAEH,QAAA,MAA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O,mBAAmB,CAAC,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,WAAW,CAAC,aAAa,CAAC,sBAAsB,CAAC,CAAC,CAAC;AACtF,MAAM,MAAM,gBAAgB,GAAG,WAAW,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC;AAC1E,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;IACrG,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
|
@@ -220,6 +220,11 @@ const WorkflowsSettingsSchema = Type.Union([
|
|
|
220
220
|
Type.Object({
|
|
221
221
|
paths: Type.Optional(Type.Array(Type.String(), { description: "Workflow resource paths." })),
|
|
222
222
|
durability: Type.Optional(Type.Object({
|
|
223
|
+
poolSize: Type.Optional(Type.Integer({
|
|
224
|
+
minimum: 2,
|
|
225
|
+
default: 10,
|
|
226
|
+
description: "Maximum connections per workflow database pool (at least 2).",
|
|
227
|
+
})),
|
|
223
228
|
systemDatabaseUrl: Type.Optional(Type.String({ description: "PostgreSQL URL for the workflow database." })),
|
|
224
229
|
systemDatabaseUrlFile: Type.Optional(Type.String({
|
|
225
230
|
description: "Read the PostgreSQL URL from a UTF-8 file instead of storing credentials in settings.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings-schema.js","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAoC,IAAI,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,SAAS,sBAAsB,CAAC,OAAO,GAA+C,EAAE;IACvF,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,MA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AI,CAAC,QAAQ,CAC1B,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE;QAClF,WAAW,EACV,4GAA4G;QAC7G,OAAO,EAAE,iBAAiB,CAAC,YAAY;KACvC,CAAC,CACF;IACD,yBAAyB,EAAE,IAAI,CAAC,QAAQ,CACvC,cAAc,CAAC;QACd,WAAW,EACV,oIAAoI;KACrI,CAAC,CACF;IACD,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAC9B,cAAc,CAAC;QACd,WAAW,EACV,4IAA4I;KAC7I,CAAC,CACF;IACD,SAAS,EAAE,IAAI,CAAC,QAAQ,CACvB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,EAAE;QAChE,WAAW,EAAE,0CAA0C;QACvD,UAAU,EAAE,IAAI;KAChB,CAAC,CACF;IACD,UAAU,EAAE,IAAI,CAAC,QAAQ,CACxB,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,uCAAuC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxF;CACD,EACD,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAC9B,CAAC","sourcesContent":["import { ModelThinkingLevelSchema } from \"@bastani/pi-ai/providers/model-schema\";\nimport { type Static, type TSchemaOptions, Type } from \"typebox\";\nimport { SETTINGS_DEFAULTS } from \"./settings-defaults.ts\";\n\nfunction nonNegativeSafeInteger(options: { default?: number; description?: string } = {}) {\n\treturn Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER, ...options });\n}\n\nfunction caseInsensitive(word: string): string {\n\treturn [...word].map((letter) => `[${letter.toLowerCase()}${letter.toUpperCase()}]`).join(\"\");\n}\n\n/** Mirrors `parseHttpIdleTimeoutMs`: milliseconds, `disabled`, or a duration such as `30s`, `5m`, `1h`. */\nconst TIMEOUT_STRING_PATTERN = `^(?:${caseInsensitive(\"disabled\")}|[0-9]+(?:${caseInsensitive(\"ms\")}|[smhSMH])?)$`;\n\nfunction timeoutSetting(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Number({ minimum: 0 }), Type.String({ pattern: TIMEOUT_STRING_PATTERN })], options);\n}\n\nconst CompactionModelOverrideSchema = Type.Object({\n\treserveTokens: Type.Optional(nonNegativeSafeInteger()),\n\tpreserve_recent: Type.Optional(nonNegativeSafeInteger()),\n});\n\nconst CompactionSettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.compaction.enabled })),\n\treserveTokens: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Tokens reserved for the next model response.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.reserveTokens,\n\t\t}),\n\t),\n\tcompression_ratio: Type.Optional(\n\t\tType.Number({\n\t\t\texclusiveMinimum: 0,\n\t\t\texclusiveMaximum: 1,\n\t\t\tdescription: \"Fraction of compactable transcript lines to keep.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.compression_ratio,\n\t\t}),\n\t),\n\tpreserve_recent: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Exact number of newest context-visible messages kept outside the compactable region.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.preserve_recent,\n\t\t}),\n\t),\n\tquery: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Relevance focus for selecting older lines to retain. Defaults to the last user message when omitted.\",\n\t\t}),\n\t),\n\tmodelOverrides: Type.Optional(\n\t\tType.Record(Type.String(), CompactionModelOverrideSchema, {\n\t\t\tdescription: 'Per-model overrides keyed by exact \"provider/modelId\" strings.',\n\t\t}),\n\t),\n});\n\nconst BranchSummarySettingsSchema = Type.Object({\n\treserveTokens: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Tokens reserved for the prompt and LLM response.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.reserveTokens,\n\t\t}),\n\t),\n\tskipPrompt: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: 'When true, skips the \"Summarize branch?\" prompt and defaults to no summary.',\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.skipPrompt,\n\t\t}),\n\t),\n});\n\nconst SessionSummarySettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Generate a one-line resume-picker summary once the agent goes idle.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.sessionSummary.enabled,\n\t\t}),\n\t),\n});\n\nconst ProviderRetrySettingsSchema = Type.Object({\n\ttimeoutMs: Type.Optional(Type.Number({ description: \"SDK or provider request timeout in milliseconds.\" })),\n\tmaxRetries: Type.Optional(Type.Number({ description: \"SDK or provider retry attempts.\" })),\n\tmaxRetryDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum server-requested delay before failing.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.provider.maxRetryDelayMs,\n\t\t}),\n\t),\n});\n\nconst RetrySettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.retry.enabled })),\n\tmaxRetries: Type.Optional(Type.Number({ default: SETTINGS_DEFAULTS.retry.maxRetries })),\n\tbaseDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.baseDelayMs,\n\t\t}),\n\t),\n\tmaxAgentDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum agent-level backoff delay in milliseconds. 0 retries immediately.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.maxAgentDelayMs,\n\t\t}),\n\t),\n\tprovider: Type.Optional(ProviderRetrySettingsSchema),\n\tmaxDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.\",\n\t\t\tdeprecated: true,\n\t\t}),\n\t),\n});\n\nconst TerminalSettingsSchema = Type.Object({\n\tshowImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show images when the terminal supports them.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showImages,\n\t\t}),\n\t),\n\timageWidthCells: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Preferred inline image width in terminal cells.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.imageWidthCells,\n\t\t}),\n\t),\n\tclearOnShrink: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Clear empty rows when content shrinks.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.clearOnShrink,\n\t\t}),\n\t),\n\tshowTerminalProgress: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show OSC 9;4 terminal progress indicators.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showTerminalProgress,\n\t\t}),\n\t),\n\thyperlinks: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Hyperlink capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n\timages: Type.Optional(\n\t\tType.Union([Type.Literal(\"kitty\"), Type.Literal(\"iterm2\"), Type.Literal(\"auto\"), Type.Literal(false)], {\n\t\t\tdescription: 'Inline-image protocol override. false disables images; \"auto\" keeps terminal detection.',\n\t\t}),\n\t),\n\ttrueColor: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Truecolor capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n});\n\nconst ImageSettingsSchema = Type.Object({\n\tautoResize: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Resize images to 2000x2000 maximum for better model compatibility.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.autoResize,\n\t\t}),\n\t),\n\tblockImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"When true, prevents all images from being sent to LLM providers.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.blockImages,\n\t\t}),\n\t),\n});\n\nconst SearchSettingsSchema = Type.Object({\n\tcontextBefore: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines before each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextBefore,\n\t\t}),\n\t),\n\tcontextAfter: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines after each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextAfter,\n\t\t}),\n\t),\n});\n\nconst BashInterceptorSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"When true, block shell commands that have dedicated tools and offer remaining bash tool calls to user_bash extension handlers before local execution.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.bashInterceptor.enabled,\n\t\t}),\n\t),\n});\n\nconst HerdrSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Enable the built-in reporter in an eligible Herdr pane.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.herdr.enabled,\n\t\t}),\n\t),\n});\n\nconst ModelRoutingSettingsSchema = Type.Object(\n\t{\n\t\tallowedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"When nonempty, only models from these provider IDs are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Provider IDs that are never routing candidates. Applied after allowedProviders.\",\n\t\t\t}),\n\t\t),\n\t\tallowedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"When nonempty, only models matching these full-ID or glob patterns, as in enabledModels, are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Models matching these full-ID or glob patterns are never routing candidates. Applied after allowedModels.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{\n\t\tdescription:\n\t\t\t'Provider and model filters for the candidates model \"auto\" may route to. Does not affect routerModel.',\n\t},\n);\n\nfunction thinkingBudgetsSettings(options?: TSchemaOptions) {\n\treturn Type.Object(\n\t\t{\n\t\t\tminimal: Type.Optional(Type.Number()),\n\t\t\tlow: Type.Optional(Type.Number()),\n\t\t\tmedium: Type.Optional(Type.Number()),\n\t\t\thigh: Type.Optional(Type.Number()),\n\t\t},\n\t\toptions,\n\t);\n}\n\nconst ThinkingBudgetsSettingsSchema = thinkingBudgetsSettings();\n\nconst MarkdownSettingsSchema = Type.Object({\n\tcodeBlockIndent: Type.Optional(Type.String({ default: SETTINGS_DEFAULTS.markdown.codeBlockIndent })),\n\tmermaid: Type.Optional(\n\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"final\"), Type.Literal(\"streaming\")], {\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.mermaid,\n\t\t}),\n\t),\n\tlatex: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Render LaTeX expressions as terminal-friendly Unicode math.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.latex,\n\t\t}),\n\t),\n});\n\nconst WarningSettingsSchema = Type.Object({\n\tanthropicExtraUsage: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.warnings.anthropicExtraUsage })),\n});\n\nfunction codemodeMode(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Literal(\"on\"), Type.Literal(\"only\")], options);\n}\n\nconst CodemodeModeSchema = codemodeMode();\n\nconst CodemodeSettingsSchema = Type.Object({\n\tmode: Type.Optional(\n\t\tcodemodeMode({\n\t\t\tdescription:\n\t\t\t\t'How codemode presents tools. \"on\" keeps direct tool declarations visible with script-call information; \"only\" hides ordinary direct callable declarations so the model uses scripts. Model-only tools remain directly available.',\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.mode,\n\t\t}),\n\t),\n\tinlineBudget: Type.Optional(\n\t\tType.Number({\n\t\t\tminimum: 0,\n\t\t\tdescription: \"Estimated tokens available for inline codemode tool declarations.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.inlineBudget,\n\t\t}),\n\t),\n});\n\nconst PackageSourceSchema = Type.Union(\n\t[\n\t\tType.String({ description: \"Load all resources from the package.\" }),\n\t\tType.Object({\n\t\t\tsource: Type.String(),\n\t\t\tautoload: Type.Optional(\n\t\t\t\tType.Boolean({ description: \"When false, start empty and only apply explicit resource patterns.\" }),\n\t\t\t),\n\t\t\textensions: Type.Optional(Type.Array(Type.String())),\n\t\t\tskills: Type.Optional(Type.Array(Type.String())),\n\t\t\tprompts: Type.Optional(Type.Array(Type.String())),\n\t\t\tthemes: Type.Optional(Type.Array(Type.String())),\n\t\t\tworkflows: Type.Optional(Type.Array(Type.String())),\n\t\t\tmcpServers: Type.Optional(Type.Array(Type.String())),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t\"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources.\",\n\t},\n);\n\nconst StringArraySchema = Type.Array(Type.String());\n\nconst SkillsInputSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\tenableSkillCommands: Type.Optional(Type.Boolean()),\n\t\t\t\tcustomDirectories: Type.Optional(StringArraySchema),\n\t\t\t},\n\t\t\t{ deprecated: true },\n\t\t),\n\t],\n\t{ description: \"Local skill file paths or directories.\" },\n);\n\nconst WorkflowsSettingsSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object({\n\t\t\tpaths: Type.Optional(Type.Array(Type.String(), { description: \"Workflow resource paths.\" })),\n\t\t\tdurability: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tsystemDatabaseUrl: Type.Optional(\n\t\t\t\t\t\t\tType.String({ description: \"PostgreSQL URL for the workflow database.\" }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsystemDatabaseUrlFile: Type.Optional(\n\t\t\t\t\t\t\tType.String({\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Read the PostgreSQL URL from a UTF-8 file instead of storing credentials in settings.\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription: \"Existing PostgreSQL database for durable workflows. Set only one URL source per scope.\",\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t),\n\t\t}),\n\t],\n\t{\n\t\tdescription: 'Local workflow paths, or an object with \"paths\" and \"durability\" for the workflow database.',\n\t},\n);\n\nexport const SettingsSchema = Type.Object(\n\t{\n\t\t$schema: Type.Optional(Type.String({ description: \"JSON Schema reference.\" })),\n\t\tlastChangelogVersion: Type.Optional(Type.String()),\n\t\tfirstRunOnboardingStartedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding state; leave unchanged.\" }),\n\t\t),\n\t\tonboardedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding completion state; leave unchanged.\" }),\n\t\t),\n\t\tdefaultProvider: Type.Optional(Type.String()),\n\t\tdefaultModel: Type.Optional(Type.String()),\n\t\trouterModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Inference model for workflow-stage and subagent model: \"auto\" selection only. An exact provider/model selects a registered chat or classifier model; \"auto\" and an empty string use the current chat model.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.routerModel,\n\t\t\t}),\n\t\t),\n\t\tcompactionModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Compaction model: \"auto\" or an empty string uses the session model, and an exact provider/model selects a registered chat model, classifier, or compactor.',\n\t\t\t}),\n\t\t),\n\t\tmodelRouting: Type.Optional(ModelRoutingSettingsSchema),\n\t\tdefaultThinkingLevel: Type.Optional(ModelThinkingLevelSchema),\n\t\tmodelThinkingLevels: Type.Optional(\n\t\t\tType.Record(Type.String(), ModelThinkingLevelSchema, {\n\t\t\t\tdescription: 'Per-model default thinking level overrides keyed by \"provider/modelId\".',\n\t\t\t}),\n\t\t),\n\t\tfallbackModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Ordered main-chat fallback models, written as \"provider/model\" with an optional thinking-level suffix such as \":high\".',\n\t\t\t}),\n\t\t),\n\t\ttransport: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[Type.Literal(\"auto\"), Type.Literal(\"sse\"), Type.Literal(\"websocket\"), Type.Literal(\"websocket-cached\")],\n\t\t\t\t{ default: SETTINGS_DEFAULTS.transport },\n\t\t\t),\n\t\t),\n\t\tsteeringMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.steeringMode,\n\t\t\t}),\n\t\t),\n\t\tfollowUpMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.followUpMode,\n\t\t\t}),\n\t\t),\n\t\ttheme: Type.Optional(Type.String()),\n\t\tenableAnalytics: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Opt in to analytics data sharing. Storage only; Atomic does not transmit analytics.\",\n\t\t\t}),\n\t\t),\n\t\ttrackingId: Type.Optional(\n\t\t\tType.String({ description: \"Analytics tracking identifier, generated when analytics is enabled.\" }),\n\t\t),\n\t\tdeviceId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Stable installation UUID, generated when authentication first needs it. Global only.\",\n\t\t\t}),\n\t\t),\n\t\tshowCacheMissNotices: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show cache cost and provider recovery notices.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.showCacheMissNotices,\n\t\t\t}),\n\t\t),\n\t\tcompaction: Type.Optional(CompactionSettingsSchema),\n\t\tbranchSummary: Type.Optional(BranchSummarySettingsSchema),\n\t\tsessionSummary: Type.Optional(SessionSummarySettingsSchema),\n\t\tretry: Type.Optional(RetrySettingsSchema),\n\t\thideThinkingBlock: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.hideThinkingBlock })),\n\t\texternalEditor: Type.Optional(\n\t\t\tType.String({ description: \"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR.\" }),\n\t\t),\n\t\tshellPath: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion.\",\n\t\t\t}),\n\t\t),\n\t\tquietStartup: Type.Optional(\n\t\t\tType.Union([Type.Boolean(), Type.Literal(\"header\")], {\n\t\t\t\tdescription: 'When true, hide all startup output. When \"header\", keep only the startup header.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.quietStartup,\n\t\t\t}),\n\t\t),\n\t\tdefaultProjectTrust: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"ask\"), Type.Literal(\"always\"), Type.Literal(\"never\")], {\n\t\t\t\tdescription: \"Global setting only.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.defaultProjectTrust,\n\t\t\t}),\n\t\t),\n\t\tshellCommandPrefix: Type.Optional(\n\t\t\tType.String({ description: \"Prefix prepended to every bash command, for example to enable shell aliases.\" }),\n\t\t),\n\t\tbashInterceptor: Type.Optional(BashInterceptorSettingsSchema),\n\t\tsearch: Type.Optional(SearchSettingsSchema),\n\t\tnpmCommand: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Command used for npm package lookup and installation, in argv form such as [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"].',\n\t\t\t}),\n\t\t),\n\t\tcollapseChangelog: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show the condensed changelog after update; use /changelog for the full changelog.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.collapseChangelog,\n\t\t\t}),\n\t\t),\n\t\tenableInstallTelemetry: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Send an anonymous version-adoption ping on eligible interactive launches.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableInstallTelemetry,\n\t\t\t}),\n\t\t),\n\t\tpackages: Type.Optional(\n\t\t\tType.Array(PackageSourceSchema, {\n\t\t\t\tdescription: \"npm or git package sources, as strings or objects with resource filtering.\",\n\t\t\t}),\n\t\t),\n\t\textensions: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local extension file paths or directories.\" }),\n\t\t),\n\t\tskills: Type.Optional(SkillsInputSchema),\n\t\tprompts: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local prompt template file paths or directories.\" }),\n\t\t),\n\t\tthemes: Type.Optional(Type.Array(Type.String(), { description: \"Local theme file paths or directories.\" })),\n\t\tworkflows: Type.Optional(WorkflowsSettingsSchema),\n\t\tenableSkillCommands: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Register skills as /skill:name commands.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableSkillCommands,\n\t\t\t}),\n\t\t),\n\t\tterminal: Type.Optional(TerminalSettingsSchema),\n\t\therdr: Type.Optional(HerdrSettingsSchema),\n\t\timages: Type.Optional(ImageSettingsSchema),\n\t\tenabledModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Model patterns for cycling, in the same format as the --models CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\tdefaultTools: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools.\",\n\t\t\t}),\n\t\t),\n\t\tdoubleEscapeAction: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"fork\"), Type.Literal(\"tree\"), Type.Literal(\"none\")], {\n\t\t\t\tdescription: \"Action for double-escape with an empty editor.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.doubleEscapeAction,\n\t\t\t}),\n\t\t),\n\t\ttreeFilterMode: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[\n\t\t\t\t\tType.Literal(\"default\"),\n\t\t\t\t\tType.Literal(\"no-tools\"),\n\t\t\t\t\tType.Literal(\"user-only\"),\n\t\t\t\t\tType.Literal(\"labeled-only\"),\n\t\t\t\t\tType.Literal(\"all\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tdescription: \"Default filter when opening /tree.\",\n\t\t\t\t\tdefault: SETTINGS_DEFAULTS.treeFilterMode,\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\tthinkingBudgets: Type.Optional(\n\t\t\tthinkingBudgetsSettings({\n\t\t\t\tdescription: \"Custom token budgets for thinking levels.\",\n\t\t\t}),\n\t\t),\n\t\teditorPaddingX: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Horizontal padding for the input editor (0-3).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.editorPaddingX,\n\t\t\t}),\n\t\t),\n\t\toutputPad: Type.Optional(\n\t\t\tType.Union([Type.Literal(0), Type.Literal(1)], {\n\t\t\t\tdescription: \"Horizontal padding for transcript content.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.outputPad,\n\t\t\t}),\n\t\t),\n\t\tautocompleteMaxVisible: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Maximum visible items in the autocomplete dropdown (3-20).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.autocompleteMaxVisible,\n\t\t\t}),\n\t\t),\n\t\tshowHardwareCursor: Type.Optional(\n\t\t\tType.Boolean({ description: \"Show the terminal cursor while still positioning it for IME.\" }),\n\t\t),\n\t\tfullscreenScrollbar: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"always\"), Type.Literal(\"hidden\")], {\n\t\t\t\tdescription: \"Fullscreen transcript scrollbar visibility.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenScrollbar,\n\t\t\t}),\n\t\t),\n\t\tfullscreenExitOutput: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"transcript\"), Type.Literal(\"resume-hint\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What the terminal keeps when a fullscreen session exits: the final transcript with a resume hint, or only the resume hint.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenExitOutput,\n\t\t\t}),\n\t\t),\n\t\tfullscreenCopyOnSelect: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Copy fullscreen text selections automatically on mouse release.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenCopyOnSelect,\n\t\t\t}),\n\t\t),\n\t\tfullscreenWheelScrollLines: Type.Optional(\n\t\t\tType.Union([Type.Number(), Type.Literal(\"auto\")], {\n\t\t\t\tdescription: \"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenWheelScrollLines,\n\t\t\t}),\n\t\t),\n\t\tcodemode: Type.Optional(CodemodeSettingsSchema),\n\t\tmarkdown: Type.Optional(MarkdownSettingsSchema),\n\t\twarnings: Type.Optional(WarningSettingsSchema),\n\t\tsessionDir: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom session storage directory, in the same format as the --session-dir CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\thttpProxy: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Atomic-managed HTTP clients. Global only.\",\n\t\t\t}),\n\t\t),\n\t\thttpIdleTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'HTTP idle timeout as milliseconds, a duration such as \"30s\", \"5m\", or \"1h\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.httpIdleTimeoutMs,\n\t\t\t}),\n\t\t),\n\t\tcacheWarming: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"streaming\"), Type.Literal(\"idle\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t'Cache-warming profile. \"idle\" also warms between agent runs. Global only because each refresh costs money.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.cacheWarming,\n\t\t\t}),\n\t\t),\n\t\twebsocketConnectTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'WebSocket connect or open handshake timeout as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tstreamDeadlineMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'Maximum idle gap between two provider stream events as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tqueueMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdescription: \"Legacy setting migrated to steeringMode.\",\n\t\t\t\tdeprecated: true,\n\t\t\t}),\n\t\t),\n\t\twebsockets: Type.Optional(\n\t\t\tType.Boolean({ description: \"Legacy setting migrated to transport.\", deprecated: true }),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\ntype SettingsInput = Static<typeof SettingsSchema>;\n\nexport interface CompactionModelOverride extends Static<typeof CompactionModelOverrideSchema> {}\nexport interface CompactionSettings extends Static<typeof CompactionSettingsSchema> {}\nexport interface BranchSummarySettings extends Static<typeof BranchSummarySettingsSchema> {}\nexport interface SessionSummarySettings extends Static<typeof SessionSummarySettingsSchema> {}\nexport interface ProviderRetrySettings extends Static<typeof ProviderRetrySettingsSchema> {}\nexport interface RetrySettings extends Omit<Static<typeof RetrySettingsSchema>, \"maxDelayMs\"> {}\nexport interface TerminalSettings extends Static<typeof TerminalSettingsSchema> {}\nexport interface ImageSettings extends Static<typeof ImageSettingsSchema> {}\nexport interface SearchSettings extends Static<typeof SearchSettingsSchema> {}\nexport interface BashInterceptorSettings extends Static<typeof BashInterceptorSettingsSchema> {}\nexport interface ModelRoutingSettings extends Static<typeof ModelRoutingSettingsSchema> {}\nexport interface ThinkingBudgetsSettings extends Static<typeof ThinkingBudgetsSettingsSchema> {}\nexport type MermaidRenderingMode = NonNullable<Static<typeof MarkdownSettingsSchema>[\"mermaid\"]>;\nexport interface MarkdownSettings extends Static<typeof MarkdownSettingsSchema> {}\nexport interface WarningSettings extends Static<typeof WarningSettingsSchema> {}\nexport type CodemodeMode = Static<typeof CodemodeModeSchema>;\nexport interface CodemodeSettings extends Static<typeof CodemodeSettingsSchema> {}\nexport type DefaultProjectTrust = NonNullable<SettingsInput[\"defaultProjectTrust\"]>;\nexport type QuietStartup = NonNullable<SettingsInput[\"quietStartup\"]>;\nexport type TransportSetting = NonNullable<SettingsInput[\"transport\"]>;\nexport type PackageSource = Static<typeof PackageSourceSchema>;\nexport type FullscreenExitOutput = NonNullable<SettingsInput[\"fullscreenExitOutput\"]>;\nexport type CacheWarmingMode = NonNullable<SettingsInput[\"cacheWarming\"]>;\nexport interface Settings extends Omit<SettingsInput, \"queueMode\" | \"retry\" | \"skills\" | \"websockets\"> {\n\tretry?: RetrySettings;\n\tskills?: string[];\n}\n"]}
|
|
1
|
+
{"version":3,"file":"settings-schema.js","sourceRoot":"","sources":["../../src/core/settings-schema.ts"],"names":[],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CAAuC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CACxF;CACD,EACD,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAC9B,CAAC","sourcesContent":["import { ModelThinkingLevelSchema } from \"@bastani/pi-ai/providers/model-schema\";\nimport { type Static, type TSchemaOptions, Type } from \"typebox\";\nimport { SETTINGS_DEFAULTS } from \"./settings-defaults.ts\";\n\nfunction nonNegativeSafeInteger(options: { default?: number; description?: string } = {}) {\n\treturn Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER, ...options });\n}\n\nfunction caseInsensitive(word: string): string {\n\treturn [...word].map((letter) => `[${letter.toLowerCase()}${letter.toUpperCase()}]`).join(\"\");\n}\n\n/** Mirrors `parseHttpIdleTimeoutMs`: milliseconds, `disabled`, or a duration such as `30s`, `5m`, `1h`. */\nconst TIMEOUT_STRING_PATTERN = `^(?:${caseInsensitive(\"disabled\")}|[0-9]+(?:${caseInsensitive(\"ms\")}|[smhSMH])?)$`;\n\nfunction timeoutSetting(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Number({ minimum: 0 }), Type.String({ pattern: TIMEOUT_STRING_PATTERN })], options);\n}\n\nconst CompactionModelOverrideSchema = Type.Object({\n\treserveTokens: Type.Optional(nonNegativeSafeInteger()),\n\tpreserve_recent: Type.Optional(nonNegativeSafeInteger()),\n});\n\nconst CompactionSettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.compaction.enabled })),\n\treserveTokens: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Tokens reserved for the next model response.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.reserveTokens,\n\t\t}),\n\t),\n\tcompression_ratio: Type.Optional(\n\t\tType.Number({\n\t\t\texclusiveMinimum: 0,\n\t\t\texclusiveMaximum: 1,\n\t\t\tdescription: \"Fraction of compactable transcript lines to keep.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.compression_ratio,\n\t\t}),\n\t),\n\tpreserve_recent: Type.Optional(\n\t\tnonNegativeSafeInteger({\n\t\t\tdescription: \"Exact number of newest context-visible messages kept outside the compactable region.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.compaction.preserve_recent,\n\t\t}),\n\t),\n\tquery: Type.Optional(\n\t\tType.String({\n\t\t\tdescription:\n\t\t\t\t\"Relevance focus for selecting older lines to retain. Defaults to the last user message when omitted.\",\n\t\t}),\n\t),\n\tmodelOverrides: Type.Optional(\n\t\tType.Record(Type.String(), CompactionModelOverrideSchema, {\n\t\t\tdescription: 'Per-model overrides keyed by exact \"provider/modelId\" strings.',\n\t\t}),\n\t),\n});\n\nconst BranchSummarySettingsSchema = Type.Object({\n\treserveTokens: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Tokens reserved for the prompt and LLM response.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.reserveTokens,\n\t\t}),\n\t),\n\tskipPrompt: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: 'When true, skips the \"Summarize branch?\" prompt and defaults to no summary.',\n\t\t\tdefault: SETTINGS_DEFAULTS.branchSummary.skipPrompt,\n\t\t}),\n\t),\n});\n\nconst SessionSummarySettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Generate a one-line resume-picker summary once the agent goes idle.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.sessionSummary.enabled,\n\t\t}),\n\t),\n});\n\nconst ProviderRetrySettingsSchema = Type.Object({\n\ttimeoutMs: Type.Optional(Type.Number({ description: \"SDK or provider request timeout in milliseconds.\" })),\n\tmaxRetries: Type.Optional(Type.Number({ description: \"SDK or provider retry attempts.\" })),\n\tmaxRetryDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum server-requested delay before failing.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.provider.maxRetryDelayMs,\n\t\t}),\n\t),\n});\n\nconst RetrySettingsSchema = Type.Object({\n\tenabled: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.retry.enabled })),\n\tmaxRetries: Type.Optional(Type.Number({ default: SETTINGS_DEFAULTS.retry.maxRetries })),\n\tbaseDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Exponential backoff base delay in milliseconds: 2s, 4s, 8s.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.baseDelayMs,\n\t\t}),\n\t),\n\tmaxAgentDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Maximum agent-level backoff delay in milliseconds. 0 retries immediately.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.retry.maxAgentDelayMs,\n\t\t}),\n\t),\n\tprovider: Type.Optional(ProviderRetrySettingsSchema),\n\tmaxDelayMs: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Legacy retry delay setting. Use provider.maxRetryDelayMs instead.\",\n\t\t\tdeprecated: true,\n\t\t}),\n\t),\n});\n\nconst TerminalSettingsSchema = Type.Object({\n\tshowImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show images when the terminal supports them.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showImages,\n\t\t}),\n\t),\n\timageWidthCells: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Preferred inline image width in terminal cells.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.imageWidthCells,\n\t\t}),\n\t),\n\tclearOnShrink: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Clear empty rows when content shrinks.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.clearOnShrink,\n\t\t}),\n\t),\n\tshowTerminalProgress: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Show OSC 9;4 terminal progress indicators.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.terminal.showTerminalProgress,\n\t\t}),\n\t),\n\thyperlinks: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Hyperlink capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n\timages: Type.Optional(\n\t\tType.Union([Type.Literal(\"kitty\"), Type.Literal(\"iterm2\"), Type.Literal(\"auto\"), Type.Literal(false)], {\n\t\t\tdescription: 'Inline-image protocol override. false disables images; \"auto\" keeps terminal detection.',\n\t\t}),\n\t),\n\ttrueColor: Type.Optional(\n\t\tType.Union([Type.Boolean(), Type.Literal(\"auto\")], {\n\t\t\tdescription: 'Truecolor capability override. \"auto\" and invalid values keep terminal detection.',\n\t\t}),\n\t),\n});\n\nconst ImageSettingsSchema = Type.Object({\n\tautoResize: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Resize images to 2000x2000 maximum for better model compatibility.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.autoResize,\n\t\t}),\n\t),\n\tblockImages: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"When true, prevents all images from being sent to LLM providers.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.images.blockImages,\n\t\t}),\n\t),\n});\n\nconst SearchSettingsSchema = Type.Object({\n\tcontextBefore: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines before each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextBefore,\n\t\t}),\n\t),\n\tcontextAfter: Type.Optional(\n\t\tType.Number({\n\t\t\tdescription: \"Number of context lines after each search match.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.search.contextAfter,\n\t\t}),\n\t),\n});\n\nconst BashInterceptorSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription:\n\t\t\t\t\"When true, block shell commands that have dedicated tools and offer remaining bash tool calls to user_bash extension handlers before local execution.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.bashInterceptor.enabled,\n\t\t}),\n\t),\n});\n\nconst HerdrSettingsSchema = Type.Object({\n\tenabled: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Enable the built-in reporter in an eligible Herdr pane.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.herdr.enabled,\n\t\t}),\n\t),\n});\n\nconst ModelRoutingSettingsSchema = Type.Object(\n\t{\n\t\tallowedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"When nonempty, only models from these provider IDs are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedProviders: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Provider IDs that are never routing candidates. Applied after allowedProviders.\",\n\t\t\t}),\n\t\t),\n\t\tallowedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"When nonempty, only models matching these full-ID or glob patterns, as in enabledModels, are routing candidates.\",\n\t\t\t}),\n\t\t),\n\t\texcludedModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Models matching these full-ID or glob patterns are never routing candidates. Applied after allowedModels.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{\n\t\tdescription:\n\t\t\t'Provider and model filters for the candidates model \"auto\" may route to. Does not affect routerModel.',\n\t},\n);\n\nfunction thinkingBudgetsSettings(options?: TSchemaOptions) {\n\treturn Type.Object(\n\t\t{\n\t\t\tminimal: Type.Optional(Type.Number()),\n\t\t\tlow: Type.Optional(Type.Number()),\n\t\t\tmedium: Type.Optional(Type.Number()),\n\t\t\thigh: Type.Optional(Type.Number()),\n\t\t},\n\t\toptions,\n\t);\n}\n\nconst ThinkingBudgetsSettingsSchema = thinkingBudgetsSettings();\n\nconst MarkdownSettingsSchema = Type.Object({\n\tcodeBlockIndent: Type.Optional(Type.String({ default: SETTINGS_DEFAULTS.markdown.codeBlockIndent })),\n\tmermaid: Type.Optional(\n\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"final\"), Type.Literal(\"streaming\")], {\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.mermaid,\n\t\t}),\n\t),\n\tlatex: Type.Optional(\n\t\tType.Boolean({\n\t\t\tdescription: \"Render LaTeX expressions as terminal-friendly Unicode math.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.markdown.latex,\n\t\t}),\n\t),\n});\n\nconst WarningSettingsSchema = Type.Object({\n\tanthropicExtraUsage: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.warnings.anthropicExtraUsage })),\n});\n\nfunction codemodeMode(options?: TSchemaOptions) {\n\treturn Type.Union([Type.Literal(\"on\"), Type.Literal(\"only\")], options);\n}\n\nconst CodemodeModeSchema = codemodeMode();\n\nconst CodemodeSettingsSchema = Type.Object({\n\tmode: Type.Optional(\n\t\tcodemodeMode({\n\t\t\tdescription:\n\t\t\t\t'How codemode presents tools. \"on\" keeps direct tool declarations visible with script-call information; \"only\" hides ordinary direct callable declarations so the model uses scripts. Model-only tools remain directly available.',\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.mode,\n\t\t}),\n\t),\n\tinlineBudget: Type.Optional(\n\t\tType.Number({\n\t\t\tminimum: 0,\n\t\t\tdescription: \"Estimated tokens available for inline codemode tool declarations.\",\n\t\t\tdefault: SETTINGS_DEFAULTS.codemode.inlineBudget,\n\t\t}),\n\t),\n});\n\nconst PackageSourceSchema = Type.Union(\n\t[\n\t\tType.String({ description: \"Load all resources from the package.\" }),\n\t\tType.Object({\n\t\t\tsource: Type.String(),\n\t\t\tautoload: Type.Optional(\n\t\t\t\tType.Boolean({ description: \"When false, start empty and only apply explicit resource patterns.\" }),\n\t\t\t),\n\t\t\textensions: Type.Optional(Type.Array(Type.String())),\n\t\t\tskills: Type.Optional(Type.Array(Type.String())),\n\t\t\tprompts: Type.Optional(Type.Array(Type.String())),\n\t\t\tthemes: Type.Optional(Type.Array(Type.String())),\n\t\t\tworkflows: Type.Optional(Type.Array(Type.String())),\n\t\t\tmcpServers: Type.Optional(Type.Array(Type.String())),\n\t\t}),\n\t],\n\t{\n\t\tdescription:\n\t\t\t\"Package source for npm or git packages. Use the string form to load all resources or the object form to filter resources.\",\n\t},\n);\n\nconst StringArraySchema = Type.Array(Type.String());\n\nconst SkillsInputSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object(\n\t\t\t{\n\t\t\t\tenableSkillCommands: Type.Optional(Type.Boolean()),\n\t\t\t\tcustomDirectories: Type.Optional(StringArraySchema),\n\t\t\t},\n\t\t\t{ deprecated: true },\n\t\t),\n\t],\n\t{ description: \"Local skill file paths or directories.\" },\n);\n\nconst WorkflowsSettingsSchema = Type.Union(\n\t[\n\t\tStringArraySchema,\n\t\tType.Object({\n\t\t\tpaths: Type.Optional(Type.Array(Type.String(), { description: \"Workflow resource paths.\" })),\n\t\t\tdurability: Type.Optional(\n\t\t\t\tType.Object(\n\t\t\t\t\t{\n\t\t\t\t\t\tpoolSize: Type.Optional(\n\t\t\t\t\t\t\tType.Integer({\n\t\t\t\t\t\t\t\tminimum: 2,\n\t\t\t\t\t\t\t\tdefault: 10,\n\t\t\t\t\t\t\t\tdescription: \"Maximum connections per workflow database pool (at least 2).\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsystemDatabaseUrl: Type.Optional(\n\t\t\t\t\t\t\tType.String({ description: \"PostgreSQL URL for the workflow database.\" }),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tsystemDatabaseUrlFile: Type.Optional(\n\t\t\t\t\t\t\tType.String({\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Read the PostgreSQL URL from a UTF-8 file instead of storing credentials in settings.\",\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdescription: \"Existing PostgreSQL database for durable workflows. Set only one URL source per scope.\",\n\t\t\t\t\t\tadditionalProperties: false,\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t),\n\t\t}),\n\t],\n\t{\n\t\tdescription: 'Local workflow paths, or an object with \"paths\" and \"durability\" for the workflow database.',\n\t},\n);\n\nexport const SettingsSchema = Type.Object(\n\t{\n\t\t$schema: Type.Optional(Type.String({ description: \"JSON Schema reference.\" })),\n\t\tlastChangelogVersion: Type.Optional(Type.String()),\n\t\tfirstRunOnboardingStartedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding state; leave unchanged.\" }),\n\t\t),\n\t\tonboardedVersion: Type.Optional(\n\t\t\tType.String({ description: \"Managed onboarding completion state; leave unchanged.\" }),\n\t\t),\n\t\tdefaultProvider: Type.Optional(Type.String()),\n\t\tdefaultModel: Type.Optional(Type.String()),\n\t\trouterModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Inference model for workflow-stage and subagent model: \"auto\" selection only. An exact provider/model selects a registered chat or classifier model; \"auto\" and an empty string use the current chat model.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.routerModel,\n\t\t\t}),\n\t\t),\n\t\tcompactionModel: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t'Compaction model: \"auto\" or an empty string uses the session model, and an exact provider/model selects a registered chat model, classifier, or compactor.',\n\t\t\t}),\n\t\t),\n\t\tmodelRouting: Type.Optional(ModelRoutingSettingsSchema),\n\t\tdefaultThinkingLevel: Type.Optional(ModelThinkingLevelSchema),\n\t\tmodelThinkingLevels: Type.Optional(\n\t\t\tType.Record(Type.String(), ModelThinkingLevelSchema, {\n\t\t\t\tdescription: 'Per-model default thinking level overrides keyed by \"provider/modelId\".',\n\t\t\t}),\n\t\t),\n\t\tfallbackModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Ordered main-chat fallback models, written as \"provider/model\" with an optional thinking-level suffix such as \":high\".',\n\t\t\t}),\n\t\t),\n\t\ttransport: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[Type.Literal(\"auto\"), Type.Literal(\"sse\"), Type.Literal(\"websocket\"), Type.Literal(\"websocket-cached\")],\n\t\t\t\t{ default: SETTINGS_DEFAULTS.transport },\n\t\t\t),\n\t\t),\n\t\tsteeringMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.steeringMode,\n\t\t\t}),\n\t\t),\n\t\tfollowUpMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdefault: SETTINGS_DEFAULTS.followUpMode,\n\t\t\t}),\n\t\t),\n\t\ttheme: Type.Optional(Type.String()),\n\t\tenableAnalytics: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Opt in to analytics data sharing. Storage only; Atomic does not transmit analytics.\",\n\t\t\t}),\n\t\t),\n\t\ttrackingId: Type.Optional(\n\t\t\tType.String({ description: \"Analytics tracking identifier, generated when analytics is enabled.\" }),\n\t\t),\n\t\tdeviceId: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Stable installation UUID, generated when authentication first needs it. Global only.\",\n\t\t\t}),\n\t\t),\n\t\tshowCacheMissNotices: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show cache cost and provider recovery notices.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.showCacheMissNotices,\n\t\t\t}),\n\t\t),\n\t\tcompaction: Type.Optional(CompactionSettingsSchema),\n\t\tbranchSummary: Type.Optional(BranchSummarySettingsSchema),\n\t\tsessionSummary: Type.Optional(SessionSummarySettingsSchema),\n\t\tretry: Type.Optional(RetrySettingsSchema),\n\t\thideThinkingBlock: Type.Optional(Type.Boolean({ default: SETTINGS_DEFAULTS.hideThinkingBlock })),\n\t\texternalEditor: Type.Optional(\n\t\t\tType.String({ description: \"Command for Ctrl+G external editor; takes precedence over VISUAL and EDITOR.\" }),\n\t\t),\n\t\tshellPath: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom shell path, for example for Cygwin on Windows, with support for leading ~ expansion.\",\n\t\t\t}),\n\t\t),\n\t\tquietStartup: Type.Optional(\n\t\t\tType.Union([Type.Boolean(), Type.Literal(\"header\")], {\n\t\t\t\tdescription: 'When true, hide all startup output. When \"header\", keep only the startup header.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.quietStartup,\n\t\t\t}),\n\t\t),\n\t\tdefaultProjectTrust: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"ask\"), Type.Literal(\"always\"), Type.Literal(\"never\")], {\n\t\t\t\tdescription: \"Global setting only.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.defaultProjectTrust,\n\t\t\t}),\n\t\t),\n\t\tshellCommandPrefix: Type.Optional(\n\t\t\tType.String({ description: \"Prefix prepended to every bash command, for example to enable shell aliases.\" }),\n\t\t),\n\t\tbashInterceptor: Type.Optional(BashInterceptorSettingsSchema),\n\t\tsearch: Type.Optional(SearchSettingsSchema),\n\t\tnpmCommand: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t'Command used for npm package lookup and installation, in argv form such as [\"mise\", \"exec\", \"node@20\", \"--\", \"npm\"].',\n\t\t\t}),\n\t\t),\n\t\tcollapseChangelog: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Show the condensed changelog after update; use /changelog for the full changelog.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.collapseChangelog,\n\t\t\t}),\n\t\t),\n\t\tenableInstallTelemetry: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Send an anonymous version-adoption ping on eligible interactive launches.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableInstallTelemetry,\n\t\t\t}),\n\t\t),\n\t\tpackages: Type.Optional(\n\t\t\tType.Array(PackageSourceSchema, {\n\t\t\t\tdescription: \"npm or git package sources, as strings or objects with resource filtering.\",\n\t\t\t}),\n\t\t),\n\t\textensions: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local extension file paths or directories.\" }),\n\t\t),\n\t\tskills: Type.Optional(SkillsInputSchema),\n\t\tprompts: Type.Optional(\n\t\t\tType.Array(Type.String(), { description: \"Local prompt template file paths or directories.\" }),\n\t\t),\n\t\tthemes: Type.Optional(Type.Array(Type.String(), { description: \"Local theme file paths or directories.\" })),\n\t\tworkflows: Type.Optional(WorkflowsSettingsSchema),\n\t\tenableSkillCommands: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Register skills as /skill:name commands.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.enableSkillCommands,\n\t\t\t}),\n\t\t),\n\t\tterminal: Type.Optional(TerminalSettingsSchema),\n\t\therdr: Type.Optional(HerdrSettingsSchema),\n\t\timages: Type.Optional(ImageSettingsSchema),\n\t\tenabledModels: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription: \"Model patterns for cycling, in the same format as the --models CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\tdefaultTools: Type.Optional(\n\t\t\tType.Array(Type.String(), {\n\t\t\t\tdescription:\n\t\t\t\t\t\"Initial tool selection. Plain names replace the inherited selection; +name and -name entries add or remove tools.\",\n\t\t\t}),\n\t\t),\n\t\tdoubleEscapeAction: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"fork\"), Type.Literal(\"tree\"), Type.Literal(\"none\")], {\n\t\t\t\tdescription: \"Action for double-escape with an empty editor.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.doubleEscapeAction,\n\t\t\t}),\n\t\t),\n\t\ttreeFilterMode: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[\n\t\t\t\t\tType.Literal(\"default\"),\n\t\t\t\t\tType.Literal(\"no-tools\"),\n\t\t\t\t\tType.Literal(\"user-only\"),\n\t\t\t\t\tType.Literal(\"labeled-only\"),\n\t\t\t\t\tType.Literal(\"all\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tdescription: \"Default filter when opening /tree.\",\n\t\t\t\t\tdefault: SETTINGS_DEFAULTS.treeFilterMode,\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\tthinkingBudgets: Type.Optional(\n\t\t\tthinkingBudgetsSettings({\n\t\t\t\tdescription: \"Custom token budgets for thinking levels.\",\n\t\t\t}),\n\t\t),\n\t\teditorPaddingX: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Horizontal padding for the input editor (0-3).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.editorPaddingX,\n\t\t\t}),\n\t\t),\n\t\toutputPad: Type.Optional(\n\t\t\tType.Union([Type.Literal(0), Type.Literal(1)], {\n\t\t\t\tdescription: \"Horizontal padding for transcript content.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.outputPad,\n\t\t\t}),\n\t\t),\n\t\tautocompleteMaxVisible: Type.Optional(\n\t\t\tType.Number({\n\t\t\t\tdescription: \"Maximum visible items in the autocomplete dropdown (3-20).\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.autocompleteMaxVisible,\n\t\t\t}),\n\t\t),\n\t\tshowHardwareCursor: Type.Optional(\n\t\t\tType.Boolean({ description: \"Show the terminal cursor while still positioning it for IME.\" }),\n\t\t),\n\t\tfullscreenScrollbar: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"always\"), Type.Literal(\"hidden\")], {\n\t\t\t\tdescription: \"Fullscreen transcript scrollbar visibility.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenScrollbar,\n\t\t\t}),\n\t\t),\n\t\tfullscreenExitOutput: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"transcript\"), Type.Literal(\"resume-hint\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t\"What the terminal keeps when a fullscreen session exits: the final transcript with a resume hint, or only the resume hint.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenExitOutput,\n\t\t\t}),\n\t\t),\n\t\tfullscreenCopyOnSelect: Type.Optional(\n\t\t\tType.Boolean({\n\t\t\t\tdescription: \"Copy fullscreen text selections automatically on mouse release.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenCopyOnSelect,\n\t\t\t}),\n\t\t),\n\t\tfullscreenWheelScrollLines: Type.Optional(\n\t\t\tType.Union([Type.Number(), Type.Literal(\"auto\")], {\n\t\t\t\tdescription: \"Lines scrolled per wheel event in fullscreen mode; numeric values are clamped from 1 to 100.\",\n\t\t\t\tdefault: SETTINGS_DEFAULTS.fullscreenWheelScrollLines,\n\t\t\t}),\n\t\t),\n\t\tcodemode: Type.Optional(CodemodeSettingsSchema),\n\t\tmarkdown: Type.Optional(MarkdownSettingsSchema),\n\t\twarnings: Type.Optional(WarningSettingsSchema),\n\t\tsessionDir: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription: \"Custom session storage directory, in the same format as the --session-dir CLI flag.\",\n\t\t\t}),\n\t\t),\n\t\thttpProxy: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Proxy URL applied as HTTP_PROXY and HTTPS_PROXY for Atomic-managed HTTP clients. Global only.\",\n\t\t\t}),\n\t\t),\n\t\thttpIdleTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'HTTP idle timeout as milliseconds, a duration such as \"30s\", \"5m\", or \"1h\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.httpIdleTimeoutMs,\n\t\t\t}),\n\t\t),\n\t\tcacheWarming: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"off\"), Type.Literal(\"streaming\"), Type.Literal(\"idle\")], {\n\t\t\t\tdescription:\n\t\t\t\t\t'Cache-warming profile. \"idle\" also warms between agent runs. Global only because each refresh costs money.',\n\t\t\t\tdefault: SETTINGS_DEFAULTS.cacheWarming,\n\t\t\t}),\n\t\t),\n\t\twebsocketConnectTimeoutMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'WebSocket connect or open handshake timeout as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tstreamDeadlineMs: Type.Optional(\n\t\t\ttimeoutSetting({\n\t\t\t\tdescription:\n\t\t\t\t\t'Maximum idle gap between two provider stream events as milliseconds, a duration such as \"30s\", or \"disabled\"; 0 or \"disabled\" disables it.',\n\t\t\t}),\n\t\t),\n\t\tqueueMode: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"all\"), Type.Literal(\"one-at-a-time\")], {\n\t\t\t\tdescription: \"Legacy setting migrated to steeringMode.\",\n\t\t\t\tdeprecated: true,\n\t\t\t}),\n\t\t),\n\t\twebsockets: Type.Optional(\n\t\t\tType.Boolean({ description: \"Legacy setting migrated to transport.\", deprecated: true }),\n\t\t),\n\t},\n\t{ additionalProperties: true },\n);\n\ntype SettingsInput = Static<typeof SettingsSchema>;\n\nexport interface CompactionModelOverride extends Static<typeof CompactionModelOverrideSchema> {}\nexport interface CompactionSettings extends Static<typeof CompactionSettingsSchema> {}\nexport interface BranchSummarySettings extends Static<typeof BranchSummarySettingsSchema> {}\nexport interface SessionSummarySettings extends Static<typeof SessionSummarySettingsSchema> {}\nexport interface ProviderRetrySettings extends Static<typeof ProviderRetrySettingsSchema> {}\nexport interface RetrySettings extends Omit<Static<typeof RetrySettingsSchema>, \"maxDelayMs\"> {}\nexport interface TerminalSettings extends Static<typeof TerminalSettingsSchema> {}\nexport interface ImageSettings extends Static<typeof ImageSettingsSchema> {}\nexport interface SearchSettings extends Static<typeof SearchSettingsSchema> {}\nexport interface BashInterceptorSettings extends Static<typeof BashInterceptorSettingsSchema> {}\nexport interface ModelRoutingSettings extends Static<typeof ModelRoutingSettingsSchema> {}\nexport interface ThinkingBudgetsSettings extends Static<typeof ThinkingBudgetsSettingsSchema> {}\nexport type MermaidRenderingMode = NonNullable<Static<typeof MarkdownSettingsSchema>[\"mermaid\"]>;\nexport interface MarkdownSettings extends Static<typeof MarkdownSettingsSchema> {}\nexport interface WarningSettings extends Static<typeof WarningSettingsSchema> {}\nexport type CodemodeMode = Static<typeof CodemodeModeSchema>;\nexport interface CodemodeSettings extends Static<typeof CodemodeSettingsSchema> {}\nexport type DefaultProjectTrust = NonNullable<SettingsInput[\"defaultProjectTrust\"]>;\nexport type QuietStartup = NonNullable<SettingsInput[\"quietStartup\"]>;\nexport type TransportSetting = NonNullable<SettingsInput[\"transport\"]>;\nexport type PackageSource = Static<typeof PackageSourceSchema>;\nexport type FullscreenExitOutput = NonNullable<SettingsInput[\"fullscreenExitOutput\"]>;\nexport type CacheWarmingMode = NonNullable<SettingsInput[\"cacheWarming\"]>;\nexport interface Settings extends Omit<SettingsInput, \"queueMode\" | \"retry\" | \"skills\" | \"websockets\"> {\n\tretry?: RetrySettings;\n\tskills?: string[];\n}\n"]}
|
package/docs/settings.md
CHANGED
|
@@ -572,12 +572,15 @@ Choose an existing PostgreSQL database in global or trusted project settings:
|
|
|
572
572
|
|---------|------|---------|-------------|
|
|
573
573
|
| `workflows.paths` | string[] | `[]` | Workflow resource paths in object-form settings; existing `workflows: [...]` settings remain supported |
|
|
574
574
|
| `workflows.durability.systemDatabaseUrl` | string | - | PostgreSQL URL for the workflow database |
|
|
575
|
+
| `workflows.durability.poolSize` | integer, at least 2 | `10` | Maximum connections per workflow database pool, for managed or remote PostgreSQL |
|
|
575
576
|
| `workflows.durability.systemDatabaseUrlFile` | string | - | Read the PostgreSQL URL from a UTF-8 file instead of storing credentials in settings |
|
|
576
577
|
|
|
577
578
|
Set only one URL source per scope. A project `durability` object replaces the global database selection; project settings are ignored unless trusted. Relative URL-file paths resolve beside the settings file that declares them: `~/.atomic/agent` for global settings and `.atomic` for project settings, or the matching `.pi` directory for inherited pi settings. Absolute paths and `~/` are supported. Protect credential files with permissions appropriate for your account, and do not commit them.
|
|
578
579
|
|
|
579
580
|
Precedence is nonempty `DBOS_SYSTEM_DATABASE_URL`, then settings, then managed embedded PostgreSQL with Docker as its provisioning fallback. URLs and file contents are trimmed. Invalid settings, including unrecognized `durability` keys, or missing, empty, or invalid URL files stop workflow initialization instead of silently choosing a local database. An explicit URL never starts managed PostgreSQL or Docker, even if the endpoint is unavailable. Existing non-durable fallback warnings still apply when DBOS cannot connect.
|
|
580
581
|
|
|
582
|
+
`poolSize` can be set without a URL, and still applies when `DBOS_SYSTEM_DATABASE_URL` supplies the URL. It is **per pool**, not a process-wide connection limit: each process opens at least two pools (DBOS SQL and the ownership fence), plus another fence pool after a recovery. The minimum is 2 because the ownership fence holds one long-lived advisory-lock connection and needs another for transactions. Lower it for hosted plans or poolers such as Neon, Supabase, or PgBouncer with low connection limits, or when many processes share one database. Raise it for one high-throughput process on a large database. Budget for all pools across all processes, and restart Atomic after changing the size.
|
|
583
|
+
|
|
581
584
|
Restart Atomic after changing the database selection. Selection takes effect on the first workflow action. Interactive and RPC sessions then report the selected provider and host without credentials; headless sessions report only a Docker fallback, on stderr. Changing databases does not migrate existing runs; use the original database to inspect or resume them. See [Durable workflows](/workflows/operations#durable-workflows-and-cross-session-resume).
|
|
582
585
|
|
|
583
586
|
#### packages
|
|
@@ -1388,7 +1388,7 @@ The public authoring declaration intentionally excludes runtime-only executor fi
|
|
|
1388
1388
|
```typescript
|
|
1389
1389
|
type WorkflowDurability =
|
|
1390
1390
|
| { readonly mode: "memory" }
|
|
1391
|
-
| { readonly mode: "durable"; readonly systemDatabaseUrl?: string };
|
|
1391
|
+
| { readonly mode: "durable"; readonly systemDatabaseUrl?: string; readonly poolSize?: number };
|
|
1392
1392
|
```
|
|
1393
1393
|
|
|
1394
1394
|
`run()` sets up workflow durability itself and shuts it down when the run ends, unless another Atomic session in the same process is still using it. `durability` chooses the backend for one call:
|
|
@@ -1397,9 +1397,12 @@ type WorkflowDurability =
|
|
|
1397
1397
|
- **`{ mode: "memory" }`:** runs with an in-memory backend that lasts only for this call. Postgres is never started, and nothing can be resumed after the process exits.
|
|
1398
1398
|
- **`{ mode: "durable" }`:** requires durable state and fails fast. If the backend can't start, or only an in-memory fallback is available, `run()` rejects with `WorkflowDurabilityRequiredError` before the workflow runs.
|
|
1399
1399
|
- **`{ mode: "durable", systemDatabaseUrl }`:** also chooses the Postgres database, for example a hosted one, and Atomic doesn't start or manage a local Postgres. `DBOS_SYSTEM_DATABASE_URL` overrides this value when set, so an operator can point a deployment at another database without changing code.
|
|
1400
|
+
- **`{ mode: "durable", poolSize }`:** sets the maximum connections per workflow database pool, with or without a URL, including when the URL comes from `DBOS_SYSTEM_DATABASE_URL`. Defaults to 10; must be an integer of at least 2 because an ownership pool holds one long-lived advisory-lock connection and needs another for transactions. Each process opens a DBOS SQL pool and an ownership-fence pool, plus another fence pool after recovery. Lower it for tight hosted connection limits or many processes; raise it for a high-throughput process on a large database.
|
|
1400
1401
|
|
|
1401
1402
|
One process uses one workflow database: DBOS runs a single executor per process, so a later run in the same process that asks for a different URL rejects. Separate processes are independent. The Atomic CLI and any number of SDK applications can each use their own database, or share one, including Atomic's managed Postgres. Each process only recovers its own interrupted runs, and an SDK process that exits doesn't stop the managed Postgres other processes are using.
|
|
1402
1403
|
|
|
1404
|
+
While DBOS remains configured, a request for a different `poolSize` rejects. Repeating the same size or omitting it keeps the current configuration.
|
|
1405
|
+
|
|
1403
1406
|
```ts
|
|
1404
1407
|
import { run, WorkflowDurabilityRequiredError } from "@bastani/atomic/workflows";
|
|
1405
1408
|
|