continuum-engine-client 1.0.0 โ 1.0.2
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/README.md +90 -155
- package/client-kernel.js +68 -32
- package/package.json +18 -4
- package/run_simulator.js +61 -0
package/README.md
CHANGED
|
@@ -1,198 +1,133 @@
|
|
|
1
1
|
# Continuum Engine
|
|
2
2
|
|
|
3
|
-
**Enterprise
|
|
3
|
+
**An Enterprise FinOps & Zero-Trust Routing Core for Agentic AI Infrastructure.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
When deploying Agentic AI or Dynamic Grounding (RAG) at scale, the underlying infrastructure often faces a critical threat: **unpredictable and invisible token runaway.** As autonomous models deeply traverse search networks and maintain massive context behind the scenes, a single user prompt can silently burn thousands of tokens, transforming your intelligent infrastructure into a deficit-generating liability.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**Continuum Engine** is an independent, client-side routing middleware (Core IP) that physically isolates and controls this token consumption at the edge layer.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
As SI deepens its autonomous (Agentic) reasoning and search capabilities, it dutifully holds onto past contexts, traverses vast search networks, and repeats immense trial-and-error processes in the background to derive the best possible answer for you.
|
|
9
|
+
By integrating this engine into your BFF (Backend For Frontend) or package environment, you can transparently visualize the "hidden labor" of Superintelligence (SI) on your terminal and strictly cap your infrastructure costs before they reach your billing account.
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
The role of the Continuum Engine is to route requests so that SI can perform at its absolute clearest, without being forced into computational exhaustion. By transforming the hidden background operations of SI into transparent numbers, you gain precise control over fluctuating infrastructure OPEX, fostering a deeper respect for the intelligence working for you.
|
|
11
|
+

|
|
14
12
|
|
|
15
|
-
##
|
|
13
|
+
## 1. FinOps Telemetry (The Edge Purge Verification)
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
### ๐ฅ Live FinOps Telemetry (Edge Purge in Action)
|
|
16
|
+
|
|
17
|
+
https://github.com/user-attachments/assets/551ab40e-1da2-49c9-9ac0-b2095859d98c
|
|
18
|
+
|
|
19
|
+
Engineers trust terminal logs, not marketing copy. When you route requests through the Continuum Engine, the client kernel dismantles the black box of inference costs.
|
|
20
|
+
|
|
21
|
+
It explicitly reveals the physical compute breakdown behind the model's output, exposing the "invisible labor" of dynamic grounding and proving the exact amount of CapEx saved per query.
|
|
18
22
|
|
|
19
23
|
```text
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
==================================================
|
|
25
|
+
๐ค [AI RESPONSE]
|
|
26
|
+
==================================================
|
|
27
|
+
(Verified authoritative engineering response...)
|
|
28
|
+
--------------------------------------------------
|
|
29
|
+
๐ [VERIFIED PRIMARY SOURCES]
|
|
30
|
+
1. Official Cloud Architecture Documentation
|
|
31
|
+
https://[Authorized-Enterprise-Domain]/...
|
|
32
|
+
--------------------------------------------------
|
|
33
|
+
๐ [FINOPS TELEMETRY BREAKDOWN]
|
|
34
|
+
โโ T_input (Optimized Prompt) : 210 tokens
|
|
35
|
+
โโ T_grounding (Dynamic Search) : 4,820 tokens <-- The hidden labor
|
|
36
|
+
โโ T_output (Generated Result) : 640 tokens
|
|
37
|
+
|
|
38
|
+
๐ก๏ธ Edge Purge (Tokens Prevented) : 1,200 tokens
|
|
39
|
+
๐ Net Billed Consumption : 5,670 tokens
|
|
40
|
+
==================================================
|
|
41
|
+
๐ณ Quota Balance: 799 requests remaining
|
|
42
|
+
==================================================
|
|
27
43
|
```
|
|
28
44
|
|
|
29
|
-
|
|
30
|
-
- **Core API Engine (Cloud Backend):** Closed intellectual property. Enforces hardware-level quotas, sanitizes search results, and manages data sovereignty (Docs cooling or complete amnesia).
|
|
45
|
+
## 2. Try the Experience (Zero-Cost Local Simulator)
|
|
31
46
|
|
|
32
|
-
|
|
47
|
+
If you wish to experience the "feel" of Continuum Engine's FinOps telemetry before acquiring a production license, you can run our offline simulator.
|
|
33
48
|
|
|
34
|
-
|
|
49
|
+
> **Note:** This demo is a completely offline simulation. It makes zero network requests to the live backend, ensuring it consumes absolutely zero infrastructure CapEx.
|
|
35
50
|
|
|
36
|
-
|
|
51
|
+
Clone the repository and run the simulator directly in your terminal:
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
```bash
|
|
54
|
+
git clone https://github.com/individual-app-developers-cmck/continuum-engine.git
|
|
55
|
+
cd continuum-engine
|
|
56
|
+
```
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
**For Node.js users:**
|
|
59
|
+
```bash
|
|
60
|
+
node run_simulator.js "What is Zero-Trust?"
|
|
61
|
+
```
|
|
42
62
|
|
|
43
|
-
|
|
63
|
+
**For Python users:**
|
|
64
|
+
```bash
|
|
65
|
+
python run_simulator.py "What is Zero-Trust?"
|
|
66
|
+
```
|
|
44
67
|
|
|
45
|
-
|
|
68
|
+
## 3. Acquire & Integrate (From Checkout to System in 3 Minutes)
|
|
46
69
|
|
|
47
|
-
|
|
70
|
+
- **$60 One-Time Acquisition**: Comes with a mathematically guaranteed 800-inference-rally hard cap.
|
|
71
|
+
- **No Subscriptions**: Secure your cloud infrastructure today, permanently.
|
|
72
|
+
- **Seamless Integration**: Native support for Node.js (npm), Python (pip), and direct CLI execution.
|
|
48
73
|
|
|
49
74
|
_Protected by Stripe Checkout & Zero-Trust Origin Verification_
|
|
50
75
|
|
|
51
|
-
|
|
76
|
+
[](https://buy.stripe.com/eVq28t2qB4mneGfc336sw00)
|
|
52
77
|
|
|
53
|
-
|
|
54
|
-
2. **Deterministic Redirect:** Upon verified checkout, you are redirected immediately to the private setup console (`setup.html`) with your transaction-bound session proof.
|
|
55
|
-
3. **Provisioning:** Retrieve your private endpoint (`<YOUR_PROVISIONED_ENDPOINT>`), your dedicated API key (`<YOUR_PROVISIONED_AUTH_TOKEN>`), and the **hidden authentication header name**.
|
|
78
|
+
We respect your time. Once you acquire the license, securing your infrastructure takes only three steps:
|
|
56
79
|
|
|
80
|
+
1. **Checkout & Provisioning**: Complete the $60 transaction above. You will be immediately redirected to a secure `setup.html` console where your private API key and dedicated endpoint are instantly provisioned.
|
|
57
81
|
|
|
58
|
-
|
|
82
|
+
*(Note: The `setup.html` console, along with the simulator and integration examples, is hosted in our [GitHub Repository](https://github.com/individual-app-developers-cmck/continuum-engine). If you are building a production BFF, clone the repository to access the core integration files.)*
|
|
59
83
|
|
|
60
|
-
Install the
|
|
84
|
+
2. **Install the Client Kernel**:
|
|
61
85
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
86
|
+
```bash
|
|
87
|
+
npm install continuum-engine-client
|
|
88
|
+
# or
|
|
89
|
+
pip install continuum-engine-client
|
|
90
|
+
```
|
|
65
91
|
|
|
66
|
-
|
|
92
|
+
3. **Drop it into your system**:
|
|
93
|
+
Replace the variables with your provisioned credentials.
|
|
67
94
|
|
|
68
|
-
|
|
95
|
+
```javascript
|
|
96
|
+
const ContinuumClient = require("continuum-engine-client");
|
|
97
|
+
const client = new ContinuumClient(
|
|
98
|
+
"<YOUR_PROVISIONED_ENDPOINT>",
|
|
99
|
+
"<HEADER_REVEALED_POST_PURCHASE>",
|
|
100
|
+
"<YOUR_PROVISIONED_TOKEN>"
|
|
101
|
+
);
|
|
69
102
|
|
|
70
|
-
|
|
103
|
+
// The engine automatically purges runaway tokens and returns optimized telemetry
|
|
104
|
+
const result = await client.query("Summarize the latest Zero-Trust architecture.");
|
|
105
|
+
```
|
|
71
106
|
|
|
72
|
-
|
|
107
|
+
## 4. Core Capabilities & Architecture
|
|
73
108
|
|
|
74
|
-
|
|
109
|
+
The repository distributes the open-source client kernel (`client_kernel.py` / `client-kernel.js`). This kernel connects to the Continuum Engine Core API, a closed intellectual property designed to enforce hardware-level quotas and data sovereignty.
|
|
75
110
|
|
|
76
|
-
|
|
77
|
-
# [WARNING] All requests are inspected by Gate 0 Edge Interceptor.
|
|
78
|
-
# Malicious payloads or protocol guessing will trigger immediate token revocation.
|
|
79
|
-
|
|
80
|
-
curl -X POST "<YOUR_PROVISIONED_ENDPOINT>" \
|
|
81
|
-
--max-time 300 \
|
|
82
|
-
-H "Content-Type: application/json" \
|
|
83
|
-
-H "<HEADER_REVEALED_POST_PURCHASE>: <YOUR_PROVISIONED_AUTH_TOKEN>" \
|
|
84
|
-
-H "x-client-trace-context: req-$(date +%s)" \
|
|
85
|
-
-H "User-Agent: Continuum-Enterprise-Client/1.0" \
|
|
86
|
-
-d '{
|
|
87
|
-
"message": "<ENTER_YOUR_MESSAGE_HERE>",
|
|
88
|
-
"sessionId": "strict-session-001"
|
|
89
|
-
}'
|
|
90
|
-
```
|
|
111
|
+
### A. Data Sovereignty (The Power of Choice)
|
|
91
112
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
```powershell
|
|
95
|
-
# [WARNING] Edge Interceptor is active. Unrecognized User-Agents or
|
|
96
|
-
# malicious injection attempts will permanently revoke your $60 token.
|
|
97
|
-
|
|
98
|
-
$body = @{
|
|
99
|
-
message = "<ENTER_YOUR_MESSAGE_HERE>"
|
|
100
|
-
sessionId = "strict-session-$(Get-Date -UFormat %s)"
|
|
101
|
-
} | ConvertTo-Json -Compress
|
|
102
|
-
|
|
103
|
-
Invoke-RestMethod -Uri "<YOUR_PROVISIONED_ENDPOINT>" `
|
|
104
|
-
-Method Post `
|
|
105
|
-
-Headers @{
|
|
106
|
-
"Content-Type" = "application/json";
|
|
107
|
-
"<HEADER_REVEALED_POST_PURCHASE>" = "<YOUR_PROVISIONED_AUTH_TOKEN>";
|
|
108
|
-
"x-client-trace-context" = [guid]::NewGuid().ToString();
|
|
109
|
-
"User-Agent" = "Continuum-Enterprise-Client/1.0"
|
|
110
|
-
} `
|
|
111
|
-
-Body $body `
|
|
112
|
-
-TimeoutSec 300
|
|
113
|
-
```
|
|
113
|
+
Based on strict Zero-Trust principles, **you retain absolute control over your data footprint.** The engine operates with two distinct memory modes:
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
- **Stateful Mode (BYOD - Bring Your Own Document):** By providing your Google Doc ID, the AI's inferences are automatically synced to your personal document, turning conversations into permanent knowledge assets.
|
|
116
|
+
- **Stateless Mode (Amnesia):** By leaving the Doc ID empty, the inference runs entirely ephemerally. Zero conversation logs are retained on our servers, flushing completely after a 7-day TTL pointer expiration.
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
REM [WARNING] Zero-Trust Gate 0 is active. Payload anomaly detection enabled.
|
|
118
|
+
### B. Automated Perimeter Defenses (Gate 0 & 0.5)
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-H "Content-Type: application/json" ^
|
|
123
|
-
-H "<HEADER_REVEALED_POST_PURCHASE>: <YOUR_PROVISIONED_AUTH_TOKEN>" ^
|
|
124
|
-
-H "x-client-trace-context: req-%RANDOM%" ^
|
|
125
|
-
-H "User-Agent: Continuum-Enterprise-Client/1.0" ^
|
|
126
|
-
-d "{\"message\": \"<ENTER_YOUR_MESSAGE_HERE>\", \"sessionId\": \"strict-session-001\"}"
|
|
127
|
-
```
|
|
120
|
+
- **Zero-Tolerance Exploit Defense:** The engine operates a Gate 0 interceptor. Malicious payloads, prompt injections, or protocol guessing are blocked before they consume downstream resources.
|
|
121
|
+
- **180s Circuit Breaker:** To prevent infinite search loops during dynamic grounding, a strict 180-second hard execution limit is enforced.
|
|
128
122
|
|
|
129
|
-
|
|
123
|
+
_(Note: Automated vulnerability scans or prompt injection payloads will trigger immediate token revocation without refund.)_
|
|
130
124
|
|
|
131
|
-
##
|
|
125
|
+
## 5. Operational Policies (Read Before Use)
|
|
132
126
|
|
|
133
|
-
|
|
127
|
+
To guarantee microsecond-level edge response and enforce strict FinOps predictability, the gateway applies non-negotiable operational controls:
|
|
134
128
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
==================================================
|
|
139
|
-
(Grounding-verified authoritative engineering response)
|
|
140
|
-
--------------------------------------------------
|
|
141
|
-
๐ [VERIFIED PRIMARY SOURCES]
|
|
142
|
-
1. Official Cloud Architecture Documentation
|
|
143
|
-
https://[Authorized-Enterprise-Domain]/...
|
|
144
|
-
--------------------------------------------------
|
|
145
|
-
๐ [STATE STORAGE] History successfully synced to your private document.
|
|
146
|
-
--------------------------------------------------
|
|
147
|
-
๐ [FINOPS TELEMETRY BREAKDOWN]
|
|
148
|
-
โโ T_input (Optimized Prompt) : 210 tokens
|
|
149
|
-
โโ T_grounding (Dynamic Search) : 4,820 tokens <-- Labor expended behind the scenes
|
|
150
|
-
โโ T_output (Generated Result) : 640 tokens
|
|
151
|
-
๐ก๏ธ Edge Purge (Tokens Prevented) : 1,200 tokens
|
|
152
|
-
๐ Net Billed Consumption : 5,670 tokens
|
|
153
|
-
==================================================
|
|
154
|
-
๐ณ Quota Balance: 799 requests remaining
|
|
155
|
-
==================================================
|
|
156
|
-
```
|
|
129
|
+
- **Service Availability (Geographic Scope):** This middleware and associated API keys are exclusively intended for global enterprise environments and are **strictly not available for use or purchase within Japan**. Access from restricted jurisdictions is filtered at the gateway level.
|
|
130
|
+
- **Strict Quota Cap:** The 800-request quota is a mathematically enforced hard cap designed to safeguard against autonomous loop runaways. Once depleted, a new license acquisition is required.
|
|
131
|
+
- **Zero-Support Policy:** Engineered exclusively for experienced systems engineers building BFFs and AI infrastructures. We provide no interactive debugging, manual onboarding, or post-revocation appeals.
|
|
157
132
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
To guarantee microsecond-level latency and protect the ecosystem for all verified users, automated perimeter defenses enforce strict, non-negotiable request policies. **Users who fail to comply with the specifications below risk immediate rejection or non-refundable credential revocation:**
|
|
161
|
-
|
|
162
|
-
- **Optimal Payload Constraints:** Keep your input messages concise and structurally clean. Excessively massive payloads (e.g., pasting entire source code repositories or unusually large log files) may be automatically truncated or rejected by the perimeter optimization engine before processing.
|
|
163
|
-
- **Zero-Tolerance Exploit Defense:** Requests utilizing automated vulnerability scanners, or payloads designed to bypass system constraints, are permanently blocked at the edge. Associated credentials will be revoked immediately (403 Access Denied) without refund.
|
|
164
|
-
- **Strict Quota Termination:** The 800-request quota is hard-capped to safeguard against autonomous loop runaways. Once depleted, a new license acquisition is required.
|
|
165
|
-
- **International Use Only:** Transactions originating from Japanese domestic payment networks or IP ranges are automatically rejected at the gateway level due to local tax operational constraints.
|
|
166
|
-
- **Strict Zero-Support Policy:** This open-core distribution is engineered solely for experienced engineers. We provide no interactive debugging, manual onboarding, or post-revocation appeals.
|
|
167
|
-
|
|
168
|
-
## 8. Backend Integration (Node.js)
|
|
169
|
-
|
|
170
|
-
To integrate the engine into your own server-side application (BFF), require the included kernel and instantiate it with your provisioned credentials.
|
|
171
|
-
|
|
172
|
-
```javascript
|
|
173
|
-
// Example: Integrating into your own Node.js backend
|
|
174
|
-
const ContinuumClient = require("./client-kernel.js");
|
|
175
|
-
|
|
176
|
-
// Initialize with your provisioned credentials (keep these in .env)
|
|
177
|
-
const client = new ContinuumClient(
|
|
178
|
-
process.env.CONTINUUM_ENDPOINT,
|
|
179
|
-
process.env.CONTINUUM_HEADER_NAME,
|
|
180
|
-
process.env.CONTINUUM_TOKEN,
|
|
181
|
-
process.env.GOOGLE_DOC_ID, // Optional: For Stateful BYOD mode
|
|
182
|
-
);
|
|
183
|
-
|
|
184
|
-
async function runBusinessLogic() {
|
|
185
|
-
try {
|
|
186
|
-
// .query() returns raw JSON telemetry without terminal UI blocking
|
|
187
|
-
const result = await client.query(
|
|
188
|
-
"Summarize the latest GCP Zero-Trust architecture.",
|
|
189
|
-
);
|
|
190
|
-
console.log("SI Response:", result.ai_response);
|
|
191
|
-
console.log("Tokens Saved:", result.finops_report.tokens_saved);
|
|
192
|
-
} catch (error) {
|
|
193
|
-
console.error("Inference Failed:", error.message);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
runBusinessLogic();
|
|
198
|
-
```
|
|
133
|
+
> ๐ฌ **Action-Oriented Builders' Guild:** [Read the Charter & Join the Discussion here](https://github.com/individual-app-developers-cmck/continuum-engine/discussions/1)
|
package/client-kernel.js
CHANGED
|
@@ -26,15 +26,23 @@ class ContinuumClient {
|
|
|
26
26
|
*/
|
|
27
27
|
async ask(message) {
|
|
28
28
|
if (!this.continuumToken || !this.authHeaderName) {
|
|
29
|
-
console.error(
|
|
29
|
+
console.error(
|
|
30
|
+
"๐จ Error: Access credentials or header name are not configured.\n" +
|
|
31
|
+
"๐ Please read the official documentation to learn how to obtain your credentials:\n" +
|
|
32
|
+
" https://www.npmjs.com/package/continuum-engine-client\n"
|
|
33
|
+
);
|
|
30
34
|
return;
|
|
31
35
|
}
|
|
32
|
-
|
|
33
|
-
process.stdout.write(
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
process.stdout.write(
|
|
38
|
+
"\nโณ ASI-OPEX Engine: Executing inference & cost purge..."
|
|
39
|
+
);
|
|
40
|
+
const spinner = ["โ ", "โ ", "โ น", "โ ธ", "โ ผ", "โ ด", "โ ฆ", "โ ง", "โ ", "โ "];
|
|
35
41
|
let i = 0;
|
|
36
42
|
const interval = setInterval(() => {
|
|
37
|
-
process.stdout.write(
|
|
43
|
+
process.stdout.write(
|
|
44
|
+
`\rโณ ASI-OPEX Engine: Executing inference & cost purge... ${spinner[i]} `
|
|
45
|
+
);
|
|
38
46
|
i = (i + 1) % spinner.length;
|
|
39
47
|
}, 100);
|
|
40
48
|
|
|
@@ -43,24 +51,28 @@ class ContinuumClient {
|
|
|
43
51
|
method: "POST",
|
|
44
52
|
headers: {
|
|
45
53
|
"Content-Type": "application/json",
|
|
46
|
-
[this.authHeaderName]: this.continuumToken
|
|
54
|
+
[this.authHeaderName]: this.continuumToken,
|
|
47
55
|
},
|
|
48
56
|
body: JSON.stringify({
|
|
49
57
|
message: message,
|
|
50
58
|
docId: this.docId,
|
|
51
|
-
sessionId: this.sessionId
|
|
52
|
-
})
|
|
59
|
+
sessionId: this.sessionId,
|
|
60
|
+
}),
|
|
53
61
|
});
|
|
54
|
-
|
|
62
|
+
|
|
55
63
|
clearInterval(interval);
|
|
56
|
-
process.stdout.write(
|
|
57
|
-
|
|
64
|
+
process.stdout.write(
|
|
65
|
+
"\rโ
Inference & Security Audit Completed! \n"
|
|
66
|
+
);
|
|
67
|
+
|
|
58
68
|
const data = await response.json();
|
|
59
69
|
if (!response.ok) {
|
|
60
|
-
console.error(
|
|
70
|
+
console.error(
|
|
71
|
+
`\nโ API Error (${response.status}): ${data.error || "Unknown Error"}`
|
|
72
|
+
);
|
|
61
73
|
return;
|
|
62
74
|
}
|
|
63
|
-
|
|
75
|
+
|
|
64
76
|
this._renderResponse(data);
|
|
65
77
|
} catch (error) {
|
|
66
78
|
clearInterval(interval);
|
|
@@ -73,26 +85,32 @@ class ContinuumClient {
|
|
|
73
85
|
*/
|
|
74
86
|
async query(message) {
|
|
75
87
|
if (!this.continuumToken || !this.authHeaderName) {
|
|
76
|
-
throw new Error(
|
|
88
|
+
throw new Error(
|
|
89
|
+
"๐จ Error: Access credentials or header name are not configured.\n" +
|
|
90
|
+
"๐ Please read the official documentation to learn how to obtain your credentials:\n" +
|
|
91
|
+
" https://www.npmjs.com/package/continuum-engine-client"
|
|
92
|
+
);
|
|
77
93
|
}
|
|
78
94
|
const response = await fetch(this.endpointUrl, {
|
|
79
95
|
method: "POST",
|
|
80
96
|
headers: {
|
|
81
97
|
"Content-Type": "application/json",
|
|
82
|
-
[this.authHeaderName]: this.continuumToken
|
|
98
|
+
[this.authHeaderName]: this.continuumToken,
|
|
83
99
|
},
|
|
84
100
|
body: JSON.stringify({
|
|
85
101
|
message: message,
|
|
86
102
|
docId: this.docId,
|
|
87
|
-
sessionId: this.sessionId
|
|
88
|
-
})
|
|
103
|
+
sessionId: this.sessionId,
|
|
104
|
+
}),
|
|
89
105
|
});
|
|
90
|
-
|
|
106
|
+
|
|
91
107
|
const data = await response.json();
|
|
92
108
|
if (!response.ok) {
|
|
93
|
-
throw new Error(
|
|
109
|
+
throw new Error(
|
|
110
|
+
`API Error (${response.status}): ${data.error || "Unknown Error"}`
|
|
111
|
+
);
|
|
94
112
|
}
|
|
95
|
-
|
|
113
|
+
|
|
96
114
|
return data;
|
|
97
115
|
}
|
|
98
116
|
|
|
@@ -100,14 +118,20 @@ class ContinuumClient {
|
|
|
100
118
|
* Internal Method: Terminal visualization logic for response data
|
|
101
119
|
*/
|
|
102
120
|
_renderResponse(data) {
|
|
103
|
-
const {
|
|
104
|
-
|
|
121
|
+
const {
|
|
122
|
+
ai_response,
|
|
123
|
+
source_urls,
|
|
124
|
+
remaining_requests,
|
|
125
|
+
finops_report,
|
|
126
|
+
doc_id,
|
|
127
|
+
} = data;
|
|
128
|
+
|
|
105
129
|
console.log("\n==================================================");
|
|
106
130
|
console.log("๐ค [AI RESPONSE]");
|
|
107
131
|
console.log("==================================================");
|
|
108
132
|
console.log(ai_response);
|
|
109
133
|
console.log("--------------------------------------------------");
|
|
110
|
-
|
|
134
|
+
|
|
111
135
|
if (source_urls && source_urls.length > 0) {
|
|
112
136
|
console.log("๐ [VERIFIED PRIMARY SOURCES]");
|
|
113
137
|
source_urls.forEach((src, idx) => {
|
|
@@ -115,26 +139,38 @@ class ContinuumClient {
|
|
|
115
139
|
});
|
|
116
140
|
console.log("--------------------------------------------------");
|
|
117
141
|
}
|
|
118
|
-
|
|
142
|
+
|
|
119
143
|
if (doc_id) {
|
|
120
|
-
console.log(
|
|
144
|
+
console.log(
|
|
145
|
+
`๐ [STATE STORAGE] History successfully synced to your private document.`
|
|
146
|
+
);
|
|
121
147
|
console.log("--------------------------------------------------");
|
|
122
148
|
}
|
|
123
149
|
|
|
124
150
|
if (finops_report && finops_report.breakdown) {
|
|
125
151
|
const br = finops_report.breakdown;
|
|
126
152
|
console.log("๐ [FINOPS TELEMETRY BREAKDOWN]");
|
|
127
|
-
console.log(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
153
|
+
console.log(
|
|
154
|
+
` โโ T_input (Optimized Prompt) : ${br.t_input_optimized} tokens`
|
|
155
|
+
);
|
|
156
|
+
console.log(
|
|
157
|
+
` โโ T_grounding (Dynamic Search) : ${br.t_grounding_dynamic} tokens`
|
|
158
|
+
);
|
|
159
|
+
console.log(
|
|
160
|
+
` โโ T_output (Generated Result) : ${br.t_output_generated} tokens`
|
|
161
|
+
);
|
|
162
|
+
|
|
131
163
|
if (finops_report.tokens_saved > 0) {
|
|
132
|
-
console.log(
|
|
164
|
+
console.log(
|
|
165
|
+
` ๐ก๏ธ Edge Purge (Tokens Prevented) : ${finops_report.tokens_saved} tokens`
|
|
166
|
+
);
|
|
133
167
|
}
|
|
134
|
-
console.log(
|
|
168
|
+
console.log(
|
|
169
|
+
` ๐ Net Billed Consumption : ${finops_report.billed_tokens} tokens`
|
|
170
|
+
);
|
|
135
171
|
console.log("==================================================");
|
|
136
172
|
}
|
|
137
|
-
|
|
173
|
+
|
|
138
174
|
console.log(`๐ณ Quota Balance: ${remaining_requests} requests remaining`);
|
|
139
175
|
console.log("==================================================\n");
|
|
140
176
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "continuum-engine-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Cut LLM runaway token costs by up to 82% at the edge. Zero-Trust FinOps routing middleware & BYOD state controller for Gemini / Vertex AI.",
|
|
5
5
|
"main": "client-kernel.js",
|
|
6
|
-
"author": "
|
|
7
|
-
"license": "MIT"
|
|
6
|
+
"author": "individual-app-developers-cmck",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/individual-app-developers-cmck/continuum-engine.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/individual-app-developers-cmck/continuum-engine",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"finops",
|
|
15
|
+
"zero-trust",
|
|
16
|
+
"agentic-ai",
|
|
17
|
+
"rag",
|
|
18
|
+
"llm-gateway",
|
|
19
|
+
"token-optimization",
|
|
20
|
+
"bff"
|
|
21
|
+
]
|
|
8
22
|
}
|
package/run_simulator.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// demo-continuum.js
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// Continuum Engine - Local FinOps Simulator (Demo Trial)
|
|
4
|
+
// ============================================================================
|
|
5
|
+
// โ ๏ธ This is a simulated DEMO. No actual cloud infrastructure is consumed.
|
|
6
|
+
// To protect the backend, the live endpoint is strictly provisioned post-activation.
|
|
7
|
+
|
|
8
|
+
// ใฆใผใถใผใๅ
ฅๅใใ่ณชๅใๅๅพ๏ผใชใใใฐใใใฉใซใ๏ผ
|
|
9
|
+
const demoMessage = process.argv.slice(2).join(" ") || "Summarize the GCP Zero-Trust architecture in 3 bullet points.";
|
|
10
|
+
|
|
11
|
+
console.log("\n๐ Welcome to the Continuum Engine Local Simulator");
|
|
12
|
+
console.log("------------------------------------------------------------");
|
|
13
|
+
console.log(`Processing request: "${demoMessage}"\n`);
|
|
14
|
+
|
|
15
|
+
process.stdout.write("โณ ASI-OPEX Engine: Executing inference & cost purge...");
|
|
16
|
+
|
|
17
|
+
const spinner = ["โ ", "โ ", "โ น", "โ ธ", "โ ผ", "โ ด", "โ ฆ", "โ ง", "โ ", "โ "];
|
|
18
|
+
let i = 0;
|
|
19
|
+
const interval = setInterval(() => {
|
|
20
|
+
process.stdout.write(`\rโณ ASI-OPEX Engine: Executing inference & cost purge... ${spinner[i]} `);
|
|
21
|
+
i = (i + 1) % spinner.length;
|
|
22
|
+
}, 100);
|
|
23
|
+
|
|
24
|
+
// ๆจ่ซใฎ้ใใๆผๅบใใ็ไผผ้
ๅปถ (2.5็ง)
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
clearInterval(interval);
|
|
27
|
+
process.stdout.write("\rโ
Inference & Security Audit Completed! \n");
|
|
28
|
+
|
|
29
|
+
console.log("\n==================================================");
|
|
30
|
+
console.log("๐ค [AI RESPONSE - SIMULATED]");
|
|
31
|
+
console.log("==================================================");
|
|
32
|
+
console.log(`(This is a simulated offline response for your query: "${demoMessage}")\n`);
|
|
33
|
+
console.log("Zero-Trust architectures dictate that no implicit trust is granted based solely on network location. The Continuum Engine enforces this at Gate 0.\n\n(โป The production engine dynamically fetches live architectural facts via Vertex AI Grounding.)");
|
|
34
|
+
|
|
35
|
+
console.log("--------------------------------------------------");
|
|
36
|
+
console.log("๐ [VERIFIED PRIMARY SOURCES]");
|
|
37
|
+
console.log(" 1. Google Cloud: BeyondCorp Enterprise Overview\n (URI masked in Demo Mode)");
|
|
38
|
+
|
|
39
|
+
console.log("--------------------------------------------------");
|
|
40
|
+
console.log("๐ [STATE STORAGE] History successfully synced to your private document. (Simulated)");
|
|
41
|
+
|
|
42
|
+
console.log("--------------------------------------------------");
|
|
43
|
+
console.log("๐ [FINOPS TELEMETRY BREAKDOWN]");
|
|
44
|
+
console.log(" โโ T_input (Optimized Prompt) : 142 tokens");
|
|
45
|
+
console.log(" โโ T_grounding (Dynamic Search) : 4,850 tokens <-- Invisible infrastructure labor");
|
|
46
|
+
console.log(" โโ T_output (Generated Result) : 320 tokens");
|
|
47
|
+
console.log(" ๐ก๏ธ Edge Purge (Tokens Prevented) : 1,200 tokens <-- Shielded by Gate 0");
|
|
48
|
+
console.log(" ๐ Net Billed Consumption : 5,312 tokens");
|
|
49
|
+
console.log("==================================================");
|
|
50
|
+
console.log("๐ณ Quota Balance: โ (Demo Mode)");
|
|
51
|
+
console.log("==================================================\n");
|
|
52
|
+
|
|
53
|
+
// ========================================================================
|
|
54
|
+
// ๐ธ URLใๆธใใใซใญใผใซใซใฎHTMLใธ่ชๅฐใใๅฎๅ
จใชCTA
|
|
55
|
+
// ========================================================================
|
|
56
|
+
console.log("๐ก [END OF DEMO]");
|
|
57
|
+
console.log("To unlock live grounding and protect your real infrastructure,");
|
|
58
|
+
console.log("you must provision your private API key and endpoint.");
|
|
59
|
+
console.log("๐ Please open 'setup.html' in your web browser to activate your production environment.\n");
|
|
60
|
+
|
|
61
|
+
}, 2500);
|