@structured-vibe-coding/core 0.22.0 → 0.24.0

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.
@@ -26,10 +26,10 @@ import {
26
26
  renderProtocolMd,
27
27
  renderThinAgent,
28
28
  writeAgentHandoff
29
- } from "./chunk-WCYVBZC4.js";
30
- import "./chunk-QE6RMJUS.js";
29
+ } from "./chunk-GIWXIQAT.js";
30
+ import "./chunk-3PYYDI7O.js";
31
31
  import "./chunk-TNWFMRIA.js";
32
- import "./chunk-47GWMUCR.js";
32
+ import "./chunk-II6LQZ7T.js";
33
33
  import "./chunk-4BRO7BOJ.js";
34
34
  import "./chunk-O5SP6X5R.js";
35
35
  export {
@@ -9,7 +9,7 @@ import {
9
9
  SddError,
10
10
  callMcpSourceTool,
11
11
  mcpTimeoutMs
12
- } from "./chunk-47GWMUCR.js";
12
+ } from "./chunk-II6LQZ7T.js";
13
13
  import {
14
14
  loadMcpConfig
15
15
  } from "./chunk-4BRO7BOJ.js";
@@ -3505,7 +3505,7 @@ async function buildAgentPrompt(ctx, config, projectRoot, budget, runtime) {
3505
3505
  }
3506
3506
  try {
3507
3507
  const { loadMcpConfig: loadMcpConfig2 } = await import("./sources-3TXUPU6V.js");
3508
- const { gatherMcpContextForChange, formatMcpContextForHandoff } = await import("./gather-ZK722X65.js");
3508
+ const { gatherMcpContextForChange, formatMcpContextForHandoff } = await import("./gather-67RBCTS3.js");
3509
3509
  const mcpCfg = await loadMcpConfig2(projectRoot);
3510
3510
  if (mcpCfg.auto_fetch_on_handoff && mcpCfg.sources.length) {
3511
3511
  const fetched = await gatherMcpContextForChange(projectRoot, ctx);
@@ -4,7 +4,7 @@ import {
4
4
  gitUserName,
5
5
  loadConfig,
6
6
  readTeamConfig
7
- } from "./chunk-QE6RMJUS.js";
7
+ } from "./chunk-3PYYDI7O.js";
8
8
  import {
9
9
  ChangeMetaSchema,
10
10
  activeStages,
@@ -1025,7 +1025,7 @@ async function createChange(input) {
1025
1025
  await materializeStageArtifacts(projectRoot, config, id, workflow, meta, firstStage);
1026
1026
  await setActiveChange(projectRoot, config, id);
1027
1027
  try {
1028
- const { refreshActiveAgentContext } = await import("./agents-EDCIINXG.js");
1028
+ const { refreshActiveAgentContext } = await import("./agents-X77B4L5E.js");
1029
1029
  await refreshActiveAgentContext(projectRoot);
1030
1030
  } catch {
1031
1031
  }
@@ -1127,7 +1127,7 @@ async function advanceStage(projectRoot, config, changeId, opts) {
1127
1127
  stage2
1128
1128
  );
1129
1129
  try {
1130
- const { refreshActiveAgentContext } = await import("./agents-EDCIINXG.js");
1130
+ const { refreshActiveAgentContext } = await import("./agents-X77B4L5E.js");
1131
1131
  await refreshActiveAgentContext(projectRoot);
1132
1132
  } catch {
1133
1133
  }
@@ -1184,7 +1184,7 @@ async function advanceStage(projectRoot, config, changeId, opts) {
1184
1184
  stage
1185
1185
  );
1186
1186
  try {
1187
- const { refreshActiveAgentContext } = await import("./agents-EDCIINXG.js");
1187
+ const { refreshActiveAgentContext } = await import("./agents-X77B4L5E.js");
1188
1188
  await refreshActiveAgentContext(projectRoot);
1189
1189
  } catch {
1190
1190
  }
@@ -1317,7 +1317,7 @@ async function completeChange(projectRoot, config, changeId) {
1317
1317
  let promoted;
1318
1318
  if (ctx.meta.workflow === "greenfield" || ctx.meta.flags?.greenfield === true) {
1319
1319
  try {
1320
- const { promoteGreenfieldToMemory: promoteGreenfieldToMemory2 } = await import("./greenfield-E5CHDQPH.js");
1320
+ const { promoteGreenfieldToMemory: promoteGreenfieldToMemory2 } = await import("./greenfield-TKZDNFEI.js");
1321
1321
  promoted = await promoteGreenfieldToMemory2(projectRoot, config, changeId);
1322
1322
  } catch {
1323
1323
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  callMcpSourceTool
3
- } from "./chunk-47GWMUCR.js";
3
+ } from "./chunk-II6LQZ7T.js";
4
4
  import {
5
5
  interpolateArgs,
6
6
  loadMcpConfig
@@ -6,7 +6,7 @@ import {
6
6
  loadConfig,
7
7
  readRole,
8
8
  readTeamConfig
9
- } from "./chunk-QE6RMJUS.js";
9
+ } from "./chunk-3PYYDI7O.js";
10
10
  import {
11
11
  buildContext,
12
12
  defaultMemoryDir,
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-TNWFMRIA.js";
15
15
  import {
16
16
  SddError
17
- } from "./chunk-47GWMUCR.js";
17
+ } from "./chunk-II6LQZ7T.js";
18
18
  import {
19
19
  configPath,
20
20
  guidancePaths,
@@ -38,7 +38,7 @@ function toProcessEnv(base, extra) {
38
38
  }
39
39
 
40
40
  // src/version.ts
41
- var SDD_CORE_VERSION = "0.22.0" ? "0.22.0" : "0.0.0-dev";
41
+ var SDD_CORE_VERSION = "0.24.0" ? "0.24.0" : "0.0.0-dev";
42
42
 
43
43
  // src/mcp/client.ts
44
44
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
@@ -3,8 +3,8 @@ import {
3
3
  gatherMcpContext,
4
4
  gatherMcpContextForChange,
5
5
  listMatchingSourceIds
6
- } from "./chunk-RXVTVLCJ.js";
7
- import "./chunk-47GWMUCR.js";
6
+ } from "./chunk-DLH3OAMG.js";
7
+ import "./chunk-II6LQZ7T.js";
8
8
  import "./chunk-4BRO7BOJ.js";
9
9
  import "./chunk-O5SP6X5R.js";
10
10
  export {
@@ -6,10 +6,10 @@ import {
6
6
  startFeatureFromBacklog,
7
7
  startGreenfield,
8
8
  updateFeatureStatus
9
- } from "./chunk-XHNO536D.js";
10
- import "./chunk-QE6RMJUS.js";
9
+ } from "./chunk-65OM2YBU.js";
10
+ import "./chunk-3PYYDI7O.js";
11
11
  import "./chunk-TNWFMRIA.js";
12
- import "./chunk-47GWMUCR.js";
12
+ import "./chunk-II6LQZ7T.js";
13
13
  import "./chunk-4BRO7BOJ.js";
14
14
  import "./chunk-O5SP6X5R.js";
15
15
  export {
package/dist/index.d.ts CHANGED
@@ -3392,12 +3392,30 @@ type IssueRead = {
3392
3392
  interface IssueSource {
3393
3393
  read(number: number): Promise<IssueRead>;
3394
3394
  }
3395
+ interface TrackerRecord {
3396
+ id: string;
3397
+ title: string;
3398
+ state: string;
3399
+ }
3400
+ type TrackerRead = {
3401
+ ok: true;
3402
+ record: TrackerRecord;
3403
+ } | {
3404
+ ok: false;
3405
+ missing: boolean;
3406
+ };
3407
+ interface TrackerSource {
3408
+ read(id: string): Promise<TrackerRead>;
3409
+ }
3395
3410
  declare function ghIssueSource(): IssueSource;
3396
3411
  declare function readConnector(input: {
3397
3412
  verb: string;
3398
3413
  connector: string;
3399
3414
  record: string;
3400
3415
  source?: IssueSource;
3416
+ tracker?: TrackerSource;
3417
+ projectRoot?: string;
3418
+ config?: Config;
3401
3419
  }): Promise<RoleCommandResult>;
3402
3420
  declare function runRoutine(root: string, roleName: string, routineName: string, source?: IssueSource): Promise<RoleCommandResult>;
3403
3421
 
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  gatherMcpContextForChange,
6
6
  listMatchingSourceIds,
7
7
  matchMcpSources
8
- } from "./chunk-RXVTVLCJ.js";
8
+ } from "./chunk-DLH3OAMG.js";
9
9
  import {
10
10
  AGENT_INTEGRATIONS,
11
11
  AGENT_TARGET_OPTIONS,
@@ -47,7 +47,7 @@ import {
47
47
  renderThinAgent,
48
48
  saveGeneratedManifest,
49
49
  writeAgentHandoff
50
- } from "./chunk-WCYVBZC4.js";
50
+ } from "./chunk-GIWXIQAT.js";
51
51
  import {
52
52
  ChangeMetricsSchema,
53
53
  DecisionMetricSchema,
@@ -81,7 +81,7 @@ import {
81
81
  switchWorkflow,
82
82
  transitionPhase,
83
83
  updateFeatureStatus
84
- } from "./chunk-XHNO536D.js";
84
+ } from "./chunk-65OM2YBU.js";
85
85
  import {
86
86
  EMBEDDINGS_UNAVAILABLE,
87
87
  EMBEDDING_MODEL,
@@ -173,7 +173,7 @@ import {
173
173
  splitFrontmatter,
174
174
  workKind,
175
175
  writePackedCache
176
- } from "./chunk-QE6RMJUS.js";
176
+ } from "./chunk-3PYYDI7O.js";
177
177
  import {
178
178
  ArtifactDefSchema,
179
179
  ChangeMetaSchema,
@@ -228,7 +228,7 @@ import {
228
228
  mcpTimeoutMs,
229
229
  toProcessEnv,
230
230
  withMcpSource
231
- } from "./chunk-47GWMUCR.js";
231
+ } from "./chunk-II6LQZ7T.js";
232
232
  import {
233
233
  McpConfigSchema,
234
234
  McpInvokeSchema,
@@ -6185,6 +6185,14 @@ import { spawn as spawn5 } from "child_process";
6185
6185
  var X_LINE = "A connector cannot read or post on X.";
6186
6186
  var NOT_IN_SLICE = "That connector is not in this slice.";
6187
6187
  var DOES_NOT_RUN = "That connector action does not run in this slice.";
6188
+ var DRAFT_NEEDS_TEXT = "A draft needs text.";
6189
+ var BAD_TRACKER_ID = "A tracker record id is one line of text.";
6190
+ var TRACKERS = {
6191
+ jira: "Jira",
6192
+ aha: "Aha",
6193
+ asana: "Asana",
6194
+ "azure-devops": "Azure DevOps"
6195
+ };
6188
6196
  var BAD_NUMBER = "A GitHub issue number is a positive integer.";
6189
6197
  var QA_LINE = "A routine cannot write a QA result.";
6190
6198
  var BAD_ROUTINES = "Routines on this role are invalid.";
@@ -6208,6 +6216,22 @@ function missingLine(number) {
6208
6216
  function unreadLine(number) {
6209
6217
  return `GitHub issue ${number} could not be read.`;
6210
6218
  }
6219
+ function couldNotOpen(number) {
6220
+ return `A change could not be opened for GitHub issue ${number}.`;
6221
+ }
6222
+ function trackerMissing(name, id) {
6223
+ return `${name} record ${id} was not found.`;
6224
+ }
6225
+ function trackerUnread(name, id) {
6226
+ return `${name} record ${id} could not be read.`;
6227
+ }
6228
+ function unavailableTracker() {
6229
+ return {
6230
+ async read() {
6231
+ return { ok: false, missing: false };
6232
+ }
6233
+ };
6234
+ }
6211
6235
  function cleanLine(value) {
6212
6236
  if (typeof value !== "string") return null;
6213
6237
  const text2 = value.trim();
@@ -6273,7 +6297,36 @@ async function readConnector(input) {
6273
6297
  const connector = input.connector.trim();
6274
6298
  const record = input.record.trim();
6275
6299
  if (connector === "x") return fail9(X_LINE);
6276
- if (verb !== "read") return fail9(DOES_NOT_RUN);
6300
+ if (verb !== "read" && verb !== "seed" && verb !== "draft") return fail9(DOES_NOT_RUN);
6301
+ if (verb === "draft") {
6302
+ if (connector !== "slack" && connector !== "teams") return fail9(NOT_IN_SLICE);
6303
+ const text2 = cleanLine(record);
6304
+ if (!text2) return fail9(DRAFT_NEEDS_TEXT);
6305
+ return ok9(`${connector}
6306
+ ${text2}
6307
+ not sent`);
6308
+ }
6309
+ const trackerName = TRACKERS[connector];
6310
+ if (verb === "read" && trackerName) {
6311
+ const id = cleanLine(record);
6312
+ if (!id) return fail9(BAD_TRACKER_ID);
6313
+ const tracker = input.tracker ?? unavailableTracker();
6314
+ let read2;
6315
+ try {
6316
+ read2 = await tracker.read(id);
6317
+ } catch {
6318
+ return fail9(trackerUnread(trackerName, id));
6319
+ }
6320
+ if (!read2.ok) {
6321
+ return fail9(read2.missing ? trackerMissing(trackerName, id) : trackerUnread(trackerName, id));
6322
+ }
6323
+ const title2 = cleanLine(read2.record.title);
6324
+ const state2 = cleanLine(read2.record.state);
6325
+ if (read2.record.id !== id || !title2 || !state2) return fail9(trackerUnread(trackerName, id));
6326
+ return ok9(`${id}
6327
+ ${title2}
6328
+ ${state2}`);
6329
+ }
6277
6330
  if (connector !== "github-issue") return fail9(NOT_IN_SLICE);
6278
6331
  const number = positiveInteger(record);
6279
6332
  if (number === null) return fail9(BAD_NUMBER);
@@ -6289,7 +6342,22 @@ async function readConnector(input) {
6289
6342
  const title = cleanLine(read.issue.title);
6290
6343
  const state = cleanLine(read.issue.state);
6291
6344
  if (!title || !state) return fail9(unreadLine(number));
6292
- return ok9(threeLines({ number, title, state }));
6345
+ if (verb === "read") return ok9(threeLines({ number, title, state }));
6346
+ if (!input.projectRoot || !input.config) return fail9(couldNotOpen(number));
6347
+ try {
6348
+ const ctx = await createChange({
6349
+ projectRoot: input.projectRoot,
6350
+ config: input.config,
6351
+ title,
6352
+ workflowName: "feature",
6353
+ epic: `issue-${number}`
6354
+ });
6355
+ return ok9(`${number}
6356
+ ${ctx.id}
6357
+ ${ctx.meta.stage}`);
6358
+ } catch {
6359
+ return fail9(couldNotOpen(number));
6360
+ }
6293
6361
  }
6294
6362
  function classifyRoutines(value) {
6295
6363
  if (!Array.isArray(value)) return { ok: false, reason: "invalid" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@structured-vibe-coding/core",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
4
  "description": "Core engine for sdd — Spec-Driven Development workflows, change packs, greenfield, and AI agent handoff (used by the sdd CLI)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",