@davidvornholt/standards 0.13.0 → 0.14.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/README.md +11 -2
- package/package.json +27 -1
- package/src/cli.ts +11 -0
- package/src/creds-add-cloudflare-commit.ts +46 -0
- package/src/creds-add-github.ts +66 -0
- package/src/creds-add.ts +183 -0
- package/src/creds-browser.ts +28 -0
- package/src/creds-cloudflare-account.ts +4 -0
- package/src/creds-cloudflare-api.ts +200 -0
- package/src/creds-cloudflare-condition.ts +63 -0
- package/src/creds-cloudflare-pagination.ts +49 -0
- package/src/creds-cloudflare.ts +197 -0
- package/src/creds-commands.ts +200 -0
- package/src/creds-dest.ts +183 -0
- package/src/creds-login-cloudflare.ts +155 -0
- package/src/creds-login-github-manifest.ts +104 -0
- package/src/creds-login-github.ts +133 -0
- package/src/creds-naming.ts +82 -0
- package/src/creds-plan-revoke.ts +15 -0
- package/src/creds-plan-run.ts +198 -0
- package/src/creds-plan.ts +185 -0
- package/src/creds-prompt.ts +62 -0
- package/src/creds-sops-editor.ts +170 -0
- package/src/creds-sops-structure.ts +199 -0
- package/src/creds-sops.ts +198 -0
- package/src/creds-store-lock.ts +102 -0
- package/src/creds-store.ts +199 -0
- package/src/dev-env.ts +4 -22
- package/src/poller-codex.ts +34 -6
- package/src/poller-config.ts +11 -1
- package/src/poller-fix-run.ts +5 -4
- package/src/poller-job-shared.ts +3 -1
- package/src/poller-review-execution.ts +6 -5
- package/src/poller-units.ts +7 -2
- package/src/sops-exec.ts +47 -0
package/src/poller-units.ts
CHANGED
|
@@ -8,7 +8,11 @@ import { fileURLToPath } from 'node:url';
|
|
|
8
8
|
import type { PollerConfig } from './poller-config';
|
|
9
9
|
|
|
10
10
|
const SERVICE_NAME = 'standards-poller';
|
|
11
|
-
|
|
11
|
+
// Bounds idle pickup latency while preserving a full cooldown after each tick:
|
|
12
|
+
// OnUnitInactiveSec starts counting when the oneshot service finishes.
|
|
13
|
+
// AccuracySec matters at this scale: systemd's default 1min accuracy would
|
|
14
|
+
// stretch a 1min interval into a 1-2min window.
|
|
15
|
+
const TICK_INTERVAL_MINUTES = 1;
|
|
12
16
|
// Non-agent tick work: stale sweeps, clone/fetch, GitHub reads and writes.
|
|
13
17
|
const TICK_OVERHEAD_MINUTES = 30;
|
|
14
18
|
const MAX_ASCII_CONTROL_CODE = 31;
|
|
@@ -62,7 +66,8 @@ Description=Run the standards fix poller on an interval
|
|
|
62
66
|
|
|
63
67
|
[Timer]
|
|
64
68
|
OnBootSec=2min
|
|
65
|
-
|
|
69
|
+
OnUnitInactiveSec=${TICK_INTERVAL_MINUTES}min
|
|
70
|
+
AccuracySec=15s
|
|
66
71
|
Persistent=true
|
|
67
72
|
|
|
68
73
|
[Install]
|
package/src/sops-exec.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Shared sops process runner: prefer a local sops binary and fall back to
|
|
2
|
+
// `nix run nixpkgs#sops`, mirroring the canonical secrets.just tool
|
|
3
|
+
// resolution. Used by dev-env decryption and the creds SOPS writers.
|
|
4
|
+
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import process from 'node:process';
|
|
7
|
+
|
|
8
|
+
export type SopsRunResult = {
|
|
9
|
+
readonly status: number | null;
|
|
10
|
+
readonly stdout: string;
|
|
11
|
+
readonly stderr: string;
|
|
12
|
+
readonly errorMessage: string | null;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const runSops = (
|
|
16
|
+
args: ReadonlyArray<string>,
|
|
17
|
+
cwd: string,
|
|
18
|
+
env?: Readonly<Record<string, string>>,
|
|
19
|
+
): SopsRunResult => {
|
|
20
|
+
const options = {
|
|
21
|
+
cwd,
|
|
22
|
+
encoding: 'utf8' as const,
|
|
23
|
+
env: { ...process.env, ...(env ?? {}) },
|
|
24
|
+
};
|
|
25
|
+
const localSops = spawnSync('sops', [...args], options);
|
|
26
|
+
const result =
|
|
27
|
+
localSops.error === undefined && localSops.status !== null
|
|
28
|
+
? localSops
|
|
29
|
+
: spawnSync(
|
|
30
|
+
'nix',
|
|
31
|
+
[
|
|
32
|
+
'--extra-experimental-features',
|
|
33
|
+
'nix-command flakes',
|
|
34
|
+
'run',
|
|
35
|
+
'nixpkgs#sops',
|
|
36
|
+
'--',
|
|
37
|
+
...args,
|
|
38
|
+
],
|
|
39
|
+
options,
|
|
40
|
+
);
|
|
41
|
+
return {
|
|
42
|
+
status: result.status,
|
|
43
|
+
stdout: result.stdout ?? '',
|
|
44
|
+
stderr: result.stderr ?? '',
|
|
45
|
+
errorMessage: result.error?.message ?? null,
|
|
46
|
+
};
|
|
47
|
+
};
|