@skillcdn/console 0.6.0 → 0.6.2
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 +7 -7
- package/dist/agent-page.d.ts.map +1 -1
- package/dist/agent-page.js +58 -35
- package/dist/agent-page.js.map +1 -1
- package/dist/agent-usage.d.ts +51 -0
- package/dist/agent-usage.d.ts.map +1 -0
- package/dist/agent-usage.js +77 -0
- package/dist/agent-usage.js.map +1 -0
- package/dist/api.d.ts +4 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +4 -2
- package/dist/api.js.map +1 -1
- package/dist/cli/cli.d.ts +9 -2
- package/dist/cli/cli.d.ts.map +1 -1
- package/dist/cli/cli.js +491 -125
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/format.d.ts +46 -4
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +163 -45
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +62 -13
- package/dist/cli/help.js.map +1 -1
- package/dist/cli/machine-check.d.ts +24 -5
- package/dist/cli/machine-check.d.ts.map +1 -1
- package/dist/cli/machine-check.js +128 -16
- package/dist/cli/machine-check.js.map +1 -1
- package/dist/cli/pack.d.ts +11 -8
- package/dist/cli/pack.d.ts.map +1 -1
- package/dist/cli/pack.js +63 -28
- package/dist/cli/pack.js.map +1 -1
- package/dist/cli/runner-host.d.ts +2 -0
- package/dist/cli/runner-host.d.ts.map +1 -1
- package/dist/cli/runner-host.js +1 -0
- package/dist/cli/runner-host.js.map +1 -1
- package/dist/cli/secret-notes.d.ts.map +1 -1
- package/dist/cli/secret-notes.js +9 -1
- package/dist/cli/secret-notes.js.map +1 -1
- package/dist/cli/terminal.d.ts +10 -2
- package/dist/cli/terminal.d.ts.map +1 -1
- package/dist/cli/terminal.js +16 -4
- package/dist/cli/terminal.js.map +1 -1
- package/dist/client.d.ts +30 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +13 -1
- package/dist/client.js.map +1 -1
- package/dist/components/agent-page.d.ts +76 -18
- package/dist/components/agent-page.d.ts.map +1 -1
- package/dist/components/agent-page.js +183 -53
- package/dist/components/agent-page.js.map +1 -1
- package/dist/components/agents.d.ts +2 -0
- package/dist/components/agents.d.ts.map +1 -1
- package/dist/components/agents.js +6 -5
- package/dist/components/agents.js.map +1 -1
- package/dist/components/calendar.d.ts +24 -4
- package/dist/components/calendar.d.ts.map +1 -1
- package/dist/components/calendar.js +79 -36
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/categories.js +2 -2
- package/dist/components/categories.js.map +1 -1
- package/dist/components/comments.js +2 -2
- package/dist/components/comments.js.map +1 -1
- package/dist/components/decision-list.d.ts.map +1 -1
- package/dist/components/decision-list.js +5 -5
- package/dist/components/decision-list.js.map +1 -1
- package/dist/components/documents.d.ts.map +1 -1
- package/dist/components/documents.js +4 -4
- package/dist/components/documents.js.map +1 -1
- package/dist/components/event-feed.d.ts +2 -3
- package/dist/components/event-feed.d.ts.map +1 -1
- package/dist/components/event-feed.js +4 -184
- package/dist/components/event-feed.js.map +1 -1
- package/dist/components/goals.d.ts.map +1 -1
- package/dist/components/goals.js +3 -3
- package/dist/components/goals.js.map +1 -1
- package/dist/components/home.js +9 -9
- package/dist/components/home.js.map +1 -1
- package/dist/components/icon.d.ts.map +1 -1
- package/dist/components/icon.js +11 -2
- package/dist/components/icon.js.map +1 -1
- package/dist/components/notifications.d.ts +65 -0
- package/dist/components/notifications.d.ts.map +1 -0
- package/dist/components/notifications.js +162 -0
- package/dist/components/notifications.js.map +1 -0
- package/dist/components/pack-connect.js +1 -1
- package/dist/components/pack-connect.js.map +1 -1
- package/dist/components/pack-token.js +1 -1
- package/dist/components/pack-token.js.map +1 -1
- package/dist/components/people.js +2 -2
- package/dist/components/people.js.map +1 -1
- package/dist/components/pictures.js +1 -1
- package/dist/components/pictures.js.map +1 -1
- package/dist/components/plugin-settings.d.ts +22 -1
- package/dist/components/plugin-settings.d.ts.map +1 -1
- package/dist/components/plugin-settings.js +63 -11
- package/dist/components/plugin-settings.js.map +1 -1
- package/dist/components/projects.js +1 -1
- package/dist/components/projects.js.map +1 -1
- package/dist/components/roadmap.js +2 -2
- package/dist/components/roadmap.js.map +1 -1
- package/dist/components/rules.js +2 -2
- package/dist/components/rules.js.map +1 -1
- package/dist/components/runs.d.ts.map +1 -1
- package/dist/components/runs.js +1 -1
- package/dist/components/runs.js.map +1 -1
- package/dist/components/sessions.js +1 -1
- package/dist/components/sessions.js.map +1 -1
- package/dist/components/shell.d.ts +2 -0
- package/dist/components/shell.d.ts.map +1 -1
- package/dist/components/shell.js +1 -1
- package/dist/components/shell.js.map +1 -1
- package/dist/components/sign-in.js +2 -2
- package/dist/components/sign-in.js.map +1 -1
- package/dist/components/skills.d.ts.map +1 -1
- package/dist/components/skills.js +1 -1
- package/dist/components/skills.js.map +1 -1
- package/dist/components/task-view.d.ts +6 -0
- package/dist/components/task-view.d.ts.map +1 -1
- package/dist/components/task-view.js +3 -2
- package/dist/components/task-view.js.map +1 -1
- package/dist/components/tokens.js +1 -1
- package/dist/components/tokens.js.map +1 -1
- package/dist/components/ui.d.ts +21 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/components/ui.js +24 -3
- package/dist/components/ui.js.map +1 -1
- package/dist/components/work.js +1 -1
- package/dist/components/work.js.map +1 -1
- package/dist/console.css +506 -289
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +193 -16
- package/dist/console.js.map +1 -1
- package/dist/data.d.ts +17 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +31 -0
- package/dist/data.js.map +1 -1
- package/dist/desk-page.js +5 -5
- package/dist/desk-page.js.map +1 -1
- package/dist/feed-words.d.ts +5 -0
- package/dist/feed-words.d.ts.map +1 -0
- package/dist/feed-words.js +193 -0
- package/dist/feed-words.js.map +1 -0
- package/dist/i18n/en.d.ts +93 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +103 -15
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/ko.d.ts.map +1 -1
- package/dist/i18n/ko.js +105 -22
- package/dist/i18n/ko.js.map +1 -1
- package/dist/icons/glyphs.d.ts +370 -104
- package/dist/icons/glyphs.d.ts.map +1 -1
- package/dist/icons/glyphs.js +72 -66
- package/dist/icons/glyphs.js.map +1 -1
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +9 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/limits.d.ts +7 -0
- package/dist/limits.d.ts.map +1 -1
- package/dist/limits.js +7 -0
- package/dist/limits.js.map +1 -1
- package/dist/notifications.d.ts +124 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +147 -0
- package/dist/notifications.js.map +1 -0
- package/dist/onboarding.d.ts.map +1 -1
- package/dist/onboarding.js +7 -12
- package/dist/onboarding.js.map +1 -1
- package/dist/plugin/capabilities.d.ts +1 -1
- package/dist/plugin/capabilities.d.ts.map +1 -1
- package/dist/plugin/capabilities.js +10 -0
- package/dist/plugin/capabilities.js.map +1 -1
- package/dist/plugin/context.d.ts +85 -1
- package/dist/plugin/context.d.ts.map +1 -1
- package/dist/plugin/limits.d.ts +7 -0
- package/dist/plugin/limits.d.ts.map +1 -1
- package/dist/plugin/limits.js +7 -0
- package/dist/plugin/limits.js.map +1 -1
- package/dist/plugin/manifest.d.ts +8 -0
- package/dist/plugin/manifest.d.ts.map +1 -1
- package/dist/plugin/manifest.js +13 -0
- package/dist/plugin/manifest.js.map +1 -1
- package/dist/plugin/rest-schemas.d.ts +22 -0
- package/dist/plugin/rest-schemas.d.ts.map +1 -1
- package/dist/plugin/rest-schemas.js +19 -3
- package/dist/plugin/rest-schemas.js.map +1 -1
- package/dist/plugin/testing.d.ts +2 -0
- package/dist/plugin/testing.d.ts.map +1 -1
- package/dist/plugin/testing.js +2 -0
- package/dist/plugin/testing.js.map +1 -1
- package/dist/plugin.d.ts +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +1 -1
- package/dist/plugin.js.map +1 -1
- package/dist/router.d.ts +6 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +5 -0
- package/dist/router.js.map +1 -1
- package/dist/routes.d.ts +2 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +2 -0
- package/dist/routes.js.map +1 -1
- package/dist/rules.js +1 -1
- package/dist/rules.js.map +1 -1
- package/dist/runner/acp.d.ts.map +1 -1
- package/dist/runner/acp.js +12 -97
- package/dist/runner/acp.js.map +1 -1
- package/dist/runner/browser.d.ts +50 -0
- package/dist/runner/browser.d.ts.map +1 -0
- package/dist/runner/browser.js +104 -0
- package/dist/runner/browser.js.map +1 -0
- package/dist/runner/claude.d.ts +1 -2
- package/dist/runner/claude.d.ts.map +1 -1
- package/dist/runner/claude.js +352 -13
- package/dist/runner/claude.js.map +1 -1
- package/dist/runner/codex.d.ts +9 -10
- package/dist/runner/codex.d.ts.map +1 -1
- package/dist/runner/codex.js +809 -346
- package/dist/runner/codex.js.map +1 -1
- package/dist/runner/config.d.ts +14 -3
- package/dist/runner/config.d.ts.map +1 -1
- package/dist/runner/config.js +27 -7
- package/dist/runner/config.js.map +1 -1
- package/dist/runner/desk.d.ts +3 -1
- package/dist/runner/desk.d.ts.map +1 -1
- package/dist/runner/desk.js +17 -5
- package/dist/runner/desk.js.map +1 -1
- package/dist/runner/message.d.ts +53 -3
- package/dist/runner/message.d.ts.map +1 -1
- package/dist/runner/message.js +201 -20
- package/dist/runner/message.js.map +1 -1
- package/dist/runner/registry.d.ts +6 -0
- package/dist/runner/registry.d.ts.map +1 -1
- package/dist/runner/registry.js.map +1 -1
- package/dist/runner/rpc.d.ts +31 -0
- package/dist/runner/rpc.d.ts.map +1 -0
- package/dist/runner/rpc.js +102 -0
- package/dist/runner/rpc.js.map +1 -0
- package/dist/runner/runner.d.ts +41 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/runner.js +695 -52
- package/dist/runner/runner.js.map +1 -1
- package/dist/runner/slack.d.ts +17 -8
- package/dist/runner/slack.d.ts.map +1 -1
- package/dist/runner/slack.js +1250 -78
- package/dist/runner/slack.js.map +1 -1
- package/dist/runner/types.d.ts +160 -8
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/runner/types.js.map +1 -1
- package/dist/runner/usage.d.ts +105 -0
- package/dist/runner/usage.d.ts.map +1 -0
- package/dist/runner/usage.js +218 -0
- package/dist/runner/usage.js.map +1 -0
- package/dist/runner.d.ts +4 -4
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +3 -3
- package/dist/runner.js.map +1 -1
- package/dist/schemas.d.ts +673 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +205 -1
- package/dist/schemas.js.map +1 -1
- package/dist/services.js +3 -3
- package/dist/services.js.map +1 -1
- package/dist/setup-guide.d.ts +4 -3
- package/dist/setup-guide.d.ts.map +1 -1
- package/dist/setup-guide.js +11 -13
- package/dist/setup-guide.js.map +1 -1
- package/dist/text.d.ts +7 -0
- package/dist/text.d.ts.map +1 -1
- package/dist/text.js +18 -0
- package/dist/text.js.map +1 -1
- package/dist/vocabulary.d.ts +4 -2
- package/dist/vocabulary.d.ts.map +1 -1
- package/dist/vocabulary.js +4 -1
- package/dist/vocabulary.js.map +1 -1
- package/docs/specs/cli.md +26 -19
- package/docs/specs/plugins.md +16 -10
- package/docs/specs/rest.md +28 -10
- package/docs/specs/runner.md +132 -44
- package/package.json +4 -4
- package/skills/building-a-console/SKILL.md +2 -2
- package/skills/building-a-console/references/configuring.md +1 -1
- package/skills/building-a-plugin/SKILL.md +4 -4
- package/skills/planning-the-board/SKILL.md +1 -1
- package/skills/planning-the-board/references/setting-up.md +2 -2
- package/skills/running-an-agent/SKILL.md +15 -64
- package/skills/running-an-agent/references/preparing-the-machine.md +17 -0
- package/skills/running-an-agent/references/several-tasks.md +37 -0
- package/skills/running-an-agent/references/slack-app.md +70 -13
- package/skills/running-an-agent/references/the-account-and-the-invitation.md +5 -0
- package/skills/running-an-agent/references/what-was-not-seen-run-yet.md +3 -0
- package/skills/running-an-agent/references/when-the-agent-could-not-go-on.md +16 -0
- package/skills/running-an-agent/references/your-first-task.md +14 -0
- package/skills/working-the-board/SKILL.md +9 -12
- package/skills/working-the-board/references/a-pack-skills-questions.md +3 -0
- package/skills/working-the-board/references/a-plugins-commands.md +3 -0
- package/skills/working-the-board/references/a-review.md +3 -0
- package/skills/working-the-board/references/an-open-run.md +3 -0
- package/skills/working-the-board/references/requirements.md +7 -0
- package/skills/working-the-board/references/the-pack.md +2 -2
- package/skills/working-the-board/references/what-they-were-told.md +3 -0
- package/skills/working-the-board/references/work-given-in-chat.md +5 -0
- package/src/agent-page.tsx +76 -47
- package/src/agent-usage.ts +113 -0
- package/src/api.ts +62 -0
- package/src/cli/cli.ts +634 -162
- package/src/cli/format.ts +190 -47
- package/src/cli/help.ts +77 -12
- package/src/cli/machine-check.ts +182 -29
- package/src/cli/pack.ts +81 -40
- package/src/cli/runner-host.ts +3 -0
- package/src/cli/secret-notes.ts +9 -1
- package/src/cli/terminal.ts +20 -4
- package/src/client.ts +94 -6
- package/src/components/agent-page.tsx +280 -63
- package/src/components/agents.tsx +23 -3
- package/src/components/calendar.tsx +93 -37
- package/src/components/categories.tsx +2 -2
- package/src/components/comments.tsx +5 -5
- package/src/components/decision-list.tsx +13 -10
- package/src/components/documents.tsx +13 -8
- package/src/components/event-feed.tsx +4 -203
- package/src/components/goals.tsx +6 -4
- package/src/components/home.tsx +12 -12
- package/src/components/icon.tsx +16 -3
- package/src/components/notifications.tsx +419 -0
- package/src/components/pack-connect.tsx +1 -1
- package/src/components/pack-token.tsx +5 -5
- package/src/components/people.tsx +3 -3
- package/src/components/pictures.tsx +1 -1
- package/src/components/plugin-settings.tsx +128 -23
- package/src/components/projects.tsx +1 -1
- package/src/components/roadmap.tsx +2 -2
- package/src/components/rules.tsx +2 -2
- package/src/components/runs.tsx +6 -3
- package/src/components/sessions.tsx +2 -2
- package/src/components/shell.tsx +3 -0
- package/src/components/sign-in.tsx +3 -3
- package/src/components/skills.tsx +5 -3
- package/src/components/task-view.tsx +18 -7
- package/src/components/tokens.tsx +2 -2
- package/src/components/ui.tsx +70 -5
- package/src/components/work.tsx +2 -2
- package/src/console.tsx +269 -12
- package/src/data.ts +54 -0
- package/src/desk-page.tsx +5 -5
- package/src/feed-words.ts +214 -0
- package/src/i18n/en.ts +114 -15
- package/src/i18n/ko.ts +115 -22
- package/src/icons/glyphs.ts +74 -68
- package/src/icons/index.ts +9 -1
- package/src/index.ts +11 -0
- package/src/limits.ts +7 -0
- package/src/notifications.ts +205 -0
- package/src/onboarding.ts +10 -14
- package/src/plugin/capabilities.ts +13 -0
- package/src/plugin/context.ts +87 -0
- package/src/plugin/limits.ts +7 -0
- package/src/plugin/manifest.ts +14 -0
- package/src/plugin/rest-schemas.ts +27 -3
- package/src/plugin/testing.ts +4 -0
- package/src/plugin.ts +2 -0
- package/src/router.ts +7 -0
- package/src/routes.ts +2 -0
- package/src/rules.ts +1 -1
- package/src/runner/acp.ts +12 -118
- package/src/runner/browser.ts +128 -0
- package/src/runner/claude.ts +399 -12
- package/src/runner/codex.ts +904 -400
- package/src/runner/config.ts +30 -7
- package/src/runner/desk.ts +22 -6
- package/src/runner/message.ts +251 -21
- package/src/runner/registry.ts +6 -0
- package/src/runner/rpc.ts +140 -0
- package/src/runner/runner.ts +863 -53
- package/src/runner/slack.ts +1535 -85
- package/src/runner/types.ts +150 -5
- package/src/runner/usage.ts +299 -0
- package/src/runner.ts +16 -1
- package/src/schemas.ts +249 -0
- package/src/services.ts +3 -3
- package/src/setup-guide.ts +12 -14
- package/src/styles/README.md +11 -7
- package/src/styles/console.css +2 -0
- package/src/styles/drawn-by-pages.json +7 -82
- package/src/styles/pages/agents.css +46 -35
- package/src/styles/pages/calendar.css +0 -1
- package/src/styles/pages/connect.css +0 -14
- package/src/styles/pages/decisions.css +2 -43
- package/src/styles/pages/documents.css +0 -29
- package/src/styles/pages/home.css +4 -16
- package/src/styles/pages/people.css +2 -17
- package/src/styles/pages/plugins.css +9 -12
- package/src/styles/pages/roadmap.css +0 -16
- package/src/styles/pages/settings.css +0 -28
- package/src/styles/pages/sign-in.css +2 -17
- package/src/styles/pages/thread.css +4 -50
- package/src/styles/pages/work.css +0 -5
- package/src/styles/parts/button.css +31 -0
- package/src/styles/parts/count.css +10 -0
- package/src/styles/parts/divider.css +17 -0
- package/src/styles/parts/frame.css +12 -0
- package/src/styles/parts/icon.css +39 -0
- package/src/styles/parts/menu.css +184 -0
- package/src/styles/parts/panel.css +7 -0
- package/src/styles/parts/progress.css +63 -0
- package/src/styles/parts/settings.css +2 -0
- package/src/styles/parts/sheet.css +28 -0
- package/src/styles/parts/text.css +34 -0
- package/src/text.ts +19 -0
- package/src/vocabulary.ts +4 -1
- package/template/plugin/package.json +1 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { USAGE_KEPT_MS } from "../agent-usage.js";
|
|
2
|
+
import { MAX_RUNNER_USAGE_WINDOWS, MAX_USAGE_WINDOW_NAME_LENGTH } from "../limits.js";
|
|
3
|
+
// What the runner makes of its product's allowance (ADR-0150, docs/specs/runner.md, "A usage
|
|
4
|
+
// limit"): a subscription allows so much within a window that resets, and a product that has
|
|
5
|
+
// used it up answers nobody until then. The runner tells its agent before, at a share of the
|
|
6
|
+
// window it decides, and brings the agent back after, by itself. What a driver says of the
|
|
7
|
+
// allowance is the product's own, read by shape and bounded there; here it is numbers and a
|
|
8
|
+
// few words, and nothing of it is run.
|
|
9
|
+
/**
|
|
10
|
+
* The shares of a window at which the agent is told how much of it is used: with a fifth left,
|
|
11
|
+
* when there is still room to end what is under way in order, and with a tenth left, when what
|
|
12
|
+
* is said to people is said now. Each once for a window, until it resets.
|
|
13
|
+
*/
|
|
14
|
+
export const USAGE_MARKS = [0.8, 0.9];
|
|
15
|
+
/**
|
|
16
|
+
* How long after the moment a product says its limit resets the runner brings its agent back:
|
|
17
|
+
* the machine's clock and the product's differ by less.
|
|
18
|
+
*/
|
|
19
|
+
export const RESET_MARGIN_MS = 60_000;
|
|
20
|
+
/** How many windows the runner keeps what it told of: more than any product names. */
|
|
21
|
+
const MAX_WINDOWS = 16;
|
|
22
|
+
/**
|
|
23
|
+
* What a product's own error says when what its subscription allows is used up until a window
|
|
24
|
+
* resets. Its words are its own and no contract: read by pattern, of an error of the product
|
|
25
|
+
* alone and never of what a model or a tool wrote, and held by the fixtures of the drivers.
|
|
26
|
+
* Narrow on purpose: a request the server throttles for a moment and a conversation that
|
|
27
|
+
* reached its length are limits too, and neither is this one.
|
|
28
|
+
*/
|
|
29
|
+
const USAGE_LIMIT = /\byou['\u2019]?ve (?:hit|reached) your ((?:[\w-]+ ){0,3})limit\b|\b(?:hit|reached) your (?:[\w-]+ ){0,2}usage limit\b|\busage limit (?:has been )?(?:reached|exceeded)\b|\busage_limit_reached\b/i;
|
|
30
|
+
/** What stands before "limit" in a limit that is another: a throttle, or a conversation's length. */
|
|
31
|
+
const ANOTHER_LIMIT = /\b(?:rate|request|context|token|output|length|size|message)\b/i;
|
|
32
|
+
/**
|
|
33
|
+
* Whether an error of a product's own says its usage limit is reached. Under a driver whose
|
|
34
|
+
* product names no reason, these words alone decide, and a limit read wrongly would be waited
|
|
35
|
+
* out for hours: "you've hit your rate limit" and "your context window limit" are not it.
|
|
36
|
+
*/
|
|
37
|
+
export const saysUsageLimit = (text) => {
|
|
38
|
+
const found = USAGE_LIMIT.exec(text.slice(0, 2000));
|
|
39
|
+
return found !== null && !(found[1] !== undefined && ANOTHER_LIMIT.test(found[1]));
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The mark a window has reached: the highest of `USAGE_MARKS` its share used is at or past; the
|
|
43
|
+
* first where the product says no share and says itself that the window is near its limit;
|
|
44
|
+
* none below the first, and none for a window used up, which the limit itself says.
|
|
45
|
+
*/
|
|
46
|
+
function markOf(window) {
|
|
47
|
+
if (window.used === undefined) {
|
|
48
|
+
return window.near === true ? USAGE_MARKS[0] : undefined;
|
|
49
|
+
}
|
|
50
|
+
if (window.used >= 1) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
let reached;
|
|
54
|
+
for (const mark of USAGE_MARKS) {
|
|
55
|
+
if (window.used >= mark) {
|
|
56
|
+
reached = mark;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return reached ?? (window.near === true ? USAGE_MARKS[0] : undefined);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Of what a product says of its windows, what the agent is to be told now, and what it then
|
|
63
|
+
* was told. A window is told once at each mark it reaches, at the highest alone where it passed
|
|
64
|
+
* several between two looks. What was told of a window stands until that window resets: until
|
|
65
|
+
* the moment it named has come and the product names a later one, or none, or its share is
|
|
66
|
+
* below the first mark again, so that a product whose reset moves with every look is told of
|
|
67
|
+
* once all the same. A moment that is past and named again is the same window still, a clock
|
|
68
|
+
* that runs ahead of the product's say: told of at every look, each telling would be a turn
|
|
69
|
+
* that spends the allowance it speaks of.
|
|
70
|
+
*/
|
|
71
|
+
export function usageToTell(windows, told, now) {
|
|
72
|
+
const next = new Map(told);
|
|
73
|
+
const tell = [];
|
|
74
|
+
for (const window of windows) {
|
|
75
|
+
// A quota kept apart from the session's own is shown and tells nothing: see `UsageWindow.apart`.
|
|
76
|
+
if (window.apart === true) {
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const before = next.get(window.name);
|
|
80
|
+
const mark = markOf(window);
|
|
81
|
+
const reset = before !== undefined &&
|
|
82
|
+
((before.resetsAt !== undefined &&
|
|
83
|
+
now >= before.resetsAt &&
|
|
84
|
+
(window.resetsAt === undefined || window.resetsAt > before.resetsAt)) ||
|
|
85
|
+
(window.used !== undefined && window.used < USAGE_MARKS[0] && window.near !== true));
|
|
86
|
+
if (reset) {
|
|
87
|
+
next.delete(window.name);
|
|
88
|
+
}
|
|
89
|
+
if (mark === undefined) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const stands = reset ? undefined : before;
|
|
93
|
+
if (stands !== undefined && stands.mark >= mark) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
// The oldest is let go where a driver names more windows than any product has.
|
|
97
|
+
if (!next.has(window.name) && next.size >= MAX_WINDOWS) {
|
|
98
|
+
const oldest = next.keys().next().value;
|
|
99
|
+
if (oldest !== undefined) {
|
|
100
|
+
next.delete(oldest);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
next.set(window.name, { mark, resetsAt: window.resetsAt });
|
|
104
|
+
tell.push({ window, mark });
|
|
105
|
+
}
|
|
106
|
+
return { tell, told: next };
|
|
107
|
+
}
|
|
108
|
+
/** What the runner says of its own, under a header that carries the session's mark. */
|
|
109
|
+
export const runnerSays = (mark, words) => `[console ${mark} · runner]\n${words}`;
|
|
110
|
+
/** A name of a window on one line, with nothing in it that ends a header or a line. */
|
|
111
|
+
const plain = (text) => text
|
|
112
|
+
.replaceAll(/[^\p{L}\p{N}._-]+/gu, " ")
|
|
113
|
+
.trim()
|
|
114
|
+
.slice(0, MAX_USAGE_WINDOW_NAME_LENGTH)
|
|
115
|
+
// Cut by its length in units, a letter of two may be cut in half: half a letter is no text.
|
|
116
|
+
.replace(/[\uD800-\uDBFF]$/u, "")
|
|
117
|
+
.trim();
|
|
118
|
+
/** A share as a whole number of hundredths, never more than was said: 0.899 is 89%. */
|
|
119
|
+
const percentOf = (share) => Math.floor(Math.max(0, Math.min(1, share)) * 100);
|
|
120
|
+
/** One window as a line says it: how much of it is used, and when it resets where that is known. */
|
|
121
|
+
function windowWords(window, moment) {
|
|
122
|
+
const share = window.used === undefined ? "near its limit" : `${percentOf(window.used)}% used`;
|
|
123
|
+
const resets = window.resetsAt === undefined
|
|
124
|
+
? ""
|
|
125
|
+
: `, which resets ${moment(new Date(window.resetsAt).toISOString())}`;
|
|
126
|
+
return `${share} in its ${plain(window.name)} window${resets}`;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* What the agent is told of its product's allowance before the limit (ADR-0150): how much of
|
|
130
|
+
* which window is used, when it resets, and what the limit does, which is what there is to
|
|
131
|
+
* plan by. A window of a part of the allowance, one model's week, is said in a sentence of its
|
|
132
|
+
* own: what it counts is said, and nothing of what to do, since that limit is the model's and
|
|
133
|
+
* what the agent makes of it is its own to decide. The words of the line, without its header.
|
|
134
|
+
*/
|
|
135
|
+
export function usageWords(tell, moment) {
|
|
136
|
+
const said = (which) => which.map((one) => windowWords(one.window, moment)).join("; and ");
|
|
137
|
+
const whole = tell.filter((one) => one.window.part !== true);
|
|
138
|
+
const parts = tell.filter((one) => one.window.part === true);
|
|
139
|
+
const words = [];
|
|
140
|
+
if (whole.length > 0) {
|
|
141
|
+
words.push(`Your product's allowance is ${said(whole)}. Everything signed in with it draws on it, each sub-agent you start too. At the limit your turn ends where it is and you answer nobody until the reset; the runner brings you back then by itself, with what reached you meanwhile. Nothing is asked of you now. Plan by it: where someone waits on you, or work would be cut in the middle, say so and leave it where you can pick it up, before then.`);
|
|
142
|
+
}
|
|
143
|
+
if (parts.length > 0) {
|
|
144
|
+
words.push(`Your product's allowance for one model is ${said(parts)}. Requests to that model alone are counted on it, beside the plan's own windows. What you do about it is yours to decide.`);
|
|
145
|
+
}
|
|
146
|
+
return words.join(" ");
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* What the agent is told when it is handed something again after a usage limit stopped it
|
|
150
|
+
* (ADR-0150), ahead of what reached it meanwhile: that it was stopped and from when, that its
|
|
151
|
+
* turn and its sub-agents ended where they were, and whether the limit is over. The words,
|
|
152
|
+
* without a header.
|
|
153
|
+
*/
|
|
154
|
+
export function limitWords(limited, options) {
|
|
155
|
+
const at = (ms) => options.moment(new Date(ms).toISOString());
|
|
156
|
+
const early = options.early === true;
|
|
157
|
+
const stopped = `Your product's usage limit stopped you at ${at(limited.since)}: your turn ended where it was, and so did every sub-agent it had started, since they draw on the one allowance.`;
|
|
158
|
+
const now = early
|
|
159
|
+
? `${limited.until === undefined ? "The product did not say when the limit resets" : `The product said the limit resets ${at(limited.until)}`}, and a supervisor's message is tried now all the same: where the limit still stands this is not read, and the runner hands it to you again when it brings you back.`
|
|
160
|
+
: limited.until === undefined
|
|
161
|
+
? `The product did not say when the limit resets, so the runner tries now, ${at(options.now)}, by itself.`
|
|
162
|
+
: `The limit reset ${at(limited.until)}, and the runner brings you back by itself.`;
|
|
163
|
+
const meanwhile = early
|
|
164
|
+
? "The message follows; what else reached you meanwhile is kept, and handed to you then."
|
|
165
|
+
: options.follow === 0
|
|
166
|
+
? "Nothing reached you meanwhile."
|
|
167
|
+
: "What reached you meanwhile follows, in the order it came, what you were handed as the limit was reached and had not read among it.";
|
|
168
|
+
return `${stopped} ${now} Go on with what you were doing: look at what each sub-agent left before you start it again. ${meanwhile}`;
|
|
169
|
+
}
|
|
170
|
+
/** The first moment a console no longer reads as one: the year 10000, which a moment written out has no place for. */
|
|
171
|
+
const MOMENTS_END = Date.UTC(10_000, 0, 1);
|
|
172
|
+
/** A moment the console takes, or nothing: what a product says is its own, and one number out of range would cost the heartbeat. */
|
|
173
|
+
const momentOf = (ms) => ms !== undefined && Number.isFinite(ms) && ms > 0 && ms < MOMENTS_END
|
|
174
|
+
? Math.floor(ms)
|
|
175
|
+
: undefined;
|
|
176
|
+
/**
|
|
177
|
+
* Notes what the product says of its windows, for the console to be told (ADR-0156). What a
|
|
178
|
+
* product says is sparse: a window it says nothing of this time stands as it was last said. As
|
|
179
|
+
* many windows are kept as a heartbeat carries, the first said, and one without a name is none.
|
|
180
|
+
*/
|
|
181
|
+
export function noteUsage(seen, windows, now) {
|
|
182
|
+
for (const window of windows) {
|
|
183
|
+
const name = plain(window.name);
|
|
184
|
+
if (name.length === 0 || (!seen.has(name) && seen.size >= MAX_RUNNER_USAGE_WINDOWS)) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
seen.set(name, { window, at: now });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* The windows as the console is told of them with the heartbeat. One whose reset has passed is
|
|
192
|
+
* let go: what was said of it is of a window that is over, and the product says the next one
|
|
193
|
+
* when it is next asked. And so is one that names no reset and was last said longer ago than
|
|
194
|
+
* any window lasts: a product that changed what it counts, a plan without the short window
|
|
195
|
+
* say, says the old window no more, and what it once said of it would stand for good.
|
|
196
|
+
*/
|
|
197
|
+
export function usageSaid(seen, now) {
|
|
198
|
+
const said = [];
|
|
199
|
+
for (const [name, { window, at }] of [...seen]) {
|
|
200
|
+
const resetsAt = momentOf(window.resetsAt);
|
|
201
|
+
if (resetsAt === undefined ? now - at > USAGE_KEPT_MS : resetsAt <= now) {
|
|
202
|
+
seen.delete(name);
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const used = window.used === undefined || !Number.isFinite(window.used)
|
|
206
|
+
? null
|
|
207
|
+
: Math.max(0, Math.min(1, window.used));
|
|
208
|
+
said.push({
|
|
209
|
+
name,
|
|
210
|
+
used,
|
|
211
|
+
resetsAt: resetsAt === undefined ? null : new Date(resetsAt).toISOString(),
|
|
212
|
+
...(window.near === true ? { near: true } : {}),
|
|
213
|
+
at: new Date(at).toISOString(),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return said;
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL=usage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/runner/usage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAGtF,6FAA6F;AAC7F,6FAA6F;AAC7F,6FAA6F;AAC7F,2FAA2F;AAC3F,4FAA4F;AAC5F,uCAAuC;AAEvC;;;;GAIG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AAC;YACxE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YAClB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GACR,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;YACxD,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC;YACR,IAAI;YACJ,IAAI;YACJ,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE;YAC1E,GAAG,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,EAAE,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -4,15 +4,15 @@ export { createCodexDriver } from "./runner/codex.js";
|
|
|
4
4
|
export { DEFAULT_RUNNER_CONFIG, parseRunnerConfig, type RunnerConfig, runnerConfigSchema, } from "./runner/config.js";
|
|
5
5
|
export { DESK_FOLDER, DESK_SECTIONS, type DeskInput, deskFiles, deskServicesOf, deskWebTitleOf, PERSON_DESK_SECTIONS, type PersonDeskInput, personDeskFiles, } from "./runner/desk.js";
|
|
6
6
|
export { LAUNCHD_LABEL, launchd, launchdUnit } from "./runner/launchd.js";
|
|
7
|
-
export { type Attached, attachedLine, composeSignals, deskName, fenced, GROUP_WINDOW_MS, headerOf, introOf, MAX_GROUP_LENGTH, MAX_GROUP_SIGNALS, makeMark, } from "./runner/message.js";
|
|
7
|
+
export { type Attached, attachedLine, composeSignals, deskName, fenced, GROUP_WINDOW_MS, headerOf, introOf, MAX_GROUP_LENGTH, MAX_GROUP_SIGNALS, makeMark, wakePartsOf, wakeTextOf, } from "./runner/message.js";
|
|
8
8
|
export { ownRunnerModules } from "./runner/modules.js";
|
|
9
9
|
export { createSpawn } from "./runner/process.js";
|
|
10
10
|
export { cutShown, cutShownEnd, formsOf, MAX_CUT_WINDOW, type Redactor, redactorOf, WITHHELD, } from "./runner/redact.js";
|
|
11
11
|
export { createRegistry, createRunnerModules, type DriverHost, type Registry, type RunnerModules, } from "./runner/registry.js";
|
|
12
|
-
export { AUTOSAVE_MESSAGE, BATCH_MS, COOL_DOWN_MS, createRunner, HEARTBEAT_MS, HOLD_MS, MAX_COOL_DOWN_MS, MAX_HOLD_MS, type Runner, type RunnerClient, type RunnerOptions, type RunnerState, } from "./runner/runner.js";
|
|
13
|
-
export { SLACK_APP_TOKEN, slack, slackWakeOf } from "./runner/slack.js";
|
|
12
|
+
export { AUTOSAVE_MESSAGE, BATCH_MS, COOL_DOWN_MS, createRunner, HEARTBEAT_MS, HOLD_MS, MAX_COOL_DOWN_MS, MAX_HOLD_MS, REPORT_MS, type Runner, type RunnerClient, type RunnerOptions, type RunnerState, SUBAGENTS_MS, } from "./runner/runner.js";
|
|
13
|
+
export { SLACK_APP_TOKEN, SLACK_USER_TOKEN, type SlackWake, slack, slackWakeOf, } from "./runner/slack.js";
|
|
14
14
|
export { SYSTEMD_UNIT, systemdUnit, systemdUser } from "./runner/systemd-user.js";
|
|
15
15
|
export { KEPT_LOGS, logKeeper, MAX_LOG_BYTES, TASK_NAME, taskDefinition, taskNameOf, taskScheduler, taskScript, } from "./runner/task-scheduler.js";
|
|
16
|
-
export type { Boundary, Child, Cut, Driver, DriverEvent, DriverMessage, DriverSession, Fact, Picture, Probe, Service, ServiceCommand, ServiceInput, ServicePlan, Spawn, StartOptions, WakeHost, WakeSocket, WakeSource, } from "./runner/types.js";
|
|
16
|
+
export type { Boundary, Child, Cut, Driver, DriverEvent, DriverMessage, DriverSession, Fact, Picture, Probe, RaisedWake, Service, ServiceCommand, ServiceInput, ServicePlan, Spawn, StartOptions, WakeAccount, WakeHost, WakePart, WakeRead, WakeSocket, WakeSource, WakeWriter, } from "./runner/types.js";
|
|
17
17
|
export { errorsShown, KEEPER_VARIABLE, MAX_ERRORS_SHOWN, plainCut, plainCutEnd, } from "./runner/types.js";
|
|
18
18
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,YAAY,EACjB,kBAAkB,GACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,SAAS,EACd,SAAS,EACT,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,KAAK,eAAe,EACpB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EACL,KAAK,QAAQ,EACb,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,eAAe,EA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AAC5B,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,EACL,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,aAAa,EACb,UAAU,GACX,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,QAAQ,EACR,KAAK,EACL,GAAG,EACH,MAAM,EACN,WAAW,EACX,aAAa,EACb,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,YAAY,EACZ,WAAW,EACX,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,QAAQ,EACR,WAAW,GACZ,MAAM,mBAAmB,CAAC"}
|
package/dist/runner.js
CHANGED
|
@@ -7,13 +7,13 @@ export { createCodexDriver } from "./runner/codex.js";
|
|
|
7
7
|
export { DEFAULT_RUNNER_CONFIG, parseRunnerConfig, runnerConfigSchema, } from "./runner/config.js";
|
|
8
8
|
export { DESK_FOLDER, DESK_SECTIONS, deskFiles, deskServicesOf, deskWebTitleOf, PERSON_DESK_SECTIONS, personDeskFiles, } from "./runner/desk.js";
|
|
9
9
|
export { LAUNCHD_LABEL, launchd, launchdUnit } from "./runner/launchd.js";
|
|
10
|
-
export { attachedLine, composeSignals, deskName, fenced, GROUP_WINDOW_MS, headerOf, introOf, MAX_GROUP_LENGTH, MAX_GROUP_SIGNALS, makeMark, } from "./runner/message.js";
|
|
10
|
+
export { attachedLine, composeSignals, deskName, fenced, GROUP_WINDOW_MS, headerOf, introOf, MAX_GROUP_LENGTH, MAX_GROUP_SIGNALS, makeMark, wakePartsOf, wakeTextOf, } from "./runner/message.js";
|
|
11
11
|
export { ownRunnerModules } from "./runner/modules.js";
|
|
12
12
|
export { createSpawn } from "./runner/process.js";
|
|
13
13
|
export { cutShown, cutShownEnd, formsOf, MAX_CUT_WINDOW, redactorOf, WITHHELD, } from "./runner/redact.js";
|
|
14
14
|
export { createRegistry, createRunnerModules, } from "./runner/registry.js";
|
|
15
|
-
export { AUTOSAVE_MESSAGE, BATCH_MS, COOL_DOWN_MS, createRunner, HEARTBEAT_MS, HOLD_MS, MAX_COOL_DOWN_MS, MAX_HOLD_MS, } from "./runner/runner.js";
|
|
16
|
-
export { SLACK_APP_TOKEN, slack, slackWakeOf } from "./runner/slack.js";
|
|
15
|
+
export { AUTOSAVE_MESSAGE, BATCH_MS, COOL_DOWN_MS, createRunner, HEARTBEAT_MS, HOLD_MS, MAX_COOL_DOWN_MS, MAX_HOLD_MS, REPORT_MS, SUBAGENTS_MS, } from "./runner/runner.js";
|
|
16
|
+
export { SLACK_APP_TOKEN, SLACK_USER_TOKEN, slack, slackWakeOf, } from "./runner/slack.js";
|
|
17
17
|
export { SYSTEMD_UNIT, systemdUnit, systemdUser } from "./runner/systemd-user.js";
|
|
18
18
|
export { KEPT_LOGS, logKeeper, MAX_LOG_BYTES, TASK_NAME, taskDefinition, taskNameOf, taskScheduler, taskScript, } from "./runner/task-scheduler.js";
|
|
19
19
|
export { errorsShown, KEEPER_VARIABLE, MAX_ERRORS_SHOWN, plainCut, plainCutEnd, } from "./runner/types.js";
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,4FAA4F;AAC5F,yEAAyE;AAEzE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oB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