@skillcdn/console 0.6.3 → 0.6.4

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 (191) hide show
  1. package/README.md +6 -6
  2. package/dist/agent-page.d.ts.map +1 -1
  3. package/dist/agent-page.js +7 -3
  4. package/dist/agent-page.js.map +1 -1
  5. package/dist/api.d.ts +5 -4
  6. package/dist/api.d.ts.map +1 -1
  7. package/dist/api.js +5 -4
  8. package/dist/api.js.map +1 -1
  9. package/dist/cli/cli.d.ts.map +1 -1
  10. package/dist/cli/cli.js +660 -138
  11. package/dist/cli/cli.js.map +1 -1
  12. package/dist/cli/format.d.ts +32 -4
  13. package/dist/cli/format.d.ts.map +1 -1
  14. package/dist/cli/format.js +125 -4
  15. package/dist/cli/format.js.map +1 -1
  16. package/dist/cli/help.d.ts.map +1 -1
  17. package/dist/cli/help.js +91 -29
  18. package/dist/cli/help.js.map +1 -1
  19. package/dist/cli/pack.d.ts +11 -10
  20. package/dist/cli/pack.d.ts.map +1 -1
  21. package/dist/cli/pack.js +27 -41
  22. package/dist/cli/pack.js.map +1 -1
  23. package/dist/cli/plugin-cli.d.ts.map +1 -1
  24. package/dist/cli/plugin-cli.js +8 -5
  25. package/dist/cli/plugin-cli.js.map +1 -1
  26. package/dist/cli/runner-files.d.ts.map +1 -1
  27. package/dist/cli/runner-files.js +15 -0
  28. package/dist/cli/runner-files.js.map +1 -1
  29. package/dist/cli/skill-path.d.ts +11 -0
  30. package/dist/cli/skill-path.d.ts.map +1 -0
  31. package/dist/cli/skill-path.js +44 -0
  32. package/dist/cli/skill-path.js.map +1 -0
  33. package/dist/client.d.ts +17 -1
  34. package/dist/client.d.ts.map +1 -1
  35. package/dist/client.js +10 -1
  36. package/dist/client.js.map +1 -1
  37. package/dist/components/agent-page.d.ts +67 -5
  38. package/dist/components/agent-page.d.ts.map +1 -1
  39. package/dist/components/agent-page.js +161 -14
  40. package/dist/components/agent-page.js.map +1 -1
  41. package/dist/components/agents.d.ts +3 -4
  42. package/dist/components/agents.d.ts.map +1 -1
  43. package/dist/components/agents.js +7 -6
  44. package/dist/components/agents.js.map +1 -1
  45. package/dist/components/people.d.ts.map +1 -1
  46. package/dist/components/people.js +7 -2
  47. package/dist/components/people.js.map +1 -1
  48. package/dist/components/picker.d.ts +16 -0
  49. package/dist/components/picker.d.ts.map +1 -1
  50. package/dist/components/picker.js +69 -4
  51. package/dist/components/picker.js.map +1 -1
  52. package/dist/console.css +40 -0
  53. package/dist/console.d.ts.map +1 -1
  54. package/dist/console.js +1 -1
  55. package/dist/console.js.map +1 -1
  56. package/dist/i18n/en.d.ts +19 -5
  57. package/dist/i18n/en.d.ts.map +1 -1
  58. package/dist/i18n/en.js +26 -12
  59. package/dist/i18n/en.js.map +1 -1
  60. package/dist/i18n/ko.d.ts.map +1 -1
  61. package/dist/i18n/ko.js +22 -10
  62. package/dist/i18n/ko.js.map +1 -1
  63. package/dist/limits.d.ts +16 -0
  64. package/dist/limits.d.ts.map +1 -1
  65. package/dist/limits.js +16 -0
  66. package/dist/limits.js.map +1 -1
  67. package/dist/onboarding.d.ts +18 -6
  68. package/dist/onboarding.d.ts.map +1 -1
  69. package/dist/onboarding.js +42 -7
  70. package/dist/onboarding.js.map +1 -1
  71. package/dist/plugin/args.d.ts +24 -2
  72. package/dist/plugin/args.d.ts.map +1 -1
  73. package/dist/plugin/args.js +20 -2
  74. package/dist/plugin/args.js.map +1 -1
  75. package/dist/plugin/define.d.ts.map +1 -1
  76. package/dist/plugin/define.js +12 -3
  77. package/dist/plugin/define.js.map +1 -1
  78. package/dist/plugin/rest-schemas.d.ts +2 -0
  79. package/dist/plugin/rest-schemas.d.ts.map +1 -1
  80. package/dist/plugin/rest-schemas.js +1 -0
  81. package/dist/plugin/rest-schemas.js.map +1 -1
  82. package/dist/routes.d.ts +2 -0
  83. package/dist/routes.d.ts.map +1 -1
  84. package/dist/routes.js +2 -0
  85. package/dist/routes.js.map +1 -1
  86. package/dist/rules.d.ts +4 -1
  87. package/dist/rules.d.ts.map +1 -1
  88. package/dist/rules.js +5 -2
  89. package/dist/rules.js.map +1 -1
  90. package/dist/runner/claude.d.ts.map +1 -1
  91. package/dist/runner/claude.js +48 -0
  92. package/dist/runner/claude.js.map +1 -1
  93. package/dist/runner/codex.d.ts.map +1 -1
  94. package/dist/runner/codex.js +4 -1
  95. package/dist/runner/codex.js.map +1 -1
  96. package/dist/runner/desk.d.ts.map +1 -1
  97. package/dist/runner/desk.js +5 -4
  98. package/dist/runner/desk.js.map +1 -1
  99. package/dist/runner/runner.d.ts +16 -0
  100. package/dist/runner/runner.d.ts.map +1 -1
  101. package/dist/runner/runner.js +157 -8
  102. package/dist/runner/runner.js.map +1 -1
  103. package/dist/runner/slack.d.ts.map +1 -1
  104. package/dist/runner/slack.js +14 -3
  105. package/dist/runner/slack.js.map +1 -1
  106. package/dist/runner/types.d.ts +19 -0
  107. package/dist/runner/types.d.ts.map +1 -1
  108. package/dist/runner/types.js.map +1 -1
  109. package/dist/schemas.d.ts +475 -5
  110. package/dist/schemas.d.ts.map +1 -1
  111. package/dist/schemas.js +117 -12
  112. package/dist/schemas.js.map +1 -1
  113. package/dist/secret-file.d.ts +21 -0
  114. package/dist/secret-file.d.ts.map +1 -0
  115. package/dist/secret-file.js +59 -0
  116. package/dist/secret-file.js.map +1 -0
  117. package/dist/services.d.ts.map +1 -1
  118. package/dist/services.js +3 -2
  119. package/dist/services.js.map +1 -1
  120. package/dist/setup-guide.d.ts +2 -2
  121. package/dist/setup-guide.d.ts.map +1 -1
  122. package/dist/setup-guide.js +6 -5
  123. package/dist/setup-guide.js.map +1 -1
  124. package/dist/vocabulary.d.ts +10 -2
  125. package/dist/vocabulary.d.ts.map +1 -1
  126. package/dist/vocabulary.js +9 -2
  127. package/dist/vocabulary.js.map +1 -1
  128. package/docs/specs/cli.md +22 -16
  129. package/docs/specs/plugins.md +5 -4
  130. package/docs/specs/rest.md +24 -12
  131. package/docs/specs/runner.md +19 -12
  132. package/docs/start.md +4 -3
  133. package/package.json +3 -3
  134. package/skills/building-a-plugin/SKILL.md +2 -2
  135. package/skills/keeping-the-pack/SKILL.md +87 -0
  136. package/skills/planning-the-board/SKILL.md +6 -6
  137. package/skills/planning-the-board/references/a-task.md +1 -1
  138. package/skills/planning-the-board/references/setting-up.md +9 -5
  139. package/skills/running-an-agent/SKILL.md +15 -14
  140. package/skills/running-an-agent/references/preparing-the-machine.md +3 -2
  141. package/skills/running-an-agent/references/several-tasks.md +8 -2
  142. package/skills/running-an-agent/references/slack-app.md +10 -4
  143. package/skills/running-an-agent/references/the-account-and-the-invitation.md +1 -1
  144. package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -1
  145. package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +3 -3
  146. package/skills/running-an-agent/references/your-first-task.md +4 -3
  147. package/skills/working-the-board/SKILL.md +4 -4
  148. package/skills/working-the-board/references/terms.md +3 -1
  149. package/skills/working-the-board/references/the-pack.md +12 -5
  150. package/src/agent-page.tsx +19 -3
  151. package/src/api.ts +27 -0
  152. package/src/cli/cli.ts +847 -192
  153. package/src/cli/format.ts +158 -4
  154. package/src/cli/help.ts +102 -28
  155. package/src/cli/pack.ts +49 -58
  156. package/src/cli/plugin-cli.ts +8 -5
  157. package/src/cli/runner-files.ts +17 -0
  158. package/src/cli/skill-path.ts +51 -0
  159. package/src/client.ts +50 -0
  160. package/src/components/agent-page.tsx +309 -30
  161. package/src/components/agents.tsx +7 -23
  162. package/src/components/people.tsx +7 -3
  163. package/src/components/picker.tsx +79 -5
  164. package/src/console.tsx +0 -1
  165. package/src/i18n/en.ts +28 -13
  166. package/src/i18n/ko.ts +24 -10
  167. package/src/limits.ts +16 -0
  168. package/src/onboarding.ts +60 -21
  169. package/src/plugin/args.ts +29 -3
  170. package/src/plugin/define.ts +18 -3
  171. package/src/plugin/rest-schemas.ts +3 -0
  172. package/src/routes.ts +2 -0
  173. package/src/rules.ts +5 -2
  174. package/src/runner/claude.ts +53 -0
  175. package/src/runner/codex.ts +4 -1
  176. package/src/runner/desk.ts +5 -4
  177. package/src/runner/runner.ts +199 -9
  178. package/src/runner/slack.ts +18 -7
  179. package/src/runner/types.ts +16 -0
  180. package/src/schemas.ts +148 -10
  181. package/src/secret-file.ts +76 -0
  182. package/src/services.ts +3 -2
  183. package/src/setup-guide.ts +6 -5
  184. package/src/styles/README.md +1 -1
  185. package/src/styles/pages/agents.css +40 -0
  186. package/src/vocabulary.ts +12 -2
  187. package/dist/cli/command-words.d.ts +0 -20
  188. package/dist/cli/command-words.d.ts.map +0 -1
  189. package/dist/cli/command-words.js +0 -51
  190. package/dist/cli/command-words.js.map +0 -1
  191. package/src/cli/command-words.ts +0 -56
@@ -14,7 +14,9 @@ import { cx } from "./ui.js";
14
14
  // part of, the goal it works towards. The picker asks for what the words typed find, a page at a
15
15
  // time, and never holds the listing: the first page as soon as the field is entered, the words'
16
16
  // page once the typing rests, the next page on a press. What is chosen stands in the field's
17
- // place, and a press clears it. Takes a search and nothing else from the network.
17
+ // place, and a press clears it; where something must always be chosen, the press opens the
18
+ // field over it and what stood stands again unless another is chosen. Takes a search and
19
+ // nothing else from the network.
18
20
 
19
21
  /** How many items one page of a picker holds: enough to find the one meant, few enough to read at a glance. */
20
22
  export const PICKER_PAGE_LIMIT = 10;
@@ -50,9 +52,31 @@ export function opensAbove(
50
52
  return listHeight > below && over > below;
51
53
  }
52
54
 
55
+ /**
56
+ * What the press on a chosen value's button does. It clears a value that may be none. One that
57
+ * is required is never cleared, so the press opens the field in its place and saves nothing:
58
+ * another is chosen there, and the one that stood stands again where the field is left with
59
+ * nothing chosen. A press that saved "none" first would be refused by whatever requires the
60
+ * value, and the field to choose another in would never open.
61
+ */
62
+ export function pressOnChosen(required: boolean | undefined): "clear" | "replace" {
63
+ return required === true ? "replace" : "clear";
64
+ }
65
+
66
+ /** Whether choosing `next` in the place of `current` is a change to save: what stands already is none. */
67
+ export function savesChoice(current: string | undefined, next: string): boolean {
68
+ return current !== next;
69
+ }
70
+
53
71
  export interface PickerProps<T> {
54
72
  /** What is chosen, if anything. */
55
73
  readonly value: T | undefined;
74
+ /**
75
+ * Whether something is always chosen once something is, as an agent account's manager is:
76
+ * the press on it then changes it and never clears it (`pressOnChosen`). A value that is
77
+ * not there yet is chosen as any other.
78
+ */
79
+ readonly required?: boolean | undefined;
56
80
  /** What stands for a choice made but not read back yet: shown in the chip's place, and cleared as one. */
57
81
  readonly held?: ReactNode | undefined;
58
82
  readonly search: PickerSearch<T>;
@@ -88,8 +112,14 @@ export function Picker<T>(props: PickerProps<T>) {
88
112
  const [loading, setLoading] = useState(false);
89
113
  const [active, setActive] = useState(-1);
90
114
  const [above, setAbove] = useState(false);
115
+ // Whether the field stands over what is chosen, for another to be chosen in its place.
116
+ const [replacing, setReplacing] = useState(false);
91
117
  const field = useRef<HTMLInputElement>(null);
92
118
  const list = useRef<HTMLDivElement>(null);
119
+ const press = useRef<HTMLButtonElement>(null);
120
+ // Whether the chip's button takes the focus back once the chip stands again: after a choice
121
+ // or Escape, which the keyboard goes on from, and not where the focus moved on by itself.
122
+ const back = useRef(false);
93
123
  // The search and the exclusion as the page last gave them, read at the moment of a request,
94
124
  // so that a page rendering again starts no search over.
95
125
  const search = useRef(props.search);
@@ -180,7 +210,37 @@ export function Picker<T>(props: PickerProps<T>) {
180
210
  });
181
211
  };
182
212
 
213
+ // The field takes the focus as it opens over what is chosen; the chip's button takes it back
214
+ // when the chip stands again after a choice or Escape.
215
+ useEffect(() => {
216
+ if (replacing) {
217
+ field.current?.focus();
218
+ } else if (back.current) {
219
+ back.current = false;
220
+ press.current?.focus();
221
+ }
222
+ }, [replacing]);
223
+
224
+ /** The field over what is chosen is left: what stood stands again, unless another was chosen. */
225
+ const leave = (toButton: boolean) => {
226
+ back.current = toButton;
227
+ setReplacing(false);
228
+ setQuery("");
229
+ setOpen(false);
230
+ // The field opens again at once on the next press, over the list it last held: no option
231
+ // of that list is the one the keyboard goes on from.
232
+ setActive(-1);
233
+ };
234
+
183
235
  const choose = (item: T) => {
236
+ if (replacing) {
237
+ const current = props.value === undefined ? undefined : props.keyOf(props.value);
238
+ if (savesChoice(current, props.keyOf(item))) {
239
+ props.onChange(item);
240
+ }
241
+ leave(true);
242
+ return;
243
+ }
184
244
  props.onChange(item);
185
245
  setQuery("");
186
246
  setOpen(false);
@@ -206,24 +266,30 @@ export function Picker<T>(props: PickerProps<T>) {
206
266
  if (chosen !== undefined) {
207
267
  choose(chosen);
208
268
  }
269
+ } else if (event.key === "Escape" && replacing) {
270
+ // Nothing was chosen in the place of what stood: it stands again.
271
+ event.preventDefault();
272
+ leave(true);
209
273
  } else if (event.key === "Escape" && open) {
210
274
  event.preventDefault();
211
275
  setOpen(false);
212
276
  }
213
277
  };
214
278
 
215
- if (props.value !== undefined || props.held !== undefined) {
279
+ if ((props.value !== undefined || props.held !== undefined) && !replacing) {
280
+ const replaces = pressOnChosen(props.required) === "replace";
216
281
  return (
217
282
  <div className={cx("sc-picker", "sc-picker-chosen", props.className)}>
218
283
  <span className="sc-picker-value">
219
284
  {props.value === undefined ? props.held : props.render(props.value)}
220
285
  </span>
221
286
  <button
287
+ ref={press}
222
288
  type="button"
223
289
  className="sc-picker-clear"
224
- aria-label={words.remove}
290
+ aria-label={replaces ? words.change : words.remove}
225
291
  disabled={props.disabled}
226
- onClick={() => props.onChange(undefined)}
292
+ onClick={() => (replaces ? setReplacing(true) : props.onChange(undefined))}
227
293
  >
228
294
  <span aria-hidden="true">&times;</span>
229
295
  </button>
@@ -253,7 +319,15 @@ export function Picker<T>(props: PickerProps<T>) {
253
319
  setOpen(true);
254
320
  }}
255
321
  onFocus={() => setOpen(true)}
256
- onBlur={() => setOpen(false)}
322
+ onBlur={() => {
323
+ setOpen(false);
324
+ // The focus moved on with nothing chosen in the place of what stood: it stands again.
325
+ // Not where a choice or Escape already left the field, which a browser may tell of
326
+ // as the field goes.
327
+ if (replacing && !back.current) {
328
+ leave(false);
329
+ }
330
+ }}
257
331
  onKeyDown={onKeyDown}
258
332
  />
259
333
  {open && (
package/src/console.tsx CHANGED
@@ -3268,7 +3268,6 @@ function NewAgentPage(props: {
3268
3268
  workspace={data.me?.workspace}
3269
3269
  people={data.people}
3270
3270
  me={me}
3271
- projects={data.projects}
3272
3271
  busy={busy}
3273
3272
  error={error}
3274
3273
  onSubmit={(input) =>
package/src/i18n/en.ts CHANGED
@@ -97,6 +97,7 @@ export const en = {
97
97
  cancel: "Cancel",
98
98
  save: "Save",
99
99
  remove: "Remove",
100
+ change: "Change",
100
101
  edit: "Edit",
101
102
  done: "Done",
102
103
  loading: "Loading",
@@ -219,8 +220,7 @@ export const en = {
219
220
  "team.not_a_member": "The person is not in the team.",
220
221
  "person.invalid_manager":
221
222
  "A manager must be another active person, and not one of this person's own team.",
222
- "person.last_admin": "The workspace needs at least one administrator.",
223
- "person.agent_admin": "An agent account is never an administrator.",
223
+ "person.last_admin": "The workspace needs at least one administrator who is a person.",
224
224
  "person.manager_required":
225
225
  "An agent account always has a manager. Name another; the manager is never taken away.",
226
226
  "agent.too_many_accounts": "The account records as many accounts held elsewhere as one may.",
@@ -260,14 +260,15 @@ export const en = {
260
260
  "agent.not_found": "The agent account was not found.",
261
261
  "agent.handle_taken": "Another agent account has this handle.",
262
262
  "agent.exists": "This login is an agent account already.",
263
- "agent.administrator":
264
- "An administrator is not made an agent account. Make them a member first.",
265
263
  "agent.login_is_member":
266
264
  "A member signs in with this login already. Nothing was changed: write the login of the agent's own account, or say that this member is to become the agent account.",
267
265
  "agent.invalid_manager":
268
266
  "A manager must be another active member, and not one who reports to this account.",
269
- "agent.invalid_project": "The project it starts in was not found.",
270
267
  "agent.unknown_host": "Nobody signs in through that provider here.",
268
+ "note.closed": "The note is closed already.",
269
+ "note.not_found": "The note was not found.",
270
+ "note.too_many":
271
+ "You have as many notes open on the skills as one may, or left as many within the hour. Whoever keeps the skills closes some first, and an hour passes by itself.",
271
272
  "person.not_found": "The person was not found.",
272
273
  "person.of_organization": "The organization decides who is in. This can't be changed here.",
273
274
  "picture.refused": "This picture can't be shown.",
@@ -318,6 +319,7 @@ export const en = {
318
319
  "token.not_found": "The token was not found.",
319
320
  "session.not_found": "The session was not found.",
320
321
  "token.too_many": "You have as many tokens as you can hold. Remove one first.",
322
+ "workspace.keeper_not_found": "Nobody who is in has that id: the skills are kept by a member.",
321
323
  "workspace.pack_connect_refused": "SkillCDN refused the connection.",
322
324
  "workspace.pack_connect_unsupported": "This console can't connect a pack.",
323
325
  "workspace.identity_unavailable":
@@ -2083,7 +2085,7 @@ export const en = {
2083
2085
  offerTitle: "Offer a secret",
2084
2086
  offerAria: "Offer a secret",
2085
2087
  intro: (name: string, days: number) =>
2086
- `${name} is told, and takes it or leaves it. The value is typed here once and shown to nobody; an offer not taken is gone after ${days} days.`,
2088
+ `${name} is told, and takes it or leaves it. The value is typed here once, or taken from a file's text, and shown to nobody; an offer not taken is gone after ${days} days.`,
2087
2089
  waits: (name: string) => `${name} takes each or leaves it. Never a value.`,
2088
2090
  own: "Take one or leave one with your command: console secrets --offered",
2089
2091
  name: "Name",
@@ -2095,6 +2097,21 @@ export const en = {
2095
2097
  takenAs: (name: string) => `as ${name}`,
2096
2098
  state: { waiting: "Waiting", taken: "Taken", left: "Left", lapsed: "Ran out" },
2097
2099
  },
2100
+ /** A secret's value taken from a file a person chose, and the day it ends on (ADR-0184). */
2101
+ secretFile: {
2102
+ choose: "Choose a file",
2103
+ remove: (name: string) => `Take ${name} out`,
2104
+ /** When the value itself ends, a token made for a time say: never, unless a day is chosen. */
2105
+ ends: "Value ends",
2106
+ endsNever: "Never",
2107
+ endsOnDay: "On a day",
2108
+ expiresOn: "Ends on",
2109
+ tooLarge: (most: string) =>
2110
+ `The file's text is longer than a secret's value may be: ${most} at the most.`,
2111
+ notText: "The file is no text. A secret's value is text, as a .env file's is.",
2112
+ empty: "The file holds nothing.",
2113
+ unread: "The file could not be read here. Choose it again.",
2114
+ },
2098
2115
  notSupervised: {
2099
2116
  title: "For its supervisors",
2100
2117
  body: "What an agent is doing is read by whom it reports to, those above them, and the administrators.",
@@ -2306,7 +2323,6 @@ export const en = {
2306
2323
  user: "OS account",
2307
2324
  version: "Runner",
2308
2325
  product: "Product",
2309
- untried: "a version the driver was not tried with",
2310
2326
  signals: "Signals",
2311
2327
  delivered: (delivered: number, latest: number) => `${delivered} of ${latest} delivered`,
2312
2328
  sources: "Wake sources",
@@ -2343,7 +2359,7 @@ export const en = {
2343
2359
  secrets: {
2344
2360
  title: "Secrets",
2345
2361
  intro:
2346
- "By name. A value is typed here once and never shown again: only the account reads it back.",
2362
+ "By name. A value is typed here once, or taken from a file's text, and never shown again: only the account reads it back.",
2347
2363
  empty: "No secret is kept yet.",
2348
2364
  seedAria: "Seed a secret",
2349
2365
  seeded: "seeded by a supervisor",
@@ -2467,12 +2483,11 @@ export const en = {
2467
2483
  },
2468
2484
  loginDerived:
2469
2485
  "Put together from the workspace's services; change it where the account is called otherwise.",
2470
- reports: "Whom it reports to, and where it starts",
2486
+ reports: "Whom it reports to",
2471
2487
  next: "Next, on its page: an invitation that leads a machine to it.",
2472
2488
  manager: "Manager",
2473
2489
  managerHint:
2474
- "Its manager is whom it turns to first and who answers for it; an administrator names another at any time. It starts in the project chosen, as a member.",
2475
- project: "Starts in",
2490
+ "Its manager is whom it turns to first and who answers for it; an administrator names another at any time. A private project adds it as it adds any member.",
2476
2491
  submit: "Add the agent account",
2477
2492
  },
2478
2493
  },
@@ -2480,8 +2495,8 @@ export const en = {
2480
2495
  // runner's words, shown there and on no page. `{time}` stands for the moment it is back.
2481
2496
  status: {
2482
2497
  thinking: "Thinking",
2483
- working: "Working · a reply may take a while",
2484
- limited: "Out of usage",
2498
+ working: "Working · a bit slow to reply",
2499
+ limited: "Recharging",
2485
2500
  back: "back at {time}",
2486
2501
  },
2487
2502
  },
package/src/i18n/ko.ts CHANGED
@@ -59,6 +59,7 @@ export const ko: Messages = {
59
59
  cancel: "취소",
60
60
  save: "저장",
61
61
  remove: "제거",
62
+ change: "변경",
62
63
  edit: "편집",
63
64
  done: "확인",
64
65
  loading: "불러오는 중",
@@ -175,8 +176,7 @@ export const ko: Messages = {
175
176
  "team.invalid_member": "활성 상태인 워크스페이스의 사람만 팀에 넣을 수 있습니다.",
176
177
  "team.not_a_member": "그 사람은 이 팀에 없습니다.",
177
178
  "person.invalid_manager": "본인, 본인의 팀원, 비활성화된 사람은 매니저로 지정할 수 없습니다.",
178
- "person.last_admin": "관리자가 한 명은 있어야 합니다.",
179
- "person.agent_admin": "에이전트 계정은 관리자가 될 수 없습니다.",
179
+ "person.last_admin": "사람인 관리자가 한 명은 있어야 합니다.",
180
180
  "person.manager_required":
181
181
  "에이전트 계정에는 매니저가 꼭 있어야 합니다. 비울 수 없으니 다른 사람을 지정하세요.",
182
182
  "agent.too_many_accounts":
@@ -216,13 +216,15 @@ export const ko: Messages = {
216
216
  "agent.not_found": "에이전트 계정을 찾을 수 없습니다.",
217
217
  "agent.handle_taken": "이미 다른 에이전트 계정이 쓰는 핸들입니다.",
218
218
  "agent.exists": "이미 에이전트 계정인 로그인입니다.",
219
- "agent.administrator": "관리자는 에이전트 계정으로 바꿀 수 없습니다. 먼저 멤버로 바꾸세요.",
220
219
  "agent.login_is_member":
221
220
  "이미 멤버가 쓰는 로그인입니다. 바뀐 것은 없습니다. 에이전트가 쓸 계정의 로그인을 적거나, 이 멤버를 에이전트 계정으로 바꾼다고 표시하세요.",
222
221
  "agent.invalid_manager":
223
222
  "매니저는 활성 상태인 다른 구성원이어야 하고, 이 계정에게 보고하는 구성원은 될 수 없습니다.",
224
- "agent.invalid_project": "시작할 프로젝트를 찾을 수 없습니다.",
225
223
  "agent.unknown_host": "이 콘솔에서는 그 제공자로 로그인하지 않습니다.",
224
+ "note.closed": "이미 닫힌 메모입니다.",
225
+ "note.not_found": "메모를 찾을 수 없습니다.",
226
+ "note.too_many":
227
+ "스킬에 남긴 열린 메모가 한도에 도달했거나, 한 시간 동안 남길 수 있는 수를 채웠습니다. 열린 메모는 스킬 관리자가 일부를 닫아야 하고, 시간 한도는 한 시간 뒤에 풀립니다.",
226
228
  "person.not_found": "사람을 찾을 수 없습니다.",
227
229
  "person.of_organization": "조직 설정으로 정해지는 사람이라 여기서 바꿀 수 없습니다.",
228
230
  "picture.refused": "표시할 수 없는 이미지입니다.",
@@ -274,6 +276,8 @@ export const ko: Messages = {
274
276
  "token.not_found": "토큰을 찾을 수 없습니다.",
275
277
  "session.not_found": "세션을 찾을 수 없습니다.",
276
278
  "token.too_many": "만들 수 있는 토큰 수를 다 채웠습니다. 먼저 하나를 삭제하세요.",
279
+ "workspace.keeper_not_found":
280
+ "그 id의 구성원이 없습니다. 스킬 관리자는 구성원 가운데 한 명입니다.",
277
281
  "workspace.pack_connect_refused": "SkillCDN이 연결을 거부했습니다.",
278
282
  "workspace.pack_connect_unsupported": "이 콘솔에서는 팩을 연결할 수 없습니다.",
279
283
  "workspace.identity_unavailable":
@@ -1974,7 +1978,7 @@ export const ko: Messages = {
1974
1978
  offerTitle: "시크릿 제안",
1975
1979
  offerAria: "시크릿 제안",
1976
1980
  intro: (name: string, days: number) =>
1977
- `${name}에게 알려지며, 받을지 말지는 계정이 직접 정합니다. 값은 여기에 한 번 입력하면 누구에게도 보이지 않으며, 받지 않은 제안은 ${days}일 뒤 사라집니다.`,
1981
+ `${name}에게 알려지며, 받을지 말지는 계정이 직접 정합니다. 값은 여기에 한 번 입력하거나 파일의 내용으로 넣으며, 누구에게도 보이지 않습니다. 받지 않은 제안은 ${days}일 뒤 사라집니다.`,
1978
1982
  waits: (name: string) =>
1979
1983
  `받을지 말지는 ${name} 계정이 직접 정합니다. 값은 보이지 않습니다.`,
1980
1984
  own: "명령으로 받거나 받지 않습니다: console secrets --offered",
@@ -1987,6 +1991,18 @@ export const ko: Messages = {
1987
1991
  takenAs: (name: string) => `받은 이름: ${name}`,
1988
1992
  state: { waiting: "대기 중", taken: "받음", left: "받지 않음", lapsed: "기한 지남" },
1989
1993
  },
1994
+ secretFile: {
1995
+ choose: "파일 선택",
1996
+ remove: (name) => `${name} 빼기`,
1997
+ ends: "값 만료",
1998
+ endsNever: "만료 없음",
1999
+ endsOnDay: "날짜 지정",
2000
+ expiresOn: "값 만료일",
2001
+ tooLarge: (most) => `파일 내용이 너무 깁니다. 시크릿 값은 ${most}까지입니다.`,
2002
+ notText: "텍스트 파일이 아닙니다. 시크릿 값은 .env 파일처럼 텍스트여야 합니다.",
2003
+ empty: "빈 파일입니다.",
2004
+ unread: "파일을 읽지 못했습니다. 다시 선택해 주세요.",
2005
+ },
1990
2006
  notSupervised: {
1991
2007
  title: "감독자만 볼 수 있습니다",
1992
2008
  body: "에이전트가 하는 일은 매니저와 그 위의 매니저들, 그리고 관리자만 볼 수 있습니다.",
@@ -2180,7 +2196,6 @@ export const ko: Messages = {
2180
2196
  user: "OS 계정",
2181
2197
  version: "러너",
2182
2198
  product: "제품",
2183
- untried: "드라이버가 시험되지 않은 버전",
2184
2199
  signals: "신호",
2185
2200
  delivered: (delivered: number, latest: number) => `${latest}개 중 ${delivered}개 전달됨`,
2186
2201
  sources: "깨움 소스",
@@ -2217,7 +2232,7 @@ export const ko: Messages = {
2217
2232
  secrets: {
2218
2233
  title: "시크릿",
2219
2234
  intro:
2220
- "이름으로만 보입니다. 값은 여기에 한 번 입력하면 다시 보이지 않으며, 계정만 값을 읽습니다.",
2235
+ "이름으로만 보입니다. 값은 여기에 한 번 입력하거나 파일의 내용으로 넣으며, 다시 보이지 않습니다. 계정만 값을 읽습니다.",
2221
2236
  empty: "아직 보관된 시크릿이 없습니다.",
2222
2237
  seedAria: "시크릿 넣기",
2223
2238
  seeded: "감독자가 넣음",
@@ -2337,12 +2352,11 @@ export const ko: Messages = {
2337
2352
  },
2338
2353
  loginDerived:
2339
2354
  "워크스페이스 설정의 서비스에서 만든 이름입니다. 계정 이름이 다르면 바꾸세요.",
2340
- reports: "보고할 사람과 시작할 곳",
2355
+ reports: "보고할 사람",
2341
2356
  next: "추가한 뒤에는 계정의 페이지에서 머신으로 이어지는 초대를 만듭니다.",
2342
2357
  manager: "매니저",
2343
2358
  managerHint:
2344
- "매니저는 에이전트가 먼저 찾는 사람이자 이 계정을 책임지는 사람입니다. 관리자가 언제든 바꿀 수 있습니다. 고른 프로젝트에서 멤버로 시작합니다.",
2345
- project: "시작 프로젝트",
2359
+ "매니저는 에이전트가 먼저 찾는 사람이자 이 계정을 책임지는 사람입니다. 관리자가 언제든 바꿀 수 있습니다. 비공개 프로젝트에는 다른 멤버처럼 추가합니다.",
2346
2360
  submit: "에이전트 계정 추가",
2347
2361
  },
2348
2362
  },
package/src/limits.ts CHANGED
@@ -138,6 +138,22 @@ export const MAX_AGENT_ELSEWHERE = 20;
138
138
  export const MAX_ELSEWHERE_NAME_LENGTH = 200;
139
139
  /** When an agent account's day starts, in the workspace's time zone, where the account says no other hour (ADR-0085). */
140
140
  export const DEFAULT_DAY_START = "09:00";
141
+ /**
142
+ * A note a member leaves on the pack (ADR-0178): what it says, in a few sentences; what is said
143
+ * of what became of it; the path it is on; how many one member has open at once, and how many
144
+ * they leave within an hour, whatever became of them, which is the bound a script that leaves
145
+ * and takes back in a loop meets; and how many a page of the list carries when none is asked
146
+ * for, and the most it may.
147
+ */
148
+ export const MAX_PACK_NOTE_LENGTH = 1200;
149
+ export const MAX_PACK_NOTE_OUTCOME_LENGTH = 600;
150
+ export const MAX_PACK_NOTE_PATH_LENGTH = 300;
151
+ export const MAX_PACK_NOTES_OPEN_BY_ONE = 50;
152
+ export const MAX_PACK_NOTES_PER_HOUR = 60;
153
+ export const PACK_NOTES_PAGE_LIMIT = 50;
154
+ export const MAX_PACK_NOTES_PAGE_LIMIT = 200;
155
+ /** The hour of the round of whoever keeps the pack, in the workspace's time zone, where the workspace says no other (ADR-0178). */
156
+ export const DEFAULT_PACK_ROUND = "03:00";
141
157
  /** A service a workspace names (ADR-0089): how many parameters one has beside its kind, and how long one is. */
142
158
  export const MAX_SERVICE_PARAMETERS = 8;
143
159
  export const MAX_SERVICE_VALUE_LENGTH = 200;
package/src/onboarding.ts CHANGED
@@ -1,43 +1,64 @@
1
+ import { MAX_SIGNAL_LENGTH } from "./limits.js";
2
+ import { agentHref } from "./router.js";
1
3
  import type { RestWorkspace } from "./schemas.js";
2
4
  import { BROWSER_OF_AN_AGENT, guideServicesOf } from "./setup-guide.js";
3
5
 
4
- // The onboarding of an agent account (ADR-0088, points 4 to 6): its first task, which the
5
- // console makes when the account is made, with the agent as its worker. The agent works it as
6
- // any task, with a run, reports and decisions; what only a person can do it asks for as a
7
- // decision, of whoever can do it; the board wakes the agent with it as with any ready task it
8
- // is at work on, which is its first wake. Its run stays open while a decision of it waits, which
9
- // the console never ends, and the task is finished when nothing of it waits on anyone: a run
10
- // finished with decisions waiting could ask no more. The task's words are made here, for one account and the
11
- // services of its workspace, in the words of their modules: English, as a skill is, for the
12
- // agent to read as they are. Every task says how help is asked, whatever the services are
13
- // (ADR-0152): the agent does everything it can itself, and what it cannot is its own to judge.
6
+ // The onboarding of an agent account (ADR-0181, in place of ADR-0088's points 4 to 6): the
7
+ // console's first message to it, left on the account's record when the account is made and
8
+ // delivered when a runner first connects, which is its first wake. It is no task of a board: an
9
+ // account is made in no project, and is put in one later as any member is. The agent does what
10
+ // the message lists in its own sessions; what only a person can do it asks for as a decision,
11
+ // of whoever can do it, on a task it writes for its setup in a project it is in, and where it
12
+ // is in none yet it says what it needs in its answer, which its supervisors read on its page.
13
+ // The words are made here, for one account and the services of its workspace, in the words of
14
+ // their modules: English, as a skill is, for the agent to read as they are. Every message says
15
+ // how help is asked, whatever the services are (ADR-0152): the agent does everything it can
16
+ // itself, and what it cannot is its own to judge.
14
17
 
15
18
  export interface OnboardingInput {
16
- /** The account's handle: what the task and its commands name it by. */
19
+ /** The account's handle: what the message and its commands name it by. */
17
20
  readonly handle: string;
18
21
  /** The workspace's names and services (ADR-0089). */
19
22
  readonly workspace: Pick<RestWorkspace, "handle" | "domain" | "services">;
20
23
  /**
21
- * The login the account signs in to the console with, where whoever makes the task knows it:
22
- * an address there is the account's own address, which the task then names. Left out, what
23
- * the workspace's identity service makes of its names.
24
+ * The login the account signs in to the console with, where whoever makes the account knows
25
+ * it: an address there is the account's own address, which the message then names. Left out,
26
+ * what the workspace's identity service makes of its names.
24
27
  */
25
28
  readonly login?: string | undefined;
26
29
  }
27
30
 
28
- /** What the onboarding task of an account is called. */
31
+ /**
32
+ * What the onboarding is called on the account's record: the reference of the wake that
33
+ * carries it, which its header names (`console: onboarding`).
34
+ */
35
+ export const ONBOARDING_KEY = "onboarding";
36
+
37
+ /**
38
+ * What a task for an account's setup is called: the one the account writes where it has
39
+ * something to ask of a person, and the one a console of before made with the account, which
40
+ * such an account keeps.
41
+ */
29
42
  export function onboardingTitle(handle: string): string {
30
43
  return `Set up @${handle}`;
31
44
  }
32
45
 
33
46
  const item = (title: string, body: string): string => `- **${title}.** ${body}`;
34
47
 
35
- /** The onboarding task of one account: its title, and its body as Markdown. */
48
+ /** What the words end with where they were cut at the bound of a signal, which names of an unusual length alone reach. */
49
+ const CUT =
50
+ "\n\n(Cut here at the length one message carries. Ask your manager for what is missing.)\n";
51
+
52
+ /**
53
+ * The onboarding of one account: the words of the console's first message to it, as Markdown,
54
+ * within what a signal carries, and what a task for it is called.
55
+ */
36
56
  export function onboardingOf(input: OnboardingInput): {
37
57
  readonly title: string;
38
58
  readonly body: string;
39
59
  } {
40
60
  const { handle } = input;
61
+ const title = onboardingTitle(handle);
41
62
  const services = guideServicesOf(input.workspace, handle, input.login);
42
63
  const own = [
43
64
  ...services.flatMap((one) => one.onboarding.map((step) => item(step.title, step.body))),
@@ -55,12 +76,22 @@ export function onboardingOf(input: OnboardingInput): {
55
76
  ),
56
77
  item(
57
78
  "Introduce yourself to your manager",
58
- "`console manager` says who it is. Say who you are, what you do and how to reach you: on the messenger where you have one, else as a comment on this task.",
79
+ "`console manager` says who it is. Say who you are, what you do and how to reach you: on the messenger where you have one, else in your answer to this message, which your supervisors read on your page.",
59
80
  ),
60
81
  ];
61
82
  const asked = services.flatMap((one) => one.asks.map((ask) => item(ask.title, ask.body)));
83
+ // How help is asked, a sentence a line here, so that a change to one is a change to that line.
84
+ const asking = [
85
+ "Do everything you can yourself, and ask for help only with what you cannot do. Ask for that as a decision, of whoever can do it, and of your manager where you do not know who.",
86
+ `A decision is asked on a task, in a project you are in (\`console projects\` lists them): write one for your setup there and take it in one command, \`console task new "${title}" --project <key> --take\`, and ask on its run.`,
87
+ 'Ask it in a line, and say the exact values, what to hand back and how, in its body; offer "Done" and "Not now": `console ask "<question>" --body "<the values, what to hand back>" --option "Done" --option "Not now"`, with `--to <login>` for whom it is asked of and `--project <key>`.',
88
+ "The run stays open while a decision waits: the answer wakes you, and you go on with that run (`--run <id>`).",
89
+ "Where you are in no project yet, say what you need in your answer to this message, which your supervisors read on your page, and ask it as a decision once you are in one.",
90
+ `A secret that is handed back is put in where only you read it, by whoever has it, on your page of the console: give them its address, the console's own and then \`${agentHref(handle, "settings")}\`, with the name to put it in under.`,
91
+ "Go on with the rest meanwhile.",
92
+ ].join(" ");
62
93
  const body = [
63
- `This is your first task, @${handle}: making your account ready to work. Work it as any task: take it, and report as you go. What waits on a person you ask for as a decision, and a run that waits for a decision stays open: the answer wakes you, and you go on with that run (\`--run <id>\`). The task is finished when nothing of it waits on anyone. \`console help\` and the skill \`working-the-board\` say how.`,
94
+ `This is the console's first message to you, @${handle}: making your account ready to work. It is no task of a board, and you take none to begin: do what it lists in this session and the ones after, until nothing of it waits on anyone. It stays on your record, where \`console agent signals me --json\` reads it whole.`,
64
95
  "",
65
96
  "## What you do yourself",
66
97
  "",
@@ -68,13 +99,21 @@ export function onboardingOf(input: OnboardingInput): {
68
99
  "",
69
100
  "## What you ask for",
70
101
  "",
71
- `Do everything you can yourself, and ask for help only with what you cannot do. Ask for that as a decision, of whoever can do it, and of your manager where you do not know who. Say the exact values, what to hand back and how, and offer "Done" and "Not now": \`console ask "<question>" --option "Done" --option "Not now"\`. A secret that is handed back is seeded where only you read it, by whoever has it: \`console agent secret ${handle} <name>\`. Go on with the rest meanwhile: the answer wakes you.`,
102
+ asking,
72
103
  ...(asked.length === 0 ? [] : ["", ...asked]),
73
104
  "",
74
105
  "## When you are done",
75
106
  "",
76
- "When nothing of this task waits on anyone, every item set up or answered as not to be done now, report what is set up and, item by item, what is not done and who said so, and finish the task.",
107
+ "When nothing of this waits on anyone, every item set up or answered as not to be done now, say to your manager what is set up and, item by item, what is not done and who said so: on the messenger where you have one, else in your answer here. Finish the task you wrote for it, where you wrote one.",
77
108
  "",
78
109
  ].join("\n");
79
- return { title: onboardingTitle(handle), body };
110
+ // A signal is bounded where it is sent, and this one is sent by the console itself: words
111
+ // that names at the far end of what a workspace may hold would carry past the bound end at
112
+ // the last whole line within it, with a line that says so.
113
+ if (body.length <= MAX_SIGNAL_LENGTH) {
114
+ return { title, body };
115
+ }
116
+ const kept = body.slice(0, MAX_SIGNAL_LENGTH - CUT.length);
117
+ const whole = kept.lastIndexOf("\n");
118
+ return { title, body: `${kept.slice(0, whole < 0 ? kept.length : whole).trimEnd()}${CUT}` };
80
119
  }
@@ -43,6 +43,12 @@ export interface ArgDescription {
43
43
  readonly options?: readonly string[];
44
44
  /** The collection a `record` names an id of. */
45
45
  readonly collection?: string;
46
+ /**
47
+ * A `person` that may be anyone of the workspace (ADR-0185), for whoever holds a role the
48
+ * command names, by a grant of their own or by the reporting line, in a plugin that holds
49
+ * `people:read:all`; for everyone else, one the caller may see.
50
+ */
51
+ readonly anyone?: boolean;
46
52
  /** What each item of a `list` is. */
47
53
  readonly of?: ArgDescription;
48
54
  }
@@ -218,9 +224,29 @@ export const arg = {
218
224
  }
219
225
  return { type: "enum", ...common(options), options: [...values] };
220
226
  },
221
- /** A person: a login or `me` on the command line, resolved by the console to one the caller may see. */
222
- person<O extends boolean = false>(options?: CommonOptions<O>): ArgDefinition<PluginPersonRef, O> {
223
- return { type: "person", ...common(options) };
227
+ /**
228
+ * A person: a login or `me` on the command line, resolved by the console to one the caller may
229
+ * see (ADR-0035), and refused where it is none, in the same words whether nobody has the login
230
+ * or the caller may not see who has.
231
+ *
232
+ * `anyone: true` is for a command a role of the plugin works the whole directory with, an
233
+ * enrolment say (ADR-0185): the console then resolves the login among everyone of the
234
+ * workspace, where the plugin holds `people:read:all` and the caller holds a role the command
235
+ * names by more than every member does: granted to them by name, to a team they are in or to
236
+ * the members of a private project that lists them, held by the reporting line, or as an
237
+ * administrator. For anyone else it changes nothing: whoever runs the command by the default
238
+ * role, by a grant to everyone, or where the command names no roles, names whom they may see,
239
+ * so that no member learns by a refusal whether a login they may not see exists. A console
240
+ * older than 0.6.4 reads past the option and resolves in the caller's view.
241
+ */
242
+ person<O extends boolean = false>(
243
+ options?: CommonOptions<O> & { readonly anyone?: boolean },
244
+ ): ArgDefinition<PluginPersonRef, O> {
245
+ return {
246
+ type: "person",
247
+ ...common(options),
248
+ ...(options?.anyone === true ? { anyone: true } : {}),
249
+ };
224
250
  },
225
251
  /** A project: a key the caller may see. */
226
252
  project<O extends boolean = false>(
@@ -677,6 +677,7 @@ function describeArg(description: ArgDescription): ArgDescription {
677
677
  "integer",
678
678
  "options",
679
679
  "collection",
680
+ "anyone",
680
681
  ] as const) {
681
682
  if (description[field] !== undefined) {
682
683
  copy[field] = description[field];
@@ -784,9 +785,23 @@ export function descriptionProblems(
784
785
  undeclared(`the collection ${collection.name}'s read`, collection.read);
785
786
  undeclared(`the collection ${collection.name}'s readOwn`, collection.readOwn);
786
787
  }
787
- const checkArgs = (where: string, args: Readonly<Record<string, ArgDescription>>) => {
788
+ const checkArgs = (
789
+ where: string,
790
+ args: Readonly<Record<string, ArgDescription>>,
791
+ named: readonly string[] | null,
792
+ ) => {
788
793
  for (const [name, description] of Object.entries(args)) {
789
794
  const inner = description.type === "list" ? description.of : description;
795
+ // A person who may be anyone (ADR-0185) is one only for a role the operation names, in a
796
+ // plugin that holds the whole directory: said here, since elsewhere it changes nothing.
797
+ if (inner?.type === "person" && inner.anyone === true) {
798
+ needs(`${where}'s argument ${name}, a person who may be anyone,`, "people:read:all");
799
+ if (named === null) {
800
+ problems.push(
801
+ `${where}'s argument ${name} is a person who may be anyone, and ${where} names no roles: every member runs it, and names whom they may see`,
802
+ );
803
+ }
804
+ }
790
805
  if (
791
806
  inner?.type === "record" &&
792
807
  inner.collection !== undefined &&
@@ -803,11 +818,11 @@ export function descriptionProblems(
803
818
  };
804
819
  for (const [name, command] of Object.entries(description.commands)) {
805
820
  undeclared(`the command ${name}`, command.roles);
806
- checkArgs(`the command ${name}`, command.args);
821
+ checkArgs(`the command ${name}`, command.args, command.roles);
807
822
  }
808
823
  for (const [name, query] of Object.entries(description.queries)) {
809
824
  undeclared(`the query ${name}`, query.roles);
810
- checkArgs(`the query ${name}`, query.args);
825
+ checkArgs(`the query ${name}`, query.args, query.roles);
811
826
  }
812
827
  for (const [name, endpoint] of Object.entries(description.endpoints)) {
813
828
  needs(`the endpoint ${name}`, "endpoints");