@fragment-dev/cli 2026.6.4 → 2026.6.5-1
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 +31 -5
- package/dist/{chunk-E7E3SSNY.js → chunk-3Z7YOSNF.js} +7 -7
- package/dist/chunk-4GF5BFDU.js +6091 -0
- package/dist/{chunk-Q6HQVMXZ.js → chunk-4GFUVXOU.js} +1 -1
- package/dist/chunk-4NJIQ4GG.js +168 -0
- package/dist/{chunk-CSSMGU2E.js → chunk-54TES6VA.js} +2 -2
- package/dist/{chunk-VGJJO3TO.js → chunk-5DN7VDST.js} +3 -3
- package/dist/{chunk-6NRTWULL.js → chunk-5HHWLQQP.js} +3 -5
- package/dist/{chunk-HNECLJVK.js → chunk-65ZH3QK2.js} +5 -5
- package/dist/{chunk-FLOP7UZS.js → chunk-66AHNAX3.js} +3 -3
- package/dist/chunk-66MJVSVR.js +14200 -0
- package/dist/{chunk-WXUF6LL2.js → chunk-6OHUBHOM.js} +1 -1
- package/dist/{chunk-WCMNBPIT.js → chunk-7ANSQIHO.js} +3 -3
- package/dist/{chunk-SNADJKMJ.js → chunk-7ODKTNDM.js} +2 -2
- package/dist/{chunk-X34FYDI4.js → chunk-7VZGNWZU.js} +3 -3
- package/dist/chunk-BRU5ITZE.js +229 -0
- package/dist/{chunk-L3ZNGAPY.js → chunk-F3APAVQ6.js} +2 -2
- package/dist/{chunk-5TQBOAE7.js → chunk-HLYDHSCC.js} +177 -187
- package/dist/{chunk-VZ2CPEPR.js → chunk-IDKZFORS.js} +3 -3
- package/dist/{chunk-WMPWO3EU.js → chunk-IH5353LR.js} +3 -3
- package/dist/{chunk-C7YTQ6BB.js → chunk-KITXRL7V.js} +3 -3
- package/dist/{chunk-RCIUPDRC.js → chunk-KRY3SN6D.js} +1 -1
- package/dist/{chunk-WAPUAO2X.js → chunk-KWPWX7YO.js} +3 -3
- package/dist/{chunk-WWS2QAQ3.js → chunk-LUXIPN36.js} +2 -2
- package/dist/{chunk-FCTATTYL.js → chunk-MH2TBRE7.js} +5 -5
- package/dist/{chunk-Z2CERENO.js → chunk-MJFFSZAZ.js} +4 -4
- package/dist/{chunk-UDU5PBTV.js → chunk-O7AE4SQS.js} +1 -1
- package/dist/chunk-OAOBQSDM.js +9275 -0
- package/dist/{chunk-RNNM3ZIP.js → chunk-OQT45AYL.js} +1 -1
- package/dist/{chunk-MBAU3K3S.js → chunk-PYQBNBYQ.js} +2 -2
- package/dist/{chunk-LJSFUVJW.js → chunk-QG5ISRA6.js} +4 -4
- package/dist/{chunk-KVUTOGXI.js → chunk-SHOJMF7A.js} +32 -27
- package/dist/{chunk-ZMR35FCP.js → chunk-THGLXMNF.js} +26158 -35276
- package/dist/{chunk-7DLF4ROM.js → chunk-TLN6TZFS.js} +282 -3634
- package/dist/{chunk-DR6JWXVF.js → chunk-TUJDC72W.js} +3 -3
- package/dist/{chunk-VEL3UEZV.js → chunk-VPS4SSBG.js} +5 -5
- package/dist/chunk-W6O4UGRF.js +3517 -0
- package/dist/{chunk-UMIILSMO.js → chunk-X35DOMX4.js} +5 -5
- package/dist/{chunk-WWUN4GV2.js → chunk-XIZTVCPY.js} +3 -3
- package/dist/{chunk-M5OAS5QZ.js → chunk-XK2D2Z44.js} +3 -3
- package/dist/{chunk-UV7STDIC.js → chunk-Y3ACGBDY.js} +3 -3
- package/dist/{chunk-J2FNJFQG.js → chunk-Y5I74W3X.js} +7 -7
- package/dist/chunk-YEZSTJP5.js +120 -0
- package/dist/{chunk-EJ7BSQ4G.js → chunk-YFK5FYC3.js} +3 -3
- package/dist/{chunk-M5X3GRYG.js → chunk-ZA25L4BB.js} +2 -2
- package/dist/{chunk-73ZTML2E.js → chunk-ZMFGVGZP.js} +1 -1
- package/dist/commands/add-ledger-entry.js +10 -8
- package/dist/commands/create-custom-link.js +10 -8
- package/dist/commands/create-ledger.js +10 -8
- package/dist/commands/delete-custom-txs.js +10 -8
- package/dist/commands/delete-ledger.js +10 -8
- package/dist/commands/delete-schema.js +10 -8
- package/dist/commands/designer-mcp.js +19 -0
- package/dist/commands/gen-graphql.js +15 -13
- package/dist/commands/get-schema.js +12 -9
- package/dist/commands/init.js +9 -7
- package/dist/commands/login.js +11 -8
- package/dist/commands/migrate-ledger-entry.js +10 -8
- package/dist/commands/query/ledgerAccounts.js +10 -8
- package/dist/commands/query/ledgers.js +10 -8
- package/dist/commands/query/schema.js +10 -8
- package/dist/commands/query/schemas.js +10 -8
- package/dist/commands/reverse-ledger-entry.js +10 -8
- package/dist/commands/start.js +9 -7
- package/dist/commands/store-schema.js +10 -8
- package/dist/commands/token.js +10 -8
- package/dist/commands/update-ledger-account.js +10 -8
- package/dist/commands/update.js +11 -8
- package/dist/commands/verify-schema.js +14 -12
- package/dist/commands/workspace.js +10 -8
- package/dist/commands.js +44 -40
- package/dist/designer/commandQueue.js +7 -0
- package/dist/designer/mcpServer.js +8 -0
- package/dist/designer/server.js +13557 -0
- package/dist/graphql.js +5 -6
- package/dist/index.js +44 -40
- package/dist/lib/auth.js +3 -2
- package/dist/lib/authenticatedCommand.js +9 -7
- package/dist/lib/baseCommand.js +8 -6
- package/dist/lib/errors.js +2 -2
- package/dist/utils/formatValidationErrors.js +5 -4
- package/dist/utils/schemaValidation.js +8 -7
- package/dist/utils.js +2 -2
- package/dist/version.js +3 -2
- package/oclif.manifest.json +44 -1
- package/package.json +10 -7
- package/dist/chunk-GWFXCSSY.js +0 -2018
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
init_cjs_shims
|
|
3
|
+
} from "./chunk-7GH3YGSC.js";
|
|
4
|
+
|
|
5
|
+
// src/designer/commandQueue.ts
|
|
6
|
+
init_cjs_shims();
|
|
7
|
+
import { randomUUID } from "node:crypto";
|
|
8
|
+
|
|
9
|
+
// ../../libs/designer-mcp-protocol/index.ts
|
|
10
|
+
init_cjs_shims();
|
|
11
|
+
var DESIGNER_BRIDGE_VERSION = 5;
|
|
12
|
+
var DESIGNER_POLL_TIMEOUT_MS = 25e3;
|
|
13
|
+
var DESIGNER_COMMAND_TIMEOUT_MS = 3e4;
|
|
14
|
+
|
|
15
|
+
// src/designer/commandQueue.ts
|
|
16
|
+
var DEFAULT_COMMAND_TIMEOUT_MS = DESIGNER_COMMAND_TIMEOUT_MS;
|
|
17
|
+
var DEFAULT_POLL_TIMEOUT_MS = DESIGNER_POLL_TIMEOUT_MS;
|
|
18
|
+
var REDELIVERY_GRACE_MS = 5e3;
|
|
19
|
+
var createCommandQueue = () => {
|
|
20
|
+
const pending = /* @__PURE__ */ new Map();
|
|
21
|
+
const waiters = [];
|
|
22
|
+
let dashboardLastSeenMs = 0;
|
|
23
|
+
let closed = false;
|
|
24
|
+
const markDashboardSeen = () => {
|
|
25
|
+
dashboardLastSeenMs = Date.now();
|
|
26
|
+
};
|
|
27
|
+
const isRedeliverable = (entry, now) => entry.deliveredAtMs === void 0 || now - entry.deliveredAtMs >= REDELIVERY_GRACE_MS;
|
|
28
|
+
const takeDeliverable = (now) => {
|
|
29
|
+
const batch = [];
|
|
30
|
+
pending.forEach((entry) => {
|
|
31
|
+
if (isRedeliverable(entry, now)) {
|
|
32
|
+
entry.deliveredAtMs = now;
|
|
33
|
+
batch.push(entry.command);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return batch;
|
|
37
|
+
};
|
|
38
|
+
const nextRedeliveryDelay = (now) => {
|
|
39
|
+
let soonest;
|
|
40
|
+
pending.forEach((entry) => {
|
|
41
|
+
if (entry.deliveredAtMs === void 0)
|
|
42
|
+
return;
|
|
43
|
+
const readyIn = entry.deliveredAtMs + REDELIVERY_GRACE_MS - now;
|
|
44
|
+
if (readyIn > 0 && (soonest === void 0 || readyIn < soonest)) {
|
|
45
|
+
soonest = readyIn;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return soonest;
|
|
49
|
+
};
|
|
50
|
+
const failPending = (id, error) => {
|
|
51
|
+
const entry = pending.get(id);
|
|
52
|
+
if (!entry) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
clearTimeout(entry.timer);
|
|
56
|
+
pending.delete(id);
|
|
57
|
+
entry.resolve({ id, ok: false, error });
|
|
58
|
+
};
|
|
59
|
+
const deliverPendingToWaiter = () => {
|
|
60
|
+
if (waiters.length === 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const batch = takeDeliverable(Date.now());
|
|
64
|
+
if (batch.length === 0) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const waiter = waiters.shift();
|
|
68
|
+
if (!waiter) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
clearTimeout(waiter.timer);
|
|
72
|
+
waiter.resolve(batch);
|
|
73
|
+
};
|
|
74
|
+
const enqueue = (name, args, timeoutMs = DEFAULT_COMMAND_TIMEOUT_MS) => new Promise((resolve) => {
|
|
75
|
+
if (closed) {
|
|
76
|
+
const id = randomUUID();
|
|
77
|
+
resolve({
|
|
78
|
+
id,
|
|
79
|
+
ok: false,
|
|
80
|
+
error: "Designer MCP server shutting down"
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const command = {
|
|
85
|
+
id: randomUUID(),
|
|
86
|
+
name,
|
|
87
|
+
args,
|
|
88
|
+
issuedAtMs: Date.now()
|
|
89
|
+
};
|
|
90
|
+
const timer = setTimeout(() => {
|
|
91
|
+
failPending(
|
|
92
|
+
command.id,
|
|
93
|
+
"Dashboard did not respond in time. Is the schema designer open?"
|
|
94
|
+
);
|
|
95
|
+
}, timeoutMs);
|
|
96
|
+
timer.unref?.();
|
|
97
|
+
pending.set(command.id, { command, resolve, timer });
|
|
98
|
+
deliverPendingToWaiter();
|
|
99
|
+
});
|
|
100
|
+
const drainForPoll = (timeoutMs = DEFAULT_POLL_TIMEOUT_MS) => new Promise((resolve) => {
|
|
101
|
+
markDashboardSeen();
|
|
102
|
+
const batch = takeDeliverable(Date.now());
|
|
103
|
+
if (batch.length > 0) {
|
|
104
|
+
resolve(batch);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const redeliveryDelay = nextRedeliveryDelay(Date.now());
|
|
108
|
+
const waitMs = redeliveryDelay === void 0 ? timeoutMs : Math.min(timeoutMs, redeliveryDelay);
|
|
109
|
+
const timer = setTimeout(() => {
|
|
110
|
+
const idx = waiters.indexOf(waiter);
|
|
111
|
+
if (idx !== -1) {
|
|
112
|
+
waiters.splice(idx, 1);
|
|
113
|
+
}
|
|
114
|
+
resolve(takeDeliverable(Date.now()));
|
|
115
|
+
}, waitMs);
|
|
116
|
+
timer.unref?.();
|
|
117
|
+
const waiter = { resolve, timer };
|
|
118
|
+
waiters.push(waiter);
|
|
119
|
+
});
|
|
120
|
+
const resolveCommand = (response) => {
|
|
121
|
+
const entry = pending.get(response.id);
|
|
122
|
+
if (!entry) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
clearTimeout(entry.timer);
|
|
126
|
+
pending.delete(response.id);
|
|
127
|
+
entry.resolve(response);
|
|
128
|
+
return true;
|
|
129
|
+
};
|
|
130
|
+
const getDashboardLastSeenMs = () => dashboardLastSeenMs;
|
|
131
|
+
const isDashboardConnected = (staleThresholdMs = DEFAULT_COMMAND_TIMEOUT_MS) => {
|
|
132
|
+
if (dashboardLastSeenMs === 0)
|
|
133
|
+
return false;
|
|
134
|
+
return Date.now() - dashboardLastSeenMs < staleThresholdMs;
|
|
135
|
+
};
|
|
136
|
+
const shutdown = () => {
|
|
137
|
+
closed = true;
|
|
138
|
+
pending.forEach((entry, id) => {
|
|
139
|
+
clearTimeout(entry.timer);
|
|
140
|
+
entry.resolve({
|
|
141
|
+
id,
|
|
142
|
+
ok: false,
|
|
143
|
+
error: "Designer MCP server shutting down"
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
pending.clear();
|
|
147
|
+
waiters.forEach((waiter) => {
|
|
148
|
+
clearTimeout(waiter.timer);
|
|
149
|
+
waiter.resolve([]);
|
|
150
|
+
});
|
|
151
|
+
waiters.length = 0;
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
enqueue,
|
|
155
|
+
drainForPoll,
|
|
156
|
+
resolveCommand,
|
|
157
|
+
markDashboardSeen,
|
|
158
|
+
getDashboardLastSeenMs,
|
|
159
|
+
isDashboardConnected,
|
|
160
|
+
shutdown
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export {
|
|
165
|
+
DESIGNER_BRIDGE_VERSION,
|
|
166
|
+
DESIGNER_POLL_TIMEOUT_MS,
|
|
167
|
+
createCommandQueue
|
|
168
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inquirer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TLN6TZFS.js";
|
|
4
4
|
import {
|
|
5
5
|
FragmentCommand,
|
|
6
6
|
require_lib
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-THGLXMNF.js";
|
|
8
8
|
import {
|
|
9
9
|
require_source
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XK2D2Z44.js";
|
|
11
11
|
import {
|
|
12
12
|
__toESM,
|
|
13
13
|
init_cjs_shims
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getStructuralPath,
|
|
6
6
|
getStructuralSubpaths,
|
|
7
7
|
getSubpaths
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OQT45AYL.js";
|
|
9
9
|
import {
|
|
10
10
|
BadRequestError,
|
|
11
11
|
CurrencyMatchInputSchema,
|
|
@@ -19,11 +19,9 @@ import {
|
|
|
19
19
|
assertIsError,
|
|
20
20
|
assert_default,
|
|
21
21
|
currencyCodes,
|
|
22
|
-
safe
|
|
23
|
-
} from "./chunk-GWFXCSSY.js";
|
|
24
|
-
import {
|
|
22
|
+
safe,
|
|
25
23
|
z
|
|
26
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4GF5BFDU.js";
|
|
27
25
|
import {
|
|
28
26
|
__commonJS,
|
|
29
27
|
__toESM,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inquirer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TLN6TZFS.js";
|
|
4
4
|
import {
|
|
5
5
|
FragmentCommand,
|
|
6
6
|
require_lib
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-THGLXMNF.js";
|
|
8
|
+
import {
|
|
9
|
+
require_source
|
|
10
|
+
} from "./chunk-XK2D2Z44.js";
|
|
8
11
|
import {
|
|
9
12
|
FRAGMENT_ACCESS_TOKEN_PATH,
|
|
10
13
|
FRAGMENT_AUTH_PATH
|
|
11
14
|
} from "./chunk-WS2PJBP6.js";
|
|
12
|
-
import {
|
|
13
|
-
require_source
|
|
14
|
-
} from "./chunk-M5OAS5QZ.js";
|
|
15
15
|
import {
|
|
16
16
|
__toESM,
|
|
17
17
|
init_cjs_shims
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthenticatedCommand
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LUXIPN36.js";
|
|
4
4
|
import {
|
|
5
5
|
require_lib
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-THGLXMNF.js";
|
|
7
7
|
import {
|
|
8
8
|
require_source
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XK2D2Z44.js";
|
|
10
10
|
import {
|
|
11
11
|
__toESM,
|
|
12
12
|
init_cjs_shims
|