@sideboard-ai/core 0.1.157 → 0.1.158

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.
@@ -22,6 +22,10 @@ import {
22
22
  listSchedules,
23
23
  listSlackOutboundWatches,
24
24
  listSlackWorkspaces,
25
+ mcpWaitFinishedHint,
26
+ mcpWaitForJobTimeoutMs,
27
+ mcpWaitForTurnTimeoutMs,
28
+ mcpWaitStillRunningHint,
25
29
  pollSlackOutboundWatches,
26
30
  readTurnLive,
27
31
  recordSlackOutboundWatch,
@@ -30,13 +34,14 @@ import {
30
34
  slackApi,
31
35
  slackTokenFor,
32
36
  syncBoardPins,
33
- updateSchedule
34
- } from "../chunk-SUCJAWV4.js";
37
+ updateSchedule,
38
+ waitForDetachedJob
39
+ } from "../chunk-FBFIOVDH.js";
35
40
  import {
36
41
  isInternalAgentStatusText,
37
42
  listModelsForAgent,
38
43
  sideboardMcpProfile
39
- } from "../chunk-KQ4JOGUH.js";
44
+ } from "../chunk-EPQIOAAY.js";
40
45
  import "../chunk-LZ6QMEQC.js";
41
46
  import "../chunk-S42XV45P.js";
42
47
  import {
@@ -55,12 +60,12 @@ import {
55
60
  import {
56
61
  httpFetch
57
62
  } from "../chunk-6GN5WPYZ.js";
58
- import "../chunk-2SDMENAL.js";
63
+ import "../chunk-JV4VNFMS.js";
59
64
  import "../chunk-OCQPTUR7.js";
60
65
  import {
61
66
  GLOBAL_WORKSPACE_ID,
62
67
  isCloudCoordinatorThread
63
- } from "../chunk-4I4VKAPZ.js";
68
+ } from "../chunk-3SUZMPGL.js";
64
69
  import {
65
70
  canonicalizeRepoPath,
66
71
  formatGhLandError,
@@ -71,8 +76,8 @@ import {
71
76
  resolveListPrsOptions,
72
77
  resolveRepoRoot,
73
78
  warmGithubAgentAuth
74
- } from "../chunk-CJQLPPEJ.js";
75
- import "../chunk-NVXVEGGM.js";
79
+ } from "../chunk-A7QXLYBN.js";
80
+ import "../chunk-5U4NZLBH.js";
76
81
  import "../chunk-LZQULFIT.js";
77
82
  import "../chunk-SYFVUF2C.js";
78
83
  import {
@@ -930,28 +935,6 @@ function mcpArchiveBlockedReason(thread) {
930
935
  return null;
931
936
  }
932
937
 
933
- // src/mcp/wait-for-turn.ts
934
- var MCP_WAIT_FOR_TURN_MAX_MS = 45e3;
935
- function mcpWaitForTurnTimeoutMs(requested) {
936
- const n = requested ?? MCP_WAIT_FOR_TURN_MAX_MS;
937
- if (!Number.isFinite(n)) return MCP_WAIT_FOR_TURN_MAX_MS;
938
- return Math.min(Math.max(1e3, Math.floor(n)), MCP_WAIT_FOR_TURN_MAX_MS);
939
- }
940
- var MCP_WAIT_STILL_RUNNING_HINT = "Child is still working. Call wait_for_turn again. Do not send a check-in prompt or assume a hang while progress is updating.";
941
- var MCP_WAIT_QUEUED_HINT = "Child is queued waiting for a concurrency slot \u2014 it has not started yet. Call wait_for_turn again. Do not send a check-in prompt, force_stop, or assume it failed to start.";
942
- function mcpWaitStillRunningHint(status) {
943
- return status === "queued" ? MCP_WAIT_QUEUED_HINT : MCP_WAIT_STILL_RUNNING_HINT;
944
- }
945
- var MCP_WAIT_STOPPED_HINT = "Child was stopped before the turn finished. Do not treat this as success. send_to_thread to resume, or tell the user.";
946
- var MCP_WAIT_BROKEN_HINT = "Child worktree is broken (missing on disk). Tell the user \u2014 do not treat this as success.";
947
- var MCP_WAIT_ERROR_HINT = "Child turn failed. lastError/text is the failure \u2014 switch agent, tell the user, or retry. Do not treat empty text as success.";
948
- function mcpWaitFinishedHint(status) {
949
- if (status === "stopped") return MCP_WAIT_STOPPED_HINT;
950
- if (status === "broken") return MCP_WAIT_BROKEN_HINT;
951
- if (status === "error") return MCP_WAIT_ERROR_HINT;
952
- return void 0;
953
- }
954
-
955
938
  // src/mcp/thread-visibility.ts
956
939
  function lastMessagePreview(messages, max = 160) {
957
940
  if (!messages?.length) return null;
@@ -2806,7 +2789,7 @@ async function startMcpServer() {
2806
2789
  thread_id: z6.string().optional().describe("Sideboard thread id when cwd is not the worktree")
2807
2790
  },
2808
2791
  async ({ title, content, thread_id }) => {
2809
- const { writePlanFile } = await import("../plan-file-OZEBFSGQ.js");
2792
+ const { writePlanFile } = await import("../plan-file-I24VJVP2.js");
2810
2793
  let root = process.cwd();
2811
2794
  if (thread_id?.trim()) {
2812
2795
  const t = orch.getThread(thread_id.trim());
@@ -2873,6 +2856,20 @@ async function startMcpServer() {
2873
2856
  return { content: [{ type: "text", text: JSON.stringify(payload) }] };
2874
2857
  }
2875
2858
  );
2859
+ server.tool(
2860
+ "wait_for_job",
2861
+ "Wait on a detached long job (tests, pack, deploy) started with detached-job.js. MCP clients kill tools around 60s, so this returns within 45s. stillRunning is the source of truth \u2014 if true, present_artifact type=log with content=delta (same artifact_id) and call wait_for_job again. Do not end the turn or tell the user you will let them know later. If false, ok/failed is the result.",
2862
+ {
2863
+ id: z6.string().describe("Detached job id (same kebab-case id passed to detached-job.js start)"),
2864
+ timeoutMs: z6.number().optional()
2865
+ },
2866
+ async ({ id, timeoutMs }) => {
2867
+ const result = await waitForDetachedJob(process.cwd(), id, {
2868
+ timeoutMs: mcpWaitForJobTimeoutMs(timeoutMs)
2869
+ });
2870
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
2871
+ }
2872
+ );
2876
2873
  if (!worktreeProfile) {
2877
2874
  registerSlackTools(server);
2878
2875
  registerConnectedIssueVendorTools(server);
@@ -7,16 +7,16 @@ import {
7
7
  isPidAlive,
8
8
  startOrchestration,
9
9
  waitForPidExit
10
- } from "./chunk-SUCJAWV4.js";
11
- import "./chunk-KQ4JOGUH.js";
10
+ } from "./chunk-FBFIOVDH.js";
11
+ import "./chunk-EPQIOAAY.js";
12
12
  import "./chunk-LZ6QMEQC.js";
13
13
  import "./chunk-S42XV45P.js";
14
14
  import "./chunk-6GN5WPYZ.js";
15
- import "./chunk-2SDMENAL.js";
15
+ import "./chunk-JV4VNFMS.js";
16
16
  import "./chunk-OCQPTUR7.js";
17
- import "./chunk-4I4VKAPZ.js";
18
- import "./chunk-CJQLPPEJ.js";
19
- import "./chunk-NVXVEGGM.js";
17
+ import "./chunk-3SUZMPGL.js";
18
+ import "./chunk-A7QXLYBN.js";
19
+ import "./chunk-5U4NZLBH.js";
20
20
  import "./chunk-LZQULFIT.js";
21
21
  import "./chunk-SYFVUF2C.js";
22
22
  import "./chunk-FNQNJOHY.js";
@@ -5,9 +5,9 @@ import {
5
5
  isPidAlive,
6
6
  startOrchestration,
7
7
  waitForPidExit
8
- } from "./chunk-GWEEGE6L.js";
8
+ } from "./chunk-KYKNFJK5.js";
9
9
  import "./chunk-RFMQY56R.js";
10
- import "./chunk-TIJ6QVX5.js";
10
+ import "./chunk-BLRHO7XQ.js";
11
11
  import "./chunk-CVR4RJ6G.js";
12
12
  import "./chunk-LQMFCS54.js";
13
13
  import "./chunk-JRH62XC4.js";
@@ -10,8 +10,8 @@ import {
10
10
  readPlanFile,
11
11
  resolvePlanMarkdown,
12
12
  writePlanFile
13
- } from "./chunk-2SDMENAL.js";
14
- import "./chunk-NVXVEGGM.js";
13
+ } from "./chunk-JV4VNFMS.js";
14
+ import "./chunk-5U4NZLBH.js";
15
15
  export {
16
16
  LEGACY_PLAN_FILE_REL,
17
17
  PLAN_FILE_NAME,
@@ -6,9 +6,9 @@ import {
6
6
  listWorkspaces,
7
7
  removeWorkspace,
8
8
  syncWorkspacesFromThreads
9
- } from "./chunk-4I4VKAPZ.js";
10
- import "./chunk-CJQLPPEJ.js";
11
- import "./chunk-NVXVEGGM.js";
9
+ } from "./chunk-3SUZMPGL.js";
10
+ import "./chunk-A7QXLYBN.js";
11
+ import "./chunk-5U4NZLBH.js";
12
12
  import "./chunk-LZQULFIT.js";
13
13
  import "./chunk-SYFVUF2C.js";
14
14
  import "./chunk-FNQNJOHY.js";
@@ -55,8 +55,8 @@ import {
55
55
  worktreeDisplayLabel,
56
56
  worktreeDisplayLabelForGroup,
57
57
  worktreeNameFromPath
58
- } from "./chunk-CJQLPPEJ.js";
59
- import "./chunk-NVXVEGGM.js";
58
+ } from "./chunk-A7QXLYBN.js";
59
+ import "./chunk-5U4NZLBH.js";
60
60
  import "./chunk-LZQULFIT.js";
61
61
  import "./chunk-SYFVUF2C.js";
62
62
  import "./chunk-FNQNJOHY.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sideboard-ai/core",
3
- "version": "0.1.157",
3
+ "version": "0.1.158",
4
4
  "description": "Sideboard core — orchestration, agents, git worktrees, MCP server",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",