@devinnn/docdrift 0.1.13 → 0.1.14

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.
@@ -101,13 +101,30 @@ async function runSetupLocal(options) {
101
101
  sessionUrl: "",
102
102
  };
103
103
  }
104
- /** Extract transcript text from session for fallback parsing */
104
+ /** Extract transcript text from session for fallback parsing when structured_output is empty */
105
105
  function getSessionTranscript(session) {
106
- const messages = session.messages ?? session.data?.messages;
106
+ const s = session;
107
+ const topLevel = (typeof s.output === "string" ? s.output : null) ?? (typeof s.result === "string" ? s.result : null) ?? (typeof s.transcript === "string" ? s.transcript : null);
108
+ if (topLevel)
109
+ return topLevel;
110
+ const data = s.data;
111
+ const messages = (session.messages ?? data?.messages ?? s.events);
107
112
  if (!Array.isArray(messages))
108
113
  return "";
109
114
  return messages
110
- .map((m) => (typeof m.content === "string" ? m.content : m.text ?? ""))
115
+ .map((m) => {
116
+ if (typeof m.content === "string")
117
+ return m.content;
118
+ if (typeof m.text === "string")
119
+ return m.text;
120
+ if (typeof m.message === "string")
121
+ return m.message;
122
+ if (typeof m.body === "string")
123
+ return m.body;
124
+ if (m.message && typeof m.message === "object" && typeof m.message.content === "string")
125
+ return m.message.content;
126
+ return "";
127
+ })
111
128
  .filter(Boolean)
112
129
  .join("\n");
113
130
  }
@@ -212,15 +229,16 @@ async function runSetupDevin(options) {
212
229
  max_acu_limit: 2,
213
230
  tags: ["docdrift", "setup"],
214
231
  attachments: [attachmentUrl],
215
- structured_output: {
216
- schema: schemas_1.SetupOutputSchema,
217
- },
232
+ structured_output_schema: schemas_1.SetupOutputSchema,
218
233
  metadata: { purpose: "docdrift-setup" },
219
234
  });
220
235
  process.stdout.write("Devin is analyzing the repo and generating config…\n");
221
236
  process.stdout.write(`Session: ${session.url}\n`);
222
237
  const finalSession = await (0, v1_1.pollUntilTerminal)(apiKey, session.session_id, 15 * 60_000);
223
238
  const result = parseSetupOutput(finalSession);
239
+ if (result?.summary && !(finalSession.structured_output ?? finalSession.data?.structured_output)) {
240
+ process.stdout.write(" (Parsed from session transcript — structured_output was empty; using strict-tag fallback)\n");
241
+ }
224
242
  if (!result) {
225
243
  throw new Error("Devin session did not return valid setup output. Check the session for details: " + session.url);
226
244
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devinnn/docdrift",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "description": "Detect and remediate documentation drift with Devin sessions",
6
6
  "main": "dist/src/index.js",