claude-threads 1.30.0 → 1.30.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/CHANGELOG.md +5 -0
- package/dist/index.js +13 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.30.1] - 2026-08-28
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
- **The card-injection guard now also covers the haiku-parsed `!watch`/`!routine` paths and the store-level gates.** 1.30.0 collapsed watch *keywords*; model-authored names, conditions and prompts from the natural-language parsers — and the stores' own name/condition normalization, the gate no caller can bypass — now go through the same shared `singleLine` helper (`utils/format.ts`), which replaces the two inline copies of the whitespace-collapse regex.
|
|
12
|
+
|
|
8
13
|
## [1.30.0] - 2026-08-28
|
|
9
14
|
|
|
10
15
|
### Added
|
package/dist/index.js
CHANGED
|
@@ -54578,6 +54578,9 @@ function truncateAtWord(str2, maxLength) {
|
|
|
54578
54578
|
}
|
|
54579
54579
|
return truncated + "…";
|
|
54580
54580
|
}
|
|
54581
|
+
function singleLine(text) {
|
|
54582
|
+
return text.replace(/[\s\u0085]+/g, " ").trim();
|
|
54583
|
+
}
|
|
54581
54584
|
|
|
54582
54585
|
// src/utils/error-handler/index.ts
|
|
54583
54586
|
var log7 = createLogger("error");
|
|
@@ -64908,7 +64911,7 @@ class RoutinesStore extends PlatformListStore {
|
|
|
64908
64911
|
const scheduleError = validateSchedule(routine.schedule);
|
|
64909
64912
|
if (scheduleError)
|
|
64910
64913
|
return scheduleError;
|
|
64911
|
-
const name = routine.name
|
|
64914
|
+
const name = singleLine(routine.name).slice(0, 80);
|
|
64912
64915
|
const prompt = routine.prompt.trim().slice(0, 2000);
|
|
64913
64916
|
if (!name || !prompt)
|
|
64914
64917
|
return "name and prompt are required";
|
|
@@ -64988,8 +64991,8 @@ function validateParsedRoutine(raw, defaultTimezone) {
|
|
|
64988
64991
|
if (typeof raw.error === "string" && raw.error) {
|
|
64989
64992
|
return { ok: false, error: raw.error };
|
|
64990
64993
|
}
|
|
64991
|
-
const name = typeof raw.name === "string" ? raw.name
|
|
64992
|
-
const prompt = typeof raw.prompt === "string" ? raw.prompt
|
|
64994
|
+
const name = typeof raw.name === "string" ? singleLine(raw.name) : "";
|
|
64995
|
+
const prompt = typeof raw.prompt === "string" ? singleLine(raw.prompt) : "";
|
|
64993
64996
|
const preset = raw.preset;
|
|
64994
64997
|
if (!name)
|
|
64995
64998
|
return { ok: false, error: "could not derive a routine name" };
|
|
@@ -65038,7 +65041,7 @@ var MAX_KEYWORD_LENGTH = 60;
|
|
|
65038
65041
|
function validateKeywords(raw) {
|
|
65039
65042
|
if (!Array.isArray(raw))
|
|
65040
65043
|
return "keywords must be a list";
|
|
65041
|
-
const cleaned = [...new Set(raw.filter((k) => typeof k === "string").map((k) => k
|
|
65044
|
+
const cleaned = [...new Set(raw.filter((k) => typeof k === "string").map((k) => singleLine(k).toLowerCase()).filter((k) => k.length > 0 && k.length <= MAX_KEYWORD_LENGTH))];
|
|
65042
65045
|
if (cleaned.length < MIN_KEYWORDS)
|
|
65043
65046
|
return "at least one usable keyword is required";
|
|
65044
65047
|
return cleaned.slice(0, MAX_KEYWORDS);
|
|
@@ -65051,7 +65054,7 @@ class WatchesStore extends PlatformListStore {
|
|
|
65051
65054
|
applyItemDefaults(w) {
|
|
65052
65055
|
w.enabled = w.enabled ?? true;
|
|
65053
65056
|
w.consecutiveFailures = w.consecutiveFailures ?? 0;
|
|
65054
|
-
w.keywords = Array.isArray(w.keywords) ? w.keywords.filter((k) => typeof k === "string").map((k) => k
|
|
65057
|
+
w.keywords = Array.isArray(w.keywords) ? w.keywords.filter((k) => typeof k === "string").map((k) => singleLine(k).toLowerCase()).filter((k) => k.length > 0) : [];
|
|
65055
65058
|
}
|
|
65056
65059
|
warn(message) {
|
|
65057
65060
|
log20.warn(message);
|
|
@@ -65061,8 +65064,8 @@ class WatchesStore extends PlatformListStore {
|
|
|
65061
65064
|
}
|
|
65062
65065
|
async add(platformId, watch, maxWatches = DEFAULT_MAX_WATCHES) {
|
|
65063
65066
|
const result = await this.addItem(platformId, maxWatches, "watch", () => {
|
|
65064
|
-
const name = watch.name
|
|
65065
|
-
const condition = watch.condition
|
|
65067
|
+
const name = singleLine(watch.name).slice(0, 80);
|
|
65068
|
+
const condition = singleLine(watch.condition).slice(0, 500);
|
|
65066
65069
|
const prompt = watch.prompt.trim().slice(0, 2000);
|
|
65067
65070
|
if (!name || !condition || !prompt)
|
|
65068
65071
|
return "name, condition and prompt are required";
|
|
@@ -65112,9 +65115,9 @@ function validateParsedWatch(raw) {
|
|
|
65112
65115
|
if (typeof raw.error === "string" && raw.error) {
|
|
65113
65116
|
return { ok: false, error: raw.error };
|
|
65114
65117
|
}
|
|
65115
|
-
const name = typeof raw.name === "string" ? raw.name
|
|
65116
|
-
const condition = typeof raw.condition === "string" ? raw.condition
|
|
65117
|
-
const prompt = typeof raw.prompt === "string" ? raw.prompt
|
|
65118
|
+
const name = typeof raw.name === "string" ? singleLine(raw.name) : "";
|
|
65119
|
+
const condition = typeof raw.condition === "string" ? singleLine(raw.condition) : "";
|
|
65120
|
+
const prompt = typeof raw.prompt === "string" ? singleLine(raw.prompt) : "";
|
|
65118
65121
|
if (!name || !condition || !prompt) {
|
|
65119
65122
|
return { ok: false, error: "could not extract a name, condition and task from the request" };
|
|
65120
65123
|
}
|
|
@@ -68055,9 +68058,6 @@ function refuseProposal(session, ctx, flavor) {
|
|
|
68055
68058
|
return null;
|
|
68056
68059
|
}
|
|
68057
68060
|
var PROPOSED = "proposed_awaiting_human_approval";
|
|
68058
|
-
function singleLine(text) {
|
|
68059
|
-
return text.replace(/[\s\u0085]+/g, " ").trim();
|
|
68060
|
-
}
|
|
68061
68061
|
async function proposeRoutine(session, ctx, input, signal) {
|
|
68062
68062
|
const refusal = refuseProposal(session, ctx, "routines");
|
|
68063
68063
|
if (refusal)
|
package/package.json
CHANGED