@3ngram/sdk 0.8.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 +202 -0
- package/dist/client.d.ts +45 -0
- package/dist/client.js +97 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +14 -0
- package/dist/errors.js +34 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/reference.d.ts +18 -0
- package/dist/reference.js +90 -0
- package/dist/reference.js.map +1 -0
- package/package.json +41 -0
- package/tsconfig.package.json +10 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { CommitmentStatus, FactsQueryArgs, FactsToolOutput, RememberToolArgs, RememberToolOutput, ResolveToolOutput, ReviseToolArgs, ReviseToolOutput, SearchQueryArgs, SearchToolOutput } from '@3ngram/schema';
|
|
2
|
+
/** Explicit client configuration. No env/flag fallback — the caller supplies both. */
|
|
3
|
+
export interface ThreengramClientConfig {
|
|
4
|
+
/** REST origin, e.g. `https://api.example.com` (no trailing `/api/v1`). */
|
|
5
|
+
baseUrl: string;
|
|
6
|
+
/** API key sent as the `X-API-Key` header on every request (C3 key chain). */
|
|
7
|
+
apiKey: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Search options: everything except `query` from the wider, caller-side
|
|
11
|
+
* {@link SearchQueryArgs} (server-defaulted `limit` stays optional for callers).
|
|
12
|
+
*/
|
|
13
|
+
export type SearchOptions = Omit<SearchQueryArgs, 'query'>;
|
|
14
|
+
/**
|
|
15
|
+
* Revise body: the successor write WITHOUT `predecessorId`. The predecessor is
|
|
16
|
+
* the URL arg of {@link ThreengramClient.revise}, and the REST router overwrites
|
|
17
|
+
* any body `predecessorId` with the path id anyway ("the URL wins"), so requiring
|
|
18
|
+
* it in the body would be redundant.
|
|
19
|
+
*/
|
|
20
|
+
export type ReviseBody = Omit<ReviseToolArgs, 'predecessorId'>;
|
|
21
|
+
/** The `fetch` surface the client depends on — injectable for tests (no network). */
|
|
22
|
+
export type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
|
|
23
|
+
/**
|
|
24
|
+
* Typed client over REST `/api/v1`. Five methods mirror the routes 1:1; every
|
|
25
|
+
* argument and return type is sourced from @3ngram/schema.
|
|
26
|
+
*/
|
|
27
|
+
export declare class ThreengramClient {
|
|
28
|
+
#private;
|
|
29
|
+
constructor(config: ThreengramClientConfig, fetchImpl?: FetchLike);
|
|
30
|
+
/** POST /api/v1/memories — write a memory (commitmentId present only for commitments). */
|
|
31
|
+
remember(input: RememberToolArgs): Promise<RememberToolOutput>;
|
|
32
|
+
/** POST /api/v1/search — semantic search over the wider query+filters body. */
|
|
33
|
+
search(query: string, opts?: SearchOptions): Promise<SearchToolOutput>;
|
|
34
|
+
/** GET /api/v1/facts — currently-valid facts; filters ride as the querystring. */
|
|
35
|
+
getFacts(filters?: FactsQueryArgs): Promise<FactsToolOutput>;
|
|
36
|
+
/**
|
|
37
|
+
* POST /api/v1/memories/:id/revise — supersede a predecessor with a successor write.
|
|
38
|
+
* `predecessorId` is the path arg ONLY; it is merged into the body internally
|
|
39
|
+
* (the REST router does the same — "the URL wins", router.ts), so callers never
|
|
40
|
+
* duplicate it in {@link ReviseBody}.
|
|
41
|
+
*/
|
|
42
|
+
revise(predecessorId: string, input: ReviseBody): Promise<ReviseToolOutput>;
|
|
43
|
+
/** POST /api/v1/memories/:id/resolve — transition the commitment riding a memory. */
|
|
44
|
+
resolve(memoryId: string, status: CommitmentStatus): Promise<ResolveToolOutput>;
|
|
45
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ThreengramApiError, ThreengramNetworkError } from './errors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Typed client over REST `/api/v1`. Five methods mirror the routes 1:1; every
|
|
4
|
+
* argument and return type is sourced from @3ngram/schema.
|
|
5
|
+
*/
|
|
6
|
+
export class ThreengramClient {
|
|
7
|
+
#baseUrl;
|
|
8
|
+
#apiKey;
|
|
9
|
+
#fetch;
|
|
10
|
+
constructor(config, fetchImpl) {
|
|
11
|
+
this.#baseUrl = config.baseUrl.replace(/\/+$/, '');
|
|
12
|
+
this.#apiKey = config.apiKey;
|
|
13
|
+
this.#fetch = fetchImpl ?? ((input, init) => fetch(input, init));
|
|
14
|
+
}
|
|
15
|
+
/** POST /api/v1/memories — write a memory (commitmentId present only for commitments). */
|
|
16
|
+
remember(input) {
|
|
17
|
+
return this.#send('POST', '/api/v1/memories', input);
|
|
18
|
+
}
|
|
19
|
+
/** POST /api/v1/search — semantic search over the wider query+filters body. */
|
|
20
|
+
search(query, opts) {
|
|
21
|
+
const body = { query, ...opts };
|
|
22
|
+
return this.#send('POST', '/api/v1/search', body);
|
|
23
|
+
}
|
|
24
|
+
/** GET /api/v1/facts — currently-valid facts; filters ride as the querystring. */
|
|
25
|
+
getFacts(filters) {
|
|
26
|
+
const path = `/api/v1/facts${factsQuery(filters)}`;
|
|
27
|
+
return this.#send('GET', path);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* POST /api/v1/memories/:id/revise — supersede a predecessor with a successor write.
|
|
31
|
+
* `predecessorId` is the path arg ONLY; it is merged into the body internally
|
|
32
|
+
* (the REST router does the same — "the URL wins", router.ts), so callers never
|
|
33
|
+
* duplicate it in {@link ReviseBody}.
|
|
34
|
+
*/
|
|
35
|
+
revise(predecessorId, input) {
|
|
36
|
+
const path = `/api/v1/memories/${encodeURIComponent(predecessorId)}/revise`;
|
|
37
|
+
return this.#send('POST', path, { ...input, predecessorId });
|
|
38
|
+
}
|
|
39
|
+
/** POST /api/v1/memories/:id/resolve — transition the commitment riding a memory. */
|
|
40
|
+
resolve(memoryId, status) {
|
|
41
|
+
const path = `/api/v1/memories/${encodeURIComponent(memoryId)}/resolve`;
|
|
42
|
+
return this.#send('POST', path, { status });
|
|
43
|
+
}
|
|
44
|
+
/** Issue one request: attach the key header, body, and map both failure shapes. */
|
|
45
|
+
async #send(method, path, body) {
|
|
46
|
+
const init = {
|
|
47
|
+
method,
|
|
48
|
+
headers: {
|
|
49
|
+
'X-API-Key': this.#apiKey,
|
|
50
|
+
...(body === undefined ? {} : { 'Content-Type': 'application/json' }),
|
|
51
|
+
},
|
|
52
|
+
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
|
53
|
+
};
|
|
54
|
+
const response = await this.#dispatch(`${this.#baseUrl}${path}`, init);
|
|
55
|
+
if (!response.ok)
|
|
56
|
+
throw new ThreengramApiError(response.status, await reasonOf(response));
|
|
57
|
+
return (await response.json());
|
|
58
|
+
}
|
|
59
|
+
/** Run the injected fetch; a transport rejection becomes a ThreengramNetworkError. */
|
|
60
|
+
async #dispatch(url, init) {
|
|
61
|
+
try {
|
|
62
|
+
return await this.#fetch(url, init);
|
|
63
|
+
}
|
|
64
|
+
catch (cause) {
|
|
65
|
+
throw new ThreengramNetworkError('3ngram REST transport failed', cause);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/** Read the `{ error: <reason> }` code from a non-2xx body; 'unknown' if unparseable. */
|
|
70
|
+
async function reasonOf(response) {
|
|
71
|
+
try {
|
|
72
|
+
const body = (await response.json());
|
|
73
|
+
return typeof body.error === 'string' ? body.error : 'unknown';
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return 'unknown';
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Build the `/api/v1/facts` querystring — subject/predicate/limit + FLAT asOf coords. */
|
|
80
|
+
function factsQuery(filters) {
|
|
81
|
+
if (filters === undefined)
|
|
82
|
+
return '';
|
|
83
|
+
const params = new URLSearchParams();
|
|
84
|
+
if (filters.subject !== undefined)
|
|
85
|
+
params.set('subject', filters.subject);
|
|
86
|
+
if (filters.predicate !== undefined)
|
|
87
|
+
params.set('predicate', filters.predicate);
|
|
88
|
+
if (filters.limit !== undefined)
|
|
89
|
+
params.set('limit', String(filters.limit));
|
|
90
|
+
if (filters.asOf?.validAt !== undefined)
|
|
91
|
+
params.set('validAt', filters.asOf.validAt);
|
|
92
|
+
if (filters.asOf?.asKnownAt !== undefined)
|
|
93
|
+
params.set('asKnownAt', filters.asOf.asKnownAt);
|
|
94
|
+
const query = params.toString();
|
|
95
|
+
return query === '' ? '' : `?${query}`;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AA2BxE;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAClB,QAAQ,CAAQ;IAChB,OAAO,CAAQ;IACf,MAAM,CAAW;IAE1B,YAAY,MAA8B,EAAE,SAAqB;QAC/D,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QAClD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,SAAS,IAAI,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAA;IAClE,CAAC;IAED,0FAA0F;IAC1F,QAAQ,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AAE,OAAO,EAAE,CAAA;IACpC,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;IACpC,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/E,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IAC3E,IAAI,OAAO,CAAC,IAAI,EAAE,OAAO,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACpF,IAAI,OAAO,CAAC,IAAI,EAAE,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAC1F,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAA;IAC/B,OAAO,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,EAAE,CAAA;AACxC,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** A non-2xx REST response: carries the HTTP status and the `{ error }` reason code. */
|
|
2
|
+
export declare class ThreengramApiError extends Error {
|
|
3
|
+
/** The HTTP status code of the failing response (e.g. 404, 409, 503). */
|
|
4
|
+
readonly status: number;
|
|
5
|
+
/** The REST `{ error: <reason> }` body code (e.g. 'not_found'); 'unknown' when absent. */
|
|
6
|
+
readonly reason: string;
|
|
7
|
+
constructor(status: number, reason: string);
|
|
8
|
+
}
|
|
9
|
+
/** A transport-level failure: `fetch` rejected before any HTTP response arrived. */
|
|
10
|
+
export declare class ThreengramNetworkError extends Error {
|
|
11
|
+
/** The underlying transport rejection (the original fetch error), if any. */
|
|
12
|
+
readonly cause: unknown;
|
|
13
|
+
constructor(message: string, cause: unknown);
|
|
14
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Typed SDK errors. The REST surface (apps/server/src/rest/router.ts) returns a
|
|
3
|
+
// `{ error: <reason> }` body on every non-2xx response (status 400/401/403/404/
|
|
4
|
+
// 409/503) and a generic `internal_error` on 500. The client maps those two
|
|
5
|
+
// failure shapes to DISTINCT classes so callers can branch without parsing:
|
|
6
|
+
// - ThreengramApiError — the server replied with a non-2xx status; carries
|
|
7
|
+
// the HTTP `.status` and the `{ error }` `.reason` code (e.g. 'not_found',
|
|
8
|
+
// 'invalid_transition', 'embedding_unavailable', 'invalid_input').
|
|
9
|
+
// - ThreengramNetworkError — fetch itself rejected (DNS, connection refused,
|
|
10
|
+
// timeout, aborted): no HTTP exchange completed, so there is no status/reason.
|
|
11
|
+
/** A non-2xx REST response: carries the HTTP status and the `{ error }` reason code. */
|
|
12
|
+
export class ThreengramApiError extends Error {
|
|
13
|
+
/** The HTTP status code of the failing response (e.g. 404, 409, 503). */
|
|
14
|
+
status;
|
|
15
|
+
/** The REST `{ error: <reason> }` body code (e.g. 'not_found'); 'unknown' when absent. */
|
|
16
|
+
reason;
|
|
17
|
+
constructor(status, reason) {
|
|
18
|
+
super(`3ngram REST request failed: ${status} ${reason}`);
|
|
19
|
+
this.name = 'ThreengramApiError';
|
|
20
|
+
this.status = status;
|
|
21
|
+
this.reason = reason;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** A transport-level failure: `fetch` rejected before any HTTP response arrived. */
|
|
25
|
+
export class ThreengramNetworkError extends Error {
|
|
26
|
+
/** The underlying transport rejection (the original fetch error), if any. */
|
|
27
|
+
cause;
|
|
28
|
+
constructor(message, cause) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = 'ThreengramNetworkError';
|
|
31
|
+
this.cause = cause;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,gFAAgF;AAChF,gFAAgF;AAChF,4EAA4E;AAC5E,4EAA4E;AAC5E,kFAAkF;AAClF,+EAA+E;AAC/E,uEAAuE;AACvE,gFAAgF;AAChF,mFAAmF;AAEnF,wFAAwF;AACxF,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,yEAAyE;IAChE,MAAM,CAAQ;IACvB,0FAA0F;IACjF,MAAM,CAAQ;IAEvB,YAAY,MAAc,EAAE,MAAc;QACxC,KAAK,CAAC,+BAA+B,MAAM,IAAI,MAAM,EAAE,CAAC,CAAA;QACxD,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAA;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF;AAED,oFAAoF;AACpF,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,6EAA6E;IAC3D,KAAK,CAAS;IAEhC,YAAY,OAAe,EAAE,KAAc;QACzC,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAA;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// @3ngram/sdk — workspace-only typed client over the REST /api/v1 surface
|
|
3
|
+
// (docs/concepts/architecture.mdx one core, N transports; NOT published to npm).
|
|
4
|
+
export { ThreengramClient, } from './client.js';
|
|
5
|
+
export { ThreengramApiError, ThreengramNetworkError } from './errors.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0EAA0E;AAC1E,iFAAiF;AACjF,OAAO,EAGL,gBAAgB,GAEjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface SdkMethodReference {
|
|
2
|
+
name: string;
|
|
3
|
+
signature: string;
|
|
4
|
+
route: string;
|
|
5
|
+
summary: string;
|
|
6
|
+
requestSchema: 'remember' | 'search' | 'facts' | 'revise' | 'resolve';
|
|
7
|
+
responseSchema: 'remember' | 'search' | 'facts' | 'revise' | 'resolve';
|
|
8
|
+
example: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const SDK_METHOD_NAMES: readonly ["remember", "search", "getFacts", "revise", "resolve"];
|
|
11
|
+
export declare const SDK_METHODS: readonly SdkMethodReference[];
|
|
12
|
+
export declare const SDK_ERRORS: readonly [{
|
|
13
|
+
readonly name: "ThreengramApiError";
|
|
14
|
+
readonly description: "Thrown for non-2xx REST responses. Carries status and reason from the response body.";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "ThreengramNetworkError";
|
|
17
|
+
readonly description: "Thrown when fetch rejects before a server response is available.";
|
|
18
|
+
}];
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
// Public SDK reference metadata consumed by the docs generator. The SDK runtime
|
|
3
|
+
// surface stays in client.ts; this file keeps docs prose, method signatures, and
|
|
4
|
+
// examples explicit without making the generator parse comments.
|
|
5
|
+
export const SDK_METHOD_NAMES = ['remember', 'search', 'getFacts', 'revise', 'resolve'];
|
|
6
|
+
export const SDK_METHODS = [
|
|
7
|
+
{
|
|
8
|
+
name: 'remember',
|
|
9
|
+
signature: 'remember(input: RememberToolArgs): Promise<RememberToolOutput>',
|
|
10
|
+
route: 'POST /api/v1/memories',
|
|
11
|
+
summary: 'Append a typed memory. Commitment outputs include a commitmentId.',
|
|
12
|
+
requestSchema: 'remember',
|
|
13
|
+
responseSchema: 'remember',
|
|
14
|
+
example: [
|
|
15
|
+
'await client.remember({',
|
|
16
|
+
" memoryType: 'decision',",
|
|
17
|
+
" topic: 'search backend',",
|
|
18
|
+
" content: 'Use Postgres full-text search for v1.',",
|
|
19
|
+
" scope: 'work',",
|
|
20
|
+
" project: '3ngram',",
|
|
21
|
+
'})',
|
|
22
|
+
].join('\n'),
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'search',
|
|
26
|
+
signature: 'search(query: string, opts?: SearchOptions): Promise<SearchToolOutput>',
|
|
27
|
+
route: 'POST /api/v1/search',
|
|
28
|
+
summary: 'Run semantic and keyword retrieval with optional pre-fusion filters.',
|
|
29
|
+
requestSchema: 'search',
|
|
30
|
+
responseSchema: 'search',
|
|
31
|
+
example: [
|
|
32
|
+
"await client.search('oauth refresh token', {",
|
|
33
|
+
' limit: 5,',
|
|
34
|
+
" scope: 'work',",
|
|
35
|
+
" project: '3ngram',",
|
|
36
|
+
'})',
|
|
37
|
+
].join('\n'),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'getFacts',
|
|
41
|
+
signature: 'getFacts(filters?: FactsQueryArgs): Promise<FactsToolOutput>',
|
|
42
|
+
route: 'GET /api/v1/facts',
|
|
43
|
+
summary: 'Read currently-valid facts, with optional bi-temporal filters.',
|
|
44
|
+
requestSchema: 'facts',
|
|
45
|
+
responseSchema: 'facts',
|
|
46
|
+
example: [
|
|
47
|
+
'await client.getFacts({',
|
|
48
|
+
" subject: '3ngram',",
|
|
49
|
+
" predicate: 'status',",
|
|
50
|
+
' limit: 20,',
|
|
51
|
+
'})',
|
|
52
|
+
].join('\n'),
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'revise',
|
|
56
|
+
signature: 'revise(predecessorId: string, input: ReviseBody): Promise<ReviseToolOutput>',
|
|
57
|
+
route: 'POST /api/v1/memories/:id/revise',
|
|
58
|
+
summary: 'Create a corrected successor memory and link it to the predecessor.',
|
|
59
|
+
requestSchema: 'revise',
|
|
60
|
+
responseSchema: 'revise',
|
|
61
|
+
example: [
|
|
62
|
+
'await client.revise(memoryId, {',
|
|
63
|
+
" memoryType: 'decision',",
|
|
64
|
+
" topic: 'search backend',",
|
|
65
|
+
" content: 'Use Postgres full-text search plus embeddings for v1.',",
|
|
66
|
+
" edgeIntent: 'updates',",
|
|
67
|
+
'})',
|
|
68
|
+
].join('\n'),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'resolve',
|
|
72
|
+
signature: 'resolve(memoryId: string, status: CommitmentStatus): Promise<ResolveToolOutput>',
|
|
73
|
+
route: 'POST /api/v1/memories/:id/resolve',
|
|
74
|
+
summary: 'Transition the commitment riding a memory, or archive an active blocker.',
|
|
75
|
+
requestSchema: 'resolve',
|
|
76
|
+
responseSchema: 'resolve',
|
|
77
|
+
example: "await client.resolve(memoryId, 'resolved')",
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
export const SDK_ERRORS = [
|
|
81
|
+
{
|
|
82
|
+
name: 'ThreengramApiError',
|
|
83
|
+
description: 'Thrown for non-2xx REST responses. Carries status and reason from the response body.',
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'ThreengramNetworkError',
|
|
87
|
+
description: 'Thrown when fetch rejects before a server response is available.',
|
|
88
|
+
},
|
|
89
|
+
];
|
|
90
|
+
//# sourceMappingURL=reference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.js","sourceRoot":"","sources":["../src/reference.ts"],"names":[],"mappings":"AAAA,sCAAs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QAAQ;QACxB,OAAO,EAAE;YACP,iCAAiC;YACjC,2BAA2B;YAC3B,4BAA4B;YAC5B,qEAAqE;YACrE,0BAA0B;YAC1B,IAAI;SACL,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD;QACE,IAAI,EAAE,SAAS;QACf,SAAS,EAAE,iFAAiF;QAC5F,KAAK,EAAE,mCAAmC;QAC1C,OAAO,EAAE,0EAA0E;QACnF,aAAa,EAAE,SAAS;QACxB,cAAc,EAAE,SAAS;QACzB,OAAO,EAAE,4CAA4C;KACtD;CACF,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,sFAAsF;KACzF;IACD;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,kEAAkE;KAChF;CACO,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@3ngram/sdk",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Thin typed client over the existing REST /api/v1 surface (docs/concepts/architecture.mdx one core, N transports).",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"provenance": true
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/B3dmar/3ngram.git",
|
|
14
|
+
"directory": "packages/sdk"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"default": "./dist/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./tsconfig.package.json": "./tsconfig.package.json"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"tsconfig.package.json"
|
|
26
|
+
],
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"zod": "4.4.3",
|
|
29
|
+
"@3ngram/schema": "0.4.0"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@types/node": "25.9.1",
|
|
33
|
+
"typescript": "6.0.3",
|
|
34
|
+
"vitest": "4.1.8"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "tsc -p tsconfig.json",
|
|
38
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
39
|
+
"test": "vitest run --exclude '**/integration/**'"
|
|
40
|
+
}
|
|
41
|
+
}
|