@skillcdn/console 0.0.0-stage → 0.1.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.
- package/LICENSE.md +21 -0
- package/README.md +79 -2
- package/dist/api.d.ts +7 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +11 -0
- package/dist/api.js.map +1 -0
- package/dist/cli/cli.d.ts +34 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +557 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/credentials.d.ts +16 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +46 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/format.d.ts +16 -0
- package/dist/cli/format.d.ts.map +1 -0
- package/dist/cli/format.js +151 -0
- package/dist/cli/format.js.map +1 -0
- package/dist/cli/help.d.ts +16 -0
- package/dist/cli/help.d.ts.map +1 -0
- package/dist/cli/help.js +181 -0
- package/dist/cli/help.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +32 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/terminal.d.ts +12 -0
- package/dist/cli/terminal.d.ts.map +1 -0
- package/dist/cli/terminal.js +68 -0
- package/dist/cli/terminal.js.map +1 -0
- package/dist/client.d.ts +92 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +117 -0
- package/dist/client.js.map +1 -0
- package/dist/components/board.d.ts +20 -0
- package/dist/components/board.d.ts.map +1 -0
- package/dist/components/board.js +19 -0
- package/dist/components/board.js.map +1 -0
- package/dist/components/decision-form.d.ts +13 -0
- package/dist/components/decision-form.d.ts.map +1 -0
- package/dist/components/decision-form.js +23 -0
- package/dist/components/decision-form.js.map +1 -0
- package/dist/components/decision-list.d.ts +22 -0
- package/dist/components/decision-list.d.ts.map +1 -0
- package/dist/components/decision-list.js +28 -0
- package/dist/components/decision-list.js.map +1 -0
- package/dist/components/event-feed.d.ts +13 -0
- package/dist/components/event-feed.d.ts.map +1 -0
- package/dist/components/event-feed.js +59 -0
- package/dist/components/event-feed.js.map +1 -0
- package/dist/components/markdown.d.ts +4 -0
- package/dist/components/markdown.d.ts.map +1 -0
- package/dist/components/markdown.js +34 -0
- package/dist/components/markdown.js.map +1 -0
- package/dist/components/people.d.ts +11 -0
- package/dist/components/people.d.ts.map +1 -0
- package/dist/components/people.js +7 -0
- package/dist/components/people.js.map +1 -0
- package/dist/components/runs.d.ts +27 -0
- package/dist/components/runs.d.ts.map +1 -0
- package/dist/components/runs.js +45 -0
- package/dist/components/runs.js.map +1 -0
- package/dist/components/shell.d.ts +22 -0
- package/dist/components/shell.d.ts.map +1 -0
- package/dist/components/shell.js +16 -0
- package/dist/components/shell.js.map +1 -0
- package/dist/components/sign-in.d.ts +11 -0
- package/dist/components/sign-in.d.ts.map +1 -0
- package/dist/components/sign-in.js +15 -0
- package/dist/components/sign-in.js.map +1 -0
- package/dist/components/skills.d.ts +7 -0
- package/dist/components/skills.d.ts.map +1 -0
- package/dist/components/skills.js +26 -0
- package/dist/components/skills.js.map +1 -0
- package/dist/components/task-form.d.ts +14 -0
- package/dist/components/task-form.d.ts.map +1 -0
- package/dist/components/task-form.js +34 -0
- package/dist/components/task-form.js.map +1 -0
- package/dist/components/task-view.d.ts +22 -0
- package/dist/components/task-view.d.ts.map +1 -0
- package/dist/components/task-view.js +32 -0
- package/dist/components/task-view.js.map +1 -0
- package/dist/components/tokens.d.ts +26 -0
- package/dist/components/tokens.d.ts.map +1 -0
- package/dist/components/tokens.js +42 -0
- package/dist/components/tokens.js.map +1 -0
- package/dist/components/ui.d.ts +61 -0
- package/dist/components/ui.d.ts.map +1 -0
- package/dist/components/ui.js +109 -0
- package/dist/components/ui.js.map +1 -0
- package/dist/console.css +1382 -0
- package/dist/console.d.ts +44 -0
- package/dist/console.d.ts.map +1 -0
- package/dist/console.js +181 -0
- package/dist/console.js.map +1 -0
- package/dist/data.d.ts +41 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/data.js +208 -0
- package/dist/data.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/limits.d.ts +37 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +40 -0
- package/dist/limits.js.map +1 -0
- package/dist/router.d.ts +37 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +55 -0
- package/dist/router.js.map +1 -0
- package/dist/routes.d.ts +47 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +53 -0
- package/dist/routes.js.map +1 -0
- package/dist/schemas.d.ts +789 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +341 -0
- package/dist/schemas.js.map +1 -0
- package/dist/text.d.ts +6 -0
- package/dist/text.d.ts.map +1 -0
- package/dist/text.js +31 -0
- package/dist/text.js.map +1 -0
- package/dist/vocabulary.d.ts +35 -0
- package/dist/vocabulary.d.ts.map +1 -0
- package/dist/vocabulary.js +57 -0
- package/dist/vocabulary.js.map +1 -0
- package/package.json +70 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAIA,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,MAAM,CAAC;AACpC,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,kEAAkE;AAClE,eAAO,MAAM,eAAe,QAAS,CAAC;AACtC,qEAAqE;AACrE,eAAO,MAAM,SAAS,KAAK,CAAC;AAC5B,eAAO,MAAM,qBAAqB,MAAM,CAAC;AACzC,eAAO,MAAM,cAAc,OAAO,CAAC;AACnC,8DAA8D;AAC9D,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,WAAW,KAAK,CAAC;AAC9B,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,uCAAuC;AACvC,eAAO,MAAM,eAAe,OAAO,CAAC;AACpC,4FAA4F;AAC5F,eAAO,MAAM,UAAU,MAAM,CAAC;AAC9B,oDAAoD;AACpD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AACrC,0FAA0F;AAC1F,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,uDAAuD;AACvD,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,mEAAmE;AACnE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AACvC,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,oFAAoF;AACpF,eAAO,MAAM,cAAc,QAAmB,CAAC;AAC/C,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,iFAAiF;AACjF,eAAO,MAAM,qBAAqB,KAAK,CAAC;AACxC,2FAA2F;AAC3F,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,qDAAqD;AACrD,eAAO,MAAM,qBAAqB,KAAK,CAAC"}
|
package/dist/limits.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// How much of anything the console takes in. Every text a person or an agent writes is bounded
|
|
2
|
+
// at the edge (AGENTS.md, rule 2); these are the bounds, shared by the server that enforces them
|
|
3
|
+
// and the pages that say so before a request is made.
|
|
4
|
+
/** A task's title, a decision's question: one line. */
|
|
5
|
+
export const MAX_TITLE_LENGTH = 200;
|
|
6
|
+
export const MAX_QUESTION_LENGTH = 500;
|
|
7
|
+
/** A body in Markdown: a task's, or the context of a decision. */
|
|
8
|
+
export const MAX_BODY_LENGTH = 20_000;
|
|
9
|
+
/** The links of a task: a repository, a pull request, a document. */
|
|
10
|
+
export const MAX_LINKS = 20;
|
|
11
|
+
export const MAX_LINK_LABEL_LENGTH = 120;
|
|
12
|
+
export const MAX_URL_LENGTH = 2048;
|
|
13
|
+
/** The options of a decision, and how a person words each. */
|
|
14
|
+
export const MIN_OPTIONS = 2;
|
|
15
|
+
export const MAX_OPTIONS = 10;
|
|
16
|
+
export const MAX_OPTION_LABEL_LENGTH = 120;
|
|
17
|
+
/** What a person adds to an answer. */
|
|
18
|
+
export const MAX_NOTE_LENGTH = 2000;
|
|
19
|
+
/** How many tasks or decisions one listing answers with. A board is read whole, for now. */
|
|
20
|
+
export const LIST_LIMIT = 500;
|
|
21
|
+
/** How many events one page of the feed carries. */
|
|
22
|
+
export const EVENTS_PAGE_LIMIT = 100;
|
|
23
|
+
/** What an agent calls itself when it takes a task: its kind, where it runs. One line. */
|
|
24
|
+
export const MAX_AGENT_LENGTH = 80;
|
|
25
|
+
/** What an agent says when it ends a run. Markdown. */
|
|
26
|
+
export const MAX_SUMMARY_LENGTH = 2000;
|
|
27
|
+
/** How many reports, and how many artifacts, one run may carry. */
|
|
28
|
+
export const MAX_REPORTS_PER_RUN = 500;
|
|
29
|
+
export const MAX_ARTIFACTS_PER_RUN = 50;
|
|
30
|
+
/** A file a run hands in: how many bytes, and its name, one line without a path. */
|
|
31
|
+
export const MAX_FILE_BYTES = 10 * 1024 * 1024;
|
|
32
|
+
export const MAX_FILE_NAME_LENGTH = 200;
|
|
33
|
+
/** What a person calls a token: the agent it is for, where it runs. One line. */
|
|
34
|
+
export const MAX_TOKEN_NAME_LENGTH = 80;
|
|
35
|
+
/** How long a token may be good for, in days, and how long one is when nothing is said. */
|
|
36
|
+
export const MAX_TOKEN_DAYS = 365;
|
|
37
|
+
export const DEFAULT_TOKEN_DAYS = 90;
|
|
38
|
+
/** How many tokens one person may hold at a time. */
|
|
39
|
+
export const MAX_TOKENS_PER_PERSON = 25;
|
|
40
|
+
//# sourceMappingURL=limits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limits.js","sourceRoot":"","sources":["../src/limits.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,iGAAiG;AACjG,sDAAsD;AAEtD,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM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B,GAAG,EAAE,CAAC"}
|
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type SignInFailure } from "./api.js";
|
|
2
|
+
export type Route = {
|
|
3
|
+
readonly name: "board";
|
|
4
|
+
} | {
|
|
5
|
+
readonly name: "task";
|
|
6
|
+
readonly id: string;
|
|
7
|
+
} | {
|
|
8
|
+
readonly name: "decisions";
|
|
9
|
+
} | {
|
|
10
|
+
readonly name: "feed";
|
|
11
|
+
} | {
|
|
12
|
+
readonly name: "skills";
|
|
13
|
+
} | {
|
|
14
|
+
readonly name: "tokens";
|
|
15
|
+
} | {
|
|
16
|
+
readonly name: "people";
|
|
17
|
+
} | {
|
|
18
|
+
readonly name: "not-found";
|
|
19
|
+
};
|
|
20
|
+
export declare const PATHS: {
|
|
21
|
+
readonly board: "/";
|
|
22
|
+
readonly tasks: "/tasks";
|
|
23
|
+
readonly decisions: "/decisions";
|
|
24
|
+
readonly feed: "/feed";
|
|
25
|
+
/** The organization's skills, as SkillCDN serves them. */
|
|
26
|
+
readonly skills: "/skills";
|
|
27
|
+
/** The tokens of whoever is signed in: their own page. */
|
|
28
|
+
readonly tokens: "/tokens";
|
|
29
|
+
readonly people: "/people";
|
|
30
|
+
};
|
|
31
|
+
export declare function matchRoute(pathname: string): Route;
|
|
32
|
+
export declare function taskHref(id: string): string;
|
|
33
|
+
/** Why the last sign-in did not complete, as the page's URL says it, or nothing. */
|
|
34
|
+
export declare function signInFailureOf(search: string): SignInFailure | undefined;
|
|
35
|
+
/** The URL without the sign-in parameter, once the page has read it. */
|
|
36
|
+
export declare function withoutSignInParam(pathname: string, search: string): string;
|
|
37
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9E,MAAM,MAAM,KAAK,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
decisions: "/decisions",
|
|
6
|
+
feed: "/feed",
|
|
7
|
+
/** The organization's skills, as SkillCDN serves them. */
|
|
8
|
+
skills: "/skills",
|
|
9
|
+
/** The tokens of whoever is signed in: their own page. */
|
|
10
|
+
tokens: "/tokens",
|
|
11
|
+
people: "/people",
|
|
12
|
+
};
|
|
13
|
+
const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
14
|
+
export function matchRoute(pathname) {
|
|
15
|
+
const path = pathname.length > 1 ? pathname.replace(/\/+$/, "") : pathname;
|
|
16
|
+
if (path === PATHS.board) {
|
|
17
|
+
return { name: "board" };
|
|
18
|
+
}
|
|
19
|
+
if (path === PATHS.decisions) {
|
|
20
|
+
return { name: "decisions" };
|
|
21
|
+
}
|
|
22
|
+
if (path === PATHS.feed) {
|
|
23
|
+
return { name: "feed" };
|
|
24
|
+
}
|
|
25
|
+
if (path === PATHS.skills) {
|
|
26
|
+
return { name: "skills" };
|
|
27
|
+
}
|
|
28
|
+
if (path === PATHS.tokens) {
|
|
29
|
+
return { name: "tokens" };
|
|
30
|
+
}
|
|
31
|
+
if (path === PATHS.people) {
|
|
32
|
+
return { name: "people" };
|
|
33
|
+
}
|
|
34
|
+
if (path.startsWith(`${PATHS.tasks}/`)) {
|
|
35
|
+
const id = path.slice(PATHS.tasks.length + 1);
|
|
36
|
+
return UUID.test(id) ? { name: "task", id } : { name: "not-found" };
|
|
37
|
+
}
|
|
38
|
+
return { name: "not-found" };
|
|
39
|
+
}
|
|
40
|
+
export function taskHref(id) {
|
|
41
|
+
return `${PATHS.tasks}/${id}`;
|
|
42
|
+
}
|
|
43
|
+
/** Why the last sign-in did not complete, as the page's URL says it, or nothing. */
|
|
44
|
+
export function signInFailureOf(search) {
|
|
45
|
+
const value = new URLSearchParams(search).get(SIGN_IN_PARAM);
|
|
46
|
+
return isSignInFailure(value) ? value : undefined;
|
|
47
|
+
}
|
|
48
|
+
/** The URL without the sign-in parameter, once the page has read it. */
|
|
49
|
+
export function withoutSignInParam(pathname, search) {
|
|
50
|
+
const params = new URLSearchParams(search);
|
|
51
|
+
params.delete(SIGN_IN_PARAM);
|
|
52
|
+
const query = params.toString();
|
|
53
|
+
return query.length === 0 ? pathname : `${pathname}?${query}`;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAsB,MAAM,UAAU,CAAC;AAc9E,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,YAAY;IACvB,IAAI,EAAE,OAAO;IACb,0DAA0D;IAC1D,MAAM,EAAE,SAAS;IACjB,0DAA0D;IAC1D,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,SAAS;CACT,CAAC;AAEX,MAAM,IAAI,GAAG,iEAAiE,CAAC;AAE/E,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3E,IAAI,IAAI,KAAK,KAAK,CAAC,KAAK,EAAE,CAAC;QACzB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3B,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,CAAC,SAAS,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IAC/B,CAAC;IACD,IAAI,IAAI,KAAK,KAAK,CAAC,IAAI,EAAE,CAAC;QACxB,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,IA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AC;IAC3C,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC;AAChE,CAAC"}
|
package/dist/routes.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ProviderKey } from "./vocabulary.js";
|
|
2
|
+
/** One prefix per resource; an id follows where one is needed. */
|
|
3
|
+
export declare const REST_ROUTES: {
|
|
4
|
+
/** Who is signed in, what the workspace is called, and whether anyone can sign in. */
|
|
5
|
+
readonly me: "/api/v1/me";
|
|
6
|
+
/** The people of the workspace: everyone who has signed in. */
|
|
7
|
+
readonly people: "/api/v1/people";
|
|
8
|
+
readonly tasks: "/api/v1/tasks";
|
|
9
|
+
readonly decisions: "/api/v1/decisions";
|
|
10
|
+
/** The feed, from a point on; and `/stream` under it, the same as it happens. */
|
|
11
|
+
readonly events: "/api/v1/events";
|
|
12
|
+
/** The tokens of whoever asks: what their agents, scripts and consoles act as them with. */
|
|
13
|
+
readonly tokens: "/api/v1/tokens";
|
|
14
|
+
/** The runs: agents at work, and what they did. */
|
|
15
|
+
readonly runs: "/api/v1/runs";
|
|
16
|
+
/** The bytes of a file a run handed in: `/api/v1/files/<artifact id>`. */
|
|
17
|
+
readonly files: "/api/v1/files";
|
|
18
|
+
/** The organization's skills, as SkillCDN serves them at the console's address. */
|
|
19
|
+
readonly skills: "/api/v1/skills";
|
|
20
|
+
};
|
|
21
|
+
/** Where a browser signs in and out. Signing in is per provider: `/auth/<provider>/...`. */
|
|
22
|
+
export declare const AUTH_ROUTES: {
|
|
23
|
+
/** Sends the browser to the provider to sign in, and afterwards to `return_to`. */
|
|
24
|
+
readonly login: (provider: ProviderKey) => string;
|
|
25
|
+
/** Where the provider sends the browser back to. */
|
|
26
|
+
readonly callback: (provider: ProviderKey) => string;
|
|
27
|
+
/** A POST from the pages that ends the session. */
|
|
28
|
+
readonly logout: "/auth/logout";
|
|
29
|
+
};
|
|
30
|
+
/** The parameter of the login route naming the page to come back to: a path of this origin. */
|
|
31
|
+
export declare const RETURN_TO_PARAM = "return_to";
|
|
32
|
+
/**
|
|
33
|
+
* The parameter by which the server tells a page that a sign-in did not complete: the person
|
|
34
|
+
* said no at the provider, the attempt was not finished in time or in the browser that began
|
|
35
|
+
* it, the provider did not confirm it, or the account is not a member of the workspace.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SIGN_IN_PARAM = "sign_in";
|
|
38
|
+
export declare const SIGN_IN_FAILURES: readonly ["denied", "expired", "failed", "refused"];
|
|
39
|
+
export type SignInFailure = (typeof SIGN_IN_FAILURES)[number];
|
|
40
|
+
export declare function isSignInFailure(value: string | null | undefined): value is SignInFailure;
|
|
41
|
+
/** Where a browser leaves for the provider to sign in and come back to `returnTo`. */
|
|
42
|
+
export declare function loginPath(provider: ProviderKey, returnTo: string): string;
|
|
43
|
+
/** A page of this origin, told why the sign-in it was waiting for did not complete. */
|
|
44
|
+
export declare function signInPath(page: string, failure: SignInFailure): string;
|
|
45
|
+
/** The REST path of one task, decision, token, person, run or file: the collection, then the id. */
|
|
46
|
+
export declare function restPath(collection: "tasks" | "decisions" | "tokens" | "people" | "runs" | "files", id: string): string;
|
|
47
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,kEAAkE;AAClE,eAAO,MAAM,WAAW;IACtB,sFAAsF;aACtF,EAAE,EAAE,YAAY;IAChB,+DAA+D;aAC/D,MAAM,EAAE,gBAAgB;aACxB,KAAK,EAAE,eAAe;aACtB,SAAS,EAAE,mBAAmB;IAC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
2
|
+
export const REST_ROUTES = {
|
|
3
|
+
/** Who is signed in, what the workspace is called, and whether anyone can sign in. */
|
|
4
|
+
me: "/api/v1/me",
|
|
5
|
+
/** The people of the workspace: everyone who has signed in. */
|
|
6
|
+
people: "/api/v1/people",
|
|
7
|
+
tasks: "/api/v1/tasks",
|
|
8
|
+
decisions: "/api/v1/decisions",
|
|
9
|
+
/** The feed, from a point on; and `/stream` under it, the same as it happens. */
|
|
10
|
+
events: "/api/v1/events",
|
|
11
|
+
/** The tokens of whoever asks: what their agents, scripts and consoles act as them with. */
|
|
12
|
+
tokens: "/api/v1/tokens",
|
|
13
|
+
/** The runs: agents at work, and what they did. */
|
|
14
|
+
runs: "/api/v1/runs",
|
|
15
|
+
/** The bytes of a file a run handed in: `/api/v1/files/<artifact id>`. */
|
|
16
|
+
files: "/api/v1/files",
|
|
17
|
+
/** The organization's skills, as SkillCDN serves them at the console's address. */
|
|
18
|
+
skills: "/api/v1/skills",
|
|
19
|
+
};
|
|
20
|
+
/** Where a browser signs in and out. Signing in is per provider: `/auth/<provider>/...`. */
|
|
21
|
+
export const AUTH_ROUTES = {
|
|
22
|
+
/** Sends the browser to the provider to sign in, and afterwards to `return_to`. */
|
|
23
|
+
login: (provider) => `/auth/${provider}/login`,
|
|
24
|
+
/** Where the provider sends the browser back to. */
|
|
25
|
+
callback: (provider) => `/auth/${provider}/callback`,
|
|
26
|
+
/** A POST from the pages that ends the session. */
|
|
27
|
+
logout: "/auth/logout",
|
|
28
|
+
};
|
|
29
|
+
/** The parameter of the login route naming the page to come back to: a path of this origin. */
|
|
30
|
+
export const RETURN_TO_PARAM = "return_to";
|
|
31
|
+
/**
|
|
32
|
+
* The parameter by which the server tells a page that a sign-in did not complete: the person
|
|
33
|
+
* said no at the provider, the attempt was not finished in time or in the browser that began
|
|
34
|
+
* it, the provider did not confirm it, or the account is not a member of the workspace.
|
|
35
|
+
*/
|
|
36
|
+
export const SIGN_IN_PARAM = "sign_in";
|
|
37
|
+
export const SIGN_IN_FAILURES = ["denied", "expired", "failed", "refused"];
|
|
38
|
+
export function isSignInFailure(value) {
|
|
39
|
+
return SIGN_IN_FAILURES.includes(value ?? "");
|
|
40
|
+
}
|
|
41
|
+
/** Where a browser leaves for the provider to sign in and come back to `returnTo`. */
|
|
42
|
+
export function loginPath(provider, returnTo) {
|
|
43
|
+
return `${AUTH_ROUTES.login(provider)}?${RETURN_TO_PARAM}=${encodeURIComponent(returnTo)}`;
|
|
44
|
+
}
|
|
45
|
+
/** A page of this origin, told why the sign-in it was waiting for did not complete. */
|
|
46
|
+
export function signInPath(page, failure) {
|
|
47
|
+
return `${page}${page.includes("?") ? "&" : "?"}${SIGN_IN_PARAM}=${failure}`;
|
|
48
|
+
}
|
|
49
|
+
/** The REST path of one task, decision, token, person, run or file: the collection, then the id. */
|
|
50
|
+
export function restPath(collection, id) {
|
|
51
|
+
return `${REST_ROUTES[collection]}/${encodeURIComponent(id)}`;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=routes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../src/routes.ts"],"names":[],"mappings":"AAIA,kEAAkE;AAClE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,sFAAsF;IACtF,EAAE,EAAE,YAAY;IAChB,+DAA+D;IAC/D,MAAM,EAAE,gBAAgB;IACxB,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,mBAAmB;IAC9B,iFAAiF;IACjF,MAAM,EAAE,gBAAgB;IACxB,4FAA4F;IAC5F,MAAM,EAAE,gBAAgB;IACxB,mDAAmD;IACnD,IAAI,EAAE,cAAc;IACpB,0EAA0E;IAC1E,KAAK,EAAE,eAAe;IACtB,mFAAmF;IACnF,MAAM,EAAE,gBAAgB;CAChB,CAAC;AAEX,4FAA4F;AAC5F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,mFAAmF;IACnF,KAAK,EAAE,CAAC,QAAqB,EAAU,EAAE,C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