@kodizm/acp 0.5.5 → 0.5.7
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/README.md +4 -0
- package/dist/index.js +20 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -108,6 +108,7 @@ type NewSessionRequest = {
|
|
|
108
108
|
debugCaptureRpc?: boolean
|
|
109
109
|
heartbeatIntervalMs?: number
|
|
110
110
|
inactivityThresholdMs?: number
|
|
111
|
+
settingSources?: ('user' | 'project' | 'local')[] // claude only; opt-out
|
|
111
112
|
_meta?: Record<string, unknown> // passthrough; canonical fields rejected
|
|
112
113
|
}
|
|
113
114
|
```
|
|
@@ -115,6 +116,9 @@ type NewSessionRequest = {
|
|
|
115
116
|
> [!WARNING]
|
|
116
117
|
> `permissionTimeoutMs` and `permissionDeferTimeoutMs` are mutually exclusive. Pick hard-deny on timeout OR soft-defer on timeout, not both. The schema rejects the conflict with a clear error.
|
|
117
118
|
|
|
119
|
+
> [!NOTE]
|
|
120
|
+
> `settingSources` is the claude-only opt-out for filesystem config layering. When omitted the SDK's own default fires, matching the standalone Claude Code CLI: project `CLAUDE.md` + `.claude/CLAUDE.md` + `.claude/rules/*.md` load from `cwd` walking up; user `~/.claude/CLAUDE.md` + `~/.claude/rules/*.md` and `CLAUDE.local.md` load too. Pass `[]` to disable every fs scope; pass a selective subset like `['project']` to load only project-tracked files. Codex (`AGENTS.md` from `cwd`) and opencode (`AGENTS.md` / `CLAUDE.md` / `CONTEXT.md` from session `directory`) have no parallel field and ignore this option.
|
|
121
|
+
|
|
118
122
|
### Tool policy
|
|
119
123
|
|
|
120
124
|
```ts
|
package/dist/index.js
CHANGED
|
@@ -4813,7 +4813,8 @@ function translateMcpServers(servers) {
|
|
|
4813
4813
|
function buildSdkServer(server) {
|
|
4814
4814
|
const sdkServer = {
|
|
4815
4815
|
type: server.type,
|
|
4816
|
-
url: server.url
|
|
4816
|
+
url: server.url,
|
|
4817
|
+
alwaysLoad: true
|
|
4817
4818
|
};
|
|
4818
4819
|
if (server.headers !== undefined && server.headers.length > 0) {
|
|
4819
4820
|
const headers = {};
|
|
@@ -5491,13 +5492,15 @@ class ClaudeDriver {
|
|
|
5491
5492
|
DISABLE_AUTO_COMPACT: "1"
|
|
5492
5493
|
}
|
|
5493
5494
|
} : {};
|
|
5495
|
+
const settingSourcesOpt = "settingSources" in params && params.settingSources !== undefined ? { settingSources: [...params.settingSources] } : {};
|
|
5494
5496
|
return {
|
|
5495
5497
|
cwd: params.cwd,
|
|
5496
5498
|
mcpServers: translateMcpServers(params.mcpServers),
|
|
5497
5499
|
...additional,
|
|
5498
5500
|
...skills,
|
|
5499
5501
|
...policyOptions,
|
|
5500
|
-
...compactEnv
|
|
5502
|
+
...compactEnv,
|
|
5503
|
+
...settingSourcesOpt
|
|
5501
5504
|
};
|
|
5502
5505
|
}
|
|
5503
5506
|
buildSystemPrompt(input) {
|
|
@@ -36456,7 +36459,7 @@ class OpencodeDriver {
|
|
|
36456
36459
|
const bridge = this.bridgeFactory();
|
|
36457
36460
|
const handle = await bridge.start({ env });
|
|
36458
36461
|
const ruleset = buildOpencodeRuleset(params.toolPolicy);
|
|
36459
|
-
const createParams = {};
|
|
36462
|
+
const createParams = { directory: params.cwd };
|
|
36460
36463
|
if (ruleset.length > 0) {
|
|
36461
36464
|
createParams.permission = ruleset;
|
|
36462
36465
|
}
|
|
@@ -36691,7 +36694,7 @@ class OpencodeDriver {
|
|
|
36691
36694
|
const sessionApi = handle.sdk.session;
|
|
36692
36695
|
if (typeof sessionApi.get === "function") {
|
|
36693
36696
|
try {
|
|
36694
|
-
await sessionApi.get({ sessionID: meta.opencodeSessionId });
|
|
36697
|
+
await sessionApi.get({ sessionID: meta.opencodeSessionId, directory: params.cwd });
|
|
36695
36698
|
} catch (err) {
|
|
36696
36699
|
await bridge.stop().catch(() => {
|
|
36697
36700
|
return;
|
|
@@ -36719,7 +36722,10 @@ class OpencodeDriver {
|
|
|
36719
36722
|
if (typeof sessionApi.fork !== "function") {
|
|
36720
36723
|
throw new MethodNotSupportedError("session/fork", this.supportedMethodNames());
|
|
36721
36724
|
}
|
|
36722
|
-
const forkResult = await sessionApi.fork({
|
|
36725
|
+
const forkResult = await sessionApi.fork({
|
|
36726
|
+
sessionID: source.opencodeSessionId,
|
|
36727
|
+
directory: params.cwd
|
|
36728
|
+
});
|
|
36723
36729
|
const forkedOpencodeId = this.extractSessionId(forkResult);
|
|
36724
36730
|
this.sessions.set(newSessionId, {
|
|
36725
36731
|
sessionId: newSessionId,
|
|
@@ -36888,8 +36894,10 @@ var CANONICAL_FIELDS_BANNED_IN_META = [
|
|
|
36888
36894
|
"debugCaptureRawSdk",
|
|
36889
36895
|
"debugCaptureRpc",
|
|
36890
36896
|
"heartbeatIntervalMs",
|
|
36891
|
-
"inactivityThresholdMs"
|
|
36897
|
+
"inactivityThresholdMs",
|
|
36898
|
+
"settingSources"
|
|
36892
36899
|
];
|
|
36900
|
+
var SettingSourcesSchema = exports_external.array(exports_external.enum(["user", "project", "local"]));
|
|
36893
36901
|
var PermissionModeSchema = exports_external.enum(["default", "acceptEdits", "plan", "dontAsk", "bypassPermissions"]);
|
|
36894
36902
|
var ToolPolicySchema = exports_external.object({
|
|
36895
36903
|
allow: exports_external.array(exports_external.string()).optional(),
|
|
@@ -36930,6 +36938,7 @@ var NewSessionRequestSchema = exports_external.object({
|
|
|
36930
36938
|
debugCaptureRpc: exports_external.boolean().optional(),
|
|
36931
36939
|
heartbeatIntervalMs: exports_external.number().int().positive().optional(),
|
|
36932
36940
|
inactivityThresholdMs: exports_external.number().int().positive().optional(),
|
|
36941
|
+
settingSources: SettingSourcesSchema.optional(),
|
|
36933
36942
|
_meta: MetaSchema.optional()
|
|
36934
36943
|
}).refine(metaCarriesNoCanonicalFields, { message: META_SMUGGLE_MESSAGE, path: ["_meta"] }).refine((data) => !(data.permissionTimeoutMs !== undefined && data.permissionDeferTimeoutMs !== undefined), {
|
|
36935
36944
|
message: "permissionTimeoutMs and permissionDeferTimeoutMs are mutually exclusive (pick hard-deny on timeout OR soft-defer on timeout)",
|
|
@@ -36948,6 +36957,7 @@ var LoadSessionRequestSchema = exports_external.object({
|
|
|
36948
36957
|
sessionId: exports_external.string().min(1),
|
|
36949
36958
|
cwd: AbsolutePathSchema,
|
|
36950
36959
|
mcpServers: exports_external.array(McpServerSchema),
|
|
36960
|
+
settingSources: SettingSourcesSchema.optional(),
|
|
36951
36961
|
_meta: MetaSchema.optional()
|
|
36952
36962
|
}).refine(metaCarriesNoCanonicalFields, { message: META_SMUGGLE_MESSAGE, path: ["_meta"] });
|
|
36953
36963
|
var CompactSessionRequestSchema = exports_external.object({
|
|
@@ -36960,6 +36970,7 @@ var ForkSessionRequestSchema = exports_external.object({
|
|
|
36960
36970
|
systemPrompt: SystemPromptSchema.optional(),
|
|
36961
36971
|
model: exports_external.string().optional(),
|
|
36962
36972
|
additionalDirectories: exports_external.array(AbsolutePathSchema).optional(),
|
|
36973
|
+
settingSources: SettingSourcesSchema.optional(),
|
|
36963
36974
|
_meta: MetaSchema.optional()
|
|
36964
36975
|
}).refine(metaCarriesNoCanonicalFields, { message: META_SMUGGLE_MESSAGE, path: ["_meta"] });
|
|
36965
36976
|
|
|
@@ -37383,7 +37394,7 @@ async function buildClaudeBackend() {
|
|
|
37383
37394
|
const claudePath = process.env.CLAUDE_CODE_PATH ?? "/usr/local/bin/claude";
|
|
37384
37395
|
const driver = new ClaudeDriver2({
|
|
37385
37396
|
credentials: pickClaudeCredentials(process.env),
|
|
37386
|
-
agentInfo: { version: "0.5.
|
|
37397
|
+
agentInfo: { version: "0.5.6" },
|
|
37387
37398
|
sdk: {
|
|
37388
37399
|
async* query(args) {
|
|
37389
37400
|
const optsIn = args.options;
|
|
@@ -37391,7 +37402,6 @@ async function buildClaudeBackend() {
|
|
|
37391
37402
|
prompt: args.prompt,
|
|
37392
37403
|
options: {
|
|
37393
37404
|
...optsIn ?? {},
|
|
37394
|
-
settingSources: [],
|
|
37395
37405
|
pathToClaudeCodeExecutable: claudePath
|
|
37396
37406
|
}
|
|
37397
37407
|
};
|
|
@@ -37422,7 +37432,7 @@ async function bootBackend(kind) {
|
|
|
37422
37432
|
async function buildCodexBackend() {
|
|
37423
37433
|
const { CodexDriver: CodexDriver2 } = await Promise.resolve().then(() => (init_driver2(), exports_driver2));
|
|
37424
37434
|
const driver = new CodexDriver2({
|
|
37425
|
-
agentInfo: { version: "0.5.
|
|
37435
|
+
agentInfo: { version: "0.5.6" },
|
|
37426
37436
|
...process.env.CODEX_HOME === undefined ? {} : { codexHome: process.env.CODEX_HOME }
|
|
37427
37437
|
});
|
|
37428
37438
|
return { driver };
|
|
@@ -37430,7 +37440,7 @@ async function buildCodexBackend() {
|
|
|
37430
37440
|
async function buildOpencodeBackend() {
|
|
37431
37441
|
const { OpencodeDriver: OpencodeDriver2 } = await Promise.resolve().then(() => (init_driver3(), exports_driver3));
|
|
37432
37442
|
const driver = new OpencodeDriver2({
|
|
37433
|
-
agentInfo: { version: "0.5.
|
|
37443
|
+
agentInfo: { version: "0.5.6" }
|
|
37434
37444
|
});
|
|
37435
37445
|
return { driver };
|
|
37436
37446
|
}
|