primitive-admin 1.2.0-alpha.6 → 1.2.0-alpha.8
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 +9 -3
- package/assets/skill/skills/primitive-platform/SKILL.md +12 -6
- package/dist/src/commands/apps-children.d.ts +1 -1
- package/dist/src/commands/apps-children.js +172 -28
- package/dist/src/commands/apps-children.js.map +1 -1
- package/dist/src/commands/auth.js +147 -38
- package/dist/src/commands/auth.js.map +1 -1
- package/dist/src/commands/config.js +43 -4
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/database-types.js +313 -13
- package/dist/src/commands/database-types.js.map +1 -1
- package/dist/src/commands/databases.js +143 -54
- package/dist/src/commands/databases.js.map +1 -1
- package/dist/src/commands/documents.js +70 -11
- package/dist/src/commands/documents.js.map +1 -1
- package/dist/src/commands/init.d.ts +7 -0
- package/dist/src/commands/init.js +9 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/llm.js +6 -9
- package/dist/src/commands/llm.js.map +1 -1
- package/dist/src/commands/settings.d.ts +9 -12
- package/dist/src/commands/settings.js +79 -31
- package/dist/src/commands/settings.js.map +1 -1
- package/dist/src/commands/sync-app-settings.d.ts +12 -2
- package/dist/src/commands/sync-app-settings.js +35 -10
- package/dist/src/commands/sync-app-settings.js.map +1 -1
- package/dist/src/commands/sync.d.ts +118 -6
- package/dist/src/commands/sync.js +638 -65
- package/dist/src/commands/sync.js.map +1 -1
- package/dist/src/lib/api-client.d.ts +25 -6
- package/dist/src/lib/api-client.js +106 -72
- package/dist/src/lib/api-client.js.map +1 -1
- package/dist/src/lib/app-settings-descriptor.d.ts +38 -0
- package/dist/src/lib/app-settings-descriptor.js +96 -4
- package/dist/src/lib/app-settings-descriptor.js.map +1 -1
- package/dist/src/lib/child-apps-local.d.ts +45 -21
- package/dist/src/lib/child-apps-local.js +68 -30
- package/dist/src/lib/child-apps-local.js.map +1 -1
- package/dist/src/lib/credentials-home.d.ts +51 -0
- package/dist/src/lib/credentials-home.js +169 -0
- package/dist/src/lib/credentials-home.js.map +1 -0
- package/dist/src/lib/credentials-lock.d.ts +80 -0
- package/dist/src/lib/credentials-lock.js +222 -0
- package/dist/src/lib/credentials-lock.js.map +1 -0
- package/dist/src/lib/credentials-store.d.ts +92 -5
- package/dist/src/lib/credentials-store.js +377 -53
- package/dist/src/lib/credentials-store.js.map +1 -1
- package/dist/src/lib/env-resolver-core.d.ts +1 -1
- package/dist/src/lib/env-resolver-core.js.map +1 -1
- package/dist/src/lib/function-bundle.d.ts +38 -18
- package/dist/src/lib/function-bundle.js +60 -35
- package/dist/src/lib/function-bundle.js.map +1 -1
- package/dist/src/lib/function-collect.d.ts +1 -1
- package/dist/src/lib/function-collect.js +4 -0
- package/dist/src/lib/function-collect.js.map +1 -1
- package/dist/src/lib/function-document-types.d.ts +5 -3
- package/dist/src/lib/function-document-types.js +10 -14
- package/dist/src/lib/function-document-types.js.map +1 -1
- package/dist/src/lib/function-source-roots.d.ts +67 -0
- package/dist/src/lib/function-source-roots.js +148 -0
- package/dist/src/lib/function-source-roots.js.map +1 -0
- package/dist/src/lib/function-sync.d.ts +27 -0
- package/dist/src/lib/function-sync.js +16 -3
- package/dist/src/lib/function-sync.js.map +1 -1
- package/dist/src/lib/function-triggers.d.ts +3 -15
- package/dist/src/lib/function-triggers.js +10 -72
- package/dist/src/lib/function-triggers.js.map +1 -1
- package/dist/src/lib/function-typecheck.d.ts +37 -2
- package/dist/src/lib/function-typecheck.js +210 -28
- package/dist/src/lib/function-typecheck.js.map +1 -1
- package/dist/src/lib/generated-config-surfaces.d.ts +148 -0
- package/dist/src/lib/generated-config-surfaces.js +229 -35
- package/dist/src/lib/generated-config-surfaces.js.map +1 -1
- package/dist/src/lib/generated-sdk-types.d.ts +1 -1
- package/dist/src/lib/generated-sdk-types.js +1 -1
- package/dist/src/lib/generated-sdk-types.js.map +1 -1
- package/dist/src/lib/local-state.d.ts +21 -6
- package/dist/src/lib/local-state.js +78 -34
- package/dist/src/lib/local-state.js.map +1 -1
- package/dist/src/lib/login-scope-lines.d.ts +1 -1
- package/dist/src/lib/login-scope-lines.js +1 -1
- package/dist/src/lib/login-scope-lines.js.map +1 -1
- package/dist/src/lib/project-config.d.ts +7 -0
- package/dist/src/lib/project-config.js +22 -1
- package/dist/src/lib/project-config.js.map +1 -1
- package/dist/src/lib/push-failure-report.d.ts +45 -0
- package/dist/src/lib/push-failure-report.js +57 -0
- package/dist/src/lib/push-failure-report.js.map +1 -0
- package/dist/src/lib/root-import-decision.d.ts +9 -4
- package/dist/src/lib/root-import-decision.js +24 -3
- package/dist/src/lib/root-import-decision.js.map +1 -1
- package/dist/src/lib/scope-request.d.ts +8 -5
- package/dist/src/lib/scope-request.js +17 -8
- package/dist/src/lib/scope-request.js.map +1 -1
- package/dist/src/lib/sync-selectors.d.ts +5 -1
- package/dist/src/lib/sync-selectors.js +23 -13
- package/dist/src/lib/sync-selectors.js.map +1 -1
- package/dist/src/lib/transient-retry.d.ts +9 -0
- package/dist/src/lib/transient-retry.js +37 -0
- package/dist/src/lib/transient-retry.js.map +1 -1
- package/dist/src/lib/vars-override.d.ts +105 -0
- package/dist/src/lib/vars-override.js +143 -0
- package/dist/src/lib/vars-override.js.map +1 -0
- package/package.json +2 -2
- package/dist/src/lib/generated-workflow-model-fields.d.ts +0 -20
- package/dist/src/lib/generated-workflow-model-fields.js +0 -53
- package/dist/src/lib/generated-workflow-model-fields.js.map +0 -1
- package/dist/src/lib/workflow-field-descriptor.d.ts +0 -91
- package/dist/src/lib/workflow-field-descriptor.js +0 -153
- package/dist/src/lib/workflow-field-descriptor.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generated-sdk-types.js","sourceRoot":"","sources":["../../../src/lib/generated-sdk-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"generated-sdk-types.js","sourceRoot":"","sources":["../../../src/lib/generated-sdk-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,s7kIAAs7kI,CAAC"}
|
|
@@ -55,17 +55,32 @@ export interface IgnoreCoverageOutcome {
|
|
|
55
55
|
/** Why, for `failed`. */
|
|
56
56
|
detail?: string;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Makes sure the machine-local file at `path` is git-ignored before it is
|
|
60
|
+
* written, and confirms it.
|
|
61
|
+
*
|
|
62
|
+
* When the file is not already covered an anchored pattern is appended to the
|
|
63
|
+
* repository's exclude file, resolved via `git rev-parse --git-path
|
|
64
|
+
* info/exclude` so a linked worktree (where `.git` is a FILE) works, and
|
|
65
|
+
* anchored relative to `git rev-parse --show-toplevel` so a project root
|
|
66
|
+
* nested below the worktree root is not mis-rooted. `reason` names the command
|
|
67
|
+
* in the comment written beside the pattern.
|
|
68
|
+
*
|
|
69
|
+
* Coverage is confirmed, not assumed (#4485): a destination git already
|
|
70
|
+
* tracks is a failure, and so is one `git check-ignore` still reports as not
|
|
71
|
+
* ignored once the pattern is in place — a committed `.gitignore` negation
|
|
72
|
+
* outranks `info/exclude`. Git runs from the nearest existing directory above
|
|
73
|
+
* the destination, and no directory is created.
|
|
74
|
+
*/
|
|
75
|
+
export declare function ensureFileIgnored(path: string, options: {
|
|
76
|
+
reason: string;
|
|
77
|
+
}): IgnoreCoverageOutcome;
|
|
58
78
|
/**
|
|
59
79
|
* Makes sure `.primitive/local.json` is ignored before it is written.
|
|
60
80
|
*
|
|
61
81
|
* Templates scaffolded from now on carry the entry in their `.gitignore`, but
|
|
62
82
|
* projects created before this change do not — and `env use` writing an
|
|
63
83
|
* untracked-but-committable file would be exactly the "switching backends
|
|
64
|
-
* dirties the repo" problem this replaced.
|
|
65
|
-
* covered we append an anchored pattern to the repository's exclude file,
|
|
66
|
-
* resolved via `git rev-parse --git-path info/exclude` so a linked worktree
|
|
67
|
-
* (where `.git` is a FILE) works, and anchored relative to
|
|
68
|
-
* `git rev-parse --show-toplevel` so a project root nested below the worktree
|
|
69
|
-
* root is not mis-rooted.
|
|
84
|
+
* dirties the repo" problem this replaced. See {@link ensureFileIgnored}.
|
|
70
85
|
*/
|
|
71
86
|
export declare function ensureLocalStateIgnored(localStatePath: string): IgnoreCoverageOutcome;
|
|
@@ -176,71 +176,115 @@ function git(cwd, args) {
|
|
|
176
176
|
function escapeGitignorePattern(relPath) {
|
|
177
177
|
return relPath.replace(/[\\*?[\]]/g, (c) => "\\" + c).replace(/^([#!])/, "\\$1");
|
|
178
178
|
}
|
|
179
|
+
/** The nearest directory at or above `path` that exists. */
|
|
180
|
+
function nearestExistingDir(path) {
|
|
181
|
+
let dir = dirname(path);
|
|
182
|
+
while (!existsSync(dir)) {
|
|
183
|
+
const parent = dirname(dir);
|
|
184
|
+
if (parent === dir)
|
|
185
|
+
break;
|
|
186
|
+
dir = parent;
|
|
187
|
+
}
|
|
188
|
+
return dir;
|
|
189
|
+
}
|
|
190
|
+
/** Whether git reports `path` as ignored, run from `cwd`. */
|
|
191
|
+
function isGitIgnored(cwd, path) {
|
|
192
|
+
try {
|
|
193
|
+
execFileSync("git", ["check-ignore", "-q", "--", path], { cwd, stdio: "ignore" });
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// Exit 1 means "not ignored".
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/** Whether git tracks `path`, run from `cwd`. */
|
|
202
|
+
function isGitTracked(cwd, path) {
|
|
203
|
+
try {
|
|
204
|
+
execFileSync("git", ["ls-files", "--error-unmatch", "--", path], { cwd, stdio: "ignore" });
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
179
211
|
/**
|
|
180
|
-
* Makes sure
|
|
212
|
+
* Makes sure the machine-local file at `path` is git-ignored before it is
|
|
213
|
+
* written, and confirms it.
|
|
181
214
|
*
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
215
|
+
* When the file is not already covered an anchored pattern is appended to the
|
|
216
|
+
* repository's exclude file, resolved via `git rev-parse --git-path
|
|
217
|
+
* info/exclude` so a linked worktree (where `.git` is a FILE) works, and
|
|
218
|
+
* anchored relative to `git rev-parse --show-toplevel` so a project root
|
|
219
|
+
* nested below the worktree root is not mis-rooted. `reason` names the command
|
|
220
|
+
* in the comment written beside the pattern.
|
|
221
|
+
*
|
|
222
|
+
* Coverage is confirmed, not assumed (#4485): a destination git already
|
|
223
|
+
* tracks is a failure, and so is one `git check-ignore` still reports as not
|
|
224
|
+
* ignored once the pattern is in place — a committed `.gitignore` negation
|
|
225
|
+
* outranks `info/exclude`. Git runs from the nearest existing directory above
|
|
226
|
+
* the destination, and no directory is created.
|
|
191
227
|
*/
|
|
192
|
-
export function
|
|
193
|
-
const
|
|
194
|
-
if (!existsSync(dir))
|
|
195
|
-
mkdirSync(dir, { recursive: true });
|
|
228
|
+
export function ensureFileIgnored(path, options) {
|
|
229
|
+
const cwd = nearestExistingDir(path);
|
|
196
230
|
let topLevel;
|
|
197
231
|
try {
|
|
198
|
-
topLevel = git(
|
|
232
|
+
topLevel = git(cwd, ["rev-parse", "--show-toplevel"]);
|
|
199
233
|
}
|
|
200
234
|
catch {
|
|
201
235
|
return { status: "not-a-repo" };
|
|
202
236
|
}
|
|
203
237
|
if (!topLevel)
|
|
204
238
|
return { status: "not-a-repo" };
|
|
205
|
-
try {
|
|
206
|
-
execFileSync("git", ["check-ignore", "-q", "--", localStatePath], {
|
|
207
|
-
cwd: dir,
|
|
208
|
-
stdio: "ignore",
|
|
209
|
-
});
|
|
210
|
-
return { status: "already-ignored" };
|
|
211
|
-
}
|
|
212
|
-
catch {
|
|
213
|
-
// Exit 1 means "not ignored" — carry on and add coverage.
|
|
214
|
-
}
|
|
215
239
|
// git reports the toplevel with symlinks resolved (/private/var on macOS);
|
|
216
240
|
// the caller's path usually is not (/var). Compare like for like or the
|
|
217
241
|
// "relative" path escapes the repository entirely.
|
|
218
|
-
const
|
|
219
|
-
const rel = relative(topLevel, join(
|
|
220
|
-
|
|
221
|
-
|
|
242
|
+
const realPath = join(realpathSync(cwd), relative(cwd, path));
|
|
243
|
+
const rel = relative(topLevel, realPath).split(sep).join("/");
|
|
244
|
+
if (isGitTracked(cwd, realPath)) {
|
|
245
|
+
return { status: "failed", detail: `${rel} is tracked by git` };
|
|
246
|
+
}
|
|
247
|
+
if (isGitIgnored(cwd, realPath))
|
|
248
|
+
return { status: "already-ignored" };
|
|
222
249
|
const pattern = "/" + escapeGitignorePattern(rel);
|
|
250
|
+
const overridden = {
|
|
251
|
+
status: "failed",
|
|
252
|
+
detail: `${rel} is still not ignored: a .gitignore rule overrides the exclude entry "${pattern}"`,
|
|
253
|
+
};
|
|
223
254
|
try {
|
|
224
|
-
const excludePath = git(
|
|
255
|
+
const excludePath = git(cwd, ["rev-parse", "--path-format=absolute", "--git-path", "info/exclude"]);
|
|
225
256
|
if (!excludePath)
|
|
226
257
|
return { status: "failed", detail: "could not locate the git exclude file" };
|
|
227
258
|
mkdirSync(dirname(excludePath), { recursive: true });
|
|
228
259
|
const existing = existsSync(excludePath) ? readFileSync(excludePath, "utf-8") : "";
|
|
229
260
|
if (existing.split(/\r?\n/).some((line) => line.trim() === pattern)) {
|
|
230
|
-
return { status: "already-ignored" };
|
|
261
|
+
return isGitIgnored(cwd, realPath) ? { status: "already-ignored" } : overridden;
|
|
231
262
|
}
|
|
232
263
|
const prefix = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
233
264
|
writeFileSync(excludePath, existing +
|
|
234
265
|
prefix +
|
|
235
|
-
`\n# Added by '
|
|
236
|
-
`#
|
|
237
|
-
`#
|
|
266
|
+
`\n# Added by '${options.reason}' — ${basename(path)} is per-machine Primitive\n` +
|
|
267
|
+
`# state, never committed. Add the same pattern to a committed .gitignore to\n` +
|
|
268
|
+
`# make the coverage shared.\n` +
|
|
238
269
|
pattern +
|
|
239
270
|
"\n");
|
|
271
|
+
if (!isGitIgnored(cwd, realPath))
|
|
272
|
+
return overridden;
|
|
240
273
|
return { status: "excluded", excludePath, pattern };
|
|
241
274
|
}
|
|
242
275
|
catch (err) {
|
|
243
276
|
return { status: "failed", detail: err?.message || String(err) };
|
|
244
277
|
}
|
|
245
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* Makes sure `.primitive/local.json` is ignored before it is written.
|
|
281
|
+
*
|
|
282
|
+
* Templates scaffolded from now on carry the entry in their `.gitignore`, but
|
|
283
|
+
* projects created before this change do not — and `env use` writing an
|
|
284
|
+
* untracked-but-committable file would be exactly the "switching backends
|
|
285
|
+
* dirties the repo" problem this replaced. See {@link ensureFileIgnored}.
|
|
286
|
+
*/
|
|
287
|
+
export function ensureLocalStateIgnored(localStatePath) {
|
|
288
|
+
return ensureFileIgnored(localStatePath, { reason: "primitive env use" });
|
|
289
|
+
}
|
|
246
290
|
//# sourceMappingURL=local-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-state.js","sourceRoot":"","sources":["../../../src/lib/local-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE9D,OAAO,EACL,6BAA6B,EAC7B,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,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YACN,MAAM;YACN,iBAAiB,OAAO,CAAC,MAAM,OAAO,QAAQ,CAAC,IAAI,CAAC,6BAA6B;YACjF,+EAA+E;YAC/E,+BAA+B;YAC/B,OAAO;YACP,IAAI,CACP,CAAC;QACF,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC;YAAE,OAAO,UAAU,CAAC;QACpD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,CAAC;IACtD,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IACnE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,cAAsB;IAC5D,OAAO,iBAAiB,CAAC,cAAc,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAC5E,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* and pins, and, when it cannot take destructive actions, how to step up.
|
|
4
4
|
*/
|
|
5
5
|
/** The step-up hint for a login without `admin`. */
|
|
6
|
-
export declare const STEP_UP_HINT = "Deleting apps or databases, removing collaborators and changing user roles need a 15-minute step-up: primitive login --scope admin";
|
|
6
|
+
export declare const STEP_UP_HINT = "Deleting apps or databases, removing collaborators and changing user roles need a 15-minute step-up: primitive login --step-up --scope admin";
|
|
7
7
|
/**
|
|
8
8
|
* The lines to print after `Logged in as …` for an exchange's `scope` and
|
|
9
9
|
* `apps`. None when the exchange names no scope: an older server, whose login
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* and pins, and, when it cannot take destructive actions, how to step up.
|
|
4
4
|
*/
|
|
5
5
|
/** The step-up hint for a login without `admin`. */
|
|
6
|
-
export const STEP_UP_HINT = "Deleting apps or databases, removing collaborators and changing user roles need a 15-minute step-up: primitive login --scope admin";
|
|
6
|
+
export const STEP_UP_HINT = "Deleting apps or databases, removing collaborators and changing user roles need a 15-minute step-up: primitive login --step-up --scope admin";
|
|
7
7
|
/**
|
|
8
8
|
* The lines to print after `Logged in as …` for an exchange's `scope` and
|
|
9
9
|
* `apps`. None when the exchange names no scope: an older server, whose login
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-scope-lines.js","sourceRoot":"","sources":["../../../src/lib/login-scope-lines.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GACvB,
|
|
1
|
+
{"version":3,"file":"login-scope-lines.js","sourceRoot":"","sources":["../../../src/lib/login-scope-lines.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GACvB,8IAA8I,CAAC;AAEjJ;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,QAA+C;IAC7E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC;IACnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAClC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,CAAC,UAAU,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IACtG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -65,6 +65,13 @@ export interface ProjectConfig {
|
|
|
65
65
|
* PRIMITIVE_ENV is unset.
|
|
66
66
|
*/
|
|
67
67
|
defaultEnvironment?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Directories outside the config tree that server function code may import
|
|
70
|
+
* from, relative to the project root (#4502). Their files are bundled and
|
|
71
|
+
* typechecked at push and never stored with the function. `..` may climb as
|
|
72
|
+
* far as the git repository root around the project.
|
|
73
|
+
*/
|
|
74
|
+
functionSources?: string[];
|
|
68
75
|
/**
|
|
69
76
|
* Named environments keyed by short name (e.g. "dev", "prod", "staging").
|
|
70
77
|
*/
|
|
@@ -20,6 +20,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
|
20
20
|
import { dirname } from "path";
|
|
21
21
|
import { detectInstall, installCommand, upgradeCommand, PRIMITIVE_CLI_PACKAGE, } from "./package-manager.js";
|
|
22
22
|
import { findPrimitiveConfigPath, missingAppIdMessage, projectRootForConfigPath, PROJECT_CONFIG_DISPLAY_NAME, } from "./env-resolver-core.js";
|
|
23
|
+
import { FunctionSourcesShapeError, validateFunctionSourcesShape, } from "./function-source-roots.js";
|
|
23
24
|
import { normalizeIosAppId, validateIosAppId } from "./ios-app-id.js";
|
|
24
25
|
import { validateServerUrl } from "./server-url.js";
|
|
25
26
|
import { normalizeWebUrl, validateWebUrl } from "./web-url.js";
|
|
@@ -192,7 +193,27 @@ export function validateProjectConfig(raw, sourcePath) {
|
|
|
192
193
|
}
|
|
193
194
|
defaultEnvironment = obj.defaultEnvironment || undefined;
|
|
194
195
|
}
|
|
195
|
-
|
|
196
|
+
// Shape only; whether each directory exists and stays inside the
|
|
197
|
+
// repository is a fact about the disk, answered at push (#4502).
|
|
198
|
+
let functionSources;
|
|
199
|
+
if (obj.functionSources !== undefined) {
|
|
200
|
+
try {
|
|
201
|
+
functionSources = validateFunctionSourcesShape(obj.functionSources);
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
if (!(err instanceof FunctionSourcesShapeError))
|
|
205
|
+
throw err;
|
|
206
|
+
throw new ProjectConfigError(`${err.message} (in ${PROJECT_CONFIG_DISPLAY_NAME})`, sourcePath);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// The key is carried only when declared, so a file without it saves byte
|
|
210
|
+
// for byte as it loaded.
|
|
211
|
+
return {
|
|
212
|
+
version,
|
|
213
|
+
defaultEnvironment,
|
|
214
|
+
...(functionSources !== undefined ? { functionSources } : {}),
|
|
215
|
+
environments,
|
|
216
|
+
};
|
|
196
217
|
}
|
|
197
218
|
/**
|
|
198
219
|
* Loads and validates the project config from a specific file path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../../src/lib/project-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACxE,OAAO,EAAE,OAAO,EAAiB,MAAM,MAAM,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE/D;;;;GAIG;AACH,SAAS,iBAAiB;IACxB,OAAO,CACL,cAAc,CAAC,aAAa,EAAE,EAAE,qBAAqB,EAAE,QAAQ,CAAC;QAChE,cAAc,CAAC,qBAAqB,CAAC,CACtC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACxC;;;;;GAKG;AACH,OAAO,EACL,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,EACvB,2B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,IAAI,CAAC;IAC1D,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a failed `config push` tells the command that started it (#4491).
|
|
3
|
+
*
|
|
4
|
+
* `apps children create` runs the child's first push as a separate CLI
|
|
5
|
+
* invocation and sees only its exit code. When it names a file in
|
|
6
|
+
* `PRIMITIVE_PUSH_FAILURE_REPORT`, a push that fails writes there whether the
|
|
7
|
+
* failure was transient — every failed request got no answer or a 5xx, 429 or
|
|
8
|
+
* 408 — so the creator knows whether running the push again can help. Pushing
|
|
9
|
+
* again is safe: a push applies only what the server does not hold yet.
|
|
10
|
+
*
|
|
11
|
+
* A push that exits before it reaches the server, or fails in a way it does
|
|
12
|
+
* not classify, writes nothing; no report reads as not transient.
|
|
13
|
+
*/
|
|
14
|
+
/** The environment variable naming the file a failed push writes its report to. */
|
|
15
|
+
export declare const PUSH_FAILURE_REPORT_ENV = "PRIMITIVE_PUSH_FAILURE_REPORT";
|
|
16
|
+
/** A failed push's report. */
|
|
17
|
+
export interface PushFailureReport {
|
|
18
|
+
/** Whether every failure was transient, so the same push may succeed when run again. */
|
|
19
|
+
transient: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** The parts of a failed push that decide whether it was transient. */
|
|
22
|
+
export interface PushFailureCounts {
|
|
23
|
+
/** Changes that could not be applied, each with whether its failure was transient. */
|
|
24
|
+
applyFailures: ReadonlyArray<{
|
|
25
|
+
transient?: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
conflicts: number;
|
|
28
|
+
blockedDatabaseTypes: number;
|
|
29
|
+
/** Schema and operation gate failures, all kinds together. */
|
|
30
|
+
schemaErrors: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Whether a push that failed only on applies failed transiently: there was at
|
|
34
|
+
* least one failed apply, each was transient, and nothing else (a conflict, a
|
|
35
|
+
* blocked database type, a schema gate) failed beside them.
|
|
36
|
+
*/
|
|
37
|
+
export declare function pushFailureIsTransient(counts: PushFailureCounts): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Writes the report to the file `PRIMITIVE_PUSH_FAILURE_REPORT` names. Does
|
|
40
|
+
* nothing when it is unset, and never throws: the report must not mask the
|
|
41
|
+
* failure it describes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function writePushFailureReport(transient: boolean): void;
|
|
44
|
+
/** The report at `path`, or null when there is none or it cannot be read. */
|
|
45
|
+
export declare function readPushFailureReport(path: string): PushFailureReport | null;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a failed `config push` tells the command that started it (#4491).
|
|
3
|
+
*
|
|
4
|
+
* `apps children create` runs the child's first push as a separate CLI
|
|
5
|
+
* invocation and sees only its exit code. When it names a file in
|
|
6
|
+
* `PRIMITIVE_PUSH_FAILURE_REPORT`, a push that fails writes there whether the
|
|
7
|
+
* failure was transient — every failed request got no answer or a 5xx, 429 or
|
|
8
|
+
* 408 — so the creator knows whether running the push again can help. Pushing
|
|
9
|
+
* again is safe: a push applies only what the server does not hold yet.
|
|
10
|
+
*
|
|
11
|
+
* A push that exits before it reaches the server, or fails in a way it does
|
|
12
|
+
* not classify, writes nothing; no report reads as not transient.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
15
|
+
/** The environment variable naming the file a failed push writes its report to. */
|
|
16
|
+
export const PUSH_FAILURE_REPORT_ENV = "PRIMITIVE_PUSH_FAILURE_REPORT";
|
|
17
|
+
/**
|
|
18
|
+
* Whether a push that failed only on applies failed transiently: there was at
|
|
19
|
+
* least one failed apply, each was transient, and nothing else (a conflict, a
|
|
20
|
+
* blocked database type, a schema gate) failed beside them.
|
|
21
|
+
*/
|
|
22
|
+
export function pushFailureIsTransient(counts) {
|
|
23
|
+
return (counts.conflicts === 0 &&
|
|
24
|
+
counts.blockedDatabaseTypes === 0 &&
|
|
25
|
+
counts.schemaErrors === 0 &&
|
|
26
|
+
counts.applyFailures.length > 0 &&
|
|
27
|
+
counts.applyFailures.every((failure) => failure.transient === true));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Writes the report to the file `PRIMITIVE_PUSH_FAILURE_REPORT` names. Does
|
|
31
|
+
* nothing when it is unset, and never throws: the report must not mask the
|
|
32
|
+
* failure it describes.
|
|
33
|
+
*/
|
|
34
|
+
export function writePushFailureReport(transient) {
|
|
35
|
+
const path = process.env[PUSH_FAILURE_REPORT_ENV];
|
|
36
|
+
if (!path)
|
|
37
|
+
return;
|
|
38
|
+
try {
|
|
39
|
+
writeFileSync(path, JSON.stringify({ transient }));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// No report reads as not transient.
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/** The report at `path`, or null when there is none or it cannot be read. */
|
|
46
|
+
export function readPushFailureReport(path) {
|
|
47
|
+
if (!existsSync(path))
|
|
48
|
+
return null;
|
|
49
|
+
try {
|
|
50
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
51
|
+
return { transient: parsed?.transient === true };
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=push-failure-report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-failure-report.js","sourceRoot":"","sources":["../../../src/lib/push-failure-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAE7D,mFAAmF;AACnF,MAAM,CAAC,MAAM,uBAAuB,GAAG,+BAA+B,CAAC;AAkBvE;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAyB;IAC9D,OAAO,CACL,MAAM,CAAC,SAAS,KAAK,CAAC;QACtB,MAAM,CAAC,oBAAoB,KAAK,CAAC;QACjC,MAAM,CAAC,YAAY,KAAK,CAAC;QACzB,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;QAC/B,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CACpE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,SAAkB;IACvD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;IAClD,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,IAAI,CAAC;QACH,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,SAAS,EAA8B,CAAC,CAAC,CAAC;IACjF,CAAC;IAAC,MAAM,CAAC;QACP,oCAAoC;IACtC,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,IAAI,EAAE,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -6,15 +6,20 @@
|
|
|
6
6
|
* A large-document root export (format 2) cannot go anywhere: the platform no
|
|
7
7
|
* longer serves the format, so it is refused, naming the way across — its
|
|
8
8
|
* snapshot row chunks, loaded into a record-log document. A target root that
|
|
9
|
-
* is itself a large document is refused the same way
|
|
9
|
+
* is itself a large document is refused the same way, and so is one that is
|
|
10
|
+
* a record-log document (format 3, #4546): a Yjs state has nowhere to merge
|
|
11
|
+
* in a document made of rows. When the target user
|
|
10
12
|
* has no root yet, the app's `rootDocumentFormat` setting predicts the format
|
|
11
13
|
* the mint will produce; the root the mint actually returns is decided again
|
|
12
14
|
* against that prediction.
|
|
13
15
|
*
|
|
14
16
|
* Pure, so every branch is pinned without a server.
|
|
15
17
|
*/
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* A root document's storage format: 1 (legacy), 2 (large document, no longer
|
|
20
|
+
* served) or 3 (record-log document). Only a legacy root takes a merge.
|
|
21
|
+
*/
|
|
22
|
+
export type RootDocumentFormat = 1 | 2 | 3;
|
|
18
23
|
/** The facts a root import is decided from. */
|
|
19
24
|
export interface RootImportDecisionInput {
|
|
20
25
|
/** The format `metadata.json` records for the export. */
|
|
@@ -44,7 +49,7 @@ export type RootImportDecision = {
|
|
|
44
49
|
targetFormat: RootDocumentFormat;
|
|
45
50
|
reason: string;
|
|
46
51
|
};
|
|
47
|
-
/** Read a format off the wire: 2
|
|
52
|
+
/** Read a format off the wire: 2 or 3 as itself, anything else legacy. */
|
|
48
53
|
export declare function rootDocumentFormatOf(value: unknown): RootDocumentFormat;
|
|
49
54
|
/**
|
|
50
55
|
* Decide what a root export does in the target app.
|
|
@@ -6,19 +6,25 @@
|
|
|
6
6
|
* A large-document root export (format 2) cannot go anywhere: the platform no
|
|
7
7
|
* longer serves the format, so it is refused, naming the way across — its
|
|
8
8
|
* snapshot row chunks, loaded into a record-log document. A target root that
|
|
9
|
-
* is itself a large document is refused the same way
|
|
9
|
+
* is itself a large document is refused the same way, and so is one that is
|
|
10
|
+
* a record-log document (format 3, #4546): a Yjs state has nowhere to merge
|
|
11
|
+
* in a document made of rows. When the target user
|
|
10
12
|
* has no root yet, the app's `rootDocumentFormat` setting predicts the format
|
|
11
13
|
* the mint will produce; the root the mint actually returns is decided again
|
|
12
14
|
* against that prediction.
|
|
13
15
|
*
|
|
14
16
|
* Pure, so every branch is pinned without a server.
|
|
15
17
|
*/
|
|
16
|
-
/** Read a format off the wire: 2
|
|
18
|
+
/** Read a format off the wire: 2 or 3 as itself, anything else legacy. */
|
|
17
19
|
export function rootDocumentFormatOf(value) {
|
|
18
|
-
|
|
20
|
+
const format = Number(value);
|
|
21
|
+
return format === 2 || format === 3 ? format : 1;
|
|
19
22
|
}
|
|
20
23
|
/** Why a large document goes nowhere, and the way across for an export. */
|
|
21
24
|
const NO_LONGER_SERVED = "a large document (documentFormat 2), which the platform no longer serves";
|
|
25
|
+
/** Why a record-log root cannot take a legacy export (#4546). */
|
|
26
|
+
const RECORD_LOG_ROOT = "a record-log document (documentFormat 3), which a legacy root export " +
|
|
27
|
+
"cannot be merged into";
|
|
22
28
|
const MIGRATION = "Create a record-log document and run `primitive documents ingest " +
|
|
23
29
|
"<document-id> --input <export-dir>` to load its row chunks. Nothing was imported " +
|
|
24
30
|
"for it.";
|
|
@@ -55,6 +61,14 @@ export function decideRootImport(input) {
|
|
|
55
61
|
`${NO_LONGER_SERVED}. Nothing was imported for it.`,
|
|
56
62
|
};
|
|
57
63
|
}
|
|
64
|
+
if (target === 3) {
|
|
65
|
+
return {
|
|
66
|
+
outcome: "refuse",
|
|
67
|
+
targetFormat: target,
|
|
68
|
+
reason: `this app's rootDocumentFormat would mint ${whose} as ` +
|
|
69
|
+
`${RECORD_LOG_ROOT}. Nothing was imported for it.`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
58
72
|
return { outcome: "merge", targetFormat: target };
|
|
59
73
|
}
|
|
60
74
|
if (input.predictedFormat !== undefined &&
|
|
@@ -75,6 +89,13 @@ export function decideRootImport(input) {
|
|
|
75
89
|
reason: `${whose} is ${NO_LONGER_SERVED}. Nothing was imported for it.`,
|
|
76
90
|
};
|
|
77
91
|
}
|
|
92
|
+
if (input.existingRootFormat === 3) {
|
|
93
|
+
return {
|
|
94
|
+
outcome: "refuse",
|
|
95
|
+
targetFormat: 3,
|
|
96
|
+
reason: `${whose} is ${RECORD_LOG_ROOT}. Nothing was imported for it.`,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
78
99
|
if (!input.overwrite) {
|
|
79
100
|
return {
|
|
80
101
|
outcome: "skip",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-import-decision.js","sourceRoot":"","sources":["../../../src/lib/root-import-decision.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"root-import-decision.js","sourceRoot":"","sources":["../../../src/lib/root-import-decision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsCH,0EAA0E;AAC1E,MAAM,UAAU,oBAAoB,CAAC,KAAc;IACjD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED,2EAA2E;AAC3E,MAAM,gBAAgB,GACpB,0EAA0E,CAAC;AAC7E,iEAAiE;AACjE,MAAM,eAAe,GACnB,uEAAuE;IACvE,uBAAuB,CAAC;AAC1B,MAAM,SAAS,GACb,mEAAmE;IACnE,mFAAmF;IACnF,SAAS,CAAC;AAEZ;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAA8B;IAE9B,MAAM,KAAK,GACT,CAAC,KAAK,CAAC,KAAK;QACV,CAAC,CAAC,wBAAwB,KAAK,CAAC,KAAK,EAAE;QACvC,CAAC,CAAC,iCAAiC,CAAC;QACtC,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC/D,MAAM,MAAM,GACV,KAAK,CAAC,kBAAkB,IAAI,oBAAoB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAErE,IAAI,KAAK,CAAC,YAAY,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO;YACL,OAAO,EAAE,QAAQ;YACjB,YAAY,E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,KAAK,OAAO,eAAe,gCAAgC;SACvE,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QACrB,OAAO;YACL,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,CAAC;YACf,MAAM,EACJ,GAAG,KAAK,yDAAyD;gBACjE,iBAAiB;SACpB,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
* The scoped-login request `primitive login --scope …` and
|
|
3
3
|
* `primitive token --scope …` send to `GET /admin/api/oauth-cli` (#3889).
|
|
4
4
|
*
|
|
5
|
-
* One builder serves both commands, so they agree on every rule:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* One builder serves both commands, so they agree on every rule: `--step-up`
|
|
6
|
+
* asks for a step-up holding exactly `--scope` (#4564), and a list holding
|
|
7
|
+
* `admin` is one with or without the flag; a step-up names the current
|
|
8
|
+
* session as its parent and is pinned to the environment's app unless
|
|
9
|
+
* `--app` says otherwise (`--app none` asks for an unpinned one); a printed
|
|
10
|
+
* token carries its lifetime. `primitive auth sessions create` builds its CI-session request
|
|
10
11
|
* here too (#3890). Every mistake is a usage error before any browser opens.
|
|
11
12
|
*
|
|
12
13
|
* Pure: the flags, the environment's app id and the stored session's id are
|
|
@@ -39,6 +40,8 @@ export interface ScopeRequestInput {
|
|
|
39
40
|
app?: string;
|
|
40
41
|
/** `--ttl` (`token` and `sessions` only). */
|
|
41
42
|
ttl?: string;
|
|
43
|
+
/** `--step-up` (`login` and `token`): a step-up holding exactly `--scope`. */
|
|
44
|
+
stepUp?: boolean;
|
|
42
45
|
/** `--name` (`sessions` only). */
|
|
43
46
|
name?: string;
|
|
44
47
|
/** The environment's app, when the command runs in a project. */
|