@vibest/cli 0.0.2-beta.2 → 0.0.2-beta.4

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.
@@ -15720,6 +15720,11 @@ var makeUnsafe6 = (value) => {
15720
15720
  var make24 = (value) => sync2(() => makeUnsafe6(value));
15721
15721
  var get2 = (self) => sync2(() => self.ref.current);
15722
15722
  var set2 = /* @__PURE__ */ dual(2, (self, value) => sync2(() => set(self.ref, value)));
15723
+ var getAndSet = /* @__PURE__ */ dual(2, (self, value) => sync2(() => {
15724
+ const current = self.ref.current;
15725
+ self.ref.current = value;
15726
+ return current;
15727
+ }));
15723
15728
  // ../../schema/src/plugin.ts
15724
15729
  class AgentRefused extends TaggedError3()("AgentRefused", {
15725
15730
  plugin: String4,
@@ -15730,9 +15735,6 @@ class AgentRefused extends TaggedError3()("AgentRefused", {
15730
15735
  }
15731
15736
  }
15732
15737
 
15733
- class HookFailed extends TaggedError3()("HookFailed", { message: String4 }) {
15734
- }
15735
-
15736
15738
  class PluginsNotActive extends TaggedError3()("PluginsNotActive", {
15737
15739
  plugins: ArraySchema(String4)
15738
15740
  }) {
@@ -15797,7 +15799,9 @@ var SessionCreated = fact("session.created", "session", {
15797
15799
  name: Text,
15798
15800
  directory: String4,
15799
15801
  parent: optional3(Text),
15800
- origin: optional3(Struct({ peer: Text, project: Text, session: optional3(Text) }))
15802
+ origin: optional3(Struct({ peer: Text, project: Text, session: optional3(Text) })),
15803
+ message: optional3(Seq),
15804
+ team: optional3(Text)
15801
15805
  });
15802
15806
  var SessionRenamed = fact("session.renamed", "session", { name: Text });
15803
15807
  var SessionDirectoryChanged = fact("session.directory_changed", "session", { directory: Text });
@@ -15820,51 +15824,117 @@ var ProcessReady = fact("process.ready", "session", {
15820
15824
  });
15821
15825
  var ProcessPid = fact("process.pid", "session", { process: Seq, pid: Pid });
15822
15826
  var ProcessConversation = fact("process.conversation", "session", { process: Seq, conversation: Text });
15827
+ var AgentFrom = Struct({
15828
+ session: String4,
15829
+ agent: optional3(String4),
15830
+ title: optional3(String4),
15831
+ machine: optional3(String4)
15832
+ });
15833
+ var AgentSender = Struct({ type: Literal2("agent"), ...AgentFrom.fields });
15834
+ var PluginSender = Struct({ type: Literal2("plugin"), plugin: Text });
15835
+ var Sender2 = Union2([
15836
+ AgentSender,
15837
+ PluginSender,
15838
+ Struct({ type: Literal2("vibest") }),
15839
+ Struct({ type: Literal2("user") })
15840
+ ]);
15823
15841
  var ProcessEndReason = Literals([
15824
15842
  "exited",
15825
- "limited",
15826
15843
  "restart",
15827
15844
  "move",
15828
15845
  "archived",
15829
15846
  "launch_failed",
15830
- "superseded"
15847
+ "superseded",
15848
+ "stopped"
15831
15849
  ]);
15832
- var ProcessEnded = fact("process.ended", "session", { process: Seq, reason: ProcessEndReason });
15833
- var ExecutionStarted = fact("execution.started", "session", {
15834
- process: optional3(Seq),
15850
+ var ProcessEnded = fact("process.ended", "session", {
15851
+ process: Seq,
15852
+ reason: ProcessEndReason,
15853
+ by: optional3(Sender2)
15854
+ });
15855
+ var ExecutionOutcome = Literals(["completed", "failed", "interrupted", "lost", "not_started"]);
15856
+ var ExecutionObservation = Literals(["lost", "not_started"]);
15857
+ var ExecutionFailure = Struct({
15858
+ message: Text,
15859
+ kind: optional3(Literal2("limit")),
15860
+ resetAt: optional3(Number5)
15861
+ });
15862
+ var ExecutionAllocated = fact("execution.allocated", "session", {
15863
+ executionId: Seq,
15864
+ processId: optional3(Seq),
15835
15865
  typed: optional3(Text)
15836
15866
  });
15837
15867
  var ExecutionAccepted = fact("execution.accepted", "session", { execution: Seq });
15838
- var ExecutionOutcome = Literals(["completed", "failed", "interrupted", "lost", "not_started"]);
15839
- var ExecutionEnded = fact("execution.ended", "session", {
15840
- execution: Seq,
15841
- outcome: ExecutionOutcome,
15842
- failure: optional3(Struct({ message: Text, kind: optional3(Literal2("limit")) })),
15843
- conversation: optional3(Text),
15868
+ var ExecutionStarted = fact("execution.started", "session", {
15869
+ executionId: Seq,
15870
+ processId: optional3(Seq)
15871
+ });
15872
+ var ExecutionSucceeded = fact("execution.succeeded", "session", {
15873
+ executionId: Seq,
15844
15874
  reply: optional3(String4)
15845
15875
  });
15846
- var InboxKind = Literals(["task", "send", "notice"]);
15847
- var Sender2 = Struct({
15848
- session: String4,
15849
- agent: optional3(String4),
15850
- title: optional3(String4),
15851
- machine: optional3(String4)
15876
+ var ExecutionFailed = fact("execution.failed", "session", {
15877
+ executionId: Seq,
15878
+ failure: ExecutionFailure,
15879
+ reply: optional3(String4)
15852
15880
  });
15853
- var InboxQueued = fact("inbox.queued", "session", {
15854
- kind: InboxKind,
15855
- recipient: optional3(Text),
15856
- sender: optional3(Text),
15857
- from: optional3(Sender2),
15881
+ var ExecutionInterrupted = fact("execution.interrupted", "session", {
15882
+ executionId: Seq,
15883
+ reason: optional3(Text),
15884
+ reply: optional3(String4)
15885
+ });
15886
+ var ExecutionUnresolved = fact("execution.unresolved", "session", {
15887
+ executionId: Seq,
15888
+ observation: ExecutionObservation,
15889
+ failure: optional3(ExecutionFailure),
15890
+ reply: optional3(String4)
15891
+ });
15892
+ var ExecutionInput = fact("execution.input", "session", {
15893
+ executionId: Seq,
15894
+ typed: Text
15895
+ });
15896
+ var InboxHistory = Literals([
15897
+ "route",
15898
+ "delivered_without_execution",
15899
+ "failed_unspecified",
15900
+ "unconfirmed",
15901
+ "released"
15902
+ ]);
15903
+ var InboxEnqueued = fact("inbox.enqueued", "session", {
15904
+ sender: Sender2,
15858
15905
  content: String4,
15859
- status: Literals(["pending", "delivered", "dropped"]),
15860
- request: optional3(Text),
15861
- peerItem: optional3(Text)
15906
+ senderExecutionId: optional3(Seq),
15907
+ requestId: optional3(Text),
15908
+ transferId: optional3(Text),
15909
+ aboutSessionId: optional3(Text)
15862
15910
  });
15863
- var InboxMoved = fact("inbox.moved", "session", {
15864
- inbox: Seq,
15865
- to: Literals(["pending", "delivering", "delivered", "failed", "dropped"]),
15911
+ var InboxDeliveryStarted = fact("inbox.delivery_started", "session", {
15912
+ messageId: Seq,
15866
15913
  execution: optional3(Seq)
15867
15914
  });
15915
+ var InboxDelivered = fact("inbox.delivered", "session", {
15916
+ messageId: Seq,
15917
+ recipientExecutionId: Seq
15918
+ });
15919
+ var InboxDeliveryFailed = fact("inbox.delivery_failed", "session", {
15920
+ messageId: Seq,
15921
+ reason: Text
15922
+ });
15923
+ var InboxDropped = fact("inbox.dropped", "session", {
15924
+ messageId: Seq,
15925
+ reason: Text
15926
+ });
15927
+ var InboxUnresolved = fact("inbox.unresolved", "session", {
15928
+ history: InboxHistory,
15929
+ messageId: optional3(Seq),
15930
+ execution: optional3(Seq),
15931
+ sender: optional3(Sender2),
15932
+ content: optional3(String4),
15933
+ senderExecutionId: optional3(Seq),
15934
+ requestId: optional3(Text),
15935
+ transferId: optional3(Text),
15936
+ aboutSessionId: optional3(Text)
15937
+ });
15868
15938
  var MachineAdded = fact("machine.added", "ledger", { name: Text, target: Text, vibestd: Text });
15869
15939
  var MachineConnected = fact("machine.connected", "ledger", { name: Text });
15870
15940
  var MachineRemoved = fact("machine.removed", "ledger", { name: Text });
@@ -15876,7 +15946,8 @@ var OutboxQueued = fact("outbox.queued", "ledger", {
15876
15946
  recipient: optional3(Text),
15877
15947
  kind: optional3(Literals(["send", "notice"])),
15878
15948
  content: String4,
15879
- from: optional3(Sender2)
15949
+ from: optional3(AgentFrom),
15950
+ execution: optional3(Seq)
15880
15951
  });
15881
15952
  var OutboxAcked = fact("outbox.acked", "ledger", { peer: Text, ids: NonEmptyArray(Text) });
15882
15953
  var Catalog = {
@@ -15894,11 +15965,20 @@ var Catalog = {
15894
15965
  [ProcessPid.type]: ProcessPid,
15895
15966
  [ProcessConversation.type]: ProcessConversation,
15896
15967
  [ProcessEnded.type]: ProcessEnded,
15897
- [ExecutionStarted.type]: ExecutionStarted,
15968
+ [ExecutionAllocated.type]: ExecutionAllocated,
15898
15969
  [ExecutionAccepted.type]: ExecutionAccepted,
15899
- [ExecutionEnded.type]: ExecutionEnded,
15900
- [InboxQueued.type]: InboxQueued,
15901
- [InboxMoved.type]: InboxMoved,
15970
+ [ExecutionStarted.type]: ExecutionStarted,
15971
+ [ExecutionSucceeded.type]: ExecutionSucceeded,
15972
+ [ExecutionFailed.type]: ExecutionFailed,
15973
+ [ExecutionInterrupted.type]: ExecutionInterrupted,
15974
+ [ExecutionUnresolved.type]: ExecutionUnresolved,
15975
+ [ExecutionInput.type]: ExecutionInput,
15976
+ [InboxEnqueued.type]: InboxEnqueued,
15977
+ [InboxDeliveryStarted.type]: InboxDeliveryStarted,
15978
+ [InboxDelivered.type]: InboxDelivered,
15979
+ [InboxDeliveryFailed.type]: InboxDeliveryFailed,
15980
+ [InboxDropped.type]: InboxDropped,
15981
+ [InboxUnresolved.type]: InboxUnresolved,
15902
15982
  [MachineAdded.type]: MachineAdded,
15903
15983
  [MachineConnected.type]: MachineConnected,
15904
15984
  [MachineRemoved.type]: MachineRemoved,
@@ -15926,7 +16006,7 @@ var ExecutionState = Literals([
15926
16006
  "lost",
15927
16007
  "not_started"
15928
16008
  ]);
15929
- var InboxStatus = Literals(["pending", "delivering", "delivered", "failed", "dropped"]);
16009
+ var InboxStatus = Literals(["pending", "delivering", "delivered", "failed", "dropped", "unresolved"]);
15930
16010
  var RuntimeAddress = Struct({
15931
16011
  machine: String4,
15932
16012
  id: String4
@@ -15941,30 +16021,13 @@ var RuntimeMachine = Struct({
15941
16021
  });
15942
16022
  var InboxRow = Struct({
15943
16023
  id: Number5,
15944
- sender: NullOr(String4),
15945
- from: NullOr(Sender2),
16024
+ sender: Sender2,
15946
16025
  recipient: NullOr(String4),
15947
- kind: InboxKind,
15948
16026
  message: String4,
15949
16027
  status: InboxStatus
15950
16028
  });
15951
16029
  var Detail = Struct({
15952
- sender: Union2([
15953
- Struct({
15954
- agent: String4,
15955
- title: String4,
15956
- session: String4,
15957
- machine: String4
15958
- }),
15959
- Struct({
15960
- agent: String4,
15961
- title: String4,
15962
- session: String4
15963
- }),
15964
- Struct({ address: String4 }),
15965
- Literal2("vibest"),
15966
- Literal2("user")
15967
- ]),
16030
+ sender: Sender2,
15968
16031
  message: String4
15969
16032
  });
15970
16033
  var Taken = Struct({
@@ -16025,12 +16088,6 @@ class SessionBusy extends TaggedError3()("SessionBusy", {
16025
16088
  }) {
16026
16089
  }
16027
16090
 
16028
- class LimitReached extends TaggedError3()("LimitReached", { limit: Number5 }) {
16029
- get message() {
16030
- return `VIBEST_MAX_SESSIONS=${this.limit} sessions are already open (working or kept); vibest archive one first`;
16031
- }
16032
- }
16033
-
16034
16091
  class NotReady extends TaggedError3()("NotReady", {
16035
16092
  id: String4,
16036
16093
  message: String4
@@ -16045,9 +16102,12 @@ class NoCallingSession extends TaggedError3()("NoCallingSession", {}) {
16045
16102
 
16046
16103
  class UnknownAgent extends TaggedError3()("UnknownAgent", {
16047
16104
  agent: String4,
16048
- known: ArraySchema(Struct({ id: String4, description: String4 }))
16105
+ known: ArraySchema(Struct({ id: String4, description: String4 })),
16106
+ invalid: optional2(String4)
16049
16107
  }) {
16050
16108
  get message() {
16109
+ if (this.invalid !== undefined)
16110
+ return `agent definition ${this.agent} is invalid: ${this.invalid}`;
16051
16111
  const known = this.known.map((definition) => `${definition.id} (${definition.description})`).join("; ");
16052
16112
  return `no agent definition ${this.agent}; registered: ${known || "none"}`;
16053
16113
  }
@@ -16084,9 +16144,26 @@ var HarnessChoice = Struct({
16084
16144
  problem: NullOr(String4),
16085
16145
  models: ArraySchema(HarnessModel)
16086
16146
  });
16147
+ var AgentListing = Struct({
16148
+ agents: ArraySchema(Struct({
16149
+ id: String4,
16150
+ description: String4,
16151
+ plugin: String4,
16152
+ harness: optional2(String4),
16153
+ provider: optional2(String4),
16154
+ model: optional2(String4),
16155
+ system: String4
16156
+ })),
16157
+ invalid: ArraySchema(Struct({
16158
+ id: optional2(String4),
16159
+ source: String4,
16160
+ error: String4,
16161
+ plugin: String4
16162
+ }))
16163
+ });
16087
16164
 
16088
16165
  // ../../schema/src/version.ts
16089
- var PROTOCOL = 12;
16166
+ var PROTOCOL = 14;
16090
16167
 
16091
16168
  // ../../protocol/src/protocol.ts
16092
16169
  var MISMATCH_ACTION = "vibest update";
@@ -16184,6 +16261,12 @@ var RuntimeView = Struct({
16184
16261
  note: optional2(String4)
16185
16262
  })
16186
16263
  });
16264
+ var MachineLoad = Struct({
16265
+ sampledAt: Number5,
16266
+ cpu: Struct({ count: Number5, utilization: NullOr(Number5) }),
16267
+ memory: Struct({ total: Number5, available: Number5 }),
16268
+ executions: Struct({ working: Number5 })
16269
+ });
16187
16270
  var MachineInfo = Struct({
16188
16271
  name: String4,
16189
16272
  target: String4,
@@ -16219,7 +16302,7 @@ var OutboxItem = Struct({
16219
16302
  recipient: String4,
16220
16303
  kind: Literals(["send", "notice"]),
16221
16304
  content: String4,
16222
- from: optional2(Sender2),
16305
+ from: optional2(AgentFrom),
16223
16306
  cut: optional2(Boolean3)
16224
16307
  });
16225
16308
 
@@ -16238,11 +16321,40 @@ var ProjectInfoResult = Struct({
16238
16321
  var ProjectSearchInput = Struct({ query: String4, kind: optional2(ProjectKind) });
16239
16322
  var ProjectActivity = Literals(["blocked", "done", "working", "idle"]);
16240
16323
 
16324
+ class ProjectCloneFailed extends TaggedError3()("ProjectCloneFailed", {
16325
+ message: String4
16326
+ }) {
16327
+ }
16328
+ var CloneFailed = Union2([
16329
+ ProjectCloneFailed,
16330
+ NoSuchSession,
16331
+ UnknownMachine,
16332
+ MachineUnavailable,
16333
+ MachineIncompatible
16334
+ ]);
16335
+ var CloneRequest = {
16336
+ url: String4,
16337
+ directory: optional2(String4),
16338
+ machine: optional2(String4)
16339
+ };
16340
+ var CloneStep = Union2([
16341
+ Struct({ progress: String4 }),
16342
+ Struct({ projectId: String4, directory: String4 })
16343
+ ]);
16344
+
16241
16345
  class ProjectCreateFailed extends TaggedError3()("ProjectCreateFailed", {
16242
16346
  message: String4
16243
16347
  }) {
16244
16348
  }
16245
16349
 
16350
+ class NoSuchProject extends TaggedError3()("NoSuchProject", {
16351
+ project: String4
16352
+ }) {
16353
+ get message() {
16354
+ return `no project ${this.project} on this machine`;
16355
+ }
16356
+ }
16357
+
16246
16358
  // ../../schema/src/remove.ts
16247
16359
  var RemoveOutcome = Struct({
16248
16360
  id: String4,
@@ -16277,6 +16389,43 @@ var Subscription = Struct({
16277
16389
  error: optional2(String4)
16278
16390
  });
16279
16391
 
16392
+ // ../../schema/src/team.ts
16393
+ var TeamMember = Struct({
16394
+ id: String4,
16395
+ agent: String4,
16396
+ name: String4,
16397
+ status: AgentStatus,
16398
+ startedBy: NullOr(String4)
16399
+ });
16400
+
16401
+ // ../../schema/src/worktree.ts
16402
+ var RepositoryState = Literals(["clean", "dirty", "unsaved", "unknown"]);
16403
+ var WorktreeRepository = Struct({
16404
+ folder: String4,
16405
+ branch: optional2(String4),
16406
+ commit: optional2(String4),
16407
+ state: RepositoryState,
16408
+ changed: optional2(Number5)
16409
+ });
16410
+ var WorktreeSession = Struct({
16411
+ id: String4,
16412
+ title: String4,
16413
+ state: Literals(["live", "archived"])
16414
+ });
16415
+ var WorktreeInfo = Struct({
16416
+ path: String4,
16417
+ repositories: ArraySchema(WorktreeRepository),
16418
+ sessions: ArraySchema(WorktreeSession)
16419
+ });
16420
+ var WorktreeProject = Struct({
16421
+ id: String4,
16422
+ directory: String4,
16423
+ worktrees: ArraySchema(WorktreeInfo)
16424
+ });
16425
+ var WorktreeList = Struct({
16426
+ projects: ArraySchema(WorktreeProject)
16427
+ });
16428
+
16280
16429
  // ../../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/rpc/RpcSchema.js
16281
16430
  var StreamSchemaTypeId = "~effect/rpc/RpcSchema/StreamSchema";
16282
16431
  function isStreamSchema(schema) {
@@ -17727,6 +17876,7 @@ var SessionInfo = Struct({
17727
17876
  createdAt: Number5,
17728
17877
  lastActive: Number5,
17729
17878
  task: NullOr(String4),
17879
+ waitingToStart: optional2(Literal2(true)),
17730
17880
  latest: NullOr(Struct({
17731
17881
  status: MessageStatus,
17732
17882
  summary: String4,
@@ -17736,6 +17886,15 @@ var SessionInfo = Struct({
17736
17886
  view: optional2(String4)
17737
17887
  });
17738
17888
  var LINE_ERRORS = [UnknownMachine, MachineUnavailable, MachineIncompatible];
17889
+ var PROCESS_ERRORS = Union2([
17890
+ Forbidden2,
17891
+ NoSuchSession,
17892
+ AmbiguousSession,
17893
+ SessionBusy,
17894
+ RuntimeUnreachable,
17895
+ NoRuntime,
17896
+ ...LINE_ERRORS
17897
+ ]);
17739
17898
  var SessionReply = Struct({
17740
17899
  execution: Number5,
17741
17900
  status: String4,
@@ -17788,11 +17947,13 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17788
17947
  callerEnv: Record(String4, String4),
17789
17948
  runtimeSession: optional2(String4),
17790
17949
  share: optional2(String4),
17791
- archive: optional2(Boolean3),
17792
17950
  runtime: optional2(String4),
17793
17951
  request: optional2(String4),
17794
17952
  machine: optional2(String4),
17795
- files: Attachments
17953
+ project: optional2(String4),
17954
+ files: Attachments,
17955
+ team: optional2(String4),
17956
+ newTeam: optional2(Boolean3)
17796
17957
  },
17797
17958
  success: Struct({
17798
17959
  id: String4,
@@ -17800,7 +17961,8 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17800
17961
  provider: optional2(String4),
17801
17962
  model: optional2(String4),
17802
17963
  ...Routing.fields,
17803
- notes: optional2(ArraySchema(MachineNote))
17964
+ notes: optional2(ArraySchema(MachineNote)),
17965
+ team: optional2(String4)
17804
17966
  }),
17805
17967
  error: Union2([
17806
17968
  InvalidCaller,
@@ -17812,7 +17974,6 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17812
17974
  NoProject,
17813
17975
  NoCommit,
17814
17976
  PromptTooLarge,
17815
- LimitReached,
17816
17977
  AllocationFailed,
17817
17978
  HarnessUnavailable,
17818
17979
  NotInRepository,
@@ -17827,10 +17988,24 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17827
17988
  RuntimeUnreachable,
17828
17989
  RuntimeIncompatible
17829
17990
  ])
17830
- }))), protocol(make25("Plugins", { success: ArraySchema(PluginInfo) })), protocol(make25("Harnesses.List", {
17991
+ }))), protocol(make25("Plugins", { success: ArraySchema(PluginInfo) })), protocol(make25("Concurrency", {
17992
+ success: Struct({
17993
+ max: NullOr(Number5),
17994
+ problems: ArraySchema(String4),
17995
+ unsupported: ArraySchema(String4)
17996
+ })
17997
+ })), protocol(make25("Harnesses.List", {
17831
17998
  payload: { provider: optional2(String4), machine: optional2(String4) },
17832
17999
  success: ArraySchema(HarnessChoice),
17833
18000
  error: Union2([Forbidden2, ...LINE_ERRORS])
18001
+ })), protocol(make25("Agents.List", {
18002
+ payload: { machine: optional2(String4) },
18003
+ success: AgentListing,
18004
+ error: Union2([Forbidden2, ...LINE_ERRORS])
18005
+ })), protocol(make25("Worktree.List", {
18006
+ payload: { project: optional2(String4), machine: optional2(String4) },
18007
+ success: WorktreeList,
18008
+ error: Union2([Forbidden2, NoSuchProject, ...LINE_ERRORS])
17834
18009
  })), scoped4(make25("Integration.Guard", {
17835
18010
  payload: { harness: String4, input: String4 },
17836
18011
  success: Struct({ answer: optional2(Unknown2) }),
@@ -17842,6 +18017,7 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17842
18017
  payload: {
17843
18018
  argv: ArraySchema(String4),
17844
18019
  agent: String4,
18020
+ agentNamed: optional2(Boolean3),
17845
18021
  focus: Boolean3,
17846
18022
  callerEnv: Record(String4, String4),
17847
18023
  runtimeSession: optional2(String4),
@@ -17869,38 +18045,30 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17869
18045
  id: String4,
17870
18046
  message: String4,
17871
18047
  request: optional2(RequestId),
17872
- from: optional2(Sender2)
18048
+ from: optional2(AgentFrom)
17873
18049
  },
17874
18050
  success: Struct({ id: String4 }),
17875
18051
  error: Union2([Forbidden2, NoSuchSession, AmbiguousSession, ...LINE_ERRORS])
17876
18052
  }))), scoped4(admitted(make25("Interrupt", {
17877
18053
  payload: { id: String4 },
17878
18054
  success: Struct({ id: String4, message: String4 }),
17879
- error: Union2([
17880
- Forbidden2,
17881
- NoSuchSession,
17882
- AmbiguousSession,
17883
- SessionBusy,
17884
- RuntimeUnreachable,
17885
- NoRuntime,
17886
- ...LINE_ERRORS
17887
- ])
18055
+ error: PROCESS_ERRORS
18056
+ }))), scoped4(admitted(make25("Stop", {
18057
+ payload: { id: String4 },
18058
+ success: Struct({ id: String4, message: String4 }),
18059
+ error: PROCESS_ERRORS
17888
18060
  }))), scoped4(admitted(make25("Remove", {
17889
18061
  payload: { id: String4, keepWorktree: optional2(Boolean3) },
17890
18062
  success: NullOr(RemoveOutcome),
17891
- error: Union2([
17892
- Forbidden2,
17893
- NoSuchSession,
17894
- AmbiguousSession,
17895
- SessionBusy,
17896
- RuntimeUnreachable,
17897
- NoRuntime,
17898
- ...LINE_ERRORS
17899
- ])
18063
+ error: PROCESS_ERRORS
17900
18064
  }))), scoped4(make25("List", {
17901
18065
  payload: { stopped: optional2(Boolean3), all: optional2(Boolean3) },
17902
18066
  success: Struct({ sessions: ArraySchema(SessionInfo), machines: ArraySchema(ListedMachine) }),
17903
18067
  error: Union2([Forbidden2])
18068
+ })), scoped4(make25("Team.List", {
18069
+ payload: { team: optional2(String4) },
18070
+ success: Struct({ team: String4, members: ArraySchema(TeamMember) }),
18071
+ error: Union2([Forbidden2])
17904
18072
  })), scoped4(make25("Get", {
17905
18073
  payload: { id: String4 },
17906
18074
  success: SessionStatusInfo,
@@ -17936,6 +18104,7 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17936
18104
  payload: {
17937
18105
  harness: String4,
17938
18106
  agent: String4,
18107
+ agentNamed: optional2(Boolean3),
17939
18108
  fresh: Boolean3,
17940
18109
  terminal: String4,
17941
18110
  runtime: optional2(String4),
@@ -17969,6 +18138,8 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
17969
18138
  payload: {
17970
18139
  harness: optional2(String4),
17971
18140
  agent: String4,
18141
+ agentNamed: optional2(Boolean3),
18142
+ fresh: optional2(Boolean3),
17972
18143
  provider: optional2(String4),
17973
18144
  model: optional2(String4),
17974
18145
  runtime: optional2(String4)
@@ -18067,6 +18238,11 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
18067
18238
  }))
18068
18239
  }),
18069
18240
  error: Union2([Forbidden2, ProjectCreateFailed])
18241
+ }))), scoped4(admitted(make25("Project.Clone", {
18242
+ payload: CloneRequest,
18243
+ success: CloneStep,
18244
+ error: Union2([Forbidden2, CloneFailed]),
18245
+ stream: true
18070
18246
  }))), scoped4(make25("Daemon.Stop", {
18071
18247
  payload: { instance: String4 },
18072
18248
  success: Struct({ instance: String4 }),
@@ -18107,9 +18283,16 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
18107
18283
  error: Forbidden2
18108
18284
  })), scoped4(admitted(make25("Peer.Spawn", {
18109
18285
  payload: {
18110
- repository: String4,
18286
+ repository: optional2(String4),
18111
18287
  identity: optional2(String4),
18112
- commit: String4,
18288
+ commit: optional2(String4),
18289
+ project: optional2(String4),
18290
+ repositories: optional2(ArraySchema(Struct({
18291
+ folder: String4,
18292
+ repository: String4,
18293
+ identity: optional2(String4),
18294
+ commit: String4
18295
+ }))),
18113
18296
  agent: String4,
18114
18297
  prompt: String4,
18115
18298
  harness: optional2(String4),
@@ -18134,7 +18317,6 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
18134
18317
  NoProject,
18135
18318
  NoCommit,
18136
18319
  PromptTooLarge,
18137
- LimitReached,
18138
18320
  AllocationFailed,
18139
18321
  HarnessUnavailable,
18140
18322
  NoCallingSession,
@@ -18157,61 +18339,16 @@ class VibestRpcs extends make27(make25("Ping", { success: PingResult }), scoped4
18157
18339
  notes: ArraySchema(MachineNote)
18158
18340
  }),
18159
18341
  error: Union2([Forbidden2, MachineFailed, MachineIncompatible, AlreadyAdded])
18342
+ })), scoped4(make25("Machine.Load", {
18343
+ payload: { machine: optional2(String4) },
18344
+ success: MachineLoad,
18345
+ error: Union2([Forbidden2, UnknownMachine, MachineUnavailable, MachineIncompatible])
18160
18346
  })), scoped4(make25("Machine.List", { success: ArraySchema(MachineInfo), error: Forbidden2 })), scoped4(make25("Machine.Remove", {
18161
18347
  payload: { name: String4 },
18162
18348
  success: Struct({ notes: ArraySchema(MachineNote) }),
18163
18349
  error: Union2([Forbidden2, UnknownMachine])
18164
18350
  }))) {
18165
18351
  }
18166
- var ACCESS = {
18167
- Ping: ["open", "peer"],
18168
- Plugins: "open",
18169
- "Harnesses.List": ["open", "peer"],
18170
- "Integration.Guard": "open",
18171
- "Runtimes.Doctor": "open",
18172
- Subscriptions: "open",
18173
- Republish: "open",
18174
- ExecutionEnd: "open",
18175
- Prompt: "open",
18176
- Spawn: "agent",
18177
- Launch: "cli",
18178
- List: ["agent", "peer"],
18179
- Get: ["agent", "peer"],
18180
- "Inbox.Subscribe": "session",
18181
- "Inbox.Take": "session",
18182
- Watch: "cli",
18183
- Events: "cli",
18184
- "Session.Seen": "cli",
18185
- "Project.Open": "cli",
18186
- "Project.Move": "cli",
18187
- "Project.EntryPlace": "cli",
18188
- "Project.EntrySession": "cli",
18189
- "Project.StartEntry": "cli",
18190
- "Project.FocusEntry": "cli",
18191
- "Project.RunningEntry": "agent",
18192
- "Project.StopEntry": "cli",
18193
- "Project.Create": "cli",
18194
- "Project.Info": "agent",
18195
- "Project.Search": "agent",
18196
- Send: ["owner", "session", "peer"],
18197
- Interrupt: ["owner", "peer"],
18198
- Peek: ["owner", "peer"],
18199
- Remove: ["owner", "peer"],
18200
- "Daemon.Stop": "cli",
18201
- "Daemon.Handoff": "cli",
18202
- "Session.Ready": "self",
18203
- "Agents.Outdated": "cli",
18204
- "Agents.Restart": "cli",
18205
- "Peer.Hello": "peer",
18206
- "Peer.Spawn": "peer",
18207
- "Peer.Outbox": "peer",
18208
- "Peer.Ack": "peer",
18209
- "Machine.Add": "cli",
18210
- "Machine.List": "cli",
18211
- "Machine.Remove": "cli"
18212
- };
18213
- var PEER_CALLS = new Set(Object.entries(ACCESS).filter(([, access]) => [access].flat().includes("peer")).map(([method]) => method));
18214
- var FORWARDED_CALLS = new Set([...PEER_CALLS].filter((method) => method !== "Ping" && method !== "Harnesses.List" && !method.startsWith("Peer.")));
18215
18352
 
18216
18353
  // ../../schema/src/layout.ts
18217
18354
  class Layout extends Service()("vibest/Layout") {
@@ -18455,14 +18592,20 @@ class Pi extends Service()("@vibest/pi/Pi") {
18455
18592
  }
18456
18593
 
18457
18594
  // src/version.ts
18458
- var VERSION = "0.0.2-beta.2";
18595
+ var VERSION = "0.0.2-beta.4";
18459
18596
 
18460
18597
  // src/extension.ts
18461
18598
  var { withVibest: withVibest2 } = makeClient({ version: VERSION });
18462
18599
  var skillsDir = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "skills");
18463
18600
  var encodeJson = encodeSync(fromJsonString2(Unknown2));
18464
18601
  var decodeRefusal = decodeUnknownOption2(String4);
18465
- var decodeVibestDetails = decodeUnknownOption2(Struct({ execution: Number5 }));
18602
+ var decodeVibestDetails = decodeUnknownOption2(Struct({ execution: Number5, ids: optional2(ArraySchema(Number5)) }));
18603
+ var parseExecution = (raw) => {
18604
+ if (raw === undefined || !/^[1-9]\d*$/.test(raw))
18605
+ return;
18606
+ const parsed = Number(raw);
18607
+ return Number.isSafeInteger(parsed) ? parsed : undefined;
18608
+ };
18466
18609
  var guarded = (sessionId) => gen2(function* () {
18467
18610
  const pi = yield* Pi;
18468
18611
  const layout = yield* Layout;
@@ -18490,11 +18633,13 @@ var piHeaders = (sessionId, ctx, current) => claimHeaders(Claim.session({
18490
18633
  pluginVersion: VERSION,
18491
18634
  ...current !== undefined && { process: current }
18492
18635
  }));
18493
- var session = (sessionId, processId) => effectDiscard(gen2(function* () {
18636
+ var session = (sessionId, processId, initialExecution) => effectDiscard(gen2(function* () {
18494
18637
  const pi = yield* Pi;
18495
18638
  const layout = yield* Layout;
18496
18639
  const root = yield* make24(false);
18497
18640
  const reply = yield* make24({ text: "", error: "" });
18641
+ const initialPending = yield* make24(initialExecution);
18642
+ const bound = yield* make24(initialExecution);
18498
18643
  yield* pi.handle("session_start", (_e, ctx) => set2(root, ctx.mode === "tui"));
18499
18644
  yield* pi.handle("agent_end", (e) => set2(reply, lastReply(e.messages)));
18500
18645
  yield* pi.handle("message_start", (e, ctx) => gen2(function* () {
@@ -18504,14 +18649,27 @@ var session = (sessionId, processId) => effectDiscard(gen2(function* () {
18504
18649
  const details = decodeVibestDetails(message.details);
18505
18650
  if (isNone2(details))
18506
18651
  return;
18652
+ yield* set2(initialPending, undefined);
18653
+ yield* set2(bound, details.value.execution);
18507
18654
  const headers = yield* piHeaders(sessionId, ctx, yield* get2(processId));
18508
- const event = encodeJson({ type: "accepted", execution: details.value.execution });
18655
+ const event = encodeJson({
18656
+ type: "accepted",
18657
+ execution: details.value.execution,
18658
+ ...details.value.ids !== undefined && { ids: details.value.ids }
18659
+ });
18509
18660
  yield* hookCall(layout.socket, headers, (client) => client.Prompt({ sessionId, harness: "pi", event }));
18510
18661
  }));
18511
18662
  yield* pi.handle("input", (e, ctx) => gen2(function* () {
18512
18663
  if (e.source === "extension" || e.text.trim() === "")
18513
18664
  return;
18665
+ const initial = yield* getAndSet(initialPending, undefined);
18514
18666
  const headers = yield* piHeaders(sessionId, ctx, yield* get2(processId));
18667
+ if (initial !== undefined) {
18668
+ const event = encodeJson({ type: "accepted", execution: initial });
18669
+ yield* hookCall(layout.socket, headers, (client) => client.Prompt({ sessionId, harness: "pi", event }));
18670
+ return;
18671
+ }
18672
+ yield* set2(bound, undefined);
18515
18673
  const event = encodeJson({ type: "input", text: e.text, source: e.source });
18516
18674
  yield* hookCall(layout.socket, headers, (client) => client.Prompt({ sessionId, harness: "pi", event }));
18517
18675
  }));
@@ -18519,8 +18677,16 @@ var session = (sessionId, processId) => effectDiscard(gen2(function* () {
18519
18677
  if (!(yield* get2(root)) || !ctx.isIdle())
18520
18678
  return;
18521
18679
  const { text, error } = yield* get2(reply);
18680
+ yield* set2(initialPending, undefined);
18681
+ const execution = yield* getAndSet(bound, undefined);
18522
18682
  const headers = yield* piHeaders(sessionId, ctx, yield* get2(processId));
18523
- const event = encodeJson({ type: "agent_settled", text, error, aborted: e.aborted });
18683
+ const event = encodeJson({
18684
+ type: "agent_settled",
18685
+ text,
18686
+ error,
18687
+ aborted: e.aborted,
18688
+ ...execution !== undefined && { execution }
18689
+ });
18524
18690
  yield* hookCall(layout.socket, headers, (client) => client.ExecutionEnd({ sessionId, harness: "pi", event }));
18525
18691
  }));
18526
18692
  }));
@@ -18566,7 +18732,7 @@ var inbox = (sessionId, processId) => effectDiscard(gen2(function* () {
18566
18732
  customType: "vibest",
18567
18733
  content: taken.content,
18568
18734
  display: true,
18569
- details: { execution: taken.execution, detail: taken.detail }
18735
+ details: { execution: taken.execution, ids: taken.ids, detail: taken.detail }
18570
18736
  }, { triggerTurn: true });
18571
18737
  }).pipe(ignore2);
18572
18738
  yield* pi.handle("agent_settled", (_e, ctx) => takeNext(ctx));
@@ -18593,10 +18759,11 @@ var extension2 = unwrap(gen2(function* () {
18593
18759
  if (!sessionId)
18594
18760
  return empty4;
18595
18761
  const processId = yield* make24(getOrUndefined(yield* option3(String5("VIBEST_PROCESS"))));
18762
+ const initialExecution = parseExecution(getOrUndefined(yield* option3(String5("VIBEST_EXECUTION"))));
18596
18763
  const guard = merge2(effectDiscard(guarded(sessionId)), ready(sessionId, processId));
18597
- return terminal(sessionId).pipe(provideMerge(mergeAll2(session(sessionId, processId), inbox(sessionId, processId)).pipe(provideMerge(guard))));
18764
+ return terminal(sessionId).pipe(provideMerge(mergeAll2(session(sessionId, processId, initialExecution), inbox(sessionId, processId)).pipe(provideMerge(guard))));
18598
18765
  }));
18599
- var vibestCommand = effect(VibestCommand, schema(fromJsonString2(ArraySchema(String4)), "VIBEST_COMMAND").pipe(withDefault3(["vibest"])));
18766
+ var vibestCommand = effect(VibestCommand, String5("VIBEST_CLI").pipe(map9((cli) => [cli]), withDefault3(["vibest"])));
18600
18767
  var services = mergeAll2(Layout.layer, layer.pipe(provide2(layer2)), layer2, succeed6(Service3, (endpoint) => makeNet({ path: endpoint })), vibestCommand).pipe(provideMerge(layer3));
18601
18768
  var extension_default = (api) => Pi.runMain(api, extension2.pipe(provide2(services)));
18602
18769
  export {