@locusai/sdk 0.13.2 → 0.14.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/dist/agent/worker.js +92 -3
- package/dist/ai/__tests__/factory.test.d.ts +2 -0
- package/dist/ai/__tests__/factory.test.d.ts.map +1 -0
- package/dist/ai/factory.d.ts.map +1 -1
- package/dist/core/config.d.ts +23 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/index-node.js +98 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -0
- package/dist/modules/instances.d.ts +46 -0
- package/dist/modules/instances.d.ts.map +1 -0
- package/dist/modules/workspaces.d.ts +15 -0
- package/dist/modules/workspaces.d.ts.map +1 -1
- package/dist/utils/retry.d.ts +0 -5
- package/dist/utils/retry.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/orchestrator/agent-pool.d.ts +0 -2
- package/dist/orchestrator/agent-pool.d.ts.map +0 -1
- package/dist/orchestrator/execution.d.ts +0 -2
- package/dist/orchestrator/execution.d.ts.map +0 -1
- package/dist/orchestrator/tier-merge.d.ts +0 -2
- package/dist/orchestrator/tier-merge.d.ts.map +0 -1
package/dist/agent/worker.js
CHANGED
|
@@ -156,6 +156,49 @@ var init_docs = __esm(() => {
|
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
// src/modules/instances.ts
|
|
160
|
+
var InstancesModule;
|
|
161
|
+
var init_instances = __esm(() => {
|
|
162
|
+
InstancesModule = class InstancesModule extends BaseModule {
|
|
163
|
+
async list(workspaceId) {
|
|
164
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances`);
|
|
165
|
+
return data.instances;
|
|
166
|
+
}
|
|
167
|
+
async get(workspaceId, instanceId) {
|
|
168
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}`);
|
|
169
|
+
return data.instance;
|
|
170
|
+
}
|
|
171
|
+
async provision(workspaceId, body) {
|
|
172
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances`, body);
|
|
173
|
+
return data.instance;
|
|
174
|
+
}
|
|
175
|
+
async performAction(workspaceId, instanceId, action) {
|
|
176
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/actions`, { action });
|
|
177
|
+
return data.instance;
|
|
178
|
+
}
|
|
179
|
+
async sync(workspaceId, instanceId) {
|
|
180
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/sync`);
|
|
181
|
+
return data.instance;
|
|
182
|
+
}
|
|
183
|
+
async checkUpdates(workspaceId, instanceId) {
|
|
184
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
185
|
+
return data.update;
|
|
186
|
+
}
|
|
187
|
+
async applyUpdate(workspaceId, instanceId) {
|
|
188
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
189
|
+
return data.update;
|
|
190
|
+
}
|
|
191
|
+
async getSecurity(workspaceId, instanceId) {
|
|
192
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`);
|
|
193
|
+
return data.rules;
|
|
194
|
+
}
|
|
195
|
+
async updateSecurity(workspaceId, instanceId, body) {
|
|
196
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`, body);
|
|
197
|
+
return data.rules;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
|
|
159
202
|
// src/modules/invitations.ts
|
|
160
203
|
var InvitationsModule;
|
|
161
204
|
var init_invitations = __esm(() => {
|
|
@@ -388,6 +431,17 @@ var init_workspaces = __esm(() => {
|
|
|
388
431
|
async deleteApiKey(workspaceId, keyId) {
|
|
389
432
|
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
390
433
|
}
|
|
434
|
+
async getAwsCredentials(workspaceId) {
|
|
435
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-credentials`);
|
|
436
|
+
return data.credential;
|
|
437
|
+
}
|
|
438
|
+
async saveAwsCredentials(workspaceId, body) {
|
|
439
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-credentials`, body);
|
|
440
|
+
return data.credential;
|
|
441
|
+
}
|
|
442
|
+
async deleteAwsCredentials(workspaceId) {
|
|
443
|
+
await this.api.delete(`/workspaces/${workspaceId}/aws-credentials`);
|
|
444
|
+
}
|
|
391
445
|
};
|
|
392
446
|
});
|
|
393
447
|
|
|
@@ -435,6 +489,7 @@ __export(exports_src, {
|
|
|
435
489
|
LocusEmitter: () => LocusEmitter,
|
|
436
490
|
LocusClient: () => LocusClient,
|
|
437
491
|
InvitationsModule: () => InvitationsModule,
|
|
492
|
+
InstancesModule: () => InstancesModule,
|
|
438
493
|
DocsModule: () => DocsModule,
|
|
439
494
|
DiscussionSchema: () => DiscussionSchema,
|
|
440
495
|
DiscussionMessageSchema: () => DiscussionMessageSchema,
|
|
@@ -455,6 +510,7 @@ class LocusClient {
|
|
|
455
510
|
invitations;
|
|
456
511
|
docs;
|
|
457
512
|
ci;
|
|
513
|
+
instances;
|
|
458
514
|
constructor(config) {
|
|
459
515
|
this.emitter = new LocusEmitter;
|
|
460
516
|
this.api = import_axios.default.create({
|
|
@@ -474,6 +530,7 @@ class LocusClient {
|
|
|
474
530
|
this.invitations = new InvitationsModule(this.api, this.emitter);
|
|
475
531
|
this.docs = new DocsModule(this.api, this.emitter);
|
|
476
532
|
this.ci = new CiModule(this.api, this.emitter);
|
|
533
|
+
this.instances = new InstancesModule(this.api, this.emitter);
|
|
477
534
|
if (config.retryOptions) {
|
|
478
535
|
this.setupRetryInterceptor(config.retryOptions);
|
|
479
536
|
}
|
|
@@ -539,6 +596,7 @@ var init_src = __esm(() => {
|
|
|
539
596
|
init_auth();
|
|
540
597
|
init_ci();
|
|
541
598
|
init_docs();
|
|
599
|
+
init_instances();
|
|
542
600
|
init_invitations();
|
|
543
601
|
init_organizations();
|
|
544
602
|
init_sprints();
|
|
@@ -550,6 +608,7 @@ var init_src = __esm(() => {
|
|
|
550
608
|
init_auth();
|
|
551
609
|
init_ci();
|
|
552
610
|
init_docs();
|
|
611
|
+
init_instances();
|
|
553
612
|
init_invitations();
|
|
554
613
|
init_organizations();
|
|
555
614
|
init_sprints();
|
|
@@ -558,6 +617,12 @@ var init_src = __esm(() => {
|
|
|
558
617
|
});
|
|
559
618
|
|
|
560
619
|
// src/core/config.ts
|
|
620
|
+
function isValidModelForProvider(provider, model) {
|
|
621
|
+
return PROVIDER_MODELS[provider].includes(model);
|
|
622
|
+
}
|
|
623
|
+
function getModelsForProvider(provider) {
|
|
624
|
+
return PROVIDER_MODELS[provider];
|
|
625
|
+
}
|
|
561
626
|
function getLocusPath(projectPath, fileName) {
|
|
562
627
|
return import_node_path.join(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG[fileName]);
|
|
563
628
|
}
|
|
@@ -565,16 +630,36 @@ function getAgentArtifactsPath(projectPath, agentId) {
|
|
|
565
630
|
const shortId = agentId.slice(-8);
|
|
566
631
|
return import_node_path.join(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG.artifactsDir, shortId);
|
|
567
632
|
}
|
|
568
|
-
var import_node_path, PROVIDER, DEFAULT_MODEL, LOCUS_SCHEMA_BASE_URL = "https://locusai.dev/schemas", LOCUS_SCHEMAS, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS;
|
|
633
|
+
var import_node_path, PROVIDER, CLAUDE_MODELS, CODEX_MODELS, PROVIDER_MODELS, DEFAULT_MODEL, LOCUS_SCHEMA_BASE_URL = "https://locusai.dev/schemas", LOCUS_SCHEMAS, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS;
|
|
569
634
|
var init_config = __esm(() => {
|
|
570
635
|
import_node_path = require("node:path");
|
|
571
636
|
PROVIDER = {
|
|
572
637
|
CLAUDE: "claude",
|
|
573
638
|
CODEX: "codex"
|
|
574
639
|
};
|
|
640
|
+
CLAUDE_MODELS = {
|
|
641
|
+
OPUS: "opus",
|
|
642
|
+
SONNET: "sonnet",
|
|
643
|
+
HAIKU: "haiku",
|
|
644
|
+
OPUS_PLAN: "opusplan",
|
|
645
|
+
CLAUDE_OPUS_4_6: "claude-opus-4-6",
|
|
646
|
+
CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
|
|
647
|
+
CLAUDE_SONNET_4_6: "claude-sonnet-4-6",
|
|
648
|
+
CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001"
|
|
649
|
+
};
|
|
650
|
+
CODEX_MODELS = {
|
|
651
|
+
GPT_5_3_CODEX: "gpt-5.3-codex",
|
|
652
|
+
GPT_5_3_CODEX_SPARK: "gpt-5.3-codex-spark",
|
|
653
|
+
GPT_5_CODEX_MINI: "gpt-5-codex-mini",
|
|
654
|
+
GPT_5_2_CODEX: "gpt-5.2-codex"
|
|
655
|
+
};
|
|
656
|
+
PROVIDER_MODELS = {
|
|
657
|
+
[PROVIDER.CLAUDE]: Object.values(CLAUDE_MODELS),
|
|
658
|
+
[PROVIDER.CODEX]: Object.values(CODEX_MODELS)
|
|
659
|
+
};
|
|
575
660
|
DEFAULT_MODEL = {
|
|
576
|
-
[PROVIDER.CLAUDE]:
|
|
577
|
-
[PROVIDER.CODEX]:
|
|
661
|
+
[PROVIDER.CLAUDE]: CLAUDE_MODELS.OPUS,
|
|
662
|
+
[PROVIDER.CODEX]: CODEX_MODELS.GPT_5_3_CODEX
|
|
578
663
|
};
|
|
579
664
|
LOCUS_SCHEMAS = {
|
|
580
665
|
config: `${LOCUS_SCHEMA_BASE_URL}/config.schema.json`,
|
|
@@ -1558,6 +1643,10 @@ var init_codex_runner = __esm(() => {
|
|
|
1558
1643
|
function createAiRunner(provider, config) {
|
|
1559
1644
|
const resolvedProvider = provider ?? PROVIDER.CLAUDE;
|
|
1560
1645
|
const model = config.model ?? DEFAULT_MODEL[resolvedProvider];
|
|
1646
|
+
if (!isValidModelForProvider(resolvedProvider, model)) {
|
|
1647
|
+
const validModels = getModelsForProvider(resolvedProvider);
|
|
1648
|
+
throw new Error(`Model "${model}" is not valid for provider "${resolvedProvider}". ` + `Valid models: ${validModels.join(", ")}`);
|
|
1649
|
+
}
|
|
1561
1650
|
switch (resolvedProvider) {
|
|
1562
1651
|
case PROVIDER.CODEX:
|
|
1563
1652
|
return new CodexRunner(config.projectPath, model, config.log, config.reasoningEffort ?? "high", config.timeoutMs);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.test.d.ts","sourceRoot":"","sources":["../../../src/ai/__tests__/factory.test.ts"],"names":[],"mappings":""}
|
package/dist/ai/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/ai/factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/ai/factory.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,KAAK,GAAG,CAClB,OAAO,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,KAC1C,IAAI,CAAC;AAEV,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,UAAU,GAAG,SAAS,EAChC,MAAM,EAAE,cAAc,GACrB,QAAQ,CA8BV"}
|
package/dist/core/config.d.ts
CHANGED
|
@@ -3,7 +3,29 @@ export declare const PROVIDER: {
|
|
|
3
3
|
readonly CODEX: "codex";
|
|
4
4
|
};
|
|
5
5
|
export type Provider = (typeof PROVIDER)[keyof typeof PROVIDER];
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const CLAUDE_MODELS: {
|
|
7
|
+
readonly OPUS: "opus";
|
|
8
|
+
readonly SONNET: "sonnet";
|
|
9
|
+
readonly HAIKU: "haiku";
|
|
10
|
+
readonly OPUS_PLAN: "opusplan";
|
|
11
|
+
readonly CLAUDE_OPUS_4_6: "claude-opus-4-6";
|
|
12
|
+
readonly CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929";
|
|
13
|
+
readonly CLAUDE_SONNET_4_6: "claude-sonnet-4-6";
|
|
14
|
+
readonly CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001";
|
|
15
|
+
};
|
|
16
|
+
export type ClaudeModel = (typeof CLAUDE_MODELS)[keyof typeof CLAUDE_MODELS];
|
|
17
|
+
export declare const CODEX_MODELS: {
|
|
18
|
+
readonly GPT_5_3_CODEX: "gpt-5.3-codex";
|
|
19
|
+
readonly GPT_5_3_CODEX_SPARK: "gpt-5.3-codex-spark";
|
|
20
|
+
readonly GPT_5_CODEX_MINI: "gpt-5-codex-mini";
|
|
21
|
+
readonly GPT_5_2_CODEX: "gpt-5.2-codex";
|
|
22
|
+
};
|
|
23
|
+
export type CodexModel = (typeof CODEX_MODELS)[keyof typeof CODEX_MODELS];
|
|
24
|
+
export type ModelId = ClaudeModel | CodexModel;
|
|
25
|
+
export declare const PROVIDER_MODELS: Record<Provider, readonly ModelId[]>;
|
|
26
|
+
export declare const DEFAULT_MODEL: Record<Provider, ModelId>;
|
|
27
|
+
export declare function isValidModelForProvider(provider: Provider, model: string): boolean;
|
|
28
|
+
export declare function getModelsForProvider(provider: Provider): readonly ModelId[];
|
|
7
29
|
export declare const LOCUS_SCHEMA_BASE_URL = "https://locusai.dev/schemas";
|
|
8
30
|
export declare const LOCUS_SCHEMAS: {
|
|
9
31
|
readonly config: "https://locusai.dev/schemas/config.schema.json";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/core/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAEhE,eAAO,MAAM,aAAa;;;;;;;;;CAShB,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE7E,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AACX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE1E,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;AAE/C,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAGvD,CAAC;AAEX,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAGnD,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,GACZ,OAAO,CAET;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,OAAO,EAAE,CAE3E;AAED,eAAO,MAAM,qBAAqB,gCAAgC,CAAC;AAEnE,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAaxB,CAAC;AAIF,eAAO,MAAM,wBAAwB,gkBAqB3B,CAAC;AAEX,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,OAAO,YAAY,GAClC,MAAM,CAER;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,GACd,MAAM,CASR"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { DEFAULT_MODEL, getAgentArtifactsPath, getLocusPath, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS, LOCUS_SCHEMA_BASE_URL, LOCUS_SCHEMAS, PROVIDER, type Provider, } from "./config.js";
|
|
1
|
+
export { CLAUDE_MODELS, type ClaudeModel, CODEX_MODELS, type CodexModel, DEFAULT_MODEL, getAgentArtifactsPath, getLocusPath, getModelsForProvider, isValidModelForProvider, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS, LOCUS_SCHEMA_BASE_URL, LOCUS_SCHEMAS, type ModelId, PROVIDER, PROVIDER_MODELS, type Provider, } from "./config.js";
|
|
2
2
|
export { type CodebaseIndex, CodebaseIndexer } from "./indexer.js";
|
|
3
3
|
export { PromptBuilder } from "./prompt-builder.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,KAAK,WAAW,EAChB,YAAY,EACZ,KAAK,UAAU,EACf,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EACrB,aAAa,EACb,KAAK,OAAO,EACZ,QAAQ,EACR,eAAe,EACf,KAAK,QAAQ,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index-node.js
CHANGED
|
@@ -156,6 +156,49 @@ var init_docs = __esm(() => {
|
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
// src/modules/instances.ts
|
|
160
|
+
var InstancesModule;
|
|
161
|
+
var init_instances = __esm(() => {
|
|
162
|
+
InstancesModule = class InstancesModule extends BaseModule {
|
|
163
|
+
async list(workspaceId) {
|
|
164
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances`);
|
|
165
|
+
return data.instances;
|
|
166
|
+
}
|
|
167
|
+
async get(workspaceId, instanceId) {
|
|
168
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}`);
|
|
169
|
+
return data.instance;
|
|
170
|
+
}
|
|
171
|
+
async provision(workspaceId, body) {
|
|
172
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances`, body);
|
|
173
|
+
return data.instance;
|
|
174
|
+
}
|
|
175
|
+
async performAction(workspaceId, instanceId, action) {
|
|
176
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/actions`, { action });
|
|
177
|
+
return data.instance;
|
|
178
|
+
}
|
|
179
|
+
async sync(workspaceId, instanceId) {
|
|
180
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/sync`);
|
|
181
|
+
return data.instance;
|
|
182
|
+
}
|
|
183
|
+
async checkUpdates(workspaceId, instanceId) {
|
|
184
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
185
|
+
return data.update;
|
|
186
|
+
}
|
|
187
|
+
async applyUpdate(workspaceId, instanceId) {
|
|
188
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
189
|
+
return data.update;
|
|
190
|
+
}
|
|
191
|
+
async getSecurity(workspaceId, instanceId) {
|
|
192
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`);
|
|
193
|
+
return data.rules;
|
|
194
|
+
}
|
|
195
|
+
async updateSecurity(workspaceId, instanceId, body) {
|
|
196
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`, body);
|
|
197
|
+
return data.rules;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
|
|
159
202
|
// src/modules/invitations.ts
|
|
160
203
|
var InvitationsModule;
|
|
161
204
|
var init_invitations = __esm(() => {
|
|
@@ -388,6 +431,17 @@ var init_workspaces = __esm(() => {
|
|
|
388
431
|
async deleteApiKey(workspaceId, keyId) {
|
|
389
432
|
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
390
433
|
}
|
|
434
|
+
async getAwsCredentials(workspaceId) {
|
|
435
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-credentials`);
|
|
436
|
+
return data.credential;
|
|
437
|
+
}
|
|
438
|
+
async saveAwsCredentials(workspaceId, body) {
|
|
439
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-credentials`, body);
|
|
440
|
+
return data.credential;
|
|
441
|
+
}
|
|
442
|
+
async deleteAwsCredentials(workspaceId) {
|
|
443
|
+
await this.api.delete(`/workspaces/${workspaceId}/aws-credentials`);
|
|
444
|
+
}
|
|
391
445
|
};
|
|
392
446
|
});
|
|
393
447
|
|
|
@@ -435,6 +489,7 @@ __export(exports_src, {
|
|
|
435
489
|
LocusEmitter: () => LocusEmitter,
|
|
436
490
|
LocusClient: () => LocusClient,
|
|
437
491
|
InvitationsModule: () => InvitationsModule,
|
|
492
|
+
InstancesModule: () => InstancesModule,
|
|
438
493
|
DocsModule: () => DocsModule,
|
|
439
494
|
DiscussionSchema: () => DiscussionSchema,
|
|
440
495
|
DiscussionMessageSchema: () => DiscussionMessageSchema,
|
|
@@ -455,6 +510,7 @@ class LocusClient {
|
|
|
455
510
|
invitations;
|
|
456
511
|
docs;
|
|
457
512
|
ci;
|
|
513
|
+
instances;
|
|
458
514
|
constructor(config) {
|
|
459
515
|
this.emitter = new LocusEmitter;
|
|
460
516
|
this.api = import_axios.default.create({
|
|
@@ -474,6 +530,7 @@ class LocusClient {
|
|
|
474
530
|
this.invitations = new InvitationsModule(this.api, this.emitter);
|
|
475
531
|
this.docs = new DocsModule(this.api, this.emitter);
|
|
476
532
|
this.ci = new CiModule(this.api, this.emitter);
|
|
533
|
+
this.instances = new InstancesModule(this.api, this.emitter);
|
|
477
534
|
if (config.retryOptions) {
|
|
478
535
|
this.setupRetryInterceptor(config.retryOptions);
|
|
479
536
|
}
|
|
@@ -539,6 +596,7 @@ var init_src = __esm(() => {
|
|
|
539
596
|
init_auth();
|
|
540
597
|
init_ci();
|
|
541
598
|
init_docs();
|
|
599
|
+
init_instances();
|
|
542
600
|
init_invitations();
|
|
543
601
|
init_organizations();
|
|
544
602
|
init_sprints();
|
|
@@ -550,6 +608,7 @@ var init_src = __esm(() => {
|
|
|
550
608
|
init_auth();
|
|
551
609
|
init_ci();
|
|
552
610
|
init_docs();
|
|
611
|
+
init_instances();
|
|
553
612
|
init_invitations();
|
|
554
613
|
init_organizations();
|
|
555
614
|
init_sprints();
|
|
@@ -558,6 +617,12 @@ var init_src = __esm(() => {
|
|
|
558
617
|
});
|
|
559
618
|
|
|
560
619
|
// src/core/config.ts
|
|
620
|
+
function isValidModelForProvider(provider, model) {
|
|
621
|
+
return PROVIDER_MODELS[provider].includes(model);
|
|
622
|
+
}
|
|
623
|
+
function getModelsForProvider(provider) {
|
|
624
|
+
return PROVIDER_MODELS[provider];
|
|
625
|
+
}
|
|
561
626
|
function getLocusPath(projectPath, fileName) {
|
|
562
627
|
return import_node_path.join(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG[fileName]);
|
|
563
628
|
}
|
|
@@ -565,16 +630,36 @@ function getAgentArtifactsPath(projectPath, agentId) {
|
|
|
565
630
|
const shortId = agentId.slice(-8);
|
|
566
631
|
return import_node_path.join(projectPath, LOCUS_CONFIG.dir, LOCUS_CONFIG.artifactsDir, shortId);
|
|
567
632
|
}
|
|
568
|
-
var import_node_path, PROVIDER, DEFAULT_MODEL, LOCUS_SCHEMA_BASE_URL = "https://locusai.dev/schemas", LOCUS_SCHEMAS, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS;
|
|
633
|
+
var import_node_path, PROVIDER, CLAUDE_MODELS, CODEX_MODELS, PROVIDER_MODELS, DEFAULT_MODEL, LOCUS_SCHEMA_BASE_URL = "https://locusai.dev/schemas", LOCUS_SCHEMAS, LOCUS_CONFIG, LOCUS_GITIGNORE_PATTERNS;
|
|
569
634
|
var init_config = __esm(() => {
|
|
570
635
|
import_node_path = require("node:path");
|
|
571
636
|
PROVIDER = {
|
|
572
637
|
CLAUDE: "claude",
|
|
573
638
|
CODEX: "codex"
|
|
574
639
|
};
|
|
640
|
+
CLAUDE_MODELS = {
|
|
641
|
+
OPUS: "opus",
|
|
642
|
+
SONNET: "sonnet",
|
|
643
|
+
HAIKU: "haiku",
|
|
644
|
+
OPUS_PLAN: "opusplan",
|
|
645
|
+
CLAUDE_OPUS_4_6: "claude-opus-4-6",
|
|
646
|
+
CLAUDE_SONNET_4_5: "claude-sonnet-4-5-20250929",
|
|
647
|
+
CLAUDE_SONNET_4_6: "claude-sonnet-4-6",
|
|
648
|
+
CLAUDE_HAIKU_4_5: "claude-haiku-4-5-20251001"
|
|
649
|
+
};
|
|
650
|
+
CODEX_MODELS = {
|
|
651
|
+
GPT_5_3_CODEX: "gpt-5.3-codex",
|
|
652
|
+
GPT_5_3_CODEX_SPARK: "gpt-5.3-codex-spark",
|
|
653
|
+
GPT_5_CODEX_MINI: "gpt-5-codex-mini",
|
|
654
|
+
GPT_5_2_CODEX: "gpt-5.2-codex"
|
|
655
|
+
};
|
|
656
|
+
PROVIDER_MODELS = {
|
|
657
|
+
[PROVIDER.CLAUDE]: Object.values(CLAUDE_MODELS),
|
|
658
|
+
[PROVIDER.CODEX]: Object.values(CODEX_MODELS)
|
|
659
|
+
};
|
|
575
660
|
DEFAULT_MODEL = {
|
|
576
|
-
[PROVIDER.CLAUDE]:
|
|
577
|
-
[PROVIDER.CODEX]:
|
|
661
|
+
[PROVIDER.CLAUDE]: CLAUDE_MODELS.OPUS,
|
|
662
|
+
[PROVIDER.CODEX]: CODEX_MODELS.GPT_5_3_CODEX
|
|
578
663
|
};
|
|
579
664
|
LOCUS_SCHEMAS = {
|
|
580
665
|
config: `${LOCUS_SCHEMA_BASE_URL}/config.schema.json`,
|
|
@@ -1558,6 +1643,10 @@ var init_codex_runner = __esm(() => {
|
|
|
1558
1643
|
function createAiRunner(provider, config) {
|
|
1559
1644
|
const resolvedProvider = provider ?? PROVIDER.CLAUDE;
|
|
1560
1645
|
const model = config.model ?? DEFAULT_MODEL[resolvedProvider];
|
|
1646
|
+
if (!isValidModelForProvider(resolvedProvider, model)) {
|
|
1647
|
+
const validModels = getModelsForProvider(resolvedProvider);
|
|
1648
|
+
throw new Error(`Model "${model}" is not valid for provider "${resolvedProvider}". ` + `Valid models: ${validModels.join(", ")}`);
|
|
1649
|
+
}
|
|
1561
1650
|
switch (resolvedProvider) {
|
|
1562
1651
|
case PROVIDER.CODEX:
|
|
1563
1652
|
return new CodexRunner(config.projectPath, model, config.log, config.reasoningEffort ?? "high", config.timeoutMs);
|
|
@@ -2746,7 +2835,9 @@ __export(exports_index_node, {
|
|
|
2746
2835
|
plannedTasksToCreatePayloads: () => plannedTasksToCreatePayloads,
|
|
2747
2836
|
parseSprintPlanFromAI: () => parseSprintPlanFromAI,
|
|
2748
2837
|
parseJsonWithSchema: () => parseJsonWithSchema,
|
|
2838
|
+
isValidModelForProvider: () => isValidModelForProvider,
|
|
2749
2839
|
getRemoteUrl: () => getRemoteUrl,
|
|
2840
|
+
getModelsForProvider: () => getModelsForProvider,
|
|
2750
2841
|
getLocusPath: () => getLocusPath,
|
|
2751
2842
|
getDefaultBranch: () => getDefaultBranch,
|
|
2752
2843
|
getCurrentBranch: () => getCurrentBranch,
|
|
@@ -2767,6 +2858,7 @@ __export(exports_index_node, {
|
|
|
2767
2858
|
PrService: () => PrService,
|
|
2768
2859
|
PlanningMeeting: () => PlanningMeeting,
|
|
2769
2860
|
PlanManager: () => PlanManager,
|
|
2861
|
+
PROVIDER_MODELS: () => PROVIDER_MODELS,
|
|
2770
2862
|
PROVIDER: () => PROVIDER,
|
|
2771
2863
|
OrganizationsModule: () => OrganizationsModule,
|
|
2772
2864
|
LocusEvent: () => LocusEvent,
|
|
@@ -2777,6 +2869,7 @@ __export(exports_index_node, {
|
|
|
2777
2869
|
LOCUS_GITIGNORE_PATTERNS: () => LOCUS_GITIGNORE_PATTERNS,
|
|
2778
2870
|
LOCUS_CONFIG: () => LOCUS_CONFIG,
|
|
2779
2871
|
InvitationsModule: () => InvitationsModule,
|
|
2872
|
+
InstancesModule: () => InstancesModule,
|
|
2780
2873
|
HistoryManager: () => HistoryManager,
|
|
2781
2874
|
GitWorkflow: () => GitWorkflow,
|
|
2782
2875
|
ExecSession: () => ExecSession,
|
|
@@ -2796,6 +2889,8 @@ __export(exports_index_node, {
|
|
|
2796
2889
|
CodebaseIndexer: () => CodebaseIndexer,
|
|
2797
2890
|
ClaudeRunner: () => ClaudeRunner,
|
|
2798
2891
|
CiModule: () => CiModule,
|
|
2892
|
+
CODEX_MODELS: () => CODEX_MODELS,
|
|
2893
|
+
CLAUDE_MODELS: () => CLAUDE_MODELS,
|
|
2799
2894
|
AuthModule: () => AuthModule,
|
|
2800
2895
|
AgentWorker: () => AgentWorker,
|
|
2801
2896
|
AgentOrchestrator: () => AgentOrchestrator
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { LocusConfig, LocusEmitter } from "./events.js";
|
|
|
2
2
|
import { AuthModule } from "./modules/auth.js";
|
|
3
3
|
import { CiModule } from "./modules/ci.js";
|
|
4
4
|
import { DocsModule } from "./modules/docs.js";
|
|
5
|
+
import { InstancesModule } from "./modules/instances.js";
|
|
5
6
|
import { InvitationsModule } from "./modules/invitations.js";
|
|
6
7
|
import { OrganizationsModule } from "./modules/organizations.js";
|
|
7
8
|
import { SprintsModule } from "./modules/sprints.js";
|
|
@@ -13,6 +14,7 @@ export * from "./events.js";
|
|
|
13
14
|
export * from "./modules/auth.js";
|
|
14
15
|
export * from "./modules/ci.js";
|
|
15
16
|
export * from "./modules/docs.js";
|
|
17
|
+
export * from "./modules/instances.js";
|
|
16
18
|
export * from "./modules/invitations.js";
|
|
17
19
|
export * from "./modules/organizations.js";
|
|
18
20
|
export * from "./modules/sprints.js";
|
|
@@ -29,6 +31,7 @@ export declare class LocusClient {
|
|
|
29
31
|
readonly invitations: InvitationsModule;
|
|
30
32
|
readonly docs: DocsModule;
|
|
31
33
|
readonly ci: CiModule;
|
|
34
|
+
readonly instances: InstancesModule;
|
|
32
35
|
constructor(config: LocusConfig);
|
|
33
36
|
private setupRetryInterceptor;
|
|
34
37
|
private setupInter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AAO,CAAC,QAAQ,CAAC,GAAG,CAAgB;IACpC,SAAgB,OAAO,EAAE,YAAY,CAAC;IAEtC,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,KAAK,EAAE,WAAW,CAAC;IACnC,SAAgB,OAAO,EAAE,aAAa,CAAC;IACvC,SAAgB,UAAU,EAAE,gBAAgB,CAAC;IAC7C,SAAgB,aAAa,EAAE,mBAAmB,CAAC;IACnD,SAAgB,WAAW,EAAE,iBAAiB,CAAC;IAC/C,SAAgB,IAAI,EAAE,UAAU,CAAC;IACjC,SAAgB,EAAE,EAAE,QAAQ,CAAC;IAC7B,SAAgB,SAAS,EAAE,eAAe,CAAC;gBAE/B,MAAM,EAAE,WAAW;IA8B/B,OAAO,CAAC,qBAAqB;IAmC7B,OAAO,CAAC,iBAAiB;IAmDlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;CAOrC"}
|
package/dist/index.js
CHANGED
|
@@ -156,6 +156,49 @@ var init_docs = __esm(() => {
|
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
|
|
159
|
+
// src/modules/instances.ts
|
|
160
|
+
var InstancesModule;
|
|
161
|
+
var init_instances = __esm(() => {
|
|
162
|
+
InstancesModule = class InstancesModule extends BaseModule {
|
|
163
|
+
async list(workspaceId) {
|
|
164
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances`);
|
|
165
|
+
return data.instances;
|
|
166
|
+
}
|
|
167
|
+
async get(workspaceId, instanceId) {
|
|
168
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}`);
|
|
169
|
+
return data.instance;
|
|
170
|
+
}
|
|
171
|
+
async provision(workspaceId, body) {
|
|
172
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances`, body);
|
|
173
|
+
return data.instance;
|
|
174
|
+
}
|
|
175
|
+
async performAction(workspaceId, instanceId, action) {
|
|
176
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/actions`, { action });
|
|
177
|
+
return data.instance;
|
|
178
|
+
}
|
|
179
|
+
async sync(workspaceId, instanceId) {
|
|
180
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/sync`);
|
|
181
|
+
return data.instance;
|
|
182
|
+
}
|
|
183
|
+
async checkUpdates(workspaceId, instanceId) {
|
|
184
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
185
|
+
return data.update;
|
|
186
|
+
}
|
|
187
|
+
async applyUpdate(workspaceId, instanceId) {
|
|
188
|
+
const { data } = await this.api.post(`/workspaces/${workspaceId}/aws-instances/${instanceId}/updates`);
|
|
189
|
+
return data.update;
|
|
190
|
+
}
|
|
191
|
+
async getSecurity(workspaceId, instanceId) {
|
|
192
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`);
|
|
193
|
+
return data.rules;
|
|
194
|
+
}
|
|
195
|
+
async updateSecurity(workspaceId, instanceId, body) {
|
|
196
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-instances/${instanceId}/security`, body);
|
|
197
|
+
return data.rules;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
});
|
|
201
|
+
|
|
159
202
|
// src/modules/invitations.ts
|
|
160
203
|
var InvitationsModule;
|
|
161
204
|
var init_invitations = __esm(() => {
|
|
@@ -388,6 +431,17 @@ var init_workspaces = __esm(() => {
|
|
|
388
431
|
async deleteApiKey(workspaceId, keyId) {
|
|
389
432
|
await this.api.delete(`/workspaces/${workspaceId}/api-keys/${keyId}`);
|
|
390
433
|
}
|
|
434
|
+
async getAwsCredentials(workspaceId) {
|
|
435
|
+
const { data } = await this.api.get(`/workspaces/${workspaceId}/aws-credentials`);
|
|
436
|
+
return data.credential;
|
|
437
|
+
}
|
|
438
|
+
async saveAwsCredentials(workspaceId, body) {
|
|
439
|
+
const { data } = await this.api.put(`/workspaces/${workspaceId}/aws-credentials`, body);
|
|
440
|
+
return data.credential;
|
|
441
|
+
}
|
|
442
|
+
async deleteAwsCredentials(workspaceId) {
|
|
443
|
+
await this.api.delete(`/workspaces/${workspaceId}/aws-credentials`);
|
|
444
|
+
}
|
|
391
445
|
};
|
|
392
446
|
});
|
|
393
447
|
|
|
@@ -435,6 +489,7 @@ __export(exports_src, {
|
|
|
435
489
|
LocusEmitter: () => LocusEmitter,
|
|
436
490
|
LocusClient: () => LocusClient,
|
|
437
491
|
InvitationsModule: () => InvitationsModule,
|
|
492
|
+
InstancesModule: () => InstancesModule,
|
|
438
493
|
DocsModule: () => DocsModule,
|
|
439
494
|
DiscussionSchema: () => DiscussionSchema,
|
|
440
495
|
DiscussionMessageSchema: () => DiscussionMessageSchema,
|
|
@@ -455,6 +510,7 @@ class LocusClient {
|
|
|
455
510
|
invitations;
|
|
456
511
|
docs;
|
|
457
512
|
ci;
|
|
513
|
+
instances;
|
|
458
514
|
constructor(config) {
|
|
459
515
|
this.emitter = new LocusEmitter;
|
|
460
516
|
this.api = import_axios.default.create({
|
|
@@ -474,6 +530,7 @@ class LocusClient {
|
|
|
474
530
|
this.invitations = new InvitationsModule(this.api, this.emitter);
|
|
475
531
|
this.docs = new DocsModule(this.api, this.emitter);
|
|
476
532
|
this.ci = new CiModule(this.api, this.emitter);
|
|
533
|
+
this.instances = new InstancesModule(this.api, this.emitter);
|
|
477
534
|
if (config.retryOptions) {
|
|
478
535
|
this.setupRetryInterceptor(config.retryOptions);
|
|
479
536
|
}
|
|
@@ -539,6 +596,7 @@ var init_src = __esm(() => {
|
|
|
539
596
|
init_auth();
|
|
540
597
|
init_ci();
|
|
541
598
|
init_docs();
|
|
599
|
+
init_instances();
|
|
542
600
|
init_invitations();
|
|
543
601
|
init_organizations();
|
|
544
602
|
init_sprints();
|
|
@@ -550,6 +608,7 @@ var init_src = __esm(() => {
|
|
|
550
608
|
init_auth();
|
|
551
609
|
init_ci();
|
|
552
610
|
init_docs();
|
|
611
|
+
init_instances();
|
|
553
612
|
init_invitations();
|
|
554
613
|
init_organizations();
|
|
555
614
|
init_sprints();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type InstanceAction, type ProvisionAwsInstance, type UpdateSecurityRules } from "@locusai/shared";
|
|
2
|
+
import { BaseModule } from "./base.js";
|
|
3
|
+
export interface InstanceInfo {
|
|
4
|
+
id: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
awsCredentialId: string;
|
|
7
|
+
ec2InstanceId: string | null;
|
|
8
|
+
status: string;
|
|
9
|
+
instanceType: string;
|
|
10
|
+
region: string;
|
|
11
|
+
publicIp: string | null;
|
|
12
|
+
repoUrl: string;
|
|
13
|
+
integrations: unknown[];
|
|
14
|
+
securityGroupId: string | null;
|
|
15
|
+
errorMessage: string | null;
|
|
16
|
+
launchedAt: string | null;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
}
|
|
20
|
+
export interface UpdateCheckInfo {
|
|
21
|
+
currentVersion: string;
|
|
22
|
+
latestVersion: string;
|
|
23
|
+
updateAvailable: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface UpdateApplyInfo {
|
|
26
|
+
success: boolean;
|
|
27
|
+
newVersion: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SecurityRuleInfo {
|
|
31
|
+
port: number;
|
|
32
|
+
cidr: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare class InstancesModule extends BaseModule {
|
|
36
|
+
list(workspaceId: string): Promise<InstanceInfo[]>;
|
|
37
|
+
get(workspaceId: string, instanceId: string): Promise<InstanceInfo>;
|
|
38
|
+
provision(workspaceId: string, body: ProvisionAwsInstance): Promise<InstanceInfo>;
|
|
39
|
+
performAction(workspaceId: string, instanceId: string, action: InstanceAction): Promise<InstanceInfo>;
|
|
40
|
+
sync(workspaceId: string, instanceId: string): Promise<InstanceInfo>;
|
|
41
|
+
checkUpdates(workspaceId: string, instanceId: string): Promise<UpdateCheckInfo>;
|
|
42
|
+
applyUpdate(workspaceId: string, instanceId: string): Promise<UpdateApplyInfo>;
|
|
43
|
+
getSecurity(workspaceId: string, instanceId: string): Promise<SecurityRuleInfo[]>;
|
|
44
|
+
updateSecurity(workspaceId: string, instanceId: string, body: UpdateSecurityRules): Promise<SecurityRuleInfo[]>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=instances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/modules/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,E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;
|
|
30
30
|
createApiKey(workspaceId: string, name: string): Promise<WorkspaceApiKey>;
|
|
31
31
|
deleteApiKey(workspaceId: string, keyId: string): Promise<void>;
|
|
32
|
+
getAwsCredentials(workspaceId: string): Promise<AwsCredentialInfo>;
|
|
33
|
+
saveAwsCredentials(workspaceId: string, body: SaveAwsCredentialsInput): Promise<AwsCredentialInfo>;
|
|
34
|
+
deleteAwsCredentials(workspaceId: string): Promise<void>;
|
|
32
35
|
}
|
|
33
36
|
export interface WorkspaceApiKey {
|
|
34
37
|
id: string;
|
|
@@ -41,4 +44,16 @@ export interface WorkspaceApiKey {
|
|
|
41
44
|
createdAt: string;
|
|
42
45
|
updatedAt: string;
|
|
43
46
|
}
|
|
47
|
+
export interface AwsCredentialInfo {
|
|
48
|
+
id: string;
|
|
49
|
+
accessKeyId?: string;
|
|
50
|
+
region: string;
|
|
51
|
+
createdAt: string;
|
|
52
|
+
updatedAt?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface SaveAwsCredentialsInput {
|
|
55
|
+
accessKeyId: string;
|
|
56
|
+
secretAccessKey: string;
|
|
57
|
+
region: string;
|
|
58
|
+
}
|
|
44
59
|
//# sourceMappingURL=workspaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../src/modules/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,qBAAqB,EAErB,eAAe,EACf,KAAK,EACL,IAAI,EAEJ,eAAe,EACf,SAAS,EAET,cAAc,EAEf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,qBAAa,gBAAiB,SAAQ,UAAU;IACxC,OAAO,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IAK/B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAO9C,MAAM,CAAC,IAAI,EAAE,eAAe,GAAG;QAAE,K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;CACpB;AAMD,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
package/dist/utils/retry.d.ts
CHANGED
|
@@ -5,9 +5,4 @@ export interface RetryOptions {
|
|
|
5
5
|
factor?: number;
|
|
6
6
|
retryCondition?: (error: unknown) => boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const DEFAULT_RETRY_OPTIONS: Required<RetryOptions>;
|
|
9
|
-
/**
|
|
10
|
-
* Retries an async function with exponential backoff
|
|
11
|
-
*/
|
|
12
|
-
export declare function withRetry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
13
8
|
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusai/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -26,11 +26,12 @@
|
|
|
26
26
|
"build": "bun build ./src/index.ts ./src/index-node.ts ./src/agent/worker.ts --outdir ./dist --target node --format cjs --external axios --external events --external globby --external @locusai/shared --external zod && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
27
27
|
"dev": "tsc --watch",
|
|
28
28
|
"lint": "biome lint .",
|
|
29
|
+
"test": "bun test",
|
|
29
30
|
"typecheck": "tsc --noEmit",
|
|
30
31
|
"clean": "rm -rf node_modules"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"@locusai/shared": "^0.
|
|
34
|
+
"@locusai/shared": "^0.14.0",
|
|
34
35
|
"axios": "^1.13.2",
|
|
35
36
|
"events": "^3.3.0",
|
|
36
37
|
"globby": "^14.0.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-pool.d.ts","sourceRoot":"","sources":["../../src/orchestrator/agent-pool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/orchestrator/execution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tier-merge.d.ts","sourceRoot":"","sources":["../../src/orchestrator/tier-merge.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC"}
|