fwdloop 0.26.2 → 0.28.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.
Files changed (73) hide show
  1. package/bin/fwdloop +46 -7
  2. package/package.json +2 -2
  3. package/src/authoring.js +21 -1
  4. package/src/canrun.js +23 -0
  5. package/src/config.js +18 -0
  6. package/src/declaration.js +129 -3
  7. package/src/drafter.js +38 -10
  8. package/src/flow.js +2 -1
  9. package/src/launcher.js +4 -2
  10. package/src/learnstore.js +3 -2
  11. package/src/mcp-checks.js +50 -0
  12. package/src/mcp-pick.js +33 -0
  13. package/src/mcp-sources.js +84 -0
  14. package/src/mcp-use.js +54 -0
  15. package/src/natural.js +23 -0
  16. package/src/panel/author.js +17 -1
  17. package/src/panel/authorcard.js +35 -0
  18. package/src/panel/authorflows.js +15 -6
  19. package/src/panel/authorstart.js +10 -6
  20. package/src/panel/authortrigger.js +263 -82
  21. package/src/panel/data.js +127 -9
  22. package/src/panel/index.html +945 -94
  23. package/src/panel/jobgrid.js +127 -0
  24. package/src/panel/scheduler.js +48 -6
  25. package/src/panel/server.js +33 -8
  26. package/src/panel/settings.js +119 -4
  27. package/src/panel/tickets.js +118 -0
  28. package/src/primitives.js +34 -5
  29. package/src/runner.js +129 -15
  30. package/src/schedule.js +5 -0
  31. package/src/summary-words.js +27 -7
  32. package/src/ticket-draft.js +85 -0
  33. package/src/ticket-labels.js +75 -0
  34. package/src/ticket-mcp.js +89 -0
  35. package/src/ticket-next.js +33 -0
  36. package/src/ticket-shape.js +33 -0
  37. package/src/trigger-clock.js +4 -4
  38. package/src/trigger-files.js +4 -4
  39. package/src/trigger-line.js +2 -1
  40. package/src/trigger-tickets.js +238 -0
  41. package/types/authoring.d.ts +5 -1
  42. package/types/canrun.d.ts +7 -0
  43. package/types/config.d.ts +6 -0
  44. package/types/declaration.d.ts +8 -0
  45. package/types/drafter.d.ts +552 -21
  46. package/types/mcp-checks.d.ts +8 -0
  47. package/types/mcp-pick.d.ts +23 -0
  48. package/types/mcp-sources.d.ts +51 -0
  49. package/types/mcp-use.d.ts +12 -0
  50. package/types/natural.d.ts +2 -0
  51. package/types/panel/author.d.ts +44 -0
  52. package/types/panel/authorcard.d.ts +11 -0
  53. package/types/panel/authorflows.d.ts +11 -1
  54. package/types/panel/authorstart.d.ts +3 -1
  55. package/types/panel/authortrigger.d.ts +83 -7
  56. package/types/panel/data.d.ts +78 -5
  57. package/types/panel/jobgrid.d.ts +109 -0
  58. package/types/panel/scheduler.d.ts +7 -2
  59. package/types/panel/server.d.ts +13 -2
  60. package/types/panel/settings.d.ts +3 -2
  61. package/types/panel/tickets.d.ts +103 -0
  62. package/types/primitives.d.ts +15 -2
  63. package/types/runner.d.ts +133 -75
  64. package/types/summary-words.d.ts +24 -4
  65. package/types/ticket-draft.d.ts +104 -0
  66. package/types/ticket-labels.d.ts +42 -0
  67. package/types/ticket-mcp.d.ts +57 -0
  68. package/types/ticket-next.d.ts +23 -0
  69. package/types/ticket-shape.d.ts +30 -0
  70. package/types/trigger-clock.d.ts +4 -3
  71. package/types/trigger-files.d.ts +3 -1
  72. package/types/trigger-line.d.ts +7 -0
  73. package/types/trigger-tickets.d.ts +105 -0
@@ -95,7 +95,7 @@ export function draftKeyRefusal(slot: string, env: Record<string, string | undef
95
95
  * Test seam: `provider`/`rates`/`modelId` are injected; without them a live provider is built.
96
96
  * `onResult({ ok })` (M4d am32): called once, after the spend is booked and just before the result files are written (the CLI gives its monthly hold back there).
97
97
  */
98
- export function draftToDir({ proseFile, dir, root, name, slot, model, draftThinking, keyNames, env, provider, rates, modelId, noQuestions, onResult, fetchPage, leftRules, proseRead, }: {
98
+ export function draftToDir({ proseFile, dir, root, name, slot, model, draftThinking, keyNames, env, provider, rates, modelId, noQuestions, onResult, fetchPage, leftRules, proseRead, flowType, mcpServer, mcpPick, mcpServers, }: {
99
99
  proseFile: any;
100
100
  dir: any;
101
101
  root: any;
@@ -113,6 +113,10 @@ export function draftToDir({ proseFile, dir, root, name, slot, model, draftThink
113
113
  fetchPage: any;
114
114
  leftRules: any;
115
115
  proseRead: any;
116
+ flowType?: "mcp" | "plain" | "tickets" | undefined;
117
+ mcpServer?: string | undefined;
118
+ mcpPick?: any;
119
+ mcpServers?: string[] | undefined;
116
120
  }): Promise<{
117
121
  ok: boolean;
118
122
  wrote: boolean;
package/types/canrun.d.ts CHANGED
@@ -19,6 +19,13 @@ export function unwiredRed(found: {
19
19
  };
20
20
  verb: string;
21
21
  }): string;
22
+ /**
23
+ * M13 piece 4 (F105 rewritten): the first plan problem with the job's MCP tools, as the preflight sentence, or null. Two rules, both $0 and by name:
24
+ * a step may grant only a tool the job lists (`mcp.tools`); a generic MCP job (flowType `mcp`) needs at least one step granting at least one of them. A Tickets job's
25
+ * own tools (`issue_read`, `list_issues`) belong to the job (the frozen read and the look), so no step has to grant them. A job with no `mcp` block has nothing to check.
26
+ * @param {Record<string, any>} declaration `readFlow`'s declaration @returns {string|null}
27
+ */
28
+ export function findMcpPlanRed(declaration: Record<string, any>): string | null;
22
29
  /**
23
30
  * M4e amendment 23: the ONE function that turns "this step's check cannot be built" into a plain sentence. It reads the shape, never
24
31
  * bareguard's wording, so no `spec.` path or `checks[` index can reach a human. The steps are numbered by the job line they came from
package/types/config.d.ts CHANGED
@@ -31,6 +31,12 @@ export function configDoorHome(): {
31
31
  };
32
32
  /** One provider field's value problem in plain words, or null when fine. Shared by validateDoc and the route. */
33
33
  export function providerFieldProblem(field: any, v: any): string | null;
34
+ /**
35
+ * M13 piece 3: why a typed MCP config path cannot be kept in `mcpPaths`, or null: one rule for the Settings route and for the config reader.
36
+ * Absolute or `~/…`, one line of at most 500 characters.
37
+ * @param {unknown} p
38
+ */
39
+ export function mcpPathProblem(p: unknown): "must be a path to an MCP config file" | "must be one line of at most 500 characters" | "must start with / or ~/" | null;
34
40
  /**
35
41
  * THE one rule for a slot's model lines (M4d amendment 3 items 7-8), used by config validation and the Settings
36
42
  * route. A price is a PAIR (`inPerM` and `outPerM`, each a finite number >= 0 — 0 / 0 typed is a chosen price,
@@ -1,3 +1,9 @@
1
+ /**
2
+ * M13 piece 4: the ONE reader of a job's flow type. The field when present; a job signed before it existed (M12 shape: an `mcp` block, no `flowType`) is a Tickets
3
+ * job, since M12 only had ticket jobs; no `mcp` block is plain.
4
+ * @param {Record<string, any>} declaration @returns {'plain'|'mcp'|'tickets'}
5
+ */
6
+ export function flowTypeOf(declaration: Record<string, any>): "plain" | "mcp" | "tickets";
1
7
  /**
2
8
  * A small, pure walker over `declaration.steps` for callers that only want
3
9
  * the shape-key verdict (e.g. poc/m1/slot-batch.mjs's `shape` column) —
@@ -88,6 +94,8 @@ export function validateDeclaration(declaration: unknown, context?: {
88
94
  * kept in sync with the checks below so a mutation suite can assert it
89
95
  * tested every one of them (same trick as ARBITER_FIELDS/SIGNATURE_FIELDS). */
90
96
  export const DECLARATION_FIELDS: readonly string[];
97
+ /** M13 piece 4 (signed item 4): the job's flow type, set by code from the job card, signed with the job. */
98
+ export const FLOW_TYPES: readonly string[];
91
99
  /** The typed `close.shape` vocabulary, signed by hamr 2026-09-23 (v1):
92
100
  * exactly these four top-level keys. Anything else inside `shape` reds by
93
101
  * name. */