@yaklabs-ai/plugin-sdk 0.11.0 → 0.12.3

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.
@@ -126,11 +126,22 @@ function unwired(name) {
126
126
  throw new Error(`${name} is not wired in this test double; pass your own handle to exercise it`);
127
127
  };
128
128
  }
129
+ var NOT_WIRED = async () => ({ ok: false, reason: "unavailable", message: "not wired" });
130
+ var UNWIRED_SURFACE = {
131
+ isAvailable: async () => false,
132
+ targets: NOT_WIRED,
133
+ observe: NOT_WIRED,
134
+ act: NOT_WIRED,
135
+ screenshot: NOT_WIRED,
136
+ open: NOT_WIRED
137
+ };
129
138
  function fauxKayAgentCapabilities() {
130
139
  return {
131
140
  filesystem: {
132
141
  readText: unwired("filesystem.readText"),
133
142
  writeText: unwired("filesystem.writeText"),
143
+ readBytes: unwired("filesystem.readBytes"),
144
+ writeBytes: unwired("filesystem.writeBytes"),
134
145
  mkdir: unwired("filesystem.mkdir"),
135
146
  readDir: unwired("filesystem.readDir"),
136
147
  stat: unwired("filesystem.stat"),
@@ -161,6 +172,9 @@ function fauxKayAgentCapabilities() {
161
172
  remove: unwired("whiteboard.remove")
162
173
  })
163
174
  },
175
+ // Answers `unavailable` rather than rejecting: the real surfaces report an unavailable
176
+ // surface as `{ ok: false }`, never a throw. A test driving one overrides this handle.
177
+ interaction: { browserPane: UNWIRED_SURFACE, desktop: UNWIRED_SURFACE },
164
178
  interceptToolCall: () => void 0,
165
179
  // The one handle that does NOT refuse on use. `withJev`'s contract is that it always produces
166
180
  // the baseline, so a rejecting double would make a plugin's Jev path untestable and teach the
@@ -171,7 +185,13 @@ function fauxKayAgentCapabilities() {
171
185
  // Accepts and drops, like the registrations above: the real `publish` never throws, so a
172
186
  // rejecting double would fail tests for a reason production never has. A test asserting what
173
187
  // its plugin publishes overrides this handle after the spread.
174
- events: { publish: () => void 0 }
188
+ events: { publish: () => void 0 },
189
+ // A test double has no user-time port, so it answers the zone as unknown — the same contract
190
+ // the real capability keeps for a zone the host cannot read. A test that exercises a plugin's
191
+ // zone-of-record path overrides this handle after the spread.
192
+ time: {
193
+ snapshot: () => ({ nowMs: 0, zone: "UTC", zoneSource: "utc-fallback" })
194
+ }
175
195
  };
176
196
  }
177
197
  function defaultTestToolContext() {