@skillcdn/console 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +1 -0
  2. package/dist/api.d.ts +1 -1
  3. package/dist/api.d.ts.map +1 -1
  4. package/dist/api.js +1 -1
  5. package/dist/api.js.map +1 -1
  6. package/dist/cli/cli.d.ts.map +1 -1
  7. package/dist/cli/cli.js +36 -11
  8. package/dist/cli/cli.js.map +1 -1
  9. package/dist/cli/help.d.ts.map +1 -1
  10. package/dist/cli/help.js +25 -5
  11. package/dist/cli/help.js.map +1 -1
  12. package/dist/client.d.ts +12 -1
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +4 -0
  15. package/dist/client.js.map +1 -1
  16. package/dist/compat.d.ts +1 -1
  17. package/dist/compat.js +2 -2
  18. package/dist/components/markdown.d.ts.map +1 -1
  19. package/dist/components/markdown.js +6 -3
  20. package/dist/components/markdown.js.map +1 -1
  21. package/dist/components/pack-connect.d.ts +3 -1
  22. package/dist/components/pack-connect.d.ts.map +1 -1
  23. package/dist/components/pack-connect.js +4 -4
  24. package/dist/components/pack-connect.js.map +1 -1
  25. package/dist/components/pack-token.d.ts +3 -1
  26. package/dist/components/pack-token.d.ts.map +1 -1
  27. package/dist/components/pack-token.js +1 -1
  28. package/dist/components/pack-token.js.map +1 -1
  29. package/dist/components/people.d.ts.map +1 -1
  30. package/dist/components/people.js +14 -3
  31. package/dist/components/people.js.map +1 -1
  32. package/dist/components/remote-pictures.d.ts +6 -0
  33. package/dist/components/remote-pictures.d.ts.map +1 -0
  34. package/dist/components/remote-pictures.js +8 -0
  35. package/dist/components/remote-pictures.js.map +1 -0
  36. package/dist/components/sign-in.d.ts.map +1 -1
  37. package/dist/components/sign-in.js +49 -2
  38. package/dist/components/sign-in.js.map +1 -1
  39. package/dist/components/ui.d.ts +3 -2
  40. package/dist/components/ui.d.ts.map +1 -1
  41. package/dist/components/ui.js +6 -3
  42. package/dist/components/ui.js.map +1 -1
  43. package/dist/console.css +57 -5
  44. package/dist/console.d.ts.map +1 -1
  45. package/dist/console.js +13 -6
  46. package/dist/console.js.map +1 -1
  47. package/dist/data.d.ts +4 -1
  48. package/dist/data.d.ts.map +1 -1
  49. package/dist/data.js +16 -19
  50. package/dist/data.js.map +1 -1
  51. package/dist/i18n/en.d.ts +14 -1
  52. package/dist/i18n/en.d.ts.map +1 -1
  53. package/dist/i18n/en.js +14 -1
  54. package/dist/i18n/en.js.map +1 -1
  55. package/dist/i18n/ko.d.ts.map +1 -1
  56. package/dist/i18n/ko.js +10 -1
  57. package/dist/i18n/ko.js.map +1 -1
  58. package/dist/limits.d.ts +14 -0
  59. package/dist/limits.d.ts.map +1 -1
  60. package/dist/limits.js +14 -0
  61. package/dist/limits.js.map +1 -1
  62. package/dist/routes.d.ts +2 -0
  63. package/dist/routes.d.ts.map +1 -1
  64. package/dist/routes.js +2 -0
  65. package/dist/routes.js.map +1 -1
  66. package/dist/schemas.d.ts +30 -1
  67. package/dist/schemas.d.ts.map +1 -1
  68. package/dist/schemas.js +15 -4
  69. package/dist/schemas.js.map +1 -1
  70. package/dist/web.d.ts.map +1 -1
  71. package/dist/web.js +3 -2
  72. package/dist/web.js.map +1 -1
  73. package/docs/specs/cli.md +5 -5
  74. package/docs/specs/rest.md +22 -11
  75. package/package.json +2 -2
  76. package/skills/building-a-console/SKILL.md +2 -2
  77. package/skills/working-the-board/references/setting-up.md +1 -1
  78. package/src/api.ts +8 -0
  79. package/src/cli/cli.ts +39 -12
  80. package/src/cli/help.ts +30 -4
  81. package/src/client.ts +30 -1
  82. package/src/compat.ts +2 -2
  83. package/src/components/markdown.tsx +6 -3
  84. package/src/components/pack-connect.tsx +10 -7
  85. package/src/components/pack-token.tsx +4 -1
  86. package/src/components/people.tsx +17 -7
  87. package/src/components/remote-pictures.ts +19 -0
  88. package/src/components/sign-in.tsx +114 -13
  89. package/src/components/ui.tsx +6 -3
  90. package/src/console.tsx +24 -5
  91. package/src/data.ts +20 -20
  92. package/src/i18n/en.ts +15 -1
  93. package/src/i18n/ko.ts +11 -1
  94. package/src/limits.ts +14 -0
  95. package/src/routes.ts +2 -0
  96. package/src/schemas.ts +17 -4
  97. package/src/styles/console.css +57 -5
  98. package/src/web.ts +3 -2
package/src/schemas.ts CHANGED
@@ -167,6 +167,18 @@ export const restProviderSchema = z.object({
167
167
  key: z.enum(PROVIDER_KEYS),
168
168
  /** What people read on the button. */
169
169
  label: z.string(),
170
+ /**
171
+ * Who this way in lets in, for the line under the button: the organization at the git host
172
+ * whose members are in, the Workspace domains whose accounts are, or neither, where only the
173
+ * logins an administrator listed get in. Answered from 0.4.1; read as optional, so that a
174
+ * console built on this package reads an older console's answer.
175
+ */
176
+ admits: z.optional(
177
+ z.object({
178
+ organization: z.nullable(z.string()),
179
+ domains: z.array(z.string()),
180
+ }),
181
+ ),
170
182
  });
171
183
  export type RestProvider = z.infer<typeof restProviderSchema>;
172
184
 
@@ -1095,9 +1107,10 @@ export const restPackConnectStartedSchema = z.object({
1095
1107
  export type RestPackConnectStarted = z.infer<typeof restPackConnectStartedSchema>;
1096
1108
 
1097
1109
  /**
1098
- * `GET .../pack-token/connect`: how the connection stands. Nothing asked; waiting for the
1099
- * person, with what they were shown; connected, the token kept and the project as it stands; or
1100
- * ended short of a token, and why.
1110
+ * `GET .../pack-token/connect` and `POST .../pack-token/connect/claim`: how the connection
1111
+ * stands. Nothing asked; waiting for the person, with what they were shown; connected, which
1112
+ * only the claim answers (ADR-0046), the token kept and the project as it stands; or ended
1113
+ * short of a token, and why.
1101
1114
  */
1102
1115
  const packConnectNone = z.object({ status: z.literal("none") });
1103
1116
  const packConnectPending = z.object({
@@ -1119,7 +1132,7 @@ export const restPackConnectSchema = z.union([
1119
1132
  ]);
1120
1133
  export type RestPackConnect = z.infer<typeof restPackConnectSchema>;
1121
1134
 
1122
- /** `GET /api/v1/workspace/pack-token/connect`: the same, for the workspace's token, with the workspace as it stands once connected. */
1135
+ /** `GET /api/v1/workspace/pack-token/connect` and `POST .../connect/claim`: the same, for the workspace's token, with the workspace as it stands once connected. */
1123
1136
  export const restWorkspacePackConnectSchema = z.union([
1124
1137
  packConnectNone,
1125
1138
  packConnectPending,
@@ -2168,15 +2168,67 @@ select.sc-input {
2168
2168
  text-align: left;
2169
2169
  }
2170
2170
 
2171
+ /* The ways in, one under the other, each a button with who gets in through it under it. */
2171
2172
  .sc-sign-in-ways {
2172
- display: flex;
2173
- flex-wrap: wrap;
2174
- justify-content: center;
2175
- gap: var(--sc-space-3);
2173
+ display: grid;
2174
+ justify-items: center;
2175
+ gap: var(--sc-space-4);
2176
+ margin-top: var(--sc-space-2);
2176
2177
  }
2177
2178
 
2179
+ .sc-sign-in-way {
2180
+ display: grid;
2181
+ justify-items: center;
2182
+ gap: var(--sc-space-2);
2183
+ width: 100%;
2184
+ }
2185
+
2186
+ /* The button is the page's one call: wide, a step taller than a control, the provider's mark
2187
+ before its words. */
2178
2188
  .sc-sign-in-button {
2179
- justify-self: center;
2189
+ width: 100%;
2190
+ max-width: 20rem;
2191
+ min-height: 2.75rem;
2192
+ gap: var(--sc-space-3);
2193
+ font-size: var(--sc-text-md);
2194
+ }
2195
+
2196
+ .sc-sign-in-button:focus-visible {
2197
+ outline: var(--sc-focus-ring);
2198
+ outline-offset: 3px;
2199
+ border-radius: var(--sc-radius-md);
2200
+ }
2201
+
2202
+ /* On the way to the provider: the button keeps its color and turns its ring in the text's color. */
2203
+ .sc-sign-in-button-going {
2204
+ cursor: progress;
2205
+ }
2206
+
2207
+ .sc-sign-in-spinner .sc-spinner-ring {
2208
+ width: 1rem;
2209
+ height: 1rem;
2210
+ border-color: color-mix(in srgb, var(--sc-color-accent-contrast) 40%, transparent);
2211
+ border-top-color: var(--sc-color-accent-contrast);
2212
+ }
2213
+
2214
+ .sc-sign-in-mark {
2215
+ flex: none;
2216
+ }
2217
+
2218
+ /* A mark in colors of its own sits on a light tile, whatever the button's color. */
2219
+ .sc-sign-in-mark-tile {
2220
+ display: grid;
2221
+ place-items: center;
2222
+ width: 1.5rem;
2223
+ height: 1.5rem;
2224
+ border-radius: var(--sc-radius-full);
2225
+ background: var(--sc-color-accent-contrast);
2226
+ }
2227
+
2228
+ .sc-sign-in-admits {
2229
+ margin: 0;
2230
+ color: var(--sc-color-text-muted);
2231
+ font-size: var(--sc-text-xs);
2180
2232
  }
2181
2233
 
2182
2234
  /* Prose: what people and agents write, rendered from Markdown. Element selectors on purpose. */
package/src/web.ts CHANGED
@@ -32,14 +32,15 @@ const CONTENT_TYPES: Readonly<Record<string, string>> = {
32
32
 
33
33
  /**
34
34
  * Pages show what people and agents wrote, which is untrusted. Nothing inline runs, nothing
35
- * loads from elsewhere but pictures over https, and nobody frames the page.
35
+ * loads from elsewhere, a picture from elsewhere coming through the console (ADR-0048), and
36
+ * nobody frames the page.
36
37
  */
37
38
  const PAGE_HEADERS: Readonly<Record<string, string>> = {
38
39
  "content-security-policy": [
39
40
  "default-src 'self'",
40
41
  "script-src 'self'",
41
42
  "style-src 'self'",
42
- "img-src 'self' data: https:",
43
+ "img-src 'self' data:",
43
44
  "font-src 'self'",
44
45
  "connect-src 'self'",
45
46
  "object-src 'none'",