@talocode/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.
Files changed (63) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -0
  3. package/dist/agent-browser.d.ts +11 -0
  4. package/dist/agent-browser.js +40 -0
  5. package/dist/agent-browser.js.map +1 -0
  6. package/dist/cliploop.d.ts +17 -0
  7. package/dist/cliploop.js +56 -0
  8. package/dist/cliploop.js.map +1 -0
  9. package/dist/codra.d.ts +12 -0
  10. package/dist/codra.js +47 -0
  11. package/dist/codra.js.map +1 -0
  12. package/dist/crawlerlane.d.ts +115 -0
  13. package/dist/crawlerlane.js +93 -0
  14. package/dist/crawlerlane.js.map +1 -0
  15. package/dist/errors.d.ts +24 -0
  16. package/dist/errors.js +58 -0
  17. package/dist/errors.js.map +1 -0
  18. package/dist/forgecad.d.ts +139 -0
  19. package/dist/forgecad.js +49 -0
  20. package/dist/forgecad.js.map +1 -0
  21. package/dist/index.d.ts +170 -0
  22. package/dist/index.js +178 -0
  23. package/dist/index.js.map +1 -0
  24. package/dist/invoicelane.d.ts +53 -0
  25. package/dist/invoicelane.js +45 -0
  26. package/dist/invoicelane.js.map +1 -0
  27. package/dist/opensourcelane.d.ts +135 -0
  28. package/dist/opensourcelane.js +101 -0
  29. package/dist/opensourcelane.js.map +1 -0
  30. package/dist/placeholders.d.ts +9 -0
  31. package/dist/placeholders.js +23 -0
  32. package/dist/placeholders.js.map +1 -0
  33. package/dist/replylane.d.ts +113 -0
  34. package/dist/replylane.js +83 -0
  35. package/dist/replylane.js.map +1 -0
  36. package/dist/request.d.ts +7 -0
  37. package/dist/request.js +77 -0
  38. package/dist/request.js.map +1 -0
  39. package/dist/router.d.ts +12 -0
  40. package/dist/router.js +44 -0
  41. package/dist/router.js.map +1 -0
  42. package/dist/signallane.d.ts +76 -0
  43. package/dist/signallane.js +45 -0
  44. package/dist/signallane.js.map +1 -0
  45. package/dist/skills.d.ts +19 -0
  46. package/dist/skills.js +48 -0
  47. package/dist/skills.js.map +1 -0
  48. package/dist/talocode.d.ts +51 -0
  49. package/dist/talocode.js +82 -0
  50. package/dist/talocode.js.map +1 -0
  51. package/dist/tera.d.ts +15 -0
  52. package/dist/tera.js +65 -0
  53. package/dist/tera.js.map +1 -0
  54. package/dist/types.d.ts +398 -0
  55. package/dist/types.js +4 -0
  56. package/dist/types.js.map +1 -0
  57. package/dist/ugclane.d.ts +105 -0
  58. package/dist/ugclane.js +93 -0
  59. package/dist/ugclane.js.map +1 -0
  60. package/dist/webdatalane.d.ts +74 -0
  61. package/dist/webdatalane.js +63 -0
  62. package/dist/webdatalane.js.map +1 -0
  63. package/package.json +49 -0
@@ -0,0 +1,76 @@
1
+ import { TalocodeApiClient } from './talocode.js';
2
+ export interface XMetrics {
3
+ followers?: number;
4
+ verifiedFollowers?: number;
5
+ activeFollowers?: number;
6
+ impressions?: number;
7
+ engagementRate?: number;
8
+ engagements?: number;
9
+ profileVisits?: number;
10
+ replies?: number;
11
+ likes?: number;
12
+ reposts?: number;
13
+ bookmarks?: number;
14
+ shares?: number;
15
+ }
16
+ export interface XTopPost {
17
+ text: string;
18
+ impressions?: number;
19
+ likes?: number;
20
+ replies?: number;
21
+ bookmarks?: number;
22
+ }
23
+ export interface AnalyzeInput {
24
+ handle: string;
25
+ goal: string;
26
+ metrics: XMetrics;
27
+ topPosts?: XTopPost[];
28
+ }
29
+ export interface ContentPlanInput {
30
+ handle: string;
31
+ goal: string;
32
+ analysis: Record<string, unknown>;
33
+ week: string;
34
+ cadence: string;
35
+ }
36
+ export interface PostDraftsInput {
37
+ goal: string;
38
+ voice: string;
39
+ topics: string[];
40
+ count?: number;
41
+ maxLength?: number;
42
+ }
43
+ export interface ExperimentsInput {
44
+ goal: string;
45
+ hypotheses?: string[];
46
+ durationDays?: number;
47
+ }
48
+ export interface ReportInput {
49
+ handle: string;
50
+ goal: string;
51
+ metrics: Record<string, unknown>;
52
+ topPosts?: Record<string, unknown>[];
53
+ period?: string;
54
+ }
55
+ export interface SignalLaneResponse<T> {
56
+ data: T;
57
+ usage: {
58
+ action: string;
59
+ credits: number;
60
+ remaining: number;
61
+ };
62
+ }
63
+ export declare class SignalLaneClient {
64
+ private api;
65
+ constructor(api: TalocodeApiClient);
66
+ health(): Promise<{
67
+ ok: boolean;
68
+ service: string;
69
+ version: string;
70
+ }>;
71
+ analyze(input: AnalyzeInput): Promise<SignalLaneResponse<Record<string, unknown>>>;
72
+ contentPlan(input: ContentPlanInput): Promise<SignalLaneResponse<Record<string, unknown>>>;
73
+ postDrafts(input: PostDraftsInput): Promise<SignalLaneResponse<Record<string, unknown>>>;
74
+ experiments(input: ExperimentsInput): Promise<SignalLaneResponse<Record<string, unknown>>>;
75
+ report(input: ReportInput): Promise<SignalLaneResponse<Record<string, unknown>>>;
76
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SignalLaneClient = void 0;
4
+ class SignalLaneClient {
5
+ api;
6
+ constructor(api) {
7
+ this.api = api;
8
+ }
9
+ async health() {
10
+ const res = await this.api.request('/v1/signallane/health');
11
+ return res;
12
+ }
13
+ async analyze(input) {
14
+ return this.api.request('/v1/signallane/x/analyze', {
15
+ method: 'POST',
16
+ body: input,
17
+ });
18
+ }
19
+ async contentPlan(input) {
20
+ return this.api.request('/v1/signallane/x/content-plan', {
21
+ method: 'POST',
22
+ body: input,
23
+ });
24
+ }
25
+ async postDrafts(input) {
26
+ return this.api.request('/v1/signallane/x/post-drafts', {
27
+ method: 'POST',
28
+ body: input,
29
+ });
30
+ }
31
+ async experiments(input) {
32
+ return this.api.request('/v1/signallane/x/experiments', {
33
+ method: 'POST',
34
+ body: input,
35
+ });
36
+ }
37
+ async report(input) {
38
+ return this.api.request('/v1/signallane/x/report', {
39
+ method: 'POST',
40
+ body: input,
41
+ });
42
+ }
43
+ }
44
+ exports.SignalLaneClient = SignalLaneClient;
45
+ //# sourceMappingURL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AAyD,CAAA;IAC5D,CAAC;CACF;AA9CD,4CA8CC"}
@@ -0,0 +1,19 @@
1
+ import type { SkillsGenerateProfileInput, SkillsGenerateRepoInput, SkillsGenerateDocsInput, SkillsGenerateTextInput, SkillsExportInput, SkillsGenerateResult, SkillsExportResult, SkillsHealthResponse } from './types';
2
+ export declare class SkillsClient {
3
+ private baseUrl;
4
+ private apiKey;
5
+ private timeoutMs;
6
+ constructor(baseUrl: string, apiKey: string | undefined, timeoutMs: number);
7
+ private req;
8
+ health(): Promise<SkillsHealthResponse>;
9
+ generate: {
10
+ githubProfile: (input: SkillsGenerateProfileInput) => Promise<SkillsGenerateResult>;
11
+ githubRepo: (input: SkillsGenerateRepoInput) => Promise<SkillsGenerateResult>;
12
+ docs: (input: SkillsGenerateDocsInput) => Promise<SkillsGenerateResult>;
13
+ text: (input: SkillsGenerateTextInput) => Promise<SkillsGenerateResult>;
14
+ };
15
+ export: {
16
+ cursor: (input: SkillsExportInput) => Promise<SkillsExportResult>;
17
+ claude: (input: SkillsExportInput) => Promise<SkillsExportResult>;
18
+ };
19
+ }
package/dist/skills.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SkillsClient = void 0;
4
+ const request_1 = require("./request");
5
+ class SkillsClient {
6
+ baseUrl;
7
+ apiKey;
8
+ timeoutMs;
9
+ constructor(baseUrl, apiKey, timeoutMs) {
10
+ this.baseUrl = baseUrl;
11
+ this.apiKey = apiKey;
12
+ this.timeoutMs = timeoutMs;
13
+ }
14
+ async req(path, method, body) {
15
+ return (0, request_1.request)(this.baseUrl, path, this.apiKey, {
16
+ method,
17
+ body,
18
+ timeoutMs: this.timeoutMs,
19
+ });
20
+ }
21
+ async health() {
22
+ return this.req('/v1/skills/health', 'GET');
23
+ }
24
+ generate = {
25
+ githubProfile: async (input) => {
26
+ return this.req('/v1/skills/generate/github-profile', 'POST', input);
27
+ },
28
+ githubRepo: async (input) => {
29
+ return this.req('/v1/skills/generate/github-repo', 'POST', input);
30
+ },
31
+ docs: async (input) => {
32
+ return this.req('/v1/skills/generate/docs', 'POST', input);
33
+ },
34
+ text: async (input) => {
35
+ return this.req('/v1/skills/generate/text', 'POST', input);
36
+ },
37
+ };
38
+ export = {
39
+ cursor: async (input) => {
40
+ return this.req('/v1/skills/export/cursor', 'POST', input);
41
+ },
42
+ claude: async (input) => {
43
+ return this.req('/v1/skills/export/claude', 'POST', input);
44
+ },
45
+ };
46
+ }
47
+ exports.SkillsClient = SkillsClient;
48
+ //# sourceMappingURL=skills.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skills.js","sourceRoot":"","sources":["../src/skills.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAYnC,MAAa,YAAY;IACf,OAAO,CAAQ;IACf,MAAM,CAAoB;IAC1B,SAAS,CAAQ;IAEzB,YAAY,OAAe,EAAE,MAA0B,EAAE,SAAiB;QACxE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAEO,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,MAAc,EAAE,IAAc;QAC/D,OAAO,IAAA,iBAAO,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;YAC9C,MAAM;YACN,IAAI;YACJ,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAe,CAAA;IAClB,CAAC;IAED,KAAK,CAAC,MAAM;QACV,OAAO,IAAI,CAAC,GAAG,CAAuB,mBAAmB,EAAE,KAAK,CAAC,CAAA;IACnE,CAAC;IAED,QAAQ,GAAG;QACT,aAAa,EAAE,KAAK,EAAE,KAAiC,EAAiC,EAAE;YACxF,OAAO,IAAI,CAAC,GAAG,CAAuB,oCAAoC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAC5F,CAAC;QAED,UAAU,EAAE,KAAK,EAAE,KAA8B,EAAiC,EAAE;YAClF,OAAO,IAAI,CAAC,GAAG,CAAuB,iCAAiC,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QACzF,CAAC;QAED,IAAI,EAAE,KAAK,EAAE,KAA8B,EAAiC,EAAE;YAC5E,OAAO,IAAI,CAAC,GAAG,CAAuB,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAClF,CAAC;QAED,IAAI,EAAE,KAAK,EAAE,KAA8B,EAAiC,EAAE;YAC5E,OAAO,IAAI,CAAC,GAAG,CAAuB,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAClF,CAAC;KACF,CAAA;IAED,MAAM,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,KAAwB,EAA+B,EAAE;YACtE,OAAO,IAAI,CAAC,GAAG,CAAqB,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAChF,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,KAAwB,EAA+B,EAAE;YACtE,OAAO,IAAI,CAAC,GAAG,CAAqB,0BAA0B,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;QAChF,CAAC;KACF,CAAA;CACF;AAlDD,oCAkDC"}
@@ -0,0 +1,51 @@
1
+ import { TeraClient } from './tera';
2
+ import { RouterClient } from './router';
3
+ import { AgentBrowserClient } from './agent-browser';
4
+ import { ClipLoopClient } from './cliploop';
5
+ import { CodraClient } from './codra';
6
+ import { SkillsClient } from './skills';
7
+ import { InvoiceLaneClient } from './invoicelane';
8
+ import { WebDataLaneClient } from './webdatalane';
9
+ import { SignalLaneClient } from './signallane';
10
+ import { UGCLaneClient } from './ugclane';
11
+ import { CrawlerLaneClient } from './crawlerlane';
12
+ import { OpenSourceLaneClient } from './opensourcelane';
13
+ import { ForgeCADClient } from './forgecad';
14
+ import { ReplyLaneClient } from './replylane';
15
+ import { TradiaClientPlaceholder, WorkLaneClientPlaceholder } from './placeholders';
16
+ export interface TalocodeOptions {
17
+ apiKey?: string;
18
+ baseUrl?: string;
19
+ timeoutMs?: number;
20
+ headers?: Record<string, string>;
21
+ }
22
+ export declare class TalocodeApiClient {
23
+ tera: TeraClient;
24
+ router: RouterClient;
25
+ agentBrowser: AgentBrowserClient;
26
+ cliploop: ClipLoopClient;
27
+ codra: CodraClient;
28
+ skills: SkillsClient;
29
+ invoicelane: InvoiceLaneClient;
30
+ webdatalane: WebDataLaneClient;
31
+ ugclane: UGCLaneClient;
32
+ crawlerlane: CrawlerLaneClient;
33
+ opensourcelane: OpenSourceLaneClient;
34
+ forgecad: ForgeCADClient;
35
+ replylane: ReplyLaneClient;
36
+ tradia: TradiaClientPlaceholder;
37
+ worklane: WorkLaneClientPlaceholder;
38
+ baseUrl: string;
39
+ apiKey: string | undefined;
40
+ timeoutMs: number;
41
+ private _signallane?;
42
+ constructor(options?: TalocodeOptions);
43
+ get signallane(): SignalLaneClient;
44
+ request(path: string, options?: {
45
+ method?: string;
46
+ body?: unknown;
47
+ headers?: Record<string, string>;
48
+ timeoutMs?: number;
49
+ }): Promise<unknown>;
50
+ }
51
+ export { TalocodeApiClient as Talocode };
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Talocode = exports.TalocodeApiClient = void 0;
4
+ const tera_1 = require("./tera");
5
+ const router_1 = require("./router");
6
+ const agent_browser_1 = require("./agent-browser");
7
+ const cliploop_1 = require("./cliploop");
8
+ const codra_1 = require("./codra");
9
+ const skills_1 = require("./skills");
10
+ const invoicelane_1 = require("./invoicelane");
11
+ const webdatalane_1 = require("./webdatalane");
12
+ const signallane_1 = require("./signallane");
13
+ const ugclane_1 = require("./ugclane");
14
+ const crawlerlane_1 = require("./crawlerlane");
15
+ const opensourcelane_1 = require("./opensourcelane");
16
+ const forgecad_1 = require("./forgecad");
17
+ const replylane_1 = require("./replylane");
18
+ const request_1 = require("./request");
19
+ const placeholders_1 = require("./placeholders");
20
+ const DEFAULT_BASE_URL = 'https://api.talocode.site';
21
+ const DEFAULT_TIMEOUT_MS = 30000;
22
+ class TalocodeApiClient {
23
+ tera;
24
+ router;
25
+ agentBrowser;
26
+ cliploop;
27
+ codra;
28
+ skills;
29
+ invoicelane;
30
+ webdatalane;
31
+ ugclane;
32
+ crawlerlane;
33
+ opensourcelane;
34
+ forgecad;
35
+ replylane;
36
+ tradia;
37
+ worklane;
38
+ baseUrl;
39
+ apiKey;
40
+ timeoutMs;
41
+ _signallane;
42
+ constructor(options = {}) {
43
+ this.apiKey =
44
+ options.apiKey ??
45
+ (typeof process !== 'undefined' ? process.env.TALOCODE_API_KEY : undefined);
46
+ this.baseUrl =
47
+ options.baseUrl ??
48
+ (typeof process !== 'undefined' ? process.env.TALOCODE_BASE_URL : undefined) ??
49
+ DEFAULT_BASE_URL;
50
+ this.timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
51
+ this.tera = new tera_1.TeraClient(this.baseUrl, this.apiKey, this.timeoutMs);
52
+ this.router = new router_1.RouterClient(this.baseUrl, this.apiKey, this.timeoutMs);
53
+ this.agentBrowser = new agent_browser_1.AgentBrowserClient(this.baseUrl, this.apiKey, this.timeoutMs);
54
+ this.cliploop = new cliploop_1.ClipLoopClient(this.baseUrl, this.apiKey, this.timeoutMs);
55
+ this.codra = new codra_1.CodraClient(this.baseUrl, this.apiKey, this.timeoutMs);
56
+ this.skills = new skills_1.SkillsClient(this.baseUrl, this.apiKey, this.timeoutMs);
57
+ this.invoicelane = new invoicelane_1.InvoiceLaneClient(this);
58
+ this.webdatalane = new webdatalane_1.WebDataLaneClient(this);
59
+ this.ugclane = new ugclane_1.UGCLaneClient(this);
60
+ this.crawlerlane = new crawlerlane_1.CrawlerLaneClient(this);
61
+ this.opensourcelane = new opensourcelane_1.OpenSourceLaneClient(this);
62
+ this.forgecad = new forgecad_1.ForgeCADClient(this);
63
+ this.replylane = new replylane_1.ReplyLaneClient(this);
64
+ this.tradia = new placeholders_1.TradiaClientPlaceholder();
65
+ this.worklane = new placeholders_1.WorkLaneClientPlaceholder();
66
+ }
67
+ get signallane() {
68
+ if (!this._signallane) {
69
+ this._signallane = new signallane_1.SignalLaneClient(this);
70
+ }
71
+ return this._signallane;
72
+ }
73
+ async request(path, options = {}) {
74
+ return (0, request_1.request)(this.baseUrl, path, this.apiKey, {
75
+ ...options,
76
+ timeoutMs: options.timeoutMs ?? this.timeoutMs,
77
+ });
78
+ }
79
+ }
80
+ exports.TalocodeApiClient = TalocodeApiClient;
81
+ exports.Talocode = TalocodeApiClient;
82
+ //# sourceMappingURL=talocode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"talocode.js","sourceRoot":"","sources":["../src/talocode.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,qCAAuC;AACvC,mDAAoD;AACpD,yCAA2C;AAC3C,mCAAqC;AACrC,qCAAuC;AACvC,+CAAiD;AACjD,+CAAiD;AACjD,6CAA+C;AAC/C,uCAAyC;AACzC,+CAAiD;AACjD,qDAAuD;AACvD,yCAA2C;AAC3C,2CAA6C;AAC7C,uCAAmC;AACnC,iDAGuB;AASvB,MAAM,gBAAgB,GAAG,2BAA2B,CAAA;AACpD,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAEhC,MAAa,iBAAiB;IACrB,IAAI,CAAY;IAChB,MAAM,CAAc;IACpB,YAAY,CAAoB;IAChC,QAAQ,CAAgB;IACxB,KAAK,CAAa;IAClB,MAAM,CAAc;IACpB,WAAW,CAAmB;IAC9B,WAAW,CAAmB;IAC9B,OAAO,CAAe;IACtB,WAAW,CAAmB;IAC9B,cAAc,CAAsB;IACpC,QAAQ,CAAgB;IACxB,SAAS,CAAiB;IAC1B,MAAM,CAAyB;IAC/B,QAAQ,CAA2B;IACnC,OAAO,CAAQ;IACf,MAAM,CAAoB;IAC1B,SAAS,CAAQ;IAChB,WAAW,CAAmB;IAEtC,YAAY,UAA2B,EAAE;QACvC,IAAI,CAAC,MAAM;YACT,OAAO,CA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,IAAI,CAAC,WAAW,GAAG,IAAI,+BAAiB,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,uBAAa,CAAC,IAAI,CAAC,CAAA;QACtC,IAAI,CAAC,WAAW,GAAG,IAAI,+BAAiB,CAAC,IAAI,CAAC,CAAA;QAC9C,IAAI,CAAC,cAAc,GAAG,IAAI,qCAAoB,CAAC,IAAI,CAAC,CAAA;QACpD,IAAI,CAAC,QAAQ,GAAG,IAAI,yBAAc,CAAC,IAAI,CAAC,CAAA;QACxC,IAAI,CAAC,SAAS,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAA;QAC1C,IAAI,CAAC,MAAM,GAAG,IAAI,sCAAuB,EAAE,CAAA;QAC3C,IAAI,CAAC,QAAQ,GAAG,IAAI,wCAAyB,EAAE,CAAA;IACjD,CAAC;IAED,IAAI,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,WAAW,GAAG,IAAI,6BAAgB,CAAC,IAAI,CAAC,CAAA;QAC/C,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAA;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,IAAY,EAAE,UAAqG,EAAE;QACjI,OAAO,IAAA,iBAAO,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,EAAE;YAC9C,GAAG,OAAO;YACV,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS;SAC/C,CAAC,CAAA;IACJ,CAAC;CACF;AA7DD,8CA6DC;AAE6B,qCAAQ"}
package/dist/tera.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ import type { TeraRewriteInput, TeraRewriteResult, TeraDraftInput, TeraDraftResult, TeraExplainInput, TeraExplainResult, TeraReviewInput, TeraReviewResult, TeraSuccessResponse, TeraListResponse, TeraCapabilityEntry, TeraPricingEntry, TeraHealthResponse } from './types';
2
+ export declare class TeraClient {
3
+ private baseUrl;
4
+ private apiKey;
5
+ private timeoutMs;
6
+ constructor(baseUrl: string, apiKey: string | undefined, timeoutMs: number);
7
+ private getNamespacePath;
8
+ rewrite(input: TeraRewriteInput): Promise<TeraSuccessResponse<TeraRewriteResult>>;
9
+ draft(input: TeraDraftInput): Promise<TeraSuccessResponse<TeraDraftResult>>;
10
+ explain(input: TeraExplainInput): Promise<TeraSuccessResponse<TeraExplainResult>>;
11
+ review(input: TeraReviewInput): Promise<TeraSuccessResponse<TeraReviewResult>>;
12
+ health(): Promise<TeraHealthResponse>;
13
+ capabilities(): Promise<TeraListResponse<TeraCapabilityEntry>>;
14
+ pricing(): Promise<TeraListResponse<TeraPricingEntry>>;
15
+ }
package/dist/tera.js ADDED
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeraClient = void 0;
4
+ const request_1 = require("./request");
5
+ class TeraClient {
6
+ baseUrl;
7
+ apiKey;
8
+ timeoutMs;
9
+ constructor(baseUrl, apiKey, timeoutMs) {
10
+ this.baseUrl = baseUrl;
11
+ this.apiKey = apiKey;
12
+ this.timeoutMs = timeoutMs;
13
+ }
14
+ getNamespacePath(path) {
15
+ return `/v1/tera${path}`;
16
+ }
17
+ async rewrite(input) {
18
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/writing/rewrite'), this.apiKey, {
19
+ method: 'POST',
20
+ body: input,
21
+ timeoutMs: this.timeoutMs,
22
+ });
23
+ }
24
+ async draft(input) {
25
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/writing/draft'), this.apiKey, {
26
+ method: 'POST',
27
+ body: input,
28
+ timeoutMs: this.timeoutMs,
29
+ });
30
+ }
31
+ async explain(input) {
32
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/coding/explain'), this.apiKey, {
33
+ method: 'POST',
34
+ body: input,
35
+ timeoutMs: this.timeoutMs,
36
+ });
37
+ }
38
+ async review(input) {
39
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/coding/review'), this.apiKey, {
40
+ method: 'POST',
41
+ body: input,
42
+ timeoutMs: this.timeoutMs,
43
+ });
44
+ }
45
+ async health() {
46
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/health'), this.apiKey, {
47
+ method: 'GET',
48
+ timeoutMs: this.timeoutMs,
49
+ });
50
+ }
51
+ async capabilities() {
52
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/capabilities'), this.apiKey, {
53
+ method: 'GET',
54
+ timeoutMs: this.timeoutMs,
55
+ });
56
+ }
57
+ async pricing() {
58
+ return (0, request_1.request)(this.baseUrl, this.getNamespacePath('/pricing'), this.apiKey, {
59
+ method: 'GET',
60
+ timeoutMs: this.timeoutMs,
61
+ });
62
+ }
63
+ }
64
+ exports.TeraClient = TeraClient;
65
+ //# sourceMappingURL=tera.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tera.js","sourceRoot":"","sources":["../src/tera.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAiBnC,MAAa,UAAU;IACb,OAAO,CAAQ;IACf,MAAM,CAAoB;IAC1B,SAAS,CAAQ;IAEzB,YAAY,OAAe,EAAE,MAA0B,EAAE,SAAiB;QACxE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAEO,gBAAgB,CAAC,IAAY;QACnC,OAAO,WAAW,IAAI,EAAE,CAAA;IAC1B,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAuB;QACnC,OAAO,IAAA,iBAAO,EAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE;YACnF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,IAAI,CAAC,SAAS;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