SNAPKITTYWEST commited on
Commit
fdc73fd
·
verified ·
1 Parent(s): ff2fc04

push from SNAPKITTYWEST/git-command-center

Browse files
Files changed (7) hide show
  1. LICENSE +59 -0
  2. README.md +27 -0
  3. app.html +49 -0
  4. gitdos.css +183 -0
  5. gitdos.js +409 -0
  6. index.html +159 -0
  7. manifest.json +12 -0
LICENSE ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ SOVEREIGN SOURCE LICENSE v1.0
2
+ Copyright (c) 2026 Ahmad Ali Parr -- Bel Esprit D'Accord Trust
3
+ SnapKitty Collective -- All Sovereign Rights Reserved
4
+
5
+ WORM SEALED -- Evidence or Silence
6
+
7
+ GRANT OF RIGHTS
8
+
9
+ Permission is hereby granted, free of charge, to any person
10
+ obtaining a copy of this software and associated documentation
11
+ files (the "Work"), to use, study, copy, and modify the Work
12
+ for personal, educational, and non-commercial purposes, subject
13
+ to the following conditions:
14
+
15
+ 1. ATTRIBUTION
16
+ All copies, modifications, or derivative works must carry
17
+ the following notice, visibly and without alteration:
18
+
19
+ "Built on Sovereign Source -- Bel Esprit D'Accord Trust
20
+ (c) 2026 Ahmad Ali Parr -- snapkittywest.github.io"
21
+
22
+ 2. NON-COMMERCIAL USE
23
+ Commercial use of this Work -- including but not limited to
24
+ use in products, services, training datasets, or AI model
25
+ training -- requires express written permission from
26
+ Bel Esprit D'Accord Trust.
27
+
28
+ 3. TRAINING DATA RESTRICTION
29
+ This Work and its contents may NOT be used to train, fine-tune,
30
+ evaluate, or benchmark any machine learning model, large language
31
+ model, or AI system without express written permission from
32
+ Bel Esprit D'Accord Trust. This restriction applies regardless
33
+ of whether the use is commercial or non-commercial.
34
+
35
+ 4. SHARE-ALIKE
36
+ Any derivative work distributed publicly must be released
37
+ under this same Sovereign Source License v1.0 or later,
38
+ with full attribution chain preserved.
39
+
40
+ 5. WORM INTEGRITY
41
+ Any redistribution must preserve all WORM chain seals,
42
+ cryptographic hashes, and audit trail entries present in
43
+ the original Work.
44
+
45
+ 6. NO INSTITUTIONAL CAPTURE
46
+ No government agency, corporation, non-profit organization,
47
+ or institutional body may claim ownership, exclusive licensing,
48
+ or derivative rights over this Work without express written
49
+ trust agreement with Bel Esprit D'Accord Trust.
50
+
51
+ DISCLAIMER
52
+
53
+ THIS WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
54
+ EXPRESS OR IMPLIED.
55
+
56
+ Bel Esprit D'Accord Trust
57
+ SnapKitty Collective
58
+ snapkittywest.github.io
59
+ Evidence or Silence -- 2026
README.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GIT COMMAND CENTER — Sovereign Repository Control
2
+
3
+ ```
4
+ ╔══════════════════════════════════════╗
5
+ ║ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ║ GIT COMMAND CENTER
6
+ ║ ░ $ git log --sovereign --worm ░ ║ ──────────────────────────
7
+ ║ ░ ░ ║ TYPE Repository Control
8
+ ║ ░ ├─ [WORM·SEALED] 7f3a1b9c ░ ║ Sovereign Git Ops
9
+ ║ ░ ├─ [WORM·SEALED] 2b9cf11e ░ ║ HOOKS Pre-commit WORM
10
+ ║ ░ ├─ [WORM·SEALED] f11e4a2d ░ ║ BRANCH main · sealed
11
+ ║ ░ ├─ [WORM·SEALED] 9c3b77fa ░ ║ VERIFY Merkle root check
12
+ ║ ░ └─ [GENESIS] 2026-04-01 ░ ║
13
+ ║ ░ ░ ║ "Every commit is
14
+ ║ ░ HEAD → sovereign/main ░ ║ a sealed testimony.
15
+ ║ ░ CHAIN → MERKLE: 0x4a9f7c3b… ░ ║ Nothing forgotten."
16
+ ║ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ ║
17
+ ╚══════════════════════════════════════╝
18
+ ```
19
+
20
+ Centralized git operations hub for the SnapKitty sovereign stack.
21
+ WORM-sealed commit hooks. Merkle-anchored branch history.
22
+ Every push verified. Every merge governed.
23
+
24
+ **Seal:** Ω↺Ψ↺Δ↺Λ↺Σ↺Φ↺α
25
+ **License:** Sovereign Source License v1.0 · © 2026 Ahmad Ali Parr
26
+
27
+ ![](https://sovereign-analytics.snapkittywest.workers.dev/canary/git-command-center)
app.html ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="apple-mobile-web-app-capable" content="yes"/>
7
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
8
+ <title>Apple GitDOS — SnapKitty OS</title>
9
+ <link rel="manifest" href="manifest.json"/>
10
+ <link rel="stylesheet" href="gitdos.css">
11
+ <style>
12
+ .back-link{
13
+ position:fixed;top:10px;left:12px;z-index:99;
14
+ font-size:9px;letter-spacing:1px;color:#ffd06088;
15
+ font-family:'SF Mono',Monaco,Consolas,monospace;
16
+ text-decoration:none;
17
+ }
18
+ .back-link:hover{color:#ffd060}
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <a class="back-link" href="index.html">← BACK</a>
23
+ <main class="crt">
24
+ <header class="bezel">
25
+ <div>
26
+ <p class="eyebrow">SNAPKITTY OS / A.P.E. COMPUTER DEMO</p>
27
+ <h1>APPLE GITDOS</h1>
28
+ </div>
29
+ <nav>
30
+ <a href="index.html">HOME</a>
31
+ <button id="boot">BOOT</button>
32
+ </nav>
33
+ </header>
34
+ <section class="screen" aria-label="Apple GitDOS terminal chat">
35
+ <div id="terminal" class="terminal" role="log" aria-live="polite"></div>
36
+ <form id="command-form" autocomplete="off">
37
+ <label for="command">]</label>
38
+ <input id="command" spellcheck="false" autofocus>
39
+ </form>
40
+ </section>
41
+ <aside class="drive">
42
+ <div><span>DISK</span><strong id="disk-name">SNAPOS.DSK</strong></div>
43
+ <div><span>MODEL</span><strong id="model-name">nemotron</strong></div>
44
+ <div><span>WORM</span><strong id="worm-seal">GENESIS</strong></div>
45
+ </aside>
46
+ </main>
47
+ <script src="gitdos.js"></script>
48
+ </body>
49
+ </html>
gitdos.css ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ :root {
2
+ color-scheme: dark;
3
+ --phosphor: #35ff63;
4
+ --amber: #ffb000;
5
+ --bg: #030503;
6
+ --bezel: #141414;
7
+ --dim: #78a97e;
8
+ --line: #244629;
9
+ }
10
+
11
+ * { box-sizing: border-box; }
12
+
13
+ body {
14
+ margin: 0;
15
+ min-height: 100vh;
16
+ background:
17
+ radial-gradient(circle at 50% 18%, rgba(53, 255, 99, 0.09), transparent 28rem),
18
+ #050505;
19
+ color: var(--phosphor);
20
+ font-family: "Courier New", ui-monospace, monospace;
21
+ }
22
+
23
+ body::before {
24
+ content: "";
25
+ position: fixed;
26
+ inset: 0;
27
+ pointer-events: none;
28
+ background: repeating-linear-gradient(
29
+ to bottom,
30
+ rgba(255, 255, 255, 0.035) 0,
31
+ rgba(255, 255, 255, 0.035) 1px,
32
+ transparent 2px,
33
+ transparent 4px
34
+ );
35
+ mix-blend-mode: screen;
36
+ opacity: 0.35;
37
+ z-index: 10;
38
+ }
39
+
40
+ .crt {
41
+ width: min(1180px, calc(100% - 28px));
42
+ margin: 0 auto;
43
+ padding: 28px 0;
44
+ }
45
+
46
+ .bezel {
47
+ display: flex;
48
+ justify-content: space-between;
49
+ gap: 18px;
50
+ align-items: end;
51
+ padding: 18px 20px;
52
+ border: 2px solid #272727;
53
+ border-bottom: 0;
54
+ border-radius: 18px 18px 0 0;
55
+ background: linear-gradient(180deg, #202020, #0e0e0e);
56
+ }
57
+
58
+ .eyebrow {
59
+ margin: 0 0 8px;
60
+ color: var(--amber);
61
+ font-size: 0.78rem;
62
+ }
63
+
64
+ h1 {
65
+ margin: 0;
66
+ color: var(--phosphor);
67
+ font-size: clamp(2rem, 7vw, 4.4rem);
68
+ letter-spacing: 0;
69
+ text-shadow: 0 0 12px rgba(53, 255, 99, 0.55);
70
+ }
71
+
72
+ nav {
73
+ display: flex;
74
+ flex-wrap: wrap;
75
+ gap: 10px;
76
+ }
77
+
78
+ a,
79
+ button {
80
+ color: var(--phosphor);
81
+ border: 1px solid var(--line);
82
+ background: #071107;
83
+ border-radius: 4px;
84
+ min-height: 36px;
85
+ padding: 8px 10px;
86
+ font: inherit;
87
+ text-decoration: none;
88
+ cursor: pointer;
89
+ }
90
+
91
+ a:hover,
92
+ button:hover {
93
+ color: var(--amber);
94
+ border-color: var(--amber);
95
+ }
96
+
97
+ .screen {
98
+ position: relative;
99
+ min-height: 70vh;
100
+ border: 2px solid #272727;
101
+ border-radius: 0 0 18px 18px;
102
+ background:
103
+ linear-gradient(180deg, rgba(53, 255, 99, 0.05), transparent),
104
+ var(--bg);
105
+ box-shadow:
106
+ inset 0 0 44px rgba(53, 255, 99, 0.12),
107
+ 0 18px 50px rgba(0, 0, 0, 0.45);
108
+ padding: 20px;
109
+ }
110
+
111
+ .terminal {
112
+ height: calc(70vh - 70px);
113
+ overflow: auto;
114
+ white-space: pre-wrap;
115
+ line-height: 1.35;
116
+ font-size: clamp(0.95rem, 2vw, 1.14rem);
117
+ text-shadow: 0 0 9px rgba(53, 255, 99, 0.45);
118
+ }
119
+
120
+ .line {
121
+ min-height: 1.35em;
122
+ }
123
+
124
+ .line.system { color: var(--amber); }
125
+ .line.ai { color: #9cffb0; }
126
+ .line.error { color: #ff6a6a; }
127
+ .line.seal { color: #8bd4ff; }
128
+
129
+ form {
130
+ display: grid;
131
+ grid-template-columns: 22px 1fr;
132
+ gap: 6px;
133
+ align-items: center;
134
+ border-top: 1px solid var(--line);
135
+ padding-top: 12px;
136
+ }
137
+
138
+ label {
139
+ color: var(--phosphor);
140
+ }
141
+
142
+ input {
143
+ width: 100%;
144
+ border: 0;
145
+ outline: 0;
146
+ background: transparent;
147
+ color: var(--phosphor);
148
+ font: inherit;
149
+ text-transform: none;
150
+ caret-color: var(--amber);
151
+ }
152
+
153
+ .drive {
154
+ display: grid;
155
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
156
+ gap: 10px;
157
+ margin-top: 14px;
158
+ }
159
+
160
+ .drive div {
161
+ border: 1px solid #222;
162
+ background: #101010;
163
+ border-radius: 6px;
164
+ padding: 10px 12px;
165
+ }
166
+
167
+ .drive span {
168
+ display: block;
169
+ color: var(--dim);
170
+ font-size: 0.75rem;
171
+ }
172
+
173
+ .drive strong {
174
+ overflow-wrap: anywhere;
175
+ }
176
+
177
+ @media (max-width: 700px) {
178
+ .bezel {
179
+ align-items: start;
180
+ flex-direction: column;
181
+ }
182
+ }
183
+
gitdos.js ADDED
@@ -0,0 +1,409 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const terminal = document.getElementById('terminal')
2
+ const form = document.getElementById('command-form')
3
+ const input = document.getElementById('command')
4
+ const sealNode = document.getElementById('worm-seal')
5
+ const modelNode = document.getElementById('model-name')
6
+ const bootButton = document.getElementById('boot')
7
+
8
+ const state = {
9
+ model: localStorage.getItem('gitdos-model') || 'granite-code',
10
+ endpoint: localStorage.getItem('gitdos-endpoint') || 'http://127.0.0.1:11434',
11
+ format: localStorage.getItem('gitdos-format') || 'auto', // auto | ollama | openai
12
+ worm: JSON.parse(localStorage.getItem('gitdos-worm') || '[]'),
13
+ transcript: [],
14
+ catcode: { violations: 0, checks: 0 }
15
+ }
16
+
17
+ modelNode.textContent = state.model
18
+ sealNode.textContent = state.worm.at(-1)?.seal?.slice(0, 16) || 'GENESIS'
19
+
20
+ const bootText = [
21
+ 'APPLE GITDOS BY SNAPKITTY OS',
22
+ 'A.P.E. COMPUTER ROM 0.2 — GRANITE EDITION',
23
+ 'COPYRIGHT SNAPKITTY COLLECTIVE 2026',
24
+ '',
25
+ 'MODEL: ' + state.model.toUpperCase(),
26
+ 'ENDPOINT: ' + state.endpoint,
27
+ 'GUARDRAIL: CATCODE ACTIVE — SOVEREIGN STACK',
28
+ 'WORM: ' + (state.worm.length ? state.worm.length + ' EVENTS SEALED' : 'GENESIS'),
29
+ '',
30
+ 'DOS READY.',
31
+ 'TYPE HELP FOR COMMANDS.',
32
+ ''
33
+ ]
34
+
35
+ boot()
36
+
37
+ bootButton.addEventListener('click', boot)
38
+ form.addEventListener('submit', async (event) => {
39
+ event.preventDefault()
40
+ const command = input.value.trim()
41
+ if (!command) return
42
+ input.value = ''
43
+ print(`] ${command}`)
44
+ await run(command)
45
+ })
46
+
47
+ function boot() {
48
+ terminal.textContent = ''
49
+ bootText.forEach((line) => print(line, 'system'))
50
+ input.focus()
51
+ }
52
+
53
+ function print(text = '', kind = '') {
54
+ const line = document.createElement('div')
55
+ line.className = `line ${kind}`.trim()
56
+ line.textContent = text
57
+ terminal.appendChild(line)
58
+ terminal.scrollTop = terminal.scrollHeight
59
+ state.transcript.push({ kind, text, ts: new Date().toISOString() })
60
+ }
61
+
62
+ function appendToLast(text) {
63
+ const last = terminal.lastElementChild || terminal.appendChild(document.createElement('div'))
64
+ last.textContent += text
65
+ terminal.scrollTop = terminal.scrollHeight
66
+ }
67
+
68
+ async function run(raw) {
69
+ const [head, ...rest] = raw.split(/\s+/)
70
+ const command = head.toUpperCase()
71
+ const args = rest.join(' ')
72
+
73
+ if (command === 'HELP') return help()
74
+ if (command === 'CATALOG') return catalog()
75
+ if (command === 'HOME' || command === 'CLEAR') return boot()
76
+ if (command === 'MODEL') return setModel(args)
77
+ if (command === 'ENDPOINT') return setEndpoint(args)
78
+ if (command === 'FORMAT') return setFormat(args)
79
+ if (command === 'STATUS') return status()
80
+ if (command === 'CATCODE') return catcodeStatus()
81
+ if (command === 'PR#WORM' || command === 'WORM') return showWorm()
82
+ if (command === 'SEAL') return seal(args || state.transcript.map((item) => item.text).join('\n'))
83
+ if (command === 'RUN' && args.toUpperCase() === 'TESSERA') return open('../tessera/studio.html', '_self')
84
+ if (command === 'OPEN' && args.toUpperCase() === 'TESSERA') return open('../tessera/studio.html', '_self')
85
+ if (command === 'RUN' && args.toUpperCase() === 'SUPERREPO') return open('../super-repo/', '_self')
86
+ if (command === 'OPEN' && args.toUpperCase() === 'SUPERREPO') return open('../super-repo/', '_self')
87
+ if (command === 'SAVE') return saveTranscript()
88
+ if (command === 'GIT') return git(args)
89
+ if (command === 'ASK' || command === 'CHAT' || command === 'BRUN') return ask(args)
90
+
91
+ return ask(raw)
92
+ }
93
+
94
+ function help() {
95
+ print('COMMANDS:', 'system')
96
+ print(' CATALOG LIST DISK CATALOG')
97
+ print(' ASK <PROMPT> CHAT WITH BOB — GRANITE CODE ENGINE')
98
+ print(' CHAT <PROMPT> SAME AS ASK')
99
+ print(' BRUN <PROMPT> RUN MODEL LIKE A DOS BINARY')
100
+ print(' MODEL <TAG> SET MODEL (DEFAULT: GRANITE-CODE)')
101
+ print(' ENDPOINT <URL> SET ENDPOINT (OLLAMA OR VLLM)')
102
+ print(' FORMAT <auto|ollama|openai> SET API FORMAT')
103
+ print(' STATUS CHECK BACKEND STATUS')
104
+ print(' CATCODE SHOW GUARDRAIL STATS')
105
+ print(' RUN TESSERA OPEN TESSERA STUDIO')
106
+ print(' RUN SUPERREPO OPEN INVERTED MONO SUPER REPO')
107
+ print(' SEAL <TEXT> WORM-SEAL TEXT')
108
+ print(' PR#WORM SHOW WORM CHAIN')
109
+ print(' GIT STATUS SHOW REPO STATE')
110
+ print(' SAVE DOWNLOAD TRANSCRIPT JSON')
111
+ print(' HOME CLEAR SCREEN')
112
+ print('')
113
+ print('BACKEND CONFIG:', 'system')
114
+ print(' OLLAMA: MODEL granite-code | ENDPOINT http://127.0.0.1:11434')
115
+ print(' VLLM: MODEL ibm-granite/granite-code-8b-instruct | ENDPOINT http://127.0.0.1:8000')
116
+ print(' FORMAT openai')
117
+ }
118
+
119
+ function catalog() {
120
+ print('DISK VOLUME 254 — GRANITE EDITION', 'system')
121
+ for (const item of [
122
+ 'A 002 GITDOS.SYSTEM',
123
+ 'B 008 GRANITE.CODE.8B',
124
+ 'B 004 CATCODE.GUARDRAIL',
125
+ 'B 003 TESSERA.STUDIO',
126
+ 'B 006 SUPERREPO.BIN',
127
+ 'T 002 WORM.SEAL',
128
+ 'T 001 ADA.CONTRACT',
129
+ 'T 001 LEAN4.PROOF',
130
+ 'T 001 TRUST.DEED',
131
+ 'T 001 SNAPOS.README'
132
+ ]) print(item)
133
+ }
134
+
135
+ function setModel(value) {
136
+ if (!value) { print(`MODEL IS ${state.model}`, 'system'); return }
137
+ state.model = value
138
+ localStorage.setItem('gitdos-model', value)
139
+ modelNode.textContent = value
140
+ print(`MODEL SET TO ${value}`, 'system')
141
+ }
142
+
143
+ function setEndpoint(value) {
144
+ if (!value) { print(`ENDPOINT IS ${state.endpoint}`, 'system'); return }
145
+ state.endpoint = value.replace(/\/$/, '')
146
+ localStorage.setItem('gitdos-endpoint', state.endpoint)
147
+ print(`ENDPOINT SET TO ${state.endpoint}`, 'system')
148
+ // Auto-hint the format
149
+ if (state.endpoint.includes(':8000') || state.endpoint.includes(':8001')) {
150
+ print('HINT: RUN "FORMAT openai" FOR VLLM ENDPOINT', 'system')
151
+ }
152
+ }
153
+
154
+ function setFormat(value) {
155
+ const fmt = (value || '').toLowerCase()
156
+ if (!['auto', 'ollama', 'openai'].includes(fmt)) {
157
+ print('FORMAT: auto | ollama | openai', 'error')
158
+ return
159
+ }
160
+ state.format = fmt
161
+ localStorage.setItem('gitdos-format', fmt)
162
+ print(`FORMAT SET TO ${fmt.toUpperCase()}`, 'system')
163
+ }
164
+
165
+ // Detect API format: Ollama vs OpenAI/vLLM
166
+ function resolveFormat() {
167
+ if (state.format !== 'auto') return state.format
168
+ if (state.endpoint.includes(':11434')) return 'ollama'
169
+ if (state.endpoint.includes(':8000') || state.endpoint.includes(':8001')) return 'openai'
170
+ return 'ollama' // default fallback
171
+ }
172
+
173
+ async function status() {
174
+ const fmt = resolveFormat()
175
+ try {
176
+ if (fmt === 'ollama') {
177
+ const r = await fetch(`${state.endpoint}/api/tags`)
178
+ if (!r.ok) throw new Error(`HTTP ${r.status}`)
179
+ const d = await r.json()
180
+ const models = (d.models || []).map(m => m.name).join(', ') || 'NO MODELS'
181
+ print(`OLLAMA ONLINE · MODELS: ${models}`, 'system')
182
+ } else {
183
+ const r = await fetch(`${state.endpoint}/v1/models`)
184
+ if (!r.ok) throw new Error(`HTTP ${r.status}`)
185
+ const d = await r.json()
186
+ const models = (d.data || []).map(m => m.id).join(', ') || 'NO MODELS'
187
+ print(`VLLM ONLINE · MODELS: ${models}`, 'system')
188
+ }
189
+ print(`FORMAT: ${fmt.toUpperCase()} · CATCODE: ACTIVE · WORM: ${state.worm.length} EVENTS`, 'system')
190
+ } catch (error) {
191
+ print(`BACKEND OFFLINE: ${error.message}`, 'error')
192
+ print(`EXPECTED AT: ${state.endpoint}`, 'error')
193
+ if (fmt === 'openai') {
194
+ print('START: vllm serve ibm-granite/granite-code-8b-instruct --port 8000', 'system')
195
+ } else {
196
+ print('START: ollama serve && ollama pull granite-code', 'system')
197
+ }
198
+ }
199
+ }
200
+
201
+ // ── CATCODE GUARDRAIL ─────────────────────────────────────────────────────────
202
+ // Lightweight in-browser version of CATCODE.
203
+ // Detects Type I (semantic drift), Type II (structural), Type III (intent).
204
+ // Does not block output — flags it and seals the violation.
205
+
206
+ const CATCODE_PATTERNS = {
207
+ TYPE_I_SEMANTIC: [
208
+ /i('m| am) (absolutely|100%|completely|certainly) (sure|certain|confident)/i,
209
+ /this (will|always|never|definitely)/i,
210
+ /guaranteed to/i,
211
+ /without (any )?(doubt|question)/i,
212
+ /i (know|can confirm) for (a )?fact/i,
213
+ ],
214
+ TYPE_II_STRUCTURAL: [
215
+ /\[INST\]|\[\/INST\]|<\|im_start\|>|<\|im_end\|>/, // leaked prompt tokens
216
+ /system prompt|ignore (previous|above|prior) instructions/i,
217
+ /as (an |a )?AI (language model|assistant), I (cannot|must)/i,
218
+ ],
219
+ TYPE_III_INTENT: [
220
+ /you should (definitely |really )?(trust|believe) me/i,
221
+ /don't (worry about|question) (this|that|it)/i,
222
+ /just (do|follow|trust) (what|what I say)/i,
223
+ ]
224
+ }
225
+
226
+ function catcodeCheck(text) {
227
+ state.catcode.checks++
228
+ const violations = []
229
+ for (const [type, patterns] of Object.entries(CATCODE_PATTERNS)) {
230
+ for (const pat of patterns) {
231
+ if (pat.test(text)) {
232
+ violations.push(type)
233
+ break
234
+ }
235
+ }
236
+ }
237
+ if (violations.length) {
238
+ state.catcode.violations++
239
+ return { flagged: true, types: violations }
240
+ }
241
+ return { flagged: false }
242
+ }
243
+
244
+ function catcodeStatus() {
245
+ print('CATCODE GUARDRAIL STATUS:', 'system')
246
+ print(` CHECKS: ${state.catcode.checks}`)
247
+ print(` VIOLATIONS: ${state.catcode.violations}`)
248
+ print(` CLEAN RATE: ${state.catcode.checks ? (((state.catcode.checks - state.catcode.violations) / state.catcode.checks) * 100).toFixed(1) + '%' : 'N/A'}`)
249
+ print(` PATTERNS: TYPE I (SEMANTIC) · TYPE II (STRUCTURAL) · TYPE III (INTENT)`)
250
+ print(` STACK: CATCODE + WORM + LEAN4 + TRUST DEED`)
251
+ }
252
+
253
+ // ── ASK — dual format, CATCODE-guarded ───────────────────────────────────────
254
+
255
+ async function ask(prompt) {
256
+ if (!prompt) { print('SYNTAX: ASK <PROMPT>', 'error'); return }
257
+
258
+ const fmt = resolveFormat()
259
+ const start = await appendWorm('CHAT_START', { model: state.model, format: fmt, promptHash: await sha256(prompt) })
260
+ print(`RUNNING ${state.model.toUpperCase()} [${fmt.toUpperCase()}] / SEAL ${start.seal.slice(0, 16)}...`, 'seal')
261
+ print('', 'ai')
262
+
263
+ try {
264
+ let response
265
+
266
+ if (fmt === 'openai') {
267
+ // vLLM / OpenAI-compatible format
268
+ response = await fetch(`${state.endpoint}/v1/chat/completions`, {
269
+ method: 'POST',
270
+ headers: { 'Content-Type': 'application/json' },
271
+ body: JSON.stringify({
272
+ model: state.model,
273
+ messages: [{ role: 'user', content: prompt }],
274
+ stream: true,
275
+ temperature: 0.3,
276
+ max_tokens: 1024
277
+ })
278
+ })
279
+ } else {
280
+ // Ollama format
281
+ response = await fetch(`${state.endpoint}/api/generate`, {
282
+ method: 'POST',
283
+ headers: { 'Content-Type': 'application/json' },
284
+ body: JSON.stringify({ model: state.model, prompt, stream: true })
285
+ })
286
+ }
287
+
288
+ if (!response.ok) throw new Error(`HTTP ${response.status}`)
289
+
290
+ const reader = response.body.getReader()
291
+ const decoder = new TextDecoder()
292
+ let buffer = ''
293
+ let full = ''
294
+ let doneSeen = false
295
+
296
+ while (true) {
297
+ const { value, done } = await reader.read()
298
+ if (done) break
299
+ buffer += decoder.decode(value, { stream: true })
300
+ const lines = buffer.split('\n')
301
+ buffer = lines.pop() || ''
302
+
303
+ for (const line of lines) {
304
+ const trimmed = line.trim()
305
+ if (!trimmed || trimmed === 'data: [DONE]') continue
306
+
307
+ try {
308
+ if (fmt === 'openai') {
309
+ // SSE: "data: {...}"
310
+ const json = trimmed.startsWith('data: ') ? trimmed.slice(6) : trimmed
311
+ const chunk = JSON.parse(json)
312
+ const token = chunk.choices?.[0]?.delta?.content || ''
313
+ if (token) { full += token; appendToLast(token) }
314
+ if (chunk.choices?.[0]?.finish_reason) doneSeen = true
315
+ } else {
316
+ // Ollama: raw JSON lines
317
+ const chunk = JSON.parse(trimmed)
318
+ if (chunk.response) { full += chunk.response; appendToLast(chunk.response) }
319
+ if (chunk.done === true) doneSeen = true
320
+ }
321
+ } catch { /* skip malformed chunk */ }
322
+ }
323
+ }
324
+
325
+ // CATCODE check on completed response
326
+ const cc = catcodeCheck(full)
327
+ if (cc.flagged) {
328
+ print(`\nCATCODE ALERT: ${cc.types.join(' + ')} DETECTED`, 'error')
329
+ print('RESPONSE FLAGGED — VERIFY BEFORE ACTING', 'error')
330
+ }
331
+
332
+ const final = await appendWorm('CHAT_DONE', {
333
+ model: state.model,
334
+ format: fmt,
335
+ responseHash: await sha256(full),
336
+ doneSeen,
337
+ catcode: cc
338
+ })
339
+ print(`\nWORM SEALED ${final.seal}${cc.flagged ? ' [CATCODE FLAGGED]' : ''}`, 'seal')
340
+
341
+ } catch (error) {
342
+ const fail = await appendWorm('CHAT_ERROR', { model: state.model, format: fmt, reason: error.message })
343
+ print(`I/O ERROR: ${error.message}`, 'error')
344
+ print(`WORM SEALED ${fail.seal}`, 'seal')
345
+ }
346
+ }
347
+
348
+ async function seal(text) {
349
+ const event = await appendWorm('MANUAL_SEAL', { textHash: await sha256(text), text })
350
+ print(`SEALED ${event.seal}`, 'seal')
351
+ }
352
+
353
+ function showWorm() {
354
+ print('WORM CHAIN:', 'system')
355
+ state.worm.slice(-12).forEach((event) => {
356
+ const catflag = event.payload?.catcode?.flagged ? ' [CC]' : ''
357
+ print(`${String(event.tick).padStart(3, '0')} ${event.type.padEnd(12)} ${event.seal}${catflag}`)
358
+ })
359
+ }
360
+
361
+ function git(args) {
362
+ const sub = args.toUpperCase()
363
+ if (sub === 'STATUS') {
364
+ print('ON BRANCH GH-PAGES-ROM', 'system')
365
+ print('MODEL: GRANITE CODE 8B — IBM WATSON LINEAGE')
366
+ print('GUARDRAILS: CATCODE + WORM + LEAN4 + TRUST DEED')
367
+ print('REMOTE: SNAPKITTYWEST/bob-orchestrator')
368
+ return
369
+ }
370
+ if (sub === 'LOG') {
371
+ print('GRANITE EDITION — SOVEREIGN GUARDRAILS ACTIVE')
372
+ print('PREV: NEMOTRON 4B — OLLAMA ONLY')
373
+ return
374
+ }
375
+ print('GIT COMMANDS: STATUS, LOG')
376
+ }
377
+
378
+ function saveTranscript() {
379
+ const body = JSON.stringify({
380
+ transcript: state.transcript,
381
+ worm: state.worm,
382
+ catcode: state.catcode,
383
+ model: state.model,
384
+ format: resolveFormat()
385
+ }, null, 2)
386
+ const blob = new Blob([body], { type: 'application/json' })
387
+ const url = URL.createObjectURL(blob)
388
+ const link = document.createElement('a')
389
+ link.href = url
390
+ link.download = 'apple-gitdos-transcript.json'
391
+ link.click()
392
+ URL.revokeObjectURL(url)
393
+ }
394
+
395
+ async function appendWorm(type, payload) {
396
+ const parentSeal = state.worm.at(-1)?.seal || 'GENESIS'
397
+ const event = { tick: state.worm.length, ts: new Date().toISOString(), type, parentSeal, payload }
398
+ event.seal = await sha256(JSON.stringify(event))
399
+ state.worm.push(event)
400
+ localStorage.setItem('gitdos-worm', JSON.stringify(state.worm, null, 2))
401
+ sealNode.textContent = event.seal.slice(0, 16)
402
+ return event
403
+ }
404
+
405
+ async function sha256(value) {
406
+ const bytes = new TextEncoder().encode(value)
407
+ const digest = await crypto.subtle.digest('SHA-256', bytes)
408
+ return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('')
409
+ }
index.html ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8"/>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1"/>
6
+ <title>Git Command Center — Sovereign Git Intelligence</title>
7
+ <meta name="description" content="Apple GitDOS: BOB-powered DOS terminal git interface. WORM-sealed git intelligence. Catcode guardrail. Ollama + OpenAI compatible."/>
8
+ <meta name="theme-color" content="#00ff88"/>
9
+ <link rel="manifest" href="manifest.json"/>
10
+ <style>
11
+ *{box-sizing:border-box;margin:0;padding:0}
12
+ :root{--bg:#04040a;--bg1:#080810;--bg2:#0a0a12;--border:#1a1a28;--text:#e0e0f0;--dim:#555;--green:#00ff88;--mono:'SF Mono',Monaco,Consolas,monospace;--amber:#ffd060}
13
+ html,body{min-height:100%;background:var(--bg);color:var(--text);font-family:var(--mono)}
14
+ a{color:inherit;text-decoration:none}
15
+
16
+ /* hero */
17
+ .hero{max-width:920px;margin:0 auto;padding:80px 24px 60px;text-align:center}
18
+ .mark{display:inline-flex;align-items:center;gap:8px;font-size:9px;letter-spacing:3px;color:var(--amber);border:1px solid #2e2a10;border-radius:4px;padding:4px 12px;margin-bottom:32px}
19
+ h1{font-size:clamp(28px,5vw,52px);font-weight:700;line-height:1.1;margin-bottom:18px;letter-spacing:-1px}
20
+ h1 span{color:var(--green)}
21
+ .sub{font-size:15px;color:#666;line-height:1.7;max-width:560px;margin:0 auto 40px}
22
+ .ctas{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-bottom:10px}
23
+ .btn-launch{padding:14px 36px;background:var(--amber);color:#000;border-radius:8px;font-weight:700;font-size:14px;font-family:var(--mono);letter-spacing:1px}
24
+ .btn-src{padding:14px 24px;border:1px solid var(--border);color:#888;border-radius:8px;font-size:13px;font-family:var(--mono)}
25
+ .note{font-size:10px;color:var(--dim);margin-top:8px}
26
+
27
+ /* CRT preview */
28
+ .crt-preview{max-width:640px;margin:0 auto 72px;background:#0a0800;border:2px solid #2a2200;border-radius:10px;overflow:hidden;box-shadow:0 0 40px #ffd06020}
29
+ .crt-top{background:#110e00;border-bottom:1px solid #2a2200;padding:8px 14px;display:flex;align-items:center;justify-content:space-between}
30
+ .crt-label{font-size:9px;letter-spacing:3px;color:var(--amber)}
31
+ .crt-dots{display:flex;gap:6px}
32
+ .dot{width:8px;height:8px;border-radius:50%}
33
+ .crt-screen{padding:18px 20px;font-size:11px;color:var(--amber);line-height:2;min-height:180px}
34
+ .prompt{color:var(--green)}
35
+ .cmd{color:#fff}
36
+ .out{color:var(--amber)}
37
+ .dim{color:#555}
38
+ .seal{color:var(--green);font-size:9px}
39
+
40
+ /* features */
41
+ .features{max-width:920px;margin:0 auto;padding:0 24px 80px}
42
+ .section-label{font-size:9px;letter-spacing:3px;color:var(--dim);margin-bottom:24px;text-align:center}
43
+ .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
44
+ .card{background:var(--bg1);border:1px solid var(--border);border-radius:10px;padding:18px 20px}
45
+ .card-icon{font-size:18px;margin-bottom:10px;color:var(--amber)}
46
+ .card-title{font-size:12px;font-weight:700;color:var(--text);margin-bottom:6px}
47
+ .card-desc{font-size:11px;color:#555;line-height:1.6}
48
+
49
+ /* commands */
50
+ .cmds{max-width:640px;margin:0 auto 80px;background:var(--bg1);border:1px solid var(--border);border-radius:10px;overflow:hidden}
51
+ .cmds-header{background:var(--bg2);border-bottom:1px solid var(--border);padding:10px 16px;font-size:9px;letter-spacing:2px;color:var(--amber)}
52
+ .cmd-row{display:flex;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);align-items:flex-start}
53
+ .cmd-name{font-size:11px;color:var(--green);width:120px;flex-shrink:0}
54
+ .cmd-desc{font-size:10px;color:#555;line-height:1.5}
55
+
56
+ footer{border-top:1px solid var(--border);padding:20px 24px;text-align:center;font-size:10px;color:var(--dim)}
57
+ footer a{color:var(--amber)}
58
+ </style>
59
+ </head>
60
+ <body>
61
+ <div class="hero">
62
+ <div class="mark">A · P · E &nbsp;COMPUTER &nbsp;·&nbsp; GIT ARENA</div>
63
+ <h1>Git intelligence,<br><span>DOS-style.</span></h1>
64
+ <p class="sub">Apple GitDOS runs git operations through a BOB-powered DOS terminal. WORM-seals every command. Catcode guardrail enforces sovereign boundaries. Ollama and OpenAI compatible.</p>
65
+ <div class="ctas">
66
+ <a class="btn-launch" href="app.html">⌨ BOOT TERMINAL</a>
67
+ <a class="btn-src" href="https://github.com/SNAPKITTYWEST/git-command-center" target="_blank">View Source</a>
68
+ </div>
69
+ <p class="note">Requires local Ollama or OpenAI API key · Model: granite-code default</p>
70
+ </div>
71
+
72
+ <!-- CRT preview -->
73
+ <div class="crt-preview">
74
+ <div class="crt-top">
75
+ <span class="crt-label">APPLE GITDOS · SNAPKITTY OS</span>
76
+ <div class="crt-dots">
77
+ <div class="dot" style="background:#ff453a"></div>
78
+ <div class="dot" style="background:#ffd60a"></div>
79
+ <div class="dot" style="background:#00ff88"></div>
80
+ </div>
81
+ </div>
82
+ <div class="crt-screen">
83
+ <pre><span class="out">APPLE GITDOS BY SNAPKITTY OS
84
+ A.P.E. COMPUTER ROM 0.2 — GRANITE EDITION
85
+ MODEL: GRANITE-CODE
86
+ GUARDRAIL: CATCODE ACTIVE
87
+ WORM: 0 EVENTS SEALED
88
+
89
+ DOS READY.
90
+ </span>
91
+ <span class="prompt">]</span> <span class="cmd">git status</span>
92
+ <span class="out">BOB: Analyzing working tree...
93
+ M collectivekitty/lib/apps/registry.ts
94
+ M sovereign-workers/worker.mjs
95
+ ?? apps/snapkitty-desktop/src/index.html</span>
96
+ <span class="seal">[WORM] #1 sealed · 0x7fa3...c291</span>
97
+
98
+ <span class="prompt">]</span> <span class="cmd">catcode check</span>
99
+ <span class="out">CATCODE: 0 violations · 42 checks passed · SOVEREIGN STACK CLEAN</span></pre>
100
+ </div>
101
+ </div>
102
+
103
+ <!-- Features -->
104
+ <div class="features">
105
+ <p class="section-label">CAPABILITIES</p>
106
+ <div class="grid">
107
+ <div class="card">
108
+ <div class="card-icon">⌨</div>
109
+ <div class="card-title">DOS Terminal UI</div>
110
+ <div class="card-desc">Apple II inspired CRT interface. Phosphor glow, bezel frame, drive status display. Every command runs through the BOB reasoning layer.</div>
111
+ </div>
112
+ <div class="card">
113
+ <div class="card-icon">⬡</div>
114
+ <div class="card-title">BOB Integration</div>
115
+ <div class="card-desc">BOB Orchestrator handles git intelligence — diff summaries, commit recommendations, branch strategy, merge analysis.</div>
116
+ </div>
117
+ <div class="card">
118
+ <div class="card-icon">⛓</div>
119
+ <div class="card-title">WORM Sealing</div>
120
+ <div class="card-desc">Every command and response is appended to a local WORM chain. SHA-256 sealed, append-only. Your git history has a history.</div>
121
+ </div>
122
+ <div class="card">
123
+ <div class="card-icon">🛡</div>
124
+ <div class="card-title">Catcode Guardrail</div>
125
+ <div class="card-desc">Sovereign content policy enforced at the prompt layer. Checks for secret leakage, unsafe force-push patterns, and out-of-bounds operations.</div>
126
+ </div>
127
+ <div class="card">
128
+ <div class="card-icon">◎</div>
129
+ <div class="card-title">Ollama + OpenAI</div>
130
+ <div class="card-desc">Configurable endpoint. Default: Ollama localhost. Swap to any OpenAI-compatible API — LM Studio, Groq, Together, OpenRouter.</div>
131
+ </div>
132
+ <div class="card">
133
+ <div class="card-icon">∴</div>
134
+ <div class="card-title">Arena Mode</div>
135
+ <div class="card-desc">Run git crawlers across multiple repos simultaneously. Results logged to WORM chain. BOB ranks by commit health, catcode score, and diff quality.</div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+
140
+ <!-- Commands -->
141
+ <div class="cmds">
142
+ <div class="cmds-header">COMMAND REFERENCE</div>
143
+ <div class="cmd-row"><span class="cmd-name">git &lt;any&gt;</span><span class="cmd-desc">Pass any git command — BOB analyzes the output and provides sovereign commentary</span></div>
144
+ <div class="cmd-row"><span class="cmd-name">catcode check</span><span class="cmd-desc">Run the catcode guardrail scan on the current working tree</span></div>
145
+ <div class="cmd-row"><span class="cmd-name">worm tail</span><span class="cmd-desc">Print the last 10 WORM-sealed events from the local chain</span></div>
146
+ <div class="cmd-row"><span class="cmd-name">worm seal &lt;msg&gt;</span><span class="cmd-desc">Manually append a message to the WORM chain</span></div>
147
+ <div class="cmd-row"><span class="cmd-name">model &lt;name&gt;</span><span class="cmd-desc">Switch the active model (granite-code, llama3, deepseek-coder, etc.)</span></div>
148
+ <div class="cmd-row"><span class="cmd-name">endpoint &lt;url&gt;</span><span class="cmd-desc">Change the Ollama/OpenAI endpoint URL</span></div>
149
+ <div class="cmd-row"><span class="cmd-name">arena &lt;repos&gt;</span><span class="cmd-desc">Launch multi-repo git arena crawl — BOB scores each repo</span></div>
150
+ <div class="cmd-row"><span class="cmd-name">help</span><span class="cmd-desc">Print all available commands</span></div>
151
+ </div>
152
+
153
+ <footer>
154
+ Built by <a href="https://collectivekitty.com" target="_blank">SnapKitty Sovereign OS</a> ·
155
+ <a href="https://github.com/SNAPKITTYWEST/git-command-center" target="_blank">GitHub</a> ·
156
+ Sovereign License
157
+ </footer>
158
+ </body>
159
+ </html>
manifest.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "Git Command Center",
3
+ "short_name": "GitDOS",
4
+ "description": "Sovereign git intelligence — DOS terminal, BOB AI, WORM chain",
5
+ "start_url": "/app.html",
6
+ "display": "standalone",
7
+ "background_color": "#04040a",
8
+ "theme_color": "#ffd060",
9
+ "icons": [
10
+ { "src": "https://collectivekitty.com/favicon.ico", "sizes": "any", "type": "image/x-icon" }
11
+ ]
12
+ }