@mysten-incubation/devstack 0.2.0 → 0.3.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.
- package/dashboard-ui/assets/{grpc-a4usE3Nk.js → grpc-Clz0oOtc.js} +1 -1
- package/dashboard-ui/assets/{index-CRYJ4pru.js → index-Cmqv9kiU.js} +39 -33
- package/dashboard-ui/index.html +1 -1
- package/dist/api/run-stack-internal.mjs +1 -0
- package/dist/api/run-stack-internal.mjs.map +1 -1
- package/dist/build-integrations/playwright/config.d.mts +2 -1
- package/dist/build-integrations/playwright/config.mjs +1 -1
- package/dist/build-integrations/playwright/config.mjs.map +1 -1
- package/dist/build-integrations/vite/index.d.mts +39 -9
- package/dist/build-integrations/vite/index.mjs +47 -11
- package/dist/build-integrations/vite/index.mjs.map +1 -1
- package/dist/build-integrations/vitest/config.mjs +3 -4
- package/dist/build-integrations/vitest/config.mjs.map +1 -1
- package/dist/cli/doctor-probes.mjs +7 -2
- package/dist/cli/doctor-probes.mjs.map +1 -1
- package/dist/cli/main.mjs +2 -2
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/wirings/codegen.mjs +35 -35
- package/dist/cli/wirings/codegen.mjs.map +1 -1
- package/dist/cli/wirings/up.mjs +7 -0
- package/dist/cli/wirings/up.mjs.map +1 -1
- package/dist/orchestrators/boot.mjs +12 -2
- package/dist/orchestrators/boot.mjs.map +1 -1
- package/dist/orchestrators/codegen/service.mjs +23 -8
- package/dist/orchestrators/codegen/service.mjs.map +1 -1
- package/dist/plugins/dashboard/domain.mjs +18 -1
- package/dist/plugins/dashboard/domain.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/root.mjs +2 -2
- package/dist/plugins/dashboard/schema/root.mjs.map +1 -1
- package/dist/plugins/dashboard/schema/types.mjs +15 -2
- package/dist/plugins/dashboard/schema/types.mjs.map +1 -1
- package/dist/plugins/deepbook/index.d.mts +7 -3
- package/dist/plugins/deepbook/index.mjs +3 -3
- package/dist/plugins/deepbook/index.mjs.map +1 -1
- package/dist/plugins/sui/index.d.mts +10 -10
- package/dist/plugins/sui/move-summary-runner.mjs +29 -2
- package/dist/plugins/sui/move-summary-runner.mjs.map +1 -1
- package/dist/substrate/runtime/index.mjs +1 -0
- package/dist/substrate/runtime/lifecycle/file-watcher.d.mts +1 -0
- package/dist/substrate/runtime/lifecycle/file-watcher.mjs +54 -0
- package/dist/substrate/runtime/lifecycle/file-watcher.mjs.map +1 -0
- package/dist/substrate/runtime/lifecycle/index.mjs +1 -0
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs +76 -6
- package/dist/substrate/runtime/lifecycle/watch-attribution.mjs.map +1 -1
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs +2 -6
- package/dist/substrate/runtime/supervisor/start-supervisor.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -99,8 +99,8 @@ builder.queryType({ fields: (t) => ({
|
|
|
99
99
|
type: [SnapshotEntry],
|
|
100
100
|
resolve: (_parent, _args, ctx) => Effect.runPromise(ctx.domain.snapshots)
|
|
101
101
|
}),
|
|
102
|
-
/** DeepBook deployments: registry/admin/pool ids +
|
|
103
|
-
* state. (Pool prices / order books are chain-direct.) */
|
|
102
|
+
/** DeepBook deployments: registry/admin/pool ids + seed-liquidity
|
|
103
|
+
* state + Pyth feeds. (Pool prices / order books are chain-direct.) */
|
|
104
104
|
deepbookInfo: t.field({
|
|
105
105
|
type: [DeepbookInfo],
|
|
106
106
|
resolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.deepbook)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.mjs","names":[],"sources":["../../../../src/plugins/dashboard/schema/root.ts"],"sourcesContent":["// Dashboard root types — Query / Mutation / Subscription.\n//\n// Queries expose the live projection (`state`), relay node/connection\n// access over the snapshot arrays, and a liveness `ping`. Mutations map to\n// `EngineCommand`s. The single subscription streams the projection over the\n// SubscriptionRef→async-generator bridge. Dependencies (the `state` ref +\n// `publishCommand`) come from the GraphQL context (`ctx`), not closure — the\n// dashboard is a pure control plane (no chain reads).\n\nimport { Effect, Fiber, Queue, Stream, SubscriptionRef } from 'effect';\nimport { resolveArrayConnection } from '@pothos/plugin-relay';\nimport { builder } from './builder.ts';\nimport {\n\tAccount,\n\tCoinCap,\n\tDeepbookInfo,\n\tFundableCoin,\n\tLogFilterInput,\n\tLogRecordType,\n\tPackage,\n\tSealInfo,\n\tService,\n\tSnapshotEntry,\n\tStackState,\n\ttype ServiceSource,\n} from './types.ts';\nimport { StackMode } from './enums.ts';\nimport type { DashboardContext } from './builder.ts';\nimport type { PluginKey } from '../../../substrate/brand.ts';\nimport type { EngineCommand } from '../../../substrate/events.ts';\nimport type { SubscribableState } from '../../../substrate/projection.ts';\nimport type { LogFilter, LogLevel } from '../../../substrate/runtime/observability/index.ts';\n\nconst readSnapshot = (\n\tstate: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(state));\n\n// --- CommandResult ------------------------------------------------------\ninterface CommandResultShape {\n\treadonly ok: boolean;\n\treadonly command: string;\n\treadonly message?: string | null;\n}\n\nconst CommandResult = builder.objectRef<CommandResultShape>('CommandResult').implement({\n\tdescription: 'The outcome of dispatching an engine command.',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tcommand: t.exposeString('command'),\n\t\tmessage: t.string({ nullable: true, resolve: (r) => r.message ?? null }),\n\t}),\n});\n\nconst run = async (\n\tctx: DashboardContext,\n\ttag: string,\n\tcommand: EngineCommand,\n): Promise<CommandResultShape> => {\n\tawait Effect.runPromise(ctx.publishCommand(command));\n\treturn { ok: true, command: tag };\n};\n\n// --- SnapshotActionResult -----------------------------------------------\n//\n// Restore/delete go through the control-plane `domain` (NOT the void\n// `publishCommand`), so the dashboard gets a real ok/detail outcome the\n// fire-and-forget command channel cannot carry.\ninterface SnapshotActionResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string | null;\n}\n\nconst SnapshotActionResult = builder\n\t.objectRef<SnapshotActionResultShape>('SnapshotActionResult')\n\t.implement({\n\t\tdescription: 'The outcome of a snapshot restore/delete (real result, not fire-and-forget).',\n\t\tfields: (t) => ({\n\t\t\tok: t.exposeBoolean('ok'),\n\t\t\tdetail: t.string({ nullable: true, resolve: (r) => r.detail }),\n\t\t}),\n\t});\n\n// --- MintResult ---------------------------------------------------------\n//\n// The coin Mint action goes through the control-plane `domain` (NOT the\n// void `publishCommand`): the supervisor holds the treasury-cap-owning\n// signer in-process and returns a real ok/detail outcome plus the on-chain\n// tx `digest` on success.\ninterface MintResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string;\n\treadonly digest: string | null;\n}\n\nconst MintResult = builder.objectRef<MintResultShape>('MintResult').implement({\n\tdescription: 'The outcome of a coin mint (real result, with the on-chain tx digest on success).',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tdetail: t.exposeString('detail'),\n\t\tdigest: t.string({ nullable: true, resolve: (r) => r.digest }),\n\t}),\n});\n\n// --- FundResult ---------------------------------------------------------\n//\n// The Faucet `fund` action routes through the control-plane `pluginDomain`,\n// reusing devstack's IN-PROCESS funding strategies (the same registry the\n// boot-time account funding pass uses): SUI via the chain faucet strategy\n// (fixed-amount), WAL/DEEP via the coin-specific account-signed swap. The\n// strategies return `void` (no digest), so the result carries only\n// `ok`/`detail`. `ok` reflects whether the strategy's `request(...)`\n// actually completed.\ninterface FundResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string;\n}\n\nconst FundResult = builder.objectRef<FundResultShape>('FundResult').implement({\n\tdescription:\n\t\t'The outcome of a faucet fund request (real result — ok reflects whether the ' +\n\t\t'in-process funding strategy completed).',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tdetail: t.exposeString('detail'),\n\t}),\n});\n\n// --- Query --------------------------------------------------------------\nbuilder.queryType({\n\tfields: (t) => ({\n\t\t/** Liveness probe. */\n\t\tping: t.string({ resolve: () => 'pong' }),\n\t\t/** Full live projection snapshot (status, services, endpoints, …). */\n\t\tstate: t.field({\n\t\t\ttype: StackState,\n\t\t\tresolve: (_parent, _args, ctx) => readSnapshot(ctx.state),\n\t\t}),\n\t\t/** Relay connection over the current snapshot's service rows. */\n\t\tservices: t.connection({\n\t\t\ttype: Service,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\tconst sources: ServiceSource[] = snapshot.rows.map((row) => ({ row, snapshot }));\n\t\t\t\treturn resolveArrayConnection({ args }, sources);\n\t\t\t},\n\t\t}),\n\t\t/** Relay connection over the current snapshot's accounts. */\n\t\taccounts: t.connection({\n\t\t\ttype: Account,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\treturn resolveArrayConnection({ args }, [...snapshot.accounts]);\n\t\t\t},\n\t\t}),\n\t\t/** Relay connection over the current snapshot's packages. */\n\t\tpackages: t.connection({\n\t\t\ttype: Package,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\treturn resolveArrayConnection({ args }, [...snapshot.packages]);\n\t\t\t},\n\t\t}),\n\n\t\t// --- Plugin-domain queries (data the browser cannot reach) --------\n\t\t/** Fork-vs-local stack mode (advance-clock gating). `null` when no\n\t\t * sui plugin is present. */\n\t\tmode: t.field({\n\t\t\ttype: StackMode,\n\t\t\tnullable: true,\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.mode),\n\t\t}),\n\t\t/** Snapshot catalog: id/label/created/participants/containers. */\n\t\tsnapshots: t.field({\n\t\t\ttype: [SnapshotEntry],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.domain.snapshots),\n\t\t}),\n\t\t/** DeepBook deployments: registry/admin/pool ids + market-maker\n\t\t * state. (Pool prices / order books are chain-direct.) */\n\t\tdeepbookInfo: t.field({\n\t\t\ttype: [DeepbookInfo],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.deepbook),\n\t\t}),\n\t\t/** Seal key-server deployments: objectId/threshold/mode/keyServers. */\n\t\tsealInfo: t.field({\n\t\t\ttype: [SealInfo],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.seal),\n\t\t}),\n\t\t/** Coin treasury caps (drives Mint) + addressing facts. (Supply /\n\t\t * metadata are chain-direct.) */\n\t\tcoinCaps: t.field({\n\t\t\ttype: [CoinCap],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.coinCaps),\n\t\t}),\n\t\t/** Coins the faucet can actually fund right now (drives the Faucet\n\t\t * panel's coin pills + amount gating). SUI is always present when a\n\t\t * faucet strategy is registered; WAL/DEEP appear only when their\n\t\t * plugin contributed a funding strategy. */\n\t\tfundableCoins: t.field({\n\t\t\ttype: [FundableCoin],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.fundableCoins),\n\t\t}),\n\t\t// --- Observability (Console \"Logs\" tab) ---------------------------\n\t\t/** Cross-service queryable log history. Filterable server-side by\n\t\t * service / level / substring / time window; returns most-recent\n\t\t * first, capped by `filter.limit` (default = ring capacity). */\n\t\tlogs: t.field({\n\t\t\ttype: [LogRecordType],\n\t\t\targs: { filter: t.arg({ type: LogFilterInput, required: false }) },\n\t\t\tresolve: (_parent, args, ctx) => Effect.runPromise(ctx.domain.logs(toLogFilter(args.filter))),\n\t\t}),\n\t\t/** Distinct services currently in the log ring (filter dropdown). */\n\t\tlogServices: t.field({\n\t\t\ttype: ['String'],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.domain.logServices),\n\t\t}),\n\t}),\n});\n\n/** Closed log-level set used to narrow the String[] filter input back onto\n * the store's `LogLevel` union. Unknown strings are dropped (the store would\n * just never match them anyway). */\nconst LOG_LEVELS: ReadonlySet<LogLevel> = new Set<LogLevel>([\n\t'trace',\n\t'debug',\n\t'info',\n\t'warn',\n\t'error',\n\t'fatal',\n]);\n\nconst nonEmpty = (xs: readonly (string | null)[] | null | undefined): string[] | undefined => {\n\tif (xs == null) return undefined;\n\tconst out = xs.filter((x): x is string => x != null && x.length > 0);\n\treturn out.length > 0 ? out : undefined;\n};\n\n/** Map the nullable GraphQL `LogFilter` input onto the store's `LogFilter`,\n * dropping nulls and unknown levels. */\nconst toLogFilter = (\n\tinput:\n\t\t| {\n\t\t\t\tservices?: readonly (string | null)[] | null;\n\t\t\t\tlevels?: readonly (string | null)[] | null;\n\t\t\t\tsearch?: string | null;\n\t\t\t\tsinceMillis?: number | null;\n\t\t\t\tlimit?: number | null;\n\t\t }\n\t\t| null\n\t\t| undefined,\n): LogFilter | undefined => {\n\tif (input == null) return undefined;\n\tconst services = nonEmpty(input.services);\n\tconst levelStrings = nonEmpty(input.levels);\n\tconst levels = levelStrings?.filter((l): l is LogLevel => LOG_LEVELS.has(l as LogLevel));\n\treturn {\n\t\t...(services ? { services } : {}),\n\t\t...(levels && levels.length > 0 ? { levels } : {}),\n\t\t...(input.search != null ? { search: input.search } : {}),\n\t\t...(input.sinceMillis != null ? { sinceMillis: input.sinceMillis } : {}),\n\t\t...(input.limit != null ? { limit: input.limit } : {}),\n\t};\n};\n\n// --- Mutation -----------------------------------------------------------\nbuilder.mutationType({\n\tfields: (t) => ({\n\t\t/** Restart the whole stack. */\n\t\trestart: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'stack.restart', { tag: 'stack.restart' }),\n\t\t}),\n\t\t/** Selectively restart a single plugin subgraph. */\n\t\trestartPlugin: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { pluginKey: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'selective-restart.requested', {\n\t\t\t\t\ttag: 'selective-restart.requested',\n\t\t\t\t\tpluginKey: args.input.pluginKey as PluginKey,\n\t\t\t\t}),\n\t\t}),\n\t\t/** Capture a snapshot, optionally naming it. */\n\t\tcaptureSnapshot: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { name: t.input.string({ required: false }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'snapshot.capture', {\n\t\t\t\t\ttag: 'snapshot.capture',\n\t\t\t\t\t...(args.input.name == null ? {} : { name: args.input.name }),\n\t\t\t\t}),\n\t\t}),\n\t\t/** Re-run codegen against the live manifest. */\n\t\tcodegen: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'codegen.requested', { tag: 'codegen.requested' }),\n\t\t}),\n\t\t/** Re-apply the manifest, optionally scoped to a single plugin. */\n\t\tapply: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { pluginKey: t.input.string({ required: false }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'apply.requested', {\n\t\t\t\t\ttag: 'apply.requested',\n\t\t\t\t\t...(args.input.pluginKey == null ? {} : { pluginKey: args.input.pluginKey as PluginKey }),\n\t\t\t\t}),\n\t\t}),\n\t\t/** Wipe the live stack footprint (preserves the snapshot catalog). */\n\t\twipe: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'wipe.requested', { tag: 'wipe.requested' }),\n\t\t}),\n\t\t/** Prune the snapshot catalog + sweep byproduct images. */\n\t\tprune: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'prune.requested', { tag: 'prune.requested' }),\n\t\t}),\n\t\t/** Advance the (fork/local) chain clock to an absolute epoch-ms. */\n\t\tadvanceClock: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { toMillis: t.input.float({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'advance-clock.requested', {\n\t\t\t\t\ttag: 'advance-clock.requested',\n\t\t\t\t\ttoMillis: args.input.toMillis,\n\t\t\t\t}),\n\t\t}),\n\t\t/** Request a graceful stack shutdown. */\n\t\tshutdown: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) =>\n\t\t\t\trun(ctx, 'shutdown.requested', { tag: 'shutdown.requested' }),\n\t\t}),\n\t\t/** Restore a snapshot by id. Routes through the supervisor\n\t\t * command-loop via `submitCommand` (NOT the in-process\n\t\t * `domain.restoreSnapshot`): restore is destructive — it removes the\n\t\t * live managed containers and relies on a follow-on re-acquire to\n\t\t * rebuild them. Running it in-process against a live supervisor would\n\t\t * race the single command-queue consumer and leave services dead until\n\t\t * a manual Restart. The command-loop's `snapshot.restore` case applies\n\t\t * the restored tree, publishes `snapshot.restored`, THEN drains +\n\t\t * re-acquires every service (the manual-restart sequence) — and the\n\t\t * submitted-command completion deferred lets this mutation await the\n\t\t * real ok/detail outcome the void `publishCommand` could not carry. */\n\t\trestoreSnapshot: t.fieldWithInput({\n\t\t\ttype: SnapshotActionResult,\n\t\t\tinput: { id: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.submitCommand({ tag: 'snapshot.restore', snapshotId: args.input.id }).pipe(\n\t\t\t\t\t\tEffect.as({ ok: true, detail: null as string | null }),\n\t\t\t\t\t\tEffect.catchCause((cause) =>\n\t\t\t\t\t\t\tEffect.succeed({ ok: false, detail: String(cause) as string | null }),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t}),\n\t\t/** Delete a snapshot by id (via the control-plane `domain`). */\n\t\tdeleteSnapshot: t.fieldWithInput({\n\t\t\ttype: SnapshotActionResult,\n\t\t\tinput: { id: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) => Effect.runPromise(ctx.domain.deleteSnapshot(args.input.id)),\n\t\t}),\n\t\t/** Mint a custom coin. Routes through the control-plane `domain`:\n\t\t * the supervisor holds the treasury-cap-owning publisher signer\n\t\t * in-process and returns a real ok/detail/digest result (the void\n\t\t * `publishCommand` could not carry the tx digest). `amountBaseUnits`\n\t\t * is the raw integer amount in the coin's smallest unit (string so\n\t\t * large u64 values survive the wire without precision loss). */\n\t\tmint: t.fieldWithInput({\n\t\t\ttype: MintResult,\n\t\t\tinput: {\n\t\t\t\tcoinType: t.input.string({ required: true }),\n\t\t\t\trecipient: t.input.string({ required: true }),\n\t\t\t\tamountBaseUnits: t.input.string({ required: true }),\n\t\t\t},\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.pluginDomain.mintCoin({\n\t\t\t\t\t\tcoinType: args.input.coinType,\n\t\t\t\t\t\trecipient: args.input.recipient,\n\t\t\t\t\t\tamountBaseUnits: args.input.amountBaseUnits,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t}),\n\t\t/** Fund an account/address. Routes through the control-plane\n\t\t * `pluginDomain`, reusing devstack's in-process funding strategies:\n\t\t * SUI (absent / canonical `coinType`) via the chain faucet strategy\n\t\t * (fixed-amount — `amountBaseUnits` is ignored); WAL/DEEP via the\n\t\t * coin-specific account-signed swap (`amountBaseUnits` honored, and\n\t\t * the recipient must be a resolved account). Real result — `ok`\n\t\t * reflects whether the strategy completed. */\n\t\tfund: t.fieldWithInput({\n\t\t\ttype: FundResult,\n\t\t\tinput: {\n\t\t\t\trecipient: t.input.string({ required: true }),\n\t\t\t\tcoinType: t.input.string({ required: false }),\n\t\t\t\tamountBaseUnits: t.input.string({ required: false }),\n\t\t\t},\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.pluginDomain.fundAccount({\n\t\t\t\t\t\trecipient: args.input.recipient,\n\t\t\t\t\t\tcoinType: args.input.coinType,\n\t\t\t\t\t\tamountBaseUnits: args.input.amountBaseUnits,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t}),\n\t}),\n});\n\n// --- Subscription -------------------------------------------------------\nbuilder.subscriptionType({\n\tfields: (t) => ({\n\t\t/** Stream the projection on every change (current value first). */\n\t\tstate: t.field({\n\t\t\ttype: StackState,\n\t\t\tsubscribe: (_parent, _args, ctx) => subscribeState(ctx.state),\n\t\t\tresolve: (payload) => payload,\n\t\t}),\n\t}),\n});\n\n/** Bridge an Effect `SubscriptionRef` to an async iterable for GraphQL\n * subscriptions. `SubscriptionRef.changes` emits the current value first,\n * then each subsequent update. The pump fiber is interrupted when the\n * consumer (yoga) stops iterating. */\nasync function* subscribeState(\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): AsyncGenerator<SubscribableState> {\n\tconst queue = Effect.runSync(Queue.unbounded<SubscribableState>());\n\tconst pump = Effect.runFork(\n\t\tStream.runForEach(SubscriptionRef.changes(ref), (snapshot) => Queue.offer(queue, snapshot)),\n\t);\n\ttry {\n\t\twhile (true) {\n\t\t\tyield await Effect.runPromise(Queue.take(queue));\n\t\t}\n\t} finally {\n\t\tEffect.runFork(Fiber.interrupt(pump));\n\t}\n}\n"],"mappings":";;;;;;AAiCA,MAAM,gBACL,UACgC,OAAO,WAAW,gBAAgB,IAAI,KAAK,CAAC;AAS7E,MAAM,gBAAgB,QAAQ,UAA8B,eAAe,CAAC,CAAC,UAAU;CACtF,aAAa;CACb,SAAS,OAAO;EACf,IAAI,EAAE,cAAc,IAAI;EACxB,SAAS,EAAE,aAAa,SAAS;EACjC,SAAS,EAAE,OAAO;GAAE,UAAU;GAAM,UAAU,MAAM,EAAE,WAAW;EAAK,CAAC;CACxE;AACD,CAAC;AAED,MAAM,MAAM,OACX,KACA,KACA,YACiC;CACjC,MAAM,OAAO,WAAW,IAAI,eAAe,OAAO,CAAC;CACnD,OAAO;EAAE,IAAI;EAAM,SAAS;CAAI;AACjC;AAYA,MAAM,uBAAuB,QAC3B,UAAqC,sBAAsB,CAAC,CAC5D,UAAU;CACV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S,MAAM,QACxB,OAAO,WACN,IAAI,aAAa,YAAY;GAC5B,WAAW,KAAK,MAAM;GACtB,UAAU,KAAK,MAAM;GACrB,iBAAiB,KAAK,MAAM;EAC7B,CAAC,CACF;CACF,CAAC;AACF,GACD,CAAC;AAGD,QAAQ,iBAAiB,EACxB,SAAS,OAAO;;AAEf,OAAO,EAAE,MAAM;CACd,MAAM;CACN,YAAY,SAAS,OAAO,QAAQ,eAAe,IAAI,KAAK;CAC5D,UAAU,YAAY;AACvB,CAAC,EACF,GACD,CAAC;;;;;AAMD,gBAAgB,eACf,KACoC;CACpC,MAAM,QAAQ,OAAO,QAAQ,MAAM,UAA6B,CAAC;CACjE,MAAM,OAAO,OAAO,QACnB,OAAO,WAAW,gBAAgB,QAAQ,GAAG,IAAI,aAAa,MAAM,MAAM,OAAO,QAAQ,CAAC,CAC3F;CACA,IAAI;EACH,OAAO,MACN,MAAM,MAAM,OAAO,WAAW,MAAM,KAAK,KAAK,CAAC;CAEjD,UAAU;EACT,OAAO,QAAQ,MAAM,UAAU,IAAI,CAAC;CACrC;AACD"}
|
|
1
|
+
{"version":3,"file":"root.mjs","names":[],"sources":["../../../../src/plugins/dashboard/schema/root.ts"],"sourcesContent":["// Dashboard root types — Query / Mutation / Subscription.\n//\n// Queries expose the live projection (`state`), relay node/connection\n// access over the snapshot arrays, and a liveness `ping`. Mutations map to\n// `EngineCommand`s. The single subscription streams the projection over the\n// SubscriptionRef→async-generator bridge. Dependencies (the `state` ref +\n// `publishCommand`) come from the GraphQL context (`ctx`), not closure — the\n// dashboard is a pure control plane (no chain reads).\n\nimport { Effect, Fiber, Queue, Stream, SubscriptionRef } from 'effect';\nimport { resolveArrayConnection } from '@pothos/plugin-relay';\nimport { builder } from './builder.ts';\nimport {\n\tAccount,\n\tCoinCap,\n\tDeepbookInfo,\n\tFundableCoin,\n\tLogFilterInput,\n\tLogRecordType,\n\tPackage,\n\tSealInfo,\n\tService,\n\tSnapshotEntry,\n\tStackState,\n\ttype ServiceSource,\n} from './types.ts';\nimport { StackMode } from './enums.ts';\nimport type { DashboardContext } from './builder.ts';\nimport type { PluginKey } from '../../../substrate/brand.ts';\nimport type { EngineCommand } from '../../../substrate/events.ts';\nimport type { SubscribableState } from '../../../substrate/projection.ts';\nimport type { LogFilter, LogLevel } from '../../../substrate/runtime/observability/index.ts';\n\nconst readSnapshot = (\n\tstate: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(state));\n\n// --- CommandResult ------------------------------------------------------\ninterface CommandResultShape {\n\treadonly ok: boolean;\n\treadonly command: string;\n\treadonly message?: string | null;\n}\n\nconst CommandResult = builder.objectRef<CommandResultShape>('CommandResult').implement({\n\tdescription: 'The outcome of dispatching an engine command.',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tcommand: t.exposeString('command'),\n\t\tmessage: t.string({ nullable: true, resolve: (r) => r.message ?? null }),\n\t}),\n});\n\nconst run = async (\n\tctx: DashboardContext,\n\ttag: string,\n\tcommand: EngineCommand,\n): Promise<CommandResultShape> => {\n\tawait Effect.runPromise(ctx.publishCommand(command));\n\treturn { ok: true, command: tag };\n};\n\n// --- SnapshotActionResult -----------------------------------------------\n//\n// Restore/delete go through the control-plane `domain` (NOT the void\n// `publishCommand`), so the dashboard gets a real ok/detail outcome the\n// fire-and-forget command channel cannot carry.\ninterface SnapshotActionResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string | null;\n}\n\nconst SnapshotActionResult = builder\n\t.objectRef<SnapshotActionResultShape>('SnapshotActionResult')\n\t.implement({\n\t\tdescription: 'The outcome of a snapshot restore/delete (real result, not fire-and-forget).',\n\t\tfields: (t) => ({\n\t\t\tok: t.exposeBoolean('ok'),\n\t\t\tdetail: t.string({ nullable: true, resolve: (r) => r.detail }),\n\t\t}),\n\t});\n\n// --- MintResult ---------------------------------------------------------\n//\n// The coin Mint action goes through the control-plane `domain` (NOT the\n// void `publishCommand`): the supervisor holds the treasury-cap-owning\n// signer in-process and returns a real ok/detail outcome plus the on-chain\n// tx `digest` on success.\ninterface MintResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string;\n\treadonly digest: string | null;\n}\n\nconst MintResult = builder.objectRef<MintResultShape>('MintResult').implement({\n\tdescription: 'The outcome of a coin mint (real result, with the on-chain tx digest on success).',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tdetail: t.exposeString('detail'),\n\t\tdigest: t.string({ nullable: true, resolve: (r) => r.digest }),\n\t}),\n});\n\n// --- FundResult ---------------------------------------------------------\n//\n// The Faucet `fund` action routes through the control-plane `pluginDomain`,\n// reusing devstack's IN-PROCESS funding strategies (the same registry the\n// boot-time account funding pass uses): SUI via the chain faucet strategy\n// (fixed-amount), WAL/DEEP via the coin-specific account-signed swap. The\n// strategies return `void` (no digest), so the result carries only\n// `ok`/`detail`. `ok` reflects whether the strategy's `request(...)`\n// actually completed.\ninterface FundResultShape {\n\treadonly ok: boolean;\n\treadonly detail: string;\n}\n\nconst FundResult = builder.objectRef<FundResultShape>('FundResult').implement({\n\tdescription:\n\t\t'The outcome of a faucet fund request (real result — ok reflects whether the ' +\n\t\t'in-process funding strategy completed).',\n\tfields: (t) => ({\n\t\tok: t.exposeBoolean('ok'),\n\t\tdetail: t.exposeString('detail'),\n\t}),\n});\n\n// --- Query --------------------------------------------------------------\nbuilder.queryType({\n\tfields: (t) => ({\n\t\t/** Liveness probe. */\n\t\tping: t.string({ resolve: () => 'pong' }),\n\t\t/** Full live projection snapshot (status, services, endpoints, …). */\n\t\tstate: t.field({\n\t\t\ttype: StackState,\n\t\t\tresolve: (_parent, _args, ctx) => readSnapshot(ctx.state),\n\t\t}),\n\t\t/** Relay connection over the current snapshot's service rows. */\n\t\tservices: t.connection({\n\t\t\ttype: Service,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\tconst sources: ServiceSource[] = snapshot.rows.map((row) => ({ row, snapshot }));\n\t\t\t\treturn resolveArrayConnection({ args }, sources);\n\t\t\t},\n\t\t}),\n\t\t/** Relay connection over the current snapshot's accounts. */\n\t\taccounts: t.connection({\n\t\t\ttype: Account,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\treturn resolveArrayConnection({ args }, [...snapshot.accounts]);\n\t\t\t},\n\t\t}),\n\t\t/** Relay connection over the current snapshot's packages. */\n\t\tpackages: t.connection({\n\t\t\ttype: Package,\n\t\t\tresolve: async (_parent, args, ctx) => {\n\t\t\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\t\t\treturn resolveArrayConnection({ args }, [...snapshot.packages]);\n\t\t\t},\n\t\t}),\n\n\t\t// --- Plugin-domain queries (data the browser cannot reach) --------\n\t\t/** Fork-vs-local stack mode (advance-clock gating). `null` when no\n\t\t * sui plugin is present. */\n\t\tmode: t.field({\n\t\t\ttype: StackMode,\n\t\t\tnullable: true,\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.mode),\n\t\t}),\n\t\t/** Snapshot catalog: id/label/created/participants/containers. */\n\t\tsnapshots: t.field({\n\t\t\ttype: [SnapshotEntry],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.domain.snapshots),\n\t\t}),\n\t\t/** DeepBook deployments: registry/admin/pool ids + seed-liquidity\n\t\t * state + Pyth feeds. (Pool prices / order books are chain-direct.) */\n\t\tdeepbookInfo: t.field({\n\t\t\ttype: [DeepbookInfo],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.deepbook),\n\t\t}),\n\t\t/** Seal key-server deployments: objectId/threshold/mode/keyServers. */\n\t\tsealInfo: t.field({\n\t\t\ttype: [SealInfo],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.seal),\n\t\t}),\n\t\t/** Coin treasury caps (drives Mint) + addressing facts. (Supply /\n\t\t * metadata are chain-direct.) */\n\t\tcoinCaps: t.field({\n\t\t\ttype: [CoinCap],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.coinCaps),\n\t\t}),\n\t\t/** Coins the faucet can actually fund right now (drives the Faucet\n\t\t * panel's coin pills + amount gating). SUI is always present when a\n\t\t * faucet strategy is registered; WAL/DEEP appear only when their\n\t\t * plugin contributed a funding strategy. */\n\t\tfundableCoins: t.field({\n\t\t\ttype: [FundableCoin],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.pluginDomain.fundableCoins),\n\t\t}),\n\t\t// --- Observability (Console \"Logs\" tab) ---------------------------\n\t\t/** Cross-service queryable log history. Filterable server-side by\n\t\t * service / level / substring / time window; returns most-recent\n\t\t * first, capped by `filter.limit` (default = ring capacity). */\n\t\tlogs: t.field({\n\t\t\ttype: [LogRecordType],\n\t\t\targs: { filter: t.arg({ type: LogFilterInput, required: false }) },\n\t\t\tresolve: (_parent, args, ctx) => Effect.runPromise(ctx.domain.logs(toLogFilter(args.filter))),\n\t\t}),\n\t\t/** Distinct services currently in the log ring (filter dropdown). */\n\t\tlogServices: t.field({\n\t\t\ttype: ['String'],\n\t\t\tresolve: (_parent, _args, ctx) => Effect.runPromise(ctx.domain.logServices),\n\t\t}),\n\t}),\n});\n\n/** Closed log-level set used to narrow the String[] filter input back onto\n * the store's `LogLevel` union. Unknown strings are dropped (the store would\n * just never match them anyway). */\nconst LOG_LEVELS: ReadonlySet<LogLevel> = new Set<LogLevel>([\n\t'trace',\n\t'debug',\n\t'info',\n\t'warn',\n\t'error',\n\t'fatal',\n]);\n\nconst nonEmpty = (xs: readonly (string | null)[] | null | undefined): string[] | undefined => {\n\tif (xs == null) return undefined;\n\tconst out = xs.filter((x): x is string => x != null && x.length > 0);\n\treturn out.length > 0 ? out : undefined;\n};\n\n/** Map the nullable GraphQL `LogFilter` input onto the store's `LogFilter`,\n * dropping nulls and unknown levels. */\nconst toLogFilter = (\n\tinput:\n\t\t| {\n\t\t\t\tservices?: readonly (string | null)[] | null;\n\t\t\t\tlevels?: readonly (string | null)[] | null;\n\t\t\t\tsearch?: string | null;\n\t\t\t\tsinceMillis?: number | null;\n\t\t\t\tlimit?: number | null;\n\t\t }\n\t\t| null\n\t\t| undefined,\n): LogFilter | undefined => {\n\tif (input == null) return undefined;\n\tconst services = nonEmpty(input.services);\n\tconst levelStrings = nonEmpty(input.levels);\n\tconst levels = levelStrings?.filter((l): l is LogLevel => LOG_LEVELS.has(l as LogLevel));\n\treturn {\n\t\t...(services ? { services } : {}),\n\t\t...(levels && levels.length > 0 ? { levels } : {}),\n\t\t...(input.search != null ? { search: input.search } : {}),\n\t\t...(input.sinceMillis != null ? { sinceMillis: input.sinceMillis } : {}),\n\t\t...(input.limit != null ? { limit: input.limit } : {}),\n\t};\n};\n\n// --- Mutation -----------------------------------------------------------\nbuilder.mutationType({\n\tfields: (t) => ({\n\t\t/** Restart the whole stack. */\n\t\trestart: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'stack.restart', { tag: 'stack.restart' }),\n\t\t}),\n\t\t/** Selectively restart a single plugin subgraph. */\n\t\trestartPlugin: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { pluginKey: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'selective-restart.requested', {\n\t\t\t\t\ttag: 'selective-restart.requested',\n\t\t\t\t\tpluginKey: args.input.pluginKey as PluginKey,\n\t\t\t\t}),\n\t\t}),\n\t\t/** Capture a snapshot, optionally naming it. */\n\t\tcaptureSnapshot: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { name: t.input.string({ required: false }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'snapshot.capture', {\n\t\t\t\t\ttag: 'snapshot.capture',\n\t\t\t\t\t...(args.input.name == null ? {} : { name: args.input.name }),\n\t\t\t\t}),\n\t\t}),\n\t\t/** Re-run codegen against the live manifest. */\n\t\tcodegen: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'codegen.requested', { tag: 'codegen.requested' }),\n\t\t}),\n\t\t/** Re-apply the manifest, optionally scoped to a single plugin. */\n\t\tapply: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { pluginKey: t.input.string({ required: false }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'apply.requested', {\n\t\t\t\t\ttag: 'apply.requested',\n\t\t\t\t\t...(args.input.pluginKey == null ? {} : { pluginKey: args.input.pluginKey as PluginKey }),\n\t\t\t\t}),\n\t\t}),\n\t\t/** Wipe the live stack footprint (preserves the snapshot catalog). */\n\t\twipe: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'wipe.requested', { tag: 'wipe.requested' }),\n\t\t}),\n\t\t/** Prune the snapshot catalog + sweep byproduct images. */\n\t\tprune: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) => run(ctx, 'prune.requested', { tag: 'prune.requested' }),\n\t\t}),\n\t\t/** Advance the (fork/local) chain clock to an absolute epoch-ms. */\n\t\tadvanceClock: t.fieldWithInput({\n\t\t\ttype: CommandResult,\n\t\t\tinput: { toMillis: t.input.float({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\trun(ctx, 'advance-clock.requested', {\n\t\t\t\t\ttag: 'advance-clock.requested',\n\t\t\t\t\ttoMillis: args.input.toMillis,\n\t\t\t\t}),\n\t\t}),\n\t\t/** Request a graceful stack shutdown. */\n\t\tshutdown: t.field({\n\t\t\ttype: CommandResult,\n\t\t\tresolve: (_parent, _args, ctx) =>\n\t\t\t\trun(ctx, 'shutdown.requested', { tag: 'shutdown.requested' }),\n\t\t}),\n\t\t/** Restore a snapshot by id. Routes through the supervisor\n\t\t * command-loop via `submitCommand` (NOT the in-process\n\t\t * `domain.restoreSnapshot`): restore is destructive — it removes the\n\t\t * live managed containers and relies on a follow-on re-acquire to\n\t\t * rebuild them. Running it in-process against a live supervisor would\n\t\t * race the single command-queue consumer and leave services dead until\n\t\t * a manual Restart. The command-loop's `snapshot.restore` case applies\n\t\t * the restored tree, publishes `snapshot.restored`, THEN drains +\n\t\t * re-acquires every service (the manual-restart sequence) — and the\n\t\t * submitted-command completion deferred lets this mutation await the\n\t\t * real ok/detail outcome the void `publishCommand` could not carry. */\n\t\trestoreSnapshot: t.fieldWithInput({\n\t\t\ttype: SnapshotActionResult,\n\t\t\tinput: { id: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.submitCommand({ tag: 'snapshot.restore', snapshotId: args.input.id }).pipe(\n\t\t\t\t\t\tEffect.as({ ok: true, detail: null as string | null }),\n\t\t\t\t\t\tEffect.catchCause((cause) =>\n\t\t\t\t\t\t\tEffect.succeed({ ok: false, detail: String(cause) as string | null }),\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t}),\n\t\t/** Delete a snapshot by id (via the control-plane `domain`). */\n\t\tdeleteSnapshot: t.fieldWithInput({\n\t\t\ttype: SnapshotActionResult,\n\t\t\tinput: { id: t.input.string({ required: true }) },\n\t\t\tresolve: (_parent, args, ctx) => Effect.runPromise(ctx.domain.deleteSnapshot(args.input.id)),\n\t\t}),\n\t\t/** Mint a custom coin. Routes through the control-plane `domain`:\n\t\t * the supervisor holds the treasury-cap-owning publisher signer\n\t\t * in-process and returns a real ok/detail/digest result (the void\n\t\t * `publishCommand` could not carry the tx digest). `amountBaseUnits`\n\t\t * is the raw integer amount in the coin's smallest unit (string so\n\t\t * large u64 values survive the wire without precision loss). */\n\t\tmint: t.fieldWithInput({\n\t\t\ttype: MintResult,\n\t\t\tinput: {\n\t\t\t\tcoinType: t.input.string({ required: true }),\n\t\t\t\trecipient: t.input.string({ required: true }),\n\t\t\t\tamountBaseUnits: t.input.string({ required: true }),\n\t\t\t},\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.pluginDomain.mintCoin({\n\t\t\t\t\t\tcoinType: args.input.coinType,\n\t\t\t\t\t\trecipient: args.input.recipient,\n\t\t\t\t\t\tamountBaseUnits: args.input.amountBaseUnits,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t}),\n\t\t/** Fund an account/address. Routes through the control-plane\n\t\t * `pluginDomain`, reusing devstack's in-process funding strategies:\n\t\t * SUI (absent / canonical `coinType`) via the chain faucet strategy\n\t\t * (fixed-amount — `amountBaseUnits` is ignored); WAL/DEEP via the\n\t\t * coin-specific account-signed swap (`amountBaseUnits` honored, and\n\t\t * the recipient must be a resolved account). Real result — `ok`\n\t\t * reflects whether the strategy completed. */\n\t\tfund: t.fieldWithInput({\n\t\t\ttype: FundResult,\n\t\t\tinput: {\n\t\t\t\trecipient: t.input.string({ required: true }),\n\t\t\t\tcoinType: t.input.string({ required: false }),\n\t\t\t\tamountBaseUnits: t.input.string({ required: false }),\n\t\t\t},\n\t\t\tresolve: (_parent, args, ctx) =>\n\t\t\t\tEffect.runPromise(\n\t\t\t\t\tctx.pluginDomain.fundAccount({\n\t\t\t\t\t\trecipient: args.input.recipient,\n\t\t\t\t\t\tcoinType: args.input.coinType,\n\t\t\t\t\t\tamountBaseUnits: args.input.amountBaseUnits,\n\t\t\t\t\t}),\n\t\t\t\t),\n\t\t}),\n\t}),\n});\n\n// --- Subscription -------------------------------------------------------\nbuilder.subscriptionType({\n\tfields: (t) => ({\n\t\t/** Stream the projection on every change (current value first). */\n\t\tstate: t.field({\n\t\t\ttype: StackState,\n\t\t\tsubscribe: (_parent, _args, ctx) => subscribeState(ctx.state),\n\t\t\tresolve: (payload) => payload,\n\t\t}),\n\t}),\n});\n\n/** Bridge an Effect `SubscriptionRef` to an async iterable for GraphQL\n * subscriptions. `SubscriptionRef.changes` emits the current value first,\n * then each subsequent update. The pump fiber is interrupted when the\n * consumer (yoga) stops iterating. */\nasync function* subscribeState(\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): AsyncGenerator<SubscribableState> {\n\tconst queue = Effect.runSync(Queue.unbounded<SubscribableState>());\n\tconst pump = Effect.runFork(\n\t\tStream.runForEach(SubscriptionRef.changes(ref), (snapshot) => Queue.offer(queue, snapshot)),\n\t);\n\ttry {\n\t\twhile (true) {\n\t\t\tyield await Effect.runPromise(Queue.take(queue));\n\t\t}\n\t} finally {\n\t\tEffect.runFork(Fiber.interrupt(pump));\n\t}\n}\n"],"mappings":";;;;;;AAiCA,MAAM,gBACL,UACgC,OAAO,WAAW,gBAAgB,IAAI,KAAK,CAAC;AAS7E,MAAM,gBAAgB,QAAQ,UAA8B,eAAe,CAAC,CAAC,UAAU;CACtF,aAAa;CACb,SAAS,OAAO;EACf,IAAI,EAAE,cAAc,IAAI;EACxB,SAAS,EAAE,aAAa,SAAS;EACjC,SAAS,EAAE,OAAO;GAAE,UAAU;GAAM,UAAU,MAAM,EAAE,WAAW;EAAK,CAAC;CACxE;AACD,CAAC;AAED,MAAM,MAAM,OACX,KACA,KACA,YACiC;CACjC,MAAM,OAAO,WAAW,IAAI,eAAe,OAAO,CAAC;CACnD,OAAO;EAAE,IAAI;EAAM,SAAS;CAAI;AACjC;AAYA,MAAM,uBAAuB,QAC3B,UAAqC,sBAAsB,CAAC,CAC5D,UAAU;CACV,aAAa;CACb,SAAS,OAAO;EACf,IAAI,EAAE,cAAc,IAAI;EACxB,QAAQ,EAAE,OAAO;GAAE,UAAU;GAAM,UAAU,MAAM,EAAE;EAAO,CAAC;CAC9D;AACD,CAAC;AAcF,MAAM,aAAa,QAAQ,UAA2B,YAAY,CAAC,CAAC,UAAU;CAC7E,aAAa;CACb,SAAS,OAAO;EACf,IAAI,EAAE,cAAc,IAAI;EACxB,QAAQ,EAAE,aAAa,QAAQ;EAC/B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U,YAAY;AACvB,CAAC,EACF,GACD,CAAC;;;;;AAMD,gBAAgB,eACf,KACoC;CACpC,MAAM,QAAQ,OAAO,QAAQ,MAAM,UAA6B,CAAC;CACjE,MAAM,OAAO,OAAO,QACnB,OAAO,WAAW,gBAAgB,QAAQ,GAAG,IAAI,aAAa,MAAM,MAAM,OAAO,QAAQ,CAAC,CAC3F;CACA,IAAI;EACH,OAAO,MACN,MAAM,MAAM,OAAO,WAAW,MAAM,KAAK,KAAK,CAAC;CAEjD,UAAU;EACT,OAAO,QAAQ,MAAM,UAAU,IAAI,CAAC;CACrC;AACD"}
|
|
@@ -287,8 +287,17 @@ const DeepbookPool = builder.objectRef("DeepbookPool").implement({
|
|
|
287
287
|
quoteCoinType: t.exposeString("quoteCoinType")
|
|
288
288
|
})
|
|
289
289
|
});
|
|
290
|
+
const PythPriceFeed = builder.objectRef("PythPriceFeed").implement({
|
|
291
|
+
description: "A Pyth price feed seeded inside DeepBook at boot. `price`/`expo` are FIXED boot-time mock values (static, not a live quote).",
|
|
292
|
+
fields: (t) => ({
|
|
293
|
+
symbol: t.exposeString("symbol"),
|
|
294
|
+
priceInfoObjectId: t.exposeString("priceInfoObjectId"),
|
|
295
|
+
price: t.exposeString("price"),
|
|
296
|
+
expo: t.exposeInt("expo")
|
|
297
|
+
})
|
|
298
|
+
});
|
|
290
299
|
const DeepbookInfo = builder.objectRef("DeepbookInfo").implement({
|
|
291
|
-
description: "A DeepBook deployment: registry/admin/pool ids +
|
|
300
|
+
description: "A DeepBook deployment: registry/admin/pool ids + seed-liquidity state + Pyth feeds.",
|
|
292
301
|
fields: (t) => ({
|
|
293
302
|
pluginKey: t.exposeString("pluginKey"),
|
|
294
303
|
name: t.exposeString("name"),
|
|
@@ -305,7 +314,11 @@ const DeepbookInfo = builder.objectRef("DeepbookInfo").implement({
|
|
|
305
314
|
type: [DeepbookPool],
|
|
306
315
|
resolve: (d) => d.pools
|
|
307
316
|
}),
|
|
308
|
-
|
|
317
|
+
pythFeeds: t.field({
|
|
318
|
+
type: [PythPriceFeed],
|
|
319
|
+
resolve: (d) => d.pythFeeds
|
|
320
|
+
}),
|
|
321
|
+
hasSeedLiquidity: t.exposeBoolean("hasSeedLiquidity"),
|
|
309
322
|
serverUrl: t.exposeString("serverUrl", { nullable: true }),
|
|
310
323
|
indexerUrl: t.exposeString("indexerUrl", { nullable: true }),
|
|
311
324
|
narrowingFault: t.exposeString("narrowingFault", { nullable: true })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","names":["HealthEnum"],"sources":["../../../../src/plugins/dashboard/schema/types.ts"],"sourcesContent":["// Dashboard object types — real Pothos object refs over the projection.\n//\n// Sources are the substrate projection shapes (Row, Endpoint,\n// AccountProjection, …). Service/Endpoint/Account/Package are registered\n// as relay Nodes via `builder.node`, with an opaque global id derived from\n// their natural key and a `loadOne` that re-finds them in the current\n// snapshot (read from the request's `ctx.state`) so the auto-generated\n// `node`/`nodes` queries resolve.\n//\n// `StackState` and `HealthSummary` are computed views over a snapshot —\n// `StackState` carries the snapshot itself as its source so nested\n// resolvers (e.g. Service.endpoints) can join against sibling arrays.\n\nimport { Effect, SubscriptionRef } from 'effect';\nimport { builder } from './builder.ts';\nimport {\n\tAccountScheme,\n\tAccountSource,\n\tDeepbookMode,\n\tErrorSeverity,\n\tFundingStatus,\n\tHealth as HealthEnum,\n\tLifecycleStatus,\n\tLogLevel,\n\tPackageKind,\n\tPluginRole,\n\tRowSection,\n\tWireProtocol,\n} from './enums.ts';\nimport type { Health } from './enums.ts';\nimport type { ControlPlaneSnapshotEntry } from '../../../substrate/runtime/control-plane/service.ts';\nimport type {\n\tDashboardCoinCap,\n\tDashboardDeepbookInfo,\n\tDashboardDeepbookPool,\n\tDashboardFundableCoin,\n\tDashboardSealInfo,\n\tDashboardSealKeyServer,\n} from '../domain.ts';\n// The surface-neutral health derivation lives in the TUI module\n// (`display-derivation.ts`) but is itself ink/react-free with type-only\n// substrate imports — so the web schema can reuse the SAME canonical\n// bucketing + named policies without acquiring any TUI/ink coupling.\nimport { deriveHealth, deriveStackViewModel } from '../../../surfaces/tui/display-derivation.ts';\nimport type { LogRecord } from '../../../substrate/runtime/observability/index.ts';\nimport type {\n\tAccountProjection,\n\tBuildEntry as BuildEntryShape,\n\tEndpoint as EndpointShape,\n\tLogTail as LogTailShape,\n\tPackageProjection,\n\tRow,\n\tStructuredError,\n\tSubscribableState,\n} from '../../../substrate/projection.ts';\n\n/** A snapshot-carrying service row. The snapshot lets `endpoints` join the\n * row's endpoint keys against the projection's endpoint array. */\nexport interface ServiceSource {\n\treadonly row: Row;\n\treadonly snapshot: SubscribableState;\n}\n\ntype FundingEntrySource = NonNullable<AccountProjection['funding']['entries']>[number];\n\nexport interface HealthSummarySource {\n\treadonly total: number;\n\treadonly ready: number;\n\treadonly active: number;\n\treadonly failed: number;\n\treadonly waiting: number;\n\treadonly health: Health;\n}\n\n/** Compute the stack health summary from the projection rows. Delegates to\n * the surface-neutral `deriveStackViewModel` (the single canonical\n * bucketing) + `deriveHealth(counts, 'web')` (the named web policy), then\n * folds the ViewModel's discrete `stoppedRows` into this adapter's `ready`\n * field — preserving the web GraphQL stopped→ready contract. The fold lives\n * HERE, in the web adapter, not in the shared ViewModel, so the TUI policy\n * is unaffected. `active` counts rows mid-flight (acquiring/stopping);\n * `waiting` counts rows that have not started (pending). Overall `health`\n * is `failed`→blocked, any-active→active, all-(ready|stopped) (with ≥1\n * row)→ready, otherwise empty. */\nexport const computeHealthSummary = (rows: ReadonlyArray<Row>): HealthSummarySource => {\n\tconst vm = deriveStackViewModel({\n\t\trows,\n\t\tendpoints: [],\n\t\taccounts: [],\n\t\tpackages: [],\n\t\terrors: [],\n\t});\n\tconst health: Health = deriveHealth(vm, 'web');\n\treturn {\n\t\ttotal: vm.total,\n\t\t// Web GraphQL contract: `stopped` rows count toward `ready`.\n\t\tready: vm.readyRows + vm.stoppedRows,\n\t\tactive: vm.activeRows,\n\t\tfailed: vm.failedRows,\n\t\twaiting: vm.waitingRows,\n\t\thealth,\n\t};\n};\n\nconst readSnapshot = (\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(ref));\n\n// --- Identity / Cycle ---------------------------------------------------\nexport const Identity = builder.objectRef<SubscribableState['identity']>('Identity').implement({\n\tdescription: 'Stack identity triple (app/stack/network).',\n\tfields: (t) => ({\n\t\tapp: t.exposeString('app'),\n\t\tstack: t.exposeString('stack'),\n\t\tnetwork: t.exposeString('network'),\n\t}),\n});\n\nexport const Cycle = builder.objectRef<SubscribableState['cycle']>('Cycle').implement({\n\tdescription: 'The current boot/restart cycle.',\n\tfields: (t) => ({\n\t\tid: t.exposeInt('id'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t\t// Carried as String: the raw union ('booting'|…|'shutting-down') is the\n\t\t// wire contract, and 'shutting-down' is not a valid GraphQL enum name.\n\t\tphase: t.field({ type: 'String', resolve: (c) => c.phase }),\n\t}),\n});\n\n// --- Endpoint (Node) ----------------------------------------------------\nexport const Endpoint = builder.objectRef<EndpointShape>('Endpoint');\nbuilder.node(Endpoint, {\n\tdescription: 'A routed endpoint contributed by a plugin.',\n\tid: { resolve: (e) => e.endpointKey },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.endpoints.find((e) => e.endpointKey === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tendpointKey: t.exposeString('endpointKey'),\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\turl: t.exposeString('url'),\n\t\tdisplayUrl: t.exposeString('displayUrl', { nullable: true }),\n\t\twireProtocol: t.field({ type: WireProtocol, resolve: (e) => e.wireProtocol }),\n\t\tregisteredAt: t.exposeFloat('registeredAt'),\n\t}),\n});\n\n// --- LogTail / StackError ----------------------------------------------\nexport const LogTail = builder.objectRef<LogTailShape>('LogTail').implement({\n\tdescription: 'The tail of a plugin log stream.',\n\tfields: (t) => ({\n\t\tlines: t.exposeStringList('lines'),\n\t\tlevel: t.field({ type: LogLevel, resolve: (l) => l.level }),\n\t\ttruncated: t.exposeBoolean('truncated'),\n\t}),\n});\n\nexport const StackError = builder.objectRef<StructuredError>('StackError').implement({\n\tdescription: 'A structured error reported by a plugin or the engine.',\n\tfields: (t) => ({\n\t\tat: t.exposeFloat('at'),\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\ttag: t.exposeString('tag'),\n\t\tsummary: t.exposeString('summary'),\n\t\tchain: t.exposeStringList('chain'),\n\t\tseverity: t.field({ type: ErrorSeverity, resolve: (e) => e.severity }),\n\t}),\n});\n\n// --- Service (Node, wraps a Row) ---------------------------------------\nexport const Service = builder.objectRef<ServiceSource>('Service');\nbuilder.node(Service, {\n\tdescription: 'A visible plugin instance (one projection row).',\n\tid: { resolve: (s) => s.row.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\tconst row = snapshot.rows.find((r) => r.key === id);\n\t\treturn row ? { row, snapshot } : null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.string({ resolve: (s) => s.row.key }),\n\t\trole: t.field({ type: PluginRole, resolve: (s) => s.row.role }),\n\t\tstatus: t.field({ type: LifecycleStatus, resolve: (s) => s.row.status }),\n\t\tsection: t.field({ type: RowSection, resolve: (s) => s.row.section }),\n\t\tendpointSection: t.field({ type: RowSection, resolve: (s) => s.row.endpointSection }),\n\t\tphase: t.string({ nullable: true, resolve: (s) => s.row.phase }),\n\t\tselectiveRestartHighlight: t.boolean({\n\t\t\tresolve: (s) => s.row.selectiveRestartHighlight,\n\t\t}),\n\t\tlastError: t.field({\n\t\t\ttype: StackError,\n\t\t\tnullable: true,\n\t\t\tresolve: (s) => s.row.lastError,\n\t\t}),\n\t\tlogTail: t.field({ type: LogTail, resolve: (s) => s.row.logTail }),\n\t\tendpoints: t.field({\n\t\t\ttype: [Endpoint],\n\t\t\tdescription: \"The row's endpoints, joined from the snapshot by key + pluginKey.\",\n\t\t\tresolve: (s) => {\n\t\t\t\tconst keys = new Set<string>(s.row.endpoints);\n\t\t\t\treturn s.snapshot.endpoints.filter(\n\t\t\t\t\t(e) => keys.has(e.endpointKey) && e.pluginKey === s.row.key,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t}),\n});\n\n// --- Funding ------------------------------------------------------------\nexport const FundingEntry = builder.objectRef<FundingEntrySource>('FundingEntry').implement({\n\tdescription: 'One coin-type funding outcome for an account.',\n\tfields: (t) => ({\n\t\tcoin: t.exposeString('coin'),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tamount: t.exposeString('amount'),\n\t\t// String for the same reason as Cycle.phase: 'already-satisfied' is not\n\t\t// a valid GraphQL enum name; the raw union string is the wire contract.\n\t\tstatus: t.field({ type: 'String', resolve: (e) => e.status }),\n\t}),\n});\n\nexport const AccountFunding = builder\n\t.objectRef<AccountProjection['funding']>('AccountFunding')\n\t.implement({\n\t\tdescription: 'Funding state for an account.',\n\t\tfields: (t) => ({\n\t\t\tstatus: t.field({ type: FundingStatus, resolve: (f) => f.status }),\n\t\t\tbalanceMist: t.exposeString('balanceMist', { nullable: true }),\n\t\t\trequestedMist: t.exposeString('requestedMist', { nullable: true }),\n\t\t\tentries: t.field({\n\t\t\t\ttype: [FundingEntry],\n\t\t\t\tresolve: (f) => f.entries ?? [],\n\t\t\t}),\n\t\t}),\n\t});\n\n// --- Account (Node) -----------------------------------------------------\nexport const Account = builder.objectRef<AccountProjection>('Account');\nbuilder.node(Account, {\n\tdescription: 'A managed or impersonated account.',\n\tid: { resolve: (a) => a.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.accounts.find((a) => a.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\taddress: t.exposeString('address', { nullable: true }),\n\t\tscheme: t.field({ type: AccountScheme, nullable: true, resolve: (a) => a.scheme }),\n\t\tsource: t.field({ type: AccountSource, nullable: true, resolve: (a) => a.source }),\n\t\twalletVisible: t.exposeBoolean('walletVisible'),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t\tfunding: t.field({ type: AccountFunding, resolve: (a) => a.funding }),\n\t}),\n});\n\n// --- Package (Node) -----------------------------------------------------\nexport const Package = builder.objectRef<PackageProjection>('Package');\nbuilder.node(Package, {\n\tdescription: 'A local or known on-chain package.',\n\tid: { resolve: (p) => p.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.packages.find((p) => p.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\tkind: t.field({ type: PackageKind, resolve: (p) => p.kind }),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tupgradeCapId: t.exposeString('upgradeCapId', { nullable: true }),\n\t\tmvrPlaceholder: t.exposeString('mvrPlaceholder'),\n\t\tsourcePath: t.exposeString('sourcePath', { nullable: true }),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t}),\n});\n\n// --- BuildEntry / LastEvent --------------------------------------------\nexport const BuildEntry = builder.objectRef<BuildEntryShape>('BuildEntry').implement({\n\tdescription: 'A stack build progress entry.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\tphase: t.exposeString('phase'),\n\t\tprogress: t.exposeString('progress'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t}),\n});\n\nexport const LastEvent = builder.objectRef<SubscribableState['lastEvent']>('LastEvent').implement({\n\tdescription: 'The most recent event seq/timestamp the engine emitted.',\n\tfields: (t) => ({\n\t\tseq: t.exposeInt('seq'),\n\t\tat: t.exposeFloat('at'),\n\t}),\n});\n\n// --- HealthSummary ------------------------------------------------------\nexport const HealthSummary = builder.objectRef<HealthSummarySource>('HealthSummary').implement({\n\tdescription: 'Derived stack health counts.',\n\tfields: (t) => ({\n\t\ttotal: t.exposeInt('total'),\n\t\tready: t.exposeInt('ready'),\n\t\tactive: t.exposeInt('active'),\n\t\tfailed: t.exposeInt('failed'),\n\t\twaiting: t.exposeInt('waiting'),\n\t\thealth: t.field({ type: HealthEnum, resolve: (h) => h.health }),\n\t}),\n});\n\n// --- Plugin-domain object types ----------------------------------------\n//\n// Sources are the app-agnostic `ControlPlane*` shapes the supervisor\n// populates from resolved plugin values. These cover only what the browser\n// cannot reach directly: codegen capability ids, in-process plugin state,\n// and the snapshot catalog. Numeric counts/sizes are carried as Float\n// (GraphQL Int caps at 2^31).\n\nexport const SnapshotEntry = builder\n\t.objectRef<ControlPlaneSnapshotEntry>('SnapshotEntry')\n\t.implement({\n\t\tdescription: 'A snapshot catalog entry (orchestrator `list`).',\n\t\tfields: (t) => ({\n\t\t\tid: t.exposeString('id'),\n\t\t\tlabel: t.exposeString('label', { nullable: true }),\n\t\t\tcreatedAt: t.exposeFloat('createdAt', { nullable: true }),\n\t\t\tapp: t.exposeString('app', { nullable: true }),\n\t\t\tstack: t.exposeString('stack', { nullable: true }),\n\t\t\tnetwork: t.exposeString('network', { nullable: true }),\n\t\t\tsnapshotGraphInputId: t.exposeString('snapshotGraphInputId', { nullable: true }),\n\t\t\tcurrentGraphInputId: t.exposeString('currentGraphInputId', { nullable: true }),\n\t\t\tgraphInputStatus: t.exposeString('graphInputStatus'),\n\t\t\tgraphInputWarning: t.exposeString('graphInputWarning', { nullable: true }),\n\t\t\tparticipants: t.exposeStringList('participants'),\n\t\t\tcontainerCount: t.exposeInt('containerCount'),\n\t\t\tsubtreeCount: t.exposeInt('subtreeCount'),\n\t\t\tcorrupt: t.exposeBoolean('corrupt'),\n\t\t}),\n\t});\n\nexport const DeepbookPool = builder.objectRef<DashboardDeepbookPool>('DeepbookPool').implement({\n\tdescription: 'A DeepBook pool object id + coin types (prices are chain-direct).',\n\tfields: (t) => ({\n\t\tname: t.exposeString('name'),\n\t\tpoolId: t.exposeString('poolId'),\n\t\tbaseCoinType: t.exposeString('baseCoinType'),\n\t\tquoteCoinType: t.exposeString('quoteCoinType'),\n\t}),\n});\n\nexport const DeepbookInfo = builder.objectRef<DashboardDeepbookInfo>('DeepbookInfo').implement({\n\tdescription: 'A DeepBook deployment: registry/admin/pool ids + market-maker state.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\tmode: t.field({ type: DeepbookMode, resolve: (d) => d.mode }),\n\t\tnetwork: t.exposeString('network'),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tregistryId: t.exposeString('registryId'),\n\t\tadminCapId: t.exposeString('adminCapId', { nullable: true }),\n\t\tdeepTreasuryId: t.exposeString('deepTreasuryId', { nullable: true }),\n\t\tpools: t.field({ type: [DeepbookPool], resolve: (d) => d.pools }),\n\t\tmarketMakerRunning: t.exposeBoolean('marketMakerRunning'),\n\t\tserverUrl: t.exposeString('serverUrl', { nullable: true }),\n\t\tindexerUrl: t.exposeString('indexerUrl', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow off the\n\t\t// opaque resolved value (schema drift surfaced, not silently degraded).\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const SealKeyServer = builder.objectRef<DashboardSealKeyServer>('SealKeyServer').implement({\n\tdescription: 'One Seal key-server config (objectId + weight).',\n\tfields: (t) => ({\n\t\tobjectId: t.exposeString('objectId'),\n\t\tweight: t.exposeInt('weight'),\n\t}),\n});\n\nexport const SealInfo = builder.objectRef<DashboardSealInfo>('SealInfo').implement({\n\tdescription: 'A Seal key-server deployment (objectId/threshold/mode/keyServers).',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\t// String, not enum: 'local-keygen'/'fork-known' are illegal GraphQL\n\t\t// enum value names (hyphens). The raw union string is the wire contract.\n\t\tmode: t.field({ type: 'String', resolve: (s) => s.mode }),\n\t\tobjectId: t.exposeString('objectId'),\n\t\tkeyServerUrl: t.exposeString('keyServerUrl'),\n\t\tkeyServers: t.field({ type: [SealKeyServer], resolve: (s) => s.keyServers }),\n\t\tthreshold: t.exposeInt('threshold'),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const CoinCap = builder.objectRef<DashboardCoinCap>('CoinCap').implement({\n\tdescription: \"A coin's treasury-cap id (drives Mint) + addressing facts.\",\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tsymbol: t.exposeString('symbol', { nullable: true }),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tdecimals: t.exposeInt('decimals'),\n\t\t// String, not enum: 'on-chain' is an illegal GraphQL enum value name.\n\t\tsource: t.field({ type: 'String', resolve: (c) => c.source }),\n\t\ttreasuryCapId: t.exposeString('treasuryCapId', { nullable: true }),\n\t\tpackageId: t.exposeString('packageId', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const FundableCoin = builder.objectRef<DashboardFundableCoin>('FundableCoin').implement({\n\tdescription:\n\t\t'A coin the dashboard faucet can fund right now. SUI is fixed-amount; ' +\n\t\t'WAL/DEEP honor an amount and require the recipient to be a resolved account.',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tcoinType: t.exposeString('coinType'),\n\t\t/** True when the underlying strategy honors a caller-supplied amount\n\t\t * (WAL/DEEP swaps). SUI is fixed-amount (false). */\n\t\thonorsAmount: t.exposeBoolean('honorsAmount'),\n\t\t/** True when funding requires the recipient to BE a resolved account\n\t\t * (the swap spends that account's own SUI). SUI is false. */\n\t\trequiresAccountSigner: t.exposeBoolean('requiresAccountSigner'),\n\t}),\n});\n\n// --- Observability: LogRecord ------------------------------------------\n//\n// Source is the substrate observability log ring records. `level` is\n// carried as String, not a GraphQL enum: the log level vocabulary\n// (trace/debug/info/warn/error/fatal) is wider than the projection's\n// row-tail LogLevel enum, and keeping it String decouples the queryable\n// surface from the row-tail enum (same hyphen/illegal-enum-safe String\n// pattern used by SealMode/CoinSource above). Structured `fields` are\n// serialized to a JSON string — the schema has no JSON scalar and the\n// console renders them as a detail blob.\n\nconst fieldsJson = (fields: Readonly<Record<string, unknown>>): string => {\n\ttry {\n\t\treturn JSON.stringify(fields);\n\t} catch {\n\t\treturn '{}';\n\t}\n};\n\nexport const LogRecordType = builder.objectRef<LogRecord>('LogRecord').implement({\n\tdescription:\n\t\t'One cross-service log record (queryable Console \"Logs\" tab). Fed off the same logger path as the per-row projection tail.',\n\tfields: (t) => ({\n\t\tseq: t.exposeFloat('seq'),\n\t\ttimestampMillis: t.exposeFloat('timestampMillis'),\n\t\t// String: wider than the row-tail LogLevel enum (trace/debug/fatal).\n\t\tlevel: t.field({ type: 'String', resolve: (r) => r.level }),\n\t\tservice: t.exposeString('service'),\n\t\tmessage: t.exposeString('message'),\n\t\t/** Structured fields as a JSON string (no JSON scalar in this schema). */\n\t\tfieldsJson: t.field({ type: 'String', resolve: (r) => fieldsJson(r.fields) }),\n\t}),\n});\n\n// --- Observability filter inputs ---------------------------------------\n\nexport const LogFilterInput = builder.inputType('LogFilter', {\n\tfields: (t) => ({\n\t\tservices: t.stringList({ required: false }),\n\t\t/** Levels (trace/debug/info/warn/error/fatal). Strings, not an enum\n\t\t * (the level vocabulary is wider than the row-tail LogLevel enum). */\n\t\tlevels: t.stringList({ required: false }),\n\t\tsearch: t.string({ required: false }),\n\t\tsinceMillis: t.float({ required: false }),\n\t\tlimit: t.int({ required: false }),\n\t}),\n});\n\n// --- StackState (source = the snapshot itself) -------------------------\nexport const StackState = builder.objectRef<SubscribableState>('StackState').implement({\n\tdescription: 'A full live projection snapshot.',\n\tfields: (t) => ({\n\t\tidentity: t.field({ type: Identity, resolve: (s) => s.identity }),\n\t\tcycle: t.field({ type: Cycle, resolve: (s) => s.cycle }),\n\t\tsummary: t.field({ type: HealthSummary, resolve: (s) => computeHealthSummary(s.rows) }),\n\t\tservices: t.field({\n\t\t\ttype: [Service],\n\t\t\tresolve: (s) => s.rows.map((row) => ({ row, snapshot: s })),\n\t\t}),\n\t\tendpoints: t.field({ type: [Endpoint], resolve: (s) => s.endpoints }),\n\t\taccounts: t.field({ type: [Account], resolve: (s) => s.accounts }),\n\t\tpackages: t.field({ type: [Package], resolve: (s) => s.packages }),\n\t\terrors: t.field({ type: [StackError], resolve: (s) => s.errors }),\n\t\tstackBuild: t.field({ type: [BuildEntry], resolve: (s) => s.stackBuild }),\n\t\tlastEvent: t.field({ type: LastEvent, nullable: true, resolve: (s) => s.lastEvent }),\n\t}),\n});\n"],"mappings":";;;;;;;;;;;;;;;AAoFA,MAAa,wBAAwB,SAAkD;CACtF,MAAM,KAAK,qBAAqB;EAC/B;EACA,WAAW,CAAC;EACZ,UAAU,CAAC;EACX,UAAU,CAAC;EACX,QAAQ,CAAC;CACV,CAAC;CACD,MAAM,SAAiB,aAAa,IAAI,KAAK;CAC7C,OAAO;EACN,OAAO,GAAG;EAEV,OAAO,GAAG,YAAY,GAAG;EACzB,QAAQ,GAAG;EACX,QAAQ,GAAG;EACX,SAAS,GAAG;EACZ;CACD;AACD;AAEA,MAAM,gBACL,QACgC,OAAO,WAAW,gBAAgB,IAAI,GAAG,CAAC;AAG3E,MAAa,WAAW,QAAQ,UAAyC,UAAU,CAAC,CAAC,UAAU;CAC9F,aAAa;CACb,SAAS,OAAO;EACf,KAAK,EAAE,aAAa,KAAK;EACzB,OAAO,EAAE,aAAa,OAAO;EAC7B,SAAS,EAAE,aAAa,SAAS;CAClC;AACD,CAAC;AAED,MAAa,QAAQ,QAAQ,UAAsC,OAAO,CAAC,CAAC,UAAU;CACrF,aAAa;CACb,SAAS,OAAO;EACf,IA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AAO;GAAG,UAAU,MAAM,EAAE;EAAS,CAAC;EACjE,UAAU,EAAE,MAAM;GAAE,MAAM,CAAC,OAAO;GAAG,UAAU,MAAM,EAAE;EAAS,CAAC;EACjE,QAAQ,EAAE,MAAM;GAAE,MAAM,CAAC,UAAU;GAAG,UAAU,MAAM,EAAE;EAAO,CAAC;EAChE,YAAY,EAAE,MAAM;GAAE,MAAM,CAAC,UAAU;GAAG,UAAU,MAAM,EAAE;EAAW,CAAC;EACxE,WAAW,EAAE,MAAM;GAAE,MAAM;GAAW,UAAU;GAAM,UAAU,MAAM,EAAE;EAAU,CAAC;CACpF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.mjs","names":["HealthEnum"],"sources":["../../../../src/plugins/dashboard/schema/types.ts"],"sourcesContent":["// Dashboard object types — real Pothos object refs over the projection.\n//\n// Sources are the substrate projection shapes (Row, Endpoint,\n// AccountProjection, …). Service/Endpoint/Account/Package are registered\n// as relay Nodes via `builder.node`, with an opaque global id derived from\n// their natural key and a `loadOne` that re-finds them in the current\n// snapshot (read from the request's `ctx.state`) so the auto-generated\n// `node`/`nodes` queries resolve.\n//\n// `StackState` and `HealthSummary` are computed views over a snapshot —\n// `StackState` carries the snapshot itself as its source so nested\n// resolvers (e.g. Service.endpoints) can join against sibling arrays.\n\nimport { Effect, SubscriptionRef } from 'effect';\nimport { builder } from './builder.ts';\nimport {\n\tAccountScheme,\n\tAccountSource,\n\tDeepbookMode,\n\tErrorSeverity,\n\tFundingStatus,\n\tHealth as HealthEnum,\n\tLifecycleStatus,\n\tLogLevel,\n\tPackageKind,\n\tPluginRole,\n\tRowSection,\n\tWireProtocol,\n} from './enums.ts';\nimport type { Health } from './enums.ts';\nimport type { ControlPlaneSnapshotEntry } from '../../../substrate/runtime/control-plane/service.ts';\nimport type {\n\tDashboardCoinCap,\n\tDashboardDeepbookInfo,\n\tDashboardDeepbookPool,\n\tDashboardFundableCoin,\n\tDashboardPythFeed,\n\tDashboardSealInfo,\n\tDashboardSealKeyServer,\n} from '../domain.ts';\n// The surface-neutral health derivation lives in the TUI module\n// (`display-derivation.ts`) but is itself ink/react-free with type-only\n// substrate imports — so the web schema can reuse the SAME canonical\n// bucketing + named policies without acquiring any TUI/ink coupling.\nimport { deriveHealth, deriveStackViewModel } from '../../../surfaces/tui/display-derivation.ts';\nimport type { LogRecord } from '../../../substrate/runtime/observability/index.ts';\nimport type {\n\tAccountProjection,\n\tBuildEntry as BuildEntryShape,\n\tEndpoint as EndpointShape,\n\tLogTail as LogTailShape,\n\tPackageProjection,\n\tRow,\n\tStructuredError,\n\tSubscribableState,\n} from '../../../substrate/projection.ts';\n\n/** A snapshot-carrying service row. The snapshot lets `endpoints` join the\n * row's endpoint keys against the projection's endpoint array. */\nexport interface ServiceSource {\n\treadonly row: Row;\n\treadonly snapshot: SubscribableState;\n}\n\ntype FundingEntrySource = NonNullable<AccountProjection['funding']['entries']>[number];\n\nexport interface HealthSummarySource {\n\treadonly total: number;\n\treadonly ready: number;\n\treadonly active: number;\n\treadonly failed: number;\n\treadonly waiting: number;\n\treadonly health: Health;\n}\n\n/** Compute the stack health summary from the projection rows. Delegates to\n * the surface-neutral `deriveStackViewModel` (the single canonical\n * bucketing) + `deriveHealth(counts, 'web')` (the named web policy), then\n * folds the ViewModel's discrete `stoppedRows` into this adapter's `ready`\n * field — preserving the web GraphQL stopped→ready contract. The fold lives\n * HERE, in the web adapter, not in the shared ViewModel, so the TUI policy\n * is unaffected. `active` counts rows mid-flight (acquiring/stopping);\n * `waiting` counts rows that have not started (pending). Overall `health`\n * is `failed`→blocked, any-active→active, all-(ready|stopped) (with ≥1\n * row)→ready, otherwise empty. */\nexport const computeHealthSummary = (rows: ReadonlyArray<Row>): HealthSummarySource => {\n\tconst vm = deriveStackViewModel({\n\t\trows,\n\t\tendpoints: [],\n\t\taccounts: [],\n\t\tpackages: [],\n\t\terrors: [],\n\t});\n\tconst health: Health = deriveHealth(vm, 'web');\n\treturn {\n\t\ttotal: vm.total,\n\t\t// Web GraphQL contract: `stopped` rows count toward `ready`.\n\t\tready: vm.readyRows + vm.stoppedRows,\n\t\tactive: vm.activeRows,\n\t\tfailed: vm.failedRows,\n\t\twaiting: vm.waitingRows,\n\t\thealth,\n\t};\n};\n\nconst readSnapshot = (\n\tref: SubscriptionRef.SubscriptionRef<SubscribableState>,\n): Promise<SubscribableState> => Effect.runPromise(SubscriptionRef.get(ref));\n\n// --- Identity / Cycle ---------------------------------------------------\nexport const Identity = builder.objectRef<SubscribableState['identity']>('Identity').implement({\n\tdescription: 'Stack identity triple (app/stack/network).',\n\tfields: (t) => ({\n\t\tapp: t.exposeString('app'),\n\t\tstack: t.exposeString('stack'),\n\t\tnetwork: t.exposeString('network'),\n\t}),\n});\n\nexport const Cycle = builder.objectRef<SubscribableState['cycle']>('Cycle').implement({\n\tdescription: 'The current boot/restart cycle.',\n\tfields: (t) => ({\n\t\tid: t.exposeInt('id'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t\t// Carried as String: the raw union ('booting'|…|'shutting-down') is the\n\t\t// wire contract, and 'shutting-down' is not a valid GraphQL enum name.\n\t\tphase: t.field({ type: 'String', resolve: (c) => c.phase }),\n\t}),\n});\n\n// --- Endpoint (Node) ----------------------------------------------------\nexport const Endpoint = builder.objectRef<EndpointShape>('Endpoint');\nbuilder.node(Endpoint, {\n\tdescription: 'A routed endpoint contributed by a plugin.',\n\tid: { resolve: (e) => e.endpointKey },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.endpoints.find((e) => e.endpointKey === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tendpointKey: t.exposeString('endpointKey'),\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\turl: t.exposeString('url'),\n\t\tdisplayUrl: t.exposeString('displayUrl', { nullable: true }),\n\t\twireProtocol: t.field({ type: WireProtocol, resolve: (e) => e.wireProtocol }),\n\t\tregisteredAt: t.exposeFloat('registeredAt'),\n\t}),\n});\n\n// --- LogTail / StackError ----------------------------------------------\nexport const LogTail = builder.objectRef<LogTailShape>('LogTail').implement({\n\tdescription: 'The tail of a plugin log stream.',\n\tfields: (t) => ({\n\t\tlines: t.exposeStringList('lines'),\n\t\tlevel: t.field({ type: LogLevel, resolve: (l) => l.level }),\n\t\ttruncated: t.exposeBoolean('truncated'),\n\t}),\n});\n\nexport const StackError = builder.objectRef<StructuredError>('StackError').implement({\n\tdescription: 'A structured error reported by a plugin or the engine.',\n\tfields: (t) => ({\n\t\tat: t.exposeFloat('at'),\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\ttag: t.exposeString('tag'),\n\t\tsummary: t.exposeString('summary'),\n\t\tchain: t.exposeStringList('chain'),\n\t\tseverity: t.field({ type: ErrorSeverity, resolve: (e) => e.severity }),\n\t}),\n});\n\n// --- Service (Node, wraps a Row) ---------------------------------------\nexport const Service = builder.objectRef<ServiceSource>('Service');\nbuilder.node(Service, {\n\tdescription: 'A visible plugin instance (one projection row).',\n\tid: { resolve: (s) => s.row.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\tconst row = snapshot.rows.find((r) => r.key === id);\n\t\treturn row ? { row, snapshot } : null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.string({ resolve: (s) => s.row.key }),\n\t\trole: t.field({ type: PluginRole, resolve: (s) => s.row.role }),\n\t\tstatus: t.field({ type: LifecycleStatus, resolve: (s) => s.row.status }),\n\t\tsection: t.field({ type: RowSection, resolve: (s) => s.row.section }),\n\t\tendpointSection: t.field({ type: RowSection, resolve: (s) => s.row.endpointSection }),\n\t\tphase: t.string({ nullable: true, resolve: (s) => s.row.phase }),\n\t\tselectiveRestartHighlight: t.boolean({\n\t\t\tresolve: (s) => s.row.selectiveRestartHighlight,\n\t\t}),\n\t\tlastError: t.field({\n\t\t\ttype: StackError,\n\t\t\tnullable: true,\n\t\t\tresolve: (s) => s.row.lastError,\n\t\t}),\n\t\tlogTail: t.field({ type: LogTail, resolve: (s) => s.row.logTail }),\n\t\tendpoints: t.field({\n\t\t\ttype: [Endpoint],\n\t\t\tdescription: \"The row's endpoints, joined from the snapshot by key + pluginKey.\",\n\t\t\tresolve: (s) => {\n\t\t\t\tconst keys = new Set<string>(s.row.endpoints);\n\t\t\t\treturn s.snapshot.endpoints.filter(\n\t\t\t\t\t(e) => keys.has(e.endpointKey) && e.pluginKey === s.row.key,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t}),\n});\n\n// --- Funding ------------------------------------------------------------\nexport const FundingEntry = builder.objectRef<FundingEntrySource>('FundingEntry').implement({\n\tdescription: 'One coin-type funding outcome for an account.',\n\tfields: (t) => ({\n\t\tcoin: t.exposeString('coin'),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tamount: t.exposeString('amount'),\n\t\t// String for the same reason as Cycle.phase: 'already-satisfied' is not\n\t\t// a valid GraphQL enum name; the raw union string is the wire contract.\n\t\tstatus: t.field({ type: 'String', resolve: (e) => e.status }),\n\t}),\n});\n\nexport const AccountFunding = builder\n\t.objectRef<AccountProjection['funding']>('AccountFunding')\n\t.implement({\n\t\tdescription: 'Funding state for an account.',\n\t\tfields: (t) => ({\n\t\t\tstatus: t.field({ type: FundingStatus, resolve: (f) => f.status }),\n\t\t\tbalanceMist: t.exposeString('balanceMist', { nullable: true }),\n\t\t\trequestedMist: t.exposeString('requestedMist', { nullable: true }),\n\t\t\tentries: t.field({\n\t\t\t\ttype: [FundingEntry],\n\t\t\t\tresolve: (f) => f.entries ?? [],\n\t\t\t}),\n\t\t}),\n\t});\n\n// --- Account (Node) -----------------------------------------------------\nexport const Account = builder.objectRef<AccountProjection>('Account');\nbuilder.node(Account, {\n\tdescription: 'A managed or impersonated account.',\n\tid: { resolve: (a) => a.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.accounts.find((a) => a.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\taddress: t.exposeString('address', { nullable: true }),\n\t\tscheme: t.field({ type: AccountScheme, nullable: true, resolve: (a) => a.scheme }),\n\t\tsource: t.field({ type: AccountSource, nullable: true, resolve: (a) => a.source }),\n\t\twalletVisible: t.exposeBoolean('walletVisible'),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t\tfunding: t.field({ type: AccountFunding, resolve: (a) => a.funding }),\n\t}),\n});\n\n// --- Package (Node) -----------------------------------------------------\nexport const Package = builder.objectRef<PackageProjection>('Package');\nbuilder.node(Package, {\n\tdescription: 'A local or known on-chain package.',\n\tid: { resolve: (p) => p.key },\n\tloadOne: async (id, ctx) => {\n\t\tconst snapshot = await readSnapshot(ctx.state);\n\t\treturn snapshot.packages.find((p) => p.key === id) ?? null;\n\t},\n\tfields: (t) => ({\n\t\tkey: t.exposeString('key'),\n\t\trowKey: t.exposeString('rowKey', { nullable: true }),\n\t\tname: t.exposeString('name'),\n\t\tkind: t.field({ type: PackageKind, resolve: (p) => p.kind }),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tupgradeCapId: t.exposeString('upgradeCapId', { nullable: true }),\n\t\tmvrPlaceholder: t.exposeString('mvrPlaceholder'),\n\t\tsourcePath: t.exposeString('sourcePath', { nullable: true }),\n\t\tupdatedAt: t.exposeFloat('updatedAt'),\n\t}),\n});\n\n// --- BuildEntry / LastEvent --------------------------------------------\nexport const BuildEntry = builder.objectRef<BuildEntryShape>('BuildEntry').implement({\n\tdescription: 'A stack build progress entry.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey', { nullable: true }),\n\t\tphase: t.exposeString('phase'),\n\t\tprogress: t.exposeString('progress'),\n\t\tstartedAt: t.exposeFloat('startedAt'),\n\t}),\n});\n\nexport const LastEvent = builder.objectRef<SubscribableState['lastEvent']>('LastEvent').implement({\n\tdescription: 'The most recent event seq/timestamp the engine emitted.',\n\tfields: (t) => ({\n\t\tseq: t.exposeInt('seq'),\n\t\tat: t.exposeFloat('at'),\n\t}),\n});\n\n// --- HealthSummary ------------------------------------------------------\nexport const HealthSummary = builder.objectRef<HealthSummarySource>('HealthSummary').implement({\n\tdescription: 'Derived stack health counts.',\n\tfields: (t) => ({\n\t\ttotal: t.exposeInt('total'),\n\t\tready: t.exposeInt('ready'),\n\t\tactive: t.exposeInt('active'),\n\t\tfailed: t.exposeInt('failed'),\n\t\twaiting: t.exposeInt('waiting'),\n\t\thealth: t.field({ type: HealthEnum, resolve: (h) => h.health }),\n\t}),\n});\n\n// --- Plugin-domain object types ----------------------------------------\n//\n// Sources are the app-agnostic `ControlPlane*` shapes the supervisor\n// populates from resolved plugin values. These cover only what the browser\n// cannot reach directly: codegen capability ids, in-process plugin state,\n// and the snapshot catalog. Numeric counts/sizes are carried as Float\n// (GraphQL Int caps at 2^31).\n\nexport const SnapshotEntry = builder\n\t.objectRef<ControlPlaneSnapshotEntry>('SnapshotEntry')\n\t.implement({\n\t\tdescription: 'A snapshot catalog entry (orchestrator `list`).',\n\t\tfields: (t) => ({\n\t\t\tid: t.exposeString('id'),\n\t\t\tlabel: t.exposeString('label', { nullable: true }),\n\t\t\tcreatedAt: t.exposeFloat('createdAt', { nullable: true }),\n\t\t\tapp: t.exposeString('app', { nullable: true }),\n\t\t\tstack: t.exposeString('stack', { nullable: true }),\n\t\t\tnetwork: t.exposeString('network', { nullable: true }),\n\t\t\tsnapshotGraphInputId: t.exposeString('snapshotGraphInputId', { nullable: true }),\n\t\t\tcurrentGraphInputId: t.exposeString('currentGraphInputId', { nullable: true }),\n\t\t\tgraphInputStatus: t.exposeString('graphInputStatus'),\n\t\t\tgraphInputWarning: t.exposeString('graphInputWarning', { nullable: true }),\n\t\t\tparticipants: t.exposeStringList('participants'),\n\t\t\tcontainerCount: t.exposeInt('containerCount'),\n\t\t\tsubtreeCount: t.exposeInt('subtreeCount'),\n\t\t\tcorrupt: t.exposeBoolean('corrupt'),\n\t\t}),\n\t});\n\nexport const DeepbookPool = builder.objectRef<DashboardDeepbookPool>('DeepbookPool').implement({\n\tdescription: 'A DeepBook pool object id + coin types (prices are chain-direct).',\n\tfields: (t) => ({\n\t\tname: t.exposeString('name'),\n\t\tpoolId: t.exposeString('poolId'),\n\t\tbaseCoinType: t.exposeString('baseCoinType'),\n\t\tquoteCoinType: t.exposeString('quoteCoinType'),\n\t}),\n});\n\nexport const PythPriceFeed = builder.objectRef<DashboardPythFeed>('PythPriceFeed').implement({\n\tdescription:\n\t\t'A Pyth price feed seeded inside DeepBook at boot. `price`/`expo` are FIXED ' +\n\t\t'boot-time mock values (static, not a live quote).',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tpriceInfoObjectId: t.exposeString('priceInfoObjectId'),\n\t\t// String (not Int/Float): the boot-time mock price is a signed integer in\n\t\t// feed-native scale carried as a string to survive the wire intact.\n\t\tprice: t.exposeString('price'),\n\t\texpo: t.exposeInt('expo'),\n\t}),\n});\n\nexport const DeepbookInfo = builder.objectRef<DashboardDeepbookInfo>('DeepbookInfo').implement({\n\tdescription:\n\t\t'A DeepBook deployment: registry/admin/pool ids + seed-liquidity state + Pyth feeds.',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tname: t.exposeString('name'),\n\t\tmode: t.field({ type: DeepbookMode, resolve: (d) => d.mode }),\n\t\tnetwork: t.exposeString('network'),\n\t\tpackageId: t.exposeString('packageId'),\n\t\tregistryId: t.exposeString('registryId'),\n\t\tadminCapId: t.exposeString('adminCapId', { nullable: true }),\n\t\tdeepTreasuryId: t.exposeString('deepTreasuryId', { nullable: true }),\n\t\tpools: t.field({ type: [DeepbookPool], resolve: (d) => d.pools }),\n\t\t// Pyth price feeds seeded inside this DeepBook deployment (boot-time mocks).\n\t\tpythFeeds: t.field({ type: [PythPriceFeed], resolve: (d) => d.pythFeeds }),\n\t\t// `true` when one or more pools placed seed orders at boot (NOT a running\n\t\t// market-maker process).\n\t\thasSeedLiquidity: t.exposeBoolean('hasSeedLiquidity'),\n\t\tserverUrl: t.exposeString('serverUrl', { nullable: true }),\n\t\tindexerUrl: t.exposeString('indexerUrl', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow off the\n\t\t// opaque resolved value (schema drift surfaced, not silently degraded).\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const SealKeyServer = builder.objectRef<DashboardSealKeyServer>('SealKeyServer').implement({\n\tdescription: 'One Seal key-server config (objectId + weight).',\n\tfields: (t) => ({\n\t\tobjectId: t.exposeString('objectId'),\n\t\tweight: t.exposeInt('weight'),\n\t}),\n});\n\nexport const SealInfo = builder.objectRef<DashboardSealInfo>('SealInfo').implement({\n\tdescription: 'A Seal key-server deployment (objectId/threshold/mode/keyServers).',\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\t// String, not enum: 'local-keygen'/'fork-known' are illegal GraphQL\n\t\t// enum value names (hyphens). The raw union string is the wire contract.\n\t\tmode: t.field({ type: 'String', resolve: (s) => s.mode }),\n\t\tobjectId: t.exposeString('objectId'),\n\t\tkeyServerUrl: t.exposeString('keyServerUrl'),\n\t\tkeyServers: t.field({ type: [SealKeyServer], resolve: (s) => s.keyServers }),\n\t\tthreshold: t.exposeInt('threshold'),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const CoinCap = builder.objectRef<DashboardCoinCap>('CoinCap').implement({\n\tdescription: \"A coin's treasury-cap id (drives Mint) + addressing facts.\",\n\tfields: (t) => ({\n\t\tpluginKey: t.exposeString('pluginKey'),\n\t\tsymbol: t.exposeString('symbol', { nullable: true }),\n\t\tfullCoinType: t.exposeString('fullCoinType'),\n\t\tdecimals: t.exposeInt('decimals'),\n\t\t// String, not enum: 'on-chain' is an illegal GraphQL enum value name.\n\t\tsource: t.field({ type: 'String', resolve: (c) => c.source }),\n\t\ttreasuryCapId: t.exposeString('treasuryCapId', { nullable: true }),\n\t\tpackageId: t.exposeString('packageId', { nullable: true }),\n\t\t// Fail-loud: non-null when a required field failed to narrow.\n\t\tnarrowingFault: t.exposeString('narrowingFault', { nullable: true }),\n\t}),\n});\n\nexport const FundableCoin = builder.objectRef<DashboardFundableCoin>('FundableCoin').implement({\n\tdescription:\n\t\t'A coin the dashboard faucet can fund right now. SUI is fixed-amount; ' +\n\t\t'WAL/DEEP honor an amount and require the recipient to be a resolved account.',\n\tfields: (t) => ({\n\t\tsymbol: t.exposeString('symbol'),\n\t\tcoinType: t.exposeString('coinType'),\n\t\t/** True when the underlying strategy honors a caller-supplied amount\n\t\t * (WAL/DEEP swaps). SUI is fixed-amount (false). */\n\t\thonorsAmount: t.exposeBoolean('honorsAmount'),\n\t\t/** True when funding requires the recipient to BE a resolved account\n\t\t * (the swap spends that account's own SUI). SUI is false. */\n\t\trequiresAccountSigner: t.exposeBoolean('requiresAccountSigner'),\n\t}),\n});\n\n// --- Observability: LogRecord ------------------------------------------\n//\n// Source is the substrate observability log ring records. `level` is\n// carried as String, not a GraphQL enum: the log level vocabulary\n// (trace/debug/info/warn/error/fatal) is wider than the projection's\n// row-tail LogLevel enum, and keeping it String decouples the queryable\n// surface from the row-tail enum (same hyphen/illegal-enum-safe String\n// pattern used by SealMode/CoinSource above). Structured `fields` are\n// serialized to a JSON string — the schema has no JSON scalar and the\n// console renders them as a detail blob.\n\nconst fieldsJson = (fields: Readonly<Record<string, unknown>>): string => {\n\ttry {\n\t\treturn JSON.stringify(fields);\n\t} catch {\n\t\treturn '{}';\n\t}\n};\n\nexport const LogRecordType = builder.objectRef<LogRecord>('LogRecord').implement({\n\tdescription:\n\t\t'One cross-service log record (queryable Console \"Logs\" tab). Fed off the same logger path as the per-row projection tail.',\n\tfields: (t) => ({\n\t\tseq: t.exposeFloat('seq'),\n\t\ttimestampMillis: t.exposeFloat('timestampMillis'),\n\t\t// String: wider than the row-tail LogLevel enum (trace/debug/fatal).\n\t\tlevel: t.field({ type: 'String', resolve: (r) => r.level }),\n\t\tservice: t.exposeString('service'),\n\t\tmessage: t.exposeString('message'),\n\t\t/** Structured fields as a JSON string (no JSON scalar in this schema). */\n\t\tfieldsJson: t.field({ type: 'String', resolve: (r) => fieldsJson(r.fields) }),\n\t}),\n});\n\n// --- Observability filter inputs ---------------------------------------\n\nexport const LogFilterInput = builder.inputType('LogFilter', {\n\tfields: (t) => ({\n\t\tservices: t.stringList({ required: false }),\n\t\t/** Levels (trace/debug/info/warn/error/fatal). Strings, not an enum\n\t\t * (the level vocabulary is wider than the row-tail LogLevel enum). */\n\t\tlevels: t.stringList({ required: false }),\n\t\tsearch: t.string({ required: false }),\n\t\tsinceMillis: t.float({ required: false }),\n\t\tlimit: t.int({ required: false }),\n\t}),\n});\n\n// --- StackState (source = the snapshot itself) -------------------------\nexport const StackState = builder.objectRef<SubscribableState>('StackState').implement({\n\tdescription: 'A full live projection snapshot.',\n\tfields: (t) => ({\n\t\tidentity: t.field({ type: Identity, resolve: (s) => s.identity }),\n\t\tcycle: t.field({ type: Cycle, resolve: (s) => s.cycle }),\n\t\tsummary: t.field({ type: HealthSummary, resolve: (s) => computeHealthSummary(s.rows) }),\n\t\tservices: t.field({\n\t\t\ttype: [Service],\n\t\t\tresolve: (s) => s.rows.map((row) => ({ row, snapshot: s })),\n\t\t}),\n\t\tendpoints: t.field({ type: [Endpoint], resolve: (s) => s.endpoints }),\n\t\taccounts: t.field({ type: [Account], resolve: (s) => s.accounts }),\n\t\tpackages: t.field({ type: [Package], resolve: (s) => s.packages }),\n\t\terrors: t.field({ type: [StackError], resolve: (s) => s.errors }),\n\t\tstackBuild: t.field({ type: [BuildEntry], resolve: (s) => s.stackBuild }),\n\t\tlastEvent: t.field({ type: LastEvent, nullable: true, resolve: (s) => s.lastEvent }),\n\t}),\n});\n"],"mappings":";;;;;;;;;;;;;;;AAq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;GAAG,UAAU,MAAM,EAAE;EAAW,CAAC;EACxE,WAAW,EAAE,MAAM;GAAE,MAAM;GAAW,UAAU;GAAM,UAAU,MAAM,EAAE;EAAU,CAAC;CACpF;AACD,CAAC"}
|
|
@@ -10,8 +10,10 @@ import { DeepbookBindings } from "./codegen.mjs";
|
|
|
10
10
|
/** The deepbook resolved value. Mode-asymmetric:
|
|
11
11
|
*
|
|
12
12
|
* - `adminCapId` is `null` for known-deployment mode.
|
|
13
|
-
* - `margin` / `serverUrl` / `indexerUrl`
|
|
14
|
-
*
|
|
13
|
+
* - `margin` / `serverUrl` / `indexerUrl` are `null` when the
|
|
14
|
+
* corresponding sub-feature is not enabled.
|
|
15
|
+
* - `hasSeedLiquidity` is `true` when one or more pools placed seed
|
|
16
|
+
* orders at boot (it is NOT a market-maker process state). */
|
|
15
17
|
interface DeepbookResolved {
|
|
16
18
|
readonly mode: 'local' | 'override' | 'known';
|
|
17
19
|
readonly network: string;
|
|
@@ -27,7 +29,9 @@ interface DeepbookResolved {
|
|
|
27
29
|
} | null;
|
|
28
30
|
readonly serverUrl: string | null;
|
|
29
31
|
readonly indexerUrl: string | null;
|
|
30
|
-
|
|
32
|
+
/** `true` when one or more pools placed seed orders at boot. This reflects
|
|
33
|
+
* "a pool was seeded with liquidity", NOT a running market-maker process. */
|
|
34
|
+
readonly hasSeedLiquidity: boolean;
|
|
31
35
|
readonly deepFundingStrategy: DeepbookDeepFundingStrategy | null;
|
|
32
36
|
}
|
|
33
37
|
interface DeepbookCommonOptions {
|
|
@@ -132,7 +132,7 @@ const buildOverridePlugin = (opts) => {
|
|
|
132
132
|
margin: null,
|
|
133
133
|
serverUrl: null,
|
|
134
134
|
indexerUrl: null,
|
|
135
|
-
|
|
135
|
+
hasSeedLiquidity: false,
|
|
136
136
|
deepFundingStrategy: null
|
|
137
137
|
};
|
|
138
138
|
const bindings = {
|
|
@@ -257,7 +257,7 @@ const buildLocalPlugin = (rawOpts) => {
|
|
|
257
257
|
margin: null,
|
|
258
258
|
serverUrl: null,
|
|
259
259
|
indexerUrl: null,
|
|
260
|
-
|
|
260
|
+
hasSeedLiquidity: seedResults.length > 0,
|
|
261
261
|
deepFundingStrategy: null
|
|
262
262
|
};
|
|
263
263
|
const snap = makeLocalSnapshotable({ name });
|
|
@@ -352,7 +352,7 @@ const buildKnownPlugin = (opts) => {
|
|
|
352
352
|
margin: null,
|
|
353
353
|
serverUrl: null,
|
|
354
354
|
indexerUrl: null,
|
|
355
|
-
|
|
355
|
+
hasSeedLiquidity: false,
|
|
356
356
|
deepFundingStrategy: opts.network === "testnet" ? makeDeepbookDeepFundingStrategy({ suiSdk: sui.sdk }) : null
|
|
357
357
|
};
|
|
358
358
|
const bindings = {
|