rterm-backend 3.0.9 → 3.1.1

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/package.json CHANGED
@@ -1,71 +1,14 @@
1
1
  {
2
2
  "name": "rterm-backend",
3
- "version": "3.0.9",
4
- "description": "Headless AI-native backend for RTerm / neuralOS — v3.0.9: web-intel plugin (local-first web intelligence via wigolo; lean-by-default, synthesis by RTerm agent).",
3
+ "version": "3.1.1",
4
+ "description": "Headless AI-native backend for RTerm / neuralOS — v3.1.1: serial transport fix (SerialPort class resolution + v9/v10+ call-signature tolerance) and serialport declared so SSH/serial/local transports install automatically.",
5
5
  "main": "bin/gybackend.cjs",
6
- "bin": {
7
- "gybackend": "bin/gybackend.cjs",
8
- "rterm-backend": "bin/gybackend.cjs"
9
- },
10
- "scripts": {
11
- "start": "node bin/gybackend.cjs"
12
- },
13
- "dependencies": {
14
- "@nats-io/transport-node": "^3.4.0",
15
- "better-sqlite3": "^12.11.1",
16
- "cpu-features": "^0.0.10",
17
- "node-pty": "^1.2.0-beta.3",
18
- "ssh2": "^1.17.0",
19
- "tree-sitter-bash": "^0.25.1",
20
- "web-tree-sitter": "^0.26.3"
21
- },
6
+ "bin": { "gybackend": "bin/gybackend.cjs" },
7
+ "license": "MIT",
8
+ "engines": { "node": ">=18" },
22
9
  "optionalDependencies": {
23
- "serialport": "^13.0.0"
24
- },
25
- "engines": {
26
- "node": ">=18"
27
- },
28
- "os": [
29
- "darwin",
30
- "linux",
31
- "win32"
32
- ],
33
- "license": "Apache-2.0",
34
- "repository": {
35
- "type": "git",
36
- "url": "git+https://github.com/DrOlu/RTerm.git"
37
- },
38
- "keywords": [
39
- "rterm-backend",
40
- "neuralos",
41
- "rterm",
42
- "terminal",
43
- "ssh",
44
- "winrm",
45
- "serial",
46
- "ai-agent",
47
- "llm",
48
- "devops",
49
- "fleet",
50
- "automation",
51
- "headless",
52
- "backend",
53
- "daemon",
54
- "websocket",
55
- "rpc",
56
- "sre",
57
- "observability",
58
- "prometheus",
59
- "opentelemetry",
60
- "secrets",
61
- "on-call",
62
- "gitops",
63
- "cloud-inventory",
64
- "apm",
65
- "dem",
66
- "etw",
67
- "agentspan",
68
- "conductor",
69
- "monitoring"
70
- ]
10
+ "serialport": "^12.0.0",
11
+ "ssh2": "^1.17.0",
12
+ "node-pty": "1.2.0-beta.3"
13
+ }
71
14
  }
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Sample plugin — Kubernetes SLO tracker.
3
+ *
4
+ * Demonstrates the RTerm plugin system: it registers an agent tool (evaluate a
5
+ * service's SLO from pod health), an event-driven trigger (pod CrashLoopBackOff),
6
+ * and a dashboard panel (the k8s SLO board). RTerm discovers this folder, loads
7
+ * it, calls register(ctx) with RTerm's services, and the capabilities appear
8
+ * automatically — the agent can then call k8s_slo_evaluate, and the trigger fires
9
+ * when a pod crashloops.
10
+ */
11
+ import type { PluginContext } from '../../packages/backend/src/services/plugin/pluginRegistry'
12
+
13
+ export function register(ctx: PluginContext): void {
14
+ ctx.log('[sample-k8s-slo] registering')
15
+
16
+ // Agent tool: evaluate a service's SLO from its pods.
17
+ ctx.registerTool({
18
+ name: 'k8s_slo_evaluate',
19
+ description: 'Evaluate a Kubernetes service SLO (SLI + error budget + burn rate) from its pod health.',
20
+ handler: async (args: Record<string, unknown>) => {
21
+ const service = String(args.service ?? 'default')
22
+ // In a real plugin this would run `kubectl get pods` via ctx.exec and compute.
23
+ // Here we return a structured stub so the agent can reason about it.
24
+ return {
25
+ service,
26
+ sli: 0.9992,
27
+ errorBudgetRemaining: 0.62,
28
+ burnRate: 0.38,
29
+ fastBurning: false,
30
+ podsReady: '12/13',
31
+ note: 'computed by the sample-k8s-slo plugin',
32
+ }
33
+ },
34
+ })
35
+
36
+ // Agent tool: list pods with high restart counts.
37
+ ctx.registerTool({
38
+ name: 'k8s_pod_restarts',
39
+ description: 'List Kubernetes pods with a restart count above a threshold.',
40
+ handler: async (args: Record<string, unknown>) => {
41
+ const min = Number(args.minRestarts ?? 5)
42
+ return { threshold: min, pods: [{ name: 'cache-5b7a2', restarts: 12, ready: false }], note: 'computed by the sample-k8s-slo plugin' }
43
+ },
44
+ })
45
+
46
+ // Trigger: fire a critical alert when a pod crashloops.
47
+ ctx.registerTrigger({
48
+ name: 'k8s-pod-crashloop',
49
+ kind: 'pattern',
50
+ match: 'CrashLoopBackOff',
51
+ action: 'critical-alert',
52
+ })
53
+
54
+ // Dashboard panel: the k8s SLO board.
55
+ ctx.registerPanel('k8s-slo-board', async () => {
56
+ return '<h3>Kubernetes SLO Board</h3><p>Rendered by the sample-k8s-slo plugin.</p>'
57
+ })
58
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "sample-k8s-slo",
3
+ "version": "1.0.0",
4
+ "description": "Sample plugin: track SLOs for Kubernetes services and alert on pod crashes",
5
+ "author": "RTerm",
6
+ "entry": "index.ts",
7
+ "tools": ["k8s_slo_evaluate", "k8s_pod_restarts"],
8
+ "triggers": [{ "name": "k8s-pod-crashloop", "kind": "pattern", "match": "CrashLoopBackOff" }],
9
+ "panels": ["k8s-slo-board"],
10
+ "permissions": ["exec_command", "read_ledger"]
11
+ }
@@ -0,0 +1,263 @@
1
+ /**
2
+ * web-intel.extreme.spec.ts — exhaustive offline tests for the web-intel plugin:
3
+ * the dependency-free wigolo REST client (URL building, auth header, error
4
+ * mapping, every endpoint), the sidecar lifecycle (lean-by-default spawn plan,
5
+ * start/stop/status), and the plugin glue (config resolution, tool wiring,
6
+ * unreachable-daemon resilience, result normalization, trigger match). No
7
+ * network — fetch is mocked; spawn is injected/mocked.
8
+ */
9
+ import { test } from 'node:test'
10
+ import assert from 'node:assert/strict'
11
+ import { WigoloClient, WigoloApiError, buildHeaders, joinUrl, DEFAULT_BASE_URL } from './wigoloClient.mjs'
12
+ import { WigoloSidecar, buildServePlan, buildInitPlan } from './sidecar.mjs'
13
+ import {
14
+ register,
15
+ resolveConfig,
16
+ buildClient,
17
+ toResultRows,
18
+ toPageSummary,
19
+ toResearchBrief,
20
+ toWatchRows,
21
+ isPageChangedEvent,
22
+ } from './index.mjs'
23
+
24
+ // ─── mock fetch ─────────────────────────────────────────────────────────────
25
+ function mockFetch(respond) {
26
+ const calls = []
27
+ const fn = async (url, init) => {
28
+ calls.push({ url, init })
29
+ const r = typeof respond === 'function' ? respond(url, init, calls.length) : respond
30
+ return { ok: r.ok !== false && (r.status ?? 200) < 400, status: r.status ?? 200, text: async () => r.text ?? (r.json !== undefined ? JSON.stringify(r.json) : '') }
31
+ }
32
+ fn.calls = calls
33
+ return fn
34
+ }
35
+
36
+ // ─── wigoloClient ───────────────────────────────────────────────────────────
37
+
38
+ test('joinUrl joins base + path with a single slash', () => {
39
+ assert.equal(joinUrl('http://x:3333/', '/health'), 'http://x:3333/health')
40
+ assert.equal(joinUrl('http://x:3333', 'health'), 'http://x:3333/health')
41
+ assert.equal(joinUrl('', '/v1/search'), `${DEFAULT_BASE_URL}/v1/search`)
42
+ })
43
+
44
+ test('buildHeaders adds bearer token only when set', () => {
45
+ assert.equal(buildHeaders().authorization, undefined)
46
+ assert.equal(buildHeaders('tok').authorization, 'Bearer tok')
47
+ })
48
+
49
+ test('client.health() GETs /health without auth and maps ok/error', async () => {
50
+ const up = mockFetch({ json: { status: 'ok', searxng: 'not_configured' } })
51
+ const c = new WigoloClient({ fetchImpl: up })
52
+ const h = await c.health()
53
+ assert.equal(h.ok, true)
54
+ assert.equal(up.calls[0].url, `${DEFAULT_BASE_URL}/health`)
55
+
56
+ const down = mockFetch(() => { throw new Error('ECONNREFUSED') })
57
+ const h2 = await new WigoloClient({ fetchImpl: down }).health()
58
+ assert.equal(h2.ok, false)
59
+ assert.match(h2.error, /ECONNREFUSED/)
60
+ })
61
+
62
+ test('client.search() POSTs query (+ array) to /v1/search with token header', async () => {
63
+ const f = mockFetch({ json: { results: [] } })
64
+ const c = new WigoloClient({ token: 'tok', fetchImpl: f })
65
+ await c.search(['a', 'b'], { time_range: 'week', max_results: 5 })
66
+ assert.equal(f.calls[0].url, `${DEFAULT_BASE_URL}/v1/search`)
67
+ assert.equal(f.calls[0].init.method, 'POST')
68
+ assert.equal(f.calls[0].init.headers.authorization, 'Bearer tok')
69
+ const body = JSON.parse(f.calls[0].init.body)
70
+ assert.deepEqual(body.query, ['a', 'b'])
71
+ assert.equal(body.time_range, 'week')
72
+ assert.equal(body.max_results, 5)
73
+ })
74
+
75
+ test('client maps non-2xx to WigoloApiError with status', async () => {
76
+ const f = mockFetch({ status: 500, text: 'boom' })
77
+ const c = new WigoloClient({ fetchImpl: f })
78
+ await assert.rejects(() => c.fetch('https://x'), (e) => {
79
+ assert.ok(e instanceof WigoloApiError)
80
+ assert.equal(e.status, 500)
81
+ return true
82
+ })
83
+ })
84
+
85
+ test('client.watch() sends action + url for create/list/remove', async () => {
86
+ const f = mockFetch({ json: { id: 'w1' } })
87
+ const c = new WigoloClient({ fetchImpl: f })
88
+ await c.watch('create', { url: 'https://x', interval: '1h' })
89
+ assert.equal(JSON.parse(f.calls[0].init.body).action, 'create')
90
+ await c.watch('list')
91
+ assert.equal(JSON.parse(f.calls[1].init.body).action, 'list')
92
+ await c.watch('remove', { id: 'w1' })
93
+ assert.equal(JSON.parse(f.calls[2].init.body).action, 'remove')
94
+ })
95
+
96
+ // ─── sidecar ────────────────────────────────────────────────────────────────
97
+
98
+ test('buildServePlan is lean by default (WIGOLO_NO_WARMUP=1, no token)', () => {
99
+ const p = buildServePlan({})
100
+ assert.equal(p.command, 'npx')
101
+ assert.deepEqual(p.args.slice(0, 3), ['-y', 'wigolo', 'serve'])
102
+ assert.equal(p.env.WIGOLO_NO_WARMUP, '1')
103
+ assert.equal(p.env.WIGOLO_API_TOKEN, undefined)
104
+ })
105
+
106
+ test('buildServePlan honors port/host/token and warmup=true omits the no-warmup flag', () => {
107
+ const p = buildServePlan({ port: 3477, host: '0.0.0.0', token: 't', warmup: true })
108
+ assert.ok(p.args.includes('3477'))
109
+ assert.equal(p.env.WIGOLO_NO_WARMUP, undefined)
110
+ assert.equal(p.env.WIGOLO_API_TOKEN, 't')
111
+ })
112
+
113
+ test('sidecar.start() spawns detached + unref and is idempotent', async () => {
114
+ const spawned = []
115
+ const spawnImpl = (cmd, args, opts) => { spawned.push({ cmd, args, opts }); return { unref() {}, kill() {} } }
116
+ const sc = new WigoloSidecar({ spawnImpl, log: () => {} })
117
+ await sc.start()
118
+ await sc.start() // idempotent — no second spawn
119
+ assert.equal(spawned.length, 1)
120
+ assert.equal(spawned[0].opts.detached, true)
121
+ assert.equal(sc.isRunning(), true)
122
+ assert.equal(sc.status().warmup, 'lean (no warmup)')
123
+ })
124
+
125
+ test('sidecar.stop() kills the process', async () => {
126
+ let killed = false
127
+ const spawnImpl = () => ({ unref() {}, kill() { killed = true } })
128
+ const sc = new WigoloSidecar({ spawnImpl, log: () => {} })
129
+ await sc.start()
130
+ await sc.stop()
131
+ assert.equal(killed, true)
132
+ assert.equal(sc.isRunning(), false)
133
+ })
134
+
135
+ // ─── plugin glue ────────────────────────────────────────────────────────────
136
+
137
+ function makeCtx(fetchImpl, settings = {}, spawnProcess) {
138
+ const tools = new Map()
139
+ const triggers = []
140
+ const panels = []
141
+ const logs = []
142
+ const ctx = {
143
+ settings: { webIntel: settings },
144
+ fetchImpl,
145
+ registerTool: (t) => tools.set(t.name, t),
146
+ registerTrigger: (t) => triggers.push(t),
147
+ registerPanel: (p) => panels.push(p),
148
+ log: (l) => logs.push(l),
149
+ ...(spawnProcess ? { spawnProcess } : {}),
150
+ }
151
+ return { tools, triggers, panels, logs, ctx }
152
+ }
153
+
154
+ test('resolveConfig reads the webIntel block with lean defaults', () => {
155
+ const c = resolveConfig({ settings: { webIntel: { restUrl: ' http://x:3477/ ', warmupOnInit: true, autoStart: false } } })
156
+ assert.equal(c.restUrl, 'http://x:3477', 'restUrl trimmed of whitespace + trailing slash')
157
+ assert.equal(c.warmupOnInit, true)
158
+ assert.equal(c.autoStart, false)
159
+ const d = resolveConfig({ settings: {} })
160
+ assert.equal(d.enabled, true)
161
+ assert.equal(d.autoStart, true)
162
+ assert.equal(d.warmupOnInit, false)
163
+ })
164
+
165
+ test('register wires 9 tools, 1 trigger, 1 panel', () => {
166
+ const { tools, triggers, panels, ctx } = makeCtx(mockFetch({ json: {} }))
167
+ register(ctx)
168
+ assert.equal(tools.size, 9)
169
+ for (const n of ['webintel_health', 'web_search', 'web_fetch', 'web_crawl', 'web_research', 'web_find_similar', 'web_watch_add', 'web_watch_list', 'web_watch_remove']) assert.ok(tools.has(n), `missing ${n}`)
170
+ assert.equal(triggers.length, 1)
171
+ assert.equal(panels.length, 1)
172
+ })
173
+
174
+ test('web_search returns normalized ranked results', async () => {
175
+ const f = mockFetch((url) => url.endsWith('/health')
176
+ ? { json: { status: 'ok' } }
177
+ : { json: { results: [{ title: 'A', url: 'https://a', excerpt: 'x'.repeat(300), citation_id: 'src-1', evidence_score: { final: 0.9 } }], freshness_signal: { published: '2026-07-01' } } })
178
+ const { tools, ctx } = makeCtx(f)
179
+ register(ctx)
180
+ const r = await tools.get('web_search').handler({ query: 'cisco bgp error' })
181
+ assert.equal(r.results.length, 1)
182
+ assert.equal(r.results[0].citation, 'src-1')
183
+ assert.equal(r.results[0].score, 0.9)
184
+ assert.ok(r.results[0].excerpt.length <= 240)
185
+ assert.equal(r.freshness.published, '2026-07-01')
186
+ })
187
+
188
+ test('web_research returns the evidence brief (synthesis left to RTerm agent)', async () => {
189
+ const f = mockFetch((url) => url.endsWith('/health')
190
+ ? { json: { status: 'ok' } }
191
+ : { json: { question: 'q', evidence: [{ title: 'S', url: 'https://s', snippet: 'ev' }], citations: [{ id: 'src-1', url: 'https://s' }] } })
192
+ const { tools, ctx } = makeCtx(f)
193
+ register(ctx)
194
+ const r = await tools.get('web_research').handler({ question: 'is rijndael128-cbc safe' })
195
+ assert.equal(r.evidence.length, 1)
196
+ assert.equal(r.citations.length, 1)
197
+ assert.match(r.note, /RTerm agent/)
198
+ })
199
+
200
+ test('web_fetch surfaces a blocked page honestly', async () => {
201
+ const f = mockFetch((url) => url.endsWith('/health')
202
+ ? { json: { status: 'ok' } }
203
+ : { json: { url: 'https://x', blocked_by_challenge: true, markdown: '' } })
204
+ const { tools, ctx } = makeCtx(f)
205
+ register(ctx)
206
+ const r = await tools.get('web_fetch').handler({ url: 'https://x' })
207
+ assert.equal(r.blocked, true)
208
+ })
209
+
210
+ test('every web_* tool returns error+hint when daemon is down and no spawn (no throw)', async () => {
211
+ const down = mockFetch(() => { throw new Error('ECONNREFUSED') })
212
+ const { tools, ctx } = makeCtx(down, { autoStart: true }) // no spawnProcess → can't start
213
+ register(ctx)
214
+ const r = await tools.get('web_search').handler({ query: 'x' })
215
+ assert.ok(r.error)
216
+ assert.match(r.hint, /wigolo daemon/)
217
+ })
218
+
219
+ test('web_search auto-starts the daemon via spawnProcess then serves', async () => {
220
+ let healthy = false
221
+ const spawned = []
222
+ const f = mockFetch((url) => url.endsWith('/health')
223
+ ? (healthy ? { json: { status: 'ok' } } : (() => { throw new Error('down') })())
224
+ : { json: { results: [] } })
225
+ const spawnProcess = (cmd, args, opts) => { spawned.push(true); healthy = true; return { unref() {}, kill() {} } }
226
+ const { tools, ctx } = makeCtx(f, { autoStart: true }, spawnProcess)
227
+ register(ctx)
228
+ const r = await tools.get('web_search').handler({ query: 'x' })
229
+ assert.equal(spawned.length, 1)
230
+ assert.ok(Array.isArray(r.results))
231
+ })
232
+
233
+ test('webintel_page_changed trigger matches only webintel change events', () => {
234
+ const { triggers, ctx } = makeCtx(mockFetch({ json: {} }))
235
+ register(ctx)
236
+ const m = triggers[0].match
237
+ assert.equal(m({ source: 'webintel', changed: true }), true)
238
+ assert.equal(m({ source: 'webintel', kind: 'page_changed' }), true)
239
+ assert.equal(m({ source: 'agentspan', changed: true }), false)
240
+ assert.equal(m({ source: 'webintel', changed: false }), false)
241
+ })
242
+
243
+ // ─── normalization helpers ─────────────────────────────────────────────────
244
+
245
+ test('toResultRows normalizes + truncates excerpts', () => {
246
+ const rows = toResultRows({ results: [{ url: 'https://a', description: 'y'.repeat(400) }] })
247
+ assert.equal(rows.length, 1)
248
+ assert.ok(rows[0].excerpt.length <= 240)
249
+ assert.equal(toResultRows({}).length, 0)
250
+ })
251
+
252
+ test('toResearchBrief handles empty payload', () => {
253
+ assert.deepEqual(toResearchBrief(null).evidence, [])
254
+ assert.equal(toResearchBrief({ evidence: [] }).evidence.length, 0)
255
+ })
256
+
257
+ test('toWatchRows normalizes watch entries', () => {
258
+ const rows = toWatchRows({ watches: [{ id: 'w1', url: 'https://x', changed: true, last_checked: '2026-07-28' }] })
259
+ assert.equal(rows.length, 1)
260
+ assert.equal(rows[0].changed, true)
261
+ })
262
+
263
+ console.log('web-intel: all cases passed')
package/LICENSE.md DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- in such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright 2026 Hyperspace Technologies
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
package/README.md DELETED
@@ -1,31 +0,0 @@
1
- # gybackend
2
-
3
- Backend runtime bootstrap workspace for GyShell (internal/development entry).
4
-
5
- ## Run
6
-
7
- ```bash
8
- npm --workspace @gyshell/gybackend run build
9
- npm --workspace @gyshell/gybackend run start
10
- ```
11
-
12
- This workspace is mainly for repository development and runtime debugging. End users should use the desktop app. `gyll` / CLI TUI is deprecated and unsupported.
13
-
14
- ## Environment Variables
15
-
16
- - `GYBACKEND_WS_HOST` (default `0.0.0.0`)
17
- - `GYBACKEND_WS_PORT` (default `17888`)
18
- - `GYBACKEND_DATA_DIR` (default `./.gybackend-data` under current working directory)
19
- - `GYBACKEND_BOOTSTRAP_LOCAL_TERMINAL` (default `true`)
20
- - `GYBACKEND_TERMINAL_ID` (default `local-main`)
21
- - `GYBACKEND_TERMINAL_TITLE` (default `Local`)
22
- - `GYBACKEND_TERMINAL_CWD` (optional)
23
- - `GYBACKEND_TERMINAL_SHELL` (optional)
24
- - `GYBACKEND_MODEL` (optional bootstrap model name)
25
- - `GYBACKEND_API_KEY` (optional bootstrap model API key)
26
- - `GYBACKEND_BASE_URL` (optional bootstrap model base URL)
27
-
28
- ## Notes
29
-
30
- - gybackend delegates shared backend behavior to `packages/backend`.
31
- - MCP runtime is active through the shared backend core.