fifony 0.1.47 → 0.1.48

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 (89) hide show
  1. package/README.md +78 -0
  2. package/app/dist/assets/CommandPalette-CZDG20HW.js +1 -0
  3. package/app/dist/assets/{KeyboardShortcutsHelp-CqEFfGcE.js → KeyboardShortcutsHelp-TYhQc4aA.js} +1 -1
  4. package/app/dist/assets/OnboardingWizard-CQ9YmVIT.js +1 -0
  5. package/app/dist/assets/agents.lazy-CgakDm_P.js +1 -0
  6. package/app/dist/assets/analytics.lazy-C0rw3sov.js +1 -0
  7. package/app/dist/assets/{createLucideIcon-luywpIq4.js → createLucideIcon-B3bah5lk.js} +1 -1
  8. package/app/dist/assets/hooks-CNPue7d7.js +1 -0
  9. package/app/dist/assets/index-B8XCmr0-.css +1 -0
  10. package/app/dist/assets/index-Dfn02uW3.js +47 -0
  11. package/app/dist/assets/index.lazy-JdqhBwPd.js +44 -0
  12. package/app/dist/assets/services-CHpVij2M.css +1 -0
  13. package/app/dist/assets/services.lazy-BShKUCOt.js +12 -0
  14. package/app/dist/assets/vendor-X6HTElZW.js +9 -0
  15. package/app/dist/assets/viz-Dsh_q2DK.js +4 -0
  16. package/app/dist/index.html +5 -4
  17. package/app/dist/service-worker.js +32 -1
  18. package/dist/agent/run-local.js +89 -76
  19. package/dist/{agent-DFSFG6DG.js → agent-DJ4SCNBZ.js} +22 -17
  20. package/dist/{analytics-broadcaster-O4AE3RUK.js → analytics-broadcaster-INNYWHDJ.js} +25 -20
  21. package/dist/approve-plan.command-WE2CO3H2.js +21 -0
  22. package/dist/{chunk-HOIOVUHI.js → chunk-5M7PBFMZ.js} +8 -6
  23. package/dist/chunk-7R7XFXJM.js +1247 -0
  24. package/dist/{chunk-2PRRKBG6.js → chunk-A4P2MYJF.js} +22 -9
  25. package/dist/chunk-AFOV3ZAF.js +722 -0
  26. package/dist/chunk-AFP36N23.js +134 -0
  27. package/dist/{chunk-AAZKYWOY.js → chunk-AFYKGVSP.js} +103 -8
  28. package/dist/chunk-APJOZXRP.js +737 -0
  29. package/dist/chunk-DLSPRIQL.js +241 -0
  30. package/dist/{chunk-5AMWD66T.js → chunk-EDIPHR5B.js} +6 -4
  31. package/dist/{chunk-K36BWMUV.js → chunk-JU3MF3MW.js} +2526 -736
  32. package/dist/{chunk-7TXZYZR5.js → chunk-N5HCNY4O.js} +7 -5
  33. package/dist/{chunk-JRLWLZOD.js → chunk-NKMZYPIS.js} +31 -23
  34. package/dist/{chunk-PI7Y77R3.js → chunk-OFIVTM2E.js} +17 -7
  35. package/dist/{chunk-QH6VCTET.js → chunk-RCSJFMQG.js} +909 -98
  36. package/dist/{chunk-AAVROEQC.js → chunk-UR7T7IA6.js} +253 -349
  37. package/dist/{chunk-QHISYRXJ.js → chunk-VOYLU3MI.js} +57 -3
  38. package/dist/{chunk-EBCSQFPR.js → chunk-W5IULOWV.js} +2 -3
  39. package/dist/chunk-X37RNTWU.js +193 -0
  40. package/dist/{chunk-PACI3T4I.js → chunk-XY2APMDE.js} +13 -5
  41. package/dist/chunk-Z6ZWNWWR.js +34 -0
  42. package/dist/cli.js +45 -17
  43. package/dist/constants-AAP7ZGCX.js +124 -0
  44. package/dist/create-issue.command-SX3AXXIC.js +29 -0
  45. package/dist/fsm-agent-JGV22WK4.js +59 -0
  46. package/dist/{fsm-issue-EHTSKMFN.js → fsm-issue-LHIJM5VB.js} +12 -8
  47. package/dist/{fsm-service-7O4AJG2R.js → fsm-service-GGDKUTWS.js} +13 -4
  48. package/dist/{helpers-ON2S7UEF.js → helpers-AENVYEZJ.js} +6 -2
  49. package/dist/{issue-log-broadcaster-FZGVEEIX.js → issue-log-broadcaster-QQWM7LOV.js} +29 -18
  50. package/dist/{issues-3YNNTB4U.js → issues-RXFKKSXB.js} +10 -7
  51. package/dist/{log-analyzer-EIX6R6PP.js → log-analyzer-4LNXQISY.js} +30 -20
  52. package/dist/{logger-IFLXTQPS.js → logger-4F6ATWNA.js} +2 -1
  53. package/dist/mcp/server.js +6 -2
  54. package/dist/merge-workspace.command-ZNGIZC4O.js +29 -0
  55. package/dist/{parallel-executor-DWESCNX3.js → parallel-executor-OL5CB33L.js} +78 -19
  56. package/dist/{pid-manager-UBWXVSMD.js → pid-manager-EDT4DHAU.js} +2 -1
  57. package/dist/queue-workers-NSKIIMQ2.js +43 -0
  58. package/dist/replan-issue.command-73PETERX.js +21 -0
  59. package/dist/retry-issue.command-DIDP4OCS.js +21 -0
  60. package/dist/reverse-proxy-server-QSS3H4UH.js +97 -0
  61. package/dist/scheduler-5YORYECF.js +37 -0
  62. package/dist/service-log-broadcaster-JIUP2L3D.js +21 -0
  63. package/dist/{settings-SOTIS6ZD.js → settings-ZNDXYL46.js} +34 -23
  64. package/dist/settings.resource-OKUHXICJ.js +35 -0
  65. package/dist/{store-S3NAYZ3S.js → store-P3ACO6YA.js} +22 -17
  66. package/dist/telemetry-KVUFHDQS.js +828 -0
  67. package/dist/template-variants-HEPLYKMP.js +24 -0
  68. package/dist/trace-bundle-IJOV7IWH.js +41 -0
  69. package/dist/{web-push-QCTLS7EJ.js → web-push-X2LLMQ4M.js} +2 -1
  70. package/dist/websocket-Q2TUCIC2.js +103 -0
  71. package/dist/{workspace-OS7GPMCN.js → workspace-TDX3NJCX.js} +10 -6
  72. package/package.json +12 -9
  73. package/app/dist/assets/CommandPalette-CL8p78lG.js +0 -1
  74. package/app/dist/assets/OnboardingWizard-BmI50ZUv.js +0 -1
  75. package/app/dist/assets/analytics.lazy-CXGjZabc.js +0 -1
  76. package/app/dist/assets/index-CEaccpYh.js +0 -96
  77. package/app/dist/assets/index-CzzWGzux.css +0 -1
  78. package/app/dist/assets/vendor-uqBx3VSC.js +0 -9
  79. package/dist/approve-plan.command-QGQZZXTQ.js +0 -17
  80. package/dist/chunk-N4KFNX2G.js +0 -370
  81. package/dist/chunk-VM5QAYP5.js +0 -404
  82. package/dist/create-issue.command-VAKYRECC.js +0 -24
  83. package/dist/merge-workspace.command-T2NIGR4M.js +0 -24
  84. package/dist/queue-workers-V57BYXAY.js +0 -38
  85. package/dist/replan-issue.command-2GQ3QXCR.js +0 -17
  86. package/dist/retry-issue.command-GJBUUYDJ.js +0 -17
  87. package/dist/scheduler-KYILMWLD.js +0 -32
  88. package/dist/settings.resource-JMD3JQOS.js +0 -30
  89. package/dist/websocket-T2Y3BY4B.js +0 -61
@@ -0,0 +1,241 @@
1
+ import {
2
+ ALLOWED_STATES,
3
+ DEBUG_BOOT,
4
+ init_constants
5
+ } from "./chunk-X37RNTWU.js";
6
+ import {
7
+ __esm
8
+ } from "./chunk-Z6ZWNWWR.js";
9
+
10
+ // src/concerns/helpers.ts
11
+ import { env } from "process";
12
+ import { parse as parseYaml } from "yaml";
13
+ function now() {
14
+ return (/* @__PURE__ */ new Date()).toISOString();
15
+ }
16
+ function isoWeek(date) {
17
+ const d = date ? new Date(date) : /* @__PURE__ */ new Date();
18
+ if (Number.isNaN(d.getTime())) return "";
19
+ const tmp = new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()));
20
+ const dayNum = tmp.getUTCDay() || 7;
21
+ tmp.setUTCDate(tmp.getUTCDate() + 4 - dayNum);
22
+ const yearStart = new Date(Date.UTC(tmp.getUTCFullYear(), 0, 1));
23
+ const weekNo = Math.ceil(((tmp.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
24
+ return `${tmp.getUTCFullYear()}-W${String(weekNo).padStart(2, "0")}`;
25
+ }
26
+ function sleep(ms) {
27
+ return new Promise((resolve) => setTimeout(resolve, ms));
28
+ }
29
+ function resolveEnvVar(value) {
30
+ if (!value.startsWith("$")) return value;
31
+ const varName = value.slice(1);
32
+ const resolved = env[varName];
33
+ return resolved && resolved.trim().length > 0 ? resolved.trim() : "";
34
+ }
35
+ function toStringValue(value, fallback = "") {
36
+ if (typeof value !== "string" || value.trim().length === 0) return fallback;
37
+ const trimmed = value.trim();
38
+ if (trimmed.startsWith("$") && /^\$[A-Za-z_][A-Za-z0-9_]*$/.test(trimmed)) {
39
+ const resolved = resolveEnvVar(trimmed);
40
+ return resolved.length > 0 ? resolved : fallback;
41
+ }
42
+ return trimmed;
43
+ }
44
+ function toNumberValue(value, fallback = 1) {
45
+ const parsed = typeof value === "number" ? value : typeof value === "string" ? Number.parseInt(value, 10) : Number.NaN;
46
+ return Number.isFinite(parsed) && parsed > 0 ? Math.round(parsed) : fallback;
47
+ }
48
+ function toBooleanValue(value, fallback) {
49
+ return typeof value === "boolean" ? value : fallback;
50
+ }
51
+ function toStringArray(value) {
52
+ if (!Array.isArray(value)) return [];
53
+ return value.filter((entry) => typeof entry === "string" && entry.trim().length > 0).map((entry) => entry.trim());
54
+ }
55
+ function clamp(value, min, max) {
56
+ return Math.min(Math.max(value, min), max);
57
+ }
58
+ function parseIssueState(value) {
59
+ const raw = typeof value === "string" ? value.trim() : "";
60
+ if (ALLOWED_STATES.includes(raw)) {
61
+ return raw;
62
+ }
63
+ return void 0;
64
+ }
65
+ function normalizeState(value, fallback = "Planning") {
66
+ return parseIssueState(value) ?? fallback;
67
+ }
68
+ function parseEnvNumber(name, fallback) {
69
+ return toNumberValue(env[name], fallback);
70
+ }
71
+ function parseIntArg(value, fallback) {
72
+ const parsed = Number.parseInt(value, 10);
73
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
74
+ }
75
+ function parsePositiveIntEnv(name, fallback) {
76
+ const source = env[name];
77
+ if (!source) return fallback;
78
+ return parseIntArg(source, fallback);
79
+ }
80
+ function withRetryBackoff(attempt, baseDelayMs) {
81
+ return Math.min(baseDelayMs * 2 ** attempt, 5 * 60 * 1e3);
82
+ }
83
+ function idToSafePath(value) {
84
+ return value.toLowerCase().replace(/[^a-z0-9._-]/g, "-");
85
+ }
86
+ function appendFileTail(target, text, maxLength) {
87
+ const merged = `${target}
88
+ ${text}`;
89
+ if (merged.length <= maxLength) return merged;
90
+ return `\u2026${merged.slice(-(maxLength - 1))}`;
91
+ }
92
+ function parseFrontMatter(source) {
93
+ const match = source.match(/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);
94
+ if (!match) {
95
+ return { config: {}, body: source.trim() };
96
+ }
97
+ const rawConfig = parseYaml(match[1]);
98
+ const config = rawConfig && typeof rawConfig === "object" && !Array.isArray(rawConfig) ? rawConfig : {};
99
+ return { config, body: match[2].trim() };
100
+ }
101
+ function getNestedRecord(source, key) {
102
+ if (!source || typeof source !== "object" || Array.isArray(source)) return {};
103
+ const value = source[key];
104
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
105
+ }
106
+ function getNestedString(source, key, fallback = "") {
107
+ if (!source || typeof source !== "object" || Array.isArray(source)) return fallback;
108
+ return toStringValue(source[key], fallback);
109
+ }
110
+ function getNestedNumber(source, key, fallback) {
111
+ if (!source || typeof source !== "object" || Array.isArray(source)) return fallback;
112
+ return toNumberValue(source[key], fallback);
113
+ }
114
+ function debugBoot(message) {
115
+ if (!DEBUG_BOOT) return;
116
+ console.error(`[FIFONY_DEBUG_BOOT] ${message}`);
117
+ }
118
+ function fail(message) {
119
+ console.error(message);
120
+ process.exit(1);
121
+ }
122
+ function extractJsonObjects(text) {
123
+ const results = [];
124
+ let depth = 0;
125
+ let start = -1;
126
+ let inStr = false;
127
+ let esc = false;
128
+ for (let i = 0; i < text.length; i++) {
129
+ const ch = text[i];
130
+ if (inStr) {
131
+ if (esc) {
132
+ esc = false;
133
+ continue;
134
+ }
135
+ if (ch === "\\") {
136
+ esc = true;
137
+ continue;
138
+ }
139
+ if (ch === '"') {
140
+ inStr = false;
141
+ }
142
+ continue;
143
+ }
144
+ if (ch === '"') {
145
+ inStr = true;
146
+ continue;
147
+ }
148
+ if (ch === "{") {
149
+ if (depth === 0) start = i;
150
+ depth++;
151
+ } else if (ch === "}") {
152
+ depth = Math.max(0, depth - 1);
153
+ if (depth === 0 && start >= 0) {
154
+ results.push(text.slice(start, i + 1));
155
+ start = -1;
156
+ }
157
+ }
158
+ }
159
+ return results;
160
+ }
161
+ function repairTruncatedJson(text) {
162
+ const firstBrace = text.indexOf("{");
163
+ if (firstBrace < 0) return null;
164
+ let json = text.slice(firstBrace);
165
+ let inStr = false;
166
+ let esc = false;
167
+ const stack = [];
168
+ for (let i = 0; i < json.length; i++) {
169
+ const ch = json[i];
170
+ if (inStr) {
171
+ if (esc) {
172
+ esc = false;
173
+ continue;
174
+ }
175
+ if (ch === "\\") {
176
+ esc = true;
177
+ continue;
178
+ }
179
+ if (ch === '"') {
180
+ inStr = false;
181
+ }
182
+ continue;
183
+ }
184
+ if (ch === '"') {
185
+ inStr = true;
186
+ continue;
187
+ }
188
+ if (ch === "{") stack.push("{");
189
+ else if (ch === "[") stack.push("[");
190
+ else if (ch === "}") {
191
+ if (stack.length > 0 && stack[stack.length - 1] === "{") stack.pop();
192
+ } else if (ch === "]") {
193
+ if (stack.length > 0 && stack[stack.length - 1] === "[") stack.pop();
194
+ }
195
+ }
196
+ if (!inStr && stack.length === 0) return json;
197
+ if (inStr) {
198
+ if (json.endsWith("\\")) json = json.slice(0, -1);
199
+ json += '"';
200
+ }
201
+ json = json.replace(/[,:\s]+$/, "");
202
+ while (stack.length > 0) {
203
+ const open = stack.pop();
204
+ json += open === "{" ? "}" : "]";
205
+ }
206
+ return json;
207
+ }
208
+ var init_helpers = __esm({
209
+ "src/concerns/helpers.ts"() {
210
+ init_constants();
211
+ }
212
+ });
213
+
214
+ export {
215
+ now,
216
+ isoWeek,
217
+ sleep,
218
+ toStringValue,
219
+ toNumberValue,
220
+ toBooleanValue,
221
+ toStringArray,
222
+ clamp,
223
+ parseIssueState,
224
+ normalizeState,
225
+ parseEnvNumber,
226
+ parseIntArg,
227
+ parsePositiveIntEnv,
228
+ withRetryBackoff,
229
+ idToSafePath,
230
+ appendFileTail,
231
+ parseFrontMatter,
232
+ getNestedRecord,
233
+ getNestedString,
234
+ getNestedNumber,
235
+ debugBoot,
236
+ fail,
237
+ extractJsonObjects,
238
+ repairTruncatedJson,
239
+ init_helpers
240
+ };
241
+ //# sourceMappingURL=chunk-DLSPRIQL.js.map
@@ -1,11 +1,13 @@
1
1
  import {
2
2
  transitionIssueCommand
3
- } from "./chunk-7TXZYZR5.js";
3
+ } from "./chunk-N5HCNY4O.js";
4
4
  import {
5
- TERMINAL_STATES
6
- } from "./chunk-VM5QAYP5.js";
5
+ TERMINAL_STATES,
6
+ init_constants
7
+ } from "./chunk-X37RNTWU.js";
7
8
 
8
9
  // src/commands/replan-issue.command.ts
10
+ init_constants();
9
11
  async function replanIssueCommand(input, deps) {
10
12
  const { issue } = input;
11
13
  if (issue.planningStatus === "planning") {
@@ -35,4 +37,4 @@ async function replanIssueCommand(input, deps) {
35
37
  export {
36
38
  replanIssueCommand
37
39
  };
38
- //# sourceMappingURL=chunk-5AMWD66T.js.map
40
+ //# sourceMappingURL=chunk-EDIPHR5B.js.map