@nestpilot/mcp-app 1.0.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 (149) hide show
  1. package/README.md +350 -0
  2. package/dist/cli/doctor.d.ts +1 -0
  3. package/dist/cli/doctor.js +214 -0
  4. package/dist/cli/export-import.d.ts +6 -0
  5. package/dist/cli/export-import.js +132 -0
  6. package/dist/cli/index.d.ts +2 -0
  7. package/dist/cli/index.js +168 -0
  8. package/dist/cli/init.d.ts +1 -0
  9. package/dist/cli/init.js +171 -0
  10. package/dist/host-configs/cowork.json +11 -0
  11. package/dist/host-configs/goose.yaml +22 -0
  12. package/dist/host-configs/openclaw-manifest.json +16 -0
  13. package/dist/main.d.ts +2 -0
  14. package/dist/main.js +128 -0
  15. package/dist/mcp-app.html +155 -0
  16. package/dist/nestpilot-client.d.ts +44 -0
  17. package/dist/nestpilot-client.js +160 -0
  18. package/dist/planner.html +222 -0
  19. package/dist/server.d.ts +19 -0
  20. package/dist/server.js +245 -0
  21. package/dist/skills/SKILL.md +162 -0
  22. package/dist/skills/manifest.json +51 -0
  23. package/dist/skills/tools/activate_plan.md +36 -0
  24. package/dist/skills/tools/coach.md +59 -0
  25. package/dist/skills/tools/comprehensive_plan.md +65 -0
  26. package/dist/skills/tools/create_plan.md +59 -0
  27. package/dist/skills/tools/create_saved_plan.md +49 -0
  28. package/dist/skills/tools/delete_plan.md +42 -0
  29. package/dist/skills/tools/delete_scenario.md +38 -0
  30. package/dist/skills/tools/generate_proposal.md +63 -0
  31. package/dist/skills/tools/generate_retirement_report.md +50 -0
  32. package/dist/skills/tools/get_active_plan.md +44 -0
  33. package/dist/skills/tools/get_baseline_forecast.md +47 -0
  34. package/dist/skills/tools/get_plan.md +44 -0
  35. package/dist/skills/tools/get_plan_components.md +50 -0
  36. package/dist/skills/tools/get_scenario.md +46 -0
  37. package/dist/skills/tools/list_plans.md +44 -0
  38. package/dist/skills/tools/list_scenarios.md +42 -0
  39. package/dist/skills/tools/medicare-guardian.md +59 -0
  40. package/dist/skills/tools/nestpilot_run_plan.md +61 -0
  41. package/dist/skills/tools/optimize_roth_conversion.md +107 -0
  42. package/dist/skills/tools/optimize_ss_claiming.md +30 -0
  43. package/dist/skills/tools/rename_plan.md +34 -0
  44. package/dist/skills/tools/retirement-planner.md +55 -0
  45. package/dist/skills/tools/run_forecast.md +65 -0
  46. package/dist/skills/tools/run_saved_forecast.md +52 -0
  47. package/dist/skills/tools/run_scenario.md +66 -0
  48. package/dist/skills/tools/save_plan.md +48 -0
  49. package/dist/skills/tools/save_scenario.md +50 -0
  50. package/dist/skills/tools/verify_forecast.md +43 -0
  51. package/dist/src/config.d.ts +20 -0
  52. package/dist/src/config.js +44 -0
  53. package/dist/src/contracts/provenance.d.ts +37 -0
  54. package/dist/src/contracts/provenance.js +71 -0
  55. package/dist/src/contracts/tool-contract-registry.d.ts +43 -0
  56. package/dist/src/contracts/tool-contract-registry.js +282 -0
  57. package/dist/src/local/cloud-compute-client.d.ts +55 -0
  58. package/dist/src/local/cloud-compute-client.js +135 -0
  59. package/dist/src/local/encryption.d.ts +24 -0
  60. package/dist/src/local/encryption.js +105 -0
  61. package/dist/src/local/keychain.d.ts +41 -0
  62. package/dist/src/local/keychain.js +236 -0
  63. package/dist/src/local/local-config.d.ts +34 -0
  64. package/dist/src/local/local-config.js +61 -0
  65. package/dist/src/local/local-data-layer.d.ts +20 -0
  66. package/dist/src/local/local-data-layer.js +15 -0
  67. package/dist/src/local/local-plan-store.d.ts +66 -0
  68. package/dist/src/local/local-plan-store.js +195 -0
  69. package/dist/src/local/pii-scrubber.d.ts +26 -0
  70. package/dist/src/local/pii-scrubber.js +219 -0
  71. package/dist/src/policy/policy-engine.d.ts +44 -0
  72. package/dist/src/policy/policy-engine.js +119 -0
  73. package/dist/src/rate-limit.d.ts +17 -0
  74. package/dist/src/rate-limit.js +41 -0
  75. package/dist/src/security.d.ts +19 -0
  76. package/dist/src/security.js +118 -0
  77. package/dist/src/skills/index.d.ts +12 -0
  78. package/dist/src/skills/index.js +16 -0
  79. package/dist/src/skills/retirement-pack-v1.d.ts +28 -0
  80. package/dist/src/skills/retirement-pack-v1.js +295 -0
  81. package/dist/src/skills/skill-executor.d.ts +65 -0
  82. package/dist/src/skills/skill-executor.js +174 -0
  83. package/dist/src/skills/skill-manifest-schema.d.ts +337 -0
  84. package/dist/src/skills/skill-manifest-schema.js +94 -0
  85. package/dist/src/skills/skill-registry.d.ts +71 -0
  86. package/dist/src/skills/skill-registry.js +116 -0
  87. package/dist/src/telemetry.d.ts +12 -0
  88. package/dist/src/telemetry.js +59 -0
  89. package/dist/src/types.d.ts +46 -0
  90. package/dist/src/types.js +4 -0
  91. package/dist/tools/agent-tools.d.ts +12 -0
  92. package/dist/tools/agent-tools.js +141 -0
  93. package/dist/tools/forecast-management-tools.d.ts +9 -0
  94. package/dist/tools/forecast-management-tools.js +133 -0
  95. package/dist/tools/local-plan-tools.d.ts +8 -0
  96. package/dist/tools/local-plan-tools.js +357 -0
  97. package/dist/tools/mcp-helpers.d.ts +52 -0
  98. package/dist/tools/mcp-helpers.js +177 -0
  99. package/dist/tools/medicare-tools.d.ts +3 -0
  100. package/dist/tools/medicare-tools.js +162 -0
  101. package/dist/tools/optimize-roth-tools-test.d.ts +2 -0
  102. package/dist/tools/optimize-roth-tools-test.js +36 -0
  103. package/dist/tools/optimize-roth-tools.d.ts +3 -0
  104. package/dist/tools/optimize-roth-tools.js +818 -0
  105. package/dist/tools/plan-management-tools.d.ts +3 -0
  106. package/dist/tools/plan-management-tools.js +196 -0
  107. package/dist/tools/planning-tools.d.ts +3 -0
  108. package/dist/tools/planning-tools.js +290 -0
  109. package/dist/tools/proposal-tools.d.ts +3 -0
  110. package/dist/tools/proposal-tools.js +428 -0
  111. package/dist/tools/report-tools.d.ts +3 -0
  112. package/dist/tools/report-tools.js +245 -0
  113. package/dist/tools/scenario-management-tools.d.ts +3 -0
  114. package/dist/tools/scenario-management-tools.js +136 -0
  115. package/dist/views/verification-packet.html +211 -0
  116. package/host-configs/cowork.json +11 -0
  117. package/host-configs/goose.yaml +22 -0
  118. package/host-configs/openclaw-manifest.json +16 -0
  119. package/package.json +66 -0
  120. package/skills/SKILL.md +162 -0
  121. package/skills/manifest.json +51 -0
  122. package/skills/tools/activate_plan.md +36 -0
  123. package/skills/tools/coach.md +59 -0
  124. package/skills/tools/comprehensive_plan.md +65 -0
  125. package/skills/tools/create_plan.md +59 -0
  126. package/skills/tools/create_saved_plan.md +49 -0
  127. package/skills/tools/delete_plan.md +42 -0
  128. package/skills/tools/delete_scenario.md +38 -0
  129. package/skills/tools/generate_proposal.md +63 -0
  130. package/skills/tools/generate_retirement_report.md +50 -0
  131. package/skills/tools/get_active_plan.md +44 -0
  132. package/skills/tools/get_baseline_forecast.md +47 -0
  133. package/skills/tools/get_plan.md +44 -0
  134. package/skills/tools/get_plan_components.md +50 -0
  135. package/skills/tools/get_scenario.md +46 -0
  136. package/skills/tools/list_plans.md +44 -0
  137. package/skills/tools/list_scenarios.md +42 -0
  138. package/skills/tools/medicare-guardian.md +59 -0
  139. package/skills/tools/nestpilot_run_plan.md +61 -0
  140. package/skills/tools/optimize_roth_conversion.md +107 -0
  141. package/skills/tools/optimize_ss_claiming.md +30 -0
  142. package/skills/tools/rename_plan.md +34 -0
  143. package/skills/tools/retirement-planner.md +55 -0
  144. package/skills/tools/run_forecast.md +65 -0
  145. package/skills/tools/run_saved_forecast.md +52 -0
  146. package/skills/tools/run_scenario.md +66 -0
  147. package/skills/tools/save_plan.md +48 -0
  148. package/skills/tools/save_scenario.md +50 -0
  149. package/skills/tools/verify_forecast.md +43 -0
@@ -0,0 +1,44 @@
1
+ /**
2
+ * NestPilot Backend HTTP Client
3
+ *
4
+ * Shared async client for communicating with the NestPilot Spring Boot API.
5
+ * Supports per-request headers for auth forwarding (JWT passthrough).
6
+ */
7
+ export interface BackendResult {
8
+ error?: boolean;
9
+ code?: number;
10
+ message?: string;
11
+ [key: string]: unknown;
12
+ }
13
+ export interface RequestOptions {
14
+ headers?: Record<string, string>;
15
+ timeout?: number;
16
+ }
17
+ /**
18
+ * POST request to the NestPilot backend.
19
+ */
20
+ declare function post(endpoint: string, data: Record<string, unknown>, opts?: RequestOptions): Promise<BackendResult>;
21
+ /**
22
+ * GET request to the NestPilot backend.
23
+ */
24
+ declare function get(endpoint: string, params?: Record<string, string>, opts?: RequestOptions): Promise<BackendResult>;
25
+ /**
26
+ * PUT request to the NestPilot backend.
27
+ */
28
+ declare function put(endpoint: string, data: Record<string, unknown>, opts?: RequestOptions): Promise<BackendResult>;
29
+ /**
30
+ * DELETE request to the NestPilot backend.
31
+ */
32
+ declare function del(endpoint: string, opts?: RequestOptions): Promise<BackendResult>;
33
+ /**
34
+ * PATCH request to the NestPilot backend.
35
+ */
36
+ declare function patch(endpoint: string, data: Record<string, unknown>, opts?: RequestOptions): Promise<BackendResult>;
37
+ export declare const nestpilotClient: {
38
+ post: typeof post;
39
+ get: typeof get;
40
+ put: typeof put;
41
+ del: typeof del;
42
+ patch: typeof patch;
43
+ };
44
+ export {};
@@ -0,0 +1,160 @@
1
+ /**
2
+ * NestPilot Backend HTTP Client
3
+ *
4
+ * Shared async client for communicating with the NestPilot Spring Boot API.
5
+ * Supports per-request headers for auth forwarding (JWT passthrough).
6
+ */
7
+ const NESTPILOT_BACKEND_URL = process.env.NESTPILOT_BACKEND_URL ?? "http://localhost:8080";
8
+ const DEFAULT_HEADERS = {
9
+ "Content-Type": "application/json",
10
+ "User-Agent": "NestPilot-MCP-App/1.0",
11
+ };
12
+ const DEFAULT_TIMEOUT = 30_000;
13
+ function mergeHeaders(opts) {
14
+ return { ...DEFAULT_HEADERS, ...(opts?.headers ?? {}) };
15
+ }
16
+ /**
17
+ * POST request to the NestPilot backend.
18
+ */
19
+ async function post(endpoint, data, opts) {
20
+ const url = `${NESTPILOT_BACKEND_URL}${endpoint}`;
21
+ try {
22
+ const response = await fetch(url, {
23
+ method: "POST",
24
+ headers: mergeHeaders(opts),
25
+ body: JSON.stringify(data),
26
+ signal: AbortSignal.timeout(opts?.timeout ?? DEFAULT_TIMEOUT),
27
+ });
28
+ if (!response.ok) {
29
+ const text = await response.text();
30
+ return {
31
+ error: true,
32
+ code: response.status,
33
+ message: `Backend error: ${text}`,
34
+ };
35
+ }
36
+ return (await response.json());
37
+ }
38
+ catch (e) {
39
+ console.error(`[nestpilot-client] Connection error calling ${url}:`, e);
40
+ return { error: true, message: `Connection failed: ${String(e)}` };
41
+ }
42
+ }
43
+ /**
44
+ * GET request to the NestPilot backend.
45
+ */
46
+ async function get(endpoint, params, opts) {
47
+ const url = new URL(`${NESTPILOT_BACKEND_URL}${endpoint}`);
48
+ if (params) {
49
+ for (const [k, v] of Object.entries(params)) {
50
+ url.searchParams.set(k, v);
51
+ }
52
+ }
53
+ try {
54
+ const response = await fetch(url.toString(), {
55
+ headers: mergeHeaders(opts),
56
+ signal: AbortSignal.timeout(opts?.timeout ?? DEFAULT_TIMEOUT),
57
+ });
58
+ if (!response.ok) {
59
+ const text = await response.text();
60
+ return { error: true, code: response.status, message: text };
61
+ }
62
+ return (await response.json());
63
+ }
64
+ catch (e) {
65
+ console.error(`[nestpilot-client] Error calling ${url}:`, e);
66
+ return { error: true, message: String(e) };
67
+ }
68
+ }
69
+ /**
70
+ * PUT request to the NestPilot backend.
71
+ */
72
+ async function put(endpoint, data, opts) {
73
+ const url = `${NESTPILOT_BACKEND_URL}${endpoint}`;
74
+ try {
75
+ const response = await fetch(url, {
76
+ method: "PUT",
77
+ headers: mergeHeaders(opts),
78
+ body: JSON.stringify(data),
79
+ signal: AbortSignal.timeout(opts?.timeout ?? DEFAULT_TIMEOUT),
80
+ });
81
+ if (!response.ok) {
82
+ const text = await response.text();
83
+ return {
84
+ error: true,
85
+ code: response.status,
86
+ message: `Backend error: ${text}`,
87
+ };
88
+ }
89
+ // Handle 204 No Content
90
+ if (response.status === 204)
91
+ return {};
92
+ return (await response.json());
93
+ }
94
+ catch (e) {
95
+ console.error(`[nestpilot-client] Error calling PUT ${url}:`, e);
96
+ return { error: true, message: `Connection failed: ${String(e)}` };
97
+ }
98
+ }
99
+ /**
100
+ * DELETE request to the NestPilot backend.
101
+ */
102
+ async function del(endpoint, opts) {
103
+ const url = `${NESTPILOT_BACKEND_URL}${endpoint}`;
104
+ try {
105
+ const response = await fetch(url, {
106
+ method: "DELETE",
107
+ headers: mergeHeaders(opts),
108
+ signal: AbortSignal.timeout(opts?.timeout ?? DEFAULT_TIMEOUT),
109
+ });
110
+ if (!response.ok) {
111
+ const text = await response.text();
112
+ return {
113
+ error: true,
114
+ code: response.status,
115
+ message: `Backend error: ${text}`,
116
+ };
117
+ }
118
+ // Handle 204 No Content
119
+ if (response.status === 204)
120
+ return {};
121
+ const text = await response.text();
122
+ if (!text)
123
+ return {};
124
+ return JSON.parse(text);
125
+ }
126
+ catch (e) {
127
+ console.error(`[nestpilot-client] Error calling DELETE ${url}:`, e);
128
+ return { error: true, message: `Connection failed: ${String(e)}` };
129
+ }
130
+ }
131
+ /**
132
+ * PATCH request to the NestPilot backend.
133
+ */
134
+ async function patch(endpoint, data, opts) {
135
+ const url = `${NESTPILOT_BACKEND_URL}${endpoint}`;
136
+ try {
137
+ const response = await fetch(url, {
138
+ method: "PATCH",
139
+ headers: mergeHeaders(opts),
140
+ body: JSON.stringify(data),
141
+ signal: AbortSignal.timeout(opts?.timeout ?? DEFAULT_TIMEOUT),
142
+ });
143
+ if (!response.ok) {
144
+ const text = await response.text();
145
+ return {
146
+ error: true,
147
+ code: response.status,
148
+ message: `Backend error: ${text}`,
149
+ };
150
+ }
151
+ if (response.status === 204)
152
+ return {};
153
+ return (await response.json());
154
+ }
155
+ catch (e) {
156
+ console.error(`[nestpilot-client] Error calling PATCH ${url}:`, e);
157
+ return { error: true, message: `Connection failed: ${String(e)}` };
158
+ }
159
+ }
160
+ export const nestpilotClient = { post, get, put, del, patch };