@bridgebrew/harness-acp 0.0.1 → 0.0.2

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 (2) hide show
  1. package/package.json +1 -1
  2. package/server.ts +7 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bridgebrew/harness-acp",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "license": "MIT",
5
5
  "description": "Lets the harness run any agent that speaks the Agent Client Protocol, such as Hermes.",
6
6
  "keywords": [
package/server.ts CHANGED
@@ -173,6 +173,12 @@ const kindOf = (kind: unknown): 'allow' | 'deny' | 'other' =>
173
173
  : kind === 'reject_once' || kind === 'reject_always'
174
174
  ? 'deny'
175
175
  : 'other';
176
+ const scopeOf = (kind: unknown): { scope?: 'once' | 'always' } =>
177
+ kind === 'allow_once' || kind === 'reject_once'
178
+ ? { scope: 'once' }
179
+ : kind === 'allow_always' || kind === 'reject_always'
180
+ ? { scope: 'always' }
181
+ : {};
176
182
  const CANCELLED = { outcome: { outcome: 'cancelled' } };
177
183
  /** The longest `setTimeout` delay (2^31 - 1 ms); a longer one fires at once. */
178
184
  const TIMEOUT_MAX = 2_147_483_647;
@@ -591,6 +597,7 @@ export const acpDriver = (
591
597
  id: option.optionId,
592
598
  label: typeof option.name === 'string' ? option.name : option.optionId,
593
599
  kind: kindOf(option.kind),
600
+ ...scopeOf(option.kind),
594
601
  },
595
602
  ]
596
603
  : [],