@oneharness/sdk 0.17.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,11 @@ export interface SyncOptions {
6
6
  * Report what would change and write nothing.
7
7
  */
8
8
  check?: boolean | undefined;
9
- config?: string | undefined;
9
+ /**
10
+ * Load configuration from exactly these files, in order, skipping
11
+ * user/project discovery; each later file overrides the earlier ones.
12
+ */
13
+ config?: string[] | undefined;
10
14
  cwd?: string | undefined;
11
15
  /**
12
16
  * Hold each harness's allow/deny list to exactly the configured one:
@@ -16,5 +20,9 @@ export interface SyncOptions {
16
20
  exact?: boolean | undefined;
17
21
  global?: boolean | undefined;
18
22
  harnesses?: string[] | undefined;
23
+ /**
24
+ * Ignore every configuration file and `ONEHARNESS_*` override. `true`
25
+ * beside a non-empty `config` is refused before anything runs.
26
+ */
19
27
  noConfig?: boolean | undefined;
20
28
  }
@@ -6,10 +6,18 @@ export interface UsageOptions {
6
6
  bins?: {
7
7
  [k: string]: string;
8
8
  } | undefined;
9
- config?: string | undefined;
9
+ /**
10
+ * Load configuration from exactly these files, in order, skipping
11
+ * user/project discovery; each later file overrides the earlier ones.
12
+ */
13
+ config?: string[] | undefined;
10
14
  cwd?: string | undefined;
11
15
  exclude?: string[] | undefined;
12
16
  harnesses?: string[] | undefined;
17
+ /**
18
+ * Ignore every configuration file and `ONEHARNESS_*` override. `true`
19
+ * beside a non-empty `config` is refused before anything runs.
20
+ */
13
21
  noConfig?: boolean | undefined;
14
22
  timeoutSeconds?: number | undefined;
15
23
  }
@@ -34,7 +34,7 @@ export const BatchReportSchema = z.looseObject({
34
34
  });
35
35
  export const BatchStrategySchema = z.union([z.literal("speed"), z.literal("min-tokens")]);
36
36
  export const ConfigOptionsSchema = z.strictObject({
37
- config: z.string().optional(),
37
+ config: z.array(z.string()).optional(),
38
38
  cwd: z.string().optional(),
39
39
  noConfig: z.boolean().optional(),
40
40
  });
@@ -119,7 +119,7 @@ export const DetectInfoSchema = z.looseObject({
119
119
  export const DetectOptionsSchema = z.strictObject({
120
120
  all: z.boolean().optional(),
121
121
  bins: z.record(z.string(), z.string()).optional(),
122
- config: z.string().optional(),
122
+ config: z.array(z.string()).optional(),
123
123
  exclude: z.array(z.string()).optional(),
124
124
  harnesses: z.array(z.string()).optional(),
125
125
  noConfig: z.boolean().optional(),
@@ -319,7 +319,7 @@ export const HistoryClearDryRunSchema = z.looseObject({
319
319
  });
320
320
  export const HistoryClearOptionsSchema = z.strictObject({
321
321
  allProjects: z.boolean().optional(),
322
- config: z.string().optional(),
322
+ config: z.array(z.string()).optional(),
323
323
  historyDir: z.string().optional(),
324
324
  noConfig: z.boolean().optional(),
325
325
  project: z.string().optional(),
@@ -360,6 +360,17 @@ export const HistoryEventLineSchema = z.union([
360
360
  z.literal("1.9"),
361
361
  ])
362
362
  .refine((value) => value !== undefined, { message: "Required" }),
363
+ session_name: z
364
+ .union([
365
+ z
366
+ .string()
367
+ .min(1)
368
+ .refine((value) => !new RegExp("[^a-z0-9-]|^-|-$|--", "u").test(value), {
369
+ message: "Invalid string: must not contain [^a-z0-9-]|^-|-$|--",
370
+ }),
371
+ z.null(),
372
+ ])
373
+ .optional(),
363
374
  variant: z.union([z.string(), z.null()]).optional(),
364
375
  }),
365
376
  z.looseObject({
@@ -379,6 +390,17 @@ export const HistoryEventLineSchema = z.union([
379
390
  schema_version: z
380
391
  .union([z.literal("1.0"), z.literal("1.1")])
381
392
  .refine((value) => value !== undefined, { message: "Required" }),
393
+ session_name: z
394
+ .union([
395
+ z
396
+ .string()
397
+ .min(1)
398
+ .refine((value) => !new RegExp("[^a-z0-9-]|^-|-$|--", "u").test(value), {
399
+ message: "Invalid string: must not contain [^a-z0-9-]|^-|-$|--",
400
+ }),
401
+ z.null(),
402
+ ])
403
+ .optional(),
382
404
  variant: z.union([z.string(), z.null()]).optional(),
383
405
  }),
384
406
  ]);
@@ -419,6 +441,17 @@ export const HistoryLineSchema = z.union([
419
441
  z.literal("1.9"),
420
442
  ])
421
443
  .refine((value) => value !== undefined, { message: "Required" }),
444
+ session_name: z
445
+ .union([
446
+ z
447
+ .string()
448
+ .min(1)
449
+ .refine((value) => !new RegExp("[^a-z0-9-]|^-|-$|--", "u").test(value), {
450
+ message: "Invalid string: must not contain [^a-z0-9-]|^-|-$|--",
451
+ }),
452
+ z.null(),
453
+ ])
454
+ .optional(),
422
455
  type: z.literal("event").refine((value) => value !== undefined, { message: "Required" }),
423
456
  variant: z.union([z.string(), z.null()]).optional(),
424
457
  }),
@@ -439,6 +472,17 @@ export const HistoryLineSchema = z.union([
439
472
  schema_version: z
440
473
  .union([z.literal("1.0"), z.literal("1.1")])
441
474
  .refine((value) => value !== undefined, { message: "Required" }),
475
+ session_name: z
476
+ .union([
477
+ z
478
+ .string()
479
+ .min(1)
480
+ .refine((value) => !new RegExp("[^a-z0-9-]|^-|-$|--", "u").test(value), {
481
+ message: "Invalid string: must not contain [^a-z0-9-]|^-|-$|--",
482
+ }),
483
+ z.null(),
484
+ ])
485
+ .optional(),
442
486
  type: z.literal("event").refine((value) => value !== undefined, { message: "Required" }),
443
487
  variant: z.union([z.string(), z.null()]).optional(),
444
488
  }),
@@ -1090,7 +1134,7 @@ export const HistoryLineSchema = z.union([
1090
1134
  export const HistoryListSchema = z.array(z.lazy(() => HistorySessionSummarySchema));
1091
1135
  export const HistoryListOptionsSchema = z.strictObject({
1092
1136
  allProjects: z.boolean().optional(),
1093
- config: z.string().optional(),
1137
+ config: z.array(z.string()).optional(),
1094
1138
  historyDir: z.string().optional(),
1095
1139
  noConfig: z.boolean().optional(),
1096
1140
  project: z.string().optional(),
@@ -1103,7 +1147,7 @@ export const HistoryLookupSchema = z.union([
1103
1147
  export const HistoryLookupByLastSchema = z.strictObject({
1104
1148
  all: z.boolean().optional(),
1105
1149
  allProjects: z.boolean().optional(),
1106
- config: z.string().optional(),
1150
+ config: z.array(z.string()).optional(),
1107
1151
  historyDir: z.string().optional(),
1108
1152
  last: z.literal(true).refine((value) => value !== undefined, { message: "Required" }),
1109
1153
  noConfig: z.boolean().optional(),
@@ -1113,7 +1157,7 @@ export const HistoryLookupByLastSchema = z.strictObject({
1113
1157
  export const HistoryLookupBySessionSchema = z.strictObject({
1114
1158
  all: z.boolean().optional(),
1115
1159
  allProjects: z.boolean().optional(),
1116
- config: z.string().optional(),
1160
+ config: z.array(z.string()).optional(),
1117
1161
  historyDir: z.string().optional(),
1118
1162
  last: z.boolean().optional(),
1119
1163
  noConfig: z.boolean().optional(),
@@ -1124,7 +1168,7 @@ export const HistoryLookupBySessionSchema = z.strictObject({
1124
1168
  .refine((value) => value !== undefined, { message: "Required" }),
1125
1169
  });
1126
1170
  export const HistoryMigrateOptionsSchema = z.strictObject({
1127
- config: z.string().optional(),
1171
+ config: z.array(z.string()).optional(),
1128
1172
  historyDir: z.string().optional(),
1129
1173
  noConfig: z.boolean().optional(),
1130
1174
  });
@@ -1241,6 +1285,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.intersection(
1241
1285
  z.intersection(z.lazy(() => ActionEventSchema), z.looseObject({
1242
1286
  kind: z.literal("tool_result").optional(),
1243
1287
  })),
1288
+ z.intersection(z.lazy(() => ActionEventSchema), z.looseObject({
1289
+ kind: z.union([z.literal("message"), z.literal("reasoning")]).optional(),
1290
+ })),
1244
1291
  ])),
1245
1292
  z.null(),
1246
1293
  ])
@@ -1391,6 +1438,9 @@ export const HistoryRecordSchema = z.intersection(z.intersection(z.intersection(
1391
1438
  z.intersection(z.lazy(() => ActionEventSchema), z.looseObject({
1392
1439
  kind: z.literal("tool_result").optional(),
1393
1440
  })),
1441
+ z.intersection(z.lazy(() => ActionEventSchema), z.looseObject({
1442
+ kind: z.union([z.literal("message"), z.literal("reasoning")]).optional(),
1443
+ })),
1394
1444
  ]), z.looseObject({
1395
1445
  timing_source: z.never().optional(),
1396
1446
  }))),
@@ -2197,6 +2247,7 @@ export const HistorySessionSummarySchema = z.looseObject({
2197
2247
  .int()
2198
2248
  .gte(0)
2199
2249
  .refine((value) => value !== undefined, { message: "Required" }),
2250
+ running: z.boolean().optional(),
2200
2251
  started: z.string().refine((value) => value !== undefined, { message: "Required" }),
2201
2252
  });
2202
2253
  export const HistoryStreamEnvelopeSchema = z.union([
@@ -2217,12 +2268,24 @@ export const HistoryWatchOptionsSchema = z.strictObject({
2217
2268
  .refine((value) => [...value].length <= 36, { message: "Too long: expected at most 36 characters" })
2218
2269
  .optional(),
2219
2270
  allProjects: z.boolean().optional(),
2220
- config: z.string().optional(),
2271
+ config: z.array(z.string()).optional(),
2221
2272
  events: z.boolean().optional(),
2222
2273
  historyDir: z.string().optional(),
2223
2274
  labels: z.lazy(() => HistoryLabelsSchema).optional(),
2224
2275
  noConfig: z.boolean().optional(),
2225
2276
  project: z.string().optional(),
2277
+ session: z
2278
+ .union([
2279
+ z
2280
+ .string()
2281
+ .min(1)
2282
+ .regex(new RegExp("^(?:[a-z0-9-]+|[a-z0-9-]+-(?:[0-9]{4}(?:(?:0[13578]|1[02])(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)(?:0[1-9]|[12][0-9]|30)|02(?:0[1-9]|1[0-9]|2[0-8]))|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:[02468][048]|[13579][26])00)0229)T(?:[01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z-[0-9]+)$", "u"))
2283
+ .refine((value) => !new RegExp("[^A-Za-z0-9-]|^-|-$|--", "u").test(value), {
2284
+ message: "Invalid string: must not contain [^A-Za-z0-9-]|^-|-$|--",
2285
+ }),
2286
+ z.null(),
2287
+ ])
2288
+ .optional(),
2226
2289
  variant: z.string().optional(),
2227
2290
  });
2228
2291
  export const HookEntrySchema = z.strictObject({
@@ -2348,7 +2411,7 @@ export const RunOptionsSchema = z.strictObject({
2348
2411
  batchPrompts: z.array(z.string()).optional(),
2349
2412
  batchStrategy: z.lazy(() => BatchStrategySchema).optional(),
2350
2413
  bins: z.record(z.string(), z.string()).optional(),
2351
- config: z.string().optional(),
2414
+ config: z.array(z.string()).optional(),
2352
2415
  control: z.boolean().optional(),
2353
2416
  cwd: z.string().optional(),
2354
2417
  env: z.record(z.string(), z.string()).optional(),
@@ -2495,7 +2558,7 @@ export const StatusSchema = z.union([
2495
2558
  ]);
2496
2559
  export const SyncOptionsSchema = z.strictObject({
2497
2560
  check: z.boolean().optional(),
2498
- config: z.string().optional(),
2561
+ config: z.array(z.string()).optional(),
2499
2562
  cwd: z.string().optional(),
2500
2563
  exact: z.boolean().optional(),
2501
2564
  global: z.boolean().optional(),
@@ -2596,7 +2659,7 @@ export const UsageIdentitySchema = z.looseObject({
2596
2659
  export const UsageOptionsSchema = z.strictObject({
2597
2660
  all: z.boolean().optional(),
2598
2661
  bins: z.record(z.string(), z.string()).optional(),
2599
- config: z.string().optional(),
2662
+ config: z.array(z.string()).optional(),
2600
2663
  cwd: z.string().optional(),
2601
2664
  exclude: z.array(z.string()).optional(),
2602
2665
  harnesses: z.array(z.string()).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oneharness/sdk",
3
- "version": "0.17.1",
3
+ "version": "0.19.0",
4
4
  "description": "Typed Node.js SDK for oneharness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "node": ">=20"
20
20
  },
21
21
  "dependencies": {
22
- "oneharness-cli": "0.17.1",
22
+ "oneharness-cli": "0.19.0",
23
23
  "zod": "^4.4.3"
24
24
  }
25
25
  }