@amykit/agent-kit 0.7.1 → 0.8.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.
@@ -0,0 +1,21 @@
1
+ import { Harness } from "@amykit/core";
2
+ /** What one run was handed, as its own CLI reads what reached it. */
3
+ export type Granted = "write" | "read-only" | "nothing";
4
+ /**
5
+ * A harness over a seam its test watches. Only the harness's own test knows
6
+ * how its CLI spells writing, so it says what the last run was handed.
7
+ */
8
+ export interface HarnessUnderTest {
9
+ readonly harness: Harness;
10
+ granted(): Granted;
11
+ }
12
+ /**
13
+ * Asks a harness for one writing run and one read-only run, and says what
14
+ * each was handed that it should not have been. Empty when it conforms.
15
+ *
16
+ * A writing run with no way to write answers and changes nothing, which a
17
+ * step reads as done; a read-only run that may write is a discussion that
18
+ * edits the work. Both look like success from outside.
19
+ */
20
+ export declare function harnessConformance(make: () => HarnessUnderTest): Promise<string[]>;
21
+ //# sourceMappingURL=harness-conformance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-conformance.d.ts","sourceRoot":"","sources":["../src/harness-conformance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,qEAAqE;AACrE,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,SAAS,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,OAAO,IAAI,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CASxF"}
@@ -0,0 +1,32 @@
1
+ import os from "node:os";
2
+ /**
3
+ * Asks a harness for one writing run and one read-only run, and says what
4
+ * each was handed that it should not have been. Empty when it conforms.
5
+ *
6
+ * A writing run with no way to write answers and changes nothing, which a
7
+ * step reads as done; a read-only run that may write is a discussion that
8
+ * edits the work. Both look like success from outside.
9
+ */
10
+ export async function harnessConformance(make) {
11
+ const findings = [];
12
+ const writing = await granted(make(), false, findings);
13
+ if (writing !== undefined && writing !== "write") {
14
+ findings.push(`a writing run is handed ${writing === "nothing" ? "no way to write" : "only a way to read"}`);
15
+ }
16
+ const reading = await granted(make(), true, findings);
17
+ if (reading === "write")
18
+ findings.push("a read-only run is handed a way to write");
19
+ return findings;
20
+ }
21
+ async function granted(probe, readOnly, findings) {
22
+ try {
23
+ // A directory that exists: a harness that spawns its CLI runs it there.
24
+ await probe.harness.ask(readOnly ? "why did it fail?" : "change it", os.tmpdir(), readOnly ? { readOnly } : {});
25
+ }
26
+ catch (error) {
27
+ findings.push(`a ${readOnly ? "read-only" : "writing"} run threw: ${error instanceof Error ? error.message : String(error)}`);
28
+ return undefined;
29
+ }
30
+ return probe.granted();
31
+ }
32
+ //# sourceMappingURL=harness-conformance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"harness-conformance.js","sourceRoot":"","sources":["../src/harness-conformance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AAezB;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAA4B;IACnE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;IACvD,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACjD,QAAQ,CAAC,IAAI,CAAC,2BAA2B,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC/G,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;IACnF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,KAAK,UAAU,OAAO,CAAC,KAAuB,EAAE,QAAiB,EAAE,QAAkB;IACnF,IAAI,CAAC;QACH,wEAAwE;QACxE,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAClH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,eAAe,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC9H,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,EAAE,CAAC;AACzB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,4 +15,6 @@ export { contributeTiers, tierName } from "./tiers.js";
15
15
  export type { TierOptions } from "./tiers.js";
16
16
  export { contributeUsage, USAGE_COLLECTION } from "./usage.js";
17
17
  export type { UsageAvailable, UsageReader, UsageResult, UsageUnavailable, UsageWindow } from "./usage.js";
18
+ export { harnessConformance } from "./harness-conformance.js";
19
+ export type { Granted, HarnessUnderTest } from "./harness-conformance.js";
18
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,gBAAgB,E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AAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9E,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC9D,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -7,4 +7,5 @@ export { nextRung } from "./ladder.js";
7
7
  export { everyRung, oneLadder, rungsFor } from "./ladders.js";
8
8
  export { contributeTiers, tierName } from "./tiers.js";
9
9
  export { contributeUsage, USAGE_COLLECTION } from "./usage.js";
10
+ export { harnessConformance } from "./harness-conformance.js";
10
11
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names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6 +1,6 @@
1
1
  {
2
2
  "name": "@amykit/agent-kit",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "What every agent does the same way: the ladders, the handoffs, and steps built on ask that never touch git.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,7 +28,7 @@
28
28
  "dist"
29
29
  ],
30
30
  "dependencies": {
31
- "@amykit/core": "^0.7.1"
31
+ "@amykit/core": "^0.8.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@amykit/test-fixtures": "^0.1.0"