@miroshnik/elves 2026.1105.0 → 2026.1105.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miroshnik/elves",
|
|
3
|
-
"version": "2026.1105.
|
|
3
|
+
"version": "2026.1105.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Elves — a development flow with AI agents: shared rules and skills for any agent; install — bunx @miroshnik/elves install -g; the installer and skill scripts — TypeScript under Bun, tests — bun test in tests/",
|
|
6
6
|
"repository": {
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"eslint-plugin-boundaries": "^7.2.0",
|
|
73
73
|
"knip": "^6.41.0"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "339b95668410844065b1be68aedac49b040f2d6e"
|
|
76
76
|
}
|
|
@@ -79,16 +79,18 @@ function api<T>(endpoint: string): T {
|
|
|
79
79
|
const time = (iso: string | undefined): number => Date.parse(iso ?? "");
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
* Ids of the runs with a live artifact, newest first. Only this repository's runs count: a PR run from a fork can
|
|
83
|
-
* an artifact with any name too. `before` — only artifacts uploaded by then: a run finished by a moment uploaded
|
|
84
|
-
* artifact before it.
|
|
82
|
+
* Ids of the runs with a live artifact, newest upload first. Only this repository's runs count: a PR run from a fork can
|
|
83
|
+
* upload an artifact with any name too. `before` — only artifacts uploaded by then: a run finished by a moment uploaded
|
|
84
|
+
* its artifact before it. The API lists artifacts by id, descending, not by upload time — the two differ by tens of
|
|
85
|
+
* minutes, so they are sorted by `created_at` here. A page of 100: the id order strays from time by minutes, not by a
|
|
86
|
+
* page, and newer artifacts keep coming while a run lasts — an older source stays on it.
|
|
85
87
|
*/
|
|
86
88
|
function runIds(artifact: string, before?: number): number[] {
|
|
87
89
|
const { artifacts } = api<{ artifacts: Artifact[] }>(`repos/{owner}/{repo}/actions/artifacts?name=${encodeURIComponent(artifact)}&per_page=100`);
|
|
88
|
-
const own = artifacts
|
|
89
|
-
(a) => !a.expired && a.workflow_run && a.workflow_run.head_repository_id === a.workflow_run.repository_id && !(time(a.created_at) > (before ?? Infinity))
|
|
90
|
-
|
|
91
|
-
// a rerun uploads the artifact again under the same run id
|
|
90
|
+
const own = artifacts
|
|
91
|
+
.filter((a) => !a.expired && a.workflow_run && a.workflow_run.head_repository_id === a.workflow_run.repository_id && !(time(a.created_at) > (before ?? Infinity)))
|
|
92
|
+
.sort((a, b) => time(b.created_at) - time(a.created_at));
|
|
93
|
+
// a rerun uploads the artifact again under the same run id: the run counts by its newest upload
|
|
92
94
|
return [...new Set(own.map((a) => a.workflow_run!.id))];
|
|
93
95
|
}
|
|
94
96
|
|