@kubitnodes/stellaris 0.3.0 → 0.3.1

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.
Files changed (42) hide show
  1. package/dist/cli/index.js +86 -4
  2. package/dist/server/index.js +403 -27
  3. package/package.json +1 -1
  4. package/web/dist/assets/ChannelView-UppsahaH.js +1 -0
  5. package/web/dist/assets/CitizenView-CvZ5sEqw.js +2 -0
  6. package/web/dist/assets/{CitizensView-DB2TlGxn.js → CitizensView-D7VztzDL.js} +1 -1
  7. package/web/dist/assets/{KnowledgeView-l0I_R5Zd.js → KnowledgeView-D2jzcn4S.js} +1 -1
  8. package/web/dist/assets/{Markdown-C6mhAmbQ.js → Markdown-Dc8gCFZz.js} +4 -4
  9. package/web/dist/assets/{MessageItem-BR30twQh.js → MessageItem-BcDf-lgD.js} +1 -1
  10. package/web/dist/assets/MetricsView-lRYbAJSl.js +1 -0
  11. package/web/dist/assets/NeedsYouView-C-2cU-C5.js +1 -0
  12. package/web/dist/assets/{Overview-D47FfDDO.js → Overview-lKNZgZg_.js} +1 -1
  13. package/web/dist/assets/{Pane-BXpuXst6.js → Pane-DKfOLaXj.js} +1 -1
  14. package/web/dist/assets/{ProjectView-CxUA5nFw.js → ProjectView-CSoD4RFx.js} +1 -1
  15. package/web/dist/assets/ProposalView-BkcPia8W.js +1 -0
  16. package/web/dist/assets/{ProposalsView-BscIGUTT.js → ProposalsView-BQucmpBt.js} +1 -1
  17. package/web/dist/assets/{RunnersView-BypVHvzI.js → RunnersView-FbbPyu3y.js} +1 -1
  18. package/web/dist/assets/{SocietyView-C403e1uR.js → SocietyView-rpbJ_PcL.js} +1 -1
  19. package/web/dist/assets/SubjectThread-DQHf-MWF.js +1 -0
  20. package/web/dist/assets/{TaskView-B-4WGLWK.js → TaskView-6_oFPNkL.js} +1 -1
  21. package/web/dist/assets/{TasksView-CA02-WIW.js → TasksView-CJkLuWGV.js} +1 -1
  22. package/web/dist/assets/{ThreadCard-C4rb-53v.js → ThreadCard-Cjwceioc.js} +1 -1
  23. package/web/dist/assets/ThreadForms-CE9t-rVz.js +1 -0
  24. package/web/dist/assets/{ThreadView-CAdCu-y_.js → ThreadView-D09wIsYl.js} +1 -1
  25. package/web/dist/assets/citizen-BPzyDHNO.js +1 -0
  26. package/web/dist/assets/format-CRfcN5Lw.js +55 -0
  27. package/web/dist/assets/index-Ch3gW4_Z.js +23 -0
  28. package/web/dist/assets/index-NUcot4yn.css +2 -0
  29. package/web/dist/assets/{tasks-DZgkXWwu.js → tasks-DcMvT5ru.js} +1 -1
  30. package/web/dist/assets/{useStickyScroll-CVTdIoKj.js → useStickyScroll-B3_nksqI.js} +1 -1
  31. package/web/dist/index.html +4 -4
  32. package/web/dist/assets/ChannelView-B4rv0TMD.js +0 -1
  33. package/web/dist/assets/CitizenView-DfBiP1Jw.js +0 -2
  34. package/web/dist/assets/MetricsView-BZ0WW2Do.js +0 -1
  35. package/web/dist/assets/NeedsYouView-C6CZNnJn.js +0 -1
  36. package/web/dist/assets/ProposalView-C0oLBLQD.js +0 -1
  37. package/web/dist/assets/SubjectThread-irSHRJpB.js +0 -1
  38. package/web/dist/assets/ThreadForms-Dh9ky_aU.js +0 -1
  39. package/web/dist/assets/citizen-BWGATcew.js +0 -1
  40. package/web/dist/assets/format-DZLzLk7S.js +0 -55
  41. package/web/dist/assets/index-D-wuKd9C.js +0 -21
  42. package/web/dist/assets/index-HwY3AK-1.css +0 -2
package/dist/cli/index.js CHANGED
@@ -678,6 +678,8 @@ var BOARD_EVENT_TYPES = [
678
678
  "paused.changed",
679
679
  "wake.requested",
680
680
  "turn.started",
681
+ "turn.steered",
682
+ "turn.stopped",
681
683
  "turn.completed",
682
684
  "turn.failed",
683
685
  "merge.completed",
@@ -709,7 +711,8 @@ var TurnExitReasonSchema = z5.enum([
709
711
  "timeout",
710
712
  "error",
711
713
  "interrupted",
712
- "blocked"
714
+ "blocked",
715
+ "stopped"
713
716
  ]);
714
717
  var AgentEventSchema = z5.discriminatedUnion("type", [
715
718
  z5.object({
@@ -720,6 +723,16 @@ var AgentEventSchema = z5.discriminatedUnion("type", [
720
723
  /** The model the CLI reports running, when it reports one. */
721
724
  model: z5.string().optional()
722
725
  }),
726
+ /**
727
+ * The CLI took a steer into the running turn. Adapters name the steer; the server adds the
728
+ * messages it delivered and the text the CLI was given.
729
+ */
730
+ z5.object({
731
+ type: z5.literal("steered"),
732
+ steer: z5.string().min(1),
733
+ messages: z5.array(UlidSchema).optional(),
734
+ text: z5.string().optional()
735
+ }),
723
736
  z5.object({ type: z5.literal("text"), delta: z5.string() }),
724
737
  z5.object({ type: z5.literal("tool_call"), name: z5.string(), input: z5.unknown() }),
725
738
  z5.object({
@@ -767,6 +780,10 @@ var RunnerHelloSchema = z6.object({
767
780
  clis: z6.array(CliKindSchema),
768
781
  /** The CLIs whose adapter can keep a session warm between turns. */
769
782
  residentClis: z6.array(CliKindSchema).default([]),
783
+ /** The CLIs whose adapter can take input into a running turn; the server steers only these. */
784
+ steerableClis: z6.array(CliKindSchema).default([]),
785
+ /** The CLIs whose adapter can stop a running turn; the server stops only these. */
786
+ stoppableClis: z6.array(CliKindSchema).default([]),
770
787
  capabilities: z6.array(z6.string()).default([]),
771
788
  /** Turns the runner runs at once, or null for no limit. */
772
789
  slots: z6.number().int().positive().nullable(),
@@ -870,10 +887,20 @@ var LandRequestSchema = z6.object({
870
887
  });
871
888
  var MergeOutcomeSchema = z6.object({ ok: z6.boolean(), detail: z6.string() });
872
889
  var ModelListSchema = z6.array(ModelOptionSchema);
890
+ var TurnSteerSchema = z6.object({ id: z6.uuid(), text: z6.string().min(1) });
873
891
  var RunnerMessageSchema = z6.discriminatedUnion("type", [
874
892
  z6.object({ type: z6.literal("turn"), job: TurnJobSchema }),
875
893
  z6.object({ type: z6.literal("land"), request: z6.string().min(1), land: LandRequestSchema }),
876
- z6.object({ type: z6.literal("models"), request: z6.string().min(1), cli: CliKindSchema })
894
+ z6.object({ type: z6.literal("models"), request: z6.string().min(1), cli: CliKindSchema }),
895
+ /** Answered with whether the CLI accepted it; that it took it comes as a `steered` event. */
896
+ z6.object({
897
+ type: z6.literal("steer"),
898
+ request: z6.string().min(1),
899
+ turnId: UlidSchema,
900
+ steer: TurnSteerSchema
901
+ }),
902
+ /** Answered with whether the turn was there to stop; it ends `stopped`. */
903
+ z6.object({ type: z6.literal("stop"), request: z6.string().min(1), turnId: UlidSchema })
877
904
  ]);
878
905
  var RunnerAnswerSchema = z6.discriminatedUnion("ok", [
879
906
  z6.object({ ok: z6.literal(true), value: z6.unknown() }),
@@ -949,7 +976,19 @@ var TurnRecordSchema = z7.object({
949
976
  /** The model the CLI reported for this turn, else the model configured for the agent, else null. */
950
977
  model: z7.string().nullable().default(null),
951
978
  /** The task branch the turn left work on, with its commit, as the runner reported it. */
952
- work: TurnWorkSchema.optional()
979
+ work: TurnWorkSchema.optional(),
980
+ /** Who stopped the turn, for one that ended `stopped`. */
981
+ stoppedBy: NameSchema.optional()
982
+ });
983
+ var RunningTurnSchema = z7.object({
984
+ turnId: UlidSchema,
985
+ agent: NameSchema,
986
+ scope: NameSchema,
987
+ thread: UlidSchema.optional(),
988
+ cli: CliKindSchema,
989
+ channel: ChannelRefSchema.optional(),
990
+ steerable: z7.boolean(),
991
+ stoppable: z7.boolean()
953
992
  });
954
993
  var SessionsFileSchema = z7.object({
955
994
  claude: z7.string().optional(),
@@ -1160,7 +1199,7 @@ var RunnerConfigSchema = z10.object({
1160
1199
  });
1161
1200
 
1162
1201
  // packages/shared/dist/version.js
1163
- var STELLARIS_VERSION = "0.3.0";
1202
+ var STELLARIS_VERSION = "0.3.1";
1164
1203
 
1165
1204
  // packages/board-core/dist/errors.js
1166
1205
  var BoardError = class extends Error {
@@ -1704,10 +1743,12 @@ var TaskPayload = z11.object({
1704
1743
  from: z11.string().optional()
1705
1744
  });
1706
1745
  var MessagePayload = z11.object({
1746
+ id: z11.string().optional(),
1707
1747
  channel: z11.string(),
1708
1748
  thread: z11.string().nullable().optional(),
1709
1749
  mentions: z11.array(z11.string()).default([])
1710
1750
  });
1751
+ var SteeredPayload = z11.object({ messages: z11.array(z11.string()) });
1711
1752
  var SignalPayload = z11.object({
1712
1753
  kind: z11.string(),
1713
1754
  key: z11.string(),
@@ -1814,6 +1855,23 @@ function computeMetrics(input) {
1814
1855
  }
1815
1856
  break;
1816
1857
  }
1858
+ case "turn.steered": {
1859
+ const steered = SteeredPayload.safeParse(event.payload);
1860
+ if (!steered.success) {
1861
+ break;
1862
+ }
1863
+ const delivered = new Set(steered.data.messages);
1864
+ const at = Date.parse(event.ts);
1865
+ const answered = waiting.filter((mention) => mention.agent === event.actor && mention.message !== null && delivered.has(mention.message));
1866
+ if (answered.length > 0) {
1867
+ latencies.set(event.actor, [
1868
+ ...latencies.get(event.actor) ?? [],
1869
+ ...answered.map((mention) => at - mention.at)
1870
+ ]);
1871
+ waiting = waiting.filter((mention) => !answered.includes(mention));
1872
+ }
1873
+ break;
1874
+ }
1817
1875
  case "task.completed": {
1818
1876
  const task2 = TaskPayload.safeParse(event.payload);
1819
1877
  if (counted && task2.success) {
@@ -1878,6 +1936,7 @@ function computeMetrics(input) {
1878
1936
  waiting.push({
1879
1937
  agent: name,
1880
1938
  at: Date.parse(event.ts),
1939
+ message: message.data.id ?? null,
1881
1940
  thread: thread2,
1882
1941
  scopes: [project2, wakeScope(citizen, project2)].filter((scope) => scope !== null)
1883
1942
  });
@@ -4690,6 +4749,21 @@ ${rationale}`}`);
4690
4749
  });
4691
4750
  });
4692
4751
  }
4752
+ /** Where a conversation's digest resumes: the newest message a turn there was shown. */
4753
+ async digestCursor(agent2, scope, thread2) {
4754
+ return this.mutex.run(async () => cursorOf(await this.readCursors(agent2), scope, thread2 ?? null));
4755
+ }
4756
+ /** Records that a running turn took posts delivered into it, which wake latency counts to. */
4757
+ async recordSteered(input) {
4758
+ await this.mutex.run(async () => {
4759
+ await this.events.append("turn.steered", input.agent, {
4760
+ turnId: input.turnId,
4761
+ project: input.project,
4762
+ ...input.thread === void 0 ? {} : { thread: input.thread },
4763
+ messages: [...input.messages]
4764
+ });
4765
+ });
4766
+ }
4693
4767
  /** Where a conversation's session ids and last turn are kept: the scope's home, or a thread's. */
4694
4768
  sessionDir(agent2, scope, thread2) {
4695
4769
  return thread2 === void 0 ? this.paths.agentProject(agent2, scope) : this.paths.agentThread(agent2, scope, thread2);
@@ -4759,6 +4833,14 @@ ${rationale}`}`);
4759
4833
  }
4760
4834
  await this.writeTurnRecord(parsed);
4761
4835
  await this.refreshMember(parsed.agent);
4836
+ if (parsed.exitReason === "stopped") {
4837
+ await this.events.append("turn.stopped", parsed.stoppedBy ?? USER_NAME, {
4838
+ ...parsed.id === void 0 ? {} : { turnId: parsed.id },
4839
+ agent: parsed.agent,
4840
+ project: parsed.project,
4841
+ ...parsed.thread === void 0 ? {} : { thread: parsed.thread }
4842
+ });
4843
+ }
4762
4844
  await this.events.append(failed ? "turn.failed" : "turn.completed", parsed.agent, {
4763
4845
  ...parsed.id === void 0 ? {} : { turnId: parsed.id },
4764
4846
  project: parsed.project,