@dreamboard-games/cli 0.1.30-alpha.1 → 0.1.30-alpha.10
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 +179 -22
- package/dist/agent-verifier/agent-workspace-verifier.mjs +31 -30
- package/dist/agent-verifier/agent-workspace-verifier.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-4WD3YU2E.mjs → chunk-3IJBOLGT.mjs} +4 -12
- package/dist/agent-verifier/chunk-3IJBOLGT.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-6A5HRJMQ.mjs → chunk-4GU3PCHV.mjs} +62 -99
- package/dist/agent-verifier/chunk-4GU3PCHV.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-SYPLYRGB.mjs → chunk-6XRC5PWB.mjs} +119 -310
- package/dist/agent-verifier/chunk-6XRC5PWB.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-BVVNBJM4.mjs → chunk-COB56ESI.mjs} +2 -1
- package/dist/agent-verifier/chunk-COB56ESI.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2GBBP27W.mjs → chunk-F2DIOJJZ.mjs} +1 -0
- package/dist/agent-verifier/chunk-F2DIOJJZ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CFU5EWIC.mjs → chunk-G42BGGG2.mjs} +7 -6
- package/dist/agent-verifier/chunk-G42BGGG2.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-XYDL7GY6.mjs → chunk-H6XDQJ3N.mjs} +1 -0
- package/dist/agent-verifier/{chunk-LM3OZLZG.mjs → chunk-IAYRNVUC.mjs} +1 -0
- package/dist/agent-verifier/chunk-IAYRNVUC.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2QMNAVV4.mjs → chunk-JZTH3EMV.mjs} +2 -1
- package/dist/agent-verifier/chunk-JZTH3EMV.mjs.map +1 -0
- package/dist/agent-verifier/chunk-KK47X7RV.mjs +14 -0
- package/dist/agent-verifier/chunk-KK47X7RV.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-SHUMAVAP.mjs → chunk-M7UVBANQ.mjs} +8 -9
- package/dist/agent-verifier/chunk-M7UVBANQ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-JH22JNYD.mjs → chunk-MGXX4WFR.mjs} +87 -22
- package/dist/agent-verifier/chunk-MGXX4WFR.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2E5P5NWG.mjs → chunk-NAK77WXW.mjs} +58 -126
- package/dist/agent-verifier/chunk-NAK77WXW.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CEQ2VJWN.mjs → chunk-POBFNXD4.mjs} +2 -1
- package/dist/agent-verifier/chunk-POBFNXD4.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-6UUJEYDV.mjs → chunk-QBAF7EYR.mjs} +1 -0
- package/dist/agent-verifier/chunk-QBAF7EYR.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-7653FPGJ.mjs → chunk-RHI6S4SU.mjs} +3 -2
- package/dist/agent-verifier/chunk-RHI6S4SU.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-MINCYHXN.mjs → chunk-TAEQKBJB.mjs} +1 -0
- package/dist/agent-verifier/chunk-TAEQKBJB.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-7E65UQLY.mjs → chunk-TLYGTHXU.mjs} +3 -2
- package/dist/agent-verifier/chunk-TLYGTHXU.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-EIQWDQWJ.mjs → chunk-UWJIZML3.mjs} +13 -14
- package/dist/agent-verifier/chunk-UWJIZML3.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CJEEA6NJ.mjs → chunk-VLOIZDR6.mjs} +15 -31
- package/dist/agent-verifier/chunk-VLOIZDR6.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-HJFQDSTU.mjs → chunk-W2MDP5ZN.mjs} +6 -5
- package/dist/agent-verifier/chunk-W2MDP5ZN.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-CEDUHGNH.mjs → chunk-XKCJBIRY.mjs} +2 -1
- package/dist/agent-verifier/chunk-XKCJBIRY.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-VYJTHSYR.mjs → chunk-YDIOW2BO.mjs} +2 -1
- package/dist/agent-verifier/chunk-YDIOW2BO.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-MRCUP5SW.mjs → chunk-YE7UAO3T.mjs} +1 -0
- package/dist/agent-verifier/chunk-YE7UAO3T.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-EOQIV6PS.mjs → chunk-YR664DJX.mjs} +111 -116
- package/dist/agent-verifier/chunk-YR664DJX.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-2SZHMP6F.mjs → chunk-Z6OZWUIZ.mjs} +6 -9
- package/dist/agent-verifier/chunk-Z6OZWUIZ.mjs.map +1 -0
- package/dist/agent-verifier/{chunk-RBDDIIPM.mjs → chunk-ZEELHSY3.mjs} +1 -0
- package/dist/agent-verifier/chunk-ZEELHSY3.mjs.map +1 -0
- package/dist/agent-verifier/{compile-5QSPIOUT.mjs → compile-C2VIP6VC.mjs} +27 -27
- package/dist/agent-verifier/compile-C2VIP6VC.mjs.map +1 -0
- package/dist/agent-verifier/{global-config-WX3ZZIVU.mjs → global-config-XHL7BCKN.mjs} +6 -5
- package/dist/agent-verifier/global-config-XHL7BCKN.mjs.map +1 -0
- package/dist/agent-verifier/{keychain-backend-TNOPQV3Z.mjs → keychain-backend-A3MRWLPF.mjs} +2 -1
- package/dist/agent-verifier/keychain-backend-A3MRWLPF.mjs.map +1 -0
- package/dist/agent-verifier/{local-files-MTPLP62S.mjs → local-files-ZW52HSVT.mjs} +10 -11
- package/dist/agent-verifier/local-files-ZW52HSVT.mjs.map +1 -0
- package/dist/agent-verifier/local-typecheck-3JXL2NMG.mjs +10 -0
- package/dist/agent-verifier/local-typecheck-3JXL2NMG.mjs.map +1 -0
- package/dist/agent-verifier/{materialize-workspace-FKALAE2T.mjs → materialize-workspace-BKZLLFI4.mjs} +20 -20
- package/dist/agent-verifier/materialize-workspace-BKZLLFI4.mjs.map +1 -0
- package/dist/agent-verifier/{project-state-7GR6BQTQ.mjs → project-state-XKUSCFSV.mjs} +3 -2
- package/dist/agent-verifier/project-state-XKUSCFSV.mjs.map +1 -0
- package/dist/agent-verifier/{prompt-3BAINGAQ.mjs → prompt-VKHMCQT6.mjs} +2 -1
- package/dist/agent-verifier/prompt-VKHMCQT6.mjs.map +1 -0
- package/dist/agent-verifier/{reducer-bundle-preflight-C73LEXI2.mjs → reducer-bundle-preflight-7NYZF5ZT.mjs} +6 -9
- package/dist/agent-verifier/reducer-bundle-preflight-7NYZF5ZT.mjs.map +1 -0
- package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs +11 -0
- package/dist/agent-verifier/reducer-contract-preflight-COD2CO22.mjs.map +1 -0
- package/dist/agent-verifier/{reducer-native-test-harness-GMWBUISX.mjs → reducer-native-test-harness-D4VWPIAC.mjs} +14 -17
- package/dist/agent-verifier/reducer-native-test-harness-D4VWPIAC.mjs.map +1 -0
- package/dist/agent-verifier/static-scaffold-JCRBDKEH.mjs +26 -0
- package/dist/agent-verifier/static-scaffold-JCRBDKEH.mjs.map +1 -0
- package/dist/agent-verifier/{sync-3DUQH32H.mjs → sync-UTL2IIZV.mjs} +35 -39
- package/dist/agent-verifier/sync-UTL2IIZV.mjs.map +1 -0
- package/dist/agent-verifier/{test-P4U5INTD.mjs → test-H26XCBFA.mjs} +29 -31
- package/dist/agent-verifier/test-H26XCBFA.mjs.map +1 -0
- package/dist/agent-verifier/workspace-codegen-WPZHMATU.mjs +10 -0
- package/dist/agent-verifier/workspace-codegen-WPZHMATU.mjs.map +1 -0
- package/dist/agent-verifier/{workspace-dependencies-HZ6VVS4G.mjs → workspace-dependencies-ULZZZPNX.mjs} +5 -4
- package/dist/agent-verifier/workspace-dependencies-ULZZZPNX.mjs.map +1 -0
- package/dist/{chunk-C6UAT6EH.js → chunk-GXM7RRZJ.js} +9 -11
- package/dist/chunk-GXM7RRZJ.js.map +1 -0
- package/dist/{chunk-RS7UXJZV.js → chunk-P5TITCD3.js} +790 -17875
- package/dist/chunk-P5TITCD3.js.map +1 -0
- package/dist/{global-config-AGFBDFYD.js → global-config-WPJRXVDO.js} +2 -2
- package/dist/global-config-WPJRXVDO.js.map +1 -0
- package/dist/index.js +437 -52
- package/dist/index.js.map +1 -1
- package/dist/internal.js +2 -3
- package/package.json +8 -7
- package/skills/dreamboard/references/building-your-first-game.md +510 -0
- package/skills/dreamboard/references/cli.md +104 -0
- package/skills/dreamboard/references/game-interface.md +548 -0
- package/skills/dreamboard/references/manifest-authoring.md +597 -0
- package/skills/dreamboard/references/quickstart.md +66 -0
- package/skills/dreamboard/references/reducer.md +864 -0
- package/skills/dreamboard/references/rule-authoring.md +147 -0
- package/skills/dreamboard/references/testing.md +249 -0
- package/skills/dreamboard/scripts/events-extract.mjs +218 -0
- package/dist/agent-verifier/chunk-54TAYXUD.mjs +0 -12
- package/dist/agent-verifier/chunk-HBNDKQT5.mjs +0 -8381
- package/dist/agent-verifier/chunk-LI3ZR3BI.mjs +0 -41
- package/dist/agent-verifier/chunk-U6OJN7XS.mjs +0 -8092
- package/dist/agent-verifier/local-typecheck-QFYYAZOK.mjs +0 -9
- package/dist/agent-verifier/reducer-contract-preflight-22X7DSZW.mjs +0 -10
- package/dist/agent-verifier/static-scaffold-AJMZZQWS.mjs +0 -28
- package/dist/agent-verifier/testing-5K2BJYF2.mjs +0 -674
- package/dist/agent-verifier/workspace-codegen-JDZJRSDV.mjs +0 -11
- package/dist/chunk-7FOO4AJI.js +0 -50
- package/dist/chunk-7FOO4AJI.js.map +0 -1
- package/dist/chunk-C6UAT6EH.js.map +0 -1
- package/dist/chunk-RS7UXJZV.js.map +0 -1
- package/dist/internal.d.ts +0 -311
- package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +0 -71
- package/dist/runtime-packages/ui-host-runtime/src/browser-interaction.ts +0 -139
- package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +0 -374
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +0 -266
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +0 -212
- package/dist/runtime-packages/ui-host-runtime/src/components/host-primitives.tsx +0 -271
- package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +0 -135
- package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +0 -5
- package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +0 -194
- package/dist/runtime-packages/ui-host-runtime/src/gameplay-authority-transport.ts +0 -626
- package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +0 -1
- package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +0 -1
- package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +0 -294
- package/dist/runtime-packages/ui-host-runtime/src/index.ts +0 -3
- package/dist/runtime-packages/ui-host-runtime/src/logger.ts +0 -11
- package/dist/runtime-packages/ui-host-runtime/src/perf.ts +0 -324
- package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +0 -195
- package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +0 -138
- package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +0 -159
- package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +0 -551
- package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +0 -13
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +0 -122
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +0 -26
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +0 -583
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +0 -219
- package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +0 -117
- package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +0 -431
- package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +0 -211
- package/dist/runtime-packages/ui-host-runtime/src/session-recovery.ts +0 -80
- package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +0 -1034
- package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +0 -416
- package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +0 -184
- package/dist/testing-KLSV6CPJ.js +0 -674
- package/dist/testing-KLSV6CPJ.js.map +0 -1
- /package/dist/{global-config-AGFBDFYD.js.map → agent-verifier/chunk-H6XDQJ3N.mjs.map} +0 -0
package/dist/internal.d.ts
DELETED
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { CompiledResult } from '@dreamboard-games/api-client';
|
|
3
|
-
import { GameTopologyManifest } from '@dreamboard-games/sdk/types';
|
|
4
|
-
|
|
5
|
-
type Environment = "local" | "staging" | "prod";
|
|
6
|
-
type LocalMaintainerRegistryPackages = {
|
|
7
|
-
"@dreamboard-games/api-client"?: string;
|
|
8
|
-
"@dreamboard-games/sdk": string;
|
|
9
|
-
};
|
|
10
|
-
type LocalMaintainerRegistryConfig = {
|
|
11
|
-
registryUrl: string;
|
|
12
|
-
snapshotId: string;
|
|
13
|
-
fingerprint: string;
|
|
14
|
-
publishedAt: string;
|
|
15
|
-
packages: LocalMaintainerRegistryPackages;
|
|
16
|
-
};
|
|
17
|
-
type EnvironmentConfig = {
|
|
18
|
-
apiBaseUrl: string;
|
|
19
|
-
webBaseUrl: string;
|
|
20
|
-
clerkOAuthIssuer?: string;
|
|
21
|
-
clerkOAuthClientId?: string;
|
|
22
|
-
clerkOAuthScope?: string;
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Non-credential configuration persisted at `~/.dreamboard/config.json`.
|
|
26
|
-
*
|
|
27
|
-
* IMPORTANT: `authToken` and `refreshToken` intentionally do NOT live here.
|
|
28
|
-
* Credentials are owned exclusively by the `CredentialStore` module
|
|
29
|
-
* (`config/credential-store.ts`). Mixing them into `GlobalConfig` was the
|
|
30
|
-
* root cause of the refresh-token-wipe bug: `saveGlobalConfig({ ...config })`
|
|
31
|
-
* could silently erase stored credentials if the caller forgot to include
|
|
32
|
-
* them. With credentials removed from this type, that failure mode is a
|
|
33
|
-
* type error.
|
|
34
|
-
*
|
|
35
|
-
* `credentialBackend` is a *selector*, not a credential: it only says where
|
|
36
|
-
* tokens are stored. The default (unset) is `"file"` because the OS keychain
|
|
37
|
-
* prompts the user for their login password on first use on macOS (and is
|
|
38
|
-
* re-prompted whenever the Node binary signature changes, e.g. after an
|
|
39
|
-
* `nvm`/`volta` upgrade). Users who want encrypted-at-rest storage can opt
|
|
40
|
-
* in by writing `"credentialBackend": "keychain"` into this file.
|
|
41
|
-
*/
|
|
42
|
-
type CredentialBackendPreference = "file" | "keychain";
|
|
43
|
-
type GlobalConfig = {
|
|
44
|
-
environment?: Environment;
|
|
45
|
-
credentialBackend?: CredentialBackendPreference;
|
|
46
|
-
};
|
|
47
|
-
type ProjectPendingSyncPhase = "source_revision_created" | "authoring_state_created";
|
|
48
|
-
type ProjectPendingAuthoringSync = {
|
|
49
|
-
phase: ProjectPendingSyncPhase;
|
|
50
|
-
revisionDigest?: string;
|
|
51
|
-
authoringStateId?: string;
|
|
52
|
-
ruleId?: string;
|
|
53
|
-
manifestId?: string;
|
|
54
|
-
manifestContentHash?: string;
|
|
55
|
-
localManifestContentHash?: string;
|
|
56
|
-
sourceRevisionId: string;
|
|
57
|
-
sourceTreeHash: string;
|
|
58
|
-
};
|
|
59
|
-
type ProjectAuthoringState = {
|
|
60
|
-
revisionDigest?: string;
|
|
61
|
-
authoringStateId?: string;
|
|
62
|
-
ruleId?: string;
|
|
63
|
-
manifestId?: string;
|
|
64
|
-
manifestContentHash?: string;
|
|
65
|
-
localManifestContentHash?: string;
|
|
66
|
-
sourceRevisionId?: string;
|
|
67
|
-
sourceTreeHash?: string;
|
|
68
|
-
pendingSync?: ProjectPendingAuthoringSync;
|
|
69
|
-
};
|
|
70
|
-
type ProjectCompileAttempt = {
|
|
71
|
-
resultId?: string;
|
|
72
|
-
jobId?: string;
|
|
73
|
-
revisionDigest?: string;
|
|
74
|
-
authoringStateId: string;
|
|
75
|
-
status: "successful" | "failed";
|
|
76
|
-
diagnosticsSummary?: string;
|
|
77
|
-
};
|
|
78
|
-
type ProjectCompileState = {
|
|
79
|
-
latestAttempt?: ProjectCompileAttempt;
|
|
80
|
-
latestSuccessful?: {
|
|
81
|
-
resultId: string;
|
|
82
|
-
authoringStateId: string;
|
|
83
|
-
revisionDigest?: string;
|
|
84
|
-
};
|
|
85
|
-
};
|
|
86
|
-
type ProjectManifestV2 = {
|
|
87
|
-
schemaVersion: 2;
|
|
88
|
-
projectId: string;
|
|
89
|
-
slug: string;
|
|
90
|
-
};
|
|
91
|
-
type ProjectEnvironmentBindingV1 = {
|
|
92
|
-
deploymentId: string;
|
|
93
|
-
ownerScopeId: string;
|
|
94
|
-
gameId?: string;
|
|
95
|
-
remoteHeadDigest?: string;
|
|
96
|
-
jobId?: string;
|
|
97
|
-
agentManaged?: boolean;
|
|
98
|
-
workspacePrepared?: boolean;
|
|
99
|
-
allowCreateGame?: boolean;
|
|
100
|
-
environment?: Environment;
|
|
101
|
-
authoring?: ProjectAuthoringState;
|
|
102
|
-
compile?: ProjectCompileState;
|
|
103
|
-
localMaintainerRegistry?: LocalMaintainerRegistryConfig;
|
|
104
|
-
apiBaseUrl?: string;
|
|
105
|
-
webBaseUrl?: string;
|
|
106
|
-
packageManifest?: Record<string, unknown>;
|
|
107
|
-
environmentManifest?: Record<string, unknown>;
|
|
108
|
-
};
|
|
109
|
-
type ProjectConfig = ProjectManifestV2 & Omit<ProjectEnvironmentBindingV1, "gameId"> & {
|
|
110
|
-
gameId: string;
|
|
111
|
-
bindingKey?: string;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* A resolved, read-only snapshot of "what should this CLI invocation do".
|
|
115
|
-
*
|
|
116
|
-
* `authToken` and `refreshToken` are read-only projections of the active
|
|
117
|
-
* credentials at the moment `resolveConfig` runs. They are marked `readonly`
|
|
118
|
-
* to discourage reassignment from command code; the refresh path never
|
|
119
|
-
* mutates this object and instead goes through `CredentialStore` directly.
|
|
120
|
-
* Persisting a `ResolvedConfig` back into `GlobalConfig`/`auth.json` is
|
|
121
|
-
* not possible because `GlobalConfig` has no credential fields.
|
|
122
|
-
*/
|
|
123
|
-
type ResolvedConfig = {
|
|
124
|
-
readonly environment: Environment;
|
|
125
|
-
readonly apiBaseUrl: string;
|
|
126
|
-
readonly webBaseUrl: string;
|
|
127
|
-
readonly authToken?: string;
|
|
128
|
-
readonly refreshToken?: string;
|
|
129
|
-
readonly tokenExpiresAt?: string;
|
|
130
|
-
readonly clerkOAuthIssuer?: string;
|
|
131
|
-
readonly clerkOAuthClientId?: string;
|
|
132
|
-
readonly clerkOAuthTokenUrl?: string;
|
|
133
|
-
readonly clerkOAuthScope?: string;
|
|
134
|
-
readonly authTokenSource?: "global" | "env" | "agent-env" | "flag" | "none";
|
|
135
|
-
readonly refreshTokenSource?: "global" | "env" | "none";
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
declare const configFlagsSchema: z.ZodObject<{
|
|
139
|
-
env: z.ZodOptional<z.ZodEnum<{
|
|
140
|
-
local: "local";
|
|
141
|
-
staging: "staging";
|
|
142
|
-
prod: "prod";
|
|
143
|
-
}>>;
|
|
144
|
-
token: z.ZodOptional<z.ZodString>;
|
|
145
|
-
}, z.core.$strip>;
|
|
146
|
-
type ConfigFlags = z.infer<typeof configFlagsSchema>;
|
|
147
|
-
declare function parseConfigFlags(args: unknown): ConfigFlags;
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Single writer for the long-lived Dreamboard session credentials.
|
|
151
|
-
*
|
|
152
|
-
* Design invariants (enforced at the type level and tested in
|
|
153
|
-
* `credential-store.test.ts`):
|
|
154
|
-
*
|
|
155
|
-
* 1. This module is the ONLY place in the CLI that writes credentials to
|
|
156
|
-
* disk or the OS keychain. `global-config.ts` used to own both the
|
|
157
|
-
* config and the credentials via `saveGlobalConfig`, which made it
|
|
158
|
-
* trivial to wipe a refresh token by accident. The `GlobalConfig` type
|
|
159
|
-
* no longer carries credentials, so attempting to persist one through
|
|
160
|
-
* the config path is a type error.
|
|
161
|
-
*
|
|
162
|
-
* 2. The mutating surface is intentionally narrow:
|
|
163
|
-
* - `setCredentials(c)` for refreshable sessions (both tokens present)
|
|
164
|
-
* - `setAccessOnlySession(accessToken)` for the `auth set` / `config set
|
|
165
|
-
* --token` power-user path, which has no refresh token by
|
|
166
|
-
* construction
|
|
167
|
-
* - `clearCredentials()` wipes the file entirely
|
|
168
|
-
* There is no "partial update" API. `Credentials` requires both
|
|
169
|
-
* `accessToken` and `refreshToken`, so it is impossible to persist a
|
|
170
|
-
* half-populated refreshable session.
|
|
171
|
-
*
|
|
172
|
-
* 3. Writes go through `atomicWriteFile` + `withFileLock`, so a crash or
|
|
173
|
-
* interrupt during `dreamboard sync`/`compile` cannot leave `auth.json`
|
|
174
|
-
* truncated, and parallel CLI invocations cannot clobber each other's
|
|
175
|
-
* rotated refresh tokens.
|
|
176
|
-
*
|
|
177
|
-
* 4. The on-disk JSON shape for the file backend is kept backward
|
|
178
|
-
* compatible: we continue to read/write `authToken` + `refreshToken`
|
|
179
|
-
* so existing users are not forced to log in again after this change.
|
|
180
|
-
* A newer `accessToken` key is also accepted for read to ease any
|
|
181
|
-
* future format bump.
|
|
182
|
-
*
|
|
183
|
-
* 5. The file backend is the default. The OS keychain is opt-in via
|
|
184
|
-
* `credentialBackend: "keychain"` in `~/.dreamboard/config.json`
|
|
185
|
-
* because on macOS the first keychain write triggers a login-password
|
|
186
|
-
* prompt, and re-prompts whenever the executing Node binary's code
|
|
187
|
-
* signature changes (e.g. after an `nvm`/`volta` upgrade). Users who
|
|
188
|
-
* want encrypted-at-rest storage can opt in explicitly; everyone else
|
|
189
|
-
* gets a zero-prompt experience.
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Raw on-disk snapshot. Either or both fields may be present. The refresh
|
|
194
|
-
* coordinator only acts on snapshots that have both tokens populated.
|
|
195
|
-
*/
|
|
196
|
-
type StoredSessionSnapshot = {
|
|
197
|
-
readonly accessToken?: string;
|
|
198
|
-
readonly refreshToken?: string;
|
|
199
|
-
readonly tokenExpiresAt?: string;
|
|
200
|
-
readonly clerkOAuthIssuer?: string;
|
|
201
|
-
readonly clerkOAuthClientId?: string;
|
|
202
|
-
readonly clerkOAuthTokenUrl?: string;
|
|
203
|
-
readonly environment?: string;
|
|
204
|
-
};
|
|
205
|
-
/** Loose read: returns whatever is on disk, including access-only sessions. */
|
|
206
|
-
declare function getStoredSession(): Promise<StoredSessionSnapshot | null>;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Resolve the effective CLI config for this invocation.
|
|
210
|
-
*
|
|
211
|
-
* `resolveConfig` is pure and synchronous: it takes pre-loaded inputs
|
|
212
|
-
* (global config, flags, optional project config, optional credential
|
|
213
|
-
* snapshot) and assembles a read-only `ResolvedConfig`. It intentionally
|
|
214
|
-
* does not touch disk or the network - refreshing/persisting credentials
|
|
215
|
-
* is the job of `configureClient` + `RefreshCoordinator`.
|
|
216
|
-
*
|
|
217
|
-
* Passing `credentials = undefined` is equivalent to "no stored session
|
|
218
|
-
* for this call", used by contexts that should never inherit the local
|
|
219
|
-
* session (e.g. `dreamboard login` before the browser flow).
|
|
220
|
-
*/
|
|
221
|
-
declare function resolveConfig(globalConfig: GlobalConfig, flags: ConfigFlags, project?: ProjectConfig, credentials?: StoredSessionSnapshot | null): ResolvedConfig;
|
|
222
|
-
/**
|
|
223
|
-
* Configure the API client for the resolved environment, refreshing the
|
|
224
|
-
* stored CLI session first if it is close to expiry.
|
|
225
|
-
*
|
|
226
|
-
* The refresh path never mutates `config`. It goes through
|
|
227
|
-
* Clerk OAuth directly and the CredentialStore writes. After a successful
|
|
228
|
-
* rotation the HTTP client
|
|
229
|
-
* is configured with the rotated access token; on transient failures we
|
|
230
|
-
* fall back to the `config.authToken` snapshot (which is why commands
|
|
231
|
-
* still see a bearer header and can surface the original error).
|
|
232
|
-
*/
|
|
233
|
-
declare function configureClient(config: ResolvedConfig): Promise<void>;
|
|
234
|
-
declare function requireAuth(config: ResolvedConfig): void;
|
|
235
|
-
/**
|
|
236
|
-
* Common init pattern used by pull, push, status, update, run commands:
|
|
237
|
-
* find project root, load config, resolve config, require auth,
|
|
238
|
-
* configure client.
|
|
239
|
-
*/
|
|
240
|
-
declare function resolveProjectContext(flags: ConfigFlags, opts?: {
|
|
241
|
-
requireAuth?: boolean;
|
|
242
|
-
}): Promise<{
|
|
243
|
-
projectRoot: string;
|
|
244
|
-
projectConfig: ProjectConfig;
|
|
245
|
-
config: ResolvedConfig;
|
|
246
|
-
}>;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Load non-credential CLI configuration.
|
|
250
|
-
*
|
|
251
|
-
* Note: this function used to also load `authToken` / `refreshToken`
|
|
252
|
-
* from `auth.json` and flatten them onto `GlobalConfig`. That shape
|
|
253
|
-
* enabled the refresh-token-wipe bug: `saveGlobalConfig({ ...config })`
|
|
254
|
-
* without explicit auth fields erased the stored refresh token.
|
|
255
|
-
*
|
|
256
|
-
* Credentials are now owned exclusively by `CredentialStore`. Callers
|
|
257
|
-
* that need them must import `getCredentials()` directly.
|
|
258
|
-
*/
|
|
259
|
-
declare function loadGlobalConfig(): Promise<GlobalConfig>;
|
|
260
|
-
|
|
261
|
-
declare const CONFIG_FLAG_ARGS: {
|
|
262
|
-
env: {
|
|
263
|
-
type: "string";
|
|
264
|
-
description: string;
|
|
265
|
-
};
|
|
266
|
-
token: {
|
|
267
|
-
type: "string";
|
|
268
|
-
description: string;
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
declare const ENVIRONMENT_CONFIGS: Record<string, EnvironmentConfig>;
|
|
273
|
-
|
|
274
|
-
declare function loadProjectConfig(rootDir: string): Promise<ProjectConfig>;
|
|
275
|
-
declare function updateProjectState(rootDir: string, config: ProjectConfig): Promise<void>;
|
|
276
|
-
|
|
277
|
-
declare function readJsonFile<T>(filePath: string): Promise<T>;
|
|
278
|
-
declare function writeJsonFile(filePath: string, data: unknown): Promise<void>;
|
|
279
|
-
|
|
280
|
-
declare function findCompiledResultsForAuthoringState(options: {
|
|
281
|
-
gameId: string;
|
|
282
|
-
authoringStateId: string;
|
|
283
|
-
}): Promise<CompiledResult[]>;
|
|
284
|
-
|
|
285
|
-
declare function setLatestCompileAttempt(projectConfig: ProjectConfig, attempt: ProjectCompileAttempt): ProjectConfig;
|
|
286
|
-
|
|
287
|
-
declare function loadManifest(rootDir: string): Promise<GameTopologyManifest>;
|
|
288
|
-
|
|
289
|
-
declare function writeSnapshot(rootDir: string): Promise<void>;
|
|
290
|
-
|
|
291
|
-
interface WorkspaceCodegenWriteResult {
|
|
292
|
-
written: string[];
|
|
293
|
-
skipped: string[];
|
|
294
|
-
merged: string[];
|
|
295
|
-
}
|
|
296
|
-
declare function applyWorkspaceCodegen(options: {
|
|
297
|
-
projectRoot: string;
|
|
298
|
-
manifest: GameTopologyManifest;
|
|
299
|
-
}): Promise<WorkspaceCodegenWriteResult>;
|
|
300
|
-
|
|
301
|
-
declare function ensureReducerNativeTestingFiles(projectRoot: string): Promise<void>;
|
|
302
|
-
|
|
303
|
-
declare function shortHash(value: string): string;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Browser test runner helpers shared with reducer-native-test-harness (browser runner).
|
|
307
|
-
* Screenshot / JSON scenario navigation helpers lived in the deleted `run` command.
|
|
308
|
-
*/
|
|
309
|
-
declare function configurePlaywrightBrowsersPath(): void;
|
|
310
|
-
|
|
311
|
-
export { CONFIG_FLAG_ARGS, type ConfigFlags, ENVIRONMENT_CONFIGS, type ProjectConfig, type ResolvedConfig, applyWorkspaceCodegen, configureClient, configurePlaywrightBrowsersPath, ensureReducerNativeTestingFiles, findCompiledResultsForAuthoringState, getStoredSession, loadGlobalConfig, loadManifest, loadProjectConfig, parseConfigFlags, readJsonFile, requireAuth, resolveConfig, resolveProjectContext, setLatestCompileAttempt, shortHash, updateProjectState, writeJsonFile, writeSnapshot };
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
SeatAssignment,
|
|
3
|
-
SessionActor,
|
|
4
|
-
SessionGameSource,
|
|
5
|
-
} from "@dreamboard-games/api-client";
|
|
6
|
-
|
|
7
|
-
type HexColor = string & { readonly __brand: "HexColor" };
|
|
8
|
-
|
|
9
|
-
const HEX_COLOR_PATTERN = /^#[0-9A-Fa-f]{6}$/;
|
|
10
|
-
|
|
11
|
-
function parseHexColor(value: unknown): HexColor | undefined {
|
|
12
|
-
return typeof value === "string" && HEX_COLOR_PATTERN.test(value)
|
|
13
|
-
? (value as HexColor)
|
|
14
|
-
: undefined;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Stable string principal for comparing actors to connection `userId` / demo actor id. */
|
|
18
|
-
export function principalKey(actor: SessionActor): string {
|
|
19
|
-
if (actor.kind === "AUTH_USER") {
|
|
20
|
-
return actor.id;
|
|
21
|
-
}
|
|
22
|
-
if (actor.kind === "PERF_OPERATOR") {
|
|
23
|
-
return `perf:${actor.perfRunId}`;
|
|
24
|
-
}
|
|
25
|
-
return actor.demoActorSessionId;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function principalMatchesActor(
|
|
29
|
-
principalId: string | null | undefined,
|
|
30
|
-
actor: SessionActor,
|
|
31
|
-
): boolean {
|
|
32
|
-
if (!principalId) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return principalKey(actor) === principalId;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function seatControlledByPrincipal(
|
|
39
|
-
seat: SeatAssignment,
|
|
40
|
-
principalId: string | null | undefined,
|
|
41
|
-
): boolean {
|
|
42
|
-
if (!principalId || !seat.controllerActor) {
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return principalMatchesActor(principalId, seat.controllerActor);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function gameIdFromGameSource(source: SessionGameSource): string {
|
|
49
|
-
if (source.kind === "USER_COMPILED") {
|
|
50
|
-
return source.gameId;
|
|
51
|
-
}
|
|
52
|
-
return `demo:${source.slug}:${source.revisionId}`;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export function seatsForPluginSnapshot(seats: SeatAssignment[]): Array<{
|
|
56
|
-
playerId: string;
|
|
57
|
-
controllerUserId?: string;
|
|
58
|
-
displayName: string;
|
|
59
|
-
playerColor?: HexColor;
|
|
60
|
-
isHost?: boolean;
|
|
61
|
-
}> {
|
|
62
|
-
return seats.map((seat) => ({
|
|
63
|
-
playerId: seat.playerId,
|
|
64
|
-
controllerUserId: seat.controllerActor
|
|
65
|
-
? principalKey(seat.controllerActor)
|
|
66
|
-
: undefined,
|
|
67
|
-
displayName: seat.displayName,
|
|
68
|
-
playerColor: parseHexColor(seat.playerColor),
|
|
69
|
-
isHost: seat.isHost,
|
|
70
|
-
}));
|
|
71
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createBrowserInteractionActuatorAttributes,
|
|
3
|
-
createBrowserInteractionRootAttributes,
|
|
4
|
-
defineBrowserInteractionSurface,
|
|
5
|
-
type BrowserInteractionAttributeMap,
|
|
6
|
-
} from "@dreamboard-games/sdk/browser-interaction";
|
|
7
|
-
|
|
8
|
-
export const HOST_BROWSER_INTERACTION_SURFACE = "host" as const;
|
|
9
|
-
export const HOST_BROWSER_INTERACTION_SCOPE = "session" as const;
|
|
10
|
-
export const HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_KEY =
|
|
11
|
-
"host.switchControlledPlayer" as const;
|
|
12
|
-
export const HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_ID =
|
|
13
|
-
"switchControlledPlayer" as const;
|
|
14
|
-
export const HOST_SWITCH_CONTROLLED_PLAYER_INTENT =
|
|
15
|
-
"switchControlledPlayer" as const;
|
|
16
|
-
export const HOST_SWITCH_CONTROLLED_PLAYER_EFFECT_KIND =
|
|
17
|
-
"switchControlledPlayer" as const;
|
|
18
|
-
|
|
19
|
-
export const hostBrowserInteractionSurface = defineBrowserInteractionSurface({
|
|
20
|
-
surface: HOST_BROWSER_INTERACTION_SURFACE,
|
|
21
|
-
intents: [HOST_SWITCH_CONTROLLED_PLAYER_INTENT],
|
|
22
|
-
effectKinds: [HOST_SWITCH_CONTROLLED_PLAYER_EFFECT_KIND],
|
|
23
|
-
} as Parameters<typeof defineBrowserInteractionSurface>[0] & {
|
|
24
|
-
readonly effectKinds: readonly string[];
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export function createHostSwitchControlledPlayerRootAttributes(): BrowserInteractionAttributeMap {
|
|
28
|
-
return {
|
|
29
|
-
...createBrowserInteractionRootAttributes({
|
|
30
|
-
surface: HOST_BROWSER_INTERACTION_SURFACE,
|
|
31
|
-
scopeId: HOST_BROWSER_INTERACTION_SCOPE,
|
|
32
|
-
interactionKey: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_KEY,
|
|
33
|
-
interactionId: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_ID,
|
|
34
|
-
readiness: "ready",
|
|
35
|
-
}),
|
|
36
|
-
[PROTOCOL_ATTRIBUTE]: "2.0.0",
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function createHostSwitchControlledPlayerActuatorAttributes(input: {
|
|
41
|
-
readonly playerId: string;
|
|
42
|
-
readonly selected: boolean;
|
|
43
|
-
readonly enabled: boolean;
|
|
44
|
-
}): BrowserInteractionAttributeMap {
|
|
45
|
-
return {
|
|
46
|
-
...createBrowserInteractionActuatorAttributes({
|
|
47
|
-
surface: HOST_BROWSER_INTERACTION_SURFACE,
|
|
48
|
-
scopeId: HOST_BROWSER_INTERACTION_SCOPE,
|
|
49
|
-
interactionKey: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_KEY,
|
|
50
|
-
interactionId: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_ID,
|
|
51
|
-
intent: HOST_SWITCH_CONTROLLED_PLAYER_INTENT,
|
|
52
|
-
inputKey: "playerId",
|
|
53
|
-
candidateValue: input.playerId,
|
|
54
|
-
candidateState: input.selected ? "selected" : "unselected",
|
|
55
|
-
enabled: input.enabled,
|
|
56
|
-
actuatorKind: "click",
|
|
57
|
-
}),
|
|
58
|
-
[PROTOCOL_ATTRIBUTE]: "2.0.0",
|
|
59
|
-
[SEMANTIC_EFFECTS_ATTRIBUTE]: encodeBrowserEffectList([
|
|
60
|
-
{
|
|
61
|
-
kind: HOST_SWITCH_CONTROLLED_PLAYER_EFFECT_KIND,
|
|
62
|
-
playerId: input.playerId,
|
|
63
|
-
beforeSelected: input.selected,
|
|
64
|
-
afterSelected: true,
|
|
65
|
-
},
|
|
66
|
-
]),
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function createHostSwitchControlledPlayerMenuTriggerAttributes(): BrowserInteractionAttributeMap {
|
|
71
|
-
return {
|
|
72
|
-
...createBrowserInteractionActuatorAttributes({
|
|
73
|
-
surface: HOST_BROWSER_INTERACTION_SURFACE,
|
|
74
|
-
scopeId: HOST_BROWSER_INTERACTION_SCOPE,
|
|
75
|
-
interactionKey: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_KEY,
|
|
76
|
-
interactionId: HOST_SWITCH_CONTROLLED_PLAYER_INTERACTION_ID,
|
|
77
|
-
intent: HOST_SWITCH_CONTROLLED_PLAYER_INTENT,
|
|
78
|
-
actuatorKind: "click",
|
|
79
|
-
prepares: {
|
|
80
|
-
intent: HOST_SWITCH_CONTROLLED_PLAYER_INTENT,
|
|
81
|
-
inputKey: "playerId",
|
|
82
|
-
actuatorKind: "click",
|
|
83
|
-
},
|
|
84
|
-
}),
|
|
85
|
-
[PROTOCOL_ATTRIBUTE]: "2.0.0",
|
|
86
|
-
[PREPARATION_PATTERNS_ATTRIBUTE]: encodeBrowserEffectPatternList([
|
|
87
|
-
{
|
|
88
|
-
kind: "match",
|
|
89
|
-
effectKind: HOST_SWITCH_CONTROLLED_PLAYER_EFFECT_KIND,
|
|
90
|
-
fields: {},
|
|
91
|
-
},
|
|
92
|
-
]),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const PROTOCOL_ATTRIBUTE = "data-dreamboard-browser-protocol";
|
|
97
|
-
const SEMANTIC_EFFECTS_ATTRIBUTE = "data-dreamboard-semantic-effects";
|
|
98
|
-
const PREPARATION_PATTERNS_ATTRIBUTE = "data-dreamboard-preparation-patterns";
|
|
99
|
-
|
|
100
|
-
type CanonicalBrowserValue =
|
|
101
|
-
| null
|
|
102
|
-
| boolean
|
|
103
|
-
| number
|
|
104
|
-
| string
|
|
105
|
-
| readonly CanonicalBrowserValue[]
|
|
106
|
-
| { readonly [key: string]: CanonicalBrowserValue };
|
|
107
|
-
|
|
108
|
-
function encodeBrowserEffectList(
|
|
109
|
-
effects: ReadonlyArray<{ readonly [key: string]: CanonicalBrowserValue }>,
|
|
110
|
-
): string {
|
|
111
|
-
return JSON.stringify(effects.map(encodeCanonicalBrowserValue));
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function encodeBrowserEffectPatternList(
|
|
115
|
-
patterns: ReadonlyArray<{ readonly [key: string]: CanonicalBrowserValue }>,
|
|
116
|
-
): string {
|
|
117
|
-
return JSON.stringify(patterns.map(encodeCanonicalBrowserValue));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function encodeCanonicalBrowserValue(value: CanonicalBrowserValue): string {
|
|
121
|
-
return JSON.stringify(canonicalizeBrowserValue(value));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
function canonicalizeBrowserValue(
|
|
125
|
-
value: CanonicalBrowserValue,
|
|
126
|
-
): CanonicalBrowserValue {
|
|
127
|
-
if (Array.isArray(value)) {
|
|
128
|
-
return value.map(canonicalizeBrowserValue);
|
|
129
|
-
}
|
|
130
|
-
if (value && typeof value === "object") {
|
|
131
|
-
const record = value as { readonly [key: string]: CanonicalBrowserValue };
|
|
132
|
-
return Object.fromEntries(
|
|
133
|
-
Object.keys(record)
|
|
134
|
-
.sort()
|
|
135
|
-
.map((key) => [key, canonicalizeBrowserValue(record[key]!)]),
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
return value;
|
|
139
|
-
}
|