@skillcdn/console 0.0.0-stage → 0.1.0

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 (128) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +79 -2
  3. package/dist/api.d.ts +7 -0
  4. package/dist/api.d.ts.map +1 -0
  5. package/dist/api.js +11 -0
  6. package/dist/api.js.map +1 -0
  7. package/dist/cli/cli.d.ts +32 -0
  8. package/dist/cli/cli.d.ts.map +1 -0
  9. package/dist/cli/cli.js +553 -0
  10. package/dist/cli/cli.js.map +1 -0
  11. package/dist/cli/credentials.d.ts +16 -0
  12. package/dist/cli/credentials.d.ts.map +1 -0
  13. package/dist/cli/credentials.js +46 -0
  14. package/dist/cli/credentials.js.map +1 -0
  15. package/dist/cli/format.d.ts +16 -0
  16. package/dist/cli/format.d.ts.map +1 -0
  17. package/dist/cli/format.js +151 -0
  18. package/dist/cli/format.js.map +1 -0
  19. package/dist/cli/help.d.ts +16 -0
  20. package/dist/cli/help.d.ts.map +1 -0
  21. package/dist/cli/help.js +180 -0
  22. package/dist/cli/help.js.map +1 -0
  23. package/dist/cli/main.d.ts +3 -0
  24. package/dist/cli/main.d.ts.map +1 -0
  25. package/dist/cli/main.js +25 -0
  26. package/dist/cli/main.js.map +1 -0
  27. package/dist/cli/terminal.d.ts +12 -0
  28. package/dist/cli/terminal.d.ts.map +1 -0
  29. package/dist/cli/terminal.js +68 -0
  30. package/dist/cli/terminal.js.map +1 -0
  31. package/dist/client.d.ts +92 -0
  32. package/dist/client.d.ts.map +1 -0
  33. package/dist/client.js +117 -0
  34. package/dist/client.js.map +1 -0
  35. package/dist/components/board.d.ts +20 -0
  36. package/dist/components/board.d.ts.map +1 -0
  37. package/dist/components/board.js +19 -0
  38. package/dist/components/board.js.map +1 -0
  39. package/dist/components/decision-form.d.ts +13 -0
  40. package/dist/components/decision-form.d.ts.map +1 -0
  41. package/dist/components/decision-form.js +23 -0
  42. package/dist/components/decision-form.js.map +1 -0
  43. package/dist/components/decision-list.d.ts +22 -0
  44. package/dist/components/decision-list.d.ts.map +1 -0
  45. package/dist/components/decision-list.js +28 -0
  46. package/dist/components/decision-list.js.map +1 -0
  47. package/dist/components/event-feed.d.ts +13 -0
  48. package/dist/components/event-feed.d.ts.map +1 -0
  49. package/dist/components/event-feed.js +59 -0
  50. package/dist/components/event-feed.js.map +1 -0
  51. package/dist/components/markdown.d.ts +4 -0
  52. package/dist/components/markdown.d.ts.map +1 -0
  53. package/dist/components/markdown.js +34 -0
  54. package/dist/components/markdown.js.map +1 -0
  55. package/dist/components/people.d.ts +11 -0
  56. package/dist/components/people.d.ts.map +1 -0
  57. package/dist/components/people.js +7 -0
  58. package/dist/components/people.js.map +1 -0
  59. package/dist/components/runs.d.ts +27 -0
  60. package/dist/components/runs.d.ts.map +1 -0
  61. package/dist/components/runs.js +45 -0
  62. package/dist/components/runs.js.map +1 -0
  63. package/dist/components/shell.d.ts +22 -0
  64. package/dist/components/shell.d.ts.map +1 -0
  65. package/dist/components/shell.js +16 -0
  66. package/dist/components/shell.js.map +1 -0
  67. package/dist/components/sign-in.d.ts +11 -0
  68. package/dist/components/sign-in.d.ts.map +1 -0
  69. package/dist/components/sign-in.js +15 -0
  70. package/dist/components/sign-in.js.map +1 -0
  71. package/dist/components/skills.d.ts +7 -0
  72. package/dist/components/skills.d.ts.map +1 -0
  73. package/dist/components/skills.js +26 -0
  74. package/dist/components/skills.js.map +1 -0
  75. package/dist/components/task-form.d.ts +14 -0
  76. package/dist/components/task-form.d.ts.map +1 -0
  77. package/dist/components/task-form.js +34 -0
  78. package/dist/components/task-form.js.map +1 -0
  79. package/dist/components/task-view.d.ts +22 -0
  80. package/dist/components/task-view.d.ts.map +1 -0
  81. package/dist/components/task-view.js +32 -0
  82. package/dist/components/task-view.js.map +1 -0
  83. package/dist/components/tokens.d.ts +26 -0
  84. package/dist/components/tokens.d.ts.map +1 -0
  85. package/dist/components/tokens.js +42 -0
  86. package/dist/components/tokens.js.map +1 -0
  87. package/dist/components/ui.d.ts +61 -0
  88. package/dist/components/ui.d.ts.map +1 -0
  89. package/dist/components/ui.js +109 -0
  90. package/dist/components/ui.js.map +1 -0
  91. package/dist/console.css +1382 -0
  92. package/dist/console.d.ts +44 -0
  93. package/dist/console.d.ts.map +1 -0
  94. package/dist/console.js +181 -0
  95. package/dist/console.js.map +1 -0
  96. package/dist/data.d.ts +41 -0
  97. package/dist/data.d.ts.map +1 -0
  98. package/dist/data.js +208 -0
  99. package/dist/data.js.map +1 -0
  100. package/dist/index.d.ts +19 -0
  101. package/dist/index.d.ts.map +1 -0
  102. package/dist/index.js +23 -0
  103. package/dist/index.js.map +1 -0
  104. package/dist/limits.d.ts +37 -0
  105. package/dist/limits.d.ts.map +1 -0
  106. package/dist/limits.js +40 -0
  107. package/dist/limits.js.map +1 -0
  108. package/dist/router.d.ts +37 -0
  109. package/dist/router.d.ts.map +1 -0
  110. package/dist/router.js +55 -0
  111. package/dist/router.js.map +1 -0
  112. package/dist/routes.d.ts +47 -0
  113. package/dist/routes.d.ts.map +1 -0
  114. package/dist/routes.js +53 -0
  115. package/dist/routes.js.map +1 -0
  116. package/dist/schemas.d.ts +789 -0
  117. package/dist/schemas.d.ts.map +1 -0
  118. package/dist/schemas.js +341 -0
  119. package/dist/schemas.js.map +1 -0
  120. package/dist/text.d.ts +6 -0
  121. package/dist/text.d.ts.map +1 -0
  122. package/dist/text.js +31 -0
  123. package/dist/text.js.map +1 -0
  124. package/dist/vocabulary.d.ts +35 -0
  125. package/dist/vocabulary.d.ts.map +1 -0
  126. package/dist/vocabulary.js +57 -0
  127. package/dist/vocabulary.js.map +1 -0
  128. package/package.json +70 -3
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KDX Labs Corp.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,80 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <a href="https://skillcdn.ai"><img alt="SkillCDN" src="https://raw.githubusercontent.com/skillcdn/skillcdn/main/apps/web/public/brand/symbol.svg" width="72"></a>
3
+ </p>
4
+ <h1 align="center">@skillcdn/console</h1>
5
+ <p align="center">What a custom SkillCDN console is built from: the API client and schemas, the components, the composition of the default console, and the <code>console</code> command agents work the board with.</p>
6
+ <p align="center">
7
+ <a href="https://github.com/skillcdn/console/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/skillcdn/console/actions/workflows/ci.yml/badge.svg?branch=main"></a>
8
+ <a href="https://github.com/skillcdn/console/blob/main/LICENSE.md"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-3a6dd4"></a>
9
+ </p>
2
10
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
11
+ **Pre-1.0.** Published from `main` by the release workflow, from changesets, through the registry's trusted publishing; the version's major and minor are those of the `@skillcdn/core` line the console is built on, its patch the console's own, and the changelog says what each release changed ([ADR-0007](https://github.com/skillcdn/console/blob/main/docs/adr/0007-the-package-is-published-through-trusted-publishing-and-versioned-on-the-core-line.md)). All three layers are here, and the command: the contract of the REST API, the components, the composition of the default console, and `console`, what an agent works the board with.
12
+
13
+ ## What it exports
14
+
15
+ | Layer | What it is for | Status |
16
+ |---|---|---|
17
+ | The schemas and the client of the console's REST API | A custom UI talks to any console with types, and the contract has one source, shared with the server in `apps/console`. Also on its own at `@skillcdn/console/api`, which brings no React with it. | exported |
18
+ | The `console` command | The agent's side of the console: a thin client of the REST API, shipped as the package's `bin`, which a person signs in once with a token. Also as a function at `@skillcdn/console/cli`. | exported |
19
+ | The components: the board, a task, a run, a decision, the live feed | Each takes its data as props and nothing from the network. | exported |
20
+ | `createConsole(config)` | The default console assembled from the components, with the places a team may replace named. The UI the image serves is this, with the default configuration. | exported |
21
+
22
+ ### The API layer
23
+
24
+ ```ts
25
+ import { createClient, restTaskSchema, TASK_STATES } from "@skillcdn/console/api";
26
+
27
+ const client = createClient({ baseUrl: "https://console.example" }); // the page's own origin when left out
28
+ const { items } = await client.tasks({ state: "ready" });
29
+ ```
30
+
31
+ - **The vocabulary:** `TASK_STATES`, `TASK_PRIORITIES`, `RUN_STATUSES`, `EVENT_KINDS`, with their types. One source for the database's constraints, the schemas and the board.
32
+ - **The bounds** every input is held to (`MAX_TITLE_LENGTH`, `MAX_BODY_LENGTH`, `MAX_OPTIONS`, ...), so that a page can say so before a request is made.
33
+ - **The routes:** `REST_ROUTES`, `AUTH_ROUTES`, and the helpers that build a path (`restPath`, `loginPath`, `signInPath`). The API itself is described in [docs/specs/rest.md](https://github.com/skillcdn/console/blob/main/docs/specs/rest.md).
34
+ - **The schemas,** in the mini build of zod, which runs in a browser: what the server answers (`restTaskSchema`, `restDecisionSchema`, `restEventSchema`, `restMeSchema`, ...) and what it is sent (`restTaskInputSchema`, `restTaskPatchSchema`, `restDecisionInputSchema`, `restAnswerInputSchema`). Absent values are `null` on the wire, never missing keys. The server validates with the input schemas and is tested against the others.
35
+ - **The client:** `createClient({ baseUrl, fetch })` answers typed values parsed with those schemas, and throws an `ApiError` with the server's stable `code` (or `network`, `invalid_response`) for anything else. It takes a `fetch` and reads nothing else. With `token`, a token a person made on their Tokens page, every request carries `Authorization: Bearer` and no cookie: how a script or a console of a person's own acts as that person. An `EventSource` cannot carry a header, so a stream read with a token is a `fetch` of `eventStreamUrl(after)`. `handInFile` sends a file as a form, and `fileUrl` says where its bytes are read back. `skills()` reads the organization's skills as the console serves them by address.
36
+
37
+ ### The command line
38
+
39
+ ```sh
40
+ npm install -g @skillcdn/console # where the agent runs, once the package is published
41
+ console login --url https://console.example # asks for a token made on the Tokens page, and keeps it
42
+ console take 7 # a run begins on task #7, for the person the token is
43
+ console report "Found the cause: the parser trusts its input."
44
+ console hand-in ./report.md --label "the report" # a file the console keeps, or an https link
45
+ console skills # the organization's skills, with the URI to load each by
46
+ console ask "Keep the old behaviour?" --option "Keep it" --option "Change it"
47
+ console finish --summary "Done: the parser refuses empty input."
48
+ ```
49
+
50
+ - **`console`** is the agent's side of the console ([docs/specs/cli.md](https://github.com/skillcdn/console/blob/main/docs/specs/cli.md)): a thin client of the REST API with no logic of its own, no dependencies beyond the package's, and no cost to an agent until it is used. `console help` says everything an agent needs; `--json` answers with the console's own JSON; the exit code says whether the console did it (`0`), refused or could not be reached (`1`), did not understand (`2`), or a decision still waits (`3`).
51
+ - **A person signs it in once:** `login` checks the token against the console and keeps it, with the console's address, in `$XDG_CONFIG_HOME/skillcdn-console/credentials.json` (`~/.config` when unset). `CONSOLE_URL` and `CONSOLE_TOKEN` in the environment win over the file, for a hook or a job. A token is never taken on the command line.
52
+ - **`@skillcdn/console/cli`** exports `runCli(argv, io)`, the command as a function that takes its environment, its streams, its `fetch` and its credential store: what the integration tests run against the app with no socket, and what a console of a person's own could embed.
53
+
54
+ ### The components and the composition
55
+
56
+ ```tsx
57
+ import { createConsole } from "@skillcdn/console";
58
+ import "@skillcdn/console/console.css";
59
+
60
+ createConsole({
61
+ title: "Acme", // until the server says what the board is called
62
+ components: { SignIn: MySignIn }, // any of Shell, Board, TaskView, DecisionList, EventFeed, SignIn, TokenList, PeopleList, SkillList
63
+ }).mount(document.getElementById("root"));
64
+ ```
65
+
66
+ - **The components** take their data as props and nothing from the network: `Board` (one column per state), `TaskCard`, `TaskView` (one task with its decisions and its parts), `TaskForm`, `DecisionList` and `DecisionCard` (the waiting first, each with the way to answer), `DecisionForm`, `EventFeed` (a sentence per event, newest first; `describeEvent` makes the sentence), `Shell` (the header with the pages and the person), `SignIn` (one button per provider the deployment offers), `TokenList`, `TokenForm` and `NewToken` (the tokens a person holds, the way to make one, and the one just made with its secret shown once), `PeopleList` (everyone, with what each is, and the way for an administrator to change it), `SkillList` (the organization's skills as SkillCDN serves them at the console's address, each with where a person reads it and what an agent loads it by), `RunList` and `RunCard` (an agent at work on a task: what it reported, what it handed in, links and files alike, what it waits for; `RunStatusBadge` and `RUN_STATUS_LABELS` with them, and `fileHref` for a console served from another origin than its API), and `Markdown`, which renders what people and agents wrote as elements, never as HTML, with links to the web only and pictures over https only. The small blocks (`Button`, `Badge`, `Avatar`, `PersonChip`, `Callout`, `EmptyState`, `Spinner`, `Time`) and the words of the vocabulary (`STATE_LABELS`, `PRIORITY_LABELS`, `ROLE_LABELS`, with `RoleBadge`) are exported too.
67
+ - **The composition:** `createConsole(config)` returns `{ App, mount }`. `App` is the whole console as one component; `mount(container)` renders it and returns the way to take it down. `config.baseUrl` is the origin of the API (the page's own when left out), `config.components` the pieces to replace (`ConsoleComponents` names them with the props each takes), `config.client` a client of your own, for tests. The pages route in the browser (`matchRoute`, `PATHS`, `taskHref`); the data is loaded whole and kept current by the server's stream (`useConsoleData`, for a composition of your own).
68
+ - **The styles** are one file, `@skillcdn/console/console.css`: the tokens (`--sc-*`), a small reset, and one class per block, all prefixed `sc-`. Re-skinning starts and mostly ends with the tokens.
69
+ - React 19 is a peer dependency; `react-markdown` and `remark-gfm` are the package's own.
70
+
71
+ A custom console is a small repository that depends on this package, holds a configuration and a CI job, and builds to static files served next to any console API, or into an image of its own. Nothing of the server is in the package.
72
+
73
+ ## Rules
74
+
75
+ Read the root [`AGENTS.md`](../../AGENTS.md) first. This package is what other people install; it is their contract.
76
+
77
+ - **Pure where it can be.** The schemas and the components do no I/O; the client takes a `fetch` and a base URL; the command takes everything it needs through `runCli`. Nothing here reads the environment but the command's entry point, `src/cli/main.ts`, the one place the process is read (lint enforces it).
78
+ - **The main repository's packages come from npm,** by version: `@skillcdn/core` for addresses and the REST schemas of a SkillCDN deployment. Never a path into the main repository, never a copy of its code ([ADR-0001](../../docs/adr/0001-the-console-is-the-reference-console-built-on-the-published-packages.md)).
79
+ - **Exported types are public contract.** A change to what `src/index.ts` exports carries a changeset written for whoever installs the package, and the README changes with the usage.
80
+ - **Runtime dependencies need a reason.** This package ships to browsers; a dependency here needs a stronger case than anywhere else in the repository.
package/dist/api.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { ApiError, type ClientOptions, type ConsoleClient, createClient, type FetchLike, type FileUpload, } from "./client.js";
2
+ export { DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MIN_OPTIONS, } from "./limits.js";
3
+ export { AUTH_ROUTES, isSignInFailure, loginPath, REST_ROUTES, RETURN_TO_PARAM, restPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, type SignInFailure, signInPath, } from "./routes.js";
4
+ export { type RestAnswerInput, type RestArtifact, type RestArtifactInput, type RestDecision, type RestDecisionInput, type RestDecisionOption, type RestDecisions, type RestError, type RestEvent, type RestEventData, type RestEvents, type RestFile, type RestFileInput, type RestMe, type RestPeople, type RestPerson, type RestPersonPatch, type RestProvider, type RestReport, type RestReportInput, type RestRun, type RestRunEndInput, type RestRunInput, type RestRuns, type RestSkill, type RestSkills, type RestTask, type RestTaskInput, type RestTaskLink, type RestTaskPatch, type RestTasks, type RestToken, type RestTokenCreated, type RestTokenInput, type RestTokens, restAnswerInputSchema, restArtifactInputSchema, restArtifactSchema, restDecisionInputSchema, restDecisionOptionSchema, restDecisionSchema, restDecisionsSchema, restErrorSchema, restEventDataSchema, restEventSchema, restEventsSchema, restFileInputSchema, restFileSchema, restMeSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, } from "./schemas.js";
5
+ export { hasForbiddenCodePoint } from "./text.js";
6
+ export { ARTIFACT_KINDS, type ArtifactKind, EVENT_KINDS, type EventKind, isProviderKey, PERSON_ROLES, type PersonRole, PROVIDER_KEYS, type ProviderKey, RUN_ENDINGS, RUN_STATUSES, type RunEnding, type RunStatus, SKILLS_STATUSES, type SkillsStatus, TASK_PRIORITIES, TASK_STATES, type TaskPriority, type TaskState, } from "./vocabulary.js";
7
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;A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BAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EACd,KAAK,YAAY,EACjB,WAAW,EACX,KAAK,SAAS,EACd,aAAa,EACb,YAAY,EACZ,KAAK,UAAU,EACf,aAAa,EACb,KAAK,WAAW,EAChB,WAAW,EACX,YAAY,EACZ,KAAK,SAAS,EACd,KAAK,SAAS,EACd,eAAe,EACf,KAAK,YAAY,EACjB,eAAe,EACf,WAAW,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,GACf,MAAM,iBAAiB,CAAC"}
package/dist/api.js ADDED
@@ -0,0 +1,11 @@
1
+ // The first layer of @skillcdn/console (docs/architecture.md, "The package and custom
2
+ // consoles"): the vocabulary, the schemas and the client of the console's REST API, so that a
3
+ // custom UI talks to any console with types, and so that the contract has one source. No React
4
+ // here: the server and the command line import this entry point, and nothing of the pages.
5
+ export { ApiError, createClient, } from "./client.js";
6
+ export { DEFAULT_TOKEN_DAYS, EVENTS_PAGE_LIMIT, LIST_LIMIT, MAX_AGENT_LENGTH, MAX_ARTIFACTS_PER_RUN, MAX_BODY_LENGTH, MAX_FILE_BYTES, MAX_FILE_NAME_LENGTH, MAX_LINK_LABEL_LENGTH, MAX_LINKS, MAX_NOTE_LENGTH, MAX_OPTION_LABEL_LENGTH, MAX_OPTIONS, MAX_QUESTION_LENGTH, MAX_REPORTS_PER_RUN, MAX_SUMMARY_LENGTH, MAX_TITLE_LENGTH, MAX_TOKEN_DAYS, MAX_TOKEN_NAME_LENGTH, MAX_TOKENS_PER_PERSON, MAX_URL_LENGTH, MIN_OPTIONS, } from "./limits.js";
7
+ export { AUTH_ROUTES, isSignInFailure, loginPath, REST_ROUTES, RETURN_TO_PARAM, restPath, SIGN_IN_FAILURES, SIGN_IN_PARAM, signInPath, } from "./routes.js";
8
+ export { restAnswerInputSchema, restArtifactInputSchema, restArtifactSchema, restDecisionInputSchema, restDecisionOptionSchema, restDecisionSchema, restDecisionsSchema, restErrorSchema, restEventDataSchema, restEventSchema, restEventsSchema, restFileInputSchema, restFileSchema, restMeSchema, restPeopleSchema, restPersonPatchSchema, restPersonSchema, restProviderSchema, restReportInputSchema, restReportSchema, restRunEndInputSchema, restRunInputSchema, restRunSchema, restRunsSchema, restSkillSchema, restSkillsSchema, restTaskInputSchema, restTaskLinkSchema, restTaskPatchSchema, restTaskSchema, restTasksSchema, restTokenCreatedSchema, restTokenInputSchema, restTokenSchema, restTokensSchema, } from "./schemas.js";
9
+ export { hasForbiddenCodePoint } from "./text.js";
10
+ export { ARTIFACT_KINDS, EVENT_KINDS, isProviderKey, PERSON_ROLES, PROVIDER_KEYS, RUN_ENDINGS, RUN_STATUSES, SKILLS_STATUSES, TASK_PRIORITIES, TASK_STATES, } from "./vocabulary.js";
11
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,8FAA8F;AAC9F,+FAA+F;AAC/F,2FAA2F;AAE3F,OAAO,EACL,QAAQ,EAGR,YAAY,GAGb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,cAAc,EACd,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,eAAe,EACf,SAAS,EACT,WAAW,EACX,eAAe,EACf,QAAQ,EACR,gBAAgB,EAChB,aAAa,EAEb,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAoCL,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GACjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EACL,cAAc,EAEd,WAAW,EAEX,aAAa,EACb,YAAY,EAEZ,aAAa,EAEb,WAAW,EACX,YAAY,EAGZ,eAAe,EAEf,eAAe,EACf,WAAW,GAGZ,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { type FetchLike } from "../client.js";
2
+ import type { CredentialStore } from "./credentials.js";
3
+ /** The exit codes of the command, for whoever runs it: a shell, a hook, an agent. */
4
+ export declare const EXIT: {
5
+ readonly ok: 0;
6
+ /** The console refused, or could not be reached; the reason is on stderr. */
7
+ readonly failed: 1;
8
+ /** The command was not understood. */
9
+ readonly usage: 2;
10
+ /** The decision still waits for a person. */
11
+ readonly waiting: 3;
12
+ };
13
+ export interface CliIo {
14
+ readonly env: Readonly<Record<string, string | undefined>>;
15
+ readonly stdout: (text: string) => void;
16
+ readonly stderr: (text: string) => void;
17
+ readonly fetch: FetchLike;
18
+ /** All of standard input, for a body given as `-`. */
19
+ readonly readStdin: () => Promise<string>;
20
+ /** A secret typed at the terminal without echo, or read from standard input. */
21
+ readonly readSecret: (prompt: string) => Promise<string>;
22
+ /** A file named with `--file`, as text. */
23
+ readonly readFile: (path: string) => Promise<string>;
24
+ /** A file handed in, as bytes. */
25
+ readonly readBytes: (path: string) => Promise<Uint8Array>;
26
+ readonly store: CredentialStore;
27
+ readonly sleep: (ms: number) => Promise<void>;
28
+ readonly now: () => number;
29
+ }
30
+ /** Runs the command and answers with its exit code. What it prints goes through `io`. */
31
+ export declare function runCli(argv: readonly string[], io: CliIo): Promise<number>;
32
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8C,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAmBxD,qFAAqF;AACrF,eAAO,MAAM,IAAI;aACf,EAAE,EAAE,CAAC;IACL,6EAA6E;aAC7E,MAAM,EAAE,CAAC;IACT,sCAAsC;aACtC,KAAK,EAAE,CAAC;IACR,6CAA6C;aAC7C,OAAO,EAAE,CAAC;CACF,CAAC;AAWX,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,QAAQ,C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