@lore-co/sdk 0.1.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/LICENSE +110 -0
- package/README.md +32 -0
- package/dist/index.d.ts +83 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +240 -0
- package/dist/index.js.map +1 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright (c) 2026 Treadie, Inc
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# `@lore-co/sdk`
|
|
2
|
+
|
|
3
|
+
The customer library for applications and integrations that call Lore
|
|
4
|
+
programmatically. It provides a typed client for learnings, activity, audited
|
|
5
|
+
context delivery, observations, and turns.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pnpm add @lore-co/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { LoreClient } from "@lore-co/sdk";
|
|
13
|
+
|
|
14
|
+
const lore = new LoreClient({
|
|
15
|
+
baseUrl: process.env.LORE_API_URL!,
|
|
16
|
+
headers: {
|
|
17
|
+
authorization: `Bearer ${process.env.LORE_WORKSPACE_TOKEN!}`,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const result = await lore.processTurn(turn, "incident-42:reply-3");
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`observeEvent` calls `POST /v1/observations`; `processTurn` calls
|
|
25
|
+
`POST /v1/turns` and forwards the optional idempotency key. `observe` and
|
|
26
|
+
`getContext` remain available for compatibility.
|
|
27
|
+
|
|
28
|
+
Use `@lore-co/adapter-generic` instead when the customer owns an agent runtime and
|
|
29
|
+
wants a higher-level prepare/observe bridge. CLI users should install the
|
|
30
|
+
standalone `lore` binary; they do not need this package.
|
|
31
|
+
|
|
32
|
+
Node.js 22 or newer is required.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { GetContextResponseSchema, type AgentInteraction, type AgentTask, type CorrectMemoryDto, type CorrectMemoryResponse, type ContextPacking, type CreateMemoryDto, type ForgetMemoryResponse, type GetMemoryResponse, type ListMemoriesDto, type ListMemoriesResponse, type MemoryCategory, type MemoryScope, type ObserveResponse, type RememberResponse, type UpdateMemoryResponse } from "@lore-co/core/schemas";
|
|
2
|
+
import { type ActivityListResponse, type ActivityQuery, type ContextDeliveryRequest, type ContextDeliveryResponse, type DevinSessionRegistration, type DevinSessionRegistrationResponse, type LearningInspectionResponse, type ObservationRequestInput, type ObservationResponse, type PairedTurnRequest, type PairedTurnResponse } from "@lore-co/core/pilot-schemas";
|
|
3
|
+
import { type CreateWorkspaceTokenRequest, type CreateWorkspaceTokenResponse, type ListWorkspaceTokensResponse, type RevokeWorkspaceTokenResponse } from "@lore-co/core/auth-schemas";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export type { AgentInteraction, AgentMessage, AgentTask, CorrectMemoryResponse, ContextPacking, ForgetMemoryResponse, GetMemoryResponse, ListMemoriesResponse, Memory, MemoryCategory, MemoryScope, MemorySource, MemoryStatus, Learning, LearningCategory, LearningScope, LearningSource, LearningStatus, ObserveResponse, RememberResponse, UpdateMemoryResponse, } from "@lore-co/core/schemas";
|
|
6
|
+
export type { ActivityItem, ActivityListResponse, ActivityQuery, ConnectorEvent, ContextDeliveryRequest, ContextDeliveryResponse, DeliveryReceipt, DevinSessionRegistration, DevinSessionRegistrationResponse, LearningInspectionProvenance, LearningInspectionResponse, ObservationRequest, ObservationRequestInput, ObservationResponse, PairedTurnRequest, PairedTurnResponse, TurnObservation, } from "@lore-co/core/pilot-schemas";
|
|
7
|
+
export type { CreateWorkspaceTokenRequest, CreateWorkspaceTokenResponse, ListWorkspaceTokensResponse, RevokeWorkspaceTokenResponse, WorkspaceToken, WorkspaceTokenStatus, } from "@lore-co/core/auth-schemas";
|
|
8
|
+
export interface SharedMemoryClientOptions {
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
fetch?: typeof fetch;
|
|
11
|
+
headers?: HeadersInit;
|
|
12
|
+
}
|
|
13
|
+
export type LoreClientOptions = SharedMemoryClientOptions;
|
|
14
|
+
export interface ScopeInput {
|
|
15
|
+
scope?: MemoryScope;
|
|
16
|
+
organization?: string;
|
|
17
|
+
project?: string;
|
|
18
|
+
repo?: string;
|
|
19
|
+
path?: string;
|
|
20
|
+
component?: string;
|
|
21
|
+
}
|
|
22
|
+
export type RememberInput = Omit<CreateMemoryDto, "scope"> & ScopeInput;
|
|
23
|
+
export type CorrectMemoryInput = Omit<CorrectMemoryDto, "memoryId">;
|
|
24
|
+
export type ListMemoriesInput = Omit<ListMemoriesDto, "scope"> & ScopeInput;
|
|
25
|
+
export type CreateLearningInput = RememberInput;
|
|
26
|
+
export type CorrectLearningInput = CorrectMemoryInput;
|
|
27
|
+
export type ListLearningsInput = ListMemoriesInput;
|
|
28
|
+
export interface UpdateMemoryInput {
|
|
29
|
+
content?: string;
|
|
30
|
+
scope?: MemoryScope;
|
|
31
|
+
category?: MemoryCategory;
|
|
32
|
+
}
|
|
33
|
+
export type UpdateLearningInput = UpdateMemoryInput;
|
|
34
|
+
export interface ContextResponse {
|
|
35
|
+
memories: GetContextResponse["memories"];
|
|
36
|
+
context: string;
|
|
37
|
+
packing: ContextPacking;
|
|
38
|
+
}
|
|
39
|
+
type GetContextResponse = z.infer<typeof GetContextResponseSchema>;
|
|
40
|
+
export declare class SharedMemoryApiError extends Error {
|
|
41
|
+
readonly status: number;
|
|
42
|
+
readonly method: string;
|
|
43
|
+
readonly url: string;
|
|
44
|
+
readonly details: unknown;
|
|
45
|
+
constructor(input: {
|
|
46
|
+
status: number;
|
|
47
|
+
method: string;
|
|
48
|
+
url: string;
|
|
49
|
+
details: unknown;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
export declare class SharedMemoryClient {
|
|
53
|
+
#private;
|
|
54
|
+
constructor(options: SharedMemoryClientOptions);
|
|
55
|
+
observe(input: AgentInteraction): Promise<ObserveResponse>;
|
|
56
|
+
observeEvent(input: ObservationRequestInput): Promise<ObservationResponse>;
|
|
57
|
+
observeObservation(input: ObservationRequestInput): Promise<ObservationResponse>;
|
|
58
|
+
processTurn(input: PairedTurnRequest, idempotencyKey?: string): Promise<PairedTurnResponse>;
|
|
59
|
+
getContext(input: AgentTask): Promise<ContextResponse>;
|
|
60
|
+
registerDevinSession(input: DevinSessionRegistration): Promise<DevinSessionRegistrationResponse>;
|
|
61
|
+
deliverContext(input: ContextDeliveryRequest): Promise<ContextDeliveryResponse>;
|
|
62
|
+
remember(input: RememberInput): Promise<RememberResponse>;
|
|
63
|
+
getMemory(id: string): Promise<GetMemoryResponse>;
|
|
64
|
+
listMemories(input?: ListMemoriesInput): Promise<ListMemoriesResponse>;
|
|
65
|
+
createLearning(input: RememberInput): Promise<RememberResponse>;
|
|
66
|
+
getLearning(id: string): Promise<GetMemoryResponse>;
|
|
67
|
+
inspectLearning(id: string): Promise<LearningInspectionResponse>;
|
|
68
|
+
listLearnings(input?: ListMemoriesInput): Promise<ListMemoriesResponse>;
|
|
69
|
+
updateLearning(id: string, input: UpdateMemoryInput): Promise<UpdateMemoryResponse>;
|
|
70
|
+
correctLearning(id: string, input: CorrectMemoryInput): Promise<CorrectMemoryResponse>;
|
|
71
|
+
forgetLearning(id: string): Promise<ForgetMemoryResponse>;
|
|
72
|
+
updateMemory(id: string, input: UpdateMemoryInput): Promise<UpdateMemoryResponse>;
|
|
73
|
+
correct(id: string, input: CorrectMemoryInput): Promise<CorrectMemoryResponse>;
|
|
74
|
+
forget(id: string): Promise<ForgetMemoryResponse>;
|
|
75
|
+
listActivity(input?: ActivityQuery): Promise<ActivityListResponse>;
|
|
76
|
+
listWorkspaceTokens(): Promise<ListWorkspaceTokensResponse>;
|
|
77
|
+
createWorkspaceToken(input: CreateWorkspaceTokenRequest): Promise<CreateWorkspaceTokenResponse>;
|
|
78
|
+
revokeWorkspaceToken(tokenId: string): Promise<RevokeWorkspaceTokenResponse>;
|
|
79
|
+
}
|
|
80
|
+
export declare class LoreClient extends SharedMemoryClient {
|
|
81
|
+
}
|
|
82
|
+
export { SharedMemoryApiError as LoreApiError };
|
|
83
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,wBAAwB,EAMxB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK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oryResponseSchema, GetContextResponseSchema, GetMemoryResponseSchema, ListMemoriesResponseSchema, ObserveResponseSchema, RememberResponseSchema, UpdateMemoryResponseSchema, } from "@lore-co/core/schemas";
|
|
2
|
+
import { ActivityListResponseSchema, ActivityQuerySchema, ContextDeliveryResponseSchema, DevinSessionRegistrationResponseSchema, LearningInspectionResponseSchema, ObservationResponseSchema, PairedTurnResponseSchema, } from "@lore-co/core/pilot-schemas";
|
|
3
|
+
import { CreateWorkspaceTokenResponseSchema, ListWorkspaceTokensResponseSchema, RevokeWorkspaceTokenResponseSchema, } from "@lore-co/core/auth-schemas";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const FormattedContextResponseSchema = GetContextResponseSchema.extend({
|
|
6
|
+
context: z.string(),
|
|
7
|
+
packing: ContextPackingSchema,
|
|
8
|
+
});
|
|
9
|
+
function parseResponseBody(text) {
|
|
10
|
+
if (text.trim() === "") {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
return JSON.parse(text);
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return text;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export class SharedMemoryApiError extends Error {
|
|
21
|
+
status;
|
|
22
|
+
method;
|
|
23
|
+
url;
|
|
24
|
+
details;
|
|
25
|
+
constructor(input) {
|
|
26
|
+
const detailMessage = typeof input.details === "object" &&
|
|
27
|
+
input.details !== null &&
|
|
28
|
+
"message" in input.details
|
|
29
|
+
? String(input.details.message)
|
|
30
|
+
: typeof input.details === "string"
|
|
31
|
+
? input.details
|
|
32
|
+
: "";
|
|
33
|
+
super(`${input.method} ${input.url} failed with HTTP ${input.status}${detailMessage === "" ? "" : `: ${detailMessage}`}`);
|
|
34
|
+
this.name = "SharedMemoryApiError";
|
|
35
|
+
this.status = input.status;
|
|
36
|
+
this.method = input.method;
|
|
37
|
+
this.url = input.url;
|
|
38
|
+
this.details = input.details;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
export class SharedMemoryClient {
|
|
42
|
+
#baseUrl;
|
|
43
|
+
#fetch;
|
|
44
|
+
#headers;
|
|
45
|
+
constructor(options) {
|
|
46
|
+
const baseUrl = options.baseUrl.trim().replace(/\/+$/u, "");
|
|
47
|
+
if (baseUrl === "") {
|
|
48
|
+
throw new Error("SharedMemoryClient baseUrl is required");
|
|
49
|
+
}
|
|
50
|
+
const fetchImplementation = options.fetch ?? globalThis.fetch;
|
|
51
|
+
if (fetchImplementation === undefined) {
|
|
52
|
+
throw new Error("A Fetch API implementation is required");
|
|
53
|
+
}
|
|
54
|
+
this.#baseUrl = baseUrl;
|
|
55
|
+
this.#fetch = fetchImplementation.bind(globalThis);
|
|
56
|
+
this.#headers = options.headers ?? {};
|
|
57
|
+
}
|
|
58
|
+
async #request(method, path, schema, body, requestHeaders) {
|
|
59
|
+
const url = `${this.#baseUrl}${path}`;
|
|
60
|
+
const headers = new Headers(this.#headers);
|
|
61
|
+
for (const [name, value] of new Headers(requestHeaders)) {
|
|
62
|
+
headers.set(name, value);
|
|
63
|
+
}
|
|
64
|
+
headers.set("accept", "application/json");
|
|
65
|
+
if (body !== undefined) {
|
|
66
|
+
headers.set("content-type", "application/json");
|
|
67
|
+
}
|
|
68
|
+
const response = await this.#fetch(url, {
|
|
69
|
+
method,
|
|
70
|
+
headers,
|
|
71
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
72
|
+
});
|
|
73
|
+
const parsed = parseResponseBody(await response.text());
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
throw new SharedMemoryApiError({
|
|
76
|
+
status: response.status,
|
|
77
|
+
method,
|
|
78
|
+
url,
|
|
79
|
+
details: parsed,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (parsed === undefined) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
return schema.parse(parsed);
|
|
86
|
+
}
|
|
87
|
+
observe(input) {
|
|
88
|
+
return this.#request("POST", "/v1/interactions", ObserveResponseSchema, input);
|
|
89
|
+
}
|
|
90
|
+
observeEvent(input) {
|
|
91
|
+
return this.#request("POST", "/v1/observations", ObservationResponseSchema, input);
|
|
92
|
+
}
|
|
93
|
+
observeObservation(input) {
|
|
94
|
+
return this.observeEvent(input);
|
|
95
|
+
}
|
|
96
|
+
processTurn(input, idempotencyKey) {
|
|
97
|
+
return this.#request("POST", "/v1/turns", PairedTurnResponseSchema, input, idempotencyKey === undefined
|
|
98
|
+
? undefined
|
|
99
|
+
: { "idempotency-key": idempotencyKey });
|
|
100
|
+
}
|
|
101
|
+
getContext(input) {
|
|
102
|
+
return this.#request("POST", "/v1/context", FormattedContextResponseSchema, input);
|
|
103
|
+
}
|
|
104
|
+
registerDevinSession(input) {
|
|
105
|
+
return this.#request("POST", "/v1/connectors/devin/sessions", DevinSessionRegistrationResponseSchema, input);
|
|
106
|
+
}
|
|
107
|
+
deliverContext(input) {
|
|
108
|
+
return this.#request("POST", "/v1/context/deliveries", ContextDeliveryResponseSchema, input);
|
|
109
|
+
}
|
|
110
|
+
remember(input) {
|
|
111
|
+
return this.#request("POST", "/v1/memories", RememberResponseSchema, input);
|
|
112
|
+
}
|
|
113
|
+
getMemory(id) {
|
|
114
|
+
return this.#request("GET", `/v1/memories/${encodeURIComponent(id)}`, GetMemoryResponseSchema);
|
|
115
|
+
}
|
|
116
|
+
listMemories(input = {}) {
|
|
117
|
+
return this.#listMemoriesAt("/v1/memories", input);
|
|
118
|
+
}
|
|
119
|
+
#listMemoriesAt(path, input) {
|
|
120
|
+
const query = new URLSearchParams();
|
|
121
|
+
const scope = input.scope ?? {};
|
|
122
|
+
const organization = scope.organization ?? input.organization;
|
|
123
|
+
const project = scope.project ?? input.project;
|
|
124
|
+
const repo = scope.repo ?? input.repo;
|
|
125
|
+
const learningPath = scope.path ?? input.path;
|
|
126
|
+
const component = scope.component ?? input.component;
|
|
127
|
+
if (input.query !== undefined) {
|
|
128
|
+
query.set("query", input.query);
|
|
129
|
+
}
|
|
130
|
+
const categories = input.category === undefined
|
|
131
|
+
? []
|
|
132
|
+
: Array.isArray(input.category)
|
|
133
|
+
? input.category
|
|
134
|
+
: [input.category];
|
|
135
|
+
for (const category of categories) {
|
|
136
|
+
query.append("category", category);
|
|
137
|
+
}
|
|
138
|
+
const statuses = input.status === undefined
|
|
139
|
+
? []
|
|
140
|
+
: Array.isArray(input.status)
|
|
141
|
+
? input.status
|
|
142
|
+
: [input.status];
|
|
143
|
+
for (const status of statuses) {
|
|
144
|
+
query.append("status", status);
|
|
145
|
+
}
|
|
146
|
+
if (organization !== undefined) {
|
|
147
|
+
query.set("organization", organization);
|
|
148
|
+
}
|
|
149
|
+
if (project !== undefined) {
|
|
150
|
+
query.set("project", project);
|
|
151
|
+
}
|
|
152
|
+
if (repo !== undefined) {
|
|
153
|
+
query.set("repo", repo);
|
|
154
|
+
}
|
|
155
|
+
if (learningPath !== undefined) {
|
|
156
|
+
query.set("path", learningPath);
|
|
157
|
+
}
|
|
158
|
+
if (component !== undefined) {
|
|
159
|
+
query.set("component", component);
|
|
160
|
+
}
|
|
161
|
+
if (input.limit !== undefined) {
|
|
162
|
+
query.set("limit", String(input.limit));
|
|
163
|
+
}
|
|
164
|
+
if (input.offset !== undefined) {
|
|
165
|
+
query.set("offset", String(input.offset));
|
|
166
|
+
}
|
|
167
|
+
const serialized = query.toString();
|
|
168
|
+
return this.#request("GET", `${path}${serialized === "" ? "" : `?${serialized}`}`, ListMemoriesResponseSchema);
|
|
169
|
+
}
|
|
170
|
+
createLearning(input) {
|
|
171
|
+
return this.#request("POST", "/v1/learnings", RememberResponseSchema, input);
|
|
172
|
+
}
|
|
173
|
+
getLearning(id) {
|
|
174
|
+
return this.#request("GET", `/v1/learnings/${encodeURIComponent(id)}`, GetMemoryResponseSchema);
|
|
175
|
+
}
|
|
176
|
+
inspectLearning(id) {
|
|
177
|
+
return this.#request("GET", `/v1/learnings/${encodeURIComponent(id)}/inspection`, LearningInspectionResponseSchema);
|
|
178
|
+
}
|
|
179
|
+
listLearnings(input = {}) {
|
|
180
|
+
return this.#listMemoriesAt("/v1/learnings", input);
|
|
181
|
+
}
|
|
182
|
+
updateLearning(id, input) {
|
|
183
|
+
return this.#request("PATCH", `/v1/learnings/${encodeURIComponent(id)}`, UpdateMemoryResponseSchema, input);
|
|
184
|
+
}
|
|
185
|
+
correctLearning(id, input) {
|
|
186
|
+
return this.#request("POST", `/v1/learnings/${encodeURIComponent(id)}/corrections`, CorrectMemoryResponseSchema, input);
|
|
187
|
+
}
|
|
188
|
+
forgetLearning(id) {
|
|
189
|
+
return this.#request("DELETE", `/v1/learnings/${encodeURIComponent(id)}`, ForgetMemoryResponseSchema);
|
|
190
|
+
}
|
|
191
|
+
updateMemory(id, input) {
|
|
192
|
+
return this.#request("PATCH", `/v1/memories/${encodeURIComponent(id)}`, UpdateMemoryResponseSchema, input);
|
|
193
|
+
}
|
|
194
|
+
correct(id, input) {
|
|
195
|
+
return this.#request("POST", `/v1/memories/${encodeURIComponent(id)}/corrections`, CorrectMemoryResponseSchema, input);
|
|
196
|
+
}
|
|
197
|
+
forget(id) {
|
|
198
|
+
return this.#request("DELETE", `/v1/memories/${encodeURIComponent(id)}`, ForgetMemoryResponseSchema);
|
|
199
|
+
}
|
|
200
|
+
listActivity(input = {}) {
|
|
201
|
+
const filters = ActivityQuerySchema.parse(input);
|
|
202
|
+
const query = new URLSearchParams();
|
|
203
|
+
if (filters.type !== undefined) {
|
|
204
|
+
query.set("type", filters.type);
|
|
205
|
+
}
|
|
206
|
+
if (filters.agent !== undefined) {
|
|
207
|
+
query.set("agent", filters.agent);
|
|
208
|
+
}
|
|
209
|
+
if (filters.connector !== undefined) {
|
|
210
|
+
query.set("connector", filters.connector);
|
|
211
|
+
}
|
|
212
|
+
if (filters.from !== undefined) {
|
|
213
|
+
query.set("from", filters.from);
|
|
214
|
+
}
|
|
215
|
+
if (filters.to !== undefined) {
|
|
216
|
+
query.set("to", filters.to);
|
|
217
|
+
}
|
|
218
|
+
if (filters.limit !== undefined) {
|
|
219
|
+
query.set("limit", String(filters.limit));
|
|
220
|
+
}
|
|
221
|
+
if (filters.offset !== undefined) {
|
|
222
|
+
query.set("offset", String(filters.offset));
|
|
223
|
+
}
|
|
224
|
+
const serialized = query.toString();
|
|
225
|
+
return this.#request("GET", `/v1/activity${serialized === "" ? "" : `?${serialized}`}`, ActivityListResponseSchema);
|
|
226
|
+
}
|
|
227
|
+
listWorkspaceTokens() {
|
|
228
|
+
return this.#request("GET", "/v1/workspace-tokens", ListWorkspaceTokensResponseSchema);
|
|
229
|
+
}
|
|
230
|
+
createWorkspaceToken(input) {
|
|
231
|
+
return this.#request("POST", "/v1/workspace-tokens", CreateWorkspaceTokenResponseSchema, input);
|
|
232
|
+
}
|
|
233
|
+
revokeWorkspaceToken(tokenId) {
|
|
234
|
+
return this.#request("DELETE", `/v1/workspace-tokens/${encodeURIComponent(tokenId)}`, RevokeWorkspaceTokenResponseSchema);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
export class LoreClient extends SharedMemoryClient {
|
|
238
|
+
}
|
|
239
|
+
export { SharedMemoryApiError as LoreApiError };
|
|
240
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,0BAA0B,GAgB3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,6BAA6B,EAC7B,sCAAsC,EACtC,gCAAgC,EAChC,yBAAyB,EACzB,wBAAwB,GAezB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,kCAAkC,EAClC,iCAAiC,EACjC,kCAAkC,GAOnC,MAAM,4BAA4B,CAAC;AACpC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M,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,eAAe,UAAU,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,EAAE,EAC1D,0BAA0B,CAC3B,CAAC;IACJ,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,QAAQ,CAClB,KAAK,EACL,sBAAsB,EACtB,iCAAiC,CAClC,CAAC;IACJ,CAAC;IAED,oBAAoB,CAClB,KAAkC;QAElC,OAAO,IAAI,CAAC,QAAQ,CAClB,MAAM,EACN,sBAAsB,EACtB,kCAAkC,EAClC,KAAK,CACN,CAAC;IACJ,CAAC;IAED,oBAAoB,CAClB,OAAe;QAEf,OAAO,IAAI,CAAC,QAAQ,CAClB,QAAQ,EACR,wBAAwB,kBAAkB,CAAC,OAAO,CAAC,EAAE,EACrD,kCAAkC,CACnC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,UAAW,SAAQ,kBAAkB;CAAG;AACrD,OAAO,EAAE,oBAAoB,IAAI,YAAY,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lore-co/sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Typed HTTP client for Lore engineering memory",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.0.0"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"lore",
|
|
26
|
+
"ai",
|
|
27
|
+
"memory",
|
|
28
|
+
"sdk"
|
|
29
|
+
],
|
|
30
|
+
"license": "FSL-1.1-MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"zod": "^4.4.3",
|
|
33
|
+
"@lore-co/core": "0.1.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
39
|
+
"test": "vitest run --passWithNoTests"
|
|
40
|
+
}
|
|
41
|
+
}
|