hebbrix 2.4.0 → 2.5.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +7 -1
- package/dist/index.d.mts +154 -1
- package/dist/index.d.ts +154 -1
- package/dist/index.js +85 -1
- package/dist/index.mjs +84 -1
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.5.0-rc.1 — 2026-09-09 (prerelease, npm `next`)
|
|
4
|
+
|
|
5
|
+
- Add typed native experience program, job, review, revision, policy activation
|
|
6
|
+
and one-use execution-permission transports.
|
|
7
|
+
- Preserve separate credentials, opaque evidence, uncertainty and authorization
|
|
8
|
+
receipts; never convert recommendations into execution permission.
|
|
9
|
+
- Require the matching `b5c6d7e8f959` backend, not yet deployed to public
|
|
10
|
+
production. Stable 2.4.0 remains the production recommendation.
|
|
11
|
+
|
|
3
12
|
## 2.4.0 — 2026-09-07
|
|
4
13
|
|
|
5
14
|
- Add typed Evidence Loop methods for owner-managed verifiers, durable episodes, actual-execution claims, protected outcome delivery and evidence assessments.
|
package/README.md
CHANGED
|
@@ -5,8 +5,14 @@ outcome-learning APIs.
|
|
|
5
5
|
|
|
6
6
|
## Install
|
|
7
7
|
|
|
8
|
+
This branch is the **2.5.0-rc.1 prerelease**, published under npm `next`.
|
|
9
|
+
Native experience operations require backend schema `b5c6d7e8f959`, which is not
|
|
10
|
+
yet deployed to the public production API. Keep `2.4.0` for the current stable
|
|
11
|
+
deployment. Installing this SDK does not grant execution permission or establish
|
|
12
|
+
that an agent learns better outcomes.
|
|
13
|
+
|
|
8
14
|
```bash
|
|
9
|
-
npm install hebbrix@2.
|
|
15
|
+
npm install hebbrix@2.5.0-rc.1
|
|
10
16
|
```
|
|
11
17
|
|
|
12
18
|
Node.js 16+ and modern browsers are supported.
|
package/dist/index.d.mts
CHANGED
|
@@ -118,6 +118,40 @@ interface VerifierRegistration extends EvidenceScope {
|
|
|
118
118
|
source_system: string;
|
|
119
119
|
metric_keys: string[];
|
|
120
120
|
}
|
|
121
|
+
interface ExperienceAssessmentParams {
|
|
122
|
+
collection_id?: string | null;
|
|
123
|
+
user_id?: string | null;
|
|
124
|
+
context: Record<string, unknown>;
|
|
125
|
+
candidate: {
|
|
126
|
+
schema_version?: "experience-candidate-v1";
|
|
127
|
+
policy_key: string;
|
|
128
|
+
action_key: string;
|
|
129
|
+
lesson: string;
|
|
130
|
+
applicability: {
|
|
131
|
+
schema_version?: "experience-applicability-v1";
|
|
132
|
+
required: Record<string, string | number | boolean>;
|
|
133
|
+
};
|
|
134
|
+
sources: Array<{
|
|
135
|
+
decision_id: string;
|
|
136
|
+
evidence_revision: number;
|
|
137
|
+
bundle_digest: string;
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface ExperienceContextParams {
|
|
142
|
+
memory_collection_id: string;
|
|
143
|
+
evidence_collection_id?: string | null;
|
|
144
|
+
user_id?: string | null;
|
|
145
|
+
agent_id?: string | null;
|
|
146
|
+
run_id?: string | null;
|
|
147
|
+
policy_key: string;
|
|
148
|
+
references: Array<{
|
|
149
|
+
memory_id: string;
|
|
150
|
+
record_digest: string;
|
|
151
|
+
}>;
|
|
152
|
+
context: Record<string, unknown>;
|
|
153
|
+
max_context_bytes?: number;
|
|
154
|
+
}
|
|
121
155
|
interface EpisodeCreateParams extends EvidenceScope {
|
|
122
156
|
verifier_id: string;
|
|
123
157
|
idempotency_key: string;
|
|
@@ -131,6 +165,8 @@ interface ExecutionClaim {
|
|
|
131
165
|
occurred_at?: string;
|
|
132
166
|
}
|
|
133
167
|
interface VerifiedOutcomeDelivery {
|
|
168
|
+
/** Optional source claims; their canonical digest must match evidence_digest. */
|
|
169
|
+
evidence_document?: Record<string, unknown>;
|
|
134
170
|
decision_id: string;
|
|
135
171
|
source_event_id: string;
|
|
136
172
|
evidence_digest: string;
|
|
@@ -519,6 +555,10 @@ declare class ProofLoopResource extends BaseResource {
|
|
|
519
555
|
/** Append an execution claim. This method does not execute a tool. */
|
|
520
556
|
recordExecution(decisionId: string, claim: ExecutionClaim): Promise<Record<string, any>>;
|
|
521
557
|
assessment(decisionId: string, evidenceOffset?: number): Promise<Record<string, any>>;
|
|
558
|
+
/** Revalidate a hypothesis against current source evidence; never permission to act. */
|
|
559
|
+
assessExperience(params: ExperienceAssessmentParams): Promise<Record<string, any>>;
|
|
560
|
+
/** Revalidate selected stored hypotheses; never grants execution permission. */
|
|
561
|
+
experienceContext(params: ExperienceContextParams): Promise<Record<string, any>>;
|
|
522
562
|
verifierEvidence(verifierId: string, decisionId: string): Promise<Record<string, any>>;
|
|
523
563
|
/** Deliver using the dedicated source credential, after checking execution independently. */
|
|
524
564
|
deliverVerifiedOutcomes(verifierId: string, delivery: VerifiedOutcomeDelivery): Promise<Record<string, any>>;
|
|
@@ -716,6 +756,118 @@ declare class MemoryToolsResource extends BaseResource {
|
|
|
716
756
|
rethink(memoryId: string, collectionId: string): Promise<any>;
|
|
717
757
|
}
|
|
718
758
|
|
|
759
|
+
/** Native workflow transport. Separate owner, worker and reviewer credentials.
|
|
760
|
+
* No provider call or autonomous tool execution is started by this resource.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
interface ReflectionConfig {
|
|
764
|
+
model: string;
|
|
765
|
+
applicability_keys: string[];
|
|
766
|
+
maximum_attempts: number;
|
|
767
|
+
budget_microusd: number;
|
|
768
|
+
per_attempt_microusd: number;
|
|
769
|
+
lease_seconds?: number;
|
|
770
|
+
}
|
|
771
|
+
interface ExperienceProgramInput {
|
|
772
|
+
collection_id?: string;
|
|
773
|
+
memory_collection_id: string;
|
|
774
|
+
user_id?: string;
|
|
775
|
+
agent_id?: string;
|
|
776
|
+
run_id?: string;
|
|
777
|
+
policy_key: string;
|
|
778
|
+
worker_key_id: string;
|
|
779
|
+
reviewer_key_id?: string;
|
|
780
|
+
source_since?: string;
|
|
781
|
+
config: ReflectionConfig;
|
|
782
|
+
}
|
|
783
|
+
interface ReflectionOutput {
|
|
784
|
+
schema_version?: "experience-reflection-output-v1";
|
|
785
|
+
hypotheses: Array<{
|
|
786
|
+
advice: string;
|
|
787
|
+
rationale: string;
|
|
788
|
+
limitations: string;
|
|
789
|
+
future_verification: string;
|
|
790
|
+
}>;
|
|
791
|
+
insufficient_evidence_reason?: string | null;
|
|
792
|
+
}
|
|
793
|
+
interface LessonReviewInput {
|
|
794
|
+
expected_sequence: number;
|
|
795
|
+
expected_digest: string | null;
|
|
796
|
+
candidate_digest: string;
|
|
797
|
+
verdict: "eligible" | "blocked" | "retracted";
|
|
798
|
+
rationale: string;
|
|
799
|
+
}
|
|
800
|
+
interface LessonRevisionInput extends Omit<LessonReviewInput, "verdict"> {
|
|
801
|
+
request_key: string;
|
|
802
|
+
hypothesis: ReflectionOutput["hypotheses"][number];
|
|
803
|
+
}
|
|
804
|
+
type ReflectionUncertainty = "provider_failure" | "invalid_provider_output" | "completion_delivery_uncertain";
|
|
805
|
+
declare class ExperienceWorkflowResource {
|
|
806
|
+
private client;
|
|
807
|
+
constructor(client: MemoryClient);
|
|
808
|
+
definePermission(id: string, policy: {
|
|
809
|
+
actor_key_id: string;
|
|
810
|
+
tool_key: string;
|
|
811
|
+
target_digest: string;
|
|
812
|
+
action_keys: string[];
|
|
813
|
+
maximum_argument_bytes: number;
|
|
814
|
+
maximum_dispatches: number;
|
|
815
|
+
permit_seconds: number;
|
|
816
|
+
capability_contract: string;
|
|
817
|
+
}): Promise<any>;
|
|
818
|
+
activatePermission(id: string, activation: {
|
|
819
|
+
policy_id: string | null;
|
|
820
|
+
expected_sequence: number;
|
|
821
|
+
expected_digest: string | null;
|
|
822
|
+
rationale: string;
|
|
823
|
+
}): Promise<any>;
|
|
824
|
+
permissionState(id: string): Promise<any>;
|
|
825
|
+
issuePermit(id: string, input: {
|
|
826
|
+
lesson_id: string;
|
|
827
|
+
decision_id: string;
|
|
828
|
+
request_key: string;
|
|
829
|
+
invocation: {
|
|
830
|
+
tool_key: string;
|
|
831
|
+
target: Record<string, unknown>;
|
|
832
|
+
arguments: Record<string, unknown>;
|
|
833
|
+
};
|
|
834
|
+
}): Promise<any>;
|
|
835
|
+
dispatchPermit(id: string, invocationDigest: string): Promise<any>;
|
|
836
|
+
permit(id: string): Promise<any>;
|
|
837
|
+
register(input: ExperienceProgramInput): Promise<any>;
|
|
838
|
+
program(id: string): Promise<any>;
|
|
839
|
+
stop(id: string): Promise<any>;
|
|
840
|
+
claim(id: string, requestKey: string): Promise<any>;
|
|
841
|
+
job(id: string): Promise<any>;
|
|
842
|
+
/** A dispatch grant is single-use. Never retry a provider call after uncertainty. */
|
|
843
|
+
dispatch(id: string, input: {
|
|
844
|
+
input_digest: string;
|
|
845
|
+
request_digest: string;
|
|
846
|
+
}): Promise<any>;
|
|
847
|
+
complete(id: string, input: {
|
|
848
|
+
output: ReflectionOutput;
|
|
849
|
+
request_digest: string;
|
|
850
|
+
provider_response_digest: string;
|
|
851
|
+
reported_microusd: number;
|
|
852
|
+
}): Promise<any>;
|
|
853
|
+
uncertain(id: string, requestDigest: string, reason: ReflectionUncertainty): Promise<any>;
|
|
854
|
+
lessons(id: string, params?: {
|
|
855
|
+
after_id?: string;
|
|
856
|
+
limit?: number;
|
|
857
|
+
}): Promise<any>;
|
|
858
|
+
reviewQueue(id: string, params?: {
|
|
859
|
+
after_id?: string;
|
|
860
|
+
limit?: number;
|
|
861
|
+
}): Promise<any>;
|
|
862
|
+
lesson(id: string): Promise<any>;
|
|
863
|
+
review(id: string, input: LessonReviewInput): Promise<any>;
|
|
864
|
+
revise(id: string, input: LessonRevisionInput): Promise<any>;
|
|
865
|
+
reviews(id: string, params?: {
|
|
866
|
+
after_sequence?: number;
|
|
867
|
+
limit?: number;
|
|
868
|
+
}): Promise<any>;
|
|
869
|
+
}
|
|
870
|
+
|
|
719
871
|
declare class MemoryClient {
|
|
720
872
|
private apiKey?;
|
|
721
873
|
private baseUrl;
|
|
@@ -733,6 +885,7 @@ declare class MemoryClient {
|
|
|
733
885
|
consolidation: ConsolidationResource;
|
|
734
886
|
memoryTools: MemoryToolsResource;
|
|
735
887
|
proofloop: ProofLoopResource;
|
|
888
|
+
experiences: ExperienceWorkflowResource;
|
|
736
889
|
constructor(config?: ClientConfig);
|
|
737
890
|
private getHeaders;
|
|
738
891
|
private handleError;
|
|
@@ -855,4 +1008,4 @@ interface SafetyEnvelope {
|
|
|
855
1008
|
*/
|
|
856
1009
|
declare function enforceSearchSafety<T extends object>(response: T, rowsKey?: "results" | "sources"): T & SafetyEnvelope;
|
|
857
1010
|
|
|
858
|
-
export { type APIKeyResponse, AuthResource, type AuthResponse, AuthenticationError, type BatchMemoryCreateParams, type BatchMemoryItemParams, type BatchMemoryResponse, type ClientConfig, type Collection, CollectionsResource, ConsolidationResource, type CorrectionCreateParams, type CorrectionSearchParams, CorrectionsResource, type CreateCollectionParams, type CreateMemoryParams, type CursorPage, EntitlementError, type EpisodeCreateParams, type EvidenceClaim, type EvidenceScope, type ExecutionClaim, type GroundingReceipt, HebbrixError, IndexingAbortedError, IndexingTerminalError, IndexingTimeoutError, IndexingWaitError, type IndexingWaitErrorOptions, type ListParams, MemoriesResource, type Memory, type MemoryAddResponse, type MemoryAddResult, MemoryClient, type MemoryJobReceipt, MemoryJobsResource, type MemoryListParams, MemoryToolsResource, type MemoryWithMetadata, NotFoundError, ProceduralResource, type ProofContext, type ProofLoopCandidate, type ProofLoopDecisionParams, type ProofLoopMetricParams, ProofLoopResource, RLResource, RateLimitError, type ReasonParams, type ReasoningResponse, type ReasoningSource, type SafetyEnvelope, type SearchParams, SearchResource, type SearchResponse, type SearchResult, ServerError, TemporalResource, type UpdateCollectionParams, type UpdateMemoryParams, type User, ValidationError, type VerifiedOutcomeDelivery, type VerifierRegistration, WorkingMemoryResource, enforceSearchSafety };
|
|
1011
|
+
export { type APIKeyResponse, AuthResource, type AuthResponse, AuthenticationError, type BatchMemoryCreateParams, type BatchMemoryItemParams, type BatchMemoryResponse, type ClientConfig, type Collection, CollectionsResource, ConsolidationResource, type CorrectionCreateParams, type CorrectionSearchParams, CorrectionsResource, type CreateCollectionParams, type CreateMemoryParams, type CursorPage, EntitlementError, type EpisodeCreateParams, type EvidenceClaim, type EvidenceScope, type ExecutionClaim, type ExperienceAssessmentParams, type ExperienceContextParams, type ExperienceProgramInput, ExperienceWorkflowResource, type GroundingReceipt, HebbrixError, IndexingAbortedError, IndexingTerminalError, IndexingTimeoutError, IndexingWaitError, type IndexingWaitErrorOptions, type LessonReviewInput, type LessonRevisionInput, type ListParams, MemoriesResource, type Memory, type MemoryAddResponse, type MemoryAddResult, MemoryClient, type MemoryJobReceipt, MemoryJobsResource, type MemoryListParams, MemoryToolsResource, type MemoryWithMetadata, NotFoundError, ProceduralResource, type ProofContext, type ProofLoopCandidate, type ProofLoopDecisionParams, type ProofLoopMetricParams, ProofLoopResource, RLResource, RateLimitError, type ReasonParams, type ReasoningResponse, type ReasoningSource, type ReflectionConfig, type ReflectionOutput, type ReflectionUncertainty, type SafetyEnvelope, type SearchParams, SearchResource, type SearchResponse, type SearchResult, ServerError, TemporalResource, type UpdateCollectionParams, type UpdateMemoryParams, type User, ValidationError, type VerifiedOutcomeDelivery, type VerifierRegistration, WorkingMemoryResource, enforceSearchSafety };
|
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,40 @@ interface VerifierRegistration extends EvidenceScope {
|
|
|
118
118
|
source_system: string;
|
|
119
119
|
metric_keys: string[];
|
|
120
120
|
}
|
|
121
|
+
interface ExperienceAssessmentParams {
|
|
122
|
+
collection_id?: string | null;
|
|
123
|
+
user_id?: string | null;
|
|
124
|
+
context: Record<string, unknown>;
|
|
125
|
+
candidate: {
|
|
126
|
+
schema_version?: "experience-candidate-v1";
|
|
127
|
+
policy_key: string;
|
|
128
|
+
action_key: string;
|
|
129
|
+
lesson: string;
|
|
130
|
+
applicability: {
|
|
131
|
+
schema_version?: "experience-applicability-v1";
|
|
132
|
+
required: Record<string, string | number | boolean>;
|
|
133
|
+
};
|
|
134
|
+
sources: Array<{
|
|
135
|
+
decision_id: string;
|
|
136
|
+
evidence_revision: number;
|
|
137
|
+
bundle_digest: string;
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface ExperienceContextParams {
|
|
142
|
+
memory_collection_id: string;
|
|
143
|
+
evidence_collection_id?: string | null;
|
|
144
|
+
user_id?: string | null;
|
|
145
|
+
agent_id?: string | null;
|
|
146
|
+
run_id?: string | null;
|
|
147
|
+
policy_key: string;
|
|
148
|
+
references: Array<{
|
|
149
|
+
memory_id: string;
|
|
150
|
+
record_digest: string;
|
|
151
|
+
}>;
|
|
152
|
+
context: Record<string, unknown>;
|
|
153
|
+
max_context_bytes?: number;
|
|
154
|
+
}
|
|
121
155
|
interface EpisodeCreateParams extends EvidenceScope {
|
|
122
156
|
verifier_id: string;
|
|
123
157
|
idempotency_key: string;
|
|
@@ -131,6 +165,8 @@ interface ExecutionClaim {
|
|
|
131
165
|
occurred_at?: string;
|
|
132
166
|
}
|
|
133
167
|
interface VerifiedOutcomeDelivery {
|
|
168
|
+
/** Optional source claims; their canonical digest must match evidence_digest. */
|
|
169
|
+
evidence_document?: Record<string, unknown>;
|
|
134
170
|
decision_id: string;
|
|
135
171
|
source_event_id: string;
|
|
136
172
|
evidence_digest: string;
|
|
@@ -519,6 +555,10 @@ declare class ProofLoopResource extends BaseResource {
|
|
|
519
555
|
/** Append an execution claim. This method does not execute a tool. */
|
|
520
556
|
recordExecution(decisionId: string, claim: ExecutionClaim): Promise<Record<string, any>>;
|
|
521
557
|
assessment(decisionId: string, evidenceOffset?: number): Promise<Record<string, any>>;
|
|
558
|
+
/** Revalidate a hypothesis against current source evidence; never permission to act. */
|
|
559
|
+
assessExperience(params: ExperienceAssessmentParams): Promise<Record<string, any>>;
|
|
560
|
+
/** Revalidate selected stored hypotheses; never grants execution permission. */
|
|
561
|
+
experienceContext(params: ExperienceContextParams): Promise<Record<string, any>>;
|
|
522
562
|
verifierEvidence(verifierId: string, decisionId: string): Promise<Record<string, any>>;
|
|
523
563
|
/** Deliver using the dedicated source credential, after checking execution independently. */
|
|
524
564
|
deliverVerifiedOutcomes(verifierId: string, delivery: VerifiedOutcomeDelivery): Promise<Record<string, any>>;
|
|
@@ -716,6 +756,118 @@ declare class MemoryToolsResource extends BaseResource {
|
|
|
716
756
|
rethink(memoryId: string, collectionId: string): Promise<any>;
|
|
717
757
|
}
|
|
718
758
|
|
|
759
|
+
/** Native workflow transport. Separate owner, worker and reviewer credentials.
|
|
760
|
+
* No provider call or autonomous tool execution is started by this resource.
|
|
761
|
+
*/
|
|
762
|
+
|
|
763
|
+
interface ReflectionConfig {
|
|
764
|
+
model: string;
|
|
765
|
+
applicability_keys: string[];
|
|
766
|
+
maximum_attempts: number;
|
|
767
|
+
budget_microusd: number;
|
|
768
|
+
per_attempt_microusd: number;
|
|
769
|
+
lease_seconds?: number;
|
|
770
|
+
}
|
|
771
|
+
interface ExperienceProgramInput {
|
|
772
|
+
collection_id?: string;
|
|
773
|
+
memory_collection_id: string;
|
|
774
|
+
user_id?: string;
|
|
775
|
+
agent_id?: string;
|
|
776
|
+
run_id?: string;
|
|
777
|
+
policy_key: string;
|
|
778
|
+
worker_key_id: string;
|
|
779
|
+
reviewer_key_id?: string;
|
|
780
|
+
source_since?: string;
|
|
781
|
+
config: ReflectionConfig;
|
|
782
|
+
}
|
|
783
|
+
interface ReflectionOutput {
|
|
784
|
+
schema_version?: "experience-reflection-output-v1";
|
|
785
|
+
hypotheses: Array<{
|
|
786
|
+
advice: string;
|
|
787
|
+
rationale: string;
|
|
788
|
+
limitations: string;
|
|
789
|
+
future_verification: string;
|
|
790
|
+
}>;
|
|
791
|
+
insufficient_evidence_reason?: string | null;
|
|
792
|
+
}
|
|
793
|
+
interface LessonReviewInput {
|
|
794
|
+
expected_sequence: number;
|
|
795
|
+
expected_digest: string | null;
|
|
796
|
+
candidate_digest: string;
|
|
797
|
+
verdict: "eligible" | "blocked" | "retracted";
|
|
798
|
+
rationale: string;
|
|
799
|
+
}
|
|
800
|
+
interface LessonRevisionInput extends Omit<LessonReviewInput, "verdict"> {
|
|
801
|
+
request_key: string;
|
|
802
|
+
hypothesis: ReflectionOutput["hypotheses"][number];
|
|
803
|
+
}
|
|
804
|
+
type ReflectionUncertainty = "provider_failure" | "invalid_provider_output" | "completion_delivery_uncertain";
|
|
805
|
+
declare class ExperienceWorkflowResource {
|
|
806
|
+
private client;
|
|
807
|
+
constructor(client: MemoryClient);
|
|
808
|
+
definePermission(id: string, policy: {
|
|
809
|
+
actor_key_id: string;
|
|
810
|
+
tool_key: string;
|
|
811
|
+
target_digest: string;
|
|
812
|
+
action_keys: string[];
|
|
813
|
+
maximum_argument_bytes: number;
|
|
814
|
+
maximum_dispatches: number;
|
|
815
|
+
permit_seconds: number;
|
|
816
|
+
capability_contract: string;
|
|
817
|
+
}): Promise<any>;
|
|
818
|
+
activatePermission(id: string, activation: {
|
|
819
|
+
policy_id: string | null;
|
|
820
|
+
expected_sequence: number;
|
|
821
|
+
expected_digest: string | null;
|
|
822
|
+
rationale: string;
|
|
823
|
+
}): Promise<any>;
|
|
824
|
+
permissionState(id: string): Promise<any>;
|
|
825
|
+
issuePermit(id: string, input: {
|
|
826
|
+
lesson_id: string;
|
|
827
|
+
decision_id: string;
|
|
828
|
+
request_key: string;
|
|
829
|
+
invocation: {
|
|
830
|
+
tool_key: string;
|
|
831
|
+
target: Record<string, unknown>;
|
|
832
|
+
arguments: Record<string, unknown>;
|
|
833
|
+
};
|
|
834
|
+
}): Promise<any>;
|
|
835
|
+
dispatchPermit(id: string, invocationDigest: string): Promise<any>;
|
|
836
|
+
permit(id: string): Promise<any>;
|
|
837
|
+
register(input: ExperienceProgramInput): Promise<any>;
|
|
838
|
+
program(id: string): Promise<any>;
|
|
839
|
+
stop(id: string): Promise<any>;
|
|
840
|
+
claim(id: string, requestKey: string): Promise<any>;
|
|
841
|
+
job(id: string): Promise<any>;
|
|
842
|
+
/** A dispatch grant is single-use. Never retry a provider call after uncertainty. */
|
|
843
|
+
dispatch(id: string, input: {
|
|
844
|
+
input_digest: string;
|
|
845
|
+
request_digest: string;
|
|
846
|
+
}): Promise<any>;
|
|
847
|
+
complete(id: string, input: {
|
|
848
|
+
output: ReflectionOutput;
|
|
849
|
+
request_digest: string;
|
|
850
|
+
provider_response_digest: string;
|
|
851
|
+
reported_microusd: number;
|
|
852
|
+
}): Promise<any>;
|
|
853
|
+
uncertain(id: string, requestDigest: string, reason: ReflectionUncertainty): Promise<any>;
|
|
854
|
+
lessons(id: string, params?: {
|
|
855
|
+
after_id?: string;
|
|
856
|
+
limit?: number;
|
|
857
|
+
}): Promise<any>;
|
|
858
|
+
reviewQueue(id: string, params?: {
|
|
859
|
+
after_id?: string;
|
|
860
|
+
limit?: number;
|
|
861
|
+
}): Promise<any>;
|
|
862
|
+
lesson(id: string): Promise<any>;
|
|
863
|
+
review(id: string, input: LessonReviewInput): Promise<any>;
|
|
864
|
+
revise(id: string, input: LessonRevisionInput): Promise<any>;
|
|
865
|
+
reviews(id: string, params?: {
|
|
866
|
+
after_sequence?: number;
|
|
867
|
+
limit?: number;
|
|
868
|
+
}): Promise<any>;
|
|
869
|
+
}
|
|
870
|
+
|
|
719
871
|
declare class MemoryClient {
|
|
720
872
|
private apiKey?;
|
|
721
873
|
private baseUrl;
|
|
@@ -733,6 +885,7 @@ declare class MemoryClient {
|
|
|
733
885
|
consolidation: ConsolidationResource;
|
|
734
886
|
memoryTools: MemoryToolsResource;
|
|
735
887
|
proofloop: ProofLoopResource;
|
|
888
|
+
experiences: ExperienceWorkflowResource;
|
|
736
889
|
constructor(config?: ClientConfig);
|
|
737
890
|
private getHeaders;
|
|
738
891
|
private handleError;
|
|
@@ -855,4 +1008,4 @@ interface SafetyEnvelope {
|
|
|
855
1008
|
*/
|
|
856
1009
|
declare function enforceSearchSafety<T extends object>(response: T, rowsKey?: "results" | "sources"): T & SafetyEnvelope;
|
|
857
1010
|
|
|
858
|
-
export { type APIKeyResponse, AuthResource, type AuthResponse, AuthenticationError, type BatchMemoryCreateParams, type BatchMemoryItemParams, type BatchMemoryResponse, type ClientConfig, type Collection, CollectionsResource, ConsolidationResource, type CorrectionCreateParams, type CorrectionSearchParams, CorrectionsResource, type CreateCollectionParams, type CreateMemoryParams, type CursorPage, EntitlementError, type EpisodeCreateParams, type EvidenceClaim, type EvidenceScope, type ExecutionClaim, type GroundingReceipt, HebbrixError, IndexingAbortedError, IndexingTerminalError, IndexingTimeoutError, IndexingWaitError, type IndexingWaitErrorOptions, type ListParams, MemoriesResource, type Memory, type MemoryAddResponse, type MemoryAddResult, MemoryClient, type MemoryJobReceipt, MemoryJobsResource, type MemoryListParams, MemoryToolsResource, type MemoryWithMetadata, NotFoundError, ProceduralResource, type ProofContext, type ProofLoopCandidate, type ProofLoopDecisionParams, type ProofLoopMetricParams, ProofLoopResource, RLResource, RateLimitError, type ReasonParams, type ReasoningResponse, type ReasoningSource, type SafetyEnvelope, type SearchParams, SearchResource, type SearchResponse, type SearchResult, ServerError, TemporalResource, type UpdateCollectionParams, type UpdateMemoryParams, type User, ValidationError, type VerifiedOutcomeDelivery, type VerifierRegistration, WorkingMemoryResource, enforceSearchSafety };
|
|
1011
|
+
export { type APIKeyResponse, AuthResource, type AuthResponse, AuthenticationError, type BatchMemoryCreateParams, type BatchMemoryItemParams, type BatchMemoryResponse, type ClientConfig, type Collection, CollectionsResource, ConsolidationResource, type CorrectionCreateParams, type CorrectionSearchParams, CorrectionsResource, type CreateCollectionParams, type CreateMemoryParams, type CursorPage, EntitlementError, type EpisodeCreateParams, type EvidenceClaim, type EvidenceScope, type ExecutionClaim, type ExperienceAssessmentParams, type ExperienceContextParams, type ExperienceProgramInput, ExperienceWorkflowResource, type GroundingReceipt, HebbrixError, IndexingAbortedError, IndexingTerminalError, IndexingTimeoutError, IndexingWaitError, type IndexingWaitErrorOptions, type LessonReviewInput, type LessonRevisionInput, type ListParams, MemoriesResource, type Memory, type MemoryAddResponse, type MemoryAddResult, MemoryClient, type MemoryJobReceipt, MemoryJobsResource, type MemoryListParams, MemoryToolsResource, type MemoryWithMetadata, NotFoundError, ProceduralResource, type ProofContext, type ProofLoopCandidate, type ProofLoopDecisionParams, type ProofLoopMetricParams, ProofLoopResource, RLResource, RateLimitError, type ReasonParams, type ReasoningResponse, type ReasoningSource, type ReflectionConfig, type ReflectionOutput, type ReflectionUncertainty, type SafetyEnvelope, type SearchParams, SearchResource, type SearchResponse, type SearchResult, ServerError, TemporalResource, type UpdateCollectionParams, type UpdateMemoryParams, type User, ValidationError, type VerifiedOutcomeDelivery, type VerifierRegistration, WorkingMemoryResource, enforceSearchSafety };
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
ConsolidationResource: () => ConsolidationResource,
|
|
27
27
|
CorrectionsResource: () => CorrectionsResource,
|
|
28
28
|
EntitlementError: () => EntitlementError,
|
|
29
|
+
ExperienceWorkflowResource: () => ExperienceWorkflowResource,
|
|
29
30
|
HebbrixError: () => HebbrixError,
|
|
30
31
|
IndexingAbortedError: () => IndexingAbortedError,
|
|
31
32
|
IndexingTerminalError: () => IndexingTerminalError,
|
|
@@ -787,6 +788,14 @@ var ProofLoopResource = class extends BaseResource {
|
|
|
787
788
|
{ evidence_offset: evidenceOffset }
|
|
788
789
|
);
|
|
789
790
|
}
|
|
791
|
+
/** Revalidate a hypothesis against current source evidence; never permission to act. */
|
|
792
|
+
async assessExperience(params) {
|
|
793
|
+
return this.client.post("/v1/learning/experiences/assess", params);
|
|
794
|
+
}
|
|
795
|
+
/** Revalidate selected stored hypotheses; never grants execution permission. */
|
|
796
|
+
async experienceContext(params) {
|
|
797
|
+
return this.client.post("/v1/learning/experiences/context", params);
|
|
798
|
+
}
|
|
790
799
|
async verifierEvidence(verifierId, decisionId) {
|
|
791
800
|
return this.client.get(
|
|
792
801
|
`/v1/learning/verifiers/${encodeURIComponent(verifierId)}/decisions/${encodeURIComponent(decisionId)}`
|
|
@@ -1125,6 +1134,79 @@ var MemoryToolsResource = class extends BaseResource {
|
|
|
1125
1134
|
}
|
|
1126
1135
|
};
|
|
1127
1136
|
|
|
1137
|
+
// src/experience-workflow.ts
|
|
1138
|
+
var root = "/v1/learning/experiences";
|
|
1139
|
+
var resource = (kind, id) => `${root}/${kind}/${encodeURIComponent(id)}`;
|
|
1140
|
+
var ExperienceWorkflowResource = class {
|
|
1141
|
+
constructor(client) {
|
|
1142
|
+
this.client = client;
|
|
1143
|
+
}
|
|
1144
|
+
definePermission(id, policy) {
|
|
1145
|
+
return this.client.post(`${resource("programs", id)}/permission-policies`, policy);
|
|
1146
|
+
}
|
|
1147
|
+
activatePermission(id, activation) {
|
|
1148
|
+
return this.client.post(`${resource("programs", id)}/permission-activation`, activation);
|
|
1149
|
+
}
|
|
1150
|
+
permissionState(id) {
|
|
1151
|
+
return this.client.get(`${resource("programs", id)}/permission-state`);
|
|
1152
|
+
}
|
|
1153
|
+
issuePermit(id, input) {
|
|
1154
|
+
return this.client.post(`${resource("programs", id)}/permits`, input);
|
|
1155
|
+
}
|
|
1156
|
+
dispatchPermit(id, invocationDigest) {
|
|
1157
|
+
return this.client.post(`${resource("permits", id)}/dispatch`, { invocation_digest: invocationDigest });
|
|
1158
|
+
}
|
|
1159
|
+
permit(id) {
|
|
1160
|
+
return this.client.get(resource("permits", id));
|
|
1161
|
+
}
|
|
1162
|
+
register(input) {
|
|
1163
|
+
return this.client.post(`${root}/programs`, input);
|
|
1164
|
+
}
|
|
1165
|
+
program(id) {
|
|
1166
|
+
return this.client.get(resource("programs", id));
|
|
1167
|
+
}
|
|
1168
|
+
stop(id) {
|
|
1169
|
+
return this.client.post(`${resource("programs", id)}/stop`);
|
|
1170
|
+
}
|
|
1171
|
+
claim(id, requestKey) {
|
|
1172
|
+
return this.client.post(`${resource("programs", id)}/claim`, { request_key: requestKey });
|
|
1173
|
+
}
|
|
1174
|
+
job(id) {
|
|
1175
|
+
return this.client.get(resource("jobs", id));
|
|
1176
|
+
}
|
|
1177
|
+
/** A dispatch grant is single-use. Never retry a provider call after uncertainty. */
|
|
1178
|
+
dispatch(id, input) {
|
|
1179
|
+
return this.client.post(`${resource("jobs", id)}/dispatch`, input);
|
|
1180
|
+
}
|
|
1181
|
+
complete(id, input) {
|
|
1182
|
+
return this.client.post(`${resource("jobs", id)}/complete`, input);
|
|
1183
|
+
}
|
|
1184
|
+
uncertain(id, requestDigest, reason) {
|
|
1185
|
+
return this.client.post(`${resource("jobs", id)}/uncertain`, {
|
|
1186
|
+
request_digest: requestDigest,
|
|
1187
|
+
reason
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
lessons(id, params = {}) {
|
|
1191
|
+
return this.client.get(`${resource("programs", id)}/lessons`, params);
|
|
1192
|
+
}
|
|
1193
|
+
reviewQueue(id, params = {}) {
|
|
1194
|
+
return this.client.get(`${resource("programs", id)}/review-queue`, params);
|
|
1195
|
+
}
|
|
1196
|
+
lesson(id) {
|
|
1197
|
+
return this.client.get(resource("lessons", id));
|
|
1198
|
+
}
|
|
1199
|
+
review(id, input) {
|
|
1200
|
+
return this.client.post(`${resource("lessons", id)}/reviews`, input);
|
|
1201
|
+
}
|
|
1202
|
+
revise(id, input) {
|
|
1203
|
+
return this.client.post(`${resource("lessons", id)}/revisions`, input);
|
|
1204
|
+
}
|
|
1205
|
+
reviews(id, params = {}) {
|
|
1206
|
+
return this.client.get(`${resource("lessons", id)}/reviews`, params);
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
|
|
1128
1210
|
// src/client.ts
|
|
1129
1211
|
var MemoryClient = class {
|
|
1130
1212
|
constructor(config = {}) {
|
|
@@ -1145,11 +1227,12 @@ var MemoryClient = class {
|
|
|
1145
1227
|
this.consolidation = new ConsolidationResource(this);
|
|
1146
1228
|
this.memoryTools = new MemoryToolsResource(this);
|
|
1147
1229
|
this.proofloop = new ProofLoopResource(this);
|
|
1230
|
+
this.experiences = new ExperienceWorkflowResource(this);
|
|
1148
1231
|
}
|
|
1149
1232
|
getHeaders() {
|
|
1150
1233
|
const headers = {
|
|
1151
1234
|
"Content-Type": "application/json",
|
|
1152
|
-
"User-Agent": "hebbrix-typescript/2.
|
|
1235
|
+
"User-Agent": "hebbrix-typescript/2.5.0-rc.1"
|
|
1153
1236
|
};
|
|
1154
1237
|
if (this.apiKey) {
|
|
1155
1238
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
@@ -1286,6 +1369,7 @@ var MemoryClient = class {
|
|
|
1286
1369
|
ConsolidationResource,
|
|
1287
1370
|
CorrectionsResource,
|
|
1288
1371
|
EntitlementError,
|
|
1372
|
+
ExperienceWorkflowResource,
|
|
1289
1373
|
HebbrixError,
|
|
1290
1374
|
IndexingAbortedError,
|
|
1291
1375
|
IndexingTerminalError,
|
package/dist/index.mjs
CHANGED
|
@@ -736,6 +736,14 @@ var ProofLoopResource = class extends BaseResource {
|
|
|
736
736
|
{ evidence_offset: evidenceOffset }
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
+
/** Revalidate a hypothesis against current source evidence; never permission to act. */
|
|
740
|
+
async assessExperience(params) {
|
|
741
|
+
return this.client.post("/v1/learning/experiences/assess", params);
|
|
742
|
+
}
|
|
743
|
+
/** Revalidate selected stored hypotheses; never grants execution permission. */
|
|
744
|
+
async experienceContext(params) {
|
|
745
|
+
return this.client.post("/v1/learning/experiences/context", params);
|
|
746
|
+
}
|
|
739
747
|
async verifierEvidence(verifierId, decisionId) {
|
|
740
748
|
return this.client.get(
|
|
741
749
|
`/v1/learning/verifiers/${encodeURIComponent(verifierId)}/decisions/${encodeURIComponent(decisionId)}`
|
|
@@ -1074,6 +1082,79 @@ var MemoryToolsResource = class extends BaseResource {
|
|
|
1074
1082
|
}
|
|
1075
1083
|
};
|
|
1076
1084
|
|
|
1085
|
+
// src/experience-workflow.ts
|
|
1086
|
+
var root = "/v1/learning/experiences";
|
|
1087
|
+
var resource = (kind, id) => `${root}/${kind}/${encodeURIComponent(id)}`;
|
|
1088
|
+
var ExperienceWorkflowResource = class {
|
|
1089
|
+
constructor(client) {
|
|
1090
|
+
this.client = client;
|
|
1091
|
+
}
|
|
1092
|
+
definePermission(id, policy) {
|
|
1093
|
+
return this.client.post(`${resource("programs", id)}/permission-policies`, policy);
|
|
1094
|
+
}
|
|
1095
|
+
activatePermission(id, activation) {
|
|
1096
|
+
return this.client.post(`${resource("programs", id)}/permission-activation`, activation);
|
|
1097
|
+
}
|
|
1098
|
+
permissionState(id) {
|
|
1099
|
+
return this.client.get(`${resource("programs", id)}/permission-state`);
|
|
1100
|
+
}
|
|
1101
|
+
issuePermit(id, input) {
|
|
1102
|
+
return this.client.post(`${resource("programs", id)}/permits`, input);
|
|
1103
|
+
}
|
|
1104
|
+
dispatchPermit(id, invocationDigest) {
|
|
1105
|
+
return this.client.post(`${resource("permits", id)}/dispatch`, { invocation_digest: invocationDigest });
|
|
1106
|
+
}
|
|
1107
|
+
permit(id) {
|
|
1108
|
+
return this.client.get(resource("permits", id));
|
|
1109
|
+
}
|
|
1110
|
+
register(input) {
|
|
1111
|
+
return this.client.post(`${root}/programs`, input);
|
|
1112
|
+
}
|
|
1113
|
+
program(id) {
|
|
1114
|
+
return this.client.get(resource("programs", id));
|
|
1115
|
+
}
|
|
1116
|
+
stop(id) {
|
|
1117
|
+
return this.client.post(`${resource("programs", id)}/stop`);
|
|
1118
|
+
}
|
|
1119
|
+
claim(id, requestKey) {
|
|
1120
|
+
return this.client.post(`${resource("programs", id)}/claim`, { request_key: requestKey });
|
|
1121
|
+
}
|
|
1122
|
+
job(id) {
|
|
1123
|
+
return this.client.get(resource("jobs", id));
|
|
1124
|
+
}
|
|
1125
|
+
/** A dispatch grant is single-use. Never retry a provider call after uncertainty. */
|
|
1126
|
+
dispatch(id, input) {
|
|
1127
|
+
return this.client.post(`${resource("jobs", id)}/dispatch`, input);
|
|
1128
|
+
}
|
|
1129
|
+
complete(id, input) {
|
|
1130
|
+
return this.client.post(`${resource("jobs", id)}/complete`, input);
|
|
1131
|
+
}
|
|
1132
|
+
uncertain(id, requestDigest, reason) {
|
|
1133
|
+
return this.client.post(`${resource("jobs", id)}/uncertain`, {
|
|
1134
|
+
request_digest: requestDigest,
|
|
1135
|
+
reason
|
|
1136
|
+
});
|
|
1137
|
+
}
|
|
1138
|
+
lessons(id, params = {}) {
|
|
1139
|
+
return this.client.get(`${resource("programs", id)}/lessons`, params);
|
|
1140
|
+
}
|
|
1141
|
+
reviewQueue(id, params = {}) {
|
|
1142
|
+
return this.client.get(`${resource("programs", id)}/review-queue`, params);
|
|
1143
|
+
}
|
|
1144
|
+
lesson(id) {
|
|
1145
|
+
return this.client.get(resource("lessons", id));
|
|
1146
|
+
}
|
|
1147
|
+
review(id, input) {
|
|
1148
|
+
return this.client.post(`${resource("lessons", id)}/reviews`, input);
|
|
1149
|
+
}
|
|
1150
|
+
revise(id, input) {
|
|
1151
|
+
return this.client.post(`${resource("lessons", id)}/revisions`, input);
|
|
1152
|
+
}
|
|
1153
|
+
reviews(id, params = {}) {
|
|
1154
|
+
return this.client.get(`${resource("lessons", id)}/reviews`, params);
|
|
1155
|
+
}
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1077
1158
|
// src/client.ts
|
|
1078
1159
|
var MemoryClient = class {
|
|
1079
1160
|
constructor(config = {}) {
|
|
@@ -1094,11 +1175,12 @@ var MemoryClient = class {
|
|
|
1094
1175
|
this.consolidation = new ConsolidationResource(this);
|
|
1095
1176
|
this.memoryTools = new MemoryToolsResource(this);
|
|
1096
1177
|
this.proofloop = new ProofLoopResource(this);
|
|
1178
|
+
this.experiences = new ExperienceWorkflowResource(this);
|
|
1097
1179
|
}
|
|
1098
1180
|
getHeaders() {
|
|
1099
1181
|
const headers = {
|
|
1100
1182
|
"Content-Type": "application/json",
|
|
1101
|
-
"User-Agent": "hebbrix-typescript/2.
|
|
1183
|
+
"User-Agent": "hebbrix-typescript/2.5.0-rc.1"
|
|
1102
1184
|
};
|
|
1103
1185
|
if (this.apiKey) {
|
|
1104
1186
|
headers["Authorization"] = `Bearer ${this.apiKey}`;
|
|
@@ -1234,6 +1316,7 @@ export {
|
|
|
1234
1316
|
ConsolidationResource,
|
|
1235
1317
|
CorrectionsResource,
|
|
1236
1318
|
EntitlementError,
|
|
1319
|
+
ExperienceWorkflowResource,
|
|
1237
1320
|
HebbrixError,
|
|
1238
1321
|
IndexingAbortedError,
|
|
1239
1322
|
IndexingTerminalError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hebbrix",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-rc.1",
|
|
4
4
|
"description": "Typed TypeScript client for Hebbrix memory, retrieval, and outcome-learning APIs",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://docs.hebbrix.com",
|
|
57
57
|
"publishConfig": {
|
|
58
|
-
"access": "public"
|
|
58
|
+
"access": "public",
|
|
59
|
+
"tag": "next"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@types/node": "^20.10.0",
|