arcadible 1.0.36 → 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +1 -1
  2. package/dist/action/build/tool.js +57 -8
  3. package/dist/action/function/logs.js +1 -1
  4. package/dist/action/login/flow.js +8 -1
  5. package/dist/action/pack/limits.js +28 -4
  6. package/dist/action/pack/tool.js +2 -1
  7. package/dist/action/secret/tool.js +3 -5
  8. package/dist/action/serve/tool.js +28 -21
  9. package/dist/action/value/tool.js +18 -12
  10. package/dist/action/wire/tool.js +1 -1
  11. package/dist/api.js +1 -1
  12. package/dist/arc.js +6 -2
  13. package/dist/cli/argv.js +3 -1
  14. package/dist/cli/command.js +12 -2
  15. package/dist/command/function/index.js +4 -5
  16. package/dist/command/function/logs.js +8 -1
  17. package/dist/command/function/pause.js +1 -1
  18. package/dist/command/function/resume.js +1 -1
  19. package/dist/command/function/run.js +1 -1
  20. package/dist/command/function/secret/index.js +1 -1
  21. package/dist/command/function/secret/remove.js +2 -2
  22. package/dist/command/function/secret/run.js +1 -1
  23. package/dist/command/function/secret/set.js +1 -1
  24. package/dist/command/{delete.js → game/delete.js} +14 -13
  25. package/dist/command/game/index.js +12 -0
  26. package/dist/command/login.js +1 -2
  27. package/dist/command/serve.js +9 -3
  28. package/dist/command/server/index.js +3 -4
  29. package/dist/command/server/key/create.js +1 -1
  30. package/dist/command/server/key/index.js +1 -1
  31. package/dist/command/server/key/revoke.js +1 -1
  32. package/dist/command/server/key/run.js +1 -1
  33. package/dist/command/unstable/index.js +23 -0
  34. package/dist/command/value/get.js +1 -1
  35. package/dist/command/value/index.js +6 -6
  36. package/dist/command/value/list.js +1 -1
  37. package/dist/command/value/remove.js +2 -2
  38. package/dist/command/value/set.js +1 -1
  39. package/dist/command/value/usage.js +5 -16
  40. package/dist/command/wire/index.js +4 -5
  41. package/dist/commands.js +3 -29
  42. package/dist/config/code.js +7 -3
  43. package/dist/config/limit.js +13 -0
  44. package/dist/phrase/deploy.js +1 -1
  45. package/dist/phrase/function.js +7 -7
  46. package/dist/phrase/game.js +1 -1
  47. package/dist/phrase/index.js +1 -0
  48. package/dist/phrase/pack.js +17 -0
  49. package/dist/phrase/serve.js +8 -3
  50. package/dist/phrase/server.js +5 -5
  51. package/dist/phrase/unstable.js +6 -0
  52. package/dist/phrase/value.js +30 -5
  53. package/dist/runner/bundle.js +13 -4
  54. package/dist/runner/entry.js +113 -17
  55. package/dist/runner/outbound.js +21 -5
  56. package/dist/schema/check/workflow.js +0 -21
  57. package/dist/schema/game.js +0 -32
  58. package/dist/schema/message.js +2 -3
  59. package/dist/schema/runner.js +8 -6
  60. package/dist/schema/workflow.js +6 -28
  61. package/dist/serve/page.js +1 -1
  62. package/dist/serve/remote.js +14 -6
  63. package/dist/serve/runner.js +89 -6
  64. package/dist/serve/server.js +8 -6
  65. package/dist/util/term.js +8 -0
  66. package/dist/util/zip.js +5 -0
  67. package/dist/wires/room.js +3 -3
  68. package/npm-shrinkwrap.json +33 -33
  69. package/package.json +1 -1
@@ -1,24 +1,25 @@
1
- // arc delete: deletes the project's game on Arcadible, for its owner. It
1
+ // arc unstable game delete: deletes the project's game on Arcadible, for its
2
+ // owner. It
2
3
  // can't be undone, so it asks first (src/cli/confirm.ts), naming the game.
3
4
  // The project's files are left as they are.
4
5
  // [import]
5
6
  import { resolve } from "node:path";
6
7
  // [import]
7
- import { ended } from "../account.js";
8
- import { defineCommand } from "../cli/command.js";
9
- import { askable, sure } from "../cli/confirm.js";
10
- import { headersOf } from "../action/game.js";
11
- import { confirmDeclined, gameDeleted, gameDeletedProject, gameDeleteQuestion, } from "../phrase/index.js";
12
- import { p, result } from "../util/log.js";
13
- import { CWD, JSON_OUTPUT, QUIET, YES } from "../cli/options.js";
14
- import { print } from "../util/output.js";
15
- import { SpinnerWheel } from "../util/spinner.js";
16
- import { deleteTool, named } from "../action/delete/tool.js";
17
- import { whoami } from "../action/whoami/tool.js";
8
+ import { ended } from "../../account.js";
9
+ import { defineCommand } from "../../cli/command.js";
10
+ import { askable, sure } from "../../cli/confirm.js";
11
+ import { headersOf } from "../../action/game.js";
12
+ import { confirmDeclined, gameDeleted, gameDeletedProject, gameDeleteQuestion, } from "../../phrase/index.js";
13
+ import { p, result } from "../../util/log.js";
14
+ import { CWD, JSON_OUTPUT, QUIET, YES } from "../../cli/options.js";
15
+ import { print } from "../../util/output.js";
16
+ import { SpinnerWheel } from "../../util/spinner.js";
17
+ import { deleteTool, named } from "../../action/delete/tool.js";
18
+ import { whoami } from "../../action/whoami/tool.js";
18
19
  // [declare]
19
20
  const COMMAND = "delete";
20
21
  // the command as it's typed, shown with `--yes` when there's no one to ask.
21
- const USAGE = "arc delete";
22
+ const USAGE = "arc unstable game delete";
22
23
  // [export]
23
24
  export default defineCommand({
24
25
  name: COMMAND,
@@ -0,0 +1,12 @@
1
+ // arc unstable game: the project's game on Arcadible, where a top-level
2
+ // command is the project's own life (`init` to `deploy`). Deleting it, for
3
+ // now. Under `arc unstable` until it's settled, then `arc game`.
4
+ // [import]
5
+ import { defineCommand } from "../../cli/command.js";
6
+ import del from "./delete.js";
7
+ // [export]
8
+ export default defineCommand({
9
+ commands: [del],
10
+ name: "game",
11
+ summary: "Delete the project's game on Arcadible",
12
+ });
@@ -39,10 +39,9 @@ function onLoginEnter(fn) {
39
39
  // after a blank line.
40
40
  function handler({ browser, qrcode: qr, shown, sw, }) {
41
41
  return {
42
- onLoginCreated({ code: dac, secret, url }) {
42
+ onLoginCreated({ code: dac, link, url }) {
43
43
  sw.stop(true);
44
44
  shown();
45
- const link = `${url}/${secret}`;
46
45
  p(loggingIn());
47
46
  qrcode.generate(link, { small: true }, (code) => {
48
47
  if (qr) {
@@ -11,6 +11,7 @@ import { CWD, QUIET } from "../cli/options.js";
11
11
  import { launched } from "../util/output.js";
12
12
  import { launch } from "../util/shell.js";
13
13
  import { SpinnerWheel } from "../util/spinner.js";
14
+ import { interrupted } from "../util/term.js";
14
15
  import { serveTool } from "../action/serve/tool.js";
15
16
  import { SERVE_URL } from "../config/url.js";
16
17
  // [declare]
@@ -61,7 +62,7 @@ function remoteWarnings({ quiet }) {
61
62
  return function (name, file, ex) {
62
63
  const message = ex
63
64
  ? phrase.remoteUnreachable(name)
64
- : file?.kept && phrase.remoteKept(name, file.fetchedAt);
65
+ : file?.kept && phrase.remoteKept(name, file.fetchedAt, file.refused);
65
66
  if (!message || quiet || warned.has(message)) {
66
67
  return;
67
68
  }
@@ -165,13 +166,18 @@ export default defineCommand({
165
166
  served.close();
166
167
  process.exit(0);
167
168
  };
168
- process.once("SIGINT", stop);
169
+ process.once("SIGINT", () => {
170
+ interrupted();
171
+ stop();
172
+ });
169
173
  process.once("SIGTERM", stop);
170
174
  if (!quiet) {
171
175
  const blocks = [
172
176
  [phrase.playLabel(), `${served.page}/`],
173
177
  [phrase.serveAlone(), served.game],
174
- ...(served.runner ? [[phrase.runnerLabel(), served.runner.url]] : []),
178
+ ...(served.runner
179
+ ? [[phrase.runnerLabel(), `${served.runner.url}/`]]
180
+ : []),
175
181
  // a game with a function or servers of its own can be played by
176
182
  // more than one player: a window each, named by its address
177
183
  ...(served.runner || served.forServer
@@ -1,6 +1,6 @@
1
- // arc server: a game's own server, the one its developer runs: the keys it
2
- // proves itself to Arcadible with (./key/index.ts). It's left out of
3
- // `arc --help` until keys ship, with the docs. Not `arc serve`, which runs
1
+ // arc unstable server: a game's own server, the one its developer runs: the
2
+ // keys it proves itself to Arcadible with (./key/index.ts). Under
3
+ // `arc unstable` until keys ship, with the docs. Not `arc serve`, which runs
4
4
  // the game on this machine: its help says so, since the two are a letter
5
5
  // apart.
6
6
  // [import]
@@ -11,7 +11,6 @@ import { serverNotServe } from "../../phrase/index.js";
11
11
  export default defineCommand({
12
12
  commands: [key],
13
13
  epilogue: serverNotServe(),
14
- hidden: true,
15
14
  name: "server",
16
15
  summary: "Make, list, and revoke your server's keys",
17
16
  });
@@ -30,7 +30,7 @@ export default defineCommand({
30
30
  if (!quiet) {
31
31
  pd(keyCreated(made));
32
32
  }
33
- }, "arc server key create", null, true);
33
+ }, "arc unstable server key create", null, true);
34
34
  },
35
35
  summary: "Make a key, and print it once",
36
36
  });
@@ -1,4 +1,4 @@
1
- // arc server key: a game's keys, which its own server proves itself with
1
+ // arc unstable server key: a game's keys, which its own server proves itself with
2
2
  // to Arcadible. `create` prints the new key alone on stdout, since it's
3
3
  // shown once and is what a script wants; everything else it says goes to
4
4
  // stderr.
@@ -17,7 +17,7 @@ export default defineCommand({
17
17
  p(keyRevoked(gone.id));
18
18
  }, null, () => ({
19
19
  question: keyRevokeQuestion(),
20
- usage: `arc server key revoke ${argv.id}`,
20
+ usage: `arc unstable server key revoke ${argv.id}`,
21
21
  }));
22
22
  },
23
23
  summary: "Revoke a key, by the id `list` shows",
@@ -1,4 +1,4 @@
1
- // what `arc server key`'s commands share: running one as the logged-in
1
+ // what `arc unstable server key`'s commands share: running one as the logged-in
2
2
  // account.
3
3
  // [import]
4
4
  import { resolve } from "node:path";
@@ -0,0 +1,23 @@
1
+ // arc unstable: the commands that aren't settled yet: the game on
2
+ // Arcadible, and what isn't released, a game's function, its server's
3
+ // keys, its values, and its wires. Each may change or go in any release,
4
+ // and is promoted out of it, to a name of its own, once it's settled or
5
+ // released. Its commands are outside the `--json` contract (OUTPUT.md,
6
+ // Unstable commands), and each reads its own section of `.arcrc`, as a
7
+ // top-level command does.
8
+ // [import]
9
+ import { defineCommand } from "../../cli/command.js";
10
+ import { unstableEpilogue } from "../../phrase/index.js";
11
+ import fn from "../function/index.js";
12
+ import game from "../game/index.js";
13
+ import server from "../server/index.js";
14
+ import value from "../value/index.js";
15
+ import wire from "../wire/index.js";
16
+ // [export]
17
+ export default defineCommand({
18
+ commands: [game, fn, server, value, wire],
19
+ epilogue: unstableEpilogue(),
20
+ name: "unstable",
21
+ namespace: true,
22
+ summary: "Use commands that aren't stable yet",
23
+ });
@@ -15,7 +15,7 @@ export default defineCommand({
15
15
  // the value alone, as JSON, so it pipes to a file as it was set
16
16
  (got) => {
17
17
  p(JSON.stringify(got.value, null, 2));
18
- }, `arc value get ${argv.key}`);
18
+ }, `arc unstable value get ${argv.key}`);
19
19
  },
20
20
  summary: "Show a value",
21
21
  });
@@ -1,8 +1,9 @@
1
- // arc value: a game's developer's values (plan/VALUES.md), the JSON a game's
2
- // owner publishes on a channel for the game and its server to read: a daily
3
- // puzzle, an event's switch, a table of levels. Set, read, listed, and
4
- // removed, a channel named each time, since nothing is copied between them.
5
- // Left out of `arc --help` until values ship, with the docs.
1
+ // arc unstable value: a game's developer's values (plan/VALUES.md), the JSON
2
+ // a game's owner publishes on a channel for the game and its server to read:
3
+ // a daily puzzle, an event's switch, a table of levels. Set, read, listed,
4
+ // and removed, a channel named each time, since nothing is copied between
5
+ // them.
6
+ // Under `arc unstable` until values ship, with the docs.
6
7
  // [import]
7
8
  import { defineCommand } from "../../cli/command.js";
8
9
  import get from "./get.js";
@@ -13,7 +14,6 @@ import usage from "./usage.js";
13
14
  // [export]
14
15
  export default defineCommand({
15
16
  commands: [set, get, list, remove, usage],
16
- hidden: true,
17
17
  name: "value",
18
18
  summary: "Set, get, list, and remove the values you publish for the game",
19
19
  });
@@ -35,7 +35,7 @@ export default defineCommand({
35
35
  run(argv, aborting) {
36
36
  return run(argv, aborting, (current, conf) => list(current, { ...conf, prefix: argv.prefix }), (entries) => {
37
37
  p(entries.length ? rows(entries) : valueNone());
38
- }, "arc value list");
38
+ }, "arc unstable value list");
39
39
  },
40
40
  summary: "List the values' keys, with their sizes",
41
41
  });
@@ -14,12 +14,12 @@ export default defineCommand({
14
14
  run(argv, aborting) {
15
15
  return run(argv, aborting, (current, conf) => remove(current, { ...conf, key: argv.key }), (gone) => {
16
16
  p(valueRemoved({ channel: gone.channel, key: argv.key }));
17
- }, `arc value remove ${argv.key}`, (where) => ({
17
+ }, `arc unstable value remove ${argv.key}`, (where) => ({
18
18
  question: valueRemoveQuestion({
19
19
  channel: String(where),
20
20
  key: argv.key,
21
21
  }),
22
- usage: `arc value remove ${argv.key} --${where}`,
22
+ usage: `arc unstable value remove ${argv.key} --${where}`,
23
23
  }));
24
24
  },
25
25
  summary: "Remove a value",
@@ -56,7 +56,7 @@ export default defineCommand({
56
56
  key: argv.key,
57
57
  }), (done) => {
58
58
  p(valueSet(done));
59
- }, `arc value set ${what}`);
59
+ }, `arc unstable value set ${what}`);
60
60
  },
61
61
  summary: "Set a value, its JSON from a file or standard input",
62
62
  });
@@ -4,6 +4,7 @@ import { p } from "../../util/log.js";
4
4
  import { CHANNEL, CWD, JSON_OUTPUT, QUIET } from "../../cli/options.js";
5
5
  import { run } from "../function/secret/run.js";
6
6
  import { table } from "../../util/table.js";
7
+ import { valueHolds, valueSize } from "../../phrase/index.js";
7
8
  import { usage } from "../../action/value/tool.js";
8
9
  // [declare]
9
10
  // each scope as it's said: a player's limits are each player's own.
@@ -14,16 +15,6 @@ const NAMES = {
14
15
  server: "server",
15
16
  };
16
17
  // [function]
17
- // a size in the unit that reads best: "0", "812 B", "14 KB", "2.4 MB".
18
- function size(bytes) {
19
- if (bytes < 1024) {
20
- return bytes === 0 ? "0" : `${bytes} B`;
21
- }
22
- if (bytes < 1024 * 1024) {
23
- return `${Math.round(bytes / 1024)} KB`;
24
- }
25
- return `${(bytes / (1024 * 1024)).toFixed(1).replace(/\.0$/u, "")} MB`;
26
- }
27
18
  // [function]
28
19
  // the scopes as a table. A player's row counts every player's together, and
29
20
  // its limit is what each may hold, so the most any one holds is beside it.
@@ -32,17 +23,15 @@ function rows(scopes) {
32
23
  ["SCOPE", "KEYS", "SIZE", "MAY HOLD"],
33
24
  ...scopes.map((each) => {
34
25
  const players = each.scope === "player";
35
- const limit = each.keys_limit === null && each.bytes_limit === null
36
- ? "no limit"
37
- : `${each.keys_limit === null ? "any number of" : each.keys_limit.toLocaleString("en-US")} keys, ${each.bytes_limit === null ? "any size" : size(each.bytes_limit)}`;
26
+ const limit = valueHolds(each);
38
27
  return [
39
28
  NAMES[each.scope] ?? each.scope,
40
29
  players
41
30
  ? `${each.keys} (${each.owners} ${each.owners === 1 ? "player" : "players"}, ${each.keys_most} at most)`
42
31
  : String(each.keys),
43
32
  players
44
- ? `${size(each.bytes)} (${size(each.bytes_most)} at most)`
45
- : size(each.bytes),
33
+ ? `${valueSize(each.bytes)} (${valueSize(each.bytes_most)} at most)`
34
+ : valueSize(each.bytes),
46
35
  players && limit !== "no limit" ? `${limit} each` : limit,
47
36
  ];
48
37
  }),
@@ -73,7 +62,7 @@ export default defineCommand({
73
62
  if (calls) {
74
63
  p(`\n${called(calls)}`);
75
64
  }
76
- }, "arc value usage");
65
+ }, "arc unstable value usage");
77
66
  },
78
67
  summary: "Show how much the game's values hold, by scope",
79
68
  });
@@ -1,14 +1,13 @@
1
- // arc wire: a game's wires (plan/SDKWIRES.md), live messages between its
2
- // players, relayed and never kept. A game makes and joins them itself, so
3
- // what's here is what they came to: their usage, by channel. Left out of
4
- // `arc --help` until wires ship, with the docs.
1
+ // arc unstable wire: a game's wires (plan/SDKWIRES.md), live messages
2
+ // between its players, relayed and never kept. A game makes and joins them
3
+ // itself, so what's here is what they came to: their usage, by channel.
4
+ // Under `arc unstable` until wires ship, with the docs.
5
5
  // [import]
6
6
  import { defineCommand } from "../../cli/command.js";
7
7
  import usage from "./usage.js";
8
8
  // [export]
9
9
  export default defineCommand({
10
10
  commands: [usage],
11
- hidden: true,
12
11
  name: "wire",
13
12
  summary: "Show what the game's wires carried",
14
13
  });
package/dist/commands.js CHANGED
@@ -57,11 +57,6 @@ export const COMMANDS = [
57
57
  name: "play",
58
58
  summary: "Play a game",
59
59
  },
60
- {
61
- load: () => import("./command/delete.js"),
62
- name: "delete",
63
- summary: "Delete the game",
64
- },
65
60
  {
66
61
  load: () => import("./command/login.js"),
67
62
  name: "login",
@@ -77,30 +72,9 @@ export const COMMANDS = [
77
72
  name: "logout",
78
73
  summary: `Log out of ${title}`,
79
74
  },
80
- // left out of `arc --help` until functions, keys, values, and wires ship, with the
81
- // docs.
82
- {
83
- hidden: true,
84
- load: () => import("./command/function/index.js"),
85
- name: "function",
86
- summary: "Pause, resume, and show the game's function, its logs, and its secrets",
87
- },
88
- {
89
- hidden: true,
90
- load: () => import("./command/server/index.js"),
91
- name: "server",
92
- summary: "Make, list, and revoke your server's keys",
93
- },
94
- {
95
- hidden: true,
96
- load: () => import("./command/value/index.js"),
97
- name: "value",
98
- summary: "Set, get, list, and remove the values you publish for the game",
99
- },
100
75
  {
101
- hidden: true,
102
- load: () => import("./command/wire/index.js"),
103
- name: "wire",
104
- summary: "Show what the game's wires carried",
76
+ load: () => import("./command/unstable/index.js"),
77
+ name: "unstable",
78
+ summary: "Use commands that aren't stable yet",
105
79
  },
106
80
  ];
@@ -56,8 +56,8 @@ const CLI = {
56
56
  // a release's reasons, from the pipeline (the API's
57
57
  // db/type/release_reason.sql). The CLI shares them, so a name means the same
58
58
  // thing wherever it appears: FUNCTION_TOO_LARGE, GAME_HANDLE_CHANGED,
59
- // GAME_UNAVAILABLE, INTERNAL, as well as REPO_NOT_CONNECTED and
60
- // VERSION_EXISTS, are the CLI's too.
59
+ // GAME_UNAVAILABLE, INTERNAL, PACKAGE_PATH_INVALID, as well as
60
+ // REPO_NOT_CONNECTED and VERSION_EXISTS, are the CLI's too.
61
61
  export const RELEASE = {
62
62
  BUILD_RATE_LIMITED: "build_rate_limited",
63
63
  FUNCTION_INVALID: "function_invalid",
@@ -69,6 +69,7 @@ export const RELEASE = {
69
69
  GITHUB_APP_NOT_INSTALLED: "github_app_not_installed",
70
70
  INTERNAL: "internal",
71
71
  MANIFEST_INVALID: "manifest_invalid",
72
+ PACKAGE_PATH_INVALID: "package_path_invalid",
72
73
  RELEASE_EXPIRED: "release_expired",
73
74
  REPO_NOT_CONNECTED: "repo_not_connected",
74
75
  VERSION_EXISTS: "version_exists",
@@ -92,6 +93,9 @@ export const ISSUE = {
92
93
  DESCRIPTION_RULES_MISSING: "description_rules_missing",
93
94
  DUPLICATE: "duplicate",
94
95
  EMPTY: "empty",
96
+ // no longer used: arc validate checked deploy_dir for an index.html before
97
+ // 1.0.37, which packing checks now (package_index_missing). Kept, as
98
+ // every code is.
95
99
  INDEX_MISSING: "index_missing",
96
100
  INVALID: "invalid",
97
101
  MARKDOWN_INVALID: "markdown_invalid",
@@ -137,5 +141,5 @@ export const WARNINGS = new Set(Object.values(WARNING));
137
141
  // [declare]
138
142
  // each error code by its own name too: `cfgcode.NOT_LOGGED_IN`.
139
143
  export const { API_REFUSED, API_UNREACHABLE, ARGUMENT_INVALID, BUILD_FAILED, DEPLOY_DIR_MISSING, DEPLOY_RATE_LIMITED, FUNCTION_PAUSE_RESERVED, GAME_HANDLE_TAKEN, GAME_ID_MISSING, GAME_NOT_DEPLOYED, GAME_NOT_FOUND, GIT_REMOTE_MISSING, GIT_REMOTE_UNREACHABLE, GIT_REPO_MISSING, GIT_TAG_CREATE_FAILED, GIT_TAG_EXISTS, GIT_TAG_PUSH_FAILED, GIT_UNCOMMITTED, KEY_LIMIT_REACHED, KEY_NOT_FOUND, LOCKFILE_MISSING, LOGIN_CODE_EXPIRED, LOGIN_FAILED, MANIFEST_MISSING, NOT_LOGGED_IN, PACKAGE_FILE_TOO_LARGE, PACKAGE_INDEX_MISSING, PACKAGE_PATH_RESERVED, PACKAGE_TOO_LARGE, PACKAGE_TOO_MANY_FILES, PACKAGE_UNCOMPRESSED_TOO_LARGE, PARSE_FAILED, PATH_NOT_FOUND, PORT_IN_USE, PROJECT_NOT_REPO_ROOT, SECRET_LIMIT_REACHED, SECRET_NOT_FOUND, SESSION_EXPIRED, TEMPLATE_MISSING, TEMPLATE_UNAVAILABLE, UNEXPECTED, UPLOAD_FAILED, VALIDATION_FAILED, VALUE_NOT_FOUND, VALUE_STORAGE_FULL, VALUE_TOO_LARGE, WAIT_TIMED_OUT, } = CLI;
140
- export const { BUILD_RATE_LIMITED, FUNCTION_INVALID, FUNCTION_TOO_LARGE, GAME_HANDLE_CHANGED, GAME_LIMIT_REACHED, GAME_MISMATCH, GAME_UNAVAILABLE, GITHUB_APP_NOT_INSTALLED, INTERNAL, MANIFEST_INVALID, RELEASE_EXPIRED, REPO_NOT_CONNECTED, VERSION_EXISTS, VERSION_MISMATCH, ZIP_INVALID, ZIP_MISSING, ZIP_TOO_LARGE, } = RELEASE;
144
+ export const { BUILD_RATE_LIMITED, FUNCTION_INVALID, FUNCTION_TOO_LARGE, GAME_HANDLE_CHANGED, GAME_LIMIT_REACHED, GAME_MISMATCH, GAME_UNAVAILABLE, GITHUB_APP_NOT_INSTALLED, INTERNAL, MANIFEST_INVALID, PACKAGE_PATH_INVALID, RELEASE_EXPIRED, REPO_NOT_CONNECTED, VERSION_EXISTS, VERSION_MISMATCH, ZIP_INVALID, ZIP_MISSING, ZIP_TOO_LARGE, } = RELEASE;
141
145
  export const { GIT_TAG_INVALID, WORKFLOW_MISSING } = GITHUB;
@@ -6,6 +6,10 @@ const MB = 1024 * 1024;
6
6
  // [declare]
7
7
  // the most files in the zip.
8
8
  export const FILES = 10000;
9
+ // the most entries in the zip, files and folders together (the subscriber's
10
+ // MAX_ENTRY_COUNT), so a deep tree of folders can't pass the files' limit
11
+ // and fail there.
12
+ export const ENTRIES = 20000;
9
13
  // the largest file, uncompressed.
10
14
  export const FILE_SIZE = 64 * MB;
11
15
  // everything packed, uncompressed.
@@ -14,3 +18,12 @@ export const TOTAL_SIZE = 256 * MB;
14
18
  export const ZIP_SIZE = 64 * MB;
15
19
  // a function's bundle, as Arcadible runs it (the subscriber's RUNNER_MAX).
16
20
  export const FUNCTION_SIZE = 1 * MB;
21
+ // a secret's name, as the API, the database (chk_runner_secret_name_is_valid),
22
+ // and the subscriber hold it: capitals, digits, and underscores, starting
23
+ // with a letter, 64 at most; ARCADIBLE_ is kept for Arcadible's own. The
24
+ // manifest's [function] secrets and `arc unstable function secret` both take
25
+ // this one.
26
+ export const SECRET_NAME = /^(?!ARCADIBLE_)[A-Z][A-Z0-9_]{0,63}$/u;
27
+ // the most secrets a game's channel holds (api_put_game_function_secret), so
28
+ // the most a function may declare.
29
+ export const SECRETS = 16;
@@ -158,7 +158,7 @@ export function uploadFailed(status) {
158
158
  }
159
159
  // [function]
160
160
  export function deployRateLimited(version) {
161
- return blocks(`v${version} was deployed in the last 5 minutes.`, "Wait, then deploy again.");
161
+ return blocks(`v${version} was deployed in the last 5 minutes, or this account deployed 30 times in the last hour.`, "Wait, then deploy again.");
162
162
  }
163
163
  // [function]
164
164
  export function waitTimedOut() {
@@ -1,4 +1,4 @@
1
- // a game's function: `arc function`, its secrets, and the function as arc
1
+ // a game's function: `arc unstable function`, its secrets, and the function as arc
2
2
  // build and arc serve run it.
3
3
  // [import]
4
4
  import { blocks } from "./internal.js";
@@ -17,7 +17,7 @@ export function secretRemoveQuestion({ channel, name, }) {
17
17
  // a paused function, or a pause on a channel with no function to stop.
18
18
  export function functionPaused({ channel, function: has, }) {
19
19
  if (has === false) {
20
- return blocks(`Paused ${channel}, which has no function yet.`, `A release with one stays stopped until \`arc function resume --${channel}\`.`);
20
+ return blocks(`Paused ${channel}, which has no function yet.`, `A release with one stays stopped until \`arc unstable function resume --${channel}\`.`);
21
21
  }
22
22
  return `Paused the game's function on ${channel}. It stops answering within a minute.`;
23
23
  }
@@ -99,7 +99,7 @@ export function functionPauseReserved({ channel, paused, }) {
99
99
  return blocks(`The game's function is paused by Arcadible on ${channel}.`, "Only Arcadible can resume it.");
100
100
  }
101
101
  if (paused === "limit") {
102
- return blocks(`The game's function is at a limit on ${channel}.`, "It resumes by itself as the day or the month turns (UTC): `arc function status` says when.");
102
+ return blocks(`The game's function is at a limit on ${channel}.`, "It resumes by itself as the day or the month turns (UTC): `arc unstable function status` says when.");
103
103
  }
104
104
  return `The game's function is paused on ${channel}, and not by you.`;
105
105
  }
@@ -111,7 +111,7 @@ export function secretSet({ channel, name, }) {
111
111
  // a secret a build declares that has no value on the channel it goes to,
112
112
  // which `arc deploy` warns of (not yet: action/predeploy/secrets.ts).
113
113
  export function secretUnset({ channel, name, }) {
114
- return `Secret ${name} has no value on ${channel}.\nSet it with \`arc function secret set ${name} --${channel}\`.`;
114
+ return `Secret ${name} has no value on ${channel}.\nSet it with \`arc unstable function secret set ${name} --${channel}\`.`;
115
115
  }
116
116
  // [function]
117
117
  export function secretRemoved({ channel, name, }) {
@@ -124,11 +124,11 @@ export function secretNone() {
124
124
  // [function]
125
125
  // the most secrets a game has for a channel, when one more is asked for.
126
126
  export function secretLimitReached(channel) {
127
- return blocks(`Sixteen secrets already for ${channel}.`, "Remove one with `arc function secret remove <name>`, then try again.");
127
+ return blocks(`Sixteen secrets already for ${channel}.`, "Remove one with `arc unstable function secret remove <name>`, then try again.");
128
128
  }
129
129
  // [function]
130
130
  export function secretNotFound({ channel, name, }) {
131
- return blocks(`Secret not found: ${name}`, `It isn't set for ${channel}.\n\`arc function secret list\` shows the game's secrets.`);
131
+ return blocks(`Secret not found: ${name}`, `It isn't set for ${channel}.\n\`arc unstable function secret list\` shows the game's secrets.`);
132
132
  }
133
133
  // [function]
134
134
  export function secretNameInvalid() {
@@ -140,7 +140,7 @@ export function secretNameInvalid() {
140
140
  }
141
141
  // [function]
142
142
  export function secretValueInvalid() {
143
- return blocks("A secret's value is 1 to 4096 bytes, on standard input.", 'Such as: printf %s "$EXAMPLE_KEY" | arc function secret set EXAMPLE_KEY');
143
+ return blocks("A secret's value is 1 to 4096 bytes, on standard input.", 'Such as: printf %s "$EXAMPLE_KEY" | arc unstable function secret set EXAMPLE_KEY');
144
144
  }
145
145
  // [function]
146
146
  // what's asked when a secret's value is typed.
@@ -1,4 +1,4 @@
1
- // a game on Arcadible: arc delete.
1
+ // a game on Arcadible: arc unstable game delete.
2
2
  // [import]
3
3
  import { cmdInit } from "./common.js";
4
4
  import { blocks, cmdWhoami } from "./internal.js";
@@ -14,3 +14,4 @@ export * from "./pack.js";
14
14
  export * from "./serve.js";
15
15
  export * from "./server.js";
16
16
  export * from "./value.js";
17
+ export * from "./unstable.js";
@@ -24,6 +24,14 @@ export function buildFailed({ code, signal, stderr, stdout, }) {
24
24
  : `Build failed with exit code ${code}.`, ...(output ? [output] : []));
25
25
  }
26
26
  // [function]
27
+ // a failed build's `message` (its reason, then what it printed), told first
28
+ // that the project's packages aren't installed, and to install them with
29
+ // `manager`, the one its lockfile names.
30
+ export function packagesUninstalled(message, manager) {
31
+ const [reason = "", ...rest] = message.split("\n\n");
32
+ return blocks(reason, `The project's packages aren't installed. Run \`${manager} install\` first.`, ...rest);
33
+ }
34
+ // [function]
27
35
  export function buildOutputMissing(dir) {
28
36
  return `Build didn't create deploy_dir (${dir}).`;
29
37
  }
@@ -64,6 +72,15 @@ export function packageTooManyFiles(count) {
64
72
  return `Package has more than ${count.toLocaleString("en-US")} files.`;
65
73
  }
66
74
  // [function]
75
+ export function packageTooManyEntries(count) {
76
+ return blocks(`Package has more than ${count.toLocaleString("en-US")} files and folders together.`, "Put the files in fewer folders.");
77
+ }
78
+ // [function]
79
+ // a file whose name a URL reads as another path, which no address reaches.
80
+ export function packagePathInvalid(name) {
81
+ return blocks(`'${name}' isn't a name a browser can ask for: it has a '.' or '..' folder, a backslash, or %2e, %2f, or %5c.`, "Rename it, and the paths that load it.");
82
+ }
83
+ // [function]
67
84
  export function packageUncompressedTooLarge(size) {
68
85
  return `Package is larger than ${size} MB uncompressed.`;
69
86
  }
@@ -20,9 +20,14 @@ function remoteName(name) {
20
20
  return name === "host" ? "the play page's host" : `/${HANDLE}/${name}`;
21
21
  }
22
22
  // [function]
23
- // arc serve's copy of one of Arcadible's files, kept from `fetchedAt`.
24
- export function remoteKept(name, fetchedAt) {
25
- return `Unable to reach ${TITLE}.\nServing ${remoteName(name)} saved on ${fetchedAt.slice(0, 10)}.`;
23
+ // arc serve's copy of one of Arcadible's files, kept from `fetchedAt`: served
24
+ // because Arcadible couldn't be reached, or with `refused`, because it
25
+ // answered that status for a file that's always there.
26
+ export function remoteKept(name, fetchedAt, refused) {
27
+ const why = refused
28
+ ? `${TITLE} answered ${refused} for ${remoteName(name)}.`
29
+ : `Unable to reach ${TITLE}.`;
30
+ return `${why}\nServing ${remoteName(name)} saved on ${fetchedAt.slice(0, 10)}.`;
26
31
  }
27
32
  // [function]
28
33
  export function remoteUnreachable(name) {
@@ -1,4 +1,4 @@
1
- // `arc server`: a game's own servers, and their keys.
1
+ // `arc unstable server`: a game's own servers, and their keys.
2
2
  // [import]
3
3
  import { blocks } from "./internal.js";
4
4
  // [function]
@@ -8,7 +8,7 @@ export function keyCreated({ channel, id, name, }) {
8
8
  }
9
9
  // [function]
10
10
  export function keyRevoked(id) {
11
- return `Revoked ${id}. Servers using it stop working at once.`;
11
+ return blocks(`Revoked ${id}.`, "Servers using it stop working at once.");
12
12
  }
13
13
  // [function]
14
14
  export function keyNone() {
@@ -17,11 +17,11 @@ export function keyNone() {
17
17
  // [function]
18
18
  // the most keys a game has for a channel, when one more is asked for.
19
19
  export function keyLimitReached(channel) {
20
- return blocks(`Five keys already for ${channel}.`, "Revoke one with `arc server key revoke <id>`, then try again.");
20
+ return blocks(`Five keys already for ${channel}.`, "Revoke one with `arc unstable server key revoke <id>`, then try again.");
21
21
  }
22
22
  // [function]
23
23
  export function keyNotFound(id) {
24
- return blocks(`Key not found: ${id}`, "It was revoked already, or isn't this game's.\n`arc server key list` shows the game's keys.");
24
+ return blocks(`Key not found: ${id}`, "It was revoked already, or isn't this game's.\n`arc unstable server key list` shows the game's keys.");
25
25
  }
26
26
  // [function]
27
27
  export function keyNameInvalid() {
@@ -32,7 +32,7 @@ export function keyRevokeQuestion() {
32
32
  return "Revoke this key? Servers using it stop working at once, and it can't be undone.";
33
33
  }
34
34
  // [function]
35
- // under `arc server`'s help: what it isn't, a letter away.
35
+ // under `arc unstable server`'s help: what it isn't, a letter away.
36
36
  export function serverNotServe() {
37
37
  return "To run your game on this machine, use `arc serve`.";
38
38
  }
@@ -0,0 +1,6 @@
1
+ // `arc unstable`: the commands for what isn't released yet.
2
+ // [function]
3
+ // the end of `arc unstable --help`.
4
+ export function unstableEpilogue() {
5
+ return "These commands may change or go away in any release.";
6
+ }