@longtable/cli 0.1.33 → 0.1.34

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.
package/dist/cli.js CHANGED
@@ -45,7 +45,7 @@ const ANSI = {
45
45
  green: "\u001B[32m"
46
46
  };
47
47
  const LONGTABLE_MCP_SERVER_NAME = "longtable-state";
48
- const LONGTABLE_MCP_PACKAGE_VERSION = "0.1.33";
48
+ const LONGTABLE_MCP_PACKAGE_VERSION = "0.1.34";
49
49
  const LONGTABLE_MCP_MARKER_START = "# LongTable state MCP START";
50
50
  const LONGTABLE_MCP_MARKER_END = "# LongTable state MCP END";
51
51
  function style(text, prefix) {
@@ -71,6 +71,13 @@ function activeInterviewHook(state) {
71
71
  return [...(state.hooks ?? [])].reverse().find((hook) => hook.kind === "longtable_interview" &&
72
72
  (hook.status === "pending" || hook.status === "active" || hook.status === "ready_to_confirm"));
73
73
  }
74
+ function compactContextValue(value, maxLength = 160) {
75
+ const compact = value.replace(/\s+/g, " ").trim();
76
+ if (compact.length <= maxLength) {
77
+ return compact;
78
+ }
79
+ return `${compact.slice(0, Math.max(0, maxLength - 3)).trimEnd()}...`;
80
+ }
74
81
  function buildAdditionalContextOutput(hookEventName, additionalContext) {
75
82
  return {
76
83
  hookSpecificOutput: {
@@ -119,8 +126,19 @@ async function loadLongTableRuntime(startPath) {
119
126
  const state = await loadWorkspaceState(context);
120
127
  return { context, state };
121
128
  }
122
- function buildWorkspaceSummary(runtime) {
129
+ function buildWorkspaceSummary(runtime, detail = "compact") {
123
130
  const { context, state } = runtime;
131
+ if (detail === "compact") {
132
+ const primaryContext = state.firstResearchShape
133
+ ? `First research shape: ${compactContextValue(state.firstResearchShape.handle, 96)}.`
134
+ : `Current goal: ${compactContextValue(context.session.currentGoal, 120)}.`;
135
+ return [
136
+ "LongTable workspace detected; research context restored.",
137
+ primaryContext,
138
+ context.session.nextAction ? `Next action: ${compactContextValue(context.session.nextAction)}.` : "",
139
+ context.session.protectedDecision ? "Protected decision: active; full text is in `.longtable/` and `CURRENT.md`." : ""
140
+ ].filter(Boolean);
141
+ }
124
142
  const lines = [
125
143
  "LongTable workspace detected.",
126
144
  `Current goal: ${context.session.currentGoal}.`,
@@ -160,7 +178,8 @@ function sessionStartContext(runtime) {
160
178
  const blockingQuestion = pendingRequiredQuestions(runtime.state)[0];
161
179
  const blockingObligation = pendingObligations(runtime.state)[0];
162
180
  const interview = activeInterviewHook(runtime.state);
163
- const sections = [buildWorkspaceSummary(runtime).join("\n")];
181
+ const needsDetailedSummary = Boolean(blockingQuestion || blockingObligation);
182
+ const sections = [buildWorkspaceSummary(runtime, needsDetailedSummary ? "full" : "compact").join("\n")];
164
183
  if (blockingQuestion) {
165
184
  sections.push(buildPendingQuestionContext(blockingQuestion));
166
185
  }
@@ -240,10 +259,6 @@ function stopOutput(runtime) {
240
259
  if (blockingObligation) {
241
260
  return buildStopBlockOutput("A LongTable research obligation is still pending.");
242
261
  }
243
- const interview = activeInterviewHook(runtime.state);
244
- if (interview) {
245
- return buildStopBlockOutput("A LongTable interview is still active and should not be closed silently.");
246
- }
247
262
  return null;
248
263
  }
249
264
  export async function dispatchCodexHook(payload, cwdOverride) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longtable/cli",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "private": false,
5
5
  "description": "Researcher-facing LongTable CLI",
6
6
  "type": "module",
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@clack/prompts": "^1.2.0",
32
- "@longtable/checkpoints": "0.1.33",
33
- "@longtable/core": "0.1.33",
34
- "@longtable/memory": "0.1.33",
35
- "@longtable/provider-claude": "0.1.33",
36
- "@longtable/provider-codex": "0.1.33",
37
- "@longtable/setup": "0.1.33"
32
+ "@longtable/checkpoints": "0.1.34",
33
+ "@longtable/core": "0.1.34",
34
+ "@longtable/memory": "0.1.34",
35
+ "@longtable/provider-claude": "0.1.34",
36
+ "@longtable/provider-codex": "0.1.34",
37
+ "@longtable/setup": "0.1.34"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.1",