@yaklabs-ai/plugin-sdk 0.13.4 → 0.13.6

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.
@@ -1,15 +1,3 @@
1
- // packages/herd-agent/dist/core/tools/tool-parameters.js
2
- import { z } from "zod";
3
- var URI_PAYLOAD_MARKER = "x-kay-uri-payload";
4
- var uriPayloadSchema = z.union([
5
- z.string(),
6
- z.record(z.string(), z.unknown()),
7
- z.array(z.unknown()),
8
- z.number(),
9
- z.boolean(),
10
- z.null()
11
- ]).meta({ [URI_PAYLOAD_MARKER]: true });
12
-
13
1
  // packages/herd-uri/dist/produced-resources.js
14
2
  var PRODUCED_RESOURCES_DETAILS_KEY = "producedResources";
15
3
  var ABSENT = { kind: "absent" };
@@ -46,12 +34,12 @@ function readProducedResourceDeclarations(details) {
46
34
  return { kind: "declared", resources: claimed };
47
35
  }
48
36
 
49
- // packages/herd-agent/dist/core/is-object.js
37
+ // packages/plugin-primitives/dist/is-object.js
50
38
  function isObject(value) {
51
39
  return typeof value === "object" && value !== null && !Array.isArray(value);
52
40
  }
53
41
 
54
- // packages/herd-agent/dist/core/tools/produced-resources.js
42
+ // packages/plugin-primitives/dist/produced-resources.js
55
43
  var DECLARATIONS = Symbol.for("herd.producedResources.declarations");
56
44
  function recordProducedResources(details) {
57
45
  if (!isObject(details))
@@ -97,7 +85,7 @@ function jsonValue(value) {
97
85
  return `<${Array.isArray(value) ? "array" : typeof value}>`;
98
86
  }
99
87
 
100
- // packages/herd-agent/dist/testing.js
88
+ // packages/plugin-primitives/dist/testing.js
101
89
  function fauxAuthContext(overrides = {}) {
102
90
  return {
103
91
  async resolveToken() {
@@ -205,6 +193,42 @@ function fauxKayAgentCapabilities() {
205
193
  familyFolder: { path: async () => void 0 }
206
194
  };
207
195
  }
196
+ function createTestClock(startMs, options = {}) {
197
+ let nowMs = finiteMs(startMs, "startMs");
198
+ const { zone } = options;
199
+ if (zone !== void 0)
200
+ requireResolvedZone(zone);
201
+ return {
202
+ nowMs: () => nowMs,
203
+ snapshot: () => zone === void 0 ? { nowMs, zone: "UTC", zoneSource: "utc-fallback" } : { nowMs, zone, zoneSource: "host" },
204
+ advance(ms) {
205
+ nowMs += finiteMs(ms, "ms");
206
+ },
207
+ set(ms) {
208
+ nowMs = finiteMs(ms, "ms");
209
+ }
210
+ };
211
+ }
212
+ function requireResolvedZone(zone) {
213
+ let resolved;
214
+ try {
215
+ resolved = new Intl.DateTimeFormat("en-US", {
216
+ timeZone: zone
217
+ }).resolvedOptions().timeZone;
218
+ } catch {
219
+ resolved = void 0;
220
+ }
221
+ const ianaShaped = zone.includes("/") || zone === "UTC";
222
+ if (!ianaShaped || resolved !== zone) {
223
+ throw new RangeError(`createTestClock: zone ${JSON.stringify(zone)} is not a zone the host answers` + (resolved !== void 0 && ianaShaped ? `; the host spells it ${JSON.stringify(resolved)}` : ""));
224
+ }
225
+ }
226
+ function finiteMs(value, name) {
227
+ if (!Number.isFinite(value)) {
228
+ throw new RangeError(`createTestClock: ${name} must be a finite number, got ${String(value)}`);
229
+ }
230
+ return value;
231
+ }
208
232
  function defaultTestToolContext() {
209
233
  return { cwd: "/tmp", model: void 0 };
210
234
  }
@@ -221,6 +245,7 @@ function producedResourcesForTest(result) {
221
245
  return read;
222
246
  }
223
247
  export {
248
+ createTestClock,
224
249
  fauxAuthContext,
225
250
  fauxKayAgentCapabilities,
226
251
  invokeToolForTest,