@goondan/openharness-base 0.1.7 → 0.1.8

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.
Files changed (78) hide show
  1. package/package.json +2 -2
  2. package/dist/extensions/compaction.d.ts +0 -12
  3. package/dist/extensions/compaction.d.ts.map +0 -1
  4. package/dist/extensions/compaction.js +0 -159
  5. package/dist/extensions/compaction.js.map +0 -1
  6. package/dist/extensions/context-message.d.ts +0 -9
  7. package/dist/extensions/context-message.d.ts.map +0 -1
  8. package/dist/extensions/context-message.js +0 -446
  9. package/dist/extensions/context-message.js.map +0 -1
  10. package/dist/extensions/index.d.ts +0 -13
  11. package/dist/extensions/index.d.ts.map +0 -1
  12. package/dist/extensions/index.js +0 -7
  13. package/dist/extensions/index.js.map +0 -1
  14. package/dist/extensions/logging.d.ts +0 -11
  15. package/dist/extensions/logging.d.ts.map +0 -1
  16. package/dist/extensions/logging.js +0 -140
  17. package/dist/extensions/logging.js.map +0 -1
  18. package/dist/extensions/message-window.d.ts +0 -7
  19. package/dist/extensions/message-window.d.ts.map +0 -1
  20. package/dist/extensions/message-window.js +0 -60
  21. package/dist/extensions/message-window.js.map +0 -1
  22. package/dist/extensions/required-tools-guard.d.ts +0 -9
  23. package/dist/extensions/required-tools-guard.d.ts.map +0 -1
  24. package/dist/extensions/required-tools-guard.js +0 -74
  25. package/dist/extensions/required-tools-guard.js.map +0 -1
  26. package/dist/extensions/tool-search.d.ts +0 -10
  27. package/dist/extensions/tool-search.d.ts.map +0 -1
  28. package/dist/extensions/tool-search.js +0 -198
  29. package/dist/extensions/tool-search.js.map +0 -1
  30. package/dist/harness.yaml +0 -503
  31. package/dist/index.d.ts +0 -84
  32. package/dist/index.d.ts.map +0 -1
  33. package/dist/index.js +0 -537
  34. package/dist/index.js.map +0 -1
  35. package/dist/manifests/base.d.ts +0 -8
  36. package/dist/manifests/base.d.ts.map +0 -1
  37. package/dist/manifests/base.js +0 -352
  38. package/dist/manifests/base.js.map +0 -1
  39. package/dist/manifests/index.d.ts +0 -3
  40. package/dist/manifests/index.d.ts.map +0 -1
  41. package/dist/manifests/index.js +0 -2
  42. package/dist/manifests/index.js.map +0 -1
  43. package/dist/tools/bash.d.ts +0 -8
  44. package/dist/tools/bash.d.ts.map +0 -1
  45. package/dist/tools/bash.js +0 -119
  46. package/dist/tools/bash.js.map +0 -1
  47. package/dist/tools/file-system.d.ts +0 -12
  48. package/dist/tools/file-system.d.ts.map +0 -1
  49. package/dist/tools/file-system.js +0 -117
  50. package/dist/tools/file-system.js.map +0 -1
  51. package/dist/tools/http-fetch.d.ts +0 -8
  52. package/dist/tools/http-fetch.d.ts.map +0 -1
  53. package/dist/tools/http-fetch.js +0 -149
  54. package/dist/tools/http-fetch.js.map +0 -1
  55. package/dist/tools/index.d.ts +0 -7
  56. package/dist/tools/index.d.ts.map +0 -1
  57. package/dist/tools/index.js +0 -7
  58. package/dist/tools/index.js.map +0 -1
  59. package/dist/tools/json-query.d.ts +0 -12
  60. package/dist/tools/json-query.d.ts.map +0 -1
  61. package/dist/tools/json-query.js +0 -176
  62. package/dist/tools/json-query.js.map +0 -1
  63. package/dist/tools/text-transform.d.ts +0 -16
  64. package/dist/tools/text-transform.d.ts.map +0 -1
  65. package/dist/tools/text-transform.js +0 -127
  66. package/dist/tools/text-transform.js.map +0 -1
  67. package/dist/tools/wait.d.ts +0 -6
  68. package/dist/tools/wait.d.ts.map +0 -1
  69. package/dist/tools/wait.js +0 -32
  70. package/dist/tools/wait.js.map +0 -1
  71. package/dist/types.d.ts +0 -4
  72. package/dist/types.d.ts.map +0 -1
  73. package/dist/types.js +0 -6
  74. package/dist/types.js.map +0 -1
  75. package/dist/utils.d.ts +0 -17
  76. package/dist/utils.d.ts.map +0 -1
  77. package/dist/utils.js +0 -159
  78. package/dist/utils.js.map +0 -1
package/dist/harness.yaml DELETED
@@ -1,503 +0,0 @@
1
- apiVersion: "goondan.ai/v1"
2
- kind: "Package"
3
- metadata:
4
- name: "@goondan/openharness-base"
5
- spec:
6
- version: "0.0.1-alpha4"
7
- ---
8
- apiVersion: "goondan.ai/v1"
9
- kind: "Tool"
10
- metadata:
11
- name: "bash"
12
- labels:
13
- tier: "base"
14
- spec:
15
- entry: "./dist/tools/bash.js"
16
- errorMessageLimit: 1200
17
- exports:
18
- -
19
- name: "exec"
20
- description: "Execute one shell command using /bin/sh -lc in the current instance workspace."
21
- parameters:
22
- type: "object"
23
- properties:
24
- command:
25
- type: "string"
26
- description: "Shell command string to execute."
27
- cwd:
28
- type: "string"
29
- description: "Optional working directory path relative to the instance workdir."
30
- timeoutMs:
31
- type: "number"
32
- description: "Maximum execution time in milliseconds (default: 30000)."
33
- env:
34
- type: "object"
35
- description: "Optional environment variable overrides merged with process.env before execution."
36
- additionalProperties: false
37
- required:
38
- - "command"
39
- -
40
- name: "script"
41
- description: "Run a script file from workdir with optional arguments and custom shell."
42
- parameters:
43
- type: "object"
44
- properties:
45
- path:
46
- type: "string"
47
- description: "Script file path relative to the instance workdir."
48
- args:
49
- type: "array"
50
- description: "Optional command-line arguments passed to the script in order."
51
- items:
52
- type: "string"
53
- description: "Single script argument value."
54
- shell:
55
- type: "string"
56
- description: "Shell binary path used to execute the script (default: /bin/bash)."
57
- timeoutMs:
58
- type: "number"
59
- description: "Maximum execution time in milliseconds (default: 30000)."
60
- env:
61
- type: "object"
62
- description: "Optional environment variable overrides merged with process.env before execution."
63
- additionalProperties: false
64
- required:
65
- - "path"
66
- ---
67
- apiVersion: "goondan.ai/v1"
68
- kind: "Tool"
69
- metadata:
70
- name: "wait"
71
- labels:
72
- tier: "base"
73
- spec:
74
- entry: "./dist/tools/wait.js"
75
- errorMessageLimit: 600
76
- exports:
77
- -
78
- name: "seconds"
79
- description: "Pause execution for the specified number of seconds"
80
- parameters:
81
- type: "object"
82
- properties:
83
- seconds:
84
- type: "number"
85
- description: "Seconds to wait (range: 0 to 300)."
86
- additionalProperties: false
87
- required:
88
- - "seconds"
89
- ---
90
- apiVersion: "goondan.ai/v1"
91
- kind: "Tool"
92
- metadata:
93
- name: "file-system"
94
- labels:
95
- tier: "base"
96
- spec:
97
- entry: "./dist/tools/file-system.js"
98
- errorMessageLimit: 2000
99
- exports:
100
- -
101
- name: "read"
102
- description: "Read file content from workdir"
103
- parameters:
104
- type: "object"
105
- properties:
106
- path:
107
- type: "string"
108
- description: "File path relative to workdir to read."
109
- maxBytes:
110
- type: "number"
111
- description: "Maximum bytes to return from file content (default: 100000)."
112
- additionalProperties: false
113
- required:
114
- - "path"
115
- -
116
- name: "write"
117
- description: "Write file content in workdir"
118
- parameters:
119
- type: "object"
120
- properties:
121
- path:
122
- type: "string"
123
- description: "File path relative to workdir to write. Parent directories are created automatically."
124
- content:
125
- type: "string"
126
- description: "UTF-8 text content to write."
127
- append:
128
- type: "boolean"
129
- description: "When true, append content instead of overwriting the file (default: false)."
130
- additionalProperties: false
131
- required:
132
- - "path"
133
- - "content"
134
- -
135
- name: "list"
136
- description: "List directory entries"
137
- parameters:
138
- type: "object"
139
- properties:
140
- path:
141
- type: "string"
142
- description: "Directory path relative to workdir (default: \".\")."
143
- recursive:
144
- type: "boolean"
145
- description: "When true, traverse subdirectories recursively (default: false)."
146
- includeDirs:
147
- type: "boolean"
148
- description: "Include directory entries in result (default: true)."
149
- includeFiles:
150
- type: "boolean"
151
- description: "Include file entries in result (default: true)."
152
- additionalProperties: false
153
- -
154
- name: "mkdir"
155
- description: "Create directory in workdir"
156
- parameters:
157
- type: "object"
158
- properties:
159
- path:
160
- type: "string"
161
- description: "Directory path relative to workdir to create."
162
- recursive:
163
- type: "boolean"
164
- description: "Create parent directories when missing (default: true)."
165
- additionalProperties: false
166
- required:
167
- - "path"
168
- ---
169
- apiVersion: "goondan.ai/v1"
170
- kind: "Tool"
171
- metadata:
172
- name: "http-fetch"
173
- labels:
174
- tier: "base"
175
- spec:
176
- entry: "./dist/tools/http-fetch.js"
177
- exports:
178
- -
179
- name: "get"
180
- description: "Perform HTTP GET request"
181
- parameters:
182
- type: "object"
183
- properties:
184
- url:
185
- type: "string"
186
- description: "HTTP/HTTPS URL to request."
187
- headers:
188
- type: "object"
189
- description: "Optional request headers object. Primitive values are stringified."
190
- timeoutMs:
191
- type: "number"
192
- description: "Request timeout in milliseconds (default: 30000)."
193
- maxBytes:
194
- type: "number"
195
- description: "Maximum response body bytes returned (default: 500000)."
196
- additionalProperties: false
197
- required:
198
- - "url"
199
- -
200
- name: "post"
201
- description: "Perform HTTP POST request"
202
- parameters:
203
- type: "object"
204
- properties:
205
- url:
206
- type: "string"
207
- description: "HTTP/HTTPS URL to request."
208
- body:
209
- type: "object"
210
- description: "JSON body object. When provided, it is stringified and content-type defaults to application/json."
211
- bodyString:
212
- type: "string"
213
- description: "Raw string request body. Ignored when body is provided."
214
- headers:
215
- type: "object"
216
- description: "Optional request headers object. Primitive values are stringified."
217
- timeoutMs:
218
- type: "number"
219
- description: "Request timeout in milliseconds (default: 30000)."
220
- maxBytes:
221
- type: "number"
222
- description: "Maximum response body bytes returned (default: 500000)."
223
- additionalProperties: false
224
- required:
225
- - "url"
226
- ---
227
- apiVersion: "goondan.ai/v1"
228
- kind: "Tool"
229
- metadata:
230
- name: "json-query"
231
- labels:
232
- tier: "base"
233
- spec:
234
- entry: "./dist/tools/json-query.js"
235
- exports:
236
- -
237
- name: "query"
238
- description: "Query JSON data by dot-notation path"
239
- parameters:
240
- type: "object"
241
- properties:
242
- data:
243
- type: "string"
244
- description: "Input JSON string to parse and query."
245
- path:
246
- type: "string"
247
- description: "Dot/bracket path expression. Defaults to \".\" for root."
248
- additionalProperties: false
249
- required:
250
- - "data"
251
- -
252
- name: "pick"
253
- description: "Pick specific keys from JSON object"
254
- parameters:
255
- type: "object"
256
- properties:
257
- data:
258
- type: "string"
259
- description: "Input JSON string expected to be an object."
260
- keys:
261
- type: "array"
262
- description: "Object keys to pick from parsed JSON object."
263
- items:
264
- type: "string"
265
- description: "Key name to pick."
266
- additionalProperties: false
267
- required:
268
- - "data"
269
- - "keys"
270
- -
271
- name: "count"
272
- description: "Count elements at a JSON path"
273
- parameters:
274
- type: "object"
275
- properties:
276
- data:
277
- type: "string"
278
- description: "Input JSON string to parse."
279
- path:
280
- type: "string"
281
- description: "Dot/bracket path expression to count at. Defaults to \".\" for root."
282
- additionalProperties: false
283
- required:
284
- - "data"
285
- -
286
- name: "flatten"
287
- description: "Flatten nested JSON arrays"
288
- parameters:
289
- type: "object"
290
- properties:
291
- data:
292
- type: "string"
293
- description: "Input JSON string expected to be an array."
294
- depth:
295
- type: "number"
296
- description: "Flatten depth level (default: 1)."
297
- additionalProperties: false
298
- required:
299
- - "data"
300
- ---
301
- apiVersion: "goondan.ai/v1"
302
- kind: "Tool"
303
- metadata:
304
- name: "text-transform"
305
- labels:
306
- tier: "base"
307
- spec:
308
- entry: "./dist/tools/text-transform.js"
309
- exports:
310
- -
311
- name: "replace"
312
- description: "Replace text occurrences"
313
- parameters:
314
- type: "object"
315
- properties:
316
- text:
317
- type: "string"
318
- description: "Source text to transform."
319
- search:
320
- type: "string"
321
- description: "Search string to find in text."
322
- replacement:
323
- type: "string"
324
- description: "Replacement string (default: empty string)."
325
- all:
326
- type: "boolean"
327
- description: "Replace all occurrences instead of first occurrence only."
328
- additionalProperties: false
329
- required:
330
- - "text"
331
- - "search"
332
- -
333
- name: "slice"
334
- description: "Extract substring by start/end positions"
335
- parameters:
336
- type: "object"
337
- properties:
338
- text:
339
- type: "string"
340
- description: "Source text to slice."
341
- start:
342
- type: "number"
343
- description: "Start index (default: 0)."
344
- end:
345
- type: "number"
346
- description: "Optional end index (exclusive)."
347
- additionalProperties: false
348
- required:
349
- - "text"
350
- -
351
- name: "split"
352
- description: "Split text by delimiter"
353
- parameters:
354
- type: "object"
355
- properties:
356
- text:
357
- type: "string"
358
- description: "Source text to split."
359
- delimiter:
360
- type: "string"
361
- description: "Delimiter string (default: newline)."
362
- maxParts:
363
- type: "number"
364
- description: "Optional maximum number of split parts to return."
365
- additionalProperties: false
366
- required:
367
- - "text"
368
- -
369
- name: "join"
370
- description: "Join array of strings with delimiter"
371
- parameters:
372
- type: "object"
373
- properties:
374
- parts:
375
- type: "array"
376
- description: "List of values to join into a single string."
377
- items:
378
- type:
379
- - "string"
380
- - "number"
381
- - "boolean"
382
- description: "Part value. Numbers/booleans are stringified before join."
383
- delimiter:
384
- type: "string"
385
- description: "Delimiter string inserted between parts (default: newline)."
386
- additionalProperties: false
387
- required:
388
- - "parts"
389
- -
390
- name: "trim"
391
- description: "Trim whitespace from text"
392
- parameters:
393
- type: "object"
394
- properties:
395
- text:
396
- type: "string"
397
- description: "Source text to trim."
398
- mode:
399
- type: "string"
400
- description: "Trim mode (default: both)."
401
- enum:
402
- - "start"
403
- - "end"
404
- - "both"
405
- additionalProperties: false
406
- required:
407
- - "text"
408
- -
409
- name: "case"
410
- description: "Transform text case (upper/lower)"
411
- parameters:
412
- type: "object"
413
- properties:
414
- text:
415
- type: "string"
416
- description: "Source text to transform."
417
- to:
418
- type: "string"
419
- description: "Target case transform mode."
420
- enum:
421
- - "upper"
422
- - "lower"
423
- additionalProperties: false
424
- required:
425
- - "text"
426
- - "to"
427
- ---
428
- apiVersion: "goondan.ai/v1"
429
- kind: "Extension"
430
- metadata:
431
- name: "logging"
432
- labels:
433
- tier: "base"
434
- spec:
435
- entry: "./dist/extensions/logging.js"
436
- config:
437
- level: "info"
438
- includeToolArgs: false
439
- ---
440
- apiVersion: "goondan.ai/v1"
441
- kind: "Extension"
442
- metadata:
443
- name: "message-compaction"
444
- labels:
445
- tier: "base"
446
- spec:
447
- entry: "./dist/extensions/compaction.js"
448
- config:
449
- maxMessages: 40
450
- maxCharacters: 12000
451
- retainLastMessages: 8
452
- mode: "remove"
453
- appendSummary: true
454
- ---
455
- apiVersion: "goondan.ai/v1"
456
- kind: "Extension"
457
- metadata:
458
- name: "message-window"
459
- labels:
460
- tier: "base"
461
- spec:
462
- entry: "./dist/extensions/message-window.js"
463
- config:
464
- maxMessages: 80
465
- ---
466
- apiVersion: "goondan.ai/v1"
467
- kind: "Extension"
468
- metadata:
469
- name: "tool-search"
470
- labels:
471
- tier: "base"
472
- spec:
473
- entry: "./dist/extensions/tool-search.js"
474
- config:
475
- toolName: "tool-search__search"
476
- maxResults: 10
477
- minQueryLength: 1
478
- persistSelection: true
479
- ---
480
- apiVersion: "goondan.ai/v1"
481
- kind: "Extension"
482
- metadata:
483
- name: "context-message"
484
- labels:
485
- tier: "base"
486
- spec:
487
- entry: "./dist/extensions/context-message.js"
488
- config:
489
- includeAgentPrompt: true
490
- includeRouteSummary: false
491
- includeInboundInput: true
492
- ---
493
- apiVersion: "goondan.ai/v1"
494
- kind: "Extension"
495
- metadata:
496
- name: "required-tools-guard"
497
- labels:
498
- tier: "base"
499
- spec:
500
- entry: "./dist/extensions/required-tools-guard.js"
501
- config:
502
- requiredTools: []
503
- errorMessage: ""
package/dist/index.d.ts DELETED
@@ -1,84 +0,0 @@
1
- import { Extension, LlmChatOptions, Message, ToolDefinition } from '@goondan/openharness-types';
2
-
3
- /**
4
- * BasicSystemPrompt extension — prepends a system message to the conversation
5
- * at the start of every turn.
6
- *
7
- * Uses a fixed message ID so the system prompt is only appended once;
8
- * subsequent turns detect the existing message and skip the append.
9
- *
10
- * Priority 10 (HIGH) ensures it runs before other turn middleware.
11
- */
12
- declare function BasicSystemPrompt(text: string): Extension;
13
-
14
- /**
15
- * MessageWindow extension — truncates conversation history to keep only
16
- * the most recent `maxMessages` messages before each step.
17
- */
18
- declare function MessageWindow(config: {
19
- maxMessages: number;
20
- }): Extension;
21
-
22
- /**
23
- * CompactionSummarize extension — when message count exceeds `threshold`,
24
- * removes the oldest messages and replaces them with an LLM-generated summary.
25
- *
26
- * By default, uses the agent's own LLM (`ctx.llm`) to produce the summary.
27
- * A custom `summarizer` callback can override this for advanced use cases
28
- * (e.g. using a cheaper model, external API, or deterministic logic).
29
- *
30
- * @param config.threshold - Trigger compaction when messages exceed this count.
31
- * @param config.summaryPrompt - Custom system prompt for the LLM summarizer.
32
- * @param config.summarizer - Optional override: produce summary text from messages.
33
- */
34
- declare function CompactionSummarize(config: {
35
- threshold: number;
36
- summaryPrompt?: string;
37
- /** LLM options for the summarization call (e.g. model override for cheaper summarization). */
38
- llmOptions?: LlmChatOptions;
39
- summarizer?: (messages: Message[]) => Promise<string>;
40
- }): Extension;
41
-
42
- /**
43
- * Logging extension — subscribes to core events and logs them.
44
- */
45
- declare function Logging(config?: {
46
- logger?: (msg: string) => void;
47
- }): Extension;
48
-
49
- /**
50
- * ToolSearch extension — registers a meta-tool `search_tools` that searches
51
- * registered tool names and descriptions by keyword.
52
- */
53
- declare function ToolSearch(): Extension;
54
-
55
- /**
56
- * RequiredToolsGuard extension — blocks a turn if any required tools are
57
- * not registered.
58
- */
59
- declare function RequiredToolsGuard(config: {
60
- tools: string[];
61
- }): Extension;
62
-
63
- interface BashToolConfig {
64
- timeout?: number;
65
- maxBuffer?: number;
66
- }
67
- declare function BashTool(config?: BashToolConfig): ToolDefinition;
68
-
69
- declare function FileReadTool(): ToolDefinition;
70
- declare function FileWriteTool(): ToolDefinition;
71
- declare function FileListTool(): ToolDefinition;
72
-
73
- declare function HttpFetchTool(): ToolDefinition;
74
-
75
- declare function JsonQueryTool(): ToolDefinition;
76
-
77
- declare function TextTransformTool(): ToolDefinition;
78
-
79
- interface WaitToolConfig {
80
- maxMs?: number;
81
- }
82
- declare function WaitTool(config?: WaitToolConfig): ToolDefinition;
83
-
84
- export { BashTool, type BashToolConfig, BasicSystemPrompt, CompactionSummarize, FileListTool, FileReadTool, FileWriteTool, HttpFetchTool, JsonQueryTool, Logging, MessageWindow, RequiredToolsGuard, TextTransformTool, ToolSearch, WaitTool, type WaitToolConfig };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAE3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}