@ai-ecoverse/slicc-spectrum 1.82.0 → 1.84.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.
@@ -62,6 +62,23 @@ function guestFixtures(now2 = Date.now()) {
62
62
  }
63
63
  ];
64
64
  }
65
+ function guestAlways(now2 = Date.now()) {
66
+ return [
67
+ {
68
+ id: "guest-read",
69
+ kind: "guest-tool",
70
+ requester: mara,
71
+ agentId: "cone-sliccy",
72
+ agentName: "sliccy",
73
+ tool: "read_file",
74
+ summary: "/workspace/harbor/schedule.csv",
75
+ createdAt: now2,
76
+ expiresAt: now2 + 5 * minutes,
77
+ always: true,
78
+ verdict: { decision: "allow", reason: "it reads a file inside the shared folder." }
79
+ }
80
+ ];
81
+ }
65
82
  function approvalFixtures(scenario, now2 = Date.now()) {
66
83
  const agent = {
67
84
  id: "sudo-jq",
@@ -106,6 +123,7 @@ function approvalFixtures(scenario, now2 = Date.now()) {
106
123
  }
107
124
  ];
108
125
  if (scenario === "guest" || scenario === "guest-follower") return guestFixtures(now2);
126
+ if (scenario === "guest-always") return guestAlways(now2);
109
127
  if (scenario === "none") return [];
110
128
  if (scenario === "user") return [user];
111
129
  if (scenario === "many") return [agent, user, cache];
@@ -2008,6 +2026,7 @@ var minute = 6e4;
2008
2026
  var hour = 60 * minute;
2009
2027
  var day = 24 * hour;
2010
2028
  var guestDeclined = "It was declined.";
2029
+ var guestApproved = "It was approved.";
2011
2030
  var guestLabel = "Seat 2 (Mara)";
2012
2031
  var guestSettingsKey = "slicc-guest-settings";
2013
2032
  var otherGuest = "Seat 3 (Jonas)";
@@ -2197,6 +2216,7 @@ var DummyGuestAgent = class extends Emitter {
2197
2216
  #seat;
2198
2217
  #clock;
2199
2218
  #next = 1;
2219
+ #reviews = 0;
2200
2220
  constructor(cone, messages, seat, time, refused) {
2201
2221
  super();
2202
2222
  this.#cone = { ...cone };
@@ -2308,14 +2328,27 @@ var DummyGuestAgent = class extends Emitter {
2308
2328
  this.emit("messages", this.#cone.id);
2309
2329
  await this.#clock.sleep(60);
2310
2330
  this.#waiting = this.#waiting.filter((message) => message !== proposal);
2331
+ const approved = this.#reviews++ % 2 === 1;
2311
2332
  this.#post({
2312
2333
  id: proposal.id,
2313
2334
  role: "system",
2314
2335
  kind: "notice",
2315
- title: guestDeclined,
2336
+ title: approved ? guestApproved : guestDeclined,
2316
2337
  text,
2317
2338
  createdAt: Date.now()
2318
2339
  });
2340
+ if (approved) {
2341
+ this.#post({
2342
+ id: `guest-${this.#next++}`,
2343
+ role: "user",
2344
+ text,
2345
+ createdAt: Date.now(),
2346
+ origin: "guest",
2347
+ from: this.#seat.label,
2348
+ seat: this.#seat.id,
2349
+ delivered: "follow-up"
2350
+ });
2351
+ }
2319
2352
  }
2320
2353
  async send(agentId, input) {
2321
2354
  const text = (typeof input === "string" ? input : input.text).trim();
@@ -2407,6 +2440,10 @@ var day2 = 24 * hour2;
2407
2440
  var cap = 30 * day2;
2408
2441
  var guestsUnavailable = "Guests need the tray hub. Connect this SLICC to a tray to invite one.";
2409
2442
  var guestsRefused = "The hub couldn\u2019t make a link right now. Try again in a minute.";
2443
+ var guestsPolicy = {
2444
+ messages: ["user", "agent", "cone", "scoop:*", "off"],
2445
+ tools: ["user", "agent", "scoop:*", "off"]
2446
+ };
2410
2447
  function guestsFixtures(scenario, now2 = Date.now()) {
2411
2448
  if (scenario === "none" || scenario === "unavailable") return [];
2412
2449
  return [
@@ -2437,11 +2474,16 @@ var DummyGuests = class extends Emitter {
2437
2474
  #seats;
2438
2475
  #clock;
2439
2476
  #count = 0;
2477
+ gates;
2440
2478
  constructor(scenario, clock2) {
2441
2479
  super();
2442
2480
  this.scenario = scenario;
2443
2481
  this.#clock = clock2;
2444
2482
  this.#seats = guestsFixtures(scenario);
2483
+ this.#policy();
2484
+ }
2485
+ #policy() {
2486
+ this.gates = this.scenario === "policy" ? () => guestsPolicy : void 0;
2445
2487
  }
2446
2488
  list() {
2447
2489
  return this.#seats;
@@ -2452,6 +2494,7 @@ var DummyGuests = class extends Emitter {
2452
2494
  setScenario(scenario) {
2453
2495
  this.scenario = scenario;
2454
2496
  this.#seats = guestsFixtures(scenario);
2497
+ this.#policy();
2455
2498
  this.emit("unavailable", this.unavailable());
2456
2499
  this.emit("seats", this.#seats);
2457
2500
  }
@@ -7257,6 +7300,7 @@ export {
7257
7300
  createGuestModel,
7258
7301
  followFixtures,
7259
7302
  forecastSprinkle,
7303
+ guestApproved,
7260
7304
  guestDeclined,
7261
7305
  guestLabel,
7262
7306
  guestOnly,
@@ -7264,6 +7308,7 @@ export {
7264
7308
  guestSeat,
7265
7309
  guestTranscript,
7266
7310
  guestsFixtures,
7311
+ guestsPolicy,
7267
7312
  guestsRefused,
7268
7313
  guestsUnavailable,
7269
7314
  joinUrl,