github-issue-tower-defence-management 1.60.2 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +13 -0
- package/.github/workflows/test.yml +0 -4
- package/CHANGELOG.md +14 -0
- package/README.md +53 -10
- package/bin/adapter/entry-points/cli/index.js +11 -11
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.js +3 -22
- package/bin/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +8 -22
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/entry-points/handlers/rotationOrderFileWriter.js +56 -0
- package/bin/adapter/entry-points/handlers/rotationOrderFileWriter.js.map +1 -0
- package/bin/adapter/entry-points/handlers/situationFileWriter.js +5 -0
- package/bin/adapter/entry-points/handlers/situationFileWriter.js.map +1 -1
- package/bin/adapter/proxy/TokenListLoader.js +21 -6
- package/bin/adapter/proxy/TokenListLoader.js.map +1 -1
- package/bin/adapter/proxy/proxyEntry.js +1 -0
- package/bin/adapter/proxy/proxyEntry.js.map +1 -1
- package/bin/adapter/repositories/BaseGitHubRepository.js +1 -113
- package/bin/adapter/repositories/BaseGitHubRepository.js.map +1 -1
- package/bin/adapter/repositories/ProxyClaudeTokenUsageRepository.js +5 -3
- package/bin/adapter/repositories/ProxyClaudeTokenUsageRepository.js.map +1 -1
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +8 -7
- package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
- package/bin/domain/usecases/HandleScheduledEventUseCase.js +14 -3
- package/bin/domain/usecases/HandleScheduledEventUseCase.js.map +1 -1
- package/bin/domain/usecases/IssueRejectionEvaluator.js +8 -1
- package/bin/domain/usecases/IssueRejectionEvaluator.js.map +1 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js +5 -1
- package/bin/domain/usecases/NotifyFinishedIssuePreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js +1 -1
- package/bin/domain/usecases/RevertOrphanedPreparationUseCase.js.map +1 -1
- package/bin/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.js +32 -1
- package/bin/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.js.map +1 -1
- package/bin/domain/usecases/StartPreparationUseCase.js +148 -28
- package/bin/domain/usecases/StartPreparationUseCase.js.map +1 -1
- package/package.json +1 -4
- package/src/adapter/entry-points/cli/index.test.ts +16 -16
- package/src/adapter/entry-points/cli/index.ts +8 -11
- package/src/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.test.ts +2 -55
- package/src/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.ts +1 -11
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.test.ts +6 -56
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +7 -11
- package/src/adapter/entry-points/handlers/rotationOrderFileWriter.test.ts +177 -0
- package/src/adapter/entry-points/handlers/rotationOrderFileWriter.ts +20 -0
- package/src/adapter/entry-points/handlers/situationFileWriter.test.ts +36 -0
- package/src/adapter/entry-points/handlers/situationFileWriter.ts +8 -0
- package/src/adapter/proxy/TokenListLoader.test.ts +50 -1
- package/src/adapter/proxy/TokenListLoader.ts +25 -5
- package/src/adapter/proxy/proxyEntry.test.ts +270 -1
- package/src/adapter/proxy/proxyEntry.ts +2 -1
- package/src/adapter/repositories/BaseGitHubRepository.test.ts +1 -186
- package/src/adapter/repositories/BaseGitHubRepository.ts +1 -139
- package/src/adapter/repositories/GraphqlProjectRepository.errorHandling.test.ts +0 -1
- package/src/adapter/repositories/GraphqlProjectRepository.fetchProjectId.test.ts +4 -1
- package/src/adapter/repositories/ProxyClaudeTokenUsageRepository.test.ts +60 -19
- package/src/adapter/repositories/ProxyClaudeTokenUsageRepository.ts +6 -4
- package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +23 -13
- package/src/adapter/repositories/issue/ApiV3IssueRepository.test.ts +0 -1
- package/src/adapter/repositories/issue/GraphqlProjectItemRepository.test.ts +0 -8
- package/src/adapter/repositories/issue/RestIssueRepository.test.ts +0 -1
- package/src/domain/entities/ClaudeTokenUsage.ts +1 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.test.ts +4 -0
- package/src/domain/usecases/HandleScheduledEventUseCase.ts +20 -5
- package/src/domain/usecases/IssueRejectionEvaluator.test.ts +153 -0
- package/src/domain/usecases/IssueRejectionEvaluator.ts +8 -0
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.test.ts +175 -31
- package/src/domain/usecases/NotifyFinishedIssuePreparationUseCase.ts +7 -1
- package/src/domain/usecases/RevertNotReadyAwaitingQualityCheckUseCase.test.ts +32 -0
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.test.ts +39 -5
- package/src/domain/usecases/RevertOrphanedPreparationUseCase.ts +1 -1
- package/src/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.test.ts +139 -20
- package/src/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.ts +62 -2
- package/src/domain/usecases/StartPreparationUseCase.test.ts +614 -23
- package/src/domain/usecases/StartPreparationUseCase.ts +226 -35
- package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +16 -0
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/rotationOrderFileWriter.d.ts +3 -0
- package/types/adapter/entry-points/handlers/rotationOrderFileWriter.d.ts.map +1 -0
- package/types/adapter/entry-points/handlers/situationFileWriter.d.ts +1 -0
- package/types/adapter/entry-points/handlers/situationFileWriter.d.ts.map +1 -1
- package/types/adapter/proxy/TokenListLoader.d.ts +5 -0
- package/types/adapter/proxy/TokenListLoader.d.ts.map +1 -1
- package/types/adapter/proxy/proxyEntry.d.ts +2 -1
- package/types/adapter/proxy/proxyEntry.d.ts.map +1 -1
- package/types/adapter/repositories/BaseGitHubRepository.d.ts +1 -23
- package/types/adapter/repositories/BaseGitHubRepository.d.ts.map +1 -1
- package/types/adapter/repositories/ProxyClaudeTokenUsageRepository.d.ts.map +1 -1
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +14 -5
- package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
- package/types/domain/entities/ClaudeTokenUsage.d.ts +1 -0
- package/types/domain/entities/ClaudeTokenUsage.d.ts.map +1 -1
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts +5 -2
- package/types/domain/usecases/HandleScheduledEventUseCase.d.ts.map +1 -1
- package/types/domain/usecases/IssueRejectionEvaluator.d.ts +1 -1
- package/types/domain/usecases/IssueRejectionEvaluator.d.ts.map +1 -1
- package/types/domain/usecases/NotifyFinishedIssuePreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.d.ts +5 -2
- package/types/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.d.ts.map +1 -1
- package/types/domain/usecases/StartPreparationUseCase.d.ts +18 -2
- package/types/domain/usecases/StartPreparationUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +14 -0
- package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
- package/bin/adapter/repositories/issue/CheerioIssueRepository.js +0 -136
- package/bin/adapter/repositories/issue/CheerioIssueRepository.js.map +0 -1
- package/bin/adapter/repositories/issue/InternalGraphqlIssueRepository.js +0 -1606
- package/bin/adapter/repositories/issue/InternalGraphqlIssueRepository.js.map +0 -1
- package/src/adapter/repositories/issue/CheerioIssueRepository.test.ts +0 -6552
- package/src/adapter/repositories/issue/CheerioIssueRepository.ts +0 -142
- package/src/adapter/repositories/issue/InternalGraphqlIssueRepository.test.ts +0 -118
- package/src/adapter/repositories/issue/InternalGraphqlIssueRepository.ts +0 -584
- package/types/adapter/repositories/issue/CheerioIssueRepository.d.ts +0 -40
- package/types/adapter/repositories/issue/CheerioIssueRepository.d.ts.map +0 -1
- package/types/adapter/repositories/issue/InternalGraphqlIssueRepository.d.ts +0 -220
- package/types/adapter/repositories/issue/InternalGraphqlIssueRepository.d.ts.map +0 -1
|
@@ -19,6 +19,19 @@ jobs:
|
|
|
19
19
|
pull-requests: write
|
|
20
20
|
id-token: write
|
|
21
21
|
steps:
|
|
22
|
+
- name: Harden Runner
|
|
23
|
+
uses: step-security/harden-runner@v2
|
|
24
|
+
with:
|
|
25
|
+
egress-policy: block
|
|
26
|
+
allowed-endpoints: >
|
|
27
|
+
api.github.com:443
|
|
28
|
+
github.com:443
|
|
29
|
+
registry.npmjs.org:443
|
|
30
|
+
nodejs.org:443
|
|
31
|
+
fulcio.sigstore.dev:443
|
|
32
|
+
rekor.sigstore.dev:443
|
|
33
|
+
tuf-repo-cdn.sigstore.dev:443
|
|
34
|
+
oauth2.sigstore.dev:443
|
|
22
35
|
- uses: actions/create-github-app-token@v3
|
|
23
36
|
id: app-token
|
|
24
37
|
with:
|
|
@@ -33,16 +33,12 @@ jobs:
|
|
|
33
33
|
- name: Build
|
|
34
34
|
run: npm run build
|
|
35
35
|
|
|
36
|
-
- run: mkdir -p tmp && npm_config_ignore_scripts=false npx -y gh-cookie '${{ secrets.TEST_GH_USER_NAME }}' '${{ secrets.TEST_GH_USER_PASSWORD }}' '${{ secrets.TEST_GH_AUTHENTICATOR_KEY }}' > tmp/github.com.cookies.json
|
|
37
36
|
- name: Run tests
|
|
38
37
|
run: npm run test
|
|
39
38
|
env:
|
|
40
39
|
GH_TOKEN: ${{ secrets.TEST_GH_TOKEN }}
|
|
41
40
|
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.TEST_GOOGLE_SERVICE_ACCOUNT_KEY }}
|
|
42
41
|
SLACK_USER_TOKEN: ${{ secrets.TEST_SLACK_USER_TOKEN }}
|
|
43
|
-
GH_USER_NAME: ${{ secrets.TEST_GH_USER_NAME }}
|
|
44
|
-
GH_USER_PASSWORD: ${{ secrets.TEST_GH_USER_PASSWORD }}
|
|
45
|
-
GH_AUTHENTICATOR_KEY: ${{ secrets.TEST_GH_AUTHENTICATOR_KEY }}
|
|
46
42
|
DOTENV_CONFIG_QUIET: true
|
|
47
43
|
|
|
48
44
|
- name: Upload test results
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.64.0](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.63.1...v1.64.0) (2026-05-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **core:** route spawn to a usable model per token using per-model 7d availability ([f3bdf07](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/f3bdf07dea62cf01b62647942cc8175604d6d826)), closes [#672](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/issues/672)
|
|
7
|
+
|
|
8
|
+
## [1.63.1](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.63.0...v1.63.1) (2026-05-25)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **ci:** allow sigstore endpoints in harden-runner allowlist for npm provenance signing ([651727d](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/commit/651727d06c2c6f8e649fe2e16bd17ff72d939391))
|
|
14
|
+
|
|
1
15
|
## [1.60.2](https://github.com/HiromiShikata/npm-cli-github-issue-tower-defence-management/compare/v1.60.1...v1.60.2) (2026-05-25)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -33,9 +33,9 @@ Options for startDaemon:
|
|
|
33
33
|
--defaultAgentName <name> Default agent name
|
|
34
34
|
--defaultLlmModelName <name> Default LLM model name
|
|
35
35
|
--defaultLlmAgentName <name> Default LLM agent name
|
|
36
|
-
--maximumPreparingIssuesCount <count> Maximum number of issues in preparation status (default: 6)
|
|
36
|
+
--maximumPreparingIssuesCount <count> Maximum number of issues in preparation status (default: 6 per available Claude OAuth token, otherwise 6)
|
|
37
37
|
--allowIssueCacheMinutes <minutes> Allow cache for issues in minutes (default: 10)
|
|
38
|
-
--utilizationPercentageThreshold <percent> Claude utilization
|
|
38
|
+
--utilizationPercentageThreshold <percent> Legacy Claude utilization threshold setting; token process slots decay from 80% utilization to 0 at 95% (default: 90)
|
|
39
39
|
--allowedIssueAuthors <authors> Comma-separated list of allowed issue authors
|
|
40
40
|
--preparationProcessCheckCommand <template> Shell command template with {URL} placeholder to check if a preparation process is alive
|
|
41
41
|
|
|
@@ -96,8 +96,8 @@ startPreparation?: # Optional: Enable automatic issue preparation workflow
|
|
|
96
96
|
configFilePath: string # Path to config file passed to the aw command
|
|
97
97
|
defaultLlmModelName?: string | null # Optional: Default LLM model name (overridable via llm-model: label)
|
|
98
98
|
defaultLlmAgentName?: string | null # Optional: Default LLM agent name (overridable via llm-agent: label)
|
|
99
|
-
maximumPreparingIssuesCount: number | null # Max concurrent preparing issues
|
|
100
|
-
utilizationPercentageThreshold?: number # Optional:
|
|
99
|
+
maximumPreparingIssuesCount: number | null # Max concurrent preparing issues. When token rotation is active, effective concurrency is also capped at 6 per available token. When null, the default is 6 per available token, or 6 without token rotation
|
|
100
|
+
utilizationPercentageThreshold?: number # Optional: Legacy Claude utilization threshold setting. Token process slots now use a fixed exponential decay: 6 slots through 80% 5h utilization, fewer slots above 80%, and 0 slots at 95%
|
|
101
101
|
allowedIssueAuthors?: string[] | null # Optional: Only start preparation for issues from these authors (null = all authors)
|
|
102
102
|
preparationProcessCheckCommand?: string # Optional: Shell command template with {URL} placeholder to check if a preparation process is alive. When set, orphaned Preparation issues (process exits non-zero, or stale aw log) are evaluated for completion: if work is done they advance to Awaiting Quality Check; otherwise they fall back to Awaiting Workspace
|
|
103
103
|
awaitingQualityCheckStatus?: string | null # Optional: Project status name for issues awaiting quality check. When set with preparationProcessCheckCommand, orphaned issues with no rejections advance to this status instead of awaitingWorkspaceStatus
|
|
@@ -157,9 +157,9 @@ projectName: string # Project name (used for cache directory path)
|
|
|
157
157
|
defaultAgentName: string # Default agent name for issue preparation
|
|
158
158
|
defaultLlmModelName?: string # Optional: Default LLM model name
|
|
159
159
|
defaultLlmAgentName?: string # Optional: Default LLM agent name
|
|
160
|
-
maximumPreparingIssuesCount?: number # Optional: Max concurrent preparing issues
|
|
160
|
+
maximumPreparingIssuesCount?: number # Optional: Max concurrent preparing issues. When token rotation is active, effective concurrency is also capped at 6 per available token. Omitted defaults to 6 per available token, or 6 without token rotation
|
|
161
161
|
allowIssueCacheMinutes?: number # Optional: Allow cache for issues in minutes (default: 10)
|
|
162
|
-
utilizationPercentageThreshold?: number # Optional: Claude
|
|
162
|
+
utilizationPercentageThreshold?: number # Optional: Legacy Claude utilization threshold setting. Token process slots now use a fixed exponential decay from 80% to 95% 5h utilization
|
|
163
163
|
allowedIssueAuthors?: string # Optional: Comma-separated list of allowed issue authors
|
|
164
164
|
thresholdForAutoReject?: number # Optional: Consecutive rejections before escalation (default: 3)
|
|
165
165
|
workflowBlockerResolvedWebhookUrl?: string # Optional: Webhook URL. Supports {URL} and {MESSAGE} placeholders
|
|
@@ -209,11 +209,11 @@ When `claudeCodeOauthTokenListJsonPath` is set, `startDaemon` distributes prepar
|
|
|
209
209
|
]
|
|
210
210
|
```
|
|
211
211
|
|
|
212
|
-
|
|
212
|
+
The `name` field is optional; when absent, TDPM assigns a positional name (`token-1`, `token-2`, …) based on the entry's index in the array. Entries without a string `token` are skipped. Missing files or malformed JSON yield no tokens and disable rotation for that run (the daemon then falls back to whatever `CLAUDE_CODE_OAUTH_TOKEN` is already in the environment).
|
|
213
213
|
|
|
214
214
|
2. Local reverse proxy (`127.0.0.1:8787`): on each `startDaemon` run, the daemon TCP-probes the port. If nothing responds, it spawns a detached child running `bin/adapter/proxy/proxyEntry.js`. The proxy forwards every request to `api.anthropic.com`, observes the `anthropic-ratelimit-unified-*` response headers, and writes them to a per-token cache file at `${XDG_CACHE_HOME:-~/.cache}/tdpm/ratelimit/<sha256-of-token>.json`. The cache file stores the latest 5-hour and 7-day utilization, reset epochs, and the unified, 5-hour, and 7-day statuses (used to detect `blocked` and `rejected` state per window). In addition to the unified headers, the proxy inspects the streamed response body for `rate_limit` events (objects carrying `rateLimitType`, `status`, and `resetsAt`) and records the model-specific weekly limits — at minimum `seven_day_sonnet` and `seven_day` — per token. These model-specific weekly limits are exposed only in the response body, never in the unified headers, so a token can appear healthy on `anthropic-ratelimit-unified-7d-*` while its Sonnet weekly limit is exhausted.
|
|
215
215
|
|
|
216
|
-
3. Selection: before spawning each `aw` job, the daemon reads every token's cache file. A cached observation is treated as expired once its reset epoch has passed: when the current time is past the 5-hour reset, that token's 5-hour utilization is treated as `0` and any 5-hour-window rejection is cleared; a 7-day-window rejection is cleared once the 7-day reset has passed; a model-specific weekly limit rejection is cleared once that limit's `resetsAt` has passed. This stale-reset expiry prevents a token that has actually recovered from being locked out of rotation forever (an excluded token receives no new requests, so the proxy never re-observes it). After expiry normalization, tokens whose status is `blocked
|
|
216
|
+
3. Selection: before spawning each `aw` job, the daemon reads every token's cache file. A cached observation is treated as expired once its reset epoch has passed: when the current time is past the 5-hour reset, that token's 5-hour utilization is treated as `0` and any 5-hour-window rejection is cleared; a 7-day-window rejection is cleared once the 7-day reset has passed; a model-specific weekly limit rejection is cleared once that limit's `resetsAt` has passed. This stale-reset expiry prevents a token that has actually recovered from being locked out of rotation forever (an excluded token receives no new requests, so the proxy never re-observes it). After expiry normalization, tokens whose status is `blocked` or whose remaining (non-expired) rejection is still active are excluded. Tokens are also excluded when all candidate model-specific weekly limits are exhausted or the general `seven_day` limit is rejected; however, when only the default model's weekly limit is rejected (e.g., `seven_day_sonnet`), the token remains in rotation and is spawned with a fallback model whose limit is still available (e.g., `seven_day_opus`). The model name maps to a limit type: a model name containing `sonnet` maps to `seven_day_sonnet`, one containing `opus` maps to `seven_day_opus`, otherwise `seven_day`; the generic `seven_day` rejection also excludes regardless of model. The remaining tokens are sorted by 5-hour utilization ascending. Each available token receives up to six concurrent preparation slots through 80% 5-hour utilization; above 80%, its slot count decays exponentially; at 95% or higher, its slot count is 0. The first token (lowest utilization) is selected for the next spawn, then the next, weighted round-robin by remaining slots, for the duration of the run. The effective preparation limit is the sum of available token slots; a lower explicit `maximumPreparingIssuesCount` remains honored. When a token list is configured but no token has remaining slots, preparation is skipped for that run. The selected token, the selected model (which may differ from the default when a fallback model was chosen), and the proxy URL (`http://127.0.0.1:8787`) are passed to the child `aw` process as `CLAUDE_CODE_OAUTH_TOKEN`, the model argument, and `ANTHROPIC_BASE_URL` environment variables. The child inherits the parent process's environment, so no further wiring is required inside `aw`.
|
|
217
217
|
|
|
218
218
|
When `claudeCodeOauthTokenListJsonPath` is unset, no proxy is started and `aw` runs with whatever `CLAUDE_CODE_OAUTH_TOKEN` and `ANTHROPIC_BASE_URL` are already in the environment.
|
|
219
219
|
|
|
@@ -257,7 +257,8 @@ This file is written atomically (written to a `.tmp` file then renamed) so exter
|
|
|
257
257
|
"awaitingQualityCheckImmediatelyActionable": 2,
|
|
258
258
|
"preparation": 4,
|
|
259
259
|
"awaitingWorkspaceImmediatelyActionable": 3,
|
|
260
|
-
"awaitingWorkspaceBlockedByDependency": 1
|
|
260
|
+
"awaitingWorkspaceBlockedByDependency": 1,
|
|
261
|
+
"failedPreparation": 2
|
|
261
262
|
},
|
|
262
263
|
"processes": {
|
|
263
264
|
"runningPreparation": 4
|
|
@@ -281,13 +282,14 @@ This file is written atomically (written to a `.tmp` file then renamed) so exter
|
|
|
281
282
|
|
|
282
283
|
- `capturedAt`: ISO 8601 timestamp when the snapshot was captured.
|
|
283
284
|
- `config.maximumPreparingIssuesCount`: Resolved maximum number of issues allowed in preparation status (`null` if unconfigured).
|
|
284
|
-
- `config.utilizationPercentageThreshold`: Resolved Claude utilization threshold
|
|
285
|
+
- `config.utilizationPercentageThreshold`: Resolved legacy Claude utilization threshold setting. Token process slots now use fixed exponential decay from 80% to 95% 5-hour utilization.
|
|
285
286
|
- `config.allowIssueCacheMinutes`: Resolved issue cache duration in minutes.
|
|
286
287
|
- `config.thresholdForAutoReject`: Resolved consecutive rejection count before auto-escalation.
|
|
287
288
|
- `status.awaitingQualityCheckImmediatelyActionable`: Count of issues in the awaiting quality check status with no dependency URL, next action date, or next action hour set.
|
|
288
289
|
- `status.preparation`: Count of issues currently in preparation status.
|
|
289
290
|
- `status.awaitingWorkspaceImmediatelyActionable`: Count of issues in awaiting workspace status with no dependency URL, next action date, or next action hour set.
|
|
290
291
|
- `status.awaitingWorkspaceBlockedByDependency`: Count of issues in awaiting workspace status that have a dependency URL set.
|
|
292
|
+
- `status.failedPreparation`: Count of issues currently in failed preparation status.
|
|
291
293
|
- `processes.runningPreparation`: Count of spawned preparation processes confirmed running via `preparationProcessCheckCommand`. `null` if `preparationProcessCheckCommand` is not configured.
|
|
292
294
|
- `system.memory.usedPercent`: Host memory usage as a percentage (MemTotal - MemAvailable / MemTotal × 100).
|
|
293
295
|
- `system.memory.usedGib` / `system.memory.totalGib`: Used and total host memory in GiB.
|
|
@@ -296,6 +298,47 @@ This file is written atomically (written to a `.tmp` file then renamed) so exter
|
|
|
296
298
|
|
|
297
299
|
System metrics are read from `/proc/meminfo` at snapshot write time.
|
|
298
300
|
|
|
301
|
+
## Token Rotation Order File
|
|
302
|
+
|
|
303
|
+
After each schedule cycle where Claude OAuth token rotation is active, TDPM writes the computed rotation order to:
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
${XDG_CACHE_HOME:-~/.cache}/tdpm/rotation-order.json
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
This file is written atomically (written to a `.tmp` file then renamed) so external readers never see a partial write.
|
|
310
|
+
|
|
311
|
+
### JSON Shape
|
|
312
|
+
|
|
313
|
+
```json
|
|
314
|
+
[
|
|
315
|
+
{
|
|
316
|
+
"name": "personal-1",
|
|
317
|
+
"fiveHourUtilization": 0.12,
|
|
318
|
+
"blocked": false,
|
|
319
|
+
"rejected": false,
|
|
320
|
+
"thresholdExcluded": false
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "personal-2",
|
|
324
|
+
"fiveHourUtilization": 0.95,
|
|
325
|
+
"blocked": false,
|
|
326
|
+
"rejected": false,
|
|
327
|
+
"thresholdExcluded": true
|
|
328
|
+
}
|
|
329
|
+
]
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
The array is ordered with selected (eligible) tokens first, sorted by ascending `fiveHourUtilization`, followed by excluded tokens. Raw token values are never written to this file; each entry uses the `name` field from the token list JSON as its identifier.
|
|
333
|
+
|
|
334
|
+
### Field Descriptions
|
|
335
|
+
|
|
336
|
+
- `name`: Non-secret identifier for the token entry, taken from the `name` field in the token list JSON.
|
|
337
|
+
- `fiveHourUtilization`: Current 5-hour utilization ratio (0.0–1.0) for this token.
|
|
338
|
+
- `blocked`: `true` if the token is marked as blocked.
|
|
339
|
+
- `rejected`: `true` if the token is marked as rejected by the API.
|
|
340
|
+
- `thresholdExcluded`: `true` if the token is eligible (not blocked or rejected) but excluded because its 5-hour utilization is at or above 95% (the fixed slot-zero boundary), giving it zero available preparation slots.
|
|
341
|
+
|
|
299
342
|
## Cadence and Cache Contract
|
|
300
343
|
|
|
301
344
|
The `schedule` command runs two distinct processing loops within a single invocation:
|
|
@@ -11,6 +11,7 @@ Object.defineProperty(exports, "mergeConfigs", { enumerable: true, get: function
|
|
|
11
11
|
Object.defineProperty(exports, "fetchProjectReadme", { enumerable: true, get: function () { return projectConfig_1.fetchProjectReadme; } });
|
|
12
12
|
const projectConfig_2 = require("./projectConfig");
|
|
13
13
|
const StartPreparationUseCase_1 = require("../../../domain/usecases/StartPreparationUseCase");
|
|
14
|
+
const rotationOrderFileWriter_1 = require("../handlers/rotationOrderFileWriter");
|
|
14
15
|
const ProxyClaudeTokenUsageRepository_1 = require("../../repositories/ProxyClaudeTokenUsageRepository");
|
|
15
16
|
const NotifyFinishedIssuePreparationUseCase_1 = require("../../../domain/usecases/NotifyFinishedIssuePreparationUseCase");
|
|
16
17
|
const LocalStorageRepository_1 = require("../../repositories/LocalStorageRepository");
|
|
@@ -24,13 +25,9 @@ const NodeLocalCommandRunner_1 = require("../../repositories/NodeLocalCommandRun
|
|
|
24
25
|
const GitHubIssueCommentRepository_1 = require("../../repositories/GitHubIssueCommentRepository");
|
|
25
26
|
const FetchWebhookRepository_1 = require("../../repositories/FetchWebhookRepository");
|
|
26
27
|
const RevertOrphanedPreparationUseCase_1 = require("../../../domain/usecases/RevertOrphanedPreparationUseCase");
|
|
27
|
-
const buildGithubRepositoryParams = (localStorageRepository,
|
|
28
|
+
const buildGithubRepositoryParams = (localStorageRepository, token) => [
|
|
28
29
|
localStorageRepository,
|
|
29
|
-
`${cachePath}/github.com.cookies.json`,
|
|
30
30
|
token,
|
|
31
|
-
undefined,
|
|
32
|
-
undefined,
|
|
33
|
-
undefined,
|
|
34
31
|
];
|
|
35
32
|
exports.program = new commander_1.Command();
|
|
36
33
|
exports.program
|
|
@@ -61,9 +58,9 @@ exports.program
|
|
|
61
58
|
.option('--defaultAgentName <name>', 'Default agent name')
|
|
62
59
|
.option('--defaultLlmModelName <name>', 'Default LLM model name')
|
|
63
60
|
.option('--defaultLlmAgentName <name>', 'Default LLM agent name')
|
|
64
|
-
.option('--maximumPreparingIssuesCount <count>', 'Maximum number of issues in preparation status (default: 6)')
|
|
61
|
+
.option('--maximumPreparingIssuesCount <count>', 'Maximum number of issues in preparation status (default: 6 per available Claude OAuth token, otherwise 6)')
|
|
65
62
|
.option('--allowIssueCacheMinutes <minutes>', 'Allow cache for issues in minutes (default: 10)')
|
|
66
|
-
.option('--utilizationPercentageThreshold <percent>', 'Claude utilization
|
|
63
|
+
.option('--utilizationPercentageThreshold <percent>', 'Legacy Claude utilization threshold setting; token process slots decay from 80% utilization to 0 at 95% (default: 90)')
|
|
67
64
|
.option('--allowedIssueAuthors <authors>', 'Comma-separated list of allowed issue authors')
|
|
68
65
|
.option('--preparationProcessCheckCommand <template>', 'Shell command template with {URL} placeholder to check if a preparation process is alive')
|
|
69
66
|
.action(async (options) => {
|
|
@@ -122,12 +119,12 @@ exports.program
|
|
|
122
119
|
maximumPreparingIssuesCount = parsedCount;
|
|
123
120
|
}
|
|
124
121
|
const allowIssueCacheMinutes = config.allowIssueCacheMinutes ?? 10;
|
|
125
|
-
console.log(`maximumPreparingIssuesCount: ${maximumPreparingIssuesCount ?? 'null (default: 6)'}`);
|
|
122
|
+
console.log(`maximumPreparingIssuesCount: ${maximumPreparingIssuesCount ?? 'null (default: 6 per available Claude OAuth token, otherwise 6)'}`);
|
|
126
123
|
const projectName = config.projectName ?? 'default';
|
|
127
124
|
const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
|
|
128
125
|
const cachePath = `./tmp/cache/${projectName}`;
|
|
129
126
|
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
130
|
-
const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository,
|
|
127
|
+
const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository, token);
|
|
131
128
|
const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams);
|
|
132
129
|
const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
|
|
133
130
|
const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams);
|
|
@@ -158,7 +155,7 @@ exports.program
|
|
|
158
155
|
const codexHomeCandidates = config.codexHomeCandidates && config.codexHomeCandidates.length > 0
|
|
159
156
|
? config.codexHomeCandidates
|
|
160
157
|
: null;
|
|
161
|
-
await useCase.run({
|
|
158
|
+
const preparationResult = await useCase.run({
|
|
162
159
|
projectUrl,
|
|
163
160
|
defaultAgentName,
|
|
164
161
|
defaultLlmModelName: config.defaultLlmModelName ?? null,
|
|
@@ -170,6 +167,9 @@ exports.program
|
|
|
170
167
|
codexHomeCandidates,
|
|
171
168
|
allowIssueCacheMinutes,
|
|
172
169
|
});
|
|
170
|
+
if (preparationResult.rotationOrder !== null) {
|
|
171
|
+
(0, rotationOrderFileWriter_1.writeRotationOrderFile)(preparationResult.rotationOrder);
|
|
172
|
+
}
|
|
173
173
|
});
|
|
174
174
|
exports.program
|
|
175
175
|
.command('notifyFinishedIssuePreparation')
|
|
@@ -224,7 +224,7 @@ exports.program
|
|
|
224
224
|
const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
|
|
225
225
|
const cachePath = `./tmp/cache/${projectName}`;
|
|
226
226
|
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
227
|
-
const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository,
|
|
227
|
+
const githubRepositoryParams = buildGithubRepositoryParams(localStorageRepository, token);
|
|
228
228
|
const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams);
|
|
229
229
|
const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
|
|
230
230
|
const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";;;;AACA,yCAAoC;AACpC,uGAAoG;AACpG,iDAMyB;AAJvB,+GAAA,cAAc,OAAA;AACd,yHAAA,wBAAwB,OAAA;AACxB,6GAAA,YAAY,OAAA;AACZ,mHAAA,kBAAkB,OAAA;AAEpB,mDAMyB;AACzB,8FAA2F;AAC3F,wGAAqG;AACrG,0HAAuH;AACvH,sFAAmF;AACnF,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,gGAA6F;AAE7F,sFAAmF;AACnF,kGAA+F;AAC/F,sFAAmF;AACnF,gHAA6G;AAuB7G,MAAM,2BAA2B,GAAG,CAClC,sBAA8C,EAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";;;;AACA,yCAAoC;AACpC,uGAAoG;AACpG,iDAMyB;AAJvB,+GAAA,cAAc,OAAA;AACd,yHAAA,wBAAwB,OAAA;AACxB,6GAAA,YAAY,OAAA;AACZ,mHAAA,kBAAkB,OAAA;AAEpB,mDAMyB;AACzB,8FAA2F;AAC3F,iFAA6E;AAC7E,wGAAqG;AACrG,0HAAuH;AACvH,sFAAmF;AACnF,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,gGAA6F;AAE7F,sFAAmF;AACnF,kGAA+F;AAC/F,sFAAmF;AACnF,gHAA6G;AAuB7G,MAAM,2BAA2B,GAAG,CAClC,sBAA8C,EAC9C,KAAa,EACuC,EAAE,CAAC;IACvD,sBAAsB;IACtB,KAAK;CACN,CAAC;AASW,QAAA,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAErC,eAAO;KACJ,IAAI,CAAC,uCAAuC,CAAC;KAC7C,WAAW,CAAC,oDAAoD,CAAC,CAAC;AAErE,eAAO;KACJ,OAAO,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACxC,WAAW,CAAC,sDAAsD,CAAC;KACnE,cAAc,CACb,sBAAsB,EACtB,iCAAiC,EACjC,qBAAqB,CACtB;KACA,cAAc,CAAC,qBAAqB,EAAE,0BAA0B,CAAC;KACjE,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAAC;KACzC,MAAM,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;KAC/C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,CAAC;IACvE,MAAM,iBAAiB,GAAG,IAAI,+CAAsB,EAAE,CAAC;IAEvD,MAAM,OAAO,GAAG,IAAI,6EAAqC,CACvD,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,CAClB,CAAC;IAEF,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,UAAU;QACV,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,sBAAsB;QACtB,iCAAiC;KAClC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEL,0BAA0B;AAC1B,IAAI,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5C,eAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -54,8 +54,8 @@ class GetStoryObjectMapUseCaseHandler {
|
|
|
54
54
|
this.handle = async (configFilePath, _verbose, allowCacheMinutes) => {
|
|
55
55
|
const configFileContent = fs_1.default.readFileSync(configFilePath, 'utf8');
|
|
56
56
|
const input = yaml_1.default.parse(configFileContent);
|
|
57
|
-
if (!(() => { const _io0 = input => "string" === typeof input.projectUrl && "number" === typeof input.allowIssueCacheMinutes && "string" === typeof input.projectName && ("object" === typeof input.credentials && null !== input.credentials && _io1(input.credentials)); const _io1 = input => "object" === typeof input.bot && null !== input.bot && _io2(input.bot); const _io2 = input => "object" === typeof input.github && null !== input.github && _io3(input.github); const _io3 = input => "string" === typeof input.token
|
|
58
|
-
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectUrl && "number" === typeof input.allowIssueCacheMinutes && "string" === typeof input.projectName && ("object" === typeof input.credentials && null !== input.credentials && _io1(input.credentials)); const _io1 = input => "object" === typeof input.bot && null !== input.bot && _io2(input.bot); const _io2 = input => "object" === typeof input.github && null !== input.github && _io3(input.github); const _io3 = input => "string" === typeof input.token
|
|
57
|
+
if (!(() => { const _io0 = input => "string" === typeof input.projectUrl && "number" === typeof input.allowIssueCacheMinutes && "string" === typeof input.projectName && ("object" === typeof input.credentials && null !== input.credentials && _io1(input.credentials)); const _io1 = input => "object" === typeof input.bot && null !== input.bot && _io2(input.bot); const _io2 = input => "object" === typeof input.github && null !== input.github && _io3(input.github); const _io3 = input => "string" === typeof input.token; return input => "object" === typeof input && null !== input && _io0(input); })()(input)) {
|
|
58
|
+
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectUrl && "number" === typeof input.allowIssueCacheMinutes && "string" === typeof input.projectName && ("object" === typeof input.credentials && null !== input.credentials && _io1(input.credentials)); const _io1 = input => "object" === typeof input.bot && null !== input.bot && _io2(input.bot); const _io2 = input => "object" === typeof input.github && null !== input.github && _io3(input.github); const _io3 = input => "string" === typeof input.token; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.projectUrl || _report(_exceptionable, {
|
|
59
59
|
path: _path + ".projectUrl",
|
|
60
60
|
expected: "string",
|
|
61
61
|
value: input.projectUrl
|
|
@@ -95,18 +95,6 @@ class GetStoryObjectMapUseCaseHandler {
|
|
|
95
95
|
path: _path + ".token",
|
|
96
96
|
expected: "string",
|
|
97
97
|
value: input.token
|
|
98
|
-
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
99
|
-
path: _path + ".name",
|
|
100
|
-
expected: "(string | undefined)",
|
|
101
|
-
value: input.name
|
|
102
|
-
}), undefined === input.password || "string" === typeof input.password || _report(_exceptionable, {
|
|
103
|
-
path: _path + ".password",
|
|
104
|
-
expected: "(string | undefined)",
|
|
105
|
-
value: input.password
|
|
106
|
-
}), undefined === input.authenticatorKey || "string" === typeof input.authenticatorKey || _report(_exceptionable, {
|
|
107
|
-
path: _path + ".authenticatorKey",
|
|
108
|
-
expected: "(string | undefined)",
|
|
109
|
-
value: input.authenticatorKey
|
|
110
98
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
111
99
|
if (false === __is(input)) {
|
|
112
100
|
errors = [];
|
|
@@ -139,14 +127,7 @@ class GetStoryObjectMapUseCaseHandler {
|
|
|
139
127
|
const localStorageRepository = new LocalStorageRepository_1.LocalStorageRepository();
|
|
140
128
|
const cachePath = `./tmp/cache/${input.projectName}`;
|
|
141
129
|
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
142
|
-
const githubRepositoryParams = [
|
|
143
|
-
localStorageRepository,
|
|
144
|
-
`${cachePath}/github.com.cookies.json`,
|
|
145
|
-
input.credentials.bot.github.token,
|
|
146
|
-
input.credentials.bot.github.name,
|
|
147
|
-
input.credentials.bot.github.password,
|
|
148
|
-
input.credentials.bot.github.authenticatorKey,
|
|
149
|
-
];
|
|
130
|
+
const githubRepositoryParams = [localStorageRepository, input.credentials.bot.github.token];
|
|
150
131
|
const projectRepository = {
|
|
151
132
|
...new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams),
|
|
152
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetStoryObjectMapUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,sFAAmF;AACnF,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,gGAA6F;AAI7F,gGAA6F;AAG7F,MAAa,+BAA+B;IAA5C;QACE,WAAM,GAAG,KAAK,EACZ,cAAsB,EACtB,QAAiB,EACjB,iBAA0B,EAMzB,EAAE;YACH,MAAM,iBAAiB,GAAG,YAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,KAAK,GAAY,cAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"GetStoryObjectMapUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/GetStoryObjectMapUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,sFAAmF;AACnF,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,gGAA6F;AAI7F,gGAA6F;AAG7F,MAAa,+BAA+B;IAA5C;QACE,WAAM,GAAG,KAAK,EACZ,cAAsB,EACtB,QAAiB,EACjB,iBAA0B,EAMzB,EAAE;YACH,MAAM,iBAAiB,GAAG,YAAE,CAAC,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;YAClE,MAAM,KAAK,GAAY,cAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;YAYrD,IAAI,olBAAqB,KAAK,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CACb,kBAAkB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAA2B,KAAK,EAAE,EAAE,CACjG,CAAC;YACJ,CAAC;YACD,MAAM,sBAAsB,GAAG,IAAI,+CAAsB,EAAE,CAAC;YAC5D,MAAM,SAAS,GAAG,eAAe,KAAK,CAAC,WAAW,EAAE,CAAC;YACrD,MAAM,2BAA2B,GAAG,IAAI,yDAA2B,CACjE,sBAAsB,EACtB,SAAS,CACV,CAAC;YACF,MAAM,sBAAsB,GAExB,CAAC,sBAAsB,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACjE,MAAM,iBAAiB,GAAG;gBACxB,GAAG,IAAI,mDAAwB,CAAC,GAAG,sBAAsB,CAAC;aAC3D,CAAC;YACF,MAAM,oBAAoB,GAAG,IAAI,2CAAoB,CACnD,GAAG,sBAAsB,CAC1B,CAAC;YACF,MAAM,mBAAmB,GAAG,IAAI,yCAAmB,CACjD,GAAG,sBAAsB,CAC1B,CAAC;YACF,MAAM,4BAA4B,GAAG,IAAI,2DAA4B,CACnE,GAAG,sBAAsB,CAC1B,CAAC;YACF,MAAM,eAAe,GAAG,IAAI,iEAA+B,CACzD,oBAAoB,EACpB,mBAAmB,EACnB,4BAA4B,EAC5B,2BAA2B,EAC3B,GAAG,sBAAsB,CAC1B,CAAC;YAEF,MAAM,wBAAwB,GAAG,IAAI,mDAAwB,CAC3D,iBAAiB,EACjB,eAAe,CAChB,CAAC;YAEF,MAAM,YAAY,GAChB,iBAAiB,KAAK,SAAS;gBAC7B,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,sBAAsB,EAAE,iBAAiB,EAAE;gBACzD,CAAC,CAAC,KAAK,CAAC;YAEZ,OAAO,MAAM,wBAAwB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QAC1D,CAAC,CAAC;IACJ,CAAC;CAAA;AAtED,0EAsEC"}
|
|
@@ -42,6 +42,7 @@ const yaml_1 = __importDefault(require("yaml"));
|
|
|
42
42
|
const typia_1 = __importDefault(require("typia"));
|
|
43
43
|
const fs_1 = __importDefault(require("fs"));
|
|
44
44
|
const situationFileWriter_1 = require("./situationFileWriter");
|
|
45
|
+
const rotationOrderFileWriter_1 = require("./rotationOrderFileWriter");
|
|
45
46
|
const projectConfig_1 = require("../cli/projectConfig");
|
|
46
47
|
const SystemDateRepository_1 = require("../../repositories/SystemDateRepository");
|
|
47
48
|
const LocalStorageRepository_1 = require("../../repositories/LocalStorageRepository");
|
|
@@ -81,8 +82,8 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
81
82
|
this.handle = async (configFilePath, _verbose) => {
|
|
82
83
|
const configFileContent = fs_1.default.readFileSync(configFilePath, 'utf8');
|
|
83
84
|
const input = yaml_1.default.parse(configFileContent);
|
|
84
|
-
if (!(() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io2(input.startPreparation)) && (null === input.notifyFinishedPreparation || undefined === input.notifyFinishedPreparation || "object" === typeof input.notifyFinishedPreparation && null !== input.notifyFinishedPreparation && false === Array.isArray(input.notifyFinishedPreparation) && _io3(input.notifyFinishedPreparation)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && ("object" === typeof input.credentials && null !== input.credentials && _io4(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus); const _io3 = input => null === input.awaitingQualityCheckStatusName || undefined === input.awaitingQualityCheckStatusName || "string" === typeof input.awaitingQualityCheckStatusName; const _io4 = input => "object" === typeof input.manager && null !== input.manager && _io5(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io9(input.bot)); const _io5 = input => "object" === typeof input.github && null !== input.github && _io6(input.github) && ("object" === typeof input.slack && null !== input.slack && _io7(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io8(input.googleServiceAccount)); const _io6 = input => "string" === typeof input.token; const _io7 = input => "string" === typeof input.userToken; const _io8 = input => "string" === typeof input.serviceAccountKey; const _io9 = input => "object" === typeof input.github && null !== input.github && _io10(input.github); const _io10 = input => "string" === typeof input.token
|
|
85
|
-
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io2(input.startPreparation)) && (null === input.notifyFinishedPreparation || undefined === input.notifyFinishedPreparation || "object" === typeof input.notifyFinishedPreparation && null !== input.notifyFinishedPreparation && false === Array.isArray(input.notifyFinishedPreparation) && _io3(input.notifyFinishedPreparation)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && ("object" === typeof input.credentials && null !== input.credentials && _io4(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus); const _io3 = input => null === input.awaitingQualityCheckStatusName || undefined === input.awaitingQualityCheckStatusName || "string" === typeof input.awaitingQualityCheckStatusName; const _io4 = input => "object" === typeof input.manager && null !== input.manager && _io5(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io9(input.bot)); const _io5 = input => "object" === typeof input.github && null !== input.github && _io6(input.github) && ("object" === typeof input.slack && null !== input.slack && _io7(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io8(input.googleServiceAccount)); const _io6 = input => "string" === typeof input.token; const _io7 = input => "string" === typeof input.userToken; const _io8 = input => "string" === typeof input.serviceAccountKey; const _io9 = input => "object" === typeof input.github && null !== input.github && _io10(input.github); const _io10 = input => "string" === typeof input.token
|
|
85
|
+
if (!(() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io2(input.startPreparation)) && (null === input.notifyFinishedPreparation || undefined === input.notifyFinishedPreparation || "object" === typeof input.notifyFinishedPreparation && null !== input.notifyFinishedPreparation && false === Array.isArray(input.notifyFinishedPreparation) && _io3(input.notifyFinishedPreparation)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && ("object" === typeof input.credentials && null !== input.credentials && _io4(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus); const _io3 = input => null === input.awaitingQualityCheckStatusName || undefined === input.awaitingQualityCheckStatusName || "string" === typeof input.awaitingQualityCheckStatusName; const _io4 = input => "object" === typeof input.manager && null !== input.manager && _io5(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io9(input.bot)); const _io5 = input => "object" === typeof input.github && null !== input.github && _io6(input.github) && ("object" === typeof input.slack && null !== input.slack && _io7(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io8(input.googleServiceAccount)); const _io6 = input => "string" === typeof input.token; const _io7 = input => "string" === typeof input.userToken; const _io8 = input => "string" === typeof input.serviceAccountKey; const _io9 = input => "object" === typeof input.github && null !== input.github && _io10(input.github); const _io10 = input => "string" === typeof input.token; return input => "object" === typeof input && null !== input && _io0(input); })()(input)) {
|
|
86
|
+
throw new Error(`Invalid input: ${JSON.stringify(input)}\n\n${JSON.stringify((() => { const _io0 = input => "string" === typeof input.projectName && "string" === typeof input.org && "string" === typeof input.projectUrl && "string" === typeof input.manager && ("object" === typeof input.workingReport && null !== input.workingReport && _io1(input.workingReport)) && "string" === typeof input.urlOfStoryView && "boolean" === typeof input.disabled && "number" === typeof input.allowIssueCacheMinutes && (null === input.startPreparation || undefined === input.startPreparation || "object" === typeof input.startPreparation && null !== input.startPreparation && _io2(input.startPreparation)) && (null === input.notifyFinishedPreparation || undefined === input.notifyFinishedPreparation || "object" === typeof input.notifyFinishedPreparation && null !== input.notifyFinishedPreparation && false === Array.isArray(input.notifyFinishedPreparation) && _io3(input.notifyFinishedPreparation)) && (undefined === input.claudeCodeOauthTokenListJsonPath || "string" === typeof input.claudeCodeOauthTokenListJsonPath) && ("object" === typeof input.credentials && null !== input.credentials && _io4(input.credentials)); const _io1 = input => "string" === typeof input.repo && (Array.isArray(input.members) && input.members.every(elem => "string" === typeof elem)) && "string" === typeof input.spreadsheetUrl; const _io2 = input => "string" === typeof input.defaultAgentName && (null === input.defaultLlmModelName || undefined === input.defaultLlmModelName || "string" === typeof input.defaultLlmModelName) && (null === input.defaultLlmAgentName || undefined === input.defaultLlmAgentName || "string" === typeof input.defaultLlmAgentName) && "string" === typeof input.configFilePath && (null === input.maximumPreparingIssuesCount || "number" === typeof input.maximumPreparingIssuesCount) && (undefined === input.utilizationPercentageThreshold || "number" === typeof input.utilizationPercentageThreshold) && (null === input.allowedIssueAuthors || undefined === input.allowedIssueAuthors || Array.isArray(input.allowedIssueAuthors) && input.allowedIssueAuthors.every(elem => "string" === typeof elem)) && (undefined === input.preparationProcessCheckCommand || "string" === typeof input.preparationProcessCheckCommand) && (null === input.codexHomeCandidates || undefined === input.codexHomeCandidates || Array.isArray(input.codexHomeCandidates) && input.codexHomeCandidates.every(elem => "string" === typeof elem)) && (undefined === input.awLogDirectoryPath || "string" === typeof input.awLogDirectoryPath) && (undefined === input.awLogStaleThresholdMinutes || "number" === typeof input.awLogStaleThresholdMinutes) && (null === input.awaitingQualityCheckStatus || undefined === input.awaitingQualityCheckStatus || "string" === typeof input.awaitingQualityCheckStatus); const _io3 = input => null === input.awaitingQualityCheckStatusName || undefined === input.awaitingQualityCheckStatusName || "string" === typeof input.awaitingQualityCheckStatusName; const _io4 = input => "object" === typeof input.manager && null !== input.manager && _io5(input.manager) && ("object" === typeof input.bot && null !== input.bot && _io9(input.bot)); const _io5 = input => "object" === typeof input.github && null !== input.github && _io6(input.github) && ("object" === typeof input.slack && null !== input.slack && _io7(input.slack)) && ("object" === typeof input.googleServiceAccount && null !== input.googleServiceAccount && _io8(input.googleServiceAccount)); const _io6 = input => "string" === typeof input.token; const _io7 = input => "string" === typeof input.userToken; const _io8 = input => "string" === typeof input.serviceAccountKey; const _io9 = input => "object" === typeof input.github && null !== input.github && _io10(input.github); const _io10 = input => "string" === typeof input.token; const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.projectName || _report(_exceptionable, {
|
|
86
87
|
path: _path + ".projectName",
|
|
87
88
|
expected: "string",
|
|
88
89
|
value: input.projectName
|
|
@@ -298,18 +299,6 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
298
299
|
path: _path + ".token",
|
|
299
300
|
expected: "string",
|
|
300
301
|
value: input.token
|
|
301
|
-
}), undefined === input.name || "string" === typeof input.name || _report(_exceptionable, {
|
|
302
|
-
path: _path + ".name",
|
|
303
|
-
expected: "(string | undefined)",
|
|
304
|
-
value: input.name
|
|
305
|
-
}), undefined === input.password || "string" === typeof input.password || _report(_exceptionable, {
|
|
306
|
-
path: _path + ".password",
|
|
307
|
-
expected: "(string | undefined)",
|
|
308
|
-
value: input.password
|
|
309
|
-
}), undefined === input.authenticatorKey || "string" === typeof input.authenticatorKey || _report(_exceptionable, {
|
|
310
|
-
path: _path + ".authenticatorKey",
|
|
311
|
-
expected: "(string | undefined)",
|
|
312
|
-
value: input.authenticatorKey
|
|
313
302
|
})].every(flag => flag); const __is = input => "object" === typeof input && null !== input && _io0(input); let errors; let _report; return input => {
|
|
314
303
|
if (false === __is(input)) {
|
|
315
304
|
errors = [];
|
|
@@ -381,14 +370,7 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
381
370
|
const googleSpreadsheetRepository = new GoogleSpreadsheetRepository_1.GoogleSpreadsheetRepository(localStorageRepository, input.credentials.manager.googleServiceAccount.serviceAccountKey);
|
|
382
371
|
const cachePath = `./tmp/cache/${input.projectName}`;
|
|
383
372
|
const localStorageCacheRepository = new LocalStorageCacheRepository_1.LocalStorageCacheRepository(localStorageRepository, cachePath);
|
|
384
|
-
const githubRepositoryParams = [
|
|
385
|
-
localStorageRepository,
|
|
386
|
-
`${cachePath}/github.com.cookies.json`,
|
|
387
|
-
input.credentials.bot.github.token,
|
|
388
|
-
input.credentials.bot.github.name,
|
|
389
|
-
input.credentials.bot.github.password,
|
|
390
|
-
input.credentials.bot.github.authenticatorKey,
|
|
391
|
-
];
|
|
373
|
+
const githubRepositoryParams = [localStorageRepository, input.credentials.bot.github.token];
|
|
392
374
|
const projectRepository = new GraphqlProjectRepository_1.GraphqlProjectRepository(...githubRepositoryParams);
|
|
393
375
|
const apiV3IssueRepository = new ApiV3IssueRepository_1.ApiV3IssueRepository(...githubRepositoryParams);
|
|
394
376
|
const restIssueRepository = new RestIssueRepository_1.RestIssueRepository(...githubRepositoryParams);
|
|
@@ -421,6 +403,9 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
421
403
|
const handleScheduledEventUseCase = new HandleScheduledEventUseCase_1.HandleScheduledEventUseCase(setupTowerDefenceProjectUseCase, actionAnnouncement, setWorkflowManagementIssueToStoryUseCase, clearPastNextActionUseCase, analyzeProblemByIssueUseCase, analyzeStoriesUseCase, clearDependedIssueURLUseCase, createEstimationIssueUseCase, convertCheckboxToIssueInStoryIssueUseCase, changeStatusByStoryColorUseCase, setNoStoryIssueToStoryUseCase, createNewStoryByLabel, assignNoAssigneeIssueToManagerUseCase, updateIssueStatusByLabelUseCase, startPreparationUseCase, revertOrphanedPreparationUseCase, revertNotReadyAwaitingQualityCheckUseCase, updateRateLimitCacheUseCase, systemDateRepository, googleSpreadsheetRepository, projectRepository, issueRepository);
|
|
422
404
|
const result = await handleScheduledEventUseCase.run(mergedInput);
|
|
423
405
|
if (result) {
|
|
406
|
+
if (result.rotationOrder !== null) {
|
|
407
|
+
(0, rotationOrderFileWriter_1.writeRotationOrderFile)(result.rotationOrder);
|
|
408
|
+
}
|
|
424
409
|
await (0, situationFileWriter_1.writeSituationFile)({
|
|
425
410
|
cachePath,
|
|
426
411
|
projectId: result.project.id,
|
|
@@ -429,6 +414,7 @@ class HandleScheduledEventUseCaseHandler {
|
|
|
429
414
|
awaitingQualityCheckStatus: WorkflowStatus_1.AWAITING_QUALITY_CHECK_STATUS_NAME,
|
|
430
415
|
preparationStatus: WorkflowStatus_1.PREPARATION_STATUS_NAME,
|
|
431
416
|
awaitingWorkspaceStatus: WorkflowStatus_1.AWAITING_WORKSPACE_STATUS_NAME,
|
|
417
|
+
failedPreparationStatus: WorkflowStatus_1.FAILED_PREPARATION_STATUS_NAME,
|
|
432
418
|
},
|
|
433
419
|
config: {
|
|
434
420
|
maximumPreparingIssuesCount: mergedInput.startPreparation?.maximumPreparingIssuesCount ?? null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF,wGAAqG;AACrG,8GAA2G;AAC3G,sGAAmG;AACnG,gGAA6F;AAC7F,kGAA+F;AAC/F,gIAA6H;AAC7H,oHAAiH;AACjH,wGAAqG;AAIrG,0FAAuF;AACvF,wGAAqG;AACrG,wGAAqG;AACrG,kIAA+H;AAC/H,8GAA2G;AAC3G,0GAAuG;AACvG,wGAAqG;AACrG,0HAAuH;AACvH,8GAA2G;AAC3G,8FAA2F;AAC3F,sFAAmF;AACnF,wGAAqG;AACrG,oGAAiG;AACjG,sGAAmG;AACnG,gHAA6G;AAC7G,kIAA+H;AAC/H,kGAA+F;AAC/F,8GAA2G;AAC3G,
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,4CAAoB;AACpB,+DAA2D;AAC3D,uEAAmE;AACnE,wDAG8B;AAC9B,kFAA+E;AAC/E,sFAAmF;AACnF,gGAA6F;AAC7F,0FAAuF;AACvF,wFAAqF;AACrF,sFAAmF;AACnF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0B,EAAE,mDAAkC;wBAC9D,iBAAiB,EAAE,wCAAuB;wBAC1C,uBAAuB,EAAE,+CAA8B;wBACvD,uBAAuB,EAAE,+CAA8B;qBACxD;oBACD,MAAM,EAAE;wBACN,2BAA2B,EACzB,WAAW,CAAC,gBAAgB,EAAE,2BAA2B,IAAI,IAAI;wBACnE,8BAA8B,EAC5B,WAAW,CAAC,gBAAgB,EAAE,8BAA8B,IAAI,EAAE;wBACpE,sBAAsB,EAAE,WAAW,CAAC,sBAAsB;wBAC1D,sBAAsB,EAAE,CAAC;qBAC1B;oBACD,8BAA8B,EAC5B,WAAW,CAAC,gBAAgB,EAAE,8BAA8B,IAAI,IAAI;oBACtE,kBAAkB,EAAE,sBAAsB;iBAC3C,CAAC,CAAC;YACL,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CAAA;AA5PD,gFA4PC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.writeRotationOrderFile = void 0;
|
|
40
|
+
const fs_1 = __importDefault(require("fs"));
|
|
41
|
+
const os = __importStar(require("os"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const rotationOrderFilePath = () => {
|
|
44
|
+
const base = process.env.XDG_CACHE_HOME ?? path.join(os.homedir(), '.cache');
|
|
45
|
+
return path.join(base, 'tdpm', 'rotation-order.json');
|
|
46
|
+
};
|
|
47
|
+
const writeRotationOrderFile = (rotationOrder) => {
|
|
48
|
+
const filePath = rotationOrderFilePath();
|
|
49
|
+
const dir = path.dirname(filePath);
|
|
50
|
+
fs_1.default.mkdirSync(dir, { recursive: true });
|
|
51
|
+
const tmpPath = `${filePath}.tmp`;
|
|
52
|
+
fs_1.default.writeFileSync(tmpPath, JSON.stringify(rotationOrder));
|
|
53
|
+
fs_1.default.renameSync(tmpPath, filePath);
|
|
54
|
+
};
|
|
55
|
+
exports.writeRotationOrderFile = writeRotationOrderFile;
|
|
56
|
+
//# sourceMappingURL=rotationOrderFileWriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rotationOrderFileWriter.js","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/rotationOrderFileWriter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,uCAAyB;AACzB,2CAA6B;AAG7B,MAAM,qBAAqB,GAAG,GAAW,EAAE;IACzC,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC7E,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,qBAAqB,CAAC,CAAC;AACxD,CAAC,CAAC;AAEK,MAAM,sBAAsB,GAAG,CACpC,aAAmC,EAC7B,EAAE;IACR,MAAM,QAAQ,GAAG,qBAAqB,EAAE,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnC,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,MAAM,OAAO,GAAG,GAAG,QAAQ,MAAM,CAAC;IAClC,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;IACzD,YAAE,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC;AATW,QAAA,sBAAsB,0BASjC"}
|
|
@@ -48,6 +48,10 @@ const writeSituationFile = async (params) => {
|
|
|
48
48
|
const awaitingWorkspaceIssues = statusNames.awaitingWorkspaceStatus !== null
|
|
49
49
|
? issues.filter((i) => i.status === statusNames.awaitingWorkspaceStatus)
|
|
50
50
|
: [];
|
|
51
|
+
const failedPreparation = statusNames.failedPreparationStatus !== null
|
|
52
|
+
? issues.filter((i) => i.status === statusNames.failedPreparationStatus)
|
|
53
|
+
.length
|
|
54
|
+
: 0;
|
|
51
55
|
const awaitingWorkspaceImmediatelyActionable = awaitingWorkspaceIssues.filter(isImmediatelyActionable).length;
|
|
52
56
|
const awaitingWorkspaceBlockedByDependency = awaitingWorkspaceIssues.filter((i) => i.dependedIssueUrls.length > 0).length;
|
|
53
57
|
let runningPreparation = null;
|
|
@@ -71,6 +75,7 @@ const writeSituationFile = async (params) => {
|
|
|
71
75
|
preparation: preparationIssues.length,
|
|
72
76
|
awaitingWorkspaceImmediatelyActionable,
|
|
73
77
|
awaitingWorkspaceBlockedByDependency,
|
|
78
|
+
failedPreparation,
|
|
74
79
|
},
|
|
75
80
|
processes: {
|
|
76
81
|
runningPreparation,
|