@openagt/dashboard 0.9.0 → 0.10.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.
- package/README.md +8 -11
- package/dist/built-in.d.ts +38 -16
- package/dist/built-in.d.ts.map +1 -1
- package/dist/built-in.js +85 -31
- package/dist/built-in.js.map +1 -1
- package/dist/daemon-runtime.d.ts.map +1 -1
- package/dist/daemon-runtime.js +1 -2
- package/dist/daemon-runtime.js.map +1 -1
- package/dist/dashboard/start-branch.d.ts +32 -0
- package/dist/dashboard/start-branch.d.ts.map +1 -0
- package/dist/dashboard/start-branch.js +47 -0
- package/dist/dashboard/start-branch.js.map +1 -0
- package/dist/dashboard-bundle/assets/main-Q7JMdMJI.css +2 -0
- package/dist/dashboard-bundle/assets/main-fDZWGOub.js +140 -0
- package/dist/dashboard-bundle/assets/{module-v213KWfH.js → module-gKz-ZvkG.js} +2 -2
- package/dist/dashboard-bundle/host/module.js +1 -1
- package/dist/dashboard-bundle/index.html +3 -3
- package/dist/dashboard-rpc/index.d.ts +1 -0
- package/dist/dashboard-rpc/index.d.ts.map +1 -1
- package/dist/dashboard-rpc/index.js +3 -1
- package/dist/dashboard-rpc/index.js.map +1 -1
- package/dist/dashboard-rpc/projects.d.ts.map +1 -1
- package/dist/dashboard-rpc/projects.js +8 -1
- package/dist/dashboard-rpc/projects.js.map +1 -1
- package/dist/dashboard-rpc/skills.d.ts +80 -0
- package/dist/dashboard-rpc/skills.d.ts.map +1 -0
- package/dist/dashboard-rpc/skills.js +84 -0
- package/dist/dashboard-rpc/skills.js.map +1 -0
- package/dist/module-types/dashboard/components/ui/switch.d.ts +7 -0
- package/dist/module-types/dashboard/module/index.d.ts +1 -0
- package/dist/module-types/src/built-in.d.ts +38 -16
- package/dist/module-types/src/dashboard/start-branch.d.ts +31 -0
- package/dist/module-types/src/dashboard-rpc/index.d.ts +1 -0
- package/dist/module-types/src/dashboard-rpc/skills.d.ts +79 -0
- package/dist/module-types/src/openagent-dir.d.ts +3 -5
- package/dist/module-types/src/project-commands.d.ts +4 -0
- package/dist/module-types/src/project-hooks.d.ts +8 -5
- package/dist/module-types/src/project-modules.d.ts +8 -6
- package/dist/module-types/src/store/branches.d.ts +1 -1
- package/dist/module-types/src/store/git-host.d.ts +1 -1
- package/dist/module-types/src/store/queue.d.ts +1 -1
- package/dist/module-types/src/store/runs.d.ts +1 -1
- package/dist/module-types/src/store/tickets.d.ts +1 -1
- package/dist/openagent-dir.d.ts +3 -5
- package/dist/openagent-dir.d.ts.map +1 -1
- package/dist/openagent-dir.js +3 -5
- package/dist/openagent-dir.js.map +1 -1
- package/dist/project-commands.d.ts +4 -0
- package/dist/project-commands.d.ts.map +1 -1
- package/dist/project-commands.js.map +1 -1
- package/dist/project-hooks.d.ts +8 -5
- package/dist/project-hooks.d.ts.map +1 -1
- package/dist/project-hooks.js +9 -6
- package/dist/project-hooks.js.map +1 -1
- package/dist/project-modules.d.ts +8 -6
- package/dist/project-modules.d.ts.map +1 -1
- package/dist/project-modules.js +7 -13
- package/dist/project-modules.js.map +1 -1
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +1 -2
- package/dist/project.js.map +1 -1
- package/dist/store/branches.d.ts +1 -1
- package/dist/store/branches.js +1 -1
- package/dist/store/git-host.d.ts +1 -1
- package/dist/store/git-host.js +2 -2
- package/dist/store/git-host.js.map +1 -1
- package/dist/store/queue.d.ts +1 -1
- package/dist/store/queue.js +1 -1
- package/dist/store/runs.d.ts +1 -1
- package/dist/store/runs.js +1 -1
- package/dist/store/test-branches.d.ts +0 -8
- package/dist/store/test-branches.d.ts.map +1 -1
- package/dist/store/test-branches.js +0 -24
- package/dist/store/test-branches.js.map +1 -1
- package/dist/store/tickets.d.ts +1 -1
- package/dist/store/tickets.js +1 -1
- package/package.json +16 -13
- package/dist/dashboard-bundle/assets/main-B98UOA3_.js +0 -140
- package/dist/dashboard-bundle/assets/main-ByRjbCiA.css +0 -2
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type Standing } from '@openagt/init';
|
|
2
|
+
/**
|
|
3
|
+
* A project's skills, as the dashboard shows and changes them (#2023): the same list with ticks
|
|
4
|
+
* `npx @openagt/init` shows in a terminal, read and written through that package's own code, so
|
|
5
|
+
* the two cannot drift apart. A project has a skill when the skill's text is in its folder; the
|
|
6
|
+
* dashboard writes and deletes those files, and offers the one commit that holds them.
|
|
7
|
+
*/
|
|
8
|
+
/** One skill of the list, as it stands in the project. */
|
|
9
|
+
export interface ProjectSkill {
|
|
10
|
+
name: string;
|
|
11
|
+
/** The one line the skill's text says of itself. */
|
|
12
|
+
description: string;
|
|
13
|
+
/** How the project's text stands against the one this dashboard carries; `absent` when the project does not hold the skill. */
|
|
14
|
+
standing: Standing;
|
|
15
|
+
/** Whether the skill is in the folder but not yet on the branch agents start from: an agent started from it does not have the skill. */
|
|
16
|
+
waiting: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectSkills {
|
|
19
|
+
/** How many skills the project has, of how many there are: the ones in its folder, and the basic ones every run gets. */
|
|
20
|
+
has: number;
|
|
21
|
+
of: number;
|
|
22
|
+
/** The list's groups; `ticked` says whether a group's skills are ticked in a project that has none yet. */
|
|
23
|
+
groups: {
|
|
24
|
+
title: string;
|
|
25
|
+
ticked: boolean;
|
|
26
|
+
skills: ProjectSkill[];
|
|
27
|
+
}[];
|
|
28
|
+
/** Whether the scheduler starts with the dashboard for this project, on this machine. */
|
|
29
|
+
scheduler: boolean;
|
|
30
|
+
/** The branch agents start from, by its name: the remote's default branch, else the branch the folder is on. Absent where there is none. */
|
|
31
|
+
startBranch?: string;
|
|
32
|
+
/** How many skill files stand written or deleted in the folder with no commit yet. */
|
|
33
|
+
uncommitted: number;
|
|
34
|
+
/** Whether the folder is a git repository: without one there is nothing to commit. */
|
|
35
|
+
git: boolean;
|
|
36
|
+
/** Whether the project has a remote: without one a commit on this machine is all agents need. */
|
|
37
|
+
remote: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** The project's skills; `null` when the project is unknown here. */
|
|
40
|
+
export declare function onProjectSkills(projectId: string): Promise<ProjectSkills | null>;
|
|
41
|
+
/** What a change of skills answered: what was written and deleted, what was left as it is, and the scheduler when the change switched it. */
|
|
42
|
+
export type ChangeSkillsResult = {
|
|
43
|
+
ok: true;
|
|
44
|
+
written: string[];
|
|
45
|
+
removed: string[];
|
|
46
|
+
left: {
|
|
47
|
+
path: string;
|
|
48
|
+
reason: string;
|
|
49
|
+
}[];
|
|
50
|
+
scheduler?: 'on' | 'off';
|
|
51
|
+
schedulerError?: string;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
error: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Write and delete skills in a project's folder, and switch its scheduler: what the "Add skills"
|
|
58
|
+
* screen saves. Only the names of the list are taken; anything else is refused whole. A scheduler
|
|
59
|
+
* switched on starts at once, by its own line, as it would have at this dashboard's opening.
|
|
60
|
+
* Nothing is committed here: `sendCommitSkills` is the person's next press.
|
|
61
|
+
*/
|
|
62
|
+
export declare function sendChangeSkills(projectId: string, change: {
|
|
63
|
+
write?: string[];
|
|
64
|
+
remove?: string[];
|
|
65
|
+
scheduler?: boolean;
|
|
66
|
+
}): Promise<ChangeSkillsResult>;
|
|
67
|
+
/**
|
|
68
|
+
* One commit of skill files that stand uncommitted in the project's folder, on the branch the
|
|
69
|
+
* folder is on: the files of the skills `only` names, after a change that wrote or deleted them,
|
|
70
|
+
* else every uncommitted skill file. Never a push.
|
|
71
|
+
*/
|
|
72
|
+
export declare function sendCommitSkills(projectId: string, only?: string[]): Promise<{
|
|
73
|
+
ok: true;
|
|
74
|
+
committed: boolean;
|
|
75
|
+
commit?: string;
|
|
76
|
+
} | {
|
|
77
|
+
ok: false;
|
|
78
|
+
error: string;
|
|
79
|
+
}>;
|
|
80
|
+
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot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AC,EAAE,MAAM,CAAA;CAAE,GAC/I;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAKhC;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4B3J;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAMpK"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { applyChange, carriedSkills, commitSkills, GROUPS, isKnown, readProject, SCHEDULER, skillCount, SKILLS_IN_ALL, uncommittedSkills } from '@openagt/init';
|
|
2
|
+
import { waitingSkills } from '../dashboard/start-branch.js';
|
|
3
|
+
import { readProjectHooks, runProjectHooks } from '../project-hooks.js';
|
|
4
|
+
import { providedDataChanged } from '../store/provided.js';
|
|
5
|
+
import { resolveProjectPath } from './context.js';
|
|
6
|
+
/** The project's skills; `null` when the project is unknown here. */
|
|
7
|
+
export async function onProjectSkills(projectId) {
|
|
8
|
+
const cwd = await resolveProjectPath(projectId);
|
|
9
|
+
if (!cwd)
|
|
10
|
+
return null;
|
|
11
|
+
const [state, carried] = await Promise.all([readProject(cwd), carriedSkills()]);
|
|
12
|
+
const standing = new Map(state.skills.map(skill => [skill.name, skill.standing]));
|
|
13
|
+
const { start, waiting } = await waitingSkills(cwd, state.skills.filter(skill => skill.standing !== 'absent').map(skill => skill.name));
|
|
14
|
+
return {
|
|
15
|
+
has: skillCount(state),
|
|
16
|
+
of: SKILLS_IN_ALL,
|
|
17
|
+
groups: GROUPS.map(group => ({
|
|
18
|
+
title: group.title,
|
|
19
|
+
ticked: group.ticked,
|
|
20
|
+
skills: group.skills.map(name => ({ name, description: carried.get(name).description, standing: standing.get(name) ?? 'absent', waiting: waiting.has(name) })),
|
|
21
|
+
})),
|
|
22
|
+
scheduler: state.scheduler,
|
|
23
|
+
...(start ? { startBranch: start.name } : {}),
|
|
24
|
+
uncommitted: state.git ? await uncommittedSkills(cwd) : 0,
|
|
25
|
+
git: state.git,
|
|
26
|
+
remote: state.remote,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/** A list of the list's own skill names, each once; nothing for anything else. */
|
|
30
|
+
const names = (value) => (value === undefined ? [] : Array.isArray(value) && value.every(name => typeof name === 'string' && name !== SCHEDULER && isKnown(name)) ? [...new Set(value)] : undefined);
|
|
31
|
+
/**
|
|
32
|
+
* Write and delete skills in a project's folder, and switch its scheduler: what the "Add skills"
|
|
33
|
+
* screen saves. Only the names of the list are taken; anything else is refused whole. A scheduler
|
|
34
|
+
* switched on starts at once, by its own line, as it would have at this dashboard's opening.
|
|
35
|
+
* Nothing is committed here: `sendCommitSkills` is the person's next press.
|
|
36
|
+
*/
|
|
37
|
+
export async function sendChangeSkills(projectId, change) {
|
|
38
|
+
const cwd = await resolveProjectPath(projectId);
|
|
39
|
+
if (!cwd)
|
|
40
|
+
return { ok: false, error: 'this project has no local path on this server' };
|
|
41
|
+
const asked = change && typeof change === 'object' && !Array.isArray(change) ? change : undefined;
|
|
42
|
+
const write = names(asked?.write);
|
|
43
|
+
const remove = names(asked?.remove);
|
|
44
|
+
if (!asked || !write || !remove || (asked.scheduler !== undefined && typeof asked.scheduler !== 'boolean'))
|
|
45
|
+
return { ok: false, error: 'not a list of skills' };
|
|
46
|
+
try {
|
|
47
|
+
const opened = (await readProjectHooks(cwd).catch(() => undefined))?.open ?? [];
|
|
48
|
+
const changed = await applyChange(cwd, { write, remove, ...(asked.scheduler !== undefined ? { scheduler: asked.scheduler } : {}) });
|
|
49
|
+
providedDataChanged(cwd);
|
|
50
|
+
const scheduler = changed.scheduler;
|
|
51
|
+
// The lines the change added run when the dashboard opens, and this dashboard is open: they run now, the way they would have.
|
|
52
|
+
if (scheduler && !('error' in scheduler) && scheduler.on && scheduler.changed) {
|
|
53
|
+
const added = ((await readProjectHooks(cwd).catch(() => undefined))?.open ?? []).filter(line => !opened.includes(line));
|
|
54
|
+
if (added.length > 0)
|
|
55
|
+
await runProjectHooks(cwd, 'open', { only: added, log: console.log });
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
ok: true,
|
|
59
|
+
written: changed.written,
|
|
60
|
+
removed: changed.removed,
|
|
61
|
+
left: changed.left,
|
|
62
|
+
...(scheduler && !('error' in scheduler) && scheduler.changed ? { scheduler: scheduler.on ? 'on' : 'off' } : {}),
|
|
63
|
+
...(scheduler && 'error' in scheduler ? { schedulerError: scheduler.error } : {}),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One commit of skill files that stand uncommitted in the project's folder, on the branch the
|
|
72
|
+
* folder is on: the files of the skills `only` names, after a change that wrote or deleted them,
|
|
73
|
+
* else every uncommitted skill file. Never a push.
|
|
74
|
+
*/
|
|
75
|
+
export async function sendCommitSkills(projectId, only) {
|
|
76
|
+
const cwd = await resolveProjectPath(projectId);
|
|
77
|
+
if (!cwd)
|
|
78
|
+
return { ok: false, error: 'this project has no local path on this server' };
|
|
79
|
+
const named = names(only);
|
|
80
|
+
if (!named)
|
|
81
|
+
return { ok: false, error: 'not a list of skills' };
|
|
82
|
+
return named.length > 0 ? commitSkills(cwd, named) : commitS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AAC,CAAC,EAAE,CAAC;SAClF,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAA;IAC/E,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,SAAiB,EAAE,IAAe;IACvE,MAAM,GAAG,GAAG,MAAM,kBAAkB,CAAC,SAAS,CAAC,CAAA;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,+CAA+C,EAAE,CAAA;IACtF,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACzB,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAA;IAC/D,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,CAAA;AACxE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ComponentProps } from 'react';
|
|
2
|
+
import { Switch as SwitchPrimitive } from '@base-ui-components/react/switch';
|
|
3
|
+
type SwitchProps = Omit<ComponentProps<typeof SwitchPrimitive.Root>, 'disabled'> & {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function Switch({ className, disabled, ...props }: SwitchProps): import("react").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -314,6 +314,7 @@ export { Badge } from '../components/ui/badge.js';
|
|
|
314
314
|
export { Card, CardHeader, CardTitle, CardContent } from '../components/ui/card.js';
|
|
315
315
|
export { Skeleton } from '../components/ui/skeleton.js';
|
|
316
316
|
export { Checkbox } from '../components/ui/checkbox.js';
|
|
317
|
+
export { Switch } from '../components/ui/switch.js';
|
|
317
318
|
export { Input } from '../components/ui/input.js';
|
|
318
319
|
export { Popover, PopoverContent, PopoverTrigger } from '../components/ui/popover.js';
|
|
319
320
|
export { RangeSlider } from '../components/ui/slider.js';
|
|
@@ -1,37 +1,59 @@
|
|
|
1
1
|
import type { CleanupReport } from './dashboard/types.js';
|
|
2
2
|
import { type ProjectPackage, type ProvidedCommand, type ProvidedCommandLookup } from '@openagt/agent-data';
|
|
3
3
|
/**
|
|
4
|
-
* The packages OpenAgent
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* The packages OpenAgent brings, by name: dependencies of OpenAgent itself, resolved from its
|
|
5
|
+
* own install, so a project installs nothing for them and an empty folder starts an agent and
|
|
6
|
+
* shows it. Each comes through the same contract as any package: a module by its `./dashboard`
|
|
7
|
+
* export, a provider of a kind of data and the writer of its hook lines by its `openagent` key.
|
|
8
|
+
* These two lists are the one place OpenAgent names a package. One of these names among a
|
|
9
|
+
* project's own dependencies is not read: OpenAgent's copy, and the rules below for which
|
|
10
|
+
* project has it, are the only ones.
|
|
10
11
|
*/
|
|
12
|
+
/** The packages every project has: an agent cannot start, be shown or be put on a git host without them. */
|
|
11
13
|
export declare const BUILT_IN_PACKAGES: readonly string[];
|
|
12
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The packages a project has once it picked them (#2023). A skill's package is the project's
|
|
16
|
+
* when the project holds the skill's text where the coding agents read it
|
|
17
|
+
* (`.claude/skills/<name>/SKILL.md`, `.agents/skills/<name>/SKILL.md`): the rule the launcher
|
|
18
|
+
* already lists a project's commands by, so deleting the skill's folder takes its page away. A
|
|
19
|
+
* tool with no skill text (the scheduler) is the project's when one of the project's hook lines
|
|
20
|
+
* runs it.
|
|
21
|
+
*/
|
|
22
|
+
export declare const PICKED_PACKAGES: readonly string[];
|
|
23
|
+
/** Every name OpenAgent brings itself. */
|
|
24
|
+
export declare const OWN_PACKAGE_NAMES: readonly string[];
|
|
25
|
+
/** Every package OpenAgent brings, resolved from its own install, once; one that is not installed is skipped. */
|
|
13
26
|
export declare function builtInPackages(): Promise<ProjectPackage[]>;
|
|
14
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The packages OpenAgent brings to the project at `root`: the ones every project has, and
|
|
29
|
+
* each picked one the project has by its rule (see {@link PICKED_PACKAGES}). Read off the
|
|
30
|
+
* project's files each time, so a skill written or deleted a moment ago counts at once.
|
|
31
|
+
*/
|
|
32
|
+
export declare function builtInPackagesOf(root: string): Promise<ProjectPackage[]>;
|
|
33
|
+
/** The project's own installed packages, less the names OpenAgent brings itself. */
|
|
34
|
+
export declare function ownPackages(root: string): Promise<ProjectPackage[]>;
|
|
35
|
+
/** The directories the commands of OpenAgent's packages sit in: what a hook line's PATH gains after the project's own installed tools. */
|
|
15
36
|
export declare function builtInBinDirs(): Promise<string[]>;
|
|
16
|
-
/** What provides `kind` in the project at `root`:
|
|
37
|
+
/** What provides `kind` in the project at `root`: a package the project installed for it, else one OpenAgent brings to this project. */
|
|
17
38
|
export declare function lookupProvided(root: string, kind: string): Promise<ProvidedCommandLookup>;
|
|
18
39
|
/** {@link lookupProvided}'s command, for a caller that only needs to run it. */
|
|
19
40
|
export declare function providedCommand(root: string, kind: string): Promise<ProvidedCommand | undefined>;
|
|
20
|
-
/** Whether `command` comes from a
|
|
21
|
-
export declare function isBuiltIn(
|
|
41
|
+
/** Whether `command` comes from a package OpenAgent brings: one the project did not install. */
|
|
42
|
+
export declare function isBuiltIn(command: ProvidedCommand): boolean;
|
|
22
43
|
/**
|
|
23
44
|
* Have every package that writes hook lines write its own into the project at `root`: a package
|
|
24
45
|
* declares `"openagent": { "hooks": "<command>" }`, and `<command> init`, run in the project,
|
|
25
46
|
* writes its lines into the project's hooks file, keeping every line already there. The project's
|
|
26
|
-
* own packages are asked, then the
|
|
27
|
-
*
|
|
47
|
+
* own packages are asked, then the ones OpenAgent brings to it. Answers one line per package
|
|
48
|
+
* that could not write, in words.
|
|
28
49
|
*/
|
|
29
50
|
export declare function writeHookLines(root: string): Promise<string[]>;
|
|
30
51
|
/**
|
|
31
52
|
* Have every package that declares a clean-up remove what it left in the project at `root`: a
|
|
32
53
|
* package declares `"openagent": { "cleanup": "<command>" }`, and `<command> cleanup`, run in the
|
|
33
|
-
* project, answers `{ ok: true, removed, kept }`. The project's own packages are asked, then
|
|
34
|
-
*
|
|
35
|
-
*
|
|
54
|
+
* project, answers `{ ok: true, removed, kept }`. The project's own packages are asked, then
|
|
55
|
+
* every package OpenAgent brings, also one this project no longer has (what it left stays its
|
|
56
|
+
* own to remove), each whatever the one before answered. A package that refuses, fails or answers
|
|
57
|
+
* something else is one line in `failed`, in words.
|
|
36
58
|
*/
|
|
37
59
|
export declare function runCleanups(root: string): Promise<CleanupReport>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The branch agents start from in the project at `cwd`: origin's default branch as this clone has
|
|
3
|
+
* it, else the branch the folder is on (a project with no remote starts an agent from its last
|
|
4
|
+
* local commit). `ref` is what git is asked, `name` what a person reads. None where the folder is
|
|
5
|
+
* on no branch, or is no repository.
|
|
6
|
+
*/
|
|
7
|
+
export declare function startBranch(cwd: string): Promise<{
|
|
8
|
+
ref: string;
|
|
9
|
+
name: string;
|
|
10
|
+
} | undefined>;
|
|
11
|
+
/** A skill that is in the folder and not on the branch agents start from. */
|
|
12
|
+
export interface Waiting {
|
|
13
|
+
/** The branch it has yet to reach, by name. */
|
|
14
|
+
branch: string;
|
|
15
|
+
/** Whether the branch the folder is on has it: an agent started from that branch does. */
|
|
16
|
+
here: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Which of the skills `names`, all in the project's folder, are waiting to reach the branch agents
|
|
20
|
+
* start from. A skill is said to be waiting only when that is known: an agent's checkout fetches
|
|
21
|
+
* the remote before it starts, so before a skill is called waiting against a remote branch, this
|
|
22
|
+
* clone's copy of that branch is fetched too (at most once a minute per project), or a pull
|
|
23
|
+
* request merged a moment ago would keep its skill waiting here.
|
|
24
|
+
*/
|
|
25
|
+
export declare function waitingSkills(cwd: string, names: readonly string[]): Promise<{
|
|
26
|
+
start?: {
|
|
27
|
+
ref: string;
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
waiting: Map<string, Waiting>;
|
|
31
|
+
}>;
|
|
@@ -8,6 +8,7 @@ export { onQuota } from './quota.js';
|
|
|
8
8
|
export { onModels } from './models.js';
|
|
9
9
|
export { checkDevices, type DeviceCheck } from './devices.js';
|
|
10
10
|
export { onModules, runModuleCommand, readModule, type DashboardModule, type ModuleCommandResult, type ModuleReadResult } from './modules.js';
|
|
11
|
+
export { onProjectSkills, sendChangeSkills, sendCommitSkills, type ProjectSkills, type ProjectSkill, type ChangeSkillsResult } from './skills.js';
|
|
11
12
|
import { streamAgentEvents } from './events.js';
|
|
12
13
|
/** One RPC: called with whatever the browser sent, answering with whatever JSON.stringify keeps. */
|
|
13
14
|
export type RpcHandler = (...args: never[]) => unknown;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type Standing } from '@openagt/init';
|
|
2
|
+
/**
|
|
3
|
+
* A project's skills, as the dashboard shows and changes them (#2023): the same list with ticks
|
|
4
|
+
* `npx @openagt/init` shows in a terminal, read and written through that package's own code, so
|
|
5
|
+
* the two cannot drift apart. A project has a skill when the skill's text is in its folder; the
|
|
6
|
+
* dashboard writes and deletes those files, and offers the one commit that holds them.
|
|
7
|
+
*/
|
|
8
|
+
/** One skill of the list, as it stands in the project. */
|
|
9
|
+
export interface ProjectSkill {
|
|
10
|
+
name: string;
|
|
11
|
+
/** The one line the skill's text says of itself. */
|
|
12
|
+
description: string;
|
|
13
|
+
/** How the project's text stands against the one this dashboard carries; `absent` when the project does not hold the skill. */
|
|
14
|
+
standing: Standing;
|
|
15
|
+
/** Whether the skill is in the folder but not yet on the branch agents start from: an agent started from it does not have the skill. */
|
|
16
|
+
waiting: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ProjectSkills {
|
|
19
|
+
/** How many skills the project has, of how many there are: the ones in its folder, and the basic ones every run gets. */
|
|
20
|
+
has: number;
|
|
21
|
+
of: number;
|
|
22
|
+
/** The list's groups; `ticked` says whether a group's skills are ticked in a project that has none yet. */
|
|
23
|
+
groups: {
|
|
24
|
+
title: string;
|
|
25
|
+
ticked: boolean;
|
|
26
|
+
skills: ProjectSkill[];
|
|
27
|
+
}[];
|
|
28
|
+
/** Whether the scheduler starts with the dashboard for this project, on this machine. */
|
|
29
|
+
scheduler: boolean;
|
|
30
|
+
/** The branch agents start from, by its name: the remote's default branch, else the branch the folder is on. Absent where there is none. */
|
|
31
|
+
startBranch?: string;
|
|
32
|
+
/** How many skill files stand written or deleted in the folder with no commit yet. */
|
|
33
|
+
uncommitted: number;
|
|
34
|
+
/** Whether the folder is a git repository: without one there is nothing to commit. */
|
|
35
|
+
git: boolean;
|
|
36
|
+
/** Whether the project has a remote: without one a commit on this machine is all agents need. */
|
|
37
|
+
remote: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** The project's skills; `null` when the project is unknown here. */
|
|
40
|
+
export declare function onProjectSkills(projectId: string): Promise<ProjectSkills | null>;
|
|
41
|
+
/** What a change of skills answered: what was written and deleted, what was left as it is, and the scheduler when the change switched it. */
|
|
42
|
+
export type ChangeSkillsResult = {
|
|
43
|
+
ok: true;
|
|
44
|
+
written: string[];
|
|
45
|
+
removed: string[];
|
|
46
|
+
left: {
|
|
47
|
+
path: string;
|
|
48
|
+
reason: string;
|
|
49
|
+
}[];
|
|
50
|
+
scheduler?: 'on' | 'off';
|
|
51
|
+
schedulerError?: string;
|
|
52
|
+
} | {
|
|
53
|
+
ok: false;
|
|
54
|
+
error: string;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Write and delete skills in a project's folder, and switch its scheduler: what the "Add skills"
|
|
58
|
+
* screen saves. Only the names of the list are taken; anything else is refused whole. A scheduler
|
|
59
|
+
* switched on starts at once, by its own line, as it would have at this dashboard's opening.
|
|
60
|
+
* Nothing is committed here: `sendCommitSkills` is the person's next press.
|
|
61
|
+
*/
|
|
62
|
+
export declare function sendChangeSkills(projectId: string, change: {
|
|
63
|
+
write?: string[];
|
|
64
|
+
remove?: string[];
|
|
65
|
+
scheduler?: boolean;
|
|
66
|
+
}): Promise<ChangeSkillsResult>;
|
|
67
|
+
/**
|
|
68
|
+
* One commit of skill files that stand uncommitted in the project's folder, on the branch the
|
|
69
|
+
* folder is on: the files of the skills `only` names, after a change that wrote or deleted them,
|
|
70
|
+
* else every uncommitted skill file. Never a push.
|
|
71
|
+
*/
|
|
72
|
+
export declare function sendCommitSkills(projectId: string, only?: string[]): Promise<{
|
|
73
|
+
ok: true;
|
|
74
|
+
committed: boolean;
|
|
75
|
+
commit?: string;
|
|
76
|
+
} | {
|
|
77
|
+
ok: false;
|
|
78
|
+
error: string;
|
|
79
|
+
}>;
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* The directory, under a project root, that holds OpenAgent's own files.
|
|
3
3
|
*
|
|
4
4
|
* Its own module so every reader and writer of the directory (the hooks file, the project's saved
|
|
5
|
-
* prompts,
|
|
6
|
-
*
|
|
7
|
-
* Nothing of the product's rides on a branch of its own any more: the agent archives are the
|
|
8
|
-
* `logs` skill's runs, on the shared `agent-data` branch that `@openagt/agent-data` names (#1769).
|
|
5
|
+
* prompts, a run's card, diary and inbox) spells it the same way. The name itself is
|
|
6
|
+
* `@openagt/agent-data`'s, which also makes the directory when a folder becomes a project.
|
|
9
7
|
*/
|
|
10
|
-
export
|
|
8
|
+
export { OPENAGENT_DIR } from '@openagt/agent-data/names';
|
|
@@ -13,6 +13,10 @@ export interface ProjectCommand {
|
|
|
13
13
|
name: string;
|
|
14
14
|
/** The `description` of the skill's front matter, when it has one. */
|
|
15
15
|
description?: string;
|
|
16
|
+
/** The branch the skill has yet to reach, by name, when its text is in the folder but not on the branch agents start from: an agent started from that branch does not have the command. */
|
|
17
|
+
waiting?: string;
|
|
18
|
+
/** With `waiting`: whether the branch the folder is on has the skill, so an agent started from that branch does have the command. */
|
|
19
|
+
here?: true;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* The project's commands, by name: the skills whose front matter says
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* A project's hooks (#1774): the shell lines a project's own `.openagent/hooks.yml` names to
|
|
3
3
|
* run when the dashboard opens and when it closes, the two lines that start a run and continue
|
|
4
4
|
* one, and the line that says whether a run can start here at all. The daemon calls no tool by
|
|
5
|
-
* name: it runs whatever the file says, in the project, with the
|
|
6
|
-
* then the
|
|
5
|
+
* name: it runs whatever the file says, in the project, with the commands of the packages
|
|
6
|
+
* OpenAgent brings and then the project's installed tools on the PATH, so a line reaches its tool with nothing fetched from npm. Per
|
|
7
7
|
* user, since `.openagent/` is ignored: a hook is this machine's, and a teammate's pull
|
|
8
8
|
* changes nothing.
|
|
9
9
|
*
|
|
@@ -49,6 +49,8 @@ export interface RunHooksOptions {
|
|
|
49
49
|
timeoutMs?: number;
|
|
50
50
|
/** The environment the lines run with; default the daemon's own. */
|
|
51
51
|
env?: NodeJS.ProcessEnv;
|
|
52
|
+
/** The lines to run, of the ones the file holds; every line when absent. */
|
|
53
|
+
only?: readonly string[];
|
|
52
54
|
}
|
|
53
55
|
/**
|
|
54
56
|
* Run a project's `open` or `close` lines, in order, each through `sh -c` with the project's
|
|
@@ -122,8 +124,9 @@ export declare function runCheckHook(cwd: string, input: {
|
|
|
122
124
|
driver?: string;
|
|
123
125
|
}, opts?: Omit<RunHooksOptions, 'log'>): Promise<CheckHookResult>;
|
|
124
126
|
/**
|
|
125
|
-
* The environment a line runs with: the PATH led by the
|
|
126
|
-
*
|
|
127
|
-
*
|
|
127
|
+
* The environment a line runs with: the PATH led by the commands of the packages OpenAgent
|
|
128
|
+
* brings, then the project's installed tools. So a tool of OpenAgent's named in a line is always
|
|
129
|
+
* OpenAgent's copy, the one its pages and its data go through too, any other tool is the
|
|
130
|
+
* project's, and nothing is a package fetched by name.
|
|
128
131
|
*/
|
|
129
132
|
export declare function hookEnv(cwd: string, env: NodeJS.ProcessEnv): Promise<NodeJS.ProcessEnv>;
|
|
@@ -2,11 +2,12 @@ import { type PackageCommandResult } from '@openagt/agent-data';
|
|
|
2
2
|
/**
|
|
3
3
|
* A package that adds to the dashboard (#1774): its browser part, named by its
|
|
4
4
|
* `exports["./dashboard"]`, and optionally its server part, named by `exports["./server"]`.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* Any dependency of the project that exports `./dashboard` is a module, whoever wrote it, and the
|
|
6
|
+
* packages OpenAgent brings itself come the same way, for the projects that have them
|
|
7
|
+
* (`built-in.ts`).
|
|
7
8
|
*/
|
|
8
9
|
export interface ProjectModule {
|
|
9
|
-
/** The package's name
|
|
10
|
+
/** The package's name. */
|
|
10
11
|
package: string;
|
|
11
12
|
/** The package's version, when its package.json says one. */
|
|
12
13
|
version?: string;
|
|
@@ -21,8 +22,9 @@ export interface ProjectModule {
|
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
24
|
* The modules a project has: each of its dependencies whose package.json exports `./dashboard` to
|
|
24
|
-
* a file that exists inside the package, plus the modules among
|
|
25
|
-
*
|
|
25
|
+
* a file that exists inside the package, plus the modules among the packages OpenAgent brings to
|
|
26
|
+
* this project (`built-in.ts`): a skill's page where the project holds the skill's text. Sorted
|
|
27
|
+
* by name.
|
|
26
28
|
*/
|
|
27
29
|
export declare function readProjectModules(root: string): Promise<ProjectModule[]>;
|
|
28
30
|
/** The one module of this project that `name` names, or undefined. */
|
|
@@ -38,7 +40,7 @@ export type ModuleCommandResult = PackageCommandResult;
|
|
|
38
40
|
/**
|
|
39
41
|
* Run one of a module package's own commands in the project, with the given arguments, and read
|
|
40
42
|
* its standard output as JSON. This is how a module reads its data: the same command an agent runs
|
|
41
|
-
* (`npx logs`), so the module and the agent see the same thing and OpenAgent knows neither.
|
|
43
|
+
* (`npx @openagt/skill-logs@0.1`), so the module and the agent see the same thing and OpenAgent knows neither.
|
|
42
44
|
*
|
|
43
45
|
* `command` picks one of the package's commands; a package with exactly one needs none. The
|
|
44
46
|
* command runs with Node (a package's commands are Node scripts), in the project root, never
|
|
@@ -149,7 +149,7 @@ export declare function parseCheckouts(output: unknown): Checkout[];
|
|
|
149
149
|
/** The states read back from a provider's `show`: the objects with a branch and the three verdicts, lists cleaned; anything else is no state. */
|
|
150
150
|
export declare function parseBranchStates(output: unknown): BranchState[];
|
|
151
151
|
/**
|
|
152
|
-
* The production {@link BranchesReader}: the project's provider, looked up
|
|
152
|
+
* The production {@link BranchesReader}: the project's provider, looked up among the packages the project has (`built-in.ts`),
|
|
153
153
|
* one source per project kept while the same command provides — so the cache holds across the
|
|
154
154
|
* many reads of one poll, and a project that installs, swaps or drops its provider is read the new
|
|
155
155
|
* way within {@link CACHE_MS}. `changed(root)` forgets that project's reads, so the next read runs
|
|
@@ -101,7 +101,7 @@ export type GitHostReader = GitHostFor & {
|
|
|
101
101
|
/** The rows read back from a provider's `requests`: the objects with the facts a request needs; anything else is no request. */
|
|
102
102
|
export declare function parseRequests(output: unknown): GitHostRequest[];
|
|
103
103
|
/**
|
|
104
|
-
* The production {@link GitHostReader}: the project's provider, looked up
|
|
104
|
+
* The production {@link GitHostReader}: the project's provider, looked up among the packages the project has (`built-in.ts`), one
|
|
105
105
|
* source per project kept while the same command provides, so a project that installs, swaps or
|
|
106
106
|
* drops its git host is read the new way within {@link CACHE_MS}. `changed(root)` forgets the
|
|
107
107
|
* project, so the next ask looks its provider up again.
|
|
@@ -32,7 +32,7 @@ export type QueueReader = QueueFor & {
|
|
|
32
32
|
/** Entries read back from a provider's output: the non-empty strings of an array, trimmed; anything else is no entries. */
|
|
33
33
|
export declare function parseQueueEntries(output: unknown): string[];
|
|
34
34
|
/**
|
|
35
|
-
* The production {@link QueueReader}: the project's provider, looked up
|
|
35
|
+
* The production {@link QueueReader}: the project's provider, looked up among the packages the project has (`built-in.ts`), one
|
|
36
36
|
* source per project kept while the same command provides — so the cache holds across the many
|
|
37
37
|
* reads of one poll, and a project that installs, swaps or drops its provider is read the new way
|
|
38
38
|
* within {@link CACHE_MS}. `changed(root)` forgets that project's read, so the next read runs the
|
|
@@ -94,7 +94,7 @@ export declare function isRunId(id: string): boolean;
|
|
|
94
94
|
*/
|
|
95
95
|
export declare function parseRunCard(input: unknown): RunCard | undefined;
|
|
96
96
|
/**
|
|
97
|
-
* The production {@link RunsFor}: the project's provider, looked up
|
|
97
|
+
* The production {@link RunsFor}: the project's provider, looked up among the packages the project has (`built-in.ts`), one
|
|
98
98
|
* source per project kept while the same command provides — so the cache holds across the many
|
|
99
99
|
* reads of one poll, and a project that installs, swaps or drops its provider is read the new way
|
|
100
100
|
* within {@link CACHE_MS}. `changed(root)` forgets that project's reads, so the next read runs the
|
|
@@ -59,7 +59,7 @@ export type TicketsReader = TicketsFor & {
|
|
|
59
59
|
/** The rows read back from a provider's output: the objects with the five plain facts, everything else as printed; anything else is no ticket. */
|
|
60
60
|
export declare function parseTickets(output: unknown): Ticket[];
|
|
61
61
|
/**
|
|
62
|
-
* The production {@link TicketsReader}: the project's provider, looked up
|
|
62
|
+
* The production {@link TicketsReader}: the project's provider, looked up among the packages the project has (`built-in.ts`), one
|
|
63
63
|
* source per project kept while the same command provides — so the cache holds across the many
|
|
64
64
|
* reads of one poll, and a project that installs, swaps or drops its provider is read the new way
|
|
65
65
|
* within {@link CACHE_MS}. `changed(root)` forgets that project's read, so the next read runs the
|
package/dist/openagent-dir.d.ts
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* The directory, under a project root, that holds OpenAgent's own files.
|
|
3
3
|
*
|
|
4
4
|
* Its own module so every reader and writer of the directory (the hooks file, the project's saved
|
|
5
|
-
* prompts,
|
|
6
|
-
*
|
|
7
|
-
* Nothing of the product's rides on a branch of its own any more: the agent archives are the
|
|
8
|
-
* `logs` skill's runs, on the shared `agent-data` branch that `@openagt/agent-data` names (#1769).
|
|
5
|
+
* prompts, a run's card, diary and inbox) spells it the same way. The name itself is
|
|
6
|
+
* `@openagt/agent-data`'s, which also makes the directory when a folder becomes a project.
|
|
9
7
|
*/
|
|
10
|
-
export
|
|
8
|
+
export { OPENAGENT_DIR } from '@openagt/agent-data/names';
|
|
11
9
|
//# sourceMappingURL=openagent-dir.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openagent-dir.d.ts","sourceRoot":"","sources":["../src/openagent-dir.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openagent-dir.d.ts","sourceRoot":"","sources":["../src/openagent-dir.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/openagent-dir.js
CHANGED
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
* The directory, under a project root, that holds OpenAgent's own files.
|
|
3
3
|
*
|
|
4
4
|
* Its own module so every reader and writer of the directory (the hooks file, the project's saved
|
|
5
|
-
* prompts,
|
|
6
|
-
*
|
|
7
|
-
* Nothing of the product's rides on a branch of its own any more: the agent archives are the
|
|
8
|
-
* `logs` skill's runs, on the shared `agent-data` branch that `@openagt/agent-data` names (#1769).
|
|
5
|
+
* prompts, a run's card, diary and inbox) spells it the same way. The name itself is
|
|
6
|
+
* `@openagt/agent-data`'s, which also makes the directory when a folder becomes a project.
|
|
9
7
|
*/
|
|
10
|
-
export
|
|
8
|
+
export { OPENAGENT_DIR } from '@openagt/agent-data/names';
|
|
11
9
|
//# sourceMappingURL=openagent-dir.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openagent-dir.js","sourceRoot":"","sources":["../src/openagent-dir.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"openagent-dir.js","sourceRoot":"","sources":["../src/openagent-dir.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -13,6 +13,10 @@ export interface ProjectCommand {
|
|
|
13
13
|
name: string;
|
|
14
14
|
/** The `description` of the skill's front matter, when it has one. */
|
|
15
15
|
description?: string;
|
|
16
|
+
/** The branch the skill has yet to reach, by name, when its text is in the folder but not on the branch agents start from: an agent started from that branch does not have the command. */
|
|
17
|
+
waiting?: string;
|
|
18
|
+
/** With `waiting`: whether the branch the folder is on has the skill, so an agent started from that branch does have the command. */
|
|
19
|
+
here?: true;
|
|
16
20
|
}
|
|
17
21
|
/**
|
|
18
22
|
* The project's commands, by name: the skills whose front matter says
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-commands.d.ts","sourceRoot":"","sources":["../src/project-commands.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,yGAAyG;AACzG,eAAO,MAAM,WAAW,YAAI,gBAAgB,EAAE,gBAAgB,CAAU,CAAA;AAExE,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"project-commands.d.ts","sourceRoot":"","sources":["../src/project-commands.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,yGAAyG;AACzG,eAAO,MAAM,WAAW,YAAI,gBAAgB,EAAE,gBAAgB,CAAU,CAAA;AAExE,0CAA0C;AAC1C,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAA;IACZ,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2LAA2L;IAC3L,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,qIAAqI;IACrI,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAqBhF"}
|