crewly 1.20.354 → 1.20.356
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/config/roles/team-leader/prompt.md +1 -1
- package/config/roles/team-leader/tl-addon.md +1 -1
- package/config/skills/team-leader/delegate-task/SKILL.md +23 -1
- package/config/skills/team-leader/delegate-task/execute.sh +44 -1
- package/config/skills/team-leader/delegate-task/execute.test.sh +95 -1
- package/dist/backend/backend/src/constants.d.ts +71 -0
- package/dist/backend/backend/src/constants.d.ts.map +1 -1
- package/dist/backend/backend/src/constants.js +71 -0
- package/dist/backend/backend/src/constants.js.map +1 -1
- package/dist/backend/backend/src/controllers/agent-hooks/agent-hooks.controller.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/agent-hooks/agent-hooks.controller.js +10 -0
- package/dist/backend/backend/src/controllers/agent-hooks/agent-hooks.controller.js.map +1 -1
- package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.js +7 -0
- package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.js.map +1 -1
- package/dist/backend/backend/src/controllers/team/team.controller.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/team/team.controller.js +5 -0
- package/dist/backend/backend/src/controllers/team/team.controller.js.map +1 -1
- package/dist/backend/backend/src/index.d.ts +15 -0
- package/dist/backend/backend/src/index.d.ts.map +1 -1
- package/dist/backend/backend/src/index.js +68 -11
- package/dist/backend/backend/src/index.js.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts +11 -0
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js +73 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/oauth-relogin-monitor.service.d.ts +9 -1
- package/dist/backend/backend/src/services/agent/oauth-relogin-monitor.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/oauth-relogin-monitor.service.js +60 -4
- package/dist/backend/backend/src/services/agent/oauth-relogin-monitor.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/resource-mode-protection.d.ts +22 -0
- package/dist/backend/backend/src/services/agent/resource-mode-protection.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/resource-mode-protection.js +33 -0
- package/dist/backend/backend/src/services/agent/resource-mode-protection.js.map +1 -1
- package/dist/backend/backend/src/services/agent/resource-mode.service.d.ts +50 -3
- package/dist/backend/backend/src/services/agent/resource-mode.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/resource-mode.service.js +92 -10
- package/dist/backend/backend/src/services/agent/resource-mode.service.js.map +1 -1
- package/dist/backend/backend/src/services/harness/harness-relogin.service.d.ts +23 -0
- package/dist/backend/backend/src/services/harness/harness-relogin.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/harness/harness-relogin.service.js +47 -6
- package/dist/backend/backend/src/services/harness/harness-relogin.service.js.map +1 -1
- package/dist/backend/backend/src/services/messaging/deferred-start-retry.d.ts +14 -2
- package/dist/backend/backend/src/services/messaging/deferred-start-retry.d.ts.map +1 -1
- package/dist/backend/backend/src/services/messaging/deferred-start-retry.js +21 -4
- package/dist/backend/backend/src/services/messaging/deferred-start-retry.js.map +1 -1
- package/dist/backend/backend/src/services/messaging/queue-processor.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/messaging/queue-processor.service.js +10 -1
- package/dist/backend/backend/src/services/messaging/queue-processor.service.js.map +1 -1
- package/dist/backend/backend/src/services/open-items/open-items.service.d.ts +8 -0
- package/dist/backend/backend/src/services/open-items/open-items.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/open-items/open-items.service.js +33 -0
- package/dist/backend/backend/src/services/open-items/open-items.service.js.map +1 -1
- package/dist/backend/backend/src/services/open-items/open-items.wiring.js +2 -2
- package/dist/backend/backend/src/services/open-items/open-items.wiring.js.map +1 -1
- package/dist/backend/backend/src/services/open-items/question-card-gate.d.ts +49 -0
- package/dist/backend/backend/src/services/open-items/question-card-gate.d.ts.map +1 -0
- package/dist/backend/backend/src/services/open-items/question-card-gate.js +77 -0
- package/dist/backend/backend/src/services/open-items/question-card-gate.js.map +1 -0
- package/dist/backend/backend/src/services/orchestrator/orchestrator-heartbeat-monitor.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/orchestrator/orchestrator-heartbeat-monitor.service.js +10 -0
- package/dist/backend/backend/src/services/orchestrator/orchestrator-heartbeat-monitor.service.js.map +1 -1
- package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.d.ts +2 -0
- package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.js +17 -0
- package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.js.map +1 -1
- package/dist/backend/backend/src/services/orchestrator/orchestrator-status.service.d.ts +7 -0
- package/dist/backend/backend/src/services/orchestrator/orchestrator-status.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/orchestrator/orchestrator-status.service.js +22 -10
- package/dist/backend/backend/src/services/orchestrator/orchestrator-status.service.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/effective-runtime.d.ts +16 -0
- package/dist/backend/backend/src/services/runtime-fallback/effective-runtime.d.ts.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/effective-runtime.js +23 -0
- package/dist/backend/backend/src/services/runtime-fallback/effective-runtime.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/reset-time.d.ts +2 -1
- package/dist/backend/backend/src/services/runtime-fallback/reset-time.d.ts.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/reset-time.js +3 -2
- package/dist/backend/backend/src/services/runtime-fallback/reset-time.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.service.d.ts +101 -5
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.service.js +247 -19
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.service.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.wiring.d.ts.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.wiring.js +10 -2
- package/dist/backend/backend/src/services/runtime-fallback/runtime-fallback.wiring.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-rules.d.ts +78 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-rules.d.ts.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-rules.js +159 -1
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-rules.js.map +1 -1
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-screen.d.ts +63 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-screen.d.ts.map +1 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-screen.js +104 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-screen.js.map +1 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-state.d.ts +166 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-state.d.ts.map +1 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-state.js +207 -0
- package/dist/backend/backend/src/services/runtime-fallback/usage-limit-state.js.map +1 -0
- package/dist/backend/backend/src/services/session/tui-input-guard.d.ts +3 -1
- package/dist/backend/backend/src/services/session/tui-input-guard.d.ts.map +1 -1
- package/dist/backend/backend/src/services/session/tui-input-guard.js +11 -2
- package/dist/backend/backend/src/services/session/tui-input-guard.js.map +1 -1
- package/dist/backend/backend/src/services/v3/workitem-dispatch.subscriber.d.ts.map +1 -1
- package/dist/backend/backend/src/services/v3/workitem-dispatch.subscriber.js +13 -0
- package/dist/backend/backend/src/services/v3/workitem-dispatch.subscriber.js.map +1 -1
- package/dist/backend/backend/src/services/workflow/scheduler.service.d.ts +22 -0
- package/dist/backend/backend/src/services/workflow/scheduler.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/workflow/scheduler.service.js +35 -1
- package/dist/backend/backend/src/services/workflow/scheduler.service.js.map +1 -1
- package/dist/backend/backend/src/types/index.d.ts +12 -0
- package/dist/backend/backend/src/types/index.d.ts.map +1 -1
- package/dist/backend/backend/src/types/index.js.map +1 -1
- package/dist/backend/backend/src/types/team-template.types.d.ts +1 -0
- package/dist/backend/backend/src/types/team-template.types.d.ts.map +1 -1
- package/dist/backend/backend/src/types/team-template.types.js.map +1 -1
- package/dist/backend/build-info.json +2 -2
- package/dist/cli/backend/src/constants.d.ts +71 -0
- package/dist/cli/backend/src/constants.d.ts.map +1 -1
- package/dist/cli/backend/src/constants.js +71 -0
- package/dist/cli/backend/src/constants.js.map +1 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.d.ts +11 -0
- package/dist/cli/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.js +73 -1
- package/dist/cli/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/cli/backend/src/services/agent/oauth-relogin-monitor.service.d.ts +9 -1
- package/dist/cli/backend/src/services/agent/oauth-relogin-monitor.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/agent/oauth-relogin-monitor.service.js +60 -4
- package/dist/cli/backend/src/services/agent/oauth-relogin-monitor.service.js.map +1 -1
- package/dist/cli/backend/src/services/agent/resource-mode.service.d.ts +50 -3
- package/dist/cli/backend/src/services/agent/resource-mode.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/agent/resource-mode.service.js +92 -10
- package/dist/cli/backend/src/services/agent/resource-mode.service.js.map +1 -1
- package/dist/cli/backend/src/services/harness/harness-relogin.service.d.ts +23 -0
- package/dist/cli/backend/src/services/harness/harness-relogin.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/harness/harness-relogin.service.js +47 -6
- package/dist/cli/backend/src/services/harness/harness-relogin.service.js.map +1 -1
- package/dist/cli/backend/src/services/messaging/queue-processor.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/messaging/queue-processor.service.js +10 -1
- package/dist/cli/backend/src/services/messaging/queue-processor.service.js.map +1 -1
- package/dist/cli/backend/src/services/open-items/open-items.service.d.ts +8 -0
- package/dist/cli/backend/src/services/open-items/open-items.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/open-items/open-items.service.js +33 -0
- package/dist/cli/backend/src/services/open-items/open-items.service.js.map +1 -1
- package/dist/cli/backend/src/services/open-items/question-card-gate.d.ts +49 -0
- package/dist/cli/backend/src/services/open-items/question-card-gate.d.ts.map +1 -0
- package/dist/cli/backend/src/services/open-items/question-card-gate.js +77 -0
- package/dist/cli/backend/src/services/open-items/question-card-gate.js.map +1 -0
- package/dist/cli/backend/src/services/orchestrator/orchestrator-restart.service.d.ts +2 -0
- package/dist/cli/backend/src/services/orchestrator/orchestrator-restart.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/orchestrator/orchestrator-restart.service.js +17 -0
- package/dist/cli/backend/src/services/orchestrator/orchestrator-restart.service.js.map +1 -1
- package/dist/cli/backend/src/services/orchestrator/orchestrator-status.service.d.ts +7 -0
- package/dist/cli/backend/src/services/orchestrator/orchestrator-status.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/orchestrator/orchestrator-status.service.js +22 -10
- package/dist/cli/backend/src/services/orchestrator/orchestrator-status.service.js.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/effective-runtime.d.ts +16 -0
- package/dist/cli/backend/src/services/runtime-fallback/effective-runtime.d.ts.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/effective-runtime.js +23 -0
- package/dist/cli/backend/src/services/runtime-fallback/effective-runtime.js.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/reset-time.d.ts +2 -1
- package/dist/cli/backend/src/services/runtime-fallback/reset-time.d.ts.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/reset-time.js +3 -2
- package/dist/cli/backend/src/services/runtime-fallback/reset-time.js.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-rules.d.ts +78 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-rules.d.ts.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-rules.js +159 -1
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-rules.js.map +1 -1
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-screen.d.ts +63 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-screen.d.ts.map +1 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-screen.js +104 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-screen.js.map +1 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-state.d.ts +166 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-state.d.ts.map +1 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-state.js +207 -0
- package/dist/cli/backend/src/services/runtime-fallback/usage-limit-state.js.map +1 -0
- package/dist/cli/backend/src/services/session/tui-input-guard.d.ts +3 -1
- package/dist/cli/backend/src/services/session/tui-input-guard.d.ts.map +1 -1
- package/dist/cli/backend/src/services/session/tui-input-guard.js +11 -2
- package/dist/cli/backend/src/services/session/tui-input-guard.js.map +1 -1
- package/dist/cli/backend/src/types/index.d.ts +12 -0
- package/dist/cli/backend/src/types/index.d.ts.map +1 -1
- package/dist/cli/backend/src/types/index.js.map +1 -1
- package/dist/cli/backend/src/types/team-template.types.d.ts +1 -0
- package/dist/cli/backend/src/types/team-template.types.d.ts.map +1 -1
- package/dist/cli/backend/src/types/team-template.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-limit-rules.js","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"usage-limit-rules.js","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAyB,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAWjD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAoB;IACpD,OAAO,IAAI,KAAK,aAAa,IAAI,IAAI,KAAK,SAAS,CAAC;AACrD,CAAC;AAyBD,iFAAiF;AACjF,MAAM,iBAAiB,GAAG,2IAA2I,CAAC;AACtK,2DAA2D;AAC3D,MAAM,cAAc,GAAG,yCAAyC,CAAC;AACjE,yDAAyD;AACzD,MAAM,aAAa,GAAG,oJAAoJ,CAAC;AAE3K,8DAA8D;AAC9D,MAAM,CAAC,MAAM,kBAAkB,GAA8B;IAC5D;QACC,EAAE,EAAE,sBAAsB;QAC1B,OAAO,EAAE,aAAa,CAAC,WAAW;QAClC,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,CAAC,mCAAmC,EAAE,cAAc,EAAE,aAAa,CAAC;KACzE;IACD;QACC,EAAE,EAAE,2BAA2B;QAC/B,OAAO,EAAE,aAAa,CAAC,WAAW;QAClC,IAAI,EAAE,SAAS;QACf,GAAG,EAAE,CAAC,mCAAmC,EAAE,yCAAyC,CAAC;KACrF;IACD;QACC,EAAE,EAAE,6BAA6B;QACjC,OAAO,EAAE,aAAa,CAAC,WAAW;QAClC,IAAI,EAAE,aAAa;QACnB,GAAG,EAAE,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EAAyE,CAAC;AAE/F;;;;;GAKG;AACH,SAAS,aAAa,CAAC,IAAY;IAClC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,OAAO,IAAI,KAAK,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrD,CAAC;AAED,iFAAiF;AACjF,MAAM,kBAAkB,GAAG,6GAA6G,CAAC;AAEzI;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAc,EAAE,OAAe,EAAE,MAAc,IAAI,CAAC,GAAG,EAAE;IAC9F,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9E,IAAI,IAAI,CAAC,MAAM,GAAG,2BAA2B,CAAC,sBAAsB;QAAE,OAAO,KAAK,CAAC;IACnF,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAChD,OAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an agent's screen for a usage-limit state, record it, and answer
|
|
3
|
+
* Claude Code's usage-limit menu.
|
|
4
|
+
*
|
|
5
|
+
* One entry point ({@link inspectUsageLimitScreen}) for every place that
|
|
6
|
+
* already reads an agent's screen: the login/screen monitor's 30s sweep, the
|
|
7
|
+
* orchestrator heartbeat, and the delivery wait for a prompt. Detection is
|
|
8
|
+
* {@link detectUsageLimitScreen}; the state is {@link markUsageLimited}.
|
|
9
|
+
*
|
|
10
|
+
* The menu ("❯ 1. Stop and wait for limit to reset / 2. Wait here, then
|
|
11
|
+
* continue automatically at 8pm") is answered with option 2, like the other
|
|
12
|
+
* known start-up prompts are answered with the one right choice for an
|
|
13
|
+
* unattended agent: the turn waits and goes on by itself at the reset, so
|
|
14
|
+
* nobody has to come back and re-send it. Only while option 1 or 2 is the
|
|
15
|
+
* highlighted one, once per state, and Enter is pressed only after the
|
|
16
|
+
* screen shows option 2 highlighted.
|
|
17
|
+
*
|
|
18
|
+
* @module services/runtime-fallback/usage-limit-screen
|
|
19
|
+
*/
|
|
20
|
+
import { type UsageLimitedInfo } from './usage-limit-state.js';
|
|
21
|
+
/** Keys and screen access, to answer the menu. */
|
|
22
|
+
export interface UsageLimitMenuIO {
|
|
23
|
+
sendKey(sessionName: string, key: string): Promise<void>;
|
|
24
|
+
sendEnter(sessionName: string): Promise<void>;
|
|
25
|
+
/** Current screen of the session */
|
|
26
|
+
capture(sessionName: string): string;
|
|
27
|
+
}
|
|
28
|
+
/** Minimal logger. */
|
|
29
|
+
export interface UsageLimitScreenLogger {
|
|
30
|
+
info(message: string, context?: Record<string, unknown>): void;
|
|
31
|
+
warn(message: string, context?: Record<string, unknown>): void;
|
|
32
|
+
}
|
|
33
|
+
/** Options of {@link inspectUsageLimitScreen}. */
|
|
34
|
+
export interface InspectUsageLimitOptions {
|
|
35
|
+
/** Keys + capture; without it the menu is left alone */
|
|
36
|
+
io?: UsageLimitMenuIO;
|
|
37
|
+
logger?: UsageLimitScreenLogger;
|
|
38
|
+
now?: number;
|
|
39
|
+
/** Zone for reset clock times that name none */
|
|
40
|
+
timeZone?: string;
|
|
41
|
+
/** Hand a new detection to the runtime fallback (default true) */
|
|
42
|
+
reportToFallback?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Look at a session's screen for a usage-limit state. On a match the state
|
|
46
|
+
* is recorded (a new one is logged and handed to the runtime fallback, which
|
|
47
|
+
* may move the agent to another runtime) and an open usage-limit menu is
|
|
48
|
+
* answered. Never throws.
|
|
49
|
+
*
|
|
50
|
+
* @param sessionName - Session
|
|
51
|
+
* @param screen - Captured screen
|
|
52
|
+
* @param runtime - Runtime the session runs (null when unknown: nothing is detected)
|
|
53
|
+
* @param options - Keys, logger, clock
|
|
54
|
+
* @returns The state in force (also one recorded earlier), or null
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const limited = await inspectUsageLimitScreen('crewly-orc', screen, 'claude-code', { io });
|
|
59
|
+
* if (limited) return; // do not restart / wait / write
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function inspectUsageLimitScreen(sessionName: string, screen: string, runtime: string | null, options?: InspectUsageLimitOptions): Promise<UsageLimitedInfo | null>;
|
|
63
|
+
//# sourceMappingURL=usage-limit-screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-limit-screen.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,EAA8D,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE3H,kDAAkD;AAClD,MAAM,WAAW,gBAAgB;IAChC,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,oCAAoC;IACpC,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED,sBAAsB;AACtB,MAAM,WAAW,sBAAsB;IACtC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC/D;AAED,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACxC,wDAAwD;IACxD,EAAE,CAAC,EAAE,gBAAgB,CAAC;IACtB,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC3B;AAwBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,uBAAuB,CAC5C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,GAAE,wBAA6B,GACpC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAwClC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read an agent's screen for a usage-limit state, record it, and answer
|
|
3
|
+
* Claude Code's usage-limit menu.
|
|
4
|
+
*
|
|
5
|
+
* One entry point ({@link inspectUsageLimitScreen}) for every place that
|
|
6
|
+
* already reads an agent's screen: the login/screen monitor's 30s sweep, the
|
|
7
|
+
* orchestrator heartbeat, and the delivery wait for a prompt. Detection is
|
|
8
|
+
* {@link detectUsageLimitScreen}; the state is {@link markUsageLimited}.
|
|
9
|
+
*
|
|
10
|
+
* The menu ("❯ 1. Stop and wait for limit to reset / 2. Wait here, then
|
|
11
|
+
* continue automatically at 8pm") is answered with option 2, like the other
|
|
12
|
+
* known start-up prompts are answered with the one right choice for an
|
|
13
|
+
* unattended agent: the turn waits and goes on by itself at the reset, so
|
|
14
|
+
* nobody has to come back and re-send it. Only while option 1 or 2 is the
|
|
15
|
+
* highlighted one, once per state, and Enter is pressed only after the
|
|
16
|
+
* screen shows option 2 highlighted.
|
|
17
|
+
*
|
|
18
|
+
* @module services/runtime-fallback/usage-limit-screen
|
|
19
|
+
*/
|
|
20
|
+
import { USAGE_LIMIT_STATE_CONSTANTS } from '../../constants.js';
|
|
21
|
+
import { delay } from '../../utils/async.utils.js';
|
|
22
|
+
import { reportRuntimeOutput } from './effective-runtime.js';
|
|
23
|
+
import { detectUsageLimitScreen } from './usage-limit-rules.js';
|
|
24
|
+
import { markUsageLimited, noteUsageLimitMenuAnswered, usageLimitOf } from './usage-limit-state.js';
|
|
25
|
+
/** `❯` on option 2 of the usage-limit menu. */
|
|
26
|
+
const OPTION_2_SELECTED = /❯\s*2\.\s*Wait\s*here/i;
|
|
27
|
+
/**
|
|
28
|
+
* Answer the usage-limit menu with option 2 ("Wait here, then continue
|
|
29
|
+
* automatically"). Down + check + Enter from option 1; Enter from option 2.
|
|
30
|
+
*
|
|
31
|
+
* @param sessionName - Session
|
|
32
|
+
* @param selected - Highlighted option
|
|
33
|
+
* @param io - Keys + capture
|
|
34
|
+
* @returns True when Enter was pressed on option 2
|
|
35
|
+
*/
|
|
36
|
+
async function answerMenu(sessionName, selected, io) {
|
|
37
|
+
if (selected === 1) {
|
|
38
|
+
await io.sendKey(sessionName, 'Down');
|
|
39
|
+
await delay(USAGE_LIMIT_STATE_CONSTANTS.MENU_KEY_DELAY_MS);
|
|
40
|
+
if (!OPTION_2_SELECTED.test(io.capture(sessionName)))
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
await io.sendEnter(sessionName);
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Look at a session's screen for a usage-limit state. On a match the state
|
|
48
|
+
* is recorded (a new one is logged and handed to the runtime fallback, which
|
|
49
|
+
* may move the agent to another runtime) and an open usage-limit menu is
|
|
50
|
+
* answered. Never throws.
|
|
51
|
+
*
|
|
52
|
+
* @param sessionName - Session
|
|
53
|
+
* @param screen - Captured screen
|
|
54
|
+
* @param runtime - Runtime the session runs (null when unknown: nothing is detected)
|
|
55
|
+
* @param options - Keys, logger, clock
|
|
56
|
+
* @returns The state in force (also one recorded earlier), or null
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const limited = await inspectUsageLimitScreen('crewly-orc', screen, 'claude-code', { io });
|
|
61
|
+
* if (limited) return; // do not restart / wait / write
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export async function inspectUsageLimitScreen(sessionName, screen, runtime, options = {}) {
|
|
65
|
+
const now = options.now ?? Date.now();
|
|
66
|
+
try {
|
|
67
|
+
const match = runtime ? detectUsageLimitScreen(screen, runtime, now, options.timeZone) : null;
|
|
68
|
+
if (!match)
|
|
69
|
+
return usageLimitOf(sessionName, now);
|
|
70
|
+
const { info, isNew } = markUsageLimited({ sessionName, runtime, ruleId: match.ruleId, resetAt: match.resetAt, source: match.menu ? 'menu' : 'screen' }, now);
|
|
71
|
+
if (isNew) {
|
|
72
|
+
options.logger?.warn('Agent runtime is out of usage — no restarts or deliveries until it resets', {
|
|
73
|
+
sessionName,
|
|
74
|
+
runtime,
|
|
75
|
+
rule: match.ruleId,
|
|
76
|
+
until: info.until ?? null,
|
|
77
|
+
retryAt: info.retryAt,
|
|
78
|
+
menu: match.menu !== null,
|
|
79
|
+
});
|
|
80
|
+
// The screen is live (bottom of it, a plausible reset): the fallback may
|
|
81
|
+
// move the agent to another runtime meanwhile.
|
|
82
|
+
if (options.reportToFallback !== false && runtime)
|
|
83
|
+
reportRuntimeOutput(sessionName, runtime, screen, 'output');
|
|
84
|
+
}
|
|
85
|
+
const selected = match.menu?.selected;
|
|
86
|
+
if (options.io && selected && !info.menuAnsweredAt) {
|
|
87
|
+
// Once per state: a menu that comes back is not pressed into again.
|
|
88
|
+
noteUsageLimitMenuAnswered(sessionName, now);
|
|
89
|
+
const answered = await answerMenu(sessionName, selected, options.io);
|
|
90
|
+
if (answered) {
|
|
91
|
+
options.logger?.info('Answered the usage-limit menu: wait and continue automatically at the reset', { sessionName, until: info.until ?? null });
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
options.logger?.warn('Usage-limit menu: could not select "Wait here, then continue automatically"; left as is', { sessionName });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return info;
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
options.logger?.warn('Usage-limit screen check failed (ignored)', { sessionName, error: err instanceof Error ? err.message : String(err) });
|
|
101
|
+
return usageLimitOf(sessionName, now);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=usage-limit-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-limit-screen.js","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-screen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,YAAY,EAAyB,MAAM,wBAAwB,CAAC;AA4B3H,+CAA+C;AAC/C,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEnD;;;;;;;;GAQG;AACH,KAAK,UAAU,UAAU,CAAC,WAAmB,EAAE,QAAe,EAAE,EAAoB;IACnF,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QACtC,MAAM,KAAK,CAAC,2BAA2B,CAAC,iBAAiB,CAAC,CAAC;QAC3D,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAA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AgB,KAAK,KAAK,IAAI,OAAO;gBAAE,mBAAmB,CAAC,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChH,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC;QACtC,IAAI,OAAO,CAAC,EAAE,IAAI,QAAQ,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACpD,oEAAoE;YACpE,0BAA0B,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YAC7C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;YACrE,IAAI,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,6EAA6E,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC;YACjJ,CAAC;iBAAM,CAAC;gBACP,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,yFAAyF,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC;YAClI,CAAC;QACF,CAAC;QACD,OAAO,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,2CAA2C,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5I,OAAO,YAAY,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACvC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage-limit state per agent session — "this agent's runtime is out of
|
|
3
|
+
* usage until …". Process-wide and dependency-free (like the spend-cap gate)
|
|
4
|
+
* so the hot paths can ask it cheaply: the orchestrator restart service and
|
|
5
|
+
* heartbeat monitor (no restarts while limited), delivery (no waiting on a
|
|
6
|
+
* prompt that will not come, messages held), dispatch, and the status APIs.
|
|
7
|
+
*
|
|
8
|
+
* Why (2026-10-16): the orchestrator sat on Claude Code's weekly-limit menu
|
|
9
|
+
* for ~38 hours. Crewly kept waiting for its prompt every ~17s, restarted it
|
|
10
|
+
* 12 times in 15 minutes, and `GET /api/orchestrator/status` said "active and
|
|
11
|
+
* ready" the whole time.
|
|
12
|
+
*
|
|
13
|
+
* Fed by the login/screen monitor (screen sweep + live output) through
|
|
14
|
+
* {@link markUsageLimited}. A state lifts on its own at the reset time (plus
|
|
15
|
+
* a short grace), or after {@link USAGE_LIMIT_STATE_CONSTANTS.NO_RESET_BACKOFF_MS}
|
|
16
|
+
* when no reset time was given; it is set again if the limit is still there.
|
|
17
|
+
* It is lifted early ({@link liftUsageLimit}) as soon as the agent works
|
|
18
|
+
* again: a finished turn or tool call (Claude Code hooks), or fresh live
|
|
19
|
+
* output that is not a limit message.
|
|
20
|
+
* It is held in memory only: it describes the live screen, and after a Crewly
|
|
21
|
+
* restart the screen is read again.
|
|
22
|
+
*
|
|
23
|
+
* Distinct from the runtime fallback's account-wide "exhausted runtime"
|
|
24
|
+
* record: that one moves agents to another runtime; this one says what a
|
|
25
|
+
* given session is doing right now. A session moved to another runtime is
|
|
26
|
+
* cleared ({@link clearUsageLimit}).
|
|
27
|
+
*
|
|
28
|
+
* @module services/runtime-fallback/usage-limit-state
|
|
29
|
+
*/
|
|
30
|
+
/** Where a usage-limit state was seen. */
|
|
31
|
+
export type UsageLimitSource = 'menu' | 'screen' | 'output';
|
|
32
|
+
/** A session that is out of usage. */
|
|
33
|
+
export interface UsageLimitedInfo {
|
|
34
|
+
/** Agent session */
|
|
35
|
+
sessionName: string;
|
|
36
|
+
/** Runtime that is out of usage (null when unknown) */
|
|
37
|
+
runtime: string | null;
|
|
38
|
+
/** Detection rule (logs only) */
|
|
39
|
+
ruleId: string;
|
|
40
|
+
/** Where it was seen */
|
|
41
|
+
source: UsageLimitSource;
|
|
42
|
+
/** ISO time of first detection */
|
|
43
|
+
detectedAt: string;
|
|
44
|
+
/** ISO time the limit was last seen (every detection refreshes it) */
|
|
45
|
+
lastSeenAt: string;
|
|
46
|
+
/** ISO time the runtime says the limit resets, when it says so */
|
|
47
|
+
until?: string;
|
|
48
|
+
/** ISO time the session may be tried again (reset + grace, or the backoff) */
|
|
49
|
+
retryAt: string;
|
|
50
|
+
/** ISO time Crewly answered the usage-limit menu, when it did */
|
|
51
|
+
menuAnsweredAt?: string;
|
|
52
|
+
}
|
|
53
|
+
/** Input of {@link markUsageLimited}. */
|
|
54
|
+
export interface MarkUsageLimitedInput {
|
|
55
|
+
sessionName: string;
|
|
56
|
+
runtime: string | null;
|
|
57
|
+
ruleId: string;
|
|
58
|
+
/** Reset time (epoch ms), or null when unknown */
|
|
59
|
+
resetAt: number | null;
|
|
60
|
+
source: UsageLimitSource;
|
|
61
|
+
}
|
|
62
|
+
/** API view of a usage-limited session (the `usageLimited` status field). */
|
|
63
|
+
export interface UsageLimitedView {
|
|
64
|
+
/** ISO reset time, when known */
|
|
65
|
+
until?: string;
|
|
66
|
+
/** ISO time Crewly tries the session again */
|
|
67
|
+
retryAt: string;
|
|
68
|
+
/** ISO time of first detection */
|
|
69
|
+
detectedAt: string;
|
|
70
|
+
/** Runtime that is out of usage */
|
|
71
|
+
runtime: string | null;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Record that a session is out of usage. A state already in force keeps its
|
|
75
|
+
* first-detection time; a reset time seen later replaces the backoff, and a
|
|
76
|
+
* later detection without one does not extend it.
|
|
77
|
+
*
|
|
78
|
+
* @param input - Session, runtime, rule, reset time, source
|
|
79
|
+
* @param now - Current time (ms)
|
|
80
|
+
* @returns The state and whether it is new (not in force before this call)
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* markUsageLimited({ sessionName: 'crewly-orc', runtime: 'claude-code', ruleId: 'claude.hit_your_limit', resetAt, source: 'menu' });
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export declare function markUsageLimited(input: MarkUsageLimitedInput, now?: number): {
|
|
88
|
+
info: UsageLimitedInfo;
|
|
89
|
+
isNew: boolean;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* The usage-limit state in force for a session. A state past its retry time
|
|
93
|
+
* is dropped. Never throws.
|
|
94
|
+
*
|
|
95
|
+
* @param sessionName - Agent session
|
|
96
|
+
* @param now - Current time (ms)
|
|
97
|
+
* @returns The state, or null when the session may run
|
|
98
|
+
*/
|
|
99
|
+
export declare function usageLimitOf(sessionName: string, now?: number): UsageLimitedInfo | null;
|
|
100
|
+
/**
|
|
101
|
+
* Milliseconds until a usage-limited session may be tried again.
|
|
102
|
+
*
|
|
103
|
+
* @param info - The state
|
|
104
|
+
* @param now - Current time (ms)
|
|
105
|
+
* @returns Milliseconds (at least 0)
|
|
106
|
+
*/
|
|
107
|
+
export declare function usageLimitRemainingMs(info: UsageLimitedInfo, now?: number): number;
|
|
108
|
+
/**
|
|
109
|
+
* Note that Crewly answered the usage-limit menu of a session.
|
|
110
|
+
*
|
|
111
|
+
* @param sessionName - Agent session
|
|
112
|
+
* @param now - Current time (ms)
|
|
113
|
+
*/
|
|
114
|
+
export declare function noteUsageLimitMenuAnswered(sessionName: string, now?: number): void;
|
|
115
|
+
/**
|
|
116
|
+
* Forget a session's usage-limit state (it moved to another runtime, or the
|
|
117
|
+
* owner changed its runtime).
|
|
118
|
+
*
|
|
119
|
+
* @param sessionName - Agent session
|
|
120
|
+
* @returns True when a state was in force
|
|
121
|
+
*/
|
|
122
|
+
export declare function clearUsageLimit(sessionName: string): boolean;
|
|
123
|
+
/**
|
|
124
|
+
* Lift a session's usage-limit state because the agent works again: it
|
|
125
|
+
* finished a turn, or wrote fresh output that is not a limit message.
|
|
126
|
+
* Activity within {@link USAGE_LIMIT_STATE_CONSTANTS.LIFT_GRACE_MS} of the
|
|
127
|
+
* limit last being seen, or of Crewly answering its menu, is the repaint of
|
|
128
|
+
* that screen and does not count.
|
|
129
|
+
*
|
|
130
|
+
* @param sessionName - Agent session
|
|
131
|
+
* @param now - Current time (ms)
|
|
132
|
+
* @returns The lifted state, or null when none was in force or it was too soon
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* if (liftUsageLimit('crewly-orc')) logger.info('Orchestrator works again');
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare function liftUsageLimit(sessionName: string, now?: number): UsageLimitedInfo | null;
|
|
140
|
+
/**
|
|
141
|
+
* Every session that is usage-limited now.
|
|
142
|
+
*
|
|
143
|
+
* @param now - Current time (ms)
|
|
144
|
+
* @returns States
|
|
145
|
+
*/
|
|
146
|
+
export declare function listUsageLimited(now?: number): UsageLimitedInfo[];
|
|
147
|
+
/**
|
|
148
|
+
* The status-API view of a session's state (`usageLimited`), or undefined.
|
|
149
|
+
*
|
|
150
|
+
* @param sessionName - Agent session
|
|
151
|
+
* @param now - Current time (ms)
|
|
152
|
+
* @returns View, or undefined when the session is not limited
|
|
153
|
+
*/
|
|
154
|
+
export declare function usageLimitedView(sessionName: string, now?: number): UsageLimitedView | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* One-line, owner-facing reason, e.g. "Orchestrator is out of Claude usage
|
|
157
|
+
* until 2026-10-17T00:00:00.000Z".
|
|
158
|
+
*
|
|
159
|
+
* @param name - Who is limited ("Orchestrator", "Ella")
|
|
160
|
+
* @param info - The state
|
|
161
|
+
* @returns Reason text
|
|
162
|
+
*/
|
|
163
|
+
export declare function usageLimitReason(name: string, info: UsageLimitedInfo): string;
|
|
164
|
+
/** Forget every state (tests). */
|
|
165
|
+
export declare function resetUsageLimitState(): void;
|
|
166
|
+
//# sourceMappingURL=usage-limit-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-limit-state.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5D,sCAAsC;AACtC,MAAM,WAAW,gBAAgB;IAChC,oBAAoB;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,yCAAyC;AACzC,MAAM,WAAW,qBAAqB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;CACzB;AAED,6EAA6E;AAC7E,MAAM,WAAW,gBAAgB;IAChC,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAiBD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,GAAE,MAAmB,GAAG;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CA+BnI;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,gBAAgB,GAAG,IAAI,CAQnG;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,GAAE,MAAmB,GAAG,MAAM,CAE9F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAG9F;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,gBAAgB,GAAG,IAAI,CAOrG;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAmB,GAAG,gBAAgB,EAAE,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,MAAmB,GAAG,gBAAgB,GAAG,SAAS,CAI5G;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,MAAM,CAM7E;AAED,kCAAkC;AAClC,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Usage-limit state per agent session — "this agent's runtime is out of
|
|
3
|
+
* usage until …". Process-wide and dependency-free (like the spend-cap gate)
|
|
4
|
+
* so the hot paths can ask it cheaply: the orchestrator restart service and
|
|
5
|
+
* heartbeat monitor (no restarts while limited), delivery (no waiting on a
|
|
6
|
+
* prompt that will not come, messages held), dispatch, and the status APIs.
|
|
7
|
+
*
|
|
8
|
+
* Why (2026-10-16): the orchestrator sat on Claude Code's weekly-limit menu
|
|
9
|
+
* for ~38 hours. Crewly kept waiting for its prompt every ~17s, restarted it
|
|
10
|
+
* 12 times in 15 minutes, and `GET /api/orchestrator/status` said "active and
|
|
11
|
+
* ready" the whole time.
|
|
12
|
+
*
|
|
13
|
+
* Fed by the login/screen monitor (screen sweep + live output) through
|
|
14
|
+
* {@link markUsageLimited}. A state lifts on its own at the reset time (plus
|
|
15
|
+
* a short grace), or after {@link USAGE_LIMIT_STATE_CONSTANTS.NO_RESET_BACKOFF_MS}
|
|
16
|
+
* when no reset time was given; it is set again if the limit is still there.
|
|
17
|
+
* It is lifted early ({@link liftUsageLimit}) as soon as the agent works
|
|
18
|
+
* again: a finished turn or tool call (Claude Code hooks), or fresh live
|
|
19
|
+
* output that is not a limit message.
|
|
20
|
+
* It is held in memory only: it describes the live screen, and after a Crewly
|
|
21
|
+
* restart the screen is read again.
|
|
22
|
+
*
|
|
23
|
+
* Distinct from the runtime fallback's account-wide "exhausted runtime"
|
|
24
|
+
* record: that one moves agents to another runtime; this one says what a
|
|
25
|
+
* given session is doing right now. A session moved to another runtime is
|
|
26
|
+
* cleared ({@link clearUsageLimit}).
|
|
27
|
+
*
|
|
28
|
+
* @module services/runtime-fallback/usage-limit-state
|
|
29
|
+
*/
|
|
30
|
+
import { RUNTIME_FALLBACK_CONSTANTS, USAGE_LIMIT_STATE_CONSTANTS } from '../../constants.js';
|
|
31
|
+
const states = new Map();
|
|
32
|
+
/**
|
|
33
|
+
* When a state with this reset time may be tried again.
|
|
34
|
+
*
|
|
35
|
+
* @param resetAt - Reset time (ms), or null
|
|
36
|
+
* @param now - Current time (ms)
|
|
37
|
+
* @returns Epoch ms
|
|
38
|
+
*/
|
|
39
|
+
function retryAtFor(resetAt, now) {
|
|
40
|
+
return resetAt !== null
|
|
41
|
+
? resetAt + USAGE_LIMIT_STATE_CONSTANTS.RESET_GRACE_MS
|
|
42
|
+
: now + USAGE_LIMIT_STATE_CONSTANTS.NO_RESET_BACKOFF_MS;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Record that a session is out of usage. A state already in force keeps its
|
|
46
|
+
* first-detection time; a reset time seen later replaces the backoff, and a
|
|
47
|
+
* later detection without one does not extend it.
|
|
48
|
+
*
|
|
49
|
+
* @param input - Session, runtime, rule, reset time, source
|
|
50
|
+
* @param now - Current time (ms)
|
|
51
|
+
* @returns The state and whether it is new (not in force before this call)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* markUsageLimited({ sessionName: 'crewly-orc', runtime: 'claude-code', ruleId: 'claude.hit_your_limit', resetAt, source: 'menu' });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export function markUsageLimited(input, now = Date.now()) {
|
|
59
|
+
const existing = usageLimitOf(input.sessionName, now);
|
|
60
|
+
// A reset in the past or implausibly far ahead (an old dated message read
|
|
61
|
+
// as next year's) is not trusted: back off instead.
|
|
62
|
+
const resetAt = input.resetAt !== null && input.resetAt > now && input.resetAt - now <= USAGE_LIMIT_STATE_CONSTANTS.MAX_RESET_AHEAD_MS
|
|
63
|
+
? input.resetAt
|
|
64
|
+
: null;
|
|
65
|
+
const until = resetAt !== null ? new Date(resetAt).toISOString() : undefined;
|
|
66
|
+
if (existing) {
|
|
67
|
+
if (until && existing.until !== until) {
|
|
68
|
+
existing.until = until;
|
|
69
|
+
existing.retryAt = new Date(retryAtFor(resetAt, now)).toISOString();
|
|
70
|
+
}
|
|
71
|
+
if (input.runtime && !existing.runtime)
|
|
72
|
+
existing.runtime = input.runtime;
|
|
73
|
+
if (input.source === 'menu')
|
|
74
|
+
existing.source = 'menu';
|
|
75
|
+
existing.lastSeenAt = new Date(now).toISOString();
|
|
76
|
+
return { info: existing, isNew: false };
|
|
77
|
+
}
|
|
78
|
+
const info = {
|
|
79
|
+
sessionName: input.sessionName,
|
|
80
|
+
runtime: input.runtime,
|
|
81
|
+
ruleId: input.ruleId,
|
|
82
|
+
source: input.source,
|
|
83
|
+
detectedAt: new Date(now).toISOString(),
|
|
84
|
+
lastSeenAt: new Date(now).toISOString(),
|
|
85
|
+
...(until ? { until } : {}),
|
|
86
|
+
retryAt: new Date(retryAtFor(resetAt, now)).toISOString(),
|
|
87
|
+
};
|
|
88
|
+
states.set(input.sessionName, info);
|
|
89
|
+
return { info, isNew: true };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The usage-limit state in force for a session. A state past its retry time
|
|
93
|
+
* is dropped. Never throws.
|
|
94
|
+
*
|
|
95
|
+
* @param sessionName - Agent session
|
|
96
|
+
* @param now - Current time (ms)
|
|
97
|
+
* @returns The state, or null when the session may run
|
|
98
|
+
*/
|
|
99
|
+
export function usageLimitOf(sessionName, now = Date.now()) {
|
|
100
|
+
const info = states.get(sessionName);
|
|
101
|
+
if (!info)
|
|
102
|
+
return null;
|
|
103
|
+
if (Date.parse(info.retryAt) <= now) {
|
|
104
|
+
states.delete(sessionName);
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
return info;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Milliseconds until a usage-limited session may be tried again.
|
|
111
|
+
*
|
|
112
|
+
* @param info - The state
|
|
113
|
+
* @param now - Current time (ms)
|
|
114
|
+
* @returns Milliseconds (at least 0)
|
|
115
|
+
*/
|
|
116
|
+
export function usageLimitRemainingMs(info, now = Date.now()) {
|
|
117
|
+
return Math.max(0, Date.parse(info.retryAt) - now);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Note that Crewly answered the usage-limit menu of a session.
|
|
121
|
+
*
|
|
122
|
+
* @param sessionName - Agent session
|
|
123
|
+
* @param now - Current time (ms)
|
|
124
|
+
*/
|
|
125
|
+
export function noteUsageLimitMenuAnswered(sessionName, now = Date.now()) {
|
|
126
|
+
const info = usageLimitOf(sessionName, now);
|
|
127
|
+
if (info)
|
|
128
|
+
info.menuAnsweredAt = new Date(now).toISOString();
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Forget a session's usage-limit state (it moved to another runtime, or the
|
|
132
|
+
* owner changed its runtime).
|
|
133
|
+
*
|
|
134
|
+
* @param sessionName - Agent session
|
|
135
|
+
* @returns True when a state was in force
|
|
136
|
+
*/
|
|
137
|
+
export function clearUsageLimit(sessionName) {
|
|
138
|
+
return states.delete(sessionName);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Lift a session's usage-limit state because the agent works again: it
|
|
142
|
+
* finished a turn, or wrote fresh output that is not a limit message.
|
|
143
|
+
* Activity within {@link USAGE_LIMIT_STATE_CONSTANTS.LIFT_GRACE_MS} of the
|
|
144
|
+
* limit last being seen, or of Crewly answering its menu, is the repaint of
|
|
145
|
+
* that screen and does not count.
|
|
146
|
+
*
|
|
147
|
+
* @param sessionName - Agent session
|
|
148
|
+
* @param now - Current time (ms)
|
|
149
|
+
* @returns The lifted state, or null when none was in force or it was too soon
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* if (liftUsageLimit('crewly-orc')) logger.info('Orchestrator works again');
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export function liftUsageLimit(sessionName, now = Date.now()) {
|
|
157
|
+
const info = usageLimitOf(sessionName, now);
|
|
158
|
+
if (!info)
|
|
159
|
+
return null;
|
|
160
|
+
const lastSeen = Math.max(Date.parse(info.lastSeenAt), info.menuAnsweredAt ? Date.parse(info.menuAnsweredAt) : 0);
|
|
161
|
+
if (now - lastSeen < USAGE_LIMIT_STATE_CONSTANTS.LIFT_GRACE_MS)
|
|
162
|
+
return null;
|
|
163
|
+
states.delete(sessionName);
|
|
164
|
+
return info;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Every session that is usage-limited now.
|
|
168
|
+
*
|
|
169
|
+
* @param now - Current time (ms)
|
|
170
|
+
* @returns States
|
|
171
|
+
*/
|
|
172
|
+
export function listUsageLimited(now = Date.now()) {
|
|
173
|
+
return [...states.keys()].map((s) => usageLimitOf(s, now)).filter((i) => i !== null);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* The status-API view of a session's state (`usageLimited`), or undefined.
|
|
177
|
+
*
|
|
178
|
+
* @param sessionName - Agent session
|
|
179
|
+
* @param now - Current time (ms)
|
|
180
|
+
* @returns View, or undefined when the session is not limited
|
|
181
|
+
*/
|
|
182
|
+
export function usageLimitedView(sessionName, now = Date.now()) {
|
|
183
|
+
const info = usageLimitOf(sessionName, now);
|
|
184
|
+
if (!info)
|
|
185
|
+
return undefined;
|
|
186
|
+
return { ...(info.until ? { until: info.until } : {}), retryAt: info.retryAt, detectedAt: info.detectedAt, runtime: info.runtime };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* One-line, owner-facing reason, e.g. "Orchestrator is out of Claude usage
|
|
190
|
+
* until 2026-10-17T00:00:00.000Z".
|
|
191
|
+
*
|
|
192
|
+
* @param name - Who is limited ("Orchestrator", "Ella")
|
|
193
|
+
* @param info - The state
|
|
194
|
+
* @returns Reason text
|
|
195
|
+
*/
|
|
196
|
+
export function usageLimitReason(name, info) {
|
|
197
|
+
const runtime = info.runtime ? RUNTIME_FALLBACK_CONSTANTS.SHORT_LABELS[info.runtime] ?? info.runtime : null;
|
|
198
|
+
const what = runtime ? `out of ${runtime} usage` : 'out of usage';
|
|
199
|
+
return info.until
|
|
200
|
+
? `${name} is ${what} until ${info.until}`
|
|
201
|
+
: `${name} is ${what} (reset time unknown; trying again at ${info.retryAt})`;
|
|
202
|
+
}
|
|
203
|
+
/** Forget every state (tests). */
|
|
204
|
+
export function resetUsageLimitState() {
|
|
205
|
+
states.clear();
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=usage-limit-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-limit-state.js","sourceRoot":"","sources":["../../../../../../backend/src/services/runtime-fallback/usage-limit-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAiD7F,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;AAEnD;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,OAAsB,EAAE,GAAW;IACtD,OAAO,OAAO,KAAK,IAAI;QACtB,CAAC,CAAC,OAAO,GAAG,2BAA2B,CAAC,cAAc;QACtD,CAAC,CAAC,GAAG,GAAG,2BAA2B,CAAC,mBAAmB,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B,EAAE,MAAc,IAAI,CAAC,GAAG,EAAE;IACtF,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;IACtD,0EAA0E;IAC1E,oDAAoD;IACpD,MAAM,OAAO,GACZ,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,GAAG,GAAG,IAAI,2BAA2B,CAAC,kBAAkB;QACrH,CAAC,CAAC,KAAK,CAAC,OAAO;QACf,CAAC,CAAC,IAAI,CAAC;IACT,MAAM,KAAK,GAAG,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7E,IAAI,QAAQ,EAAE,CAAC;QACd,IAAI,KAAK,IAAI,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;YACvC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;YACvB,QAAQ,CAAC,OAAO,GAAG,IA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I,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5G,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,UAAU,OAAO,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IAClE,OAAO,IAAI,CAAC,KAAK;QAChB,CAAC,CAAC,GAAG,IAAI,OAAO,IAAI,UAAU,IAAI,CAAC,KAAK,EAAE;QAC1C,CAAC,CAAC,GAAG,IAAI,OAAO,IAAI,yCAAyC,IAAI,CAAC,OAAO,GAAG,CAAC;AAC/E,CAAC;AAED,kCAAkC;AAClC,MAAM,UAAU,oBAAoB;IACnC,MAAM,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -225,8 +225,10 @@ export declare function attributeOwnPastes(text: string, pastes: readonly string
|
|
|
225
225
|
}>): OwnPasteAttribution | null;
|
|
226
226
|
/** One piece of an input box: a runtime paste marker, or the text between markers. */
|
|
227
227
|
export interface BoxPart {
|
|
228
|
-
/** True for a "[Pasted text …]" / "[Pasted Content …]" marker */
|
|
228
|
+
/** True for a "[Pasted text …]" / "[Pasted Content …]" / "[Image #N]" marker */
|
|
229
229
|
marker: boolean;
|
|
230
|
+
/** True for a Claude Code "[Image #N]" marker (an image path it pulled out of the paste) */
|
|
231
|
+
image?: boolean;
|
|
230
232
|
/** The marker, or the text (whitespace collapsed) */
|
|
231
233
|
text: string;
|
|
232
234
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tui-input-guard.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/session/tui-input-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAC;AAErE,kDAAkD;AAClD,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG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ACjB,iEAAiE;IACjE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,iBAAiB,CAmBjE;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAGjE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAkBnE;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,YAAY,GAAE,aAAa,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAM,GACnE,MAAM,EAAE,GAAG,IAAI,CAEjB;AAED,wEAAwE;AACxE,MAAM,WAAW,mBAAmB;IACnC,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB;;;;OAIG;IACH,SAAS,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CACjC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,YAAY,GAAE,aAAa,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAM,GACnE,mBAAmB,GAAG,IAAI,CAW5B;AAqFD,sFAAsF;AACtF,MAAM,WAAW,OAAO;IACvB,
|
|
1
|
+
{"version":3,"file":"tui-input-guard.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/session/tui-input-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAIH;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,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