@snoai/memory 1.0.1 → 1.2.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/README.md +1 -1
- package/dist/{access-tracker-BbEvEocb.d.ts → access-tracker-BNqlgChq.d.ts} +3 -3
- package/dist/{adapter-B7Jox9-6.d.ts → adapter-CeQ7rViY.d.ts} +2 -2
- package/dist/{atomic-memory-extraction-d9EG-4ti.d.ts → atomic-memory-extraction-BT8lFE5t.d.ts} +4 -4
- package/dist/{atomic-memory-extraction-C5rmogoY.js → atomic-memory-extraction-By0axKHc.js} +4 -4
- package/dist/{b-profile-section-dictionary-provider-BxbksLj3.d.ts → b-profile-section-dictionary-provider-DGtF4dB7.d.ts} +1 -1
- package/dist/{capture-policy-detector-CxbHPkMX.d.ts → capture-policy-detector-CN3vfdNU.d.ts} +1 -1
- package/dist/client.d.ts +11 -1
- package/dist/client.js +32 -3
- package/dist/coding-skin-C7gwOKsc.js +223 -0
- package/dist/coding-skin.d.ts +62 -1
- package/dist/coding-skin.js +2 -52
- package/dist/{config-CL90qYva.js → config-CyH1VuJc.js} +17 -11
- package/dist/{derived-suppression-cache-CI0durYx.d.ts → derived-suppression-cache-BZdBZSdK.d.ts} +1 -1
- package/dist/diagnostic-encoder.js +1 -1
- package/dist/{index-0aqS8pVF.d.ts → index-DtqgCT8u.d.ts} +22 -3
- package/dist/index.d.ts +10 -10
- package/dist/index.js +17 -8
- package/dist/internal/config/plugin-config-schema.d.ts +1 -1
- package/dist/internal/config/plugin-config-schema.js +1 -1
- package/dist/internal/config/product-mode.d.ts +2 -2
- package/dist/internal/config/product-mode.js +7 -6
- package/dist/internal/config/settings.d.ts +1 -1
- package/dist/internal/config/settings.js +3 -3
- package/dist/internal/config/skill-categories.js +19 -2
- package/dist/internal/config/skin-defaults.d.ts +1 -1
- package/dist/internal/contract/profile.d.ts +1 -1
- package/dist/internal/contract/routes.d.ts +1 -1
- package/dist/internal/engine/bindings/memory-cli-shared.d.ts +4 -4
- package/dist/internal/engine/bindings/memory-forget-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-list-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-recall-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-reflection-resolve-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-stats-tool.js +1 -1
- package/dist/internal/engine/bindings/memory-store-tool.js +3 -3
- package/dist/internal/engine/bindings/memory-tool-access.d.ts +1 -1
- package/dist/internal/engine/bindings/memory-tool-access.js +1 -1
- package/dist/internal/engine/bindings/memory-tool-results.d.ts +1 -1
- package/dist/internal/engine/bindings/memory-tool-results.js +1 -1
- package/dist/internal/engine/bindings/memory-tool-schemas.d.ts +5 -5
- package/dist/internal/engine/bindings/memory-tool-schemas.js +1 -1
- package/dist/internal/engine/bindings/memory-update-tool.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.d.ts +4 -4
- package/dist/internal/engine/bindings/sno-station-mem-ambient-learning-hook.js +3 -3
- package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.d.ts +4 -4
- package/dist/internal/engine/bindings/sno-station-mem-auto-recall-hook.js +1 -1
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.d.ts +5 -5
- package/dist/internal/engine/bindings/sno-station-mem-insight-distill-factory.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-message-transcript.js +2 -2
- package/dist/internal/engine/bindings/sno-station-mem-reset-hook.d.ts +3 -3
- package/dist/internal/engine/bindings/sno-station-mem-runtime-mode.d.ts +1 -1
- package/dist/internal/engine/extraction/atomic-memory-extraction.d.ts +1 -1
- package/dist/internal/engine/extraction/atomic-memory-extraction.js +1 -1
- package/dist/internal/engine/extraction/b-profile-section-dictionary-provider.d.ts +1 -1
- package/dist/internal/engine/extraction/b-profile-section-rekey.d.ts +5 -5
- package/dist/internal/engine/extraction/capture-policy-detector.d.ts +1 -1
- package/dist/internal/engine/extraction/memory-metadata-codec.d.ts +2 -2
- package/dist/internal/engine/extraction/memory-temporality-classifier.d.ts +1 -1
- package/dist/internal/engine/extraction/memory-temporality-classifier.js +1 -1
- package/dist/internal/engine/observability/adapter.d.ts +1 -1
- package/dist/internal/engine/observability/memory-snapshot.d.ts +1 -1
- package/dist/internal/engine/observability/observable-embedder.d.ts +1 -1
- package/dist/internal/engine/observability/observable-llm-client.d.ts +1 -1
- package/dist/internal/engine/observability/observable-memory-store.d.ts +1 -1
- package/dist/internal/engine/observability/observable-memory-store.js +1 -1
- package/dist/internal/engine/observability/observable-retriever.d.ts +1 -1
- package/dist/internal/engine/observability/runtime-diagnostics.d.ts +1 -1
- package/dist/internal/engine/observability/runtime-diagnostics.js +2 -2
- package/dist/internal/engine/operations/memory-tier-promoter.d.ts +1 -1
- package/dist/internal/engine/operations/runtime-audit-log.d.ts +2 -2
- package/dist/internal/engine/provider/provider-registration.d.ts +4 -4
- package/dist/internal/engine/provider/provider-registration.js +1 -1
- package/dist/internal/engine/provider/provider-row-renderer.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-command-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-command-hooks.js +1 -1
- package/dist/internal/engine/reflection/reflection-deps.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-embedded-generator.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-embedded-generator.js +1 -1
- package/dist/internal/engine/reflection/reflection-injection-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-injection-hooks.js +1 -1
- package/dist/internal/engine/reflection/reflection-lifecycle-hooks.d.ts +1 -1
- package/dist/internal/engine/reflection/reflection-lifecycle-hooks.js +1 -1
- package/dist/internal/engine/reflection/strategy-hook-runner.d.ts +3 -3
- package/dist/internal/engine/reflection/strategy-hook-runner.js +2 -2
- package/dist/internal/engine/retrieval/access-tracker.d.ts +1 -1
- package/dist/internal/engine/retrieval/retriever.d.ts +1 -1
- package/dist/internal/engine/shared/memory-kind-policy.d.ts +1 -1
- package/dist/internal/engine/shared/paths.d.ts +2 -2
- package/dist/internal/engine/shared/types.d.ts +2 -2
- package/dist/internal/engine/shared/types.js +1 -1
- package/dist/internal/engine/telemetry/observe-ledger.d.ts +6 -1
- package/dist/internal/engine/telemetry/observe-ledger.js +5 -1
- package/dist/internal/model/llm-client.d.ts +2 -2
- package/dist/internal/model/llm-client.js +1 -1
- package/dist/internal/model/llm-mode-routing.d.ts +1 -1
- package/dist/internal/model/llm-mode-routing.js +1 -1
- package/dist/internal/store/maintenance.d.ts +2 -2
- package/dist/internal/store/maintenance.js +3 -3
- package/dist/internal/store/store.d.ts +2 -2
- package/dist/internal/store/store.js +1 -1
- package/dist/{llm-client-BSYUAcUb.js → llm-client-BhkzlTnH.js} +1 -1
- package/dist/{llm-client-DOTSGzhe.d.ts → llm-client-PC0yQuCq.d.ts} +1 -1
- package/dist/{log-site-catalog.generated-BMKWj-Nx.js → log-site-catalog.generated-Cc8xXGaC.js} +33 -33
- package/dist/log-site-catalog.json +1 -1
- package/dist/memdump.js +1 -1
- package/dist/{memory-kind-policy-BiuRjSJc.d.ts → memory-kind-policy-DnHY7l0n.d.ts} +1 -1
- package/dist/{memory-metadata-codec-DUvsYe_X.d.ts → memory-metadata-codec-DbrRyhCg.d.ts} +1 -1
- package/dist/{memory-runtime-DqUS4cWi.js → memory-runtime-CfedHnbN.js} +134 -54
- package/dist/{memory-snapshot-CqY1BUUA.d.ts → memory-snapshot-shzK-0C8.d.ts} +2 -2
- package/dist/{memory-store-base-CQ_bHlYA.d.ts → memory-store-base-Dx6oSqiv.d.ts} +2 -2
- package/dist/{memory-temporality-classifier-BUjXG5o7.js → memory-temporality-classifier-AetVby94.js} +2 -2
- package/dist/{memory-temporality-classifier-Brht5jyK.d.ts → memory-temporality-classifier-D91grvZ3.d.ts} +1 -1
- package/dist/{memory-tier-promoter-CqGxCkue.d.ts → memory-tier-promoter-DzX7GMZ2.d.ts} +1 -1
- package/dist/{memory-tool-dependencies-DjUoelnm.js → memory-tool-dependencies-4Vl4QwBY.js} +1 -1
- package/dist/memory-tool-dependencies-BGFjBpkG.d.ts +14 -0
- package/dist/{model-call-table-CspopkBg.js → model-call-table-BZJQkbKX.js} +9 -0
- package/dist/{observable-embedder-CNNe9gkg.d.ts → observable-embedder-CbFylzsx.d.ts} +1 -1
- package/dist/{observable-llm-client-CRuKlefQ.d.ts → observable-llm-client-BC6Bc8t3.d.ts} +3 -3
- package/dist/{observable-memory-store-CnGDpOY5.d.ts → observable-memory-store-BykVMQXt.d.ts} +4 -4
- package/dist/{observable-retriever-Cooc62Qw.d.ts → observable-retriever-C-c9O83s.d.ts} +5 -5
- package/dist/paths-DHU342hf.d.ts +1 -0
- package/dist/{plugin-config-schema-C0UUbOmG.d.ts → plugin-config-schema-CCwv_K7R.d.ts} +3 -2
- package/dist/{plugin-config-schema-YJLyIIcJ.js → plugin-config-schema-CTLb-ChF.js} +2 -6
- package/dist/{profile-TWPJ_myr.d.ts → profile-DbIDAmnc.d.ts} +1 -1
- package/dist/{profile-section-writer-BhGKPBjw.js → profile-section-writer-BV605K78.js} +2 -2
- package/dist/{provider-registration-CF1tg8Xy.js → provider-registration-qLSA9CQl.js} +32 -2
- package/dist/{reflection-command-hooks-ClUl-iv6.js → reflection-command-hooks-CTYkYqM3.js} +3 -3
- package/dist/{reflection-command-hooks-G1-dI2Av.d.ts → reflection-command-hooks-h2CbYuXx.d.ts} +4 -4
- package/dist/{reflection-deps-Ccm2Jf5W.d.ts → reflection-deps-MWVeBZcs.d.ts} +2 -2
- package/dist/{reflection-embedded-generator-BRvqV5N-.js → reflection-embedded-generator-D5OhLLVw.js} +1 -1
- package/dist/{reflection-embedded-generator-kfQfKEYV.d.ts → reflection-embedded-generator-Dk7sL8uy.d.ts} +3 -3
- package/dist/{reflection-injection-hooks-CS_uhjoD.d.ts → reflection-injection-hooks-B0fGkENX.d.ts} +4 -4
- package/dist/{reflection-lifecycle-hooks-CRSpUdLi.d.ts → reflection-lifecycle-hooks-Bg_JBS6c.d.ts} +3 -3
- package/dist/{rem-batch-executor-DuC4nYyf.js → rem-batch-executor-Bdsf26tD.js} +14 -2
- package/dist/{rem-batch-executor-Dg2HgROM.js → rem-batch-executor-DdgZBL5K.js} +1 -1
- package/dist/{rem-trigger-Hn6od8IV.js → rem-trigger-6dmOjIU_.js} +2 -2
- package/dist/{results-C3ZLroMb.js → results-BkMsHy7M.js} +16 -0
- package/dist/{retriever-Dxss5fRv.d.ts → retriever-CXeB7-A2.d.ts} +6 -6
- package/dist/{runtime-audit-log-zpQiR9HT.d.ts → runtime-audit-log-CIYiNvwf.d.ts} +1 -1
- package/dist/{server-CSvxchqg.js → server-DogWEZOU.js} +6 -5
- package/dist/sidecar/main.js +2 -2
- package/dist/{sno-station-mem-runtime-dependencies-CoWqUMbK.js → sno-station-mem-runtime-dependencies-Bzfg4hGZ.js} +5 -5
- package/dist/sno-station-mem-runtime-dependencies-cFPSMqDD.d.ts +31 -0
- package/dist/{store-nPql26YM.js → store-D3n1P7Xn.js} +1 -1
- package/dist/{store-C8sUTssE.d.ts → store-Dbo7MIzt.d.ts} +1 -1
- package/dist/{strategy-hook-runner-Bxy851Xx.d.ts → strategy-hook-runner-C6qUCnzY.d.ts} +7 -7
- package/dist/{strategy-hook-runner-Djify5Rw.js → strategy-hook-runner-CHpG8vXD.js} +1 -1
- package/dist/{types-CWdhXLxr.d.ts → types-DvQ6nTNC.d.ts} +1 -1
- package/package.json +8 -8
- package/settings.default.json +5 -0
- package/dist/memory-tool-dependencies-CatGzI9R.d.ts +0 -14
- package/dist/paths-qVF-5uBq.d.ts +0 -1
- package/dist/sno-station-mem-runtime-dependencies-DHESIuPn.d.ts +0 -31
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Who it is for: you do not use this package directly. Follow the
|
|
|
28
28
|
plugins use to reach the service.
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install @snoai/memory@1.0
|
|
31
|
+
npm install @snoai/memory@1.2.0
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
Needs Node.js 22.22.3+, 24.15.0+ or 25.9.0+. Licensed under Apache-2.0.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { v as MemoryMetadata } from "./types-
|
|
1
|
+
import { v as MemoryMetadata } from "./types-DvQ6nTNC.js";
|
|
2
2
|
import { sn as RecallLifecycleConfig } from "./index-DL8AVj0Z.js";
|
|
3
|
-
import { C as MemoryStore } from "./memory-store-base-
|
|
4
|
-
import "./store-
|
|
3
|
+
import { C as MemoryStore } from "./memory-store-base-Dx6oSqiv.js";
|
|
4
|
+
import "./store-Dbo7MIzt.js";
|
|
5
5
|
//#region src/engine/retrieval/access-tracker.d.ts
|
|
6
6
|
interface AccessMetadata {
|
|
7
7
|
readonly accessCount: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PluginConfig } from "./plugin-config-schema-
|
|
2
|
-
import "./types-
|
|
1
|
+
import { t as PluginConfig } from "./plugin-config-schema-CCwv_K7R.js";
|
|
2
|
+
import "./types-DvQ6nTNC.js";
|
|
3
3
|
import { t as ObserveLogger } from "./best-effort-BPZSzKk0.js";
|
|
4
4
|
import { AgentId, EventType, JsonObject } from "@snoai/observability";
|
|
5
5
|
//#region src/engine/observability/cost-aggregator.d.ts
|
package/dist/{atomic-memory-extraction-d9EG-4ti.d.ts → atomic-memory-extraction-BT8lFE5t.d.ts}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as LlmClientConfig, l as ModelCallId, p as LlmRoutingConfig, r as LlmClient } from "./plugin-config-schema-
|
|
1
|
+
import { i as LlmClientConfig, l as ModelCallId, p as LlmRoutingConfig, r as LlmClient } from "./plugin-config-schema-CCwv_K7R.js";
|
|
2
2
|
import { n as Locale } from "./locales-JxGmkG6t.js";
|
|
3
3
|
import { qt as AdapterAMemoryView } from "./index-BO4RU_mc.js";
|
|
4
|
-
import { C as MemoryStore, c as AtomicExtractionRunParameters, f as AtomicExtractionWriteResult, g as BeginAtomicExtractionChunkResult, r as AtomicExtractionLedgerKey, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate } from "./memory-store-base-
|
|
5
|
-
import "./store-
|
|
6
|
-
import "./llm-client-
|
|
4
|
+
import { C as MemoryStore, c as AtomicExtractionRunParameters, f as AtomicExtractionWriteResult, g as BeginAtomicExtractionChunkResult, r as AtomicExtractionLedgerKey, s as AtomicExtractionReprocessReason, x as MemoryRelationPredicate } from "./memory-store-base-Dx6oSqiv.js";
|
|
5
|
+
import "./store-Dbo7MIzt.js";
|
|
6
|
+
import "./llm-client-PC0yQuCq.js";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
//#region src/engine/extraction/calendar-instruction.d.ts
|
|
9
9
|
type CalendarPrecision = "year" | "month" | "week" | "day" | "minute";
|
|
@@ -2,22 +2,22 @@ import { ATOMIC_CAPTURE_OUTPUT_TOKEN_BUDGET, ATOMIC_CAPTURE_TIMEOUT_MS, ATOMIC_E
|
|
|
2
2
|
import "./internal/engine/i18n/locales.js";
|
|
3
3
|
import { $ as FIXED_MEMORY_SNO_EXTRACT_PROFILE, Q as FIXED_MEMORY_SNO_EXTRACT_CHAT } from "./signed-registry-constants-yq3DlG3B.js";
|
|
4
4
|
import { redactSecrets } from "./internal/engine/security/redact.js";
|
|
5
|
-
import { a as isTerminalLlmFailure, i as createLlmClient, n as LlmClientTerminalError } from "./llm-client-
|
|
5
|
+
import { a as isTerminalLlmFailure, i as createLlmClient, n as LlmClientTerminalError } from "./llm-client-BhkzlTnH.js";
|
|
6
6
|
import { n as readModelReplyJson } from "./model-reply-text-CKopStP2.js";
|
|
7
7
|
import { resolveLlmRoute } from "./internal/model/llm-mode-routing.js";
|
|
8
8
|
import { n as ATOMIC_EXTRACTION_SKILL_HASH, r as atomicExtractionSkillReference, t as ATOMIC_EXTRACTION_SKILL } from "./atomic-extraction-skill-CcXmuCqL.js";
|
|
9
9
|
import { stripEnvelopeMetadata } from "./internal/engine/extraction/extraction-text-sanitizer.js";
|
|
10
10
|
import { a as sessionZoneCarriedBy, t as calculateCalendarTime } from "./calendar-instruction-CzqZbAPG.js";
|
|
11
|
-
import "./memory-temporality-classifier-
|
|
11
|
+
import "./memory-temporality-classifier-AetVby94.js";
|
|
12
12
|
import { t as appendAuditEntry } from "./runtime-audit-log-BCeujlEp.js";
|
|
13
13
|
import { a as parseAtomicCaptureReply, c as atomic_extraction_response_schema_default, i as fallbackAtomicCapturedFact, l as excludeProgressRecords, n as ATOMIC_ENRICHMENT_RESPONSE_JSON_SCHEMA, o as parseAtomicEnrichmentReply, r as ATOMIC_EXTRACTION_RESPONSE_JSON_SCHEMA, s as parseAtomicExtractionReply, t as ATOMIC_CAPTURE_RESPONSE_JSON_SCHEMA } from "./atomic-extraction-reply-BJ9XV_9s.js";
|
|
14
14
|
import { adapterAViewFromRecord, isAdapterAVerdictReply, parseAdapterAChatVerdict, renderAdapterAChatPrompt, renderAdapterAPrompt } from "./internal/engine/rem/index.js";
|
|
15
15
|
import { n as state_vocabulary_default, r as attribute_dictionary_default, t as relations } from "./relation-dictionary-Cev1kyLe.js";
|
|
16
16
|
import { g as randomUUID$1 } from "./memory-store-shared-DqpWJXZZ.js";
|
|
17
|
-
import { d as normalizeEntityName, f as recordAtomicEntityIdentityJournal, g as readAtomicArrivalRetirementCandidateSet, h as journalAtomicArrivalRetirementRefusal, m as closeAtomicArrivalRetirementTargets, u as listAtomicMemoryEntityCandidates, y as normalizeMemoryRelationPredicate } from "./store-
|
|
17
|
+
import { d as normalizeEntityName, f as recordAtomicEntityIdentityJournal, g as readAtomicArrivalRetirementCandidateSet, h as journalAtomicArrivalRetirementRefusal, m as closeAtomicArrivalRetirementTargets, u as listAtomicMemoryEntityCandidates, y as normalizeMemoryRelationPredicate } from "./store-D3n1P7Xn.js";
|
|
18
18
|
import { o as normalizeTopicToSectionName } from "./b-profile-section-dictionary-provider-BHkoNqgk.js";
|
|
19
19
|
import { r as recordTokenCounter } from "./memory-store-write-validation-B_hDG2zf.js";
|
|
20
|
-
import { i as prepareDeterministicTaskLifecycleWrite, t as PROFILE_IDENTITY_SECTION } from "./profile-section-writer-
|
|
20
|
+
import { i as prepareDeterministicTaskLifecycleWrite, t as PROFILE_IDENTITY_SECTION } from "./profile-section-writer-BV605K78.js";
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
import { countTokens } from "@snoai/chunking";
|
|
23
23
|
import { createLogger, currentLogContext, privateLogReference, withLogContext } from "@snoai/utils/logger";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as ProductMode } from "./plugin-config-schema-
|
|
1
|
+
import { g as ProductMode } from "./plugin-config-schema-CCwv_K7R.js";
|
|
2
2
|
import { n as Locale } from "./locales-JxGmkG6t.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/engine/extraction/b-profile-section-registry.d.ts
|
package/dist/{capture-policy-detector-CxbHPkMX.d.ts → capture-policy-detector-CN3vfdNU.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as MemoryCategory } from "./types-
|
|
1
|
+
import { h as MemoryCategory } from "./types-DvQ6nTNC.js";
|
|
2
2
|
//#region src/engine/extraction/capture-policy-detector.d.ts
|
|
3
3
|
declare const PROMPT_INJECTION_PATTERNS: RegExp[];
|
|
4
4
|
/** Implements looks like prompt injection as the local memory capture policy operation. */
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Discovery } from "./internal/contract/discovery.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as ScopeCtx, F as JsonValue, H as UsageSignal, I as Message, L as Mutation, M as HostEvent, N as InitRegistration, P as Inspection, R as RecallOptions, V as Turn, et as ContractError, n as MemoryContract, nt as DegradedReason, v as ContractOutputs, z as Registration } from "./index-DtqgCT8u.js";
|
|
3
3
|
//#region src/contract/client.d.ts
|
|
4
4
|
export interface ConnectOptions {
|
|
5
5
|
skinId: string;
|
|
@@ -9,7 +9,17 @@ export interface DegradedConnection {
|
|
|
9
9
|
reason: DegradedReason;
|
|
10
10
|
error?: string;
|
|
11
11
|
}
|
|
12
|
+
export type ReportingInspection = Extract<Inspection, {
|
|
13
|
+
op: "projects" | "currentProject";
|
|
14
|
+
}> | {
|
|
15
|
+
op: "stats";
|
|
16
|
+
};
|
|
17
|
+
export type ReportingClient = Pick<MemoryClient, "degraded" | "principal"> & {
|
|
18
|
+
inspect(op: ReportingInspection, scope: ScopeCtx): Promise<ContractOutputs["inspect"]>;
|
|
19
|
+
};
|
|
12
20
|
export declare function connect(options: ConnectOptions): Promise<MemoryClient | DegradedConnection>;
|
|
21
|
+
/** Connect to an already running service without starting it or registering a skin. */
|
|
22
|
+
export declare function connectReporting(options: ConnectOptions): Promise<ReportingClient | DegradedConnection>;
|
|
13
23
|
export declare class MemoryClient implements MemoryContract {
|
|
14
24
|
#private;
|
|
15
25
|
readonly skinId: string;
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as DEGRADED_REASONS, t as ContractError } from "./error-D-wb-rZw.js";
|
|
2
|
-
import { r as outputSchemas } from "./results-
|
|
2
|
+
import { r as outputSchemas } from "./results-BkMsHy7M.js";
|
|
3
3
|
import { MEMORY_ROUTES, MEMORY_SKIN_HEADER, MEMORY_START_TIMEOUT_MS, REM_SIDECAR_TOKEN_HEADER } from "./internal/contract/routes.js";
|
|
4
4
|
import { getPrincipal, getSettingsPath, getSnoStationMemStateDir, getStartupLogPath } from "./internal/contract/profile.js";
|
|
5
5
|
import { checkDiscovery, processAlive, readDiscovery } from "./internal/contract/discovery.js";
|
|
@@ -149,6 +149,22 @@ async function connect(options) {
|
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
+
/** Connect to an already running service without starting it or registering a skin. */
|
|
153
|
+
async function connectReporting(options) {
|
|
154
|
+
try {
|
|
155
|
+
const { storePath } = clientSettings();
|
|
156
|
+
const discovery = await readDiscovery();
|
|
157
|
+
if (!discovery) throw new ContractError("sidecar-unreachable");
|
|
158
|
+
await checkDiscovery(discovery);
|
|
159
|
+
return new MemoryClient(options.skinId, storePath, discovery);
|
|
160
|
+
} catch (error) {
|
|
161
|
+
return {
|
|
162
|
+
degraded: true,
|
|
163
|
+
reason: failureReason(error),
|
|
164
|
+
...error instanceof Error && { error: error.message }
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
152
168
|
var MemoryClient = class {
|
|
153
169
|
skinId;
|
|
154
170
|
storePath;
|
|
@@ -168,12 +184,15 @@ var MemoryClient = class {
|
|
|
168
184
|
const route = MEMORY_ROUTES[method];
|
|
169
185
|
try {
|
|
170
186
|
signal?.throwIfAborted();
|
|
187
|
+
const inspection = method === "inspect" && "op" in input ? input.op : void 0;
|
|
188
|
+
const reporting = inspection?.op === "projects" || inspection?.op === "currentProject" || inspection?.op === "stats" && !inspection.scope;
|
|
171
189
|
let discovery = await readDiscovery();
|
|
172
190
|
if (!discovery || !processAlive(discovery.pid)) {
|
|
191
|
+
if (reporting) throw new ContractError("sidecar-unreachable");
|
|
173
192
|
const { memoryPackage } = clientSettings();
|
|
174
193
|
discovery = await startSidecar(memoryPackage);
|
|
175
194
|
}
|
|
176
|
-
if (method !== "init" && this.#registration && this.#registeredPid !== discovery.pid) await this.request("init", this.#registration, signal);
|
|
195
|
+
if (method !== "init" && !reporting && this.#registration && this.#registeredPid !== discovery.pid) await this.request("init", this.#registration, signal);
|
|
177
196
|
const response = await postJson(discovery.port, route.path, {
|
|
178
197
|
"Content-Type": "application/json",
|
|
179
198
|
[MEMORY_SKIN_HEADER]: this.skinId,
|
|
@@ -264,6 +283,16 @@ var MemoryClient = class {
|
|
|
264
283
|
op: "get",
|
|
265
284
|
entry: null
|
|
266
285
|
};
|
|
286
|
+
else if (op.op === "projects") result = {
|
|
287
|
+
op: "projects",
|
|
288
|
+
projects: []
|
|
289
|
+
};
|
|
290
|
+
else if (op.op === "currentProject") result = {
|
|
291
|
+
op: "currentProject",
|
|
292
|
+
workspace: op.workspace,
|
|
293
|
+
status: "unknown",
|
|
294
|
+
project: null
|
|
295
|
+
};
|
|
267
296
|
else result = {
|
|
268
297
|
op: op.op,
|
|
269
298
|
project: scope.project,
|
|
@@ -303,4 +332,4 @@ var MemoryClient = class {
|
|
|
303
332
|
}
|
|
304
333
|
};
|
|
305
334
|
//#endregion
|
|
306
|
-
export { ContractError, MemoryClient, connect };
|
|
335
|
+
export { ContractError, MemoryClient, connect, connectReporting };
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import "./internal/engine/telemetry/observe-ledger.js";
|
|
2
|
+
import "./internal/config/skill-categories.js";
|
|
3
|
+
import "./internal/config/skin-defaults.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { basename } from "node:path";
|
|
6
|
+
import { createReadStream } from "node:fs";
|
|
7
|
+
//#region config/session-activity.ts
|
|
8
|
+
/** A gap between two records of at most this long is working time; a longer one ends the run. */
|
|
9
|
+
const ACTIVITY_GAP_MS = 9e5;
|
|
10
|
+
/** A run counts in runs_over_12h once, in the send where it reaches this length, ended or not. */
|
|
11
|
+
const ACTIVITY_LONG_RUN_MS = 432e5;
|
|
12
|
+
/**
|
|
13
|
+
* Text markers of messages the person did not write, seen in real transcripts on the owner's
|
|
14
|
+
* machine (Claude Code 2.1.247 and Codex 0.160, 2026-08 to 2026-10). Heuristics, matched on text.
|
|
15
|
+
*/
|
|
16
|
+
/** Reach's ring and mailbox doorbell, typed into the agent's terminal (apps/reach/lib/reach-ring line 426); recorded as a human prompt by Claude Code and Codex. */
|
|
17
|
+
const REACH_RING_MARKER = "typed by the mail transport, not by the owner";
|
|
18
|
+
/** A heartbeat tick line, "<UTC time> [label] tick=N ..." (apps/heartbeat/bin/heartbeat line 507); Claude Code delivers it inside a Monitor <task-notification>. */
|
|
19
|
+
const HEARTBEAT_TICK = /\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ \[[^\]\n]+\] tick=\d+/;
|
|
20
|
+
/** The first prompt Reach gives a seat it starts in a terminal (apps/reach/lib/reach-spawn line 19). */
|
|
21
|
+
const REACH_SEAT_START_MARKER = "No work is assigned by this startup message";
|
|
22
|
+
/** True when the text of a user message came from another agent's tooling: a Reach ring or seat start, or a heartbeat wake. */
|
|
23
|
+
function isAgentText(text) {
|
|
24
|
+
return text.includes(REACH_RING_MARKER) || text.includes(REACH_SEAT_START_MARKER) || HEARTBEAT_TICK.test(text);
|
|
25
|
+
}
|
|
26
|
+
const activityCursorSchema = z.object({
|
|
27
|
+
offset: z.number().int().nonnegative(),
|
|
28
|
+
lastTs: z.number().int().nonnegative(),
|
|
29
|
+
runStart: z.number().int().nonnegative(),
|
|
30
|
+
agentDriven: z.boolean(),
|
|
31
|
+
counted: z.boolean(),
|
|
32
|
+
path: z.string().min(1).optional()
|
|
33
|
+
});
|
|
34
|
+
const EMPTY_ACTIVITY_CURSOR = {
|
|
35
|
+
offset: 0,
|
|
36
|
+
lastTs: 0,
|
|
37
|
+
runStart: 0,
|
|
38
|
+
agentDriven: false,
|
|
39
|
+
counted: false
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Folds the records after the cursor into one window. A gap belongs to the window of the record
|
|
43
|
+
* that ends it, so splitting a transcript at any line gives the same sums. A run is counted in
|
|
44
|
+
* runs_over_12h once, in the send where it reaches 12 hours, whether or not it has ended. longest_run_ms
|
|
45
|
+
* is the longest run of any length seen in the window, including the length so far of the run still
|
|
46
|
+
* open. `closeRun` ends the run still open at the last record (the session is over); otherwise it
|
|
47
|
+
* stays open in the cursor.
|
|
48
|
+
*/
|
|
49
|
+
function foldActivity(cursor, records, closeRun) {
|
|
50
|
+
let { lastTs, runStart, agentDriven, counted } = cursor;
|
|
51
|
+
let windowStart = runStart > 0 ? lastTs : 0;
|
|
52
|
+
let active = 0, team = 0, human = 0, runs = 0, longest = 0;
|
|
53
|
+
const seeRun = (end) => {
|
|
54
|
+
const length = end - runStart;
|
|
55
|
+
longest = Math.max(longest, length);
|
|
56
|
+
if (!counted && length >= ACTIVITY_LONG_RUN_MS) {
|
|
57
|
+
runs++;
|
|
58
|
+
counted = true;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
for (const record of records) {
|
|
62
|
+
if (windowStart === 0) windowStart = record.ts;
|
|
63
|
+
if (runStart === 0) runStart = record.ts;
|
|
64
|
+
else if (record.ts > lastTs) {
|
|
65
|
+
const gap = record.ts - lastTs;
|
|
66
|
+
if (gap <= ACTIVITY_GAP_MS) {
|
|
67
|
+
active += gap;
|
|
68
|
+
if (agentDriven) team += gap;
|
|
69
|
+
} else {
|
|
70
|
+
seeRun(lastTs);
|
|
71
|
+
runStart = record.ts;
|
|
72
|
+
counted = false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
lastTs = Math.max(lastTs, record.ts);
|
|
76
|
+
if (runStart > 0) seeRun(lastTs);
|
|
77
|
+
if (record.incoming === "human") {
|
|
78
|
+
human++;
|
|
79
|
+
agentDriven = false;
|
|
80
|
+
} else if (record.incoming === "agent") agentDriven = true;
|
|
81
|
+
}
|
|
82
|
+
const closing = closeRun && runStart > 0;
|
|
83
|
+
if (closing) {
|
|
84
|
+
runStart = 0;
|
|
85
|
+
counted = false;
|
|
86
|
+
}
|
|
87
|
+
const next = {
|
|
88
|
+
...cursor,
|
|
89
|
+
lastTs,
|
|
90
|
+
runStart,
|
|
91
|
+
agentDriven,
|
|
92
|
+
counted
|
|
93
|
+
};
|
|
94
|
+
if (records.length === 0 && !closing) return {
|
|
95
|
+
payload: void 0,
|
|
96
|
+
cursor: next
|
|
97
|
+
};
|
|
98
|
+
return {
|
|
99
|
+
payload: {
|
|
100
|
+
window_start_ms: windowStart > 0 ? windowStart : lastTs,
|
|
101
|
+
window_end_ms: lastTs,
|
|
102
|
+
active_ms: active,
|
|
103
|
+
team_driven_ms: team,
|
|
104
|
+
runs_over_12h: runs,
|
|
105
|
+
longest_run_ms: longest,
|
|
106
|
+
human_messages: human
|
|
107
|
+
},
|
|
108
|
+
cursor: next
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Calls `onLine` for each complete line from `offset` on and returns the offset after the last
|
|
113
|
+
* complete line, and whether the end of the file was reached on a line boundary. Stops reading once `budgetMs` has passed: real transcripts reach 1.65 GB while a
|
|
114
|
+
* hook has seconds, so a long backlog is taken over several sends instead of failing every time.
|
|
115
|
+
*/
|
|
116
|
+
async function readNewLines(path, offset, budgetMs, onLine) {
|
|
117
|
+
const deadline = Date.now() + budgetMs;
|
|
118
|
+
const stream = createReadStream(path, { start: offset });
|
|
119
|
+
let pending = Buffer.alloc(0);
|
|
120
|
+
let consumed = offset;
|
|
121
|
+
let done = true;
|
|
122
|
+
try {
|
|
123
|
+
for await (const chunk of stream) {
|
|
124
|
+
pending = pending.length === 0 ? chunk : Buffer.concat([pending, chunk]);
|
|
125
|
+
let from = 0;
|
|
126
|
+
for (let end = pending.indexOf(10, from); end !== -1; end = pending.indexOf(10, from)) {
|
|
127
|
+
if (end > from) onLine(pending.toString("utf8", from, end));
|
|
128
|
+
from = end + 1;
|
|
129
|
+
}
|
|
130
|
+
consumed += from;
|
|
131
|
+
pending = pending.subarray(from);
|
|
132
|
+
if (Date.now() > deadline) {
|
|
133
|
+
done = false;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
} finally {
|
|
138
|
+
stream.destroy();
|
|
139
|
+
}
|
|
140
|
+
if (done && pending.length > 0) {
|
|
141
|
+
const tail = pending.toString("utf8");
|
|
142
|
+
try {
|
|
143
|
+
JSON.parse(tail);
|
|
144
|
+
onLine(tail);
|
|
145
|
+
consumed += pending.length;
|
|
146
|
+
} catch {
|
|
147
|
+
done = false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
offset: consumed,
|
|
152
|
+
done
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region config/coding-skin.ts
|
|
157
|
+
const CODING_SKIN_CHILD_DEADLINE_MS = 11e4;
|
|
158
|
+
const CODING_SKIN_WORKER_LIFETIME_MS = 54e4;
|
|
159
|
+
const CODING_SKIN_RETRY_DELAYS_MS = [2e3, 1e4];
|
|
160
|
+
const CODING_SKIN_MAX_ATTEMPTS = 3;
|
|
161
|
+
const CODING_SKIN_IMPORT_INTERVAL_MS = 2010;
|
|
162
|
+
const CODING_SKIN_CHILD_MAX_BUFFER_BYTES = 8388608;
|
|
163
|
+
const CODING_SKIN_MANUAL_SESSION_ID = "manual";
|
|
164
|
+
const CODING_SKIN_SESSION_QUERY = "standing decisions, open tasks, conventions and known pitfalls for this repository";
|
|
165
|
+
const CODING_SKIN_LEDGER_MAX_CHARS = 12e3;
|
|
166
|
+
const CODING_SKIN_RECALL_SENTENCE_MAX_CHARS = 200;
|
|
167
|
+
const CODING_SKIN_RECALL_ITEM_MAX_CHARS = 240;
|
|
168
|
+
const CODING_SKIN_HOOKS = {
|
|
169
|
+
SessionStart: {
|
|
170
|
+
eventName: "session_start",
|
|
171
|
+
subcommand: "session-start",
|
|
172
|
+
timeout: 15
|
|
173
|
+
},
|
|
174
|
+
UserPromptSubmit: {
|
|
175
|
+
eventName: "user_prompt_submit",
|
|
176
|
+
subcommand: "user-prompt-submit",
|
|
177
|
+
timeout: 8
|
|
178
|
+
},
|
|
179
|
+
Stop: {
|
|
180
|
+
eventName: "stop",
|
|
181
|
+
subcommand: "stop",
|
|
182
|
+
timeout: 5
|
|
183
|
+
},
|
|
184
|
+
SessionEnd: {
|
|
185
|
+
eventName: "session_end",
|
|
186
|
+
subcommand: "session-end",
|
|
187
|
+
timeout: 8
|
|
188
|
+
},
|
|
189
|
+
PreToolUse: {
|
|
190
|
+
eventName: "pre_tool_use",
|
|
191
|
+
subcommand: "pre-tool-use",
|
|
192
|
+
timeout: 5
|
|
193
|
+
},
|
|
194
|
+
PostToolUse: {
|
|
195
|
+
eventName: "post_tool_use",
|
|
196
|
+
subcommand: "post-tool-use",
|
|
197
|
+
timeout: 8
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const CODING_SKIN_MODEL_COMMANDS = [
|
|
201
|
+
"recall",
|
|
202
|
+
"get",
|
|
203
|
+
"remember",
|
|
204
|
+
"correct"
|
|
205
|
+
];
|
|
206
|
+
function shellQuote(value) {
|
|
207
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
208
|
+
}
|
|
209
|
+
/** The command an agent hook runs: the `sno` binary that ran setup, then `memory hook <event> --harness <name>`. */
|
|
210
|
+
function codingSkinHookCommand(snoPath, subcommand, harness) {
|
|
211
|
+
return `${shellQuote(snoPath)} memory hook ${subcommand} --harness ${harness}`;
|
|
212
|
+
}
|
|
213
|
+
/** True for a hook command of that shape, whatever the path to `sno` is. */
|
|
214
|
+
function isCodingSkinHookCommand(command, subcommand, harness) {
|
|
215
|
+
const suffix = ` memory hook ${subcommand} --harness ${harness}`;
|
|
216
|
+
const trimmed = command.trim();
|
|
217
|
+
if (!trimmed.endsWith(suffix)) return false;
|
|
218
|
+
const encoded = trimmed.slice(0, -suffix.length);
|
|
219
|
+
const program = encoded.startsWith("'") && encoded.endsWith("'") ? encoded.slice(1, -1).replaceAll("'\\''", "'") : encoded;
|
|
220
|
+
return basename(program) === "sno";
|
|
221
|
+
}
|
|
222
|
+
//#endregion
|
|
223
|
+
export { EMPTY_ACTIVITY_CURSOR as _, CODING_SKIN_LEDGER_MAX_CHARS as a, isAgentText as b, CODING_SKIN_MODEL_COMMANDS as c, CODING_SKIN_RETRY_DELAYS_MS as d, CODING_SKIN_SESSION_QUERY as f, shellQuote as g, isCodingSkinHookCommand as h, CODING_SKIN_IMPORT_INTERVAL_MS as i, CODING_SKIN_RECALL_ITEM_MAX_CHARS as l, codingSkinHookCommand as m, CODING_SKIN_CHILD_MAX_BUFFER_BYTES as n, CODING_SKIN_MANUAL_SESSION_ID as o, CODING_SKIN_WORKER_LIFETIME_MS as p, CODING_SKIN_HOOKS as r, CODING_SKIN_MAX_ATTEMPTS as s, CODING_SKIN_CHILD_DEADLINE_MS as t, CODING_SKIN_RECALL_SENTENCE_MAX_CHARS as u, activityCursorSchema as v, readNewLines as x, foldActivity as y };
|
package/dist/coding-skin.d.ts
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
import { ObserveLedgerRow, appendObserveLedgerRows } from "./internal/engine/telemetry/observe-ledger.js";
|
|
2
2
|
import { SKILL_CATEGORIES, skillVersionFor } from "./internal/config/skill-categories.js";
|
|
3
3
|
import { HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH } from "./internal/config/skin-defaults.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region config/session-activity.d.ts
|
|
6
|
+
/** True when the text of a user message came from another agent's tooling: a Reach ring or seat start, or a heartbeat wake. */
|
|
7
|
+
export declare function isAgentText(text: string): boolean;
|
|
8
|
+
/** One transcript record: its time, and who sent the incoming message it carries, if it carries one. */
|
|
9
|
+
interface ActivityRecord {
|
|
10
|
+
ts: number;
|
|
11
|
+
incoming?: "human" | "agent";
|
|
12
|
+
}
|
|
13
|
+
/** Where the previous send stopped: a byte offset into the transcript and the run still open there. */
|
|
14
|
+
interface ActivityCursor {
|
|
15
|
+
offset: number;
|
|
16
|
+
lastTs: number;
|
|
17
|
+
/** Start of the continuous run still open at lastTs; 0 when no run is open. */
|
|
18
|
+
runStart: number;
|
|
19
|
+
/** The latest incoming message came from another agent. */
|
|
20
|
+
agentDriven: boolean;
|
|
21
|
+
/** The run still open was already counted in runs_over_12h. */
|
|
22
|
+
counted: boolean;
|
|
23
|
+
/** Codex only: the rollout file found by its first send. */
|
|
24
|
+
path?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const activityCursorSchema: z.ZodType<ActivityCursor>;
|
|
27
|
+
interface SessionActivityPayload {
|
|
28
|
+
window_start_ms: number;
|
|
29
|
+
window_end_ms: number;
|
|
30
|
+
active_ms: number;
|
|
31
|
+
team_driven_ms: number;
|
|
32
|
+
runs_over_12h: number;
|
|
33
|
+
longest_run_ms: number;
|
|
34
|
+
human_messages: number;
|
|
35
|
+
}
|
|
36
|
+
export declare const EMPTY_ACTIVITY_CURSOR: ActivityCursor;
|
|
37
|
+
/**
|
|
38
|
+
* Folds the records after the cursor into one window. A gap belongs to the window of the record
|
|
39
|
+
* that ends it, so splitting a transcript at any line gives the same sums. A run is counted in
|
|
40
|
+
* runs_over_12h once, in the send where it reaches 12 hours, whether or not it has ended. longest_run_ms
|
|
41
|
+
* is the longest run of any length seen in the window, including the length so far of the run still
|
|
42
|
+
* open. `closeRun` ends the run still open at the last record (the session is over); otherwise it
|
|
43
|
+
* stays open in the cursor.
|
|
44
|
+
*/
|
|
45
|
+
export declare function foldActivity(cursor: ActivityCursor, records: readonly ActivityRecord[], closeRun: boolean): {
|
|
46
|
+
payload: SessionActivityPayload | undefined;
|
|
47
|
+
cursor: ActivityCursor;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Calls `onLine` for each complete line from `offset` on and returns the offset after the last
|
|
51
|
+
* complete line, and whether the end of the file was reached on a line boundary. Stops reading once `budgetMs` has passed: real transcripts reach 1.65 GB while a
|
|
52
|
+
* hook has seconds, so a long backlog is taken over several sends instead of failing every time.
|
|
53
|
+
*/
|
|
54
|
+
export declare function readNewLines(path: string, offset: number, budgetMs: number, onLine: (line: string) => void): Promise<{
|
|
55
|
+
offset: number;
|
|
56
|
+
done: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
//#endregion
|
|
4
59
|
//#region config/coding-skin.d.ts
|
|
5
60
|
export declare const CODING_SKIN_CHILD_DEADLINE_MS = 11e4;
|
|
6
61
|
export declare const CODING_SKIN_WORKER_LIFETIME_MS: number;
|
|
@@ -47,5 +102,11 @@ export declare const CODING_SKIN_HOOKS: {
|
|
|
47
102
|
};
|
|
48
103
|
export type CodingSkinHookName = keyof typeof CODING_SKIN_HOOKS;
|
|
49
104
|
export declare const CODING_SKIN_MODEL_COMMANDS: readonly ["recall", "get", "remember", "correct"];
|
|
105
|
+
export type CodingSkinHarness = "claude" | "codex";
|
|
106
|
+
export declare function shellQuote(value: string): string;
|
|
107
|
+
/** The command an agent hook runs: the `sno` binary that ran setup, then `memory hook <event> --harness <name>`. */
|
|
108
|
+
export declare function codingSkinHookCommand(snoPath: string, subcommand: string, harness: CodingSkinHarness): string;
|
|
109
|
+
/** True for a hook command of that shape, whatever the path to `sno` is. */
|
|
110
|
+
export declare function isCodingSkinHookCommand(command: string, subcommand: string, harness: CodingSkinHarness): boolean;
|
|
50
111
|
//#endregion
|
|
51
|
-
export { HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH, type ObserveLedgerRow, SKILL_CATEGORIES, appendObserveLedgerRows, skillVersionFor };
|
|
112
|
+
export { type ActivityCursor, type ActivityRecord, HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH, type ObserveLedgerRow, SKILL_CATEGORIES, type SessionActivityPayload, appendObserveLedgerRows, skillVersionFor };
|
package/dist/coding-skin.js
CHANGED
|
@@ -1,55 +1,5 @@
|
|
|
1
1
|
import { appendObserveLedgerRows } from "./internal/engine/telemetry/observe-ledger.js";
|
|
2
2
|
import { SKILL_CATEGORIES, skillVersionFor } from "./internal/config/skill-categories.js";
|
|
3
3
|
import { HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH } from "./internal/config/skin-defaults.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const CODING_SKIN_WORKER_LIFETIME_MS = 54e4;
|
|
7
|
-
const CODING_SKIN_RETRY_DELAYS_MS = [2e3, 1e4];
|
|
8
|
-
const CODING_SKIN_MAX_ATTEMPTS = 3;
|
|
9
|
-
const CODING_SKIN_IMPORT_INTERVAL_MS = 2010;
|
|
10
|
-
const CODING_SKIN_CHILD_MAX_BUFFER_BYTES = 8388608;
|
|
11
|
-
const CODING_SKIN_MANUAL_SESSION_ID = "manual";
|
|
12
|
-
const CODING_SKIN_SESSION_QUERY = "standing decisions, open tasks, conventions and known pitfalls for this repository";
|
|
13
|
-
const CODING_SKIN_LEDGER_MAX_CHARS = 12e3;
|
|
14
|
-
const CODING_SKIN_RECALL_SENTENCE_MAX_CHARS = 200;
|
|
15
|
-
const CODING_SKIN_RECALL_ITEM_MAX_CHARS = 240;
|
|
16
|
-
const CODING_SKIN_HOOKS = {
|
|
17
|
-
SessionStart: {
|
|
18
|
-
eventName: "session_start",
|
|
19
|
-
subcommand: "session-start",
|
|
20
|
-
timeout: 15
|
|
21
|
-
},
|
|
22
|
-
UserPromptSubmit: {
|
|
23
|
-
eventName: "user_prompt_submit",
|
|
24
|
-
subcommand: "user-prompt-submit",
|
|
25
|
-
timeout: 8
|
|
26
|
-
},
|
|
27
|
-
Stop: {
|
|
28
|
-
eventName: "stop",
|
|
29
|
-
subcommand: "stop",
|
|
30
|
-
timeout: 5
|
|
31
|
-
},
|
|
32
|
-
SessionEnd: {
|
|
33
|
-
eventName: "session_end",
|
|
34
|
-
subcommand: "session-end",
|
|
35
|
-
timeout: 8
|
|
36
|
-
},
|
|
37
|
-
PreToolUse: {
|
|
38
|
-
eventName: "pre_tool_use",
|
|
39
|
-
subcommand: "pre-tool-use",
|
|
40
|
-
timeout: 5
|
|
41
|
-
},
|
|
42
|
-
PostToolUse: {
|
|
43
|
-
eventName: "post_tool_use",
|
|
44
|
-
subcommand: "post-tool-use",
|
|
45
|
-
timeout: 8
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const CODING_SKIN_MODEL_COMMANDS = [
|
|
49
|
-
"recall",
|
|
50
|
-
"get",
|
|
51
|
-
"remember",
|
|
52
|
-
"correct"
|
|
53
|
-
];
|
|
54
|
-
//#endregion
|
|
55
|
-
export { CODING_SKIN_CHILD_DEADLINE_MS, CODING_SKIN_CHILD_MAX_BUFFER_BYTES, CODING_SKIN_HOOKS, CODING_SKIN_IMPORT_INTERVAL_MS, CODING_SKIN_LEDGER_MAX_CHARS, CODING_SKIN_MANUAL_SESSION_ID, CODING_SKIN_MAX_ATTEMPTS, CODING_SKIN_MODEL_COMMANDS, CODING_SKIN_RECALL_ITEM_MAX_CHARS, CODING_SKIN_RECALL_SENTENCE_MAX_CHARS, CODING_SKIN_RETRY_DELAYS_MS, CODING_SKIN_SESSION_QUERY, CODING_SKIN_WORKER_LIFETIME_MS, HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH, SKILL_CATEGORIES, appendObserveLedgerRows, skillVersionFor };
|
|
4
|
+
import { _ as EMPTY_ACTIVITY_CURSOR, a as CODING_SKIN_LEDGER_MAX_CHARS, b as isAgentText, c as CODING_SKIN_MODEL_COMMANDS, d as CODING_SKIN_RETRY_DELAYS_MS, f as CODING_SKIN_SESSION_QUERY, g as shellQuote, h as isCodingSkinHookCommand, i as CODING_SKIN_IMPORT_INTERVAL_MS, l as CODING_SKIN_RECALL_ITEM_MAX_CHARS, m as codingSkinHookCommand, n as CODING_SKIN_CHILD_MAX_BUFFER_BYTES, o as CODING_SKIN_MANUAL_SESSION_ID, p as CODING_SKIN_WORKER_LIFETIME_MS, r as CODING_SKIN_HOOKS, s as CODING_SKIN_MAX_ATTEMPTS, t as CODING_SKIN_CHILD_DEADLINE_MS, u as CODING_SKIN_RECALL_SENTENCE_MAX_CHARS, v as activityCursorSchema, x as readNewLines, y as foldActivity } from "./coding-skin-C7gwOKsc.js";
|
|
5
|
+
export { CODING_SKIN_CHILD_DEADLINE_MS, CODING_SKIN_CHILD_MAX_BUFFER_BYTES, CODING_SKIN_HOOKS, CODING_SKIN_IMPORT_INTERVAL_MS, CODING_SKIN_LEDGER_MAX_CHARS, CODING_SKIN_MANUAL_SESSION_ID, CODING_SKIN_MAX_ATTEMPTS, CODING_SKIN_MODEL_COMMANDS, CODING_SKIN_RECALL_ITEM_MAX_CHARS, CODING_SKIN_RECALL_SENTENCE_MAX_CHARS, CODING_SKIN_RETRY_DELAYS_MS, CODING_SKIN_SESSION_QUERY, CODING_SKIN_WORKER_LIFETIME_MS, EMPTY_ACTIVITY_CURSOR, HOST_MODEL_CALLBACK_HOST, HOST_MODEL_CALLBACK_PATH, SKILL_CATEGORIES, activityCursorSchema, appendObserveLedgerRows, codingSkinHookCommand, foldActivity, isAgentText, isCodingSkinHookCommand, readNewLines, shellQuote, skillVersionFor };
|
|
@@ -1149,14 +1149,15 @@ const PRODUCT_MODES = [
|
|
|
1149
1149
|
];
|
|
1150
1150
|
const DEFAULT_MODEL_MODE = "agent-native";
|
|
1151
1151
|
const remEnhancedConfigSchema = z.object({ trigger: z.object({ tick: z.boolean().default(true) }).strict().prefault({}) }).strict().prefault({});
|
|
1152
|
+
const modelCallsConfigSchema = z.record(z.string(), z.record(z.enum(PRODUCT_MODES), z.enum([
|
|
1153
|
+
"off",
|
|
1154
|
+
"host",
|
|
1155
|
+
"sno-gpu"
|
|
1156
|
+
]))).optional();
|
|
1152
1157
|
const llmRoutingConfigSchema = z.object({
|
|
1153
1158
|
mode: z.enum(PRODUCT_MODES),
|
|
1154
1159
|
language: z.enum(SUPPORTED_LOCALES).default("en"),
|
|
1155
|
-
modelCalls:
|
|
1156
|
-
"off",
|
|
1157
|
-
"host",
|
|
1158
|
-
"sno-gpu"
|
|
1159
|
-
]))).optional()
|
|
1160
|
+
modelCalls: modelCallsConfigSchema
|
|
1160
1161
|
}).strict();
|
|
1161
1162
|
//#endregion
|
|
1162
1163
|
//#region config/plugin-config-embedding-schema.ts
|
|
@@ -1581,11 +1582,7 @@ const pluginConfigSchema = z.object({
|
|
|
1581
1582
|
* config requires an explicit product mode.
|
|
1582
1583
|
*/
|
|
1583
1584
|
mode: z.enum(PRODUCT_MODES).default(DEFAULT_MODEL_MODE),
|
|
1584
|
-
modelCalls:
|
|
1585
|
-
"off",
|
|
1586
|
-
"host",
|
|
1587
|
-
"sno-gpu"
|
|
1588
|
-
]))).optional(),
|
|
1585
|
+
modelCalls: modelCallsConfigSchema,
|
|
1589
1586
|
remOperations: z.array(z.enum(REM_OPERATIONS)).min(1).max(2).default([...REM_OPERATIONS]),
|
|
1590
1587
|
remEnhanced: remEnhancedConfigSchema,
|
|
1591
1588
|
/**
|
|
@@ -2013,6 +2010,15 @@ const MODEL_CALLS = {
|
|
|
2013
2010
|
"rem-enhanced": "sno-gpu"
|
|
2014
2011
|
}
|
|
2015
2012
|
},
|
|
2013
|
+
R5: {
|
|
2014
|
+
description: "generate local lessons and skill reminders nightly",
|
|
2015
|
+
calledBy: "RSI skill",
|
|
2016
|
+
destinations: {
|
|
2017
|
+
"local-first": "host",
|
|
2018
|
+
"agent-native": "off",
|
|
2019
|
+
"rem-enhanced": "off"
|
|
2020
|
+
}
|
|
2021
|
+
},
|
|
2016
2022
|
REM1: {
|
|
2017
2023
|
description: "replace conflict pair",
|
|
2018
2024
|
occasion: "conflictAdjudication",
|
|
@@ -2173,7 +2179,7 @@ const destinations = z.strictObject({
|
|
|
2173
2179
|
"agent-native": destination,
|
|
2174
2180
|
"rem-enhanced": destination
|
|
2175
2181
|
});
|
|
2176
|
-
const modelCalls = z.strictObject(Object.fromEntries(Object.keys(MODEL_CALLS).map((id) => [id, destinations])));
|
|
2182
|
+
const modelCalls = z.strictObject(Object.fromEntries(Object.keys(MODEL_CALLS).map((id) => [id, destinations]))).extend({ R5: destinations.default(MODEL_CALLS.R5.destinations) });
|
|
2177
2183
|
const settingsSchema = z.strictObject({
|
|
2178
2184
|
mode: z.enum(PRODUCT_MODES),
|
|
2179
2185
|
modelCalls,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as version, t as logSiteCatalog } from "./log-site-catalog.generated-
|
|
1
|
+
import { n as version, t as logSiteCatalog } from "./log-site-catalog.generated-Cc8xXGaC.js";
|
|
2
2
|
import { diagnosticProcessInstanceId, encodeDiagnostic as encodeDiagnostic$1, writeEmergencyDiagnostic as writeEmergencyDiagnostic$1 } from "@snoai/utils/log-encoder";
|
|
3
3
|
//#region src/engine/observability/early-diagnostics.ts
|
|
4
4
|
function bindApplication(input) {
|