signetai 0.207.2 → 0.208.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/dist/mcp-stdio.js +850 -55
- package/native-manifest.json +14 -14
- package/package.json +6 -6
package/dist/mcp-stdio.js
CHANGED
|
@@ -14818,6 +14818,34 @@ function up135(db) {
|
|
|
14818
14818
|
ON memory_head_publications(agent_id, status, revision DESC);
|
|
14819
14819
|
`);
|
|
14820
14820
|
}
|
|
14821
|
+
function up136(db) {
|
|
14822
|
+
const cols = new Set(db.prepare("PRAGMA table_info(memory_head_revisions)").all().map((r2) => r2.name));
|
|
14823
|
+
for (const [name, type] of [
|
|
14824
|
+
["entry_id", "TEXT"],
|
|
14825
|
+
["entry_text", "TEXT"],
|
|
14826
|
+
["operation", "TEXT"],
|
|
14827
|
+
["source_refs_json", "TEXT"],
|
|
14828
|
+
["supporting_quotes_json", "TEXT"]
|
|
14829
|
+
]) {
|
|
14830
|
+
if (!cols.has(name))
|
|
14831
|
+
db.exec(`ALTER TABLE memory_head_revisions ADD COLUMN ${name} ${type}`);
|
|
14832
|
+
}
|
|
14833
|
+
db.exec("CREATE UNIQUE INDEX IF NOT EXISTS idx_memory_head_revisions_entry ON memory_head_revisions(agent_id, revision, entry_id)");
|
|
14834
|
+
}
|
|
14835
|
+
function up137(db) {
|
|
14836
|
+
const cols = new Set(db.prepare("PRAGMA table_info(dreaming_passes)").all().map((r2) => r2.name));
|
|
14837
|
+
for (const [name, type] of [
|
|
14838
|
+
["head_revision", "INTEGER"],
|
|
14839
|
+
["head_hash", "TEXT"],
|
|
14840
|
+
["head_added", "INTEGER NOT NULL DEFAULT 0"],
|
|
14841
|
+
["head_updated", "INTEGER NOT NULL DEFAULT 0"],
|
|
14842
|
+
["head_removed", "INTEGER NOT NULL DEFAULT 0"],
|
|
14843
|
+
["head_deferred", "INTEGER NOT NULL DEFAULT 0"],
|
|
14844
|
+
["head_no_op", "INTEGER NOT NULL DEFAULT 0"]
|
|
14845
|
+
])
|
|
14846
|
+
if (!cols.has(name))
|
|
14847
|
+
db.exec(`ALTER TABLE dreaming_passes ADD COLUMN ${name} ${type}`);
|
|
14848
|
+
}
|
|
14821
14849
|
function resolveDefaultBasePath() {
|
|
14822
14850
|
return process.env.SIGNET_PATH || join2(homedir2(), ".agents");
|
|
14823
14851
|
}
|
|
@@ -15130,6 +15158,14 @@ function normalizeLoopbackHost(host) {
|
|
|
15130
15158
|
const normalized = host.trim().toLowerCase().replace(/^\[|\]$/g, "");
|
|
15131
15159
|
return normalized === "localhost" || normalized === "::1" || normalized === "0:0:0:0:0:0:0:1" ? LOOPBACK_HOST : host;
|
|
15132
15160
|
}
|
|
15161
|
+
function parseSimpleYaml(text) {
|
|
15162
|
+
try {
|
|
15163
|
+
const parsed = import_yaml2.default.parse(text);
|
|
15164
|
+
return typeof parsed === "object" && parsed !== null ? parsed : {};
|
|
15165
|
+
} catch {
|
|
15166
|
+
return {};
|
|
15167
|
+
}
|
|
15168
|
+
}
|
|
15133
15169
|
function readEnv(env, name) {
|
|
15134
15170
|
const value = env[name];
|
|
15135
15171
|
if (typeof value !== "string")
|
|
@@ -15303,7 +15339,7 @@ var __create2, __getProtoOf2, __defProp2, __getOwnPropNames2, __hasOwnProp2, __t
|
|
|
15303
15339
|
configurable: true,
|
|
15304
15340
|
set: __exportSetter2.bind(all, name)
|
|
15305
15341
|
});
|
|
15306
|
-
}, __esm2 = (fn, res) => () => (fn && (res = fn(fn = 0)), res), __require, require_identity, require_visit, require_directives, require_anchors, require_applyReviver, require_toJS, require_Node, require_Alias, require_Scalar, require_createNode, require_Collection, require_stringifyComment, require_foldFlowLines, require_stringifyString, require_stringify, require_stringifyPair, require_log, require_merge, require_addPairToJSMap, require_Pair, require_stringifyCollection, require_YAMLMap, require_map, require_YAMLSeq, require_seq, require_string, require_null, require_bool, require_stringifyNumber, require_float, require_int, require_schema, require_schema2, require_binary, require_pairs, require_omap, require_bool2, require_float2, require_int2, require_set, require_timestamp, require_schema3, require_tags, require_Schema, require_stringifyDocument, require_Document, require_errors2, require_resolve_props, require_util_contains_newline, require_util_flow_indent_check, require_util_map_includes, require_resolve_block_map, require_resolve_block_seq, require_resolve_end, require_resolve_flow_collection, require_compose_collection, require_resolve_block_scalar, require_resolve_flow_scalar, require_compose_scalar, require_util_empty_scalar_position, require_compose_node, require_compose_doc, require_composer, require_cst_scalar, require_cst_stringify, require_cst_visit, require_cst, require_lexer, require_line_counter, require_parser, require_public_api, require_dist2, require_keyring_linux_x64_musl, require_package, require_keyring_linux_x64_gnu, require_package2, require_keyring, libsodium_default, init_libsodium, exports_libsodium_wrappers, r, t, a, _, n, s, m, libsodium_wrappers_default, init_libsodium_wrappers, PIPELINE_PROVIDER_CHOICES, SYNTHESIS_PROVIDER_CHOICES, DEFAULT_PIPELINE_TIMEOUT_MS = 90000, PIPELINE_PROVIDER_SET, SYNTHESIS_PROVIDER_SET, MEMORY_CONTENT_SAFETY_POLICY_VERSION = "memory-content-safety-v1", MEMORY_CONTENT_WITHHELD_NOTICE = "[memory content withheld by safety policy]", MEMORY_CONTENT_SAFETY_REASONS, INVISIBLE_UNICODE_RE, STRONG_DEFENSIVE_CONTEXT_RE, REPORTING_CONTEXT_RE, REPORTING_BEFORE_RE, REPORTING_AFTER_RE, NEGATED_DIRECTIVE_RE, PROMPT_INJECTION_RES, TOOL_DIRECTIVE_RES, EXFILTRATION_RE, EXFILTRATION_REVERSE, CREDENTIAL_HARVESTING_RE, DANGEROUS_SHELL_RE, DAEMON_DERIVED_MEMORY_SOURCE_TYPES, MEMORIES_FTS_TOKENIZER = "unicode61", FTS_STATE_TABLE = "memories_fts_state", COLUMNS, DEPENDENCY_TYPES, DERIVED_SOURCE_TYPES, TOKEN_COLUMNS, COLUMNS2, COMPLETION_BOUNDARY_REASONS, MIGRATIONS, LATEST_SCHEMA_VERSION, NETWORK_FILESYSTEM_TYPES, __filename2, __dirname2, import_yaml, SERVICE = "ai.signet.secrets", require2, modulePromise = null, syncModule, adapterForTests = null, secretEventRecorder = () => {}, SECRET_STORE_TEMP_PREFIX = "secrets.enc.tmp-", NATIVE_STORE_VERSION = 2, DEGRADED_WARNING_FILE = ".degraded-warning", KEYRING_ACCOUNT_SCOPE = "workspace", SecretKeyringError, NAME_RE, DEFAULT_TELEMETRY_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_TELEMETRY_POSTHOG_API_KEY = "phc_mLsvJmbmp6e9UarrX9Cq5QtTjVNiiphM9mvi5Xnddd8Q", DEFAULT_TELEMETRY_FLUSH_INTERVAL_MS = 60000, DEFAULT_TELEMETRY_FLUSH_BATCH_SIZE = 50, ENTITY_TYPES, ATTRIBUTE_KINDS, DEPENDENCY_TYPES2, ONTOLOGY_PROPOSAL_OPERATIONS, LOOPBACK_HOST = "127.0.0.1", LOCAL_BINDS, import_yaml2, native = null, SIGNET_SECRETS_PLUGIN_ID = "signet.secrets", SIGNET_GRAPHIQ_PLUGIN_ID = "signet.graphiq", SIGNET_PLUGIN_REGISTRY_DIR = ".daemon/plugins", SIGNET_PLUGIN_REGISTRY_FILE = "registry-v1.json", SIGNET_GRAPHIQ_STATE_FILE = ".daemon/graphiq/state.json", GRAPHIQ_DEFAULT_INSTALL_DIR, SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai", SIGNET_GIT_ALLOWED_DIRECTORIES, SIGNET_GIT_PROTECTED_PATHS, SIGNET_GIT_TRACKED_PATHS, SIGNET_GITIGNORE_PROTECTED_PATTERNS, DEFAULT_DISCORD_DESKTOP_CACHE_PATH, DEFAULT_GITHUB_RESOURCE_TYPES, VALID_GITHUB_RESOURCE_TYPES, IDENTITY_FILES, REQUIRED_IDENTITY_KEYS, OPTIONAL_IDENTITY_KEYS, home, SOURCE_NATIVE_TOPOLOGY_ENTITY_TYPES;
|
|
15342
|
+
}, __esm2 = (fn, res) => () => (fn && (res = fn(fn = 0)), res), __require, require_identity, require_visit, require_directives, require_anchors, require_applyReviver, require_toJS, require_Node, require_Alias, require_Scalar, require_createNode, require_Collection, require_stringifyComment, require_foldFlowLines, require_stringifyString, require_stringify, require_stringifyPair, require_log, require_merge, require_addPairToJSMap, require_Pair, require_stringifyCollection, require_YAMLMap, require_map, require_YAMLSeq, require_seq, require_string, require_null, require_bool, require_stringifyNumber, require_float, require_int, require_schema, require_schema2, require_binary, require_pairs, require_omap, require_bool2, require_float2, require_int2, require_set, require_timestamp, require_schema3, require_tags, require_Schema, require_stringifyDocument, require_Document, require_errors2, require_resolve_props, require_util_contains_newline, require_util_flow_indent_check, require_util_map_includes, require_resolve_block_map, require_resolve_block_seq, require_resolve_end, require_resolve_flow_collection, require_compose_collection, require_resolve_block_scalar, require_resolve_flow_scalar, require_compose_scalar, require_util_empty_scalar_position, require_compose_node, require_compose_doc, require_composer, require_cst_scalar, require_cst_stringify, require_cst_visit, require_cst, require_lexer, require_line_counter, require_parser, require_public_api, require_dist2, require_keyring_linux_x64_musl, require_package, require_keyring_linux_x64_gnu, require_package2, require_keyring, libsodium_default, init_libsodium, exports_libsodium_wrappers, r, t, a, _, n, s, m, libsodium_wrappers_default, init_libsodium_wrappers, PIPELINE_PROVIDER_CHOICES, SYNTHESIS_PROVIDER_CHOICES, DEFAULT_PIPELINE_TIMEOUT_MS = 90000, PIPELINE_PROVIDER_SET, SYNTHESIS_PROVIDER_SET, MEMORY_CONTENT_SAFETY_POLICY_VERSION = "memory-content-safety-v1", MEMORY_CONTENT_WITHHELD_NOTICE = "[memory content withheld by safety policy]", MEMORY_CONTENT_SAFETY_REASONS, INVISIBLE_UNICODE_RE, STRONG_DEFENSIVE_CONTEXT_RE, REPORTING_CONTEXT_RE, REPORTING_BEFORE_RE, REPORTING_AFTER_RE, NEGATED_DIRECTIVE_RE, PROMPT_INJECTION_RES, TOOL_DIRECTIVE_RES, EXFILTRATION_RE, EXFILTRATION_REVERSE, CREDENTIAL_HARVESTING_RE, DANGEROUS_SHELL_RE, DAEMON_DERIVED_MEMORY_SOURCE_TYPES, MEMORIES_FTS_TOKENIZER = "unicode61", FTS_STATE_TABLE = "memories_fts_state", COLUMNS, DEPENDENCY_TYPES, DERIVED_SOURCE_TYPES, TOKEN_COLUMNS, COLUMNS2, COMPLETION_BOUNDARY_REASONS, MIGRATIONS, LATEST_SCHEMA_VERSION, NETWORK_FILESYSTEM_TYPES, __filename2, __dirname2, import_yaml, SERVICE = "ai.signet.secrets", require2, modulePromise = null, syncModule, adapterForTests = null, secretEventRecorder = () => {}, SECRET_STORE_TEMP_PREFIX = "secrets.enc.tmp-", NATIVE_STORE_VERSION = 2, DEGRADED_WARNING_FILE = ".degraded-warning", KEYRING_ACCOUNT_SCOPE = "workspace", SecretKeyringError, NAME_RE, DEFAULT_TELEMETRY_POSTHOG_HOST = "https://us.i.posthog.com", DEFAULT_TELEMETRY_POSTHOG_API_KEY = "phc_mLsvJmbmp6e9UarrX9Cq5QtTjVNiiphM9mvi5Xnddd8Q", DEFAULT_TELEMETRY_FLUSH_INTERVAL_MS = 60000, DEFAULT_TELEMETRY_FLUSH_BATCH_SIZE = 50, DEFAULT_PROVIDER_RATE_LIMIT, TELEMETRY_DEPLOYMENT_ROLES, TELEMETRY_INSTALL_CHANNELS, ENTITY_TYPES, ATTRIBUTE_KINDS, DEPENDENCY_TYPES2, ONTOLOGY_PROPOSAL_OPERATIONS, LOOPBACK_HOST = "127.0.0.1", LOCAL_BINDS, import_yaml2, native = null, SIGNET_SECRETS_PLUGIN_ID = "signet.secrets", SIGNET_GRAPHIQ_PLUGIN_ID = "signet.graphiq", SIGNET_PLUGIN_REGISTRY_DIR = ".daemon/plugins", SIGNET_PLUGIN_REGISTRY_FILE = "registry-v1.json", SIGNET_GRAPHIQ_STATE_FILE = ".daemon/graphiq/state.json", GRAPHIQ_DEFAULT_INSTALL_DIR, SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai", SIGNET_GIT_ALLOWED_DIRECTORIES, SIGNET_GIT_PROTECTED_PATHS, SIGNET_GIT_TRACKED_PATHS, SIGNET_GITIGNORE_PROTECTED_PATTERNS, DEFAULT_DISCORD_DESKTOP_CACHE_PATH, DEFAULT_GITHUB_RESOURCE_TYPES, VALID_GITHUB_RESOURCE_TYPES, IDENTITY_FILES, REQUIRED_IDENTITY_KEYS, OPTIONAL_IDENTITY_KEYS, home, SOURCE_NATIVE_TOPOLOGY_ENTITY_TYPES;
|
|
15307
15343
|
var init_dist = __esm(() => {
|
|
15308
15344
|
__create2 = Object.create;
|
|
15309
15345
|
__getProtoOf2 = Object.getPrototypeOf;
|
|
@@ -24104,6 +24140,23 @@ ${end.comment}` : end.comment;
|
|
|
24104
24140
|
name: "memory-head-publication",
|
|
24105
24141
|
up: up135,
|
|
24106
24142
|
artifacts: { tables: ["memory_head_publications"] }
|
|
24143
|
+
},
|
|
24144
|
+
{
|
|
24145
|
+
version: 136,
|
|
24146
|
+
name: "memory-head-revisions",
|
|
24147
|
+
up: up136,
|
|
24148
|
+
artifacts: { tables: ["memory_head_revisions"] }
|
|
24149
|
+
},
|
|
24150
|
+
{
|
|
24151
|
+
version: 137,
|
|
24152
|
+
name: "dreaming-head-manifest",
|
|
24153
|
+
up: up137,
|
|
24154
|
+
artifacts: {
|
|
24155
|
+
columns: [
|
|
24156
|
+
{ table: "dreaming_passes", column: "head_revision" },
|
|
24157
|
+
{ table: "dreaming_passes", column: "head_hash" }
|
|
24158
|
+
]
|
|
24159
|
+
}
|
|
24107
24160
|
}
|
|
24108
24161
|
];
|
|
24109
24162
|
LATEST_SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1]?.version ?? 0;
|
|
@@ -24123,6 +24176,20 @@ ${end.comment}` : end.comment;
|
|
|
24123
24176
|
}
|
|
24124
24177
|
};
|
|
24125
24178
|
NAME_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
24179
|
+
DEFAULT_PROVIDER_RATE_LIMIT = {
|
|
24180
|
+
maxCallsPerHour: 200,
|
|
24181
|
+
burstSize: 20,
|
|
24182
|
+
waitTimeoutMs: 5000
|
|
24183
|
+
};
|
|
24184
|
+
TELEMETRY_DEPLOYMENT_ROLES = [
|
|
24185
|
+
"personal",
|
|
24186
|
+
"service",
|
|
24187
|
+
"automation",
|
|
24188
|
+
"development",
|
|
24189
|
+
"ci",
|
|
24190
|
+
"unknown"
|
|
24191
|
+
];
|
|
24192
|
+
TELEMETRY_INSTALL_CHANNELS = ["desktop", "package-manager", "source", "container", "unknown"];
|
|
24126
24193
|
ENTITY_TYPES = [
|
|
24127
24194
|
"person",
|
|
24128
24195
|
"project",
|
|
@@ -24866,6 +24933,63 @@ var init_rate_limiter = __esm(() => {
|
|
|
24866
24933
|
});
|
|
24867
24934
|
|
|
24868
24935
|
// ../../platform/daemon/src/auth/config.ts
|
|
24936
|
+
import { join as join5 } from "node:path";
|
|
24937
|
+
function isValidMode(val) {
|
|
24938
|
+
return val === "local" || val === "team" || val === "hybrid";
|
|
24939
|
+
}
|
|
24940
|
+
function parseRateLimit(raw, fallback) {
|
|
24941
|
+
if (!raw || typeof raw !== "object")
|
|
24942
|
+
return fallback;
|
|
24943
|
+
const obj = raw;
|
|
24944
|
+
return {
|
|
24945
|
+
windowMs: typeof obj.windowMs === "number" && obj.windowMs > 0 ? obj.windowMs : fallback.windowMs,
|
|
24946
|
+
max: typeof obj.max === "number" && obj.max > 0 ? obj.max : fallback.max
|
|
24947
|
+
};
|
|
24948
|
+
}
|
|
24949
|
+
function nonEmptyString(value) {
|
|
24950
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
24951
|
+
}
|
|
24952
|
+
function parseLoginConfig(raw) {
|
|
24953
|
+
const login = raw.login && typeof raw.login === "object" ? raw.login : {};
|
|
24954
|
+
const password = login.password && typeof login.password === "object" ? login.password : {};
|
|
24955
|
+
const sso = login.sso && typeof login.sso === "object" ? login.sso : {};
|
|
24956
|
+
const saml = login.saml && typeof login.saml === "object" ? login.saml : {};
|
|
24957
|
+
const legacyAdmin = raw.adminUser && typeof raw.adminUser === "object" ? raw.adminUser : {};
|
|
24958
|
+
return {
|
|
24959
|
+
password: {
|
|
24960
|
+
username: nonEmptyString(password.username) ?? nonEmptyString(legacyAdmin.username) ?? DEFAULT_LOGIN_CONFIG.password.username,
|
|
24961
|
+
passwordHash: nonEmptyString(password.passwordHash) ?? nonEmptyString(legacyAdmin.passwordHash)
|
|
24962
|
+
},
|
|
24963
|
+
sso: { enabled: sso.enabled === true },
|
|
24964
|
+
saml: { enabled: saml.enabled === true }
|
|
24965
|
+
};
|
|
24966
|
+
}
|
|
24967
|
+
function parseAuthConfig(raw, agentsDir) {
|
|
24968
|
+
if (!raw || typeof raw !== "object") {
|
|
24969
|
+
return {
|
|
24970
|
+
...DEFAULT_AUTH_CONFIG,
|
|
24971
|
+
secretPath: join5(agentsDir, ".daemon", "auth-secret")
|
|
24972
|
+
};
|
|
24973
|
+
}
|
|
24974
|
+
const obj = raw;
|
|
24975
|
+
const mode = isValidMode(obj.mode) ? obj.mode : "local";
|
|
24976
|
+
const secretPath = join5(agentsDir, ".daemon", "auth-secret");
|
|
24977
|
+
const rawLimits = obj.rateLimits;
|
|
24978
|
+
const rateLimits = {};
|
|
24979
|
+
for (const [key, fallback] of Object.entries(DEFAULT_RATE_LIMITS)) {
|
|
24980
|
+
rateLimits[key] = parseRateLimit(rawLimits?.[key], fallback);
|
|
24981
|
+
}
|
|
24982
|
+
const defaultTtl = typeof obj.defaultTokenTtlSeconds === "number" && obj.defaultTokenTtlSeconds > 0 ? obj.defaultTokenTtlSeconds : DEFAULT_AUTH_CONFIG.defaultTokenTtlSeconds;
|
|
24983
|
+
const sessionTtl = typeof obj.sessionTokenTtlSeconds === "number" && obj.sessionTokenTtlSeconds > 0 ? obj.sessionTokenTtlSeconds : DEFAULT_AUTH_CONFIG.sessionTokenTtlSeconds;
|
|
24984
|
+
return {
|
|
24985
|
+
mode,
|
|
24986
|
+
secretPath,
|
|
24987
|
+
rateLimits,
|
|
24988
|
+
defaultTokenTtlSeconds: defaultTtl,
|
|
24989
|
+
sessionTokenTtlSeconds: sessionTtl,
|
|
24990
|
+
login: parseLoginConfig(obj)
|
|
24991
|
+
};
|
|
24992
|
+
}
|
|
24869
24993
|
var DEFAULT_LOGIN_CONFIG, DEFAULT_AUTH_CONFIG;
|
|
24870
24994
|
var init_config = __esm(() => {
|
|
24871
24995
|
init_rate_limiter();
|
|
@@ -24909,6 +25033,8 @@ var init_auth = __esm(() => {
|
|
|
24909
25033
|
});
|
|
24910
25034
|
|
|
24911
25035
|
// ../../platform/daemon/src/memory-config.ts
|
|
25036
|
+
import { existsSync as existsSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
25037
|
+
import { join as join6 } from "node:path";
|
|
24912
25038
|
function detectLocalTimeZone() {
|
|
24913
25039
|
try {
|
|
24914
25040
|
return Intl.DateTimeFormat().resolvedOptions().timeZone || "UTC";
|
|
@@ -24916,7 +25042,496 @@ function detectLocalTimeZone() {
|
|
|
24916
25042
|
return "UTC";
|
|
24917
25043
|
}
|
|
24918
25044
|
}
|
|
24919
|
-
|
|
25045
|
+
function isValidTimeZone(timeZone) {
|
|
25046
|
+
try {
|
|
25047
|
+
new Intl.DateTimeFormat("en-US", { timeZone });
|
|
25048
|
+
return true;
|
|
25049
|
+
} catch {
|
|
25050
|
+
return false;
|
|
25051
|
+
}
|
|
25052
|
+
}
|
|
25053
|
+
function clampPositive(raw, min, max, fallback) {
|
|
25054
|
+
if (typeof raw !== "number" || !Number.isFinite(raw))
|
|
25055
|
+
return fallback;
|
|
25056
|
+
return Math.max(min, Math.min(max, raw));
|
|
25057
|
+
}
|
|
25058
|
+
function resolveTelemetryValue(raw, allowed, fallback) {
|
|
25059
|
+
if (typeof raw !== "string")
|
|
25060
|
+
return fallback;
|
|
25061
|
+
const normalized = raw.trim().toLowerCase();
|
|
25062
|
+
return allowed.includes(normalized) ? normalized : fallback;
|
|
25063
|
+
}
|
|
25064
|
+
function clampNonNegative(raw, max, fallback) {
|
|
25065
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw < 0)
|
|
25066
|
+
return fallback;
|
|
25067
|
+
return Math.min(max, raw);
|
|
25068
|
+
}
|
|
25069
|
+
function parseOptionalPositive(raw, min, max) {
|
|
25070
|
+
if (typeof raw !== "number" || !Number.isFinite(raw))
|
|
25071
|
+
return;
|
|
25072
|
+
return Math.max(min, Math.min(max, raw));
|
|
25073
|
+
}
|
|
25074
|
+
function parseEmbeddingCostRates(raw) {
|
|
25075
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw))
|
|
25076
|
+
return;
|
|
25077
|
+
const source = raw;
|
|
25078
|
+
const rates = {};
|
|
25079
|
+
for (const provider of EMBEDDING_COST_PROVIDERS) {
|
|
25080
|
+
const value = source[provider];
|
|
25081
|
+
if (typeof value === "number" && Number.isFinite(value) && value >= 0)
|
|
25082
|
+
rates[provider] = value;
|
|
25083
|
+
}
|
|
25084
|
+
return Object.keys(rates).length > 0 ? rates : undefined;
|
|
25085
|
+
}
|
|
25086
|
+
function clampFraction(raw, fallback) {
|
|
25087
|
+
if (typeof raw !== "number" || !Number.isFinite(raw))
|
|
25088
|
+
return fallback;
|
|
25089
|
+
return Math.max(0, Math.min(1, raw));
|
|
25090
|
+
}
|
|
25091
|
+
function isExtractionStrength(v2) {
|
|
25092
|
+
return typeof v2 === "string" && ["low", "medium", "high"].includes(v2);
|
|
25093
|
+
}
|
|
25094
|
+
function isRecord3(value) {
|
|
25095
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25096
|
+
}
|
|
25097
|
+
function rejectRetiredEmbeddingConfig(yaml) {
|
|
25098
|
+
if (Object.hasOwn(yaml, "embeddings")) {
|
|
25099
|
+
throw new MemoryConfigValidationError("embeddings is retired; configure provider, model, and dimensions under the canonical embedding block instead.");
|
|
25100
|
+
}
|
|
25101
|
+
const memory = yaml.memory;
|
|
25102
|
+
if (isRecord3(memory) && Object.hasOwn(memory, "embeddings")) {
|
|
25103
|
+
throw new MemoryConfigValidationError("memory.embeddings is retired; configure provider, model, and dimensions under the canonical embedding block instead.");
|
|
25104
|
+
}
|
|
25105
|
+
}
|
|
25106
|
+
function parseRateLimitConfig(raw) {
|
|
25107
|
+
if (!isRecord3(raw))
|
|
25108
|
+
return;
|
|
25109
|
+
const maxCallsPerHour = parseOptionalPositive(raw.maxCallsPerHour, 0, 1e4);
|
|
25110
|
+
const burstSize = parseOptionalPositive(raw.burstSize, 1, 1000);
|
|
25111
|
+
const waitTimeoutMs = parseOptionalPositive(raw.waitTimeoutMs, 0, 60000);
|
|
25112
|
+
if (maxCallsPerHour === undefined && burstSize === undefined && waitTimeoutMs === undefined)
|
|
25113
|
+
return;
|
|
25114
|
+
return {
|
|
25115
|
+
maxCallsPerHour: maxCallsPerHour ?? DEFAULT_PROVIDER_RATE_LIMIT.maxCallsPerHour,
|
|
25116
|
+
burstSize: burstSize ?? DEFAULT_PROVIDER_RATE_LIMIT.burstSize,
|
|
25117
|
+
waitTimeoutMs: waitTimeoutMs ?? DEFAULT_PROVIDER_RATE_LIMIT.waitTimeoutMs
|
|
25118
|
+
};
|
|
25119
|
+
}
|
|
25120
|
+
function resolveMaxLlmConcurrency(rawValue, defaultValue) {
|
|
25121
|
+
const env = process.env.SIGNET_MAX_LLM_CONCURRENCY;
|
|
25122
|
+
const candidate = env !== undefined ? Number(env) : rawValue;
|
|
25123
|
+
const isValidCandidate = typeof candidate === "number" && Number.isSafeInteger(candidate) && candidate >= 1;
|
|
25124
|
+
if (env !== undefined && !isValidCandidate) {
|
|
25125
|
+
logger.warn("pipeline", "SIGNET_MAX_LLM_CONCURRENCY is not a valid positive integer, using config/default", {
|
|
25126
|
+
value: env
|
|
25127
|
+
});
|
|
25128
|
+
return clampPositive(rawValue, 1, 16, defaultValue);
|
|
25129
|
+
}
|
|
25130
|
+
return clampPositive(candidate, 1, 16, defaultValue);
|
|
25131
|
+
}
|
|
25132
|
+
function envBool(name) {
|
|
25133
|
+
const value = process.env[name];
|
|
25134
|
+
if (value === undefined)
|
|
25135
|
+
return;
|
|
25136
|
+
const normalized = value.trim().toLowerCase();
|
|
25137
|
+
if (["1", "true", "yes", "on"].includes(normalized))
|
|
25138
|
+
return true;
|
|
25139
|
+
if (["0", "false", "no", "off"].includes(normalized))
|
|
25140
|
+
return false;
|
|
25141
|
+
return;
|
|
25142
|
+
}
|
|
25143
|
+
function parseClaudeCodeConfig(raw, fallback) {
|
|
25144
|
+
if (!isRecord3(raw))
|
|
25145
|
+
return fallback;
|
|
25146
|
+
const allowApiKeyEnv = typeof raw.allowApiKeyEnv === "boolean" ? raw.allowApiKeyEnv : raw.billingMode === "api-key" ? true : raw.billingMode === "subscription" ? false : fallback.allowApiKeyEnv;
|
|
25147
|
+
const maxBudgetUsd = parseOptionalPositive(raw.maxBudgetUsd, 0.01, 1000);
|
|
25148
|
+
const cooldownMs = clampPositive(raw.cooldownMs, 1000, 3600000, fallback.cooldownMs);
|
|
25149
|
+
return {
|
|
25150
|
+
allowApiKeyEnv,
|
|
25151
|
+
...maxBudgetUsd !== undefined ? { maxBudgetUsd } : {},
|
|
25152
|
+
cooldownMs
|
|
25153
|
+
};
|
|
25154
|
+
}
|
|
25155
|
+
function loadPipelineConfig(yaml) {
|
|
25156
|
+
const mem = yaml.memory;
|
|
25157
|
+
const raw = mem?.pipelineV2;
|
|
25158
|
+
if (mem?.synthesis !== undefined) {
|
|
25159
|
+
throw new PipelineConfigValidationError("memory.synthesis is retired; MEMORY.md synthesis follows the canonical inference workload instead.");
|
|
25160
|
+
}
|
|
25161
|
+
if (!raw)
|
|
25162
|
+
return { ...DEFAULT_PIPELINE_V2 };
|
|
25163
|
+
const extractionRaw = raw.extraction;
|
|
25164
|
+
const workerRaw = raw.worker;
|
|
25165
|
+
const claudeCodeRaw = raw.claudeCode;
|
|
25166
|
+
const graphRaw = raw.graph;
|
|
25167
|
+
const traversalRaw = raw.traversal;
|
|
25168
|
+
const rerankerRaw = raw.reranker;
|
|
25169
|
+
const autonomousRaw = raw.autonomous;
|
|
25170
|
+
const repairRaw = raw.repair;
|
|
25171
|
+
const documentsRaw = raw.documents;
|
|
25172
|
+
const guardrailsRaw = raw.guardrails;
|
|
25173
|
+
const telemetryRaw = raw.telemetry;
|
|
25174
|
+
const continuityRaw = raw.continuity;
|
|
25175
|
+
const subagentsRaw = raw.subagents;
|
|
25176
|
+
const embeddingTrackerRaw = raw.embeddingTracker;
|
|
25177
|
+
const synthesisValue = raw.synthesis;
|
|
25178
|
+
const synthesisRaw = isRecord3(synthesisValue) ? synthesisValue : undefined;
|
|
25179
|
+
const proceduralRaw = raw.procedural;
|
|
25180
|
+
const feedbackRaw = raw.feedback;
|
|
25181
|
+
const significanceRaw = raw.significance;
|
|
25182
|
+
const modelRegistryRaw = raw.modelRegistry;
|
|
25183
|
+
const hintsRaw = raw.hints;
|
|
25184
|
+
const reflectionsRaw = raw.reflections;
|
|
25185
|
+
const d2 = DEFAULT_PIPELINE_V2;
|
|
25186
|
+
function resolveBool(nested, flat, fallback) {
|
|
25187
|
+
if (typeof nested === "boolean")
|
|
25188
|
+
return nested;
|
|
25189
|
+
if (typeof flat === "boolean")
|
|
25190
|
+
return flat;
|
|
25191
|
+
return fallback;
|
|
25192
|
+
}
|
|
25193
|
+
const legacyRoutingKeys = [
|
|
25194
|
+
["memory.pipelineV2.extractionProvider", raw.extractionProvider],
|
|
25195
|
+
["memory.pipelineV2.extractionModel", raw.extractionModel],
|
|
25196
|
+
["memory.pipelineV2.extractionEndpoint", raw.extractionEndpoint],
|
|
25197
|
+
["memory.pipelineV2.extractionBaseUrl", raw.extractionBaseUrl],
|
|
25198
|
+
["memory.pipelineV2.extractionFallbackProvider", raw.extractionFallbackProvider],
|
|
25199
|
+
["memory.pipelineV2.allowRemoteProviders", raw.allowRemoteProviders],
|
|
25200
|
+
["memory.pipelineV2.extraction.provider", extractionRaw?.provider],
|
|
25201
|
+
["memory.pipelineV2.extraction.model", extractionRaw?.model],
|
|
25202
|
+
["memory.pipelineV2.extraction.endpoint", extractionRaw?.endpoint],
|
|
25203
|
+
["memory.pipelineV2.extraction.base_url", extractionRaw?.base_url],
|
|
25204
|
+
["memory.pipelineV2.extraction.baseUrl", extractionRaw?.baseUrl],
|
|
25205
|
+
["memory.pipelineV2.extraction.fallbackProvider", extractionRaw?.fallbackProvider],
|
|
25206
|
+
["memory.pipelineV2.extraction.allowRemoteProviders", extractionRaw?.allowRemoteProviders],
|
|
25207
|
+
["memory.pipelineV2.synthesis.provider", synthesisRaw?.provider],
|
|
25208
|
+
["memory.pipelineV2.synthesis.model", synthesisRaw?.model],
|
|
25209
|
+
["memory.pipelineV2.synthesis.endpoint", synthesisRaw?.endpoint],
|
|
25210
|
+
["memory.pipelineV2.synthesis.base_url", synthesisRaw?.base_url],
|
|
25211
|
+
["memory.pipelineV2.synthesis.baseUrl", synthesisRaw?.baseUrl]
|
|
25212
|
+
];
|
|
25213
|
+
const legacyRoutingKey = legacyRoutingKeys.find(([, value]) => value !== undefined);
|
|
25214
|
+
if (legacyRoutingKey) {
|
|
25215
|
+
throw new PipelineConfigValidationError(`${legacyRoutingKey[0]} is retired; configure the canonical inference workload instead.`);
|
|
25216
|
+
}
|
|
25217
|
+
if (extractionRaw?.command !== undefined || raw.extractionCommand !== undefined) {
|
|
25218
|
+
throw new PipelineConfigValidationError("memory.pipelineV2.extraction command configuration is retired; configure the canonical inference workload instead.");
|
|
25219
|
+
}
|
|
25220
|
+
if (synthesisValue !== undefined) {
|
|
25221
|
+
throw new PipelineConfigValidationError("memory.pipelineV2.synthesis is retired; configure the canonical inference workload instead.");
|
|
25222
|
+
}
|
|
25223
|
+
if (raw.writeGate !== undefined || raw.durability !== undefined || raw.writeGateEnabled !== undefined || raw.writeGateThreshold !== undefined || raw.writeGateContinuityDiscount !== undefined) {
|
|
25224
|
+
throw new PipelineConfigValidationError("memory.pipelineV2.writeGate and durability configuration is retired; Dreaming is the sole semantic writer.");
|
|
25225
|
+
}
|
|
25226
|
+
if (proceduralRaw?.enrichOnInstall !== undefined || proceduralRaw?.enrichMinDescription !== undefined) {
|
|
25227
|
+
throw new PipelineConfigValidationError("memory.pipelineV2.procedural enrichment configuration is retired; skill frontmatter is used as authored.");
|
|
25228
|
+
}
|
|
25229
|
+
const resolvedTimeout = clampPositive(extractionRaw?.timeout ?? raw.extractionTimeout, 5000, 300000, d2.extraction.timeout);
|
|
25230
|
+
const maxAW = clampFraction(feedbackRaw?.maxAspectWeight, d2.feedback.maxAspectWeight);
|
|
25231
|
+
const minAW = clampFraction(feedbackRaw?.minAspectWeight, d2.feedback.minAspectWeight);
|
|
25232
|
+
const validatedMinAW = minAW > maxAW ? maxAW : minAW;
|
|
25233
|
+
return {
|
|
25234
|
+
enabled: typeof raw.enabled === "boolean" ? raw.enabled : d2.enabled,
|
|
25235
|
+
paused: typeof raw.paused === "boolean" ? raw.paused : d2.paused,
|
|
25236
|
+
shadowMode: typeof raw.shadowMode === "boolean" ? raw.shadowMode : d2.shadowMode,
|
|
25237
|
+
mutationsFrozen: typeof raw.mutationsFrozen === "boolean" ? raw.mutationsFrozen : d2.mutationsFrozen,
|
|
25238
|
+
semanticContradictionEnabled: typeof raw.semanticContradictionEnabled === "boolean" ? raw.semanticContradictionEnabled : d2.semanticContradictionEnabled,
|
|
25239
|
+
semanticContradictionTimeoutMs: clampPositive(raw.semanticContradictionTimeoutMs, 5000, 300000, d2.semanticContradictionTimeoutMs),
|
|
25240
|
+
extraction: {
|
|
25241
|
+
strength: (() => {
|
|
25242
|
+
const candidate = raw.extractionStrength ?? extractionRaw?.strength;
|
|
25243
|
+
return isExtractionStrength(candidate) ? candidate : d2.extraction.strength;
|
|
25244
|
+
})(),
|
|
25245
|
+
timeout: resolvedTimeout,
|
|
25246
|
+
minConfidence: clampFraction(extractionRaw?.minConfidence ?? raw.minFactConfidenceForWrite, d2.extraction.minConfidence),
|
|
25247
|
+
rateLimit: parseRateLimitConfig(extractionRaw?.rateLimit),
|
|
25248
|
+
structuredOutput: (() => {
|
|
25249
|
+
const candidate = extractionRaw?.structuredOutput;
|
|
25250
|
+
return typeof candidate === "boolean" ? candidate : undefined;
|
|
25251
|
+
})()
|
|
25252
|
+
},
|
|
25253
|
+
worker: {
|
|
25254
|
+
maxRetries: clampPositive(workerRaw?.maxRetries ?? raw.workerMaxRetries, 1, 10, d2.worker.maxRetries),
|
|
25255
|
+
leaseTimeoutMs: clampPositive(workerRaw?.leaseTimeoutMs ?? raw.leaseTimeoutMs, 1e4, 600000, d2.worker.leaseTimeoutMs),
|
|
25256
|
+
maxLlmConcurrency: resolveMaxLlmConcurrency(workerRaw?.maxLlmConcurrency, d2.worker.maxLlmConcurrency)
|
|
25257
|
+
},
|
|
25258
|
+
claudeCode: parseClaudeCodeConfig(claudeCodeRaw, d2.claudeCode),
|
|
25259
|
+
graph: {
|
|
25260
|
+
enabled: resolveBool(graphRaw?.enabled, raw.graphEnabled, d2.graph.enabled),
|
|
25261
|
+
boostWeight: clampFraction(graphRaw?.boostWeight ?? raw.graphBoostWeight, d2.graph.boostWeight),
|
|
25262
|
+
boostTimeoutMs: clampPositive(graphRaw?.boostTimeoutMs ?? raw.graphBoostTimeoutMs, 50, 5000, d2.graph.boostTimeoutMs)
|
|
25263
|
+
},
|
|
25264
|
+
traversal: {
|
|
25265
|
+
enabled: resolveBool(traversalRaw?.enabled, undefined, d2.traversal?.enabled ?? true),
|
|
25266
|
+
primary: resolveBool(traversalRaw?.primary, undefined, d2.traversal?.primary ?? true),
|
|
25267
|
+
maxAspectsPerEntity: clampPositive(traversalRaw?.maxAspectsPerEntity, 1, 100, d2.traversal?.maxAspectsPerEntity ?? 20),
|
|
25268
|
+
maxAttributesPerAspect: clampPositive(traversalRaw?.maxAttributesPerAspect, 1, 200, d2.traversal?.maxAttributesPerAspect ?? 50),
|
|
25269
|
+
maxWriteAspectsPerEntity: clampPositive(traversalRaw?.maxWriteAspectsPerEntity, 1, 50, d2.traversal?.maxWriteAspectsPerEntity ?? 20),
|
|
25270
|
+
maxWriteAttributesPerAspect: clampPositive(traversalRaw?.maxWriteAttributesPerAspect, 1, 100, d2.traversal?.maxWriteAttributesPerAspect ?? 50),
|
|
25271
|
+
maxDependencyHops: clampPositive(traversalRaw?.maxDependencyHops, 1, 200, d2.traversal?.maxDependencyHops ?? 10),
|
|
25272
|
+
minDependencyStrength: clampFraction(traversalRaw?.minDependencyStrength, d2.traversal?.minDependencyStrength ?? 0.3),
|
|
25273
|
+
maxBranching: clampPositive(traversalRaw?.maxBranching, 1, 50, d2.traversal?.maxBranching ?? 4),
|
|
25274
|
+
maxTraversalPaths: clampPositive(traversalRaw?.maxTraversalPaths, 1, 500, d2.traversal?.maxTraversalPaths ?? 50),
|
|
25275
|
+
minConfidence: clampFraction(traversalRaw?.minConfidence, d2.traversal?.minConfidence ?? 0.5),
|
|
25276
|
+
timeoutMs: clampPositive(traversalRaw?.timeoutMs, 50, 5000, d2.traversal?.timeoutMs ?? 500),
|
|
25277
|
+
boostWeight: clampFraction(traversalRaw?.boostWeight, d2.traversal?.boostWeight ?? 0.2),
|
|
25278
|
+
constraintBudgetChars: clampPositive(traversalRaw?.constraintBudgetChars, 200, 1e4, d2.traversal?.constraintBudgetChars ?? 1000)
|
|
25279
|
+
},
|
|
25280
|
+
reranker: {
|
|
25281
|
+
enabled: resolveBool(rerankerRaw?.enabled, raw.rerankerEnabled, d2.reranker.enabled),
|
|
25282
|
+
model: typeof rerankerRaw?.model === "string" ? rerankerRaw.model : typeof raw.rerankerModel === "string" ? raw.rerankerModel : d2.reranker.model,
|
|
25283
|
+
useExtractionModel: resolveBool(rerankerRaw?.useExtractionModel, raw.rerankerUseExtractionModel, d2.reranker.useExtractionModel),
|
|
25284
|
+
topN: clampPositive(rerankerRaw?.topN ?? raw.rerankerTopN, 1, 100, d2.reranker.topN),
|
|
25285
|
+
timeoutMs: clampPositive(rerankerRaw?.timeoutMs ?? raw.rerankerTimeoutMs, 100, 30000, d2.reranker.timeoutMs)
|
|
25286
|
+
},
|
|
25287
|
+
autonomous: {
|
|
25288
|
+
enabled: resolveBool(autonomousRaw?.enabled, raw.autonomousEnabled, d2.autonomous.enabled),
|
|
25289
|
+
frozen: resolveBool(autonomousRaw?.frozen, raw.autonomousFrozen, d2.autonomous.frozen),
|
|
25290
|
+
allowUpdateDelete: resolveBool(autonomousRaw?.allowUpdateDelete, raw.allowUpdateDelete, d2.autonomous.allowUpdateDelete),
|
|
25291
|
+
maintenanceIntervalMs: clampPositive(autonomousRaw?.maintenanceIntervalMs ?? raw.maintenanceIntervalMs, 60000, 86400000, d2.autonomous.maintenanceIntervalMs),
|
|
25292
|
+
maintenanceMode: (() => {
|
|
25293
|
+
const v2 = autonomousRaw?.maintenanceMode ?? raw.maintenanceMode;
|
|
25294
|
+
if (v2 === "execute" || v2 === "observe")
|
|
25295
|
+
return v2;
|
|
25296
|
+
return d2.autonomous.maintenanceMode;
|
|
25297
|
+
})()
|
|
25298
|
+
},
|
|
25299
|
+
repair: {
|
|
25300
|
+
reembedCooldownMs: clampPositive(repairRaw?.reembedCooldownMs ?? raw.repairReembedCooldownMs, 1e4, 3600000, d2.repair.reembedCooldownMs),
|
|
25301
|
+
reembedHourlyBudget: clampPositive(repairRaw?.reembedHourlyBudget ?? raw.repairReembedHourlyBudget, 1, 1000, d2.repair.reembedHourlyBudget),
|
|
25302
|
+
requeueCooldownMs: clampPositive(repairRaw?.requeueCooldownMs ?? raw.repairRequeueCooldownMs, 5000, 3600000, d2.repair.requeueCooldownMs),
|
|
25303
|
+
requeueHourlyBudget: clampPositive(repairRaw?.requeueHourlyBudget ?? raw.repairRequeueHourlyBudget, 1, 1000, d2.repair.requeueHourlyBudget),
|
|
25304
|
+
dedupCooldownMs: clampPositive(repairRaw?.dedupCooldownMs ?? raw.repairDedupCooldownMs, 1e4, 3600000, d2.repair.dedupCooldownMs),
|
|
25305
|
+
dedupHourlyBudget: clampPositive(repairRaw?.dedupHourlyBudget ?? raw.repairDedupHourlyBudget, 1, 100, d2.repair.dedupHourlyBudget),
|
|
25306
|
+
dedupSemanticThreshold: clampFraction(repairRaw?.dedupSemanticThreshold ?? raw.repairDedupSemanticThreshold, d2.repair.dedupSemanticThreshold),
|
|
25307
|
+
dedupBatchSize: clampPositive(repairRaw?.dedupBatchSize ?? raw.repairDedupBatchSize, 10, 1000, d2.repair.dedupBatchSize)
|
|
25308
|
+
},
|
|
25309
|
+
documents: {
|
|
25310
|
+
workerIntervalMs: clampPositive(documentsRaw?.workerIntervalMs ?? raw.documentWorkerIntervalMs, 1000, 300000, d2.documents.workerIntervalMs),
|
|
25311
|
+
chunkSize: clampPositive(documentsRaw?.chunkSize ?? raw.documentChunkSize, 200, 50000, d2.documents.chunkSize),
|
|
25312
|
+
chunkOverlap: clampPositive(documentsRaw?.chunkOverlap ?? raw.documentChunkOverlap, 0, 1e4, d2.documents.chunkOverlap),
|
|
25313
|
+
maxContentBytes: clampPositive(documentsRaw?.maxContentBytes ?? raw.documentMaxContentBytes, 1024, 100 * 1024 * 1024, d2.documents.maxContentBytes)
|
|
25314
|
+
},
|
|
25315
|
+
guardrails: {
|
|
25316
|
+
maxContentChars: clampPositive(guardrailsRaw?.maxContentChars, 50, 1e5, d2.guardrails.maxContentChars),
|
|
25317
|
+
chunkTargetChars: clampPositive(guardrailsRaw?.chunkTargetChars, 50, 50000, d2.guardrails.chunkTargetChars),
|
|
25318
|
+
recallTruncateChars: clampPositive(guardrailsRaw?.recallTruncateChars, 50, 1e5, d2.guardrails.recallTruncateChars),
|
|
25319
|
+
contextBudgetChars: clampPositive(guardrailsRaw?.contextBudgetChars, 200, 1e5, d2.guardrails.contextBudgetChars)
|
|
25320
|
+
},
|
|
25321
|
+
continuity: {
|
|
25322
|
+
enabled: resolveBool(continuityRaw?.enabled, undefined, d2.continuity.enabled),
|
|
25323
|
+
promptInterval: clampPositive(continuityRaw?.promptInterval, 1, 1000, d2.continuity.promptInterval),
|
|
25324
|
+
timeIntervalMs: clampPositive(continuityRaw?.timeIntervalMs, 60000, 3600000, d2.continuity.timeIntervalMs),
|
|
25325
|
+
maxCheckpointsPerSession: clampPositive(continuityRaw?.maxCheckpointsPerSession, 1, 500, d2.continuity.maxCheckpointsPerSession),
|
|
25326
|
+
retentionDays: clampPositive(continuityRaw?.retentionDays, 1, 90, d2.continuity.retentionDays),
|
|
25327
|
+
recoveryBudgetChars: clampPositive(continuityRaw?.recoveryBudgetChars, 200, 1e4, d2.continuity.recoveryBudgetChars)
|
|
25328
|
+
},
|
|
25329
|
+
subagents: {
|
|
25330
|
+
inheritContext: resolveBool(subagentsRaw?.inheritContext, undefined, d2.subagents?.inheritContext ?? true),
|
|
25331
|
+
tailChars: clampNonNegative(subagentsRaw?.tailChars, 20000, d2.subagents?.tailChars ?? 3000)
|
|
25332
|
+
},
|
|
25333
|
+
telemetryEnabled: typeof raw.telemetryEnabled === "boolean" ? raw.telemetryEnabled : d2.telemetryEnabled,
|
|
25334
|
+
telemetry: {
|
|
25335
|
+
posthogHost: typeof telemetryRaw?.posthogHost === "string" ? telemetryRaw.posthogHost : d2.telemetry.posthogHost,
|
|
25336
|
+
posthogApiKey: typeof telemetryRaw?.posthogApiKey === "string" ? telemetryRaw.posthogApiKey : d2.telemetry.posthogApiKey,
|
|
25337
|
+
flushIntervalMs: clampPositive(telemetryRaw?.flushIntervalMs, 5000, 600000, d2.telemetry.flushIntervalMs),
|
|
25338
|
+
flushBatchSize: clampPositive(telemetryRaw?.flushBatchSize, 1, 500, d2.telemetry.flushBatchSize),
|
|
25339
|
+
retentionDays: clampPositive(telemetryRaw?.retentionDays, 1, 365, d2.telemetry.retentionDays),
|
|
25340
|
+
memorySearchQaEnabled: resolveBool(telemetryRaw?.memorySearchQaEnabled, undefined, d2.telemetry.memorySearchQaEnabled),
|
|
25341
|
+
deploymentRole: resolveTelemetryValue(telemetryRaw?.deploymentRole, TELEMETRY_DEPLOYMENT_ROLES, d2.telemetry.deploymentRole ?? "unknown"),
|
|
25342
|
+
installChannel: resolveTelemetryValue(telemetryRaw?.installChannel, TELEMETRY_INSTALL_CHANNELS, d2.telemetry.installChannel ?? "unknown")
|
|
25343
|
+
},
|
|
25344
|
+
embeddingTracker: {
|
|
25345
|
+
enabled: resolveBool(embeddingTrackerRaw?.enabled, undefined, d2.embeddingTracker.enabled),
|
|
25346
|
+
pollMs: clampPositive(embeddingTrackerRaw?.pollMs, 1000, 60000, d2.embeddingTracker.pollMs),
|
|
25347
|
+
batchSize: clampPositive(embeddingTrackerRaw?.batchSize, 1, 20, d2.embeddingTracker.batchSize)
|
|
25348
|
+
},
|
|
25349
|
+
procedural: {
|
|
25350
|
+
enabled: resolveBool(proceduralRaw?.enabled, undefined, d2.procedural.enabled),
|
|
25351
|
+
decayRate: clampFraction(proceduralRaw?.decayRate, d2.procedural.decayRate),
|
|
25352
|
+
minImportance: clampFraction(proceduralRaw?.minImportance, d2.procedural.minImportance),
|
|
25353
|
+
importanceOnInstall: clampFraction(proceduralRaw?.importanceOnInstall, d2.procedural.importanceOnInstall),
|
|
25354
|
+
reconcileIntervalMs: clampPositive(proceduralRaw?.reconcileIntervalMs, 1e4, 600000, d2.procedural.reconcileIntervalMs)
|
|
25355
|
+
},
|
|
25356
|
+
feedback: {
|
|
25357
|
+
enabled: resolveBool(feedbackRaw?.enabled, undefined, d2.feedback.enabled),
|
|
25358
|
+
ftsWeightDelta: clampFraction(feedbackRaw?.ftsWeightDelta, d2.feedback.ftsWeightDelta),
|
|
25359
|
+
maxAspectWeight: maxAW,
|
|
25360
|
+
minAspectWeight: validatedMinAW,
|
|
25361
|
+
decayEnabled: resolveBool(feedbackRaw?.decayEnabled, undefined, d2.feedback.decayEnabled),
|
|
25362
|
+
decayRate: clampFraction(feedbackRaw?.decayRate, d2.feedback.decayRate),
|
|
25363
|
+
staleDays: clampPositive(feedbackRaw?.staleDays, 1, 365, d2.feedback.staleDays),
|
|
25364
|
+
decayIntervalSessions: clampPositive(feedbackRaw?.decayIntervalSessions, 1, 1000, d2.feedback.decayIntervalSessions)
|
|
25365
|
+
},
|
|
25366
|
+
significance: {
|
|
25367
|
+
enabled: resolveBool(significanceRaw?.enabled, undefined, d2.significance?.enabled ?? true),
|
|
25368
|
+
minTurns: clampPositive(significanceRaw?.minTurns, 1, 100, d2.significance?.minTurns ?? 5),
|
|
25369
|
+
minEntityOverlap: clampPositive(significanceRaw?.minEntityOverlap, 0, 100, d2.significance?.minEntityOverlap ?? 1),
|
|
25370
|
+
noveltyThreshold: clampFraction(significanceRaw?.noveltyThreshold, d2.significance?.noveltyThreshold ?? 0.15)
|
|
25371
|
+
},
|
|
25372
|
+
modelRegistry: {
|
|
25373
|
+
enabled: resolveBool(modelRegistryRaw?.enabled, undefined, d2.modelRegistry.enabled),
|
|
25374
|
+
refreshIntervalMs: clampPositive(modelRegistryRaw?.refreshIntervalMs, 60000, 86400000, d2.modelRegistry.refreshIntervalMs)
|
|
25375
|
+
},
|
|
25376
|
+
hints: {
|
|
25377
|
+
enabled: resolveBool(hintsRaw?.enabled, undefined, d2.hints?.enabled ?? true),
|
|
25378
|
+
max: clampPositive(hintsRaw?.max, 1, 10, d2.hints?.max ?? 5),
|
|
25379
|
+
timeout: clampPositive(hintsRaw?.timeout, 5000, 120000, d2.hints?.timeout ?? 60000),
|
|
25380
|
+
maxTokens: clampPositive(hintsRaw?.maxTokens, 64, 1024, d2.hints?.maxTokens ?? 256),
|
|
25381
|
+
poll: clampPositive(hintsRaw?.poll, 1000, 60000, d2.hints?.poll ?? 5000)
|
|
25382
|
+
},
|
|
25383
|
+
reflections: {
|
|
25384
|
+
enabled: resolveBool(reflectionsRaw?.enabled, undefined, d2.reflections.enabled),
|
|
25385
|
+
model: typeof reflectionsRaw?.model === "string" && reflectionsRaw.model.trim().length > 0 ? reflectionsRaw.model : d2.reflections.model,
|
|
25386
|
+
timeout: clampPositive(reflectionsRaw?.timeout, 5000, 300000, d2.reflections.timeout),
|
|
25387
|
+
maxTokens: clampPositive(reflectionsRaw?.maxTokens, 500, 16000, d2.reflections.maxTokens),
|
|
25388
|
+
schedule: typeof reflectionsRaw?.schedule === "string" && reflectionsRaw.schedule.trim().length > 0 ? reflectionsRaw.schedule : d2.reflections.schedule,
|
|
25389
|
+
timezone: typeof reflectionsRaw?.timezone === "string" && isValidTimeZone(reflectionsRaw.timezone) ? reflectionsRaw.timezone : d2.reflections.timezone,
|
|
25390
|
+
count: clampPositive(reflectionsRaw?.count, 1, 6, d2.reflections.count),
|
|
25391
|
+
timeWindowHours: clampPositive(reflectionsRaw?.timeWindowHours, 1, 168, d2.reflections.timeWindowHours),
|
|
25392
|
+
maxMemories: clampPositive(reflectionsRaw?.maxMemories, 5, 500, d2.reflections.maxMemories),
|
|
25393
|
+
maxSummaries: clampPositive(reflectionsRaw?.maxSummaries, 1, 50, d2.reflections.maxSummaries)
|
|
25394
|
+
}
|
|
25395
|
+
};
|
|
25396
|
+
}
|
|
25397
|
+
function clampWarn(field, raw, min, max, fallback) {
|
|
25398
|
+
if (typeof raw !== "number" || !Number.isFinite(raw))
|
|
25399
|
+
return fallback;
|
|
25400
|
+
const clamped = Math.max(min, Math.min(max, raw));
|
|
25401
|
+
if (clamped !== raw) {
|
|
25402
|
+
logger.warn("config", `dreaming.${field} out of range [${min}, ${max}]: ${raw} → clamped to ${clamped}`);
|
|
25403
|
+
}
|
|
25404
|
+
return clamped;
|
|
25405
|
+
}
|
|
25406
|
+
function loadDreamingConfig(yaml) {
|
|
25407
|
+
const mem = yaml.memory;
|
|
25408
|
+
const raw = mem?.dreaming;
|
|
25409
|
+
if (!raw)
|
|
25410
|
+
return { ...DEFAULT_DREAMING };
|
|
25411
|
+
const dd = DEFAULT_DREAMING;
|
|
25412
|
+
const defaultSurprisal = dd.surprisal ?? DEFAULT_DREAMING_SURPRISAL;
|
|
25413
|
+
const surprisal = raw.surprisal;
|
|
25414
|
+
return {
|
|
25415
|
+
tokenThreshold: clampWarn("tokenThreshold", raw.tokenThreshold, 1e4, 1e6, dd.tokenThreshold),
|
|
25416
|
+
maxInterval: clampWarn("maxInterval", raw.maxInterval, 5 * 60 * 1000, 7 * 24 * 60 * 60 * 1000, dd.maxInterval),
|
|
25417
|
+
timeout: clampWarn("timeout", raw.timeout, 30000, 1800000, dd.timeout),
|
|
25418
|
+
maxInputTokens: clampWarn("maxInputTokens", raw.maxInputTokens, 8000, 1e6, dd.maxInputTokens),
|
|
25419
|
+
maxOutputTokens: clampWarn("maxOutputTokens", raw.maxOutputTokens, 1000, 128000, dd.maxOutputTokens),
|
|
25420
|
+
backfillOnFirstRun: typeof raw.backfillOnFirstRun === "boolean" ? raw.backfillOnFirstRun : dd.backfillOnFirstRun,
|
|
25421
|
+
surprisal: {
|
|
25422
|
+
enabled: typeof surprisal?.enabled === "boolean" ? surprisal.enabled : defaultSurprisal.enabled,
|
|
25423
|
+
sampleSize: clampWarn("surprisal.sampleSize", surprisal?.sampleSize, 20, 500, defaultSurprisal.sampleSize),
|
|
25424
|
+
maxCandidates: clampWarn("surprisal.maxCandidates", surprisal?.maxCandidates, 1, 20, defaultSurprisal.maxCandidates),
|
|
25425
|
+
minObservations: clampWarn("surprisal.minObservations", surprisal?.minObservations, 8, 500, defaultSurprisal.minObservations),
|
|
25426
|
+
neighborCount: clampWarn("surprisal.neighborCount", surprisal?.neighborCount, 1, 32, defaultSurprisal.neighborCount),
|
|
25427
|
+
treeLeafSize: clampWarn("surprisal.treeLeafSize", surprisal?.treeLeafSize, 2, 64, defaultSurprisal.treeLeafSize),
|
|
25428
|
+
minScore: clampWarn("surprisal.minScore", surprisal?.minScore, 0, 1, defaultSurprisal.minScore)
|
|
25429
|
+
}
|
|
25430
|
+
};
|
|
25431
|
+
}
|
|
25432
|
+
function loadMemoryConfig(agentsDir) {
|
|
25433
|
+
const defaults = {
|
|
25434
|
+
embedding: {
|
|
25435
|
+
provider: "native",
|
|
25436
|
+
model: "nomic-embed-text-v1.5",
|
|
25437
|
+
dimensions: 768,
|
|
25438
|
+
base_url: "",
|
|
25439
|
+
promptSubmitTimeoutMs: DEFAULT_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS,
|
|
25440
|
+
llamaCppMaxInputTokens: DEFAULT_LLAMACPP_MAX_INPUT_TOKENS,
|
|
25441
|
+
warmNative: true
|
|
25442
|
+
},
|
|
25443
|
+
search: {
|
|
25444
|
+
alpha: 0.7,
|
|
25445
|
+
top_k: 20,
|
|
25446
|
+
min_score: 0.1,
|
|
25447
|
+
rehearsal_enabled: true,
|
|
25448
|
+
rehearsal_weight: 0.1,
|
|
25449
|
+
rehearsal_half_life_days: 30,
|
|
25450
|
+
temporal_prior_enabled: true,
|
|
25451
|
+
temporal_prior_weight: 0.15,
|
|
25452
|
+
temporal_prior_half_life_days: 14
|
|
25453
|
+
},
|
|
25454
|
+
pipelineV2: { ...DEFAULT_PIPELINE_V2 },
|
|
25455
|
+
dreaming: { ...DEFAULT_DREAMING },
|
|
25456
|
+
auth: parseAuthConfig(undefined, agentsDir)
|
|
25457
|
+
};
|
|
25458
|
+
const paths = [join6(agentsDir, "agent.yaml"), join6(agentsDir, "AGENT.yaml"), join6(agentsDir, "config.yaml")];
|
|
25459
|
+
const envWarmNative = envBool("SIGNET_EMBEDDING_WARM_NATIVE");
|
|
25460
|
+
for (const path of paths) {
|
|
25461
|
+
if (!existsSync2(path))
|
|
25462
|
+
continue;
|
|
25463
|
+
try {
|
|
25464
|
+
const yaml = parseSimpleYaml(readFileSync3(path, "utf-8"));
|
|
25465
|
+
if (isRecord3(yaml))
|
|
25466
|
+
rejectRetiredEmbeddingConfig(yaml);
|
|
25467
|
+
const emb = yaml.embedding ?? {};
|
|
25468
|
+
const configuredCostRates = parseEmbeddingCostRates(emb.costRates ?? emb.cost_rates);
|
|
25469
|
+
if (configuredCostRates)
|
|
25470
|
+
defaults.embedding.costRates = configuredCostRates;
|
|
25471
|
+
const srch = yaml.search ?? {};
|
|
25472
|
+
defaults.embedding.promptSubmitTimeoutMs = clampPositive(emb.promptSubmitTimeoutMs, MIN_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS, MAX_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS, defaults.embedding.promptSubmitTimeoutMs ?? DEFAULT_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS);
|
|
25473
|
+
defaults.embedding.llamaCppMaxInputTokens = clampPositive(emb.llamaCppMaxInputTokens, MIN_LLAMACPP_MAX_INPUT_TOKENS, MAX_LLAMACPP_MAX_INPUT_TOKENS, defaults.embedding.llamaCppMaxInputTokens ?? DEFAULT_LLAMACPP_MAX_INPUT_TOKENS);
|
|
25474
|
+
if (typeof emb.warmNative === "boolean") {
|
|
25475
|
+
defaults.embedding.warmNative = emb.warmNative;
|
|
25476
|
+
}
|
|
25477
|
+
if (emb.provider === "none") {
|
|
25478
|
+
defaults.embedding.provider = "none";
|
|
25479
|
+
} else if (emb.provider) {
|
|
25480
|
+
const rawProvider = String(emb.provider);
|
|
25481
|
+
defaults.embedding.provider = rawProvider === "local" ? "native" : rawProvider;
|
|
25482
|
+
defaults.embedding.model = emb.model ?? defaults.embedding.model;
|
|
25483
|
+
defaults.embedding.dimensions = Number.parseInt(String(emb.dimensions ?? "768"), 10);
|
|
25484
|
+
const explicitBaseUrl = (typeof emb.base_url === "string" ? emb.base_url : undefined) ?? (typeof emb.endpoint === "string" ? emb.endpoint : undefined);
|
|
25485
|
+
if (defaults.embedding.provider === "ollama") {
|
|
25486
|
+
defaults.embedding.base_url = typeof explicitBaseUrl === "string" && explicitBaseUrl.trim().length > 0 ? explicitBaseUrl : DEFAULT_OLLAMA_BASE_URL;
|
|
25487
|
+
} else if (defaults.embedding.provider === "llama-cpp") {
|
|
25488
|
+
defaults.embedding.base_url = typeof explicitBaseUrl === "string" && explicitBaseUrl.trim().length > 0 ? explicitBaseUrl : DEFAULT_LLAMACPP_BASE_URL;
|
|
25489
|
+
} else if (defaults.embedding.provider === "openai") {
|
|
25490
|
+
defaults.embedding.base_url = typeof explicitBaseUrl === "string" && explicitBaseUrl.trim().length > 0 ? explicitBaseUrl : DEFAULT_OPENAI_BASE_URL;
|
|
25491
|
+
} else {
|
|
25492
|
+
defaults.embedding.base_url = explicitBaseUrl ?? defaults.embedding.base_url;
|
|
25493
|
+
}
|
|
25494
|
+
defaults.embedding.api_key = emb.api_key;
|
|
25495
|
+
}
|
|
25496
|
+
if (srch.alpha !== undefined) {
|
|
25497
|
+
defaults.search.alpha = Number.parseFloat(String(srch.alpha));
|
|
25498
|
+
defaults.search.top_k = Number.parseInt(String(srch.top_k ?? "20"), 10);
|
|
25499
|
+
defaults.search.min_score = Number.parseFloat(String(srch.min_score ?? "0.3"));
|
|
25500
|
+
}
|
|
25501
|
+
if (srch.rehearsal_enabled !== undefined) {
|
|
25502
|
+
defaults.search.rehearsal_enabled = srch.rehearsal_enabled === true;
|
|
25503
|
+
}
|
|
25504
|
+
if (typeof srch.rehearsal_weight === "number") {
|
|
25505
|
+
defaults.search.rehearsal_weight = Math.max(0, Math.min(1, srch.rehearsal_weight));
|
|
25506
|
+
}
|
|
25507
|
+
if (typeof srch.rehearsal_half_life_days === "number") {
|
|
25508
|
+
defaults.search.rehearsal_half_life_days = Math.max(1, srch.rehearsal_half_life_days);
|
|
25509
|
+
}
|
|
25510
|
+
if (srch.temporal_prior_enabled !== undefined) {
|
|
25511
|
+
defaults.search.temporal_prior_enabled = srch.temporal_prior_enabled === true;
|
|
25512
|
+
}
|
|
25513
|
+
if (typeof srch.temporal_prior_weight === "number") {
|
|
25514
|
+
defaults.search.temporal_prior_weight = Math.max(0, Math.min(1, srch.temporal_prior_weight));
|
|
25515
|
+
}
|
|
25516
|
+
if (typeof srch.temporal_prior_half_life_days === "number") {
|
|
25517
|
+
defaults.search.temporal_prior_half_life_days = Math.max(1, Math.min(365, srch.temporal_prior_half_life_days));
|
|
25518
|
+
}
|
|
25519
|
+
defaults.pipelineV2 = loadPipelineConfig(yaml);
|
|
25520
|
+
defaults.dreaming = loadDreamingConfig(yaml);
|
|
25521
|
+
defaults.auth = parseAuthConfig(yaml.auth, agentsDir);
|
|
25522
|
+
break;
|
|
25523
|
+
} catch (error51) {
|
|
25524
|
+
if (error51 instanceof MemoryConfigValidationError || error51 instanceof PipelineConfigValidationError) {
|
|
25525
|
+
throw error51;
|
|
25526
|
+
}
|
|
25527
|
+
}
|
|
25528
|
+
}
|
|
25529
|
+
if (envWarmNative !== undefined) {
|
|
25530
|
+
defaults.embedding.warmNative = envWarmNative;
|
|
25531
|
+
}
|
|
25532
|
+
return defaults;
|
|
25533
|
+
}
|
|
25534
|
+
var DEFAULT_DREAMING_SURPRISAL, DEFAULT_DREAMING, PipelineConfigValidationError, DEFAULT_PIPELINE_V2, DEFAULT_OLLAMA_BASE_URL, DEFAULT_LLAMACPP_BASE_URL, DEFAULT_LLAMACPP_MAX_INPUT_TOKENS = 1400, MIN_LLAMACPP_MAX_INPUT_TOKENS = 128, MAX_LLAMACPP_MAX_INPUT_TOKENS = 131072, DEFAULT_OPENAI_BASE_URL = "https://api.openai.com/v1", DEFAULT_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS = 1000, MIN_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS = 1000, MAX_PROMPT_SUBMIT_EMBEDDING_TIMEOUT_MS = 300000, MemoryConfigValidationError, EMBEDDING_COST_PROVIDERS;
|
|
24920
25535
|
var init_memory_config = __esm(() => {
|
|
24921
25536
|
init_dist();
|
|
24922
25537
|
init_auth();
|
|
@@ -24939,6 +25554,12 @@ var init_memory_config = __esm(() => {
|
|
|
24939
25554
|
backfillOnFirstRun: true,
|
|
24940
25555
|
surprisal: DEFAULT_DREAMING_SURPRISAL
|
|
24941
25556
|
};
|
|
25557
|
+
PipelineConfigValidationError = class PipelineConfigValidationError extends Error {
|
|
25558
|
+
constructor(message) {
|
|
25559
|
+
super(message);
|
|
25560
|
+
this.name = "PipelineConfigValidationError";
|
|
25561
|
+
}
|
|
25562
|
+
};
|
|
24942
25563
|
DEFAULT_PIPELINE_V2 = {
|
|
24943
25564
|
enabled: true,
|
|
24944
25565
|
paused: false,
|
|
@@ -25094,6 +25715,15 @@ var init_memory_config = __esm(() => {
|
|
|
25094
25715
|
};
|
|
25095
25716
|
DEFAULT_OLLAMA_BASE_URL = `http://${LOOPBACK_HOST}:11434`;
|
|
25096
25717
|
DEFAULT_LLAMACPP_BASE_URL = `http://${LOOPBACK_HOST}:8080`;
|
|
25718
|
+
MemoryConfigValidationError = class MemoryConfigValidationError extends Error {
|
|
25719
|
+
};
|
|
25720
|
+
EMBEDDING_COST_PROVIDERS = [
|
|
25721
|
+
"native",
|
|
25722
|
+
"llama-cpp",
|
|
25723
|
+
"ollama",
|
|
25724
|
+
"openai",
|
|
25725
|
+
"openrouter"
|
|
25726
|
+
];
|
|
25097
25727
|
});
|
|
25098
25728
|
|
|
25099
25729
|
// ../../platform/daemon/src/db-observability.ts
|
|
@@ -25104,9 +25734,9 @@ var init_runtime_pressure = () => {};
|
|
|
25104
25734
|
// ../../platform/daemon/src/db-accessor.ts
|
|
25105
25735
|
import {
|
|
25106
25736
|
copyFileSync,
|
|
25107
|
-
existsSync as
|
|
25737
|
+
existsSync as existsSync4,
|
|
25108
25738
|
mkdirSync as mkdirSync3,
|
|
25109
|
-
readFileSync as
|
|
25739
|
+
readFileSync as readFileSync6,
|
|
25110
25740
|
readdirSync as readdirSync3,
|
|
25111
25741
|
statSync as statSync3,
|
|
25112
25742
|
statfsSync,
|
|
@@ -25151,10 +25781,10 @@ var init_db_accessor = __esm(() => {
|
|
|
25151
25781
|
import { createHash as createHash3 } from "node:crypto";
|
|
25152
25782
|
import {
|
|
25153
25783
|
chmodSync as chmodSync2,
|
|
25154
|
-
existsSync as
|
|
25784
|
+
existsSync as existsSync7,
|
|
25155
25785
|
mkdirSync as mkdirSync5,
|
|
25156
25786
|
mkdtempSync,
|
|
25157
|
-
readFileSync as
|
|
25787
|
+
readFileSync as readFileSync8,
|
|
25158
25788
|
readdirSync as readdirSync5,
|
|
25159
25789
|
renameSync as renameSync4,
|
|
25160
25790
|
rmSync,
|
|
@@ -25162,7 +25792,7 @@ import {
|
|
|
25162
25792
|
writeFileSync
|
|
25163
25793
|
} from "node:fs";
|
|
25164
25794
|
import { tmpdir } from "node:os";
|
|
25165
|
-
import { dirname as dirname3, join as
|
|
25795
|
+
import { dirname as dirname3, join as join7 } from "node:path";
|
|
25166
25796
|
function nativeRuntimeAssets() {
|
|
25167
25797
|
return globalThis.__SIGNET_NATIVE_RUNTIME_ASSETS__ ?? {};
|
|
25168
25798
|
}
|
|
@@ -25171,10 +25801,10 @@ function resolveEmbeddedWorkerPath(name) {
|
|
|
25171
25801
|
if (!worker)
|
|
25172
25802
|
return null;
|
|
25173
25803
|
const hash2 = createHash3("sha256").update(worker.contentBase64).digest("hex").slice(0, 16);
|
|
25174
|
-
const dir =
|
|
25175
|
-
const path =
|
|
25804
|
+
const dir = join7(tmpdir(), "signet-native-workers");
|
|
25805
|
+
const path = join7(dir, `${name.replace(/[^a-zA-Z0-9_.-]/g, "_")}-${hash2}.mjs`);
|
|
25176
25806
|
mkdirSync5(dir, { recursive: true });
|
|
25177
|
-
if (!
|
|
25807
|
+
if (!existsSync7(path)) {
|
|
25178
25808
|
writeFileSync(path, Buffer.from(worker.contentBase64, "base64"));
|
|
25179
25809
|
}
|
|
25180
25810
|
return path;
|
|
@@ -25277,7 +25907,7 @@ var require_base64_js = __commonJS((exports) => {
|
|
|
25277
25907
|
});
|
|
25278
25908
|
|
|
25279
25909
|
// ../../platform/daemon/src/mcp-stdio.ts
|
|
25280
|
-
import { existsSync as
|
|
25910
|
+
import { existsSync as existsSync15, statSync as statSync4 } from "node:fs";
|
|
25281
25911
|
import { isAbsolute } from "node:path";
|
|
25282
25912
|
|
|
25283
25913
|
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
|
|
@@ -48116,6 +48746,12 @@ try {
|
|
|
48116
48746
|
const esmRequire = createRequire6(import.meta.url);
|
|
48117
48747
|
native2 = esmRequire("@signet/native");
|
|
48118
48748
|
} catch {}
|
|
48749
|
+
function countChanges(result) {
|
|
48750
|
+
if (typeof result !== "object" || result === null)
|
|
48751
|
+
return 0;
|
|
48752
|
+
const row = result;
|
|
48753
|
+
return typeof row.changes === "number" ? row.changes : 0;
|
|
48754
|
+
}
|
|
48119
48755
|
function tableExists4(db, name) {
|
|
48120
48756
|
return db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?").get(name) != null;
|
|
48121
48757
|
}
|
|
@@ -49204,15 +49840,15 @@ function pendingDreamingEvidenceContinuations(db, agentId, limit, kind) {
|
|
|
49204
49840
|
|
|
49205
49841
|
// ../../platform/daemon/src/pipeline/dreaming-token-cache.ts
|
|
49206
49842
|
init_native_runtime_assets();
|
|
49207
|
-
import { existsSync as
|
|
49208
|
-
import { join as
|
|
49843
|
+
import { existsSync as existsSync9 } from "node:fs";
|
|
49844
|
+
import { join as join9 } from "node:path";
|
|
49209
49845
|
import { dirname as dirname6 } from "node:path";
|
|
49210
49846
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
49211
49847
|
import { Worker } from "node:worker_threads";
|
|
49212
49848
|
function resolveWorkerPath() {
|
|
49213
49849
|
const moduleDir = dirname6(fileURLToPath2(import.meta.url));
|
|
49214
|
-
const bundled =
|
|
49215
|
-
return
|
|
49850
|
+
const bundled = join9(moduleDir, "dreaming-token-worker.js");
|
|
49851
|
+
return existsSync9(bundled) ? bundled : resolveEmbeddedWorkerPath("dreaming-token-worker") ?? join9(moduleDir, "dreaming-token-worker.ts");
|
|
49216
49852
|
}
|
|
49217
49853
|
|
|
49218
49854
|
class DreamingBacklogTokenCache {
|
|
@@ -50258,7 +50894,7 @@ async function getStructuralDensity(accessor2, entityId, agentId) {
|
|
|
50258
50894
|
init_dist();
|
|
50259
50895
|
|
|
50260
50896
|
// ../../platform/daemon/src/ontology-evidence.ts
|
|
50261
|
-
function
|
|
50897
|
+
function isRecord5(value) {
|
|
50262
50898
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
50263
50899
|
}
|
|
50264
50900
|
function readString(record5, key) {
|
|
@@ -50308,7 +50944,7 @@ function readOntologyEvidenceRef(value) {
|
|
|
50308
50944
|
const trimmed = value.trim();
|
|
50309
50945
|
return trimmed.length > 0 ? { sourceKind: null, sourceId: trimmed, sourcePath: null, memoryId: null, quote: null, reference: value } : null;
|
|
50310
50946
|
}
|
|
50311
|
-
if (!
|
|
50947
|
+
if (!isRecord5(value))
|
|
50312
50948
|
return null;
|
|
50313
50949
|
const transcriptId = readString(value, "transcript_id");
|
|
50314
50950
|
const sessionKey = readString(value, "session_key");
|
|
@@ -51483,12 +52119,12 @@ function now() {
|
|
|
51483
52119
|
function canonical(value) {
|
|
51484
52120
|
return value.trim().toLowerCase().replace(/\s+/g, " ");
|
|
51485
52121
|
}
|
|
51486
|
-
function
|
|
52122
|
+
function isRecord7(value) {
|
|
51487
52123
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
51488
52124
|
}
|
|
51489
52125
|
function parseJsonRecord(value) {
|
|
51490
52126
|
const parsed = JSON.parse(value);
|
|
51491
|
-
return
|
|
52127
|
+
return isRecord7(parsed) ? parsed : {};
|
|
51492
52128
|
}
|
|
51493
52129
|
function parseJsonArray3(value) {
|
|
51494
52130
|
const parsed = JSON.parse(value);
|
|
@@ -51615,7 +52251,7 @@ function isDreamingAttentionEvidenceInTx(db, agentId, value) {
|
|
|
51615
52251
|
function validateProposalEvidenceSourcesInTx(db, agentId, evidence) {
|
|
51616
52252
|
for (const value of evidence) {
|
|
51617
52253
|
const ref3 = readOntologyEvidenceRef(value);
|
|
51618
|
-
if (ref3 === null || !
|
|
52254
|
+
if (ref3 === null || !isRecord7(ref3.reference) || !("source_ref" in ref3.reference))
|
|
51619
52255
|
continue;
|
|
51620
52256
|
if (isDreamingAttentionEvidenceInTx(db, agentId, ref3.reference))
|
|
51621
52257
|
continue;
|
|
@@ -52842,7 +53478,7 @@ function wasEntityMergeApplied(db, agentId, sourceId, targetId, sourceSelector)
|
|
|
52842
53478
|
if (!Array.isArray(merged))
|
|
52843
53479
|
continue;
|
|
52844
53480
|
if (merged.some((item) => {
|
|
52845
|
-
if (!
|
|
53481
|
+
if (!isRecord7(item))
|
|
52846
53482
|
return false;
|
|
52847
53483
|
if (sourceId !== null)
|
|
52848
53484
|
return readString2(item, "entityId") === sourceId;
|
|
@@ -54177,11 +54813,11 @@ function collectReviewDueClaims(accessor2, now2, options = {}) {
|
|
|
54177
54813
|
init_dist();
|
|
54178
54814
|
init_db_accessor();
|
|
54179
54815
|
import { createHash as createHash5, randomUUID as randomUUID2 } from "node:crypto";
|
|
54180
|
-
import { mkdirSync as mkdirSync6, renameSync as renameSync6, writeFileSync as writeFileSync4, readFileSync as
|
|
54181
|
-
import { dirname as dirname8, join as
|
|
54816
|
+
import { mkdirSync as mkdirSync6, renameSync as renameSync6, writeFileSync as writeFileSync4, readFileSync as readFileSync9 } from "node:fs";
|
|
54817
|
+
import { dirname as dirname8, join as join11 } from "node:path";
|
|
54182
54818
|
var CURATED_MEMORY_HEAD_MAX_TOKENS = 1000;
|
|
54183
54819
|
var hash2 = (text2) => createHash5("sha256").update(text2).digest("hex");
|
|
54184
|
-
var pathFor = (agentId) => agentId === "default" ?
|
|
54820
|
+
var pathFor = (agentId) => agentId === "default" ? join11(resolveDefaultBasePath(), "MEMORY.md") : join11(resolveDefaultBasePath(), "agents", agentId, "MEMORY.md");
|
|
54185
54821
|
var render = (entries) => entries.map((entry) => `- ${entry.text.trim()}`).join(`
|
|
54186
54822
|
`);
|
|
54187
54823
|
async function readCuratedMemoryHead(agentId) {
|
|
@@ -54201,7 +54837,7 @@ async function readCuratedMemoryHead(agentId) {
|
|
|
54201
54837
|
mkdirSync6(dirname8(target2), { recursive: true });
|
|
54202
54838
|
let existing = "";
|
|
54203
54839
|
try {
|
|
54204
|
-
existing =
|
|
54840
|
+
existing = readFileSync9(target2, "utf8");
|
|
54205
54841
|
} catch {}
|
|
54206
54842
|
if (existing !== `${content}
|
|
54207
54843
|
`) {
|
|
@@ -54338,6 +54974,138 @@ async function commitCuratedMemoryHead(input) {
|
|
|
54338
54974
|
return committed;
|
|
54339
54975
|
}
|
|
54340
54976
|
|
|
54977
|
+
// ../../platform/daemon/src/memory-head.ts
|
|
54978
|
+
init_dist();
|
|
54979
|
+
init_db_accessor();
|
|
54980
|
+
import { createHash as createHash6, randomUUID as randomUUID3 } from "node:crypto";
|
|
54981
|
+
import { existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync10, rmSync as rmSync3, writeFileSync as writeFileSync6 } from "node:fs";
|
|
54982
|
+
import { dirname as dirname9, join as join12 } from "node:path";
|
|
54983
|
+
init_memory_config();
|
|
54984
|
+
var MEMORY_HEAD_MAX_TOKENS = 1000;
|
|
54985
|
+
function getAgentsDir2() {
|
|
54986
|
+
return resolveDefaultBasePath();
|
|
54987
|
+
}
|
|
54988
|
+
function hashContent(content) {
|
|
54989
|
+
return createHash6("sha256").update(content).digest("hex");
|
|
54990
|
+
}
|
|
54991
|
+
function projectMemoryMd(content) {
|
|
54992
|
+
const stamp = new Date().toISOString().slice(0, 16).replace("T", " ");
|
|
54993
|
+
const prefix = `<!-- generated ${stamp} -->
|
|
54994
|
+
|
|
54995
|
+
`;
|
|
54996
|
+
const body = content.trim();
|
|
54997
|
+
if (countTokens(`${prefix}${body}`) > MEMORY_HEAD_MAX_TOKENS) {
|
|
54998
|
+
throw new Error(`MEMORY.md candidate exceeds the ${MEMORY_HEAD_MAX_TOKENS}-token limit`);
|
|
54999
|
+
}
|
|
55000
|
+
return { body, file: `${prefix}${body}` };
|
|
55001
|
+
}
|
|
55002
|
+
function resolveMemoryHeadPath(agentsDir, agentId) {
|
|
55003
|
+
if (agentId === "default")
|
|
55004
|
+
return join12(agentsDir, "MEMORY.md");
|
|
55005
|
+
return join12(agentsDir, "agents", agentId, "MEMORY.md");
|
|
55006
|
+
}
|
|
55007
|
+
function acquireHeadLease(agentId, owner, ttlMs) {
|
|
55008
|
+
try {
|
|
55009
|
+
return getDbAccessor().withWriteTx((db) => {
|
|
55010
|
+
const table = db.prepare(`SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'memory_md_heads'`).get();
|
|
55011
|
+
if (!table) {
|
|
55012
|
+
return { ok: false, error: "memory_md_heads table unavailable", code: "unavailable" };
|
|
55013
|
+
}
|
|
55014
|
+
const now2 = new Date().toISOString();
|
|
55015
|
+
db.prepare(`INSERT OR IGNORE INTO memory_md_heads
|
|
55016
|
+
(agent_id, content, content_hash, revision, updated_at)
|
|
55017
|
+
VALUES (?, '', '', 0, ?)`).run(agentId, now2);
|
|
55018
|
+
const active = db.prepare(`SELECT revision, content_hash, lease_token, lease_expires_at
|
|
55019
|
+
FROM memory_md_heads
|
|
55020
|
+
WHERE agent_id = ?`).get(agentId);
|
|
55021
|
+
if (!active) {
|
|
55022
|
+
return { ok: false, error: "memory head state missing", code: "unavailable" };
|
|
55023
|
+
}
|
|
55024
|
+
const expiresAt = active.lease_expires_at ? Date.parse(active.lease_expires_at) : 0;
|
|
55025
|
+
if (active.lease_token && Number.isFinite(expiresAt) && expiresAt > Date.now()) {
|
|
55026
|
+
return { ok: false, error: "MEMORY.md write busy", code: "busy" };
|
|
55027
|
+
}
|
|
55028
|
+
const token = randomUUID3();
|
|
55029
|
+
const leaseUntil = new Date(Date.now() + ttlMs).toISOString();
|
|
55030
|
+
const result = db.prepare(`UPDATE memory_md_heads
|
|
55031
|
+
SET lease_token = ?, lease_owner = ?, lease_expires_at = ?
|
|
55032
|
+
WHERE agent_id = ?`).run(token, owner, leaseUntil, agentId);
|
|
55033
|
+
if (countChanges(result) === 0) {
|
|
55034
|
+
return { ok: false, error: "MEMORY.md write busy", code: "busy" };
|
|
55035
|
+
}
|
|
55036
|
+
return {
|
|
55037
|
+
ok: true,
|
|
55038
|
+
row: {
|
|
55039
|
+
token,
|
|
55040
|
+
revision: active.revision,
|
|
55041
|
+
hash: active.content_hash
|
|
55042
|
+
}
|
|
55043
|
+
};
|
|
55044
|
+
});
|
|
55045
|
+
} catch {
|
|
55046
|
+
return { ok: false, error: "memory head db unavailable", code: "unavailable" };
|
|
55047
|
+
}
|
|
55048
|
+
}
|
|
55049
|
+
function writeProjection(file2, agentId) {
|
|
55050
|
+
const agentsDir = getAgentsDir2();
|
|
55051
|
+
const path = resolveMemoryHeadPath(agentsDir, agentId);
|
|
55052
|
+
const dir = dirname9(path);
|
|
55053
|
+
mkdirSync7(dir, { recursive: true });
|
|
55054
|
+
if (existsSync10(path)) {
|
|
55055
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-").slice(0, 19);
|
|
55056
|
+
const backup = join12(dir, "memory", `MEMORY.backup-${stamp}.md`);
|
|
55057
|
+
mkdirSync7(dirname9(backup), { recursive: true });
|
|
55058
|
+
writeFileSync6(backup, readFileSync10(path, "utf-8"));
|
|
55059
|
+
}
|
|
55060
|
+
writeFileSync6(path, file2);
|
|
55061
|
+
}
|
|
55062
|
+
async function curateMemoryHead(input) {
|
|
55063
|
+
if (!input.passId.trim() || !input.agentId.trim())
|
|
55064
|
+
return { ok: false, error: "passId and agentId are required", code: "invalid" };
|
|
55065
|
+
for (const entry of input.entries) {
|
|
55066
|
+
if (!entry.id.trim() || !entry.text.trim())
|
|
55067
|
+
return { ok: false, error: "Memory head entries require id and text", code: "invalid" };
|
|
55068
|
+
if (entry.operation !== "deferred" && entry.operation !== "no-op" && (!entry.sourceRefs.length || !entry.supportingQuotes.length))
|
|
55069
|
+
return { ok: false, error: `Entry ${entry.id} requires provenance`, code: "invalid" };
|
|
55070
|
+
}
|
|
55071
|
+
let projected;
|
|
55072
|
+
try {
|
|
55073
|
+
projected = projectMemoryMd(input.content.trim());
|
|
55074
|
+
} catch (error51) {
|
|
55075
|
+
return { ok: false, error: error51 instanceof Error ? error51.message : String(error51), code: "invalid" };
|
|
55076
|
+
}
|
|
55077
|
+
const lease = acquireHeadLease(input.agentId, `dreaming:${input.passId}`, loadMemoryConfig(getAgentsDir2()).pipelineV2.worker.leaseTimeoutMs);
|
|
55078
|
+
if (!lease.ok)
|
|
55079
|
+
return { ok: false, error: lease.error, code: lease.code === "busy" ? "busy" : "invalid" };
|
|
55080
|
+
const hash3 = hashContent(projected.body);
|
|
55081
|
+
const next = lease.row.hash === hash3 ? lease.row.revision : lease.row.revision + 1;
|
|
55082
|
+
const path = resolveMemoryHeadPath(getAgentsDir2(), input.agentId);
|
|
55083
|
+
const previous = existsSync10(path) ? readFileSync10(path, "utf-8") : undefined;
|
|
55084
|
+
try {
|
|
55085
|
+
await getDbAccessor().withWriteTxAsync((db) => {
|
|
55086
|
+
db.prepare(`UPDATE memory_md_heads SET content = ?, content_hash = ?, revision = ?, updated_at = ?, lease_token = NULL, lease_owner = NULL, lease_expires_at = NULL WHERE agent_id = ? AND lease_token = ?`).run(projected.body, hash3, next, new Date().toISOString(), input.agentId, lease.row.token);
|
|
55087
|
+
for (const entry of input.entries)
|
|
55088
|
+
db.prepare(`INSERT INTO memory_head_revisions (id, agent_id, revision, content, content_hash, rendered_token_count, pass_id, base_revision, base_hash, created_at, entry_id, entry_text, operation, source_refs_json, supporting_quotes_json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(randomUUID3(), input.agentId, next, input.content.trim(), hash3, countTokens(input.content.trim()), input.passId, input.baseRevision, input.baseHash, new Date().toISOString(), entry.id, entry.text, entry.operation, JSON.stringify(entry.sourceRefs), JSON.stringify(entry.supportingQuotes));
|
|
55089
|
+
writeProjection(projected.file, input.agentId);
|
|
55090
|
+
});
|
|
55091
|
+
} catch (error51) {
|
|
55092
|
+
try {
|
|
55093
|
+
if (previous === undefined) {
|
|
55094
|
+
if (existsSync10(path))
|
|
55095
|
+
rmSync3(path);
|
|
55096
|
+
} else
|
|
55097
|
+
writeFileSync6(path, previous);
|
|
55098
|
+
} catch {}
|
|
55099
|
+
return { ok: false, error: error51 instanceof Error ? error51.message : String(error51), code: "invalid" };
|
|
55100
|
+
}
|
|
55101
|
+
return {
|
|
55102
|
+
ok: true,
|
|
55103
|
+
revision: next,
|
|
55104
|
+
hash: hash3,
|
|
55105
|
+
changed: next !== input.baseRevision || hash3 !== input.baseHash
|
|
55106
|
+
};
|
|
55107
|
+
}
|
|
55108
|
+
|
|
54341
55109
|
// ../../platform/daemon/src/pipeline/dreaming-capabilities.ts
|
|
54342
55110
|
var bounded = (value, fallback, max) => Math.min(Math.max(Math.floor(value ?? fallback), 1), max);
|
|
54343
55111
|
var MAX_EVIDENCE_EXCERPT_CHARS = 2000;
|
|
@@ -54813,14 +55581,41 @@ function createDreamingCapabilities(params) {
|
|
|
54813
55581
|
...result.retryFrom !== undefined ? { retryFrom: result.retryFrom } : {},
|
|
54814
55582
|
items: result.items
|
|
54815
55583
|
};
|
|
54816
|
-
})
|
|
55584
|
+
}),
|
|
55585
|
+
...params.mode !== "incremental-content" ? [] : [
|
|
55586
|
+
capability("curate_memory_head", "Curate MEMORY.md head", "Content-pass-only audited MEMORY.md curation; hygiene passes cannot invoke this capability.", false, exports_external.object({
|
|
55587
|
+
passId: exports_external.string().min(1),
|
|
55588
|
+
agentId: exports_external.string().min(1),
|
|
55589
|
+
baseRevision: exports_external.number().int().nonnegative(),
|
|
55590
|
+
baseHash: exports_external.string().length(64),
|
|
55591
|
+
content: exports_external.string().trim().min(1),
|
|
55592
|
+
entries: exports_external.array(exports_external.object({
|
|
55593
|
+
id: exports_external.string().trim().min(1),
|
|
55594
|
+
text: exports_external.string().trim().min(1),
|
|
55595
|
+
operation: exports_external.enum(["added", "updated", "removed", "deferred", "no-op"]),
|
|
55596
|
+
sourceRefs: exports_external.array(exports_external.string()),
|
|
55597
|
+
supportingQuotes: exports_external.array(exports_external.string())
|
|
55598
|
+
})).max(200)
|
|
55599
|
+
}), async (input) => {
|
|
55600
|
+
if (!params.passId || input.passId !== params.passId)
|
|
55601
|
+
return { ok: false, error: "Head curation requires the active Dreaming pass" };
|
|
55602
|
+
const result = await curateMemoryHead(input);
|
|
55603
|
+
if (result.ok) {
|
|
55604
|
+
if (!params.accessor.withWriteTxAsync)
|
|
55605
|
+
throw new Error("Head curation requires the async write transaction accessor to record its pass manifest");
|
|
55606
|
+
await params.accessor.withWriteTxAsync((db) => db.prepare(`UPDATE dreaming_passes SET head_revision = ?, head_hash = ?, head_added = ?, head_updated = ?, head_removed = ?, head_deferred = ?, head_no_op = ? WHERE id = ? AND agent_id = ?`).run(result.revision, result.hash, input.entries.filter((entry) => entry.operation === "added").length, input.entries.filter((entry) => entry.operation === "updated").length, input.entries.filter((entry) => entry.operation === "removed").length, input.entries.filter((entry) => entry.operation === "deferred").length, input.entries.filter((entry) => entry.operation === "no-op").length, input.passId, input.agentId));
|
|
55607
|
+
}
|
|
55608
|
+
return result;
|
|
55609
|
+
})
|
|
55610
|
+
]
|
|
54817
55611
|
];
|
|
54818
55612
|
}
|
|
54819
55613
|
function getDreamingCapabilityManifest() {
|
|
54820
55614
|
return createDreamingCapabilities({
|
|
54821
55615
|
accessor: undefined,
|
|
54822
55616
|
agentId: "manifest",
|
|
54823
|
-
actor: "manifest"
|
|
55617
|
+
actor: "manifest",
|
|
55618
|
+
mode: "incremental-content"
|
|
54824
55619
|
}).map((capability2) => ({
|
|
54825
55620
|
id: capability2.id,
|
|
54826
55621
|
title: capability2.title,
|
|
@@ -54836,14 +55631,14 @@ init_dist();
|
|
|
54836
55631
|
// ../../platform/daemon/src/graphiq.ts
|
|
54837
55632
|
init_dist();
|
|
54838
55633
|
import { spawn } from "node:child_process";
|
|
54839
|
-
import { constants, accessSync, existsSync as
|
|
55634
|
+
import { constants, accessSync, existsSync as existsSync11 } from "node:fs";
|
|
54840
55635
|
import { homedir as homedir3 } from "node:os";
|
|
54841
|
-
import { delimiter, join as
|
|
54842
|
-
function
|
|
55636
|
+
import { delimiter, join as join13 } from "node:path";
|
|
55637
|
+
function getAgentsDir3() {
|
|
54843
55638
|
return resolveDefaultBasePath();
|
|
54844
55639
|
}
|
|
54845
55640
|
function getActiveGraphiqDbPath() {
|
|
54846
|
-
const state = readGraphiqState(
|
|
55641
|
+
const state = readGraphiqState(getAgentsDir3());
|
|
54847
55642
|
if (!state.enabled || !state.activeProject)
|
|
54848
55643
|
return null;
|
|
54849
55644
|
const project = state.indexedProjects.find((entry) => entry.path === state.activeProject);
|
|
@@ -54853,8 +55648,8 @@ function getActiveGraphiqDbPath() {
|
|
|
54853
55648
|
}
|
|
54854
55649
|
function resolveGraphiqBinary() {
|
|
54855
55650
|
const path = process.env.PATH ?? "";
|
|
54856
|
-
const candidates2 = path.split(delimiter).filter((entry) => entry.length > 0).map((entry) =>
|
|
54857
|
-
candidates2.push(
|
|
55651
|
+
const candidates2 = path.split(delimiter).filter((entry) => entry.length > 0).map((entry) => join13(entry, "graphiq"));
|
|
55652
|
+
candidates2.push(join13(homedir3(), ".local", "bin", "graphiq"));
|
|
54858
55653
|
for (const candidate of candidates2) {
|
|
54859
55654
|
try {
|
|
54860
55655
|
accessSync(candidate, constants.X_OK);
|
|
@@ -54868,7 +55663,7 @@ async function runGraphiqCli(args, timeoutMs = 15000) {
|
|
|
54868
55663
|
if (!active) {
|
|
54869
55664
|
throw new Error("GraphIQ has no active indexed project. Run `signet index <path>` first.");
|
|
54870
55665
|
}
|
|
54871
|
-
if (!
|
|
55666
|
+
if (!existsSync11(active.dbPath)) {
|
|
54872
55667
|
throw new Error(`GraphIQ database not found for active project: ${active.dbPath}`);
|
|
54873
55668
|
}
|
|
54874
55669
|
const binary = resolveGraphiqBinary();
|
|
@@ -54939,7 +55734,7 @@ function runCommand(command, args, timeoutMs, extraEnv) {
|
|
|
54939
55734
|
|
|
54940
55735
|
// ../../platform/daemon/src/plugins/index.ts
|
|
54941
55736
|
init_dist();
|
|
54942
|
-
import { existsSync as
|
|
55737
|
+
import { existsSync as existsSync14, readFileSync as readFileSync13 } from "node:fs";
|
|
54943
55738
|
|
|
54944
55739
|
// ../../platform/daemon/src/secrets.ts
|
|
54945
55740
|
init_logger();
|
|
@@ -54948,13 +55743,13 @@ init_dist();
|
|
|
54948
55743
|
// ../../platform/daemon/src/plugins/audit.ts
|
|
54949
55744
|
init_dist();
|
|
54950
55745
|
init_logger();
|
|
54951
|
-
import { appendFileSync as appendFileSync2, existsSync as
|
|
54952
|
-
import { dirname as
|
|
55746
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync12, mkdirSync as mkdirSync8, readFileSync as readFileSync11 } from "node:fs";
|
|
55747
|
+
import { dirname as dirname10, join as join14 } from "node:path";
|
|
54953
55748
|
var SENSITIVE_KEY_RE = /(^|[_-])(api-key|apikey|auth-token|authorization|bearer|client-secret|credential|credentials|password|private-key|refresh-token|secret|secret-value|token|value)([_-]|$)/i;
|
|
54954
55749
|
var SENSITIVE_ASSIGNMENT_RE = /\b((?:access[_-]?token|api[_-]?key|auth(?:orization)?|bearer|client[_-]?secret|credential|password|refresh[_-]?token|secret|token)\s*[:=]\s*)(["']?)([^"'\s,;&]+)/gi;
|
|
54955
55750
|
var KNOWN_SECRET_VALUE_RE = /\b(AKIA[0-9A-Z]{16}|github_pat_[A-Za-z0-9_]{20,}|gh[pousr]_[A-Za-z0-9_]{20,}|sk-[A-Za-z0-9_-]{12,}|xox[baprs]-[A-Za-z0-9-]{10,})\b/g;
|
|
54956
55751
|
function getDefaultPluginAuditPath() {
|
|
54957
|
-
return
|
|
55752
|
+
return join14(resolveDefaultBasePath(), ".daemon", "plugins", "audit-v1.ndjson");
|
|
54958
55753
|
}
|
|
54959
55754
|
function recordPluginAuditEvent(input, auditPath) {
|
|
54960
55755
|
if (auditPath === null)
|
|
@@ -54971,7 +55766,7 @@ function recordPluginAuditEvent(input, auditPath) {
|
|
|
54971
55766
|
data: sanitizeAuditData(input.data ?? {})
|
|
54972
55767
|
};
|
|
54973
55768
|
try {
|
|
54974
|
-
|
|
55769
|
+
mkdirSync8(dirname10(path), { recursive: true });
|
|
54975
55770
|
appendFileSync2(path, `${JSON.stringify(event)}
|
|
54976
55771
|
`, { mode: 384 });
|
|
54977
55772
|
} catch (err) {
|
|
@@ -55004,7 +55799,7 @@ function sanitizeAuditValue(value) {
|
|
|
55004
55799
|
return sanitizeAuditString(value);
|
|
55005
55800
|
if (Array.isArray(value))
|
|
55006
55801
|
return value.map((entry) => sanitizeAuditValue(entry));
|
|
55007
|
-
if (
|
|
55802
|
+
if (isRecord9(value))
|
|
55008
55803
|
return sanitizeAuditData(value);
|
|
55009
55804
|
return String(value);
|
|
55010
55805
|
}
|
|
@@ -55014,7 +55809,7 @@ function sanitizeAuditString(value) {
|
|
|
55014
55809
|
function makeAuditId() {
|
|
55015
55810
|
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
55016
55811
|
}
|
|
55017
|
-
function
|
|
55812
|
+
function isRecord9(value) {
|
|
55018
55813
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55019
55814
|
}
|
|
55020
55815
|
|
|
@@ -55546,8 +56341,8 @@ var signetGraphiqManifest = {
|
|
|
55546
56341
|
// ../../platform/daemon/src/plugins/host.ts
|
|
55547
56342
|
init_dist();
|
|
55548
56343
|
init_logger();
|
|
55549
|
-
import { existsSync as
|
|
55550
|
-
import { dirname as
|
|
56344
|
+
import { existsSync as existsSync13, mkdirSync as mkdirSync9, readFileSync as readFileSync12, writeFileSync as writeFileSync7 } from "node:fs";
|
|
56345
|
+
import { dirname as dirname11, join as join15 } from "node:path";
|
|
55551
56346
|
|
|
55552
56347
|
// ../../platform/daemon/src/plugins/manifest.ts
|
|
55553
56348
|
var PLUGIN_ID_RE = /^[a-z][a-z0-9-]*(\.[a-z][a-z0-9-]*)+$/;
|
|
@@ -55895,11 +56690,11 @@ class PluginHostV1 {
|
|
|
55895
56690
|
};
|
|
55896
56691
|
}
|
|
55897
56692
|
loadStore() {
|
|
55898
|
-
if (!this.storagePath || !
|
|
56693
|
+
if (!this.storagePath || !existsSync13(this.storagePath)) {
|
|
55899
56694
|
return { version: 1, plugins: {} };
|
|
55900
56695
|
}
|
|
55901
56696
|
try {
|
|
55902
|
-
const parsed = JSON.parse(
|
|
56697
|
+
const parsed = JSON.parse(readFileSync12(this.storagePath, "utf-8"));
|
|
55903
56698
|
return parseStore(parsed);
|
|
55904
56699
|
} catch (err) {
|
|
55905
56700
|
this.storeWritable = false;
|
|
@@ -55923,13 +56718,13 @@ class PluginHostV1 {
|
|
|
55923
56718
|
});
|
|
55924
56719
|
return;
|
|
55925
56720
|
}
|
|
55926
|
-
|
|
55927
|
-
|
|
56721
|
+
mkdirSync9(dirname11(this.storagePath), { recursive: true });
|
|
56722
|
+
writeFileSync7(this.storagePath, `${JSON.stringify(this.store, null, 2)}
|
|
55928
56723
|
`, { mode: 384 });
|
|
55929
56724
|
}
|
|
55930
56725
|
}
|
|
55931
56726
|
function getDefaultPluginRegistryPath() {
|
|
55932
|
-
return
|
|
56727
|
+
return join15(resolveDefaultBasePath(), SIGNET_PLUGIN_REGISTRY_DIR, SIGNET_PLUGIN_REGISTRY_FILE);
|
|
55933
56728
|
}
|
|
55934
56729
|
function resolveState(manifest, enabled, health, validationErrors) {
|
|
55935
56730
|
if (validationErrors.length > 0) {
|
|
@@ -55966,12 +56761,12 @@ function filterSurfacesByCapabilities(surfaces3, grantedCapabilities) {
|
|
|
55966
56761
|
};
|
|
55967
56762
|
}
|
|
55968
56763
|
function parseStore(value) {
|
|
55969
|
-
if (!
|
|
56764
|
+
if (!isRecord10(value) || value.version !== 1 || !isRecord10(value.plugins)) {
|
|
55970
56765
|
throw new Error("expected plugin registry version 1 with a plugins object");
|
|
55971
56766
|
}
|
|
55972
56767
|
const plugins = {};
|
|
55973
56768
|
for (const [id, raw] of Object.entries(value.plugins)) {
|
|
55974
|
-
if (!
|
|
56769
|
+
if (!isRecord10(raw)) {
|
|
55975
56770
|
throw new Error(`expected plugin registry entry ${id} to be an object`);
|
|
55976
56771
|
}
|
|
55977
56772
|
plugins[id] = {
|
|
@@ -55989,7 +56784,7 @@ function parseStringArray(value) {
|
|
|
55989
56784
|
return;
|
|
55990
56785
|
return value.every((entry) => typeof entry === "string") ? value : undefined;
|
|
55991
56786
|
}
|
|
55992
|
-
function
|
|
56787
|
+
function isRecord10(value) {
|
|
55993
56788
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
55994
56789
|
}
|
|
55995
56790
|
function clipPromptContribution(contribution) {
|
|
@@ -56051,10 +56846,10 @@ function auditResultForRecord(record5) {
|
|
|
56051
56846
|
}
|
|
56052
56847
|
// ../../platform/daemon/src/plugins/index.ts
|
|
56053
56848
|
function resolveGraphiqEnabled() {
|
|
56054
|
-
const statePath = getGraphiqStatePath(
|
|
56055
|
-
if (
|
|
56849
|
+
const statePath = getGraphiqStatePath(getAgentsDir3());
|
|
56850
|
+
if (existsSync14(statePath)) {
|
|
56056
56851
|
try {
|
|
56057
|
-
const parsed = JSON.parse(
|
|
56852
|
+
const parsed = JSON.parse(readFileSync13(statePath, "utf-8"));
|
|
56058
56853
|
if (typeof parsed === "object" && parsed !== null && typeof parsed.enabled === "boolean") {
|
|
56059
56854
|
return parsed.enabled;
|
|
56060
56855
|
}
|
|
@@ -58148,7 +58943,7 @@ function isLocalDaemonUrl(url2) {
|
|
|
58148
58943
|
}
|
|
58149
58944
|
function isValidAgentsDir(dir) {
|
|
58150
58945
|
try {
|
|
58151
|
-
return isAbsolute(dir) &&
|
|
58946
|
+
return isAbsolute(dir) && existsSync15(dir) && statSync4(dir).isDirectory();
|
|
58152
58947
|
} catch {
|
|
58153
58948
|
return false;
|
|
58154
58949
|
}
|
package/native-manifest.json
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.208.0",
|
|
4
4
|
"assets": [
|
|
5
5
|
{
|
|
6
6
|
"name": "signet-darwin-arm64",
|
|
7
7
|
"platform": "darwin-arm64",
|
|
8
|
-
"sha256": "
|
|
9
|
-
"size":
|
|
8
|
+
"sha256": "7af6ebd6f560d27d4f0ea92cceb076820a428e22583860a3fee9bca4bc38dea5",
|
|
9
|
+
"size": 161363104
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
"name": "signet-darwin-x64",
|
|
13
13
|
"platform": "darwin-x64",
|
|
14
|
-
"sha256": "
|
|
15
|
-
"size":
|
|
14
|
+
"sha256": "88806e38e41813ecc660a1a0c657713169754c9a0cf4752dc58866c339b4c345",
|
|
15
|
+
"size": 166103616
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "signet-linux-arm64",
|
|
19
19
|
"platform": "linux-arm64",
|
|
20
|
-
"sha256": "
|
|
21
|
-
"size":
|
|
20
|
+
"sha256": "183a5e4c215c0659fa56e432c001f2120d8fbf5faee6afd33a68335aef2a1f09",
|
|
21
|
+
"size": 208664011
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
24
|
"name": "signet-linux-x64",
|
|
25
25
|
"platform": "linux-x64",
|
|
26
|
-
"sha256": "
|
|
27
|
-
"size":
|
|
26
|
+
"sha256": "6870400c0c22722835f81ae33a3d7d44ce61e18b7371ea9dc7b9a7c16062ea98",
|
|
27
|
+
"size": 211452762
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"name": "signet-win32-x64.exe",
|
|
31
31
|
"platform": "win32-x64",
|
|
32
|
-
"sha256": "
|
|
33
|
-
"size":
|
|
32
|
+
"sha256": "7d6d123fcf71f129eaa4701d6f018e66d8df83d27210fb57a768742107673ea5",
|
|
33
|
+
"size": 217938944
|
|
34
34
|
}
|
|
35
35
|
],
|
|
36
36
|
"components": {
|
|
37
37
|
"connectors": {
|
|
38
|
-
"url": "signet-connectors-0.
|
|
39
|
-
"sha256": "
|
|
40
|
-
"size":
|
|
38
|
+
"url": "signet-connectors-0.208.0.tar.gz",
|
|
39
|
+
"sha256": "7bea667a5cd76ae34d1d2388b6fc7a4a84ef6e376e0cd4de387ff3e52ea6e374",
|
|
40
|
+
"size": 21945
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "signetai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.208.0",
|
|
4
4
|
"description": "Signet native CLI installer wrapper",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.
|
|
69
|
-
"signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.
|
|
70
|
-
"signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.
|
|
71
|
-
"signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.
|
|
72
|
-
"signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.
|
|
68
|
+
"signetai-darwin-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.208.0/signetai-darwin-arm64-0.208.0.tgz",
|
|
69
|
+
"signetai-darwin-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.208.0/signetai-darwin-x64-0.208.0.tgz",
|
|
70
|
+
"signetai-linux-arm64": "https://github.com/Signet-AI/signetai/releases/download/v0.208.0/signetai-linux-arm64-0.208.0.tgz",
|
|
71
|
+
"signetai-linux-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.208.0/signetai-linux-x64-0.208.0.tgz",
|
|
72
|
+
"signetai-win32-x64": "https://github.com/Signet-AI/signetai/releases/download/v0.208.0/signetai-win32-x64-0.208.0.tgz"
|
|
73
73
|
}
|
|
74
74
|
}
|