Skip to content

Commit a852354

Browse files
committed
fix: unblock CI typecheck, sherif and nix build gates
- Guard the optional codePointAt results in the cron jitter hash and the legacy-input detector so tsgo's strict checks pass. - Type the accent and color-scheme value sets as ReadonlySet instead of readonly string[], which vue-tsc rejected on every .has() call. - Skip the private apps/vscode workspace in sherif; it is pinned to the VS Code host runtime and is intentionally behind the other apps. - Refresh the pnpmDeps hash in flake.nix to match the current lockfile.
1 parent e12534a commit a852354

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

apps/pythinker-code/src/tui/components/editor/custom-editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function isLegacyModifiedInput(data: string): boolean {
4949
// Legacy terminals send Ctrl/Alt combos as C0 control bytes or ESC+char
5050
// sequences, which never reach the Kitty CSI-u decoder.
5151
if (data.length === 1) {
52-
const code = data.codePointAt(0);
52+
const code = data.codePointAt(0) ?? 0;
5353
return code < 0x20
5454
&& data !== '\t'
5555
&& data !== '\n'

apps/pythinker-web/src/composables/usePythinkerWebClient.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ try {
113113
// remaps the accent tokens to grayscale for 'mono'. Orthogonal to the theme.
114114
export type Accent = 'blue' | 'mono';
115115
const ACCENT_STORAGE_KEY = 'pythinker-web.accent';
116-
const ACCENT_VALUES: readonly string[] = new Set(['blue', 'mono']);
116+
const ACCENT_VALUES: ReadonlySet<string> = new Set(['blue', 'mono']);
117117
function loadAccentFromStorage(): Accent {
118118
try {
119119
const v = localStorage.getItem(ACCENT_STORAGE_KEY);
@@ -129,7 +129,7 @@ function applyAccentToDocument(a: Accent): void {
129129
}
130130

131131
const COLOR_SCHEME_STORAGE_KEY = 'pythinker-web.color-scheme';
132-
const COLOR_SCHEME_VALUES: readonly string[] = new Set(['light', 'dark', 'system']);
132+
const COLOR_SCHEME_VALUES: ReadonlySet<string> = new Set(['light', 'dark', 'system']);
133133

134134
function loadColorSchemeFromStorage(): ColorScheme {
135135
try {
@@ -400,7 +400,7 @@ function saveActiveWorkspaceToStorage(id: string): void {
400400
/** basename of an absolute path (last non-empty segment), defaulting to the path. */
401401
function basename(path: string): string {
402402
const parts = path.split('/').filter(Boolean);
403-
return parts.length > 0 ? parts[parts.length - 1]! : path;
403+
return parts.length > 0 ? parts.at(-1)! : path;
404404
}
405405

406406
/** Shorten a $HOME-prefixed absolute path to `~/…` for dim display. */
@@ -661,10 +661,10 @@ function persistSessionProfile(patch: {
661661
// Promise.resolve wrap: tolerate a sync/undefined return (e.g. test mocks).
662662
void Promise.resolve(getPythinkerWebApi().updateSession(sid, patch))
663663
.then(() => refreshSessionStatus(sid))
664-
.catch((err) => {
664+
.catch((error) => {
665665
// Local state already reflects the change; tell the user (and the log)
666666
// that the daemon did not persist it.
667-
pushOperationFailure('persistSessionProfile', err, { sessionId: sid });
667+
pushOperationFailure('persistSessionProfile', error, { sessionId: sid });
668668
});
669669
}
670670

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
inherit (finalAttrs) pname version src pnpmWorkspaces;
149149
inherit pnpm;
150150
fetcherVersion = 3;
151-
hash = "sha256-zTjp/On758iWGAWAYAIBUXF+pRkUWsUSOg/38LHoCw4=";
151+
hash = "sha256-3bo6StR6vVFZ6ur9p67gIhEzpWzUZ+JzW6O50k13oag=";
152152
};
153153

154154
nativeBuildInputs = [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"lint": "oxlint --type-aware",
1919
"lint:fix": "pnpm run lint --fix",
2020
"lint:pkg": "pnpm --filter @pythoughts/pythinker-code exec publint && npm_config_cache=${TMPDIR:-/tmp}/pythinker-code-npm-cache pnpm --filter @pythoughts/pythinker-code exec attw --pack . --profile node16",
21-
"sherif": "sherif",
21+
"sherif": "sherif --ignore-package ./apps/vscode",
2222
"test": "vitest run",
2323
"test:watch": "vitest",
2424
"test:coverage": "vitest run --coverage",

packages/agent-core/src/tools/cron/jitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function fractionFromId(id: string): number {
6868
// good enough spread for non-hex test ids.
6969
let hash = 5381;
7070
for (let i = 0; i < id.length; i++) {
71-
hash = ((hash << 5) + hash + id.codePointAt(i)) | 0;
71+
hash = ((hash << 5) + hash + (id.codePointAt(i) ?? 0)) | 0;
7272
}
7373
// Map signed int32 to [0, 1).
7474
const unsigned = hash >>> 0;

0 commit comments

Comments
 (0)