@solidnumber/cli 2.27.0 → 2.28.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/CHANGELOG.md +73 -0
- package/README.md +61 -32
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +64 -14
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/code.d.ts.map +1 -1
- package/dist/commands/code.js +13 -8
- package/dist/commands/code.js.map +1 -1
- package/dist/commands/find.d.ts +5 -0
- package/dist/commands/find.d.ts.map +1 -1
- package/dist/commands/find.js +48 -11
- package/dist/commands/find.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +10 -6
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/notes.d.ts.map +1 -1
- package/dist/commands/notes.js +16 -10
- package/dist/commands/notes.js.map +1 -1
- package/dist/commands/verbs.d.ts.map +1 -1
- package/dist/commands/verbs.js +93 -1
- package/dist/commands/verbs.js.map +1 -1
- package/dist/lib/api-client.d.ts +2 -0
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +97 -92
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/find-answer.d.ts +42 -0
- package/dist/lib/find-answer.d.ts.map +1 -0
- package/dist/lib/find-answer.js +59 -0
- package/dist/lib/find-answer.js.map +1 -0
- package/dist/lib/output-contract.d.ts +70 -0
- package/dist/lib/output-contract.d.ts.map +1 -0
- package/dist/lib/output-contract.js +83 -0
- package/dist/lib/output-contract.js.map +1 -0
- package/dist/lib/sandbox-verbs.d.ts +4 -5
- package/dist/lib/sandbox-verbs.d.ts.map +1 -1
- package/dist/lib/sandbox-verbs.js +10 -17
- package/dist/lib/sandbox-verbs.js.map +1 -1
- package/dist/lib/verb-envelope.d.ts +43 -0
- package/dist/lib/verb-envelope.d.ts.map +1 -0
- package/dist/lib/verb-envelope.js +71 -0
- package/dist/lib/verb-envelope.js.map +1 -0
- package/dist/lib/verb-snapshot.d.ts +8 -3
- package/dist/lib/verb-snapshot.d.ts.map +1 -1
- package/dist/lib/verb-snapshot.js +31 -13
- package/dist/lib/verb-snapshot.js.map +1 -1
- package/package.json +1 -1
- package/platform-docs/llms.txt +5 -5
package/dist/lib/api-client.js
CHANGED
|
@@ -57,6 +57,11 @@ const config_1 = require("./config");
|
|
|
57
57
|
const dry_run_1 = require("./dry-run");
|
|
58
58
|
const offline_queue_1 = require("./offline-queue");
|
|
59
59
|
const list_envelope_1 = require("./list-envelope");
|
|
60
|
+
const output_contract_1 = require("./output-contract");
|
|
61
|
+
function receiptOf(headers) {
|
|
62
|
+
const ref = (0, output_contract_1.receiptRefOf)(headers);
|
|
63
|
+
return ref ? { receipt: ref } : {};
|
|
64
|
+
}
|
|
60
65
|
const version_skew_1 = require("./version-skew");
|
|
61
66
|
// Resolve our package version once. Used for the X-Solid-CLI-Version header
|
|
62
67
|
// on every outbound request so the backend can log/compare CLI clients.
|
|
@@ -574,7 +579,7 @@ class ApiClient {
|
|
|
574
579
|
// Generic HTTP methods (used by droplet, dev, etc.)
|
|
575
580
|
async get(url, options) {
|
|
576
581
|
const response = await this.client.get(url, options);
|
|
577
|
-
return { data: response.data, status: response.status, success: true };
|
|
582
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
578
583
|
}
|
|
579
584
|
// Dry-run interception happens at the request-interceptor layer —
|
|
580
585
|
// every mutation (incl. those using this.client.* directly) is caught.
|
|
@@ -584,15 +589,15 @@ class ApiClient {
|
|
|
584
589
|
// per-call key (stable across internal retries only). See the interceptor.
|
|
585
590
|
async post(url, data, options) {
|
|
586
591
|
const response = await this.client.post(url, data, idempotencyConfig(options));
|
|
587
|
-
return { data: response.data, status: response.status, success: true };
|
|
592
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
588
593
|
}
|
|
589
594
|
async put(url, data, options) {
|
|
590
595
|
const response = await this.client.put(url, data, idempotencyConfig(options));
|
|
591
|
-
return { data: response.data, status: response.status, success: true };
|
|
596
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
592
597
|
}
|
|
593
598
|
async patch(url, data, options) {
|
|
594
599
|
const response = await this.client.patch(url, data, idempotencyConfig(options));
|
|
595
|
-
return { data: response.data, status: response.status, success: true };
|
|
600
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
596
601
|
}
|
|
597
602
|
async delete(url, options) {
|
|
598
603
|
const response = await this.client.delete(url, {
|
|
@@ -600,7 +605,7 @@ class ApiClient {
|
|
|
600
605
|
...(options?.data !== undefined ? { data: options.data } : {}),
|
|
601
606
|
...idempotencyConfig(options),
|
|
602
607
|
});
|
|
603
|
-
return { data: response.data, status: response.status, success: true };
|
|
608
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
604
609
|
}
|
|
605
610
|
// Auth endpoints
|
|
606
611
|
async login(email, password) {
|
|
@@ -608,7 +613,7 @@ class ApiClient {
|
|
|
608
613
|
email,
|
|
609
614
|
password,
|
|
610
615
|
});
|
|
611
|
-
return { data: response.data, status: response.status, success: true };
|
|
616
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
612
617
|
}
|
|
613
618
|
async authStatus() {
|
|
614
619
|
try {
|
|
@@ -623,80 +628,80 @@ class ApiClient {
|
|
|
623
628
|
// Health endpoints
|
|
624
629
|
async healthQuick() {
|
|
625
630
|
const response = await this.client.get('/api/v1/healthcheck/quick');
|
|
626
|
-
return { data: response.data, status: response.status, success: true };
|
|
631
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
627
632
|
}
|
|
628
633
|
async healthFull() {
|
|
629
634
|
const response = await this.client.get('/api/v1/health');
|
|
630
|
-
return { data: response.data, status: response.status, success: true };
|
|
635
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
631
636
|
}
|
|
632
637
|
async healthMcp() {
|
|
633
638
|
const response = await this.client.get('/api/v1/healthcheck/mcp');
|
|
634
|
-
return { data: response.data, status: response.status, success: true };
|
|
639
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
635
640
|
}
|
|
636
641
|
// Integration endpoints
|
|
637
642
|
async integrationsCatalog() {
|
|
638
643
|
const response = await this.client.get('/api/v1/vibe/integrations/catalog');
|
|
639
|
-
return { data: response.data, status: response.status, success: true };
|
|
644
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
640
645
|
}
|
|
641
646
|
async integrationsList(status) {
|
|
642
647
|
const params = status ? { status } : {};
|
|
643
648
|
const response = await this.client.get('/api/v1/vibe/integrations/', { params });
|
|
644
|
-
return { data: response.data, status: response.status, success: true };
|
|
649
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
645
650
|
}
|
|
646
651
|
async integrationsHealth() {
|
|
647
652
|
const response = await this.client.get('/api/v1/vibe/integrations/health');
|
|
648
|
-
return { data: response.data, status: response.status, success: true };
|
|
653
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
649
654
|
}
|
|
650
655
|
async integrationsGenerate(params) {
|
|
651
656
|
const response = await this.client.post('/api/v1/vibe/integrations/generate', params);
|
|
652
|
-
return { data: response.data, status: response.status, success: true };
|
|
657
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
653
658
|
}
|
|
654
659
|
async integrationsValidate(integrationId) {
|
|
655
660
|
const response = await this.client.post(`/api/v1/vibe/integrations/validate/${integrationId}`);
|
|
656
|
-
return { data: response.data, status: response.status, success: true };
|
|
661
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
657
662
|
}
|
|
658
663
|
async integrationsTest(integrationId, testParams) {
|
|
659
664
|
const response = await this.client.post(`/api/v1/vibe/integrations/test/${integrationId}`, {
|
|
660
665
|
test_params: testParams || {},
|
|
661
666
|
});
|
|
662
|
-
return { data: response.data, status: response.status, success: true };
|
|
667
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
663
668
|
}
|
|
664
669
|
async integrationsDeploy(integrationId) {
|
|
665
670
|
const response = await this.client.post(`/api/v1/vibe/integrations/deploy/${integrationId}`);
|
|
666
|
-
return { data: response.data, status: response.status, success: true };
|
|
671
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
667
672
|
}
|
|
668
673
|
async integrationsDisable(integrationId, reason) {
|
|
669
674
|
const response = await this.client.post(`/api/v1/vibe/integrations/disable/${integrationId}`, { reason });
|
|
670
|
-
return { data: response.data, status: response.status, success: true };
|
|
675
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
671
676
|
}
|
|
672
677
|
async integrationsRollback(integrationId, reason) {
|
|
673
678
|
const response = await this.client.post(`/api/v1/vibe/integrations/rollback/${integrationId}`, { reason });
|
|
674
|
-
return { data: response.data, status: response.status, success: true };
|
|
679
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
675
680
|
}
|
|
676
681
|
async integrationsLogs(integrationId, limit = 100) {
|
|
677
682
|
const response = await this.client.get(`/api/v1/vibe/integrations/${integrationId}/logs`, {
|
|
678
683
|
params: { limit },
|
|
679
684
|
});
|
|
680
|
-
return { data: response.data, status: response.status, success: true };
|
|
685
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
681
686
|
}
|
|
682
687
|
// Vibe endpoints
|
|
683
688
|
async vibeAnalyze(prompt) {
|
|
684
689
|
const response = await this.client.post('/api/v1/vibe/analyze', { prompt });
|
|
685
|
-
return { data: response.data, status: response.status, success: true };
|
|
690
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
686
691
|
}
|
|
687
692
|
async vibeApply(previewId) {
|
|
688
693
|
const response = await this.client.post('/api/v1/vibe/apply', {
|
|
689
694
|
preview_id: previewId,
|
|
690
695
|
confirm: true,
|
|
691
696
|
});
|
|
692
|
-
return { data: response.data, status: response.status, success: true };
|
|
697
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
693
698
|
}
|
|
694
699
|
// Company info
|
|
695
700
|
async companyInfo() {
|
|
696
701
|
const response = await this.client.post('/api/v1/rpc/Company/info', {
|
|
697
702
|
query: { id: config_1.config.companyId },
|
|
698
703
|
});
|
|
699
|
-
return { data: response.data, status: response.status, success: true };
|
|
704
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
700
705
|
}
|
|
701
706
|
// KB endpoints (via REST API)
|
|
702
707
|
async kbSearch(query, limit = 20, offset = 0) {
|
|
@@ -731,7 +736,7 @@ class ApiClient {
|
|
|
731
736
|
// CMS Pages
|
|
732
737
|
async pagesList(params) {
|
|
733
738
|
const response = await this.client.get('/api/v1/cms/pages', { params });
|
|
734
|
-
return { data: response.data, status: response.status, success: true };
|
|
739
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
735
740
|
}
|
|
736
741
|
async pagesPublish(pageId) {
|
|
737
742
|
// The endpoint takes a required WebsitePagePublish body (generate_mcp,
|
|
@@ -740,16 +745,16 @@ class ApiClient {
|
|
|
740
745
|
// all made FastAPI report a missing required field, and `solid pages
|
|
741
746
|
// publish` returned 422 for every tenant, on every page.
|
|
742
747
|
const response = await this.client.post(`/api/v1/cms/pages/${pageId}/publish`, {});
|
|
743
|
-
return { data: response.data, status: response.status, success: true };
|
|
748
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
744
749
|
}
|
|
745
750
|
async pagesUnpublish(pageId) {
|
|
746
751
|
const response = await this.client.post(`/api/v1/cms/pages/${pageId}/unpublish`);
|
|
747
|
-
return { data: response.data, status: response.status, success: true };
|
|
752
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
748
753
|
}
|
|
749
754
|
// Services
|
|
750
755
|
async servicesList() {
|
|
751
756
|
const response = await this.client.get(`/api/v1/services/catalog`);
|
|
752
|
-
return { data: response.data, status: response.status, success: true };
|
|
757
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
753
758
|
}
|
|
754
759
|
// Products
|
|
755
760
|
async productsList(params) {
|
|
@@ -757,7 +762,7 @@ class ApiClient {
|
|
|
757
762
|
const response = await this.client.get(`/api/v1/cms/public/products`, {
|
|
758
763
|
params: { company_id: companyId, ...params },
|
|
759
764
|
});
|
|
760
|
-
return { data: response.data, status: response.status, success: true };
|
|
765
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
761
766
|
}
|
|
762
767
|
// Website settings update
|
|
763
768
|
async updateWebsiteSettings(settings) {
|
|
@@ -765,31 +770,31 @@ class ApiClient {
|
|
|
765
770
|
const response = await this.client.patch(`/api/v1/companies/${companyId}`, {
|
|
766
771
|
website_settings: settings,
|
|
767
772
|
});
|
|
768
|
-
return { data: response.data, status: response.status, success: true };
|
|
773
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
769
774
|
}
|
|
770
775
|
// Single page (full detail with layout_json)
|
|
771
776
|
async pageGet(pageId) {
|
|
772
777
|
const response = await this.client.get(`/api/v1/cms/pages/${pageId}`);
|
|
773
|
-
return { data: response.data, status: response.status, success: true };
|
|
778
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
774
779
|
}
|
|
775
780
|
// Update page
|
|
776
781
|
async pageUpdate(pageId, data) {
|
|
777
782
|
const response = await this.client.patch(`/api/v1/cms/pages/${pageId}`, data);
|
|
778
|
-
return { data: response.data, status: response.status, success: true };
|
|
783
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
779
784
|
}
|
|
780
785
|
// Create page
|
|
781
786
|
async pageCreate(data) {
|
|
782
787
|
const response = await this.client.post(`/api/v1/cms/pages`, data);
|
|
783
|
-
return { data: response.data, status: response.status, success: true };
|
|
788
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
784
789
|
}
|
|
785
790
|
// Sites (solid site)
|
|
786
791
|
async sitesList() {
|
|
787
792
|
const response = await this.client.get('/api/v1/sites');
|
|
788
|
-
return { data: response.data, status: response.status, success: true };
|
|
793
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
789
794
|
}
|
|
790
795
|
async siteGet(siteId) {
|
|
791
796
|
const response = await this.client.get(`/api/v1/sites/${siteId}`);
|
|
792
|
-
return { data: response.data, status: response.status, success: true };
|
|
797
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
793
798
|
}
|
|
794
799
|
async siteCreate(slug, template, name, isLive) {
|
|
795
800
|
const response = await this.client.post('/api/v1/sites', {
|
|
@@ -798,20 +803,20 @@ class ApiClient {
|
|
|
798
803
|
name: name || undefined,
|
|
799
804
|
is_live: isLive ?? false,
|
|
800
805
|
});
|
|
801
|
-
return { data: response.data, status: response.status, success: true };
|
|
806
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
802
807
|
}
|
|
803
808
|
async siteDelete(siteId) {
|
|
804
809
|
const response = await this.client.delete(`/api/v1/sites/${siteId}`);
|
|
805
|
-
return { data: response.data, status: response.status, success: true };
|
|
810
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
806
811
|
}
|
|
807
812
|
async siteTemplates() {
|
|
808
813
|
const response = await this.client.get('/api/v1/sites/templates');
|
|
809
|
-
return { data: response.data, status: response.status, success: true };
|
|
814
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
810
815
|
}
|
|
811
816
|
// Page management (additional)
|
|
812
817
|
async pageDelete(pageId) {
|
|
813
818
|
const response = await this.client.delete(`/api/v1/cms/pages/${pageId}`);
|
|
814
|
-
return { data: response.data, status: response.status, success: true };
|
|
819
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
815
820
|
}
|
|
816
821
|
// AI Chat (talk to agents)
|
|
817
822
|
async agentChat(message, agentName = 'sarah') {
|
|
@@ -819,105 +824,105 @@ class ApiClient {
|
|
|
819
824
|
message,
|
|
820
825
|
agent: agentName,
|
|
821
826
|
});
|
|
822
|
-
return { data: response.data, status: response.status, success: true };
|
|
827
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
823
828
|
}
|
|
824
829
|
// Templates (solid clone)
|
|
825
830
|
async templatesList() {
|
|
826
831
|
const response = await this.client.get('/api/v1/cli/templates/');
|
|
827
|
-
return { data: response.data, status: response.status, success: true };
|
|
832
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
828
833
|
}
|
|
829
834
|
async templatePreview(name) {
|
|
830
835
|
const response = await this.client.get(`/api/v1/cli/templates/${name}`);
|
|
831
|
-
return { data: response.data, status: response.status, success: true };
|
|
836
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
832
837
|
}
|
|
833
838
|
async templateClone(name) {
|
|
834
839
|
const response = await this.client.post(`/api/v1/cli/templates/${name}/clone`);
|
|
835
|
-
return { data: response.data, status: response.status, success: true };
|
|
840
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
836
841
|
}
|
|
837
842
|
// Multi-company (CLI Agency)
|
|
838
843
|
async companiesList() {
|
|
839
844
|
const response = await this.client.get('/api/v1/cli/companies/');
|
|
840
|
-
return { data: response.data, status: response.status, success: true };
|
|
845
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
841
846
|
}
|
|
842
847
|
async companyCreate(name, template, industry) {
|
|
843
848
|
const response = await this.client.post('/api/v1/cli/companies/', { name, template, industry });
|
|
844
|
-
return { data: response.data, status: response.status, success: true };
|
|
849
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
845
850
|
}
|
|
846
851
|
async companySwitch(companyId) {
|
|
847
852
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/switch`);
|
|
848
|
-
return { data: response.data, status: response.status, success: true };
|
|
853
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
849
854
|
}
|
|
850
855
|
async companyMembers(companyId) {
|
|
851
856
|
const response = await this.client.get(`/api/v1/cli/companies/${companyId}/members`);
|
|
852
|
-
return { data: response.data, status: response.status, success: true };
|
|
857
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
853
858
|
}
|
|
854
859
|
async companyMemberRevoke(companyId, userId) {
|
|
855
860
|
const response = await this.client.delete(`/api/v1/cli/companies/${companyId}/members/${userId}`);
|
|
856
|
-
return { data: response.data, status: response.status, success: true };
|
|
861
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
857
862
|
}
|
|
858
863
|
async companyInvite(companyId, email, role = 'developer') {
|
|
859
864
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/invite`, { email, role });
|
|
860
|
-
return { data: response.data, status: response.status, success: true };
|
|
865
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
861
866
|
}
|
|
862
867
|
// ── T10 — Agency-managed companies + design-lock ─────────────────
|
|
863
868
|
async companyCreateForClient(payload) {
|
|
864
869
|
const response = await this.client.post('/api/v1/cli/companies/for-client', payload);
|
|
865
|
-
return { data: response.data, status: response.status, success: true };
|
|
870
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
866
871
|
}
|
|
867
872
|
async companyLockStatus(companyId) {
|
|
868
873
|
const response = await this.client.get(`/api/v1/cli/companies/${companyId}/lock-status`);
|
|
869
|
-
return { data: response.data, status: response.status, success: true };
|
|
874
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
870
875
|
}
|
|
871
876
|
async companyLock(companyId, areas) {
|
|
872
877
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/lock`, { areas });
|
|
873
|
-
return { data: response.data, status: response.status, success: true };
|
|
878
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
874
879
|
}
|
|
875
880
|
async companyUnlock(companyId, areas, all = false) {
|
|
876
881
|
const body = { all };
|
|
877
882
|
if (!all)
|
|
878
883
|
body.areas = areas;
|
|
879
884
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/unlock`, body);
|
|
880
|
-
return { data: response.data, status: response.status, success: true };
|
|
885
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
881
886
|
}
|
|
882
887
|
// ── SPRINT-AGENT-FIREWALL — agent identities, quarantine, reputation ──
|
|
883
888
|
async agentIdentityList(includeRevoked = false) {
|
|
884
889
|
const response = await this.client.get('/api/v1/agent/identities', { params: includeRevoked ? { include_revoked: true } : {} });
|
|
885
|
-
return { data: response.data, status: response.status, success: true };
|
|
890
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
886
891
|
}
|
|
887
892
|
async agentIdentityCreate(body) {
|
|
888
893
|
const response = await this.client.post('/api/v1/agent/identities', body);
|
|
889
|
-
return { data: response.data, status: response.status, success: true };
|
|
894
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
890
895
|
}
|
|
891
896
|
async agentIdentityRevoke(id) {
|
|
892
897
|
const response = await this.client.delete(`/api/v1/agent/identities/${id}`);
|
|
893
|
-
return { data: response.data, status: response.status, success: true };
|
|
898
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
894
899
|
}
|
|
895
900
|
async agentIdentityQuarantine(id, reason) {
|
|
896
901
|
const response = await this.client.post(`/api/v1/agent/identities/${id}/quarantine`, { reason });
|
|
897
|
-
return { data: response.data, status: response.status, success: true };
|
|
902
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
898
903
|
}
|
|
899
904
|
async agentIdentityRelease(id) {
|
|
900
905
|
const response = await this.client.post(`/api/v1/agent/identities/${id}/release`);
|
|
901
|
-
return { data: response.data, status: response.status, success: true };
|
|
906
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
902
907
|
}
|
|
903
908
|
async agentIdentityReputation(id) {
|
|
904
909
|
const response = await this.client.get(`/api/v1/agent/identities/${id}/reputation`);
|
|
905
|
-
return { data: response.data, status: response.status, success: true };
|
|
910
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
906
911
|
}
|
|
907
912
|
async agentRisk(days = 7) {
|
|
908
913
|
const response = await this.client.get('/api/v1/agent/identities/risk', { params: { days } });
|
|
909
|
-
return { data: response.data, status: response.status, success: true };
|
|
914
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
910
915
|
}
|
|
911
916
|
async companyLockPreset(companyId, profile) {
|
|
912
917
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/lock-preset`, { profile });
|
|
913
|
-
return { data: response.data, status: response.status, success: true };
|
|
918
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
914
919
|
}
|
|
915
920
|
async companyRequestUnlock(companyId, areas, reason) {
|
|
916
921
|
const response = await this.client.post(`/api/v1/cli/companies/${companyId}/request-unlock`, {
|
|
917
922
|
areas,
|
|
918
923
|
reason,
|
|
919
924
|
});
|
|
920
|
-
return { data: response.data, status: response.status, success: true };
|
|
925
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
921
926
|
}
|
|
922
927
|
// ── Tenant Activity Gate ────────────────────────────────────────────────
|
|
923
928
|
// See Owners-Manual/06-Operations/TENANT-ACTIVITY-GATE/ for the full spec.
|
|
@@ -964,15 +969,15 @@ class ApiClient {
|
|
|
964
969
|
expires_in_days: expiresInDays,
|
|
965
970
|
...(extra?.require_approval ? { require_approval: true } : {}),
|
|
966
971
|
});
|
|
967
|
-
return { data: response.data, status: response.status, success: true };
|
|
972
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
968
973
|
}
|
|
969
974
|
async apiKeyList() {
|
|
970
975
|
const response = await this.client.get('/api/v1/cli/api-keys/');
|
|
971
|
-
return { data: response.data, status: response.status, success: true };
|
|
976
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
972
977
|
}
|
|
973
978
|
async apiKeyRevoke(keyId) {
|
|
974
979
|
const response = await this.client.delete(`/api/v1/cli/api-keys/${keyId}`);
|
|
975
|
-
return { data: response.data, status: response.status, success: true };
|
|
980
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
976
981
|
}
|
|
977
982
|
// Agent management endpoints
|
|
978
983
|
async agentsList() {
|
|
@@ -980,32 +985,32 @@ class ApiClient {
|
|
|
980
985
|
// and axios/follow-redirects strips the Authorization header, causing
|
|
981
986
|
// spurious 401s under SOLID_API_KEY auth. Verified 2026-04-19.
|
|
982
987
|
const response = await this.client.get('/api/v1/cli/agents/');
|
|
983
|
-
return { data: response.data, status: response.status, success: true };
|
|
988
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
984
989
|
}
|
|
985
990
|
async agentDetail(agentType) {
|
|
986
991
|
const response = await this.client.get(`/api/v1/cli/agents/${agentType}`);
|
|
987
|
-
return { data: response.data, status: response.status, success: true };
|
|
992
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
988
993
|
}
|
|
989
994
|
async agentTools(agentType) {
|
|
990
995
|
const response = await this.client.get(`/api/v1/cli/agents/${agentType}/tools`);
|
|
991
|
-
return { data: response.data, status: response.status, success: true };
|
|
996
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
992
997
|
}
|
|
993
998
|
async agentData(agentType) {
|
|
994
999
|
const response = await this.client.get(`/api/v1/cli/agents/${agentType}/data`);
|
|
995
|
-
return { data: response.data, status: response.status, success: true };
|
|
1000
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
996
1001
|
}
|
|
997
1002
|
async orchestrationDashboard() {
|
|
998
1003
|
const response = await this.client.get('/api/orchestration/dashboard');
|
|
999
|
-
return { data: response.data, status: response.status, success: true };
|
|
1004
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1000
1005
|
}
|
|
1001
1006
|
async orchestrationAgents(statusFilter) {
|
|
1002
1007
|
const params = statusFilter ? { status_filter: statusFilter } : {};
|
|
1003
1008
|
const response = await this.client.get('/api/orchestration/agents', { params });
|
|
1004
|
-
return { data: response.data, status: response.status, success: true };
|
|
1009
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1005
1010
|
}
|
|
1006
1011
|
async orchestrationAgentDetail(agentId) {
|
|
1007
1012
|
const response = await this.client.get(`/api/orchestration/agents/${agentId}`);
|
|
1008
|
-
return { data: response.data, status: response.status, success: true };
|
|
1013
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1009
1014
|
}
|
|
1010
1015
|
async orchestrationDelegate(agentId, task, priority) {
|
|
1011
1016
|
const response = await this.client.post('/api/orchestration/delegate', {
|
|
@@ -1013,12 +1018,12 @@ class ApiClient {
|
|
|
1013
1018
|
task,
|
|
1014
1019
|
priority: priority || 5,
|
|
1015
1020
|
});
|
|
1016
|
-
return { data: response.data, status: response.status, success: true };
|
|
1021
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1017
1022
|
}
|
|
1018
1023
|
async orchestrationAnalytics(days) {
|
|
1019
1024
|
const params = days ? { days } : {};
|
|
1020
1025
|
const response = await this.client.get('/api/orchestration/analytics', { params });
|
|
1021
|
-
return { data: response.data, status: response.status, success: true };
|
|
1026
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1022
1027
|
}
|
|
1023
1028
|
// Dragon — Mission orchestration
|
|
1024
1029
|
async missionCreate(mission, agentIds) {
|
|
@@ -1026,16 +1031,16 @@ class ApiClient {
|
|
|
1026
1031
|
if (agentIds && agentIds.length > 0)
|
|
1027
1032
|
body.agent_ids = agentIds;
|
|
1028
1033
|
const response = await this.client.post('/api/v1/agents/missions', body);
|
|
1029
|
-
return { data: response.data, status: response.status, success: true };
|
|
1034
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1030
1035
|
}
|
|
1031
1036
|
async missionExecute(missionId) {
|
|
1032
1037
|
const response = await this.client.post(`/api/v1/agents/missions/${missionId}/execute`);
|
|
1033
|
-
return { data: response.data, status: response.status, success: true };
|
|
1038
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1034
1039
|
}
|
|
1035
1040
|
// Dragon — Telemetry
|
|
1036
1041
|
async telemetrySummary() {
|
|
1037
1042
|
const response = await this.client.get('/api/v1/telemetry/agents/summary');
|
|
1038
|
-
return { data: response.data, status: response.status, success: true };
|
|
1043
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1039
1044
|
}
|
|
1040
1045
|
// =========================================================================
|
|
1041
1046
|
// CLI History & Rollback
|
|
@@ -1043,57 +1048,57 @@ class ApiClient {
|
|
|
1043
1048
|
async historyPages(slug, limit = 50) {
|
|
1044
1049
|
const url = slug ? `/api/v1/cli/history/pages/${slug}` : '/api/v1/cli/history/pages';
|
|
1045
1050
|
const response = await this.client.get(url, { params: { limit } });
|
|
1046
|
-
return { data: response.data, status: response.status, success: true };
|
|
1051
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1047
1052
|
}
|
|
1048
1053
|
async historyPageVersion(slug, version) {
|
|
1049
1054
|
const response = await this.client.get(`/api/v1/cli/history/pages/${slug}/${version}`);
|
|
1050
|
-
return { data: response.data, status: response.status, success: true };
|
|
1055
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1051
1056
|
}
|
|
1052
1057
|
async rollbackPage(slug, version) {
|
|
1053
1058
|
const response = await this.client.post(`/api/v1/cli/history/pages/${slug}/rollback`, { version });
|
|
1054
|
-
return { data: response.data, status: response.status, success: true };
|
|
1059
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1055
1060
|
}
|
|
1056
1061
|
async historyKB(entryId, limit = 50) {
|
|
1057
1062
|
const url = entryId ? `/api/v1/cli/history/kb/${entryId}` : '/api/v1/cli/history/kb';
|
|
1058
1063
|
const response = await this.client.get(url, { params: { limit } });
|
|
1059
|
-
return { data: response.data, status: response.status, success: true };
|
|
1064
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1060
1065
|
}
|
|
1061
1066
|
async rollbackKB(entryId, version) {
|
|
1062
1067
|
const response = await this.client.post(`/api/v1/cli/history/kb/${entryId}/rollback`, { version });
|
|
1063
|
-
return { data: response.data, status: response.status, success: true };
|
|
1068
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1064
1069
|
}
|
|
1065
1070
|
async createSnapshot(source = 'cli', changeSummary) {
|
|
1066
1071
|
const response = await this.client.post('/api/v1/cli/history/snapshot', {
|
|
1067
1072
|
source,
|
|
1068
1073
|
change_summary: changeSummary,
|
|
1069
1074
|
});
|
|
1070
|
-
return { data: response.data, status: response.status, success: true };
|
|
1075
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1071
1076
|
}
|
|
1072
1077
|
// =========================================================================
|
|
1073
1078
|
// CLI Preview Deployments
|
|
1074
1079
|
// =========================================================================
|
|
1075
1080
|
async previewCreate(options = {}) {
|
|
1076
1081
|
const response = await this.client.post('/api/v1/cli/preview', options);
|
|
1077
|
-
return { data: response.data, status: response.status, success: true };
|
|
1082
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1078
1083
|
}
|
|
1079
1084
|
async previewList(status, limit = 20) {
|
|
1080
1085
|
const params = { limit };
|
|
1081
1086
|
if (status)
|
|
1082
1087
|
params.status = status;
|
|
1083
1088
|
const response = await this.client.get('/api/v1/cli/preview', { params });
|
|
1084
|
-
return { data: response.data, status: response.status, success: true };
|
|
1089
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1085
1090
|
}
|
|
1086
1091
|
async previewGet(token) {
|
|
1087
1092
|
const response = await this.client.get(`/api/v1/cli/preview/${token}`);
|
|
1088
|
-
return { data: response.data, status: response.status, success: true };
|
|
1093
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1089
1094
|
}
|
|
1090
1095
|
async previewPromote(token) {
|
|
1091
1096
|
const response = await this.client.post(`/api/v1/cli/preview/${token}/promote`, { confirm: true });
|
|
1092
|
-
return { data: response.data, status: response.status, success: true };
|
|
1097
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1093
1098
|
}
|
|
1094
1099
|
async previewExpire(token) {
|
|
1095
1100
|
const response = await this.client.delete(`/api/v1/cli/preview/${token}`);
|
|
1096
|
-
return { data: response.data, status: response.status, success: true };
|
|
1101
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1097
1102
|
}
|
|
1098
1103
|
// =========================================================================
|
|
1099
1104
|
// CLI Agent Logs & Testing
|
|
@@ -1101,30 +1106,30 @@ class ApiClient {
|
|
|
1101
1106
|
async agentLogs(agentType, options = {}) {
|
|
1102
1107
|
const url = agentType ? `/api/v1/cli/agents/${agentType}/logs` : '/api/v1/cli/agents/logs';
|
|
1103
1108
|
const response = await this.client.get(url, { params: options });
|
|
1104
|
-
return { data: response.data, status: response.status, success: true };
|
|
1109
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1105
1110
|
}
|
|
1106
1111
|
async agentErrors(agentType, hours = 24, limit = 50) {
|
|
1107
1112
|
const response = await this.client.get(`/api/v1/cli/agents/${agentType}/logs/errors`, { params: { hours, limit } });
|
|
1108
|
-
return { data: response.data, status: response.status, success: true };
|
|
1113
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1109
1114
|
}
|
|
1110
1115
|
async agentTest(options) {
|
|
1111
1116
|
const response = await this.client.post('/api/v1/cli/agents/test', options);
|
|
1112
|
-
return { data: response.data, status: response.status, success: true };
|
|
1117
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1113
1118
|
}
|
|
1114
1119
|
async agentTestResults(hours = 24, limit = 50) {
|
|
1115
1120
|
const response = await this.client.get('/api/v1/cli/agents/test/results', { params: { hours, limit } });
|
|
1116
|
-
return { data: response.data, status: response.status, success: true };
|
|
1121
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1117
1122
|
}
|
|
1118
1123
|
// =========================================================================
|
|
1119
1124
|
// CLI Company Migration
|
|
1120
1125
|
// =========================================================================
|
|
1121
1126
|
async migratePreview(options) {
|
|
1122
1127
|
const response = await this.client.post('/api/v1/cli/migrate/preview', options);
|
|
1123
|
-
return { data: response.data, status: response.status, success: true };
|
|
1128
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1124
1129
|
}
|
|
1125
1130
|
async migrateExecute(options) {
|
|
1126
1131
|
const response = await this.client.post('/api/v1/cli/migrate/execute', options);
|
|
1127
|
-
return { data: response.data, status: response.status, success: true };
|
|
1132
|
+
return { data: response.data, status: response.status, success: true, ...receiptOf(response.headers) };
|
|
1128
1133
|
}
|
|
1129
1134
|
}
|
|
1130
1135
|
exports.apiClient = new ApiClient();
|