@ai-sdk/harness-claude-code 1.0.173 → 1.0.175

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/harness-claude-code",
3
- "version": "1.0.173",
3
+ "version": "1.0.175",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -26,7 +26,7 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@ai-sdk/harness": "1.0.169",
29
+ "@ai-sdk/harness": "1.0.171",
30
30
  "@ai-sdk/provider": "4.0.35",
31
31
  "@ai-sdk/provider-utils": "5.0.72",
32
32
  "ws": "^8.21.0"
@@ -676,6 +676,13 @@ async function runTurn(start: StartMessage, turn: BridgeTurn): Promise<void> {
676
676
  deferredToolUseIds,
677
677
  nativeToolCallNames: streamEventState.nativeToolCallNames,
678
678
  });
679
+ const settings = {
680
+ ...(permissionOptions.settings as Record<string, unknown> | undefined),
681
+ ...(start.skillOverrides !== undefined
682
+ ? { skillOverrides: start.skillOverrides }
683
+ : {}),
684
+ ...(modelOverrides ? { modelOverrides } : {}),
685
+ };
679
686
  const questionPreToolUseHook = createQuestionPreToolUseHook({
680
687
  turn,
681
688
  emit,
@@ -772,16 +779,7 @@ async function runTurn(start: StartMessage, turn: BridgeTurn): Promise<void> {
772
779
  ? { continue: true }
773
780
  : {}),
774
781
  ...permissionOptions,
775
- ...(modelOverrides
776
- ? {
777
- settings: {
778
- ...(permissionOptions.settings as
779
- | Record<string, unknown>
780
- | undefined),
781
- modelOverrides,
782
- },
783
- }
784
- : {}),
782
+ ...(Object.keys(settings).length > 0 ? { settings } : {}),
785
783
  mcpServers,
786
784
  cwd: workdir,
787
785
  abortSignal: abortCtl.signal,
@@ -31,12 +31,18 @@ const thinkingSchema = z.discriminatedUnion('type', [
31
31
  z.object({ type: z.literal('disabled') }),
32
32
  ]);
33
33
 
34
+ const skillOverridesSchema = z.record(
35
+ z.string(),
36
+ z.enum(['on', 'name-only', 'user-invocable-only', 'off']),
37
+ );
38
+
34
39
  export const startMessageSchema = harnessV1BridgeStartBaseSchema.extend({
35
40
  prompt: harnessPromptContentSchema,
36
41
  instructions: z.string().optional(),
37
42
  thinking: thinkingSchema,
38
43
  effort: z.enum(['low', 'medium', 'high', 'xhigh', 'max']).optional(),
39
44
  maxTurns: z.number().optional(),
45
+ skillOverrides: skillOverridesSchema.optional(),
40
46
  maxBudgetUsd: z.number().optional(),
41
47
  strictMcpConfig: z.boolean().optional(),
42
48
  questionTimeoutMs: z.number().optional(),
@@ -121,6 +121,13 @@ export type ClaudeCodeHarnessSettings = {
121
121
  * back to the caller. Unset means the CLI's default.
122
122
  */
123
123
  readonly maxTurns?: number;
124
+ /**
125
+ * Overrides how named skills are exposed to Claude Code. Unspecified skills
126
+ * retain their Claude Code defaults.
127
+ */
128
+ readonly skillOverrides?: Readonly<
129
+ Record<string, 'on' | 'name-only' | 'user-invocable-only' | 'off'>
130
+ >;
124
131
  /**
125
132
  * Maximum estimated spend in USD for each Claude query. When it is exceeded,
126
133
  * the query stops and the turn ends with an error. Unset means no limit.
@@ -1096,6 +1103,7 @@ export function createClaudeCode(
1096
1103
  // sandbox is left running, stopped, or destroyed.
1097
1104
  proc: undefined,
1098
1105
  maxTurns: settings.maxTurns,
1106
+ skillOverrides: settings.skillOverrides,
1099
1107
  maxBudgetUsd: settings.maxBudgetUsd,
1100
1108
  strictMcpConfig: settings.strictMcpConfig,
1101
1109
  questionTimeoutMs: settings.questionTimeoutMs,
@@ -1271,6 +1279,7 @@ export function createClaudeCode(
1271
1279
  finishListenerAttachment,
1272
1280
  proc,
1273
1281
  maxTurns: settings.maxTurns,
1282
+ skillOverrides: settings.skillOverrides,
1274
1283
  maxBudgetUsd: settings.maxBudgetUsd,
1275
1284
  strictMcpConfig: settings.strictMcpConfig,
1276
1285
  questionTimeoutMs: settings.questionTimeoutMs,
@@ -1323,6 +1332,7 @@ function createSession({
1323
1332
  finishListenerAttachment,
1324
1333
  proc,
1325
1334
  maxTurns,
1335
+ skillOverrides,
1326
1336
  maxBudgetUsd,
1327
1337
  strictMcpConfig,
1328
1338
  questionTimeoutMs,
@@ -1356,6 +1366,7 @@ function createSession({
1356
1366
  /** Undefined on `attach` — the live bridge was spawned by another process. */
1357
1367
  proc: Experimental_SandboxProcess | undefined;
1358
1368
  maxTurns: number | undefined;
1369
+ skillOverrides: ClaudeCodeHarnessSettings['skillOverrides'];
1359
1370
  maxBudgetUsd: number | undefined;
1360
1371
  strictMcpConfig: boolean | undefined;
1361
1372
  questionTimeoutMs: number | undefined;
@@ -1644,6 +1655,7 @@ function createSession({
1644
1655
  : {}),
1645
1656
  model: promptOpts.model,
1646
1657
  maxTurns,
1658
+ ...(skillOverrides !== undefined ? { skillOverrides } : {}),
1647
1659
  ...(maxBudgetUsd !== undefined ? { maxBudgetUsd } : {}),
1648
1660
  ...(strictMcpConfig !== undefined ? { strictMcpConfig } : {}),
1649
1661
  ...(questionTimeoutMs !== undefined ? { questionTimeoutMs } : {}),
@@ -1722,6 +1734,7 @@ function createSession({
1722
1734
  : {}),
1723
1735
  model: continueOpts.model,
1724
1736
  maxTurns,
1737
+ ...(skillOverrides !== undefined ? { skillOverrides } : {}),
1725
1738
  ...(maxBudgetUsd !== undefined ? { maxBudgetUsd } : {}),
1726
1739
  ...(strictMcpConfig !== undefined ? { strictMcpConfig } : {}),
1727
1740
  ...(questionTimeoutMs !== undefined ? { questionTimeoutMs } : {}),