@longtable/cli 0.1.33 → 0.1.35

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/README.md CHANGED
@@ -24,12 +24,31 @@ config, hooks, or provider runtime files without explicit setup approval.
24
24
 
25
25
  ## Primary Flow
26
26
 
27
+ Start Codex from the research folder. The provider uses the shell working
28
+ directory at process start as the session workspace.
29
+
27
30
  ```bash
28
31
  longtable setup --provider codex
29
32
  cd "<research-folder>"
30
33
  codex
31
34
  ```
32
35
 
36
+ You can use `codex -C "<research-folder>"` instead of `cd` plus `codex`.
37
+ Changing directories after Codex is already running does not change that
38
+ session's workspace root or rerun LongTable's `SessionStart` hook.
39
+
40
+ Examples:
41
+
42
+ ```bash
43
+ # macOS / Linux
44
+ codex -C "/Users/yourname/Research/My-Research-Project"
45
+ ```
46
+
47
+ ```powershell
48
+ # Windows PowerShell
49
+ codex -C "C:\Users\YourName\Documents\Research\My-Research-Project"
50
+ ```
51
+
33
52
  Then invoke `$longtable-interview` inside Codex.
34
53
 
35
54
  `longtable setup --provider codex` is the permission-first setup route. It asks
@@ -42,10 +61,12 @@ Return later:
42
61
 
43
62
  ```bash
44
63
  cd "<project-path>"
45
- longtable resume
46
64
  codex
47
65
  ```
48
66
 
67
+ Run `longtable resume` inside the project folder when you want a terminal
68
+ summary without starting a provider session.
69
+
49
70
  ## What `$longtable-interview` Creates
50
71
 
51
72
  ```text
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.35";
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.35",
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.35",
33
+ "@longtable/core": "0.1.35",
34
+ "@longtable/memory": "0.1.35",
35
+ "@longtable/provider-claude": "0.1.35",
36
+ "@longtable/provider-codex": "0.1.35",
37
+ "@longtable/setup": "0.1.35"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.1",