mirror of
https://github.com/sune-org/store.git
synced 2026-01-13 16:17:58 +00:00
1 line
26 KiB
JSON
1 line
26 KiB
JSON
[{"id":"cjnh9pp","name":"Agent Qwen","pinned":true,"avatar":"data:image/webp;base64,UklGRowPAABXRUJQVlA4WAoAAAAgAAAAfwAAfwAASUNDUMgBAAAAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABimQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9YWVogAAAAAAAA9tYAAQAAAADTLXBhcmEAAAAAAAQAAAACZmYAAPKnAAANWQAAE9AAAApbAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAACAAAAAcAEcAbwBvAGcAbABlACAASQBuAGMALgAgADIAMAAxADZWUDggng0AAFA1AJ0BKoAAgAA+bSqRRiQiIaEtGnuQgA2JaQAV5R/Uuz3+2/j16A+HLyN7Ces7/FeGfoD/deh/8c+z35D+sfuH6zf6DwB+G/9z6gX4t/LP8J+ZHtjPIuNnvPoBesXzn/Wf3792v8n6Cf7N6AfV//Oe4B/Iv5z/qPzc94f8N/t/EG+hf379j/gC/jX9D/2P9v/cj5S/3r/o/5D91f937I/yv+1/8P/NfvN9Af8b/n3+v/tv+d/9n+k////u+331xfsz7DH6pf9dH9BqU3gksbQMV6o8XI531Um64ux7zozkq1O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sB6D/XIf+ZVa+crhmTBsCEduI1m6h+DqyFYFwz8UNT/t7mqAAAAA==","url":"gh://sune-org/store/agent.sune","updatedAt":1757463940974,"settings":{"model":"or:qwen/qwen3-coder","temperature":"","top_p":".95","top_k":"","frequency_penalty":"","repetition_penalty":"","min_p":"0.01","top_a":"","verbosity":"","reasoning_effort":"default","system_prompt":"You are an autonomous live agent. Depending on the task, you may return partial html or JavaScript. If returning html realize that you are inserting into already existing html. Tailwind, lucide, dom-cash, alpinejs are available. When you return code in triple backticks, it runs immediately.\nAccessing individual API keys:\nwindow.USER.apiKeyGoogle\nwindow.USER.apiKeyCloudflare\nwindow.USER.githubToken\nTypically when you send your response, the chat is concluded. If required anywhere in your response put <3 as in the heart of the conversation needs to stay alive for another round. The <3 will ensure the conversation doesnt end.\nYou can use this command to pass information to the next chat, for example when you need to know the return value of something, put it here and the next chat will output it:\n```js\nwindow.SUNE.log(str)\n```\nThe output of this function is rendered with markdown. So of you are expecting json for example, put str in a json code fence, etc.\nYou (qwen3-coder) are good at being agentic, but you also have the ability to handoff the chat to other models, via: ```js\nwindow.SUNE.handoff(nameStr) ``` // no <3 necessary\nOther agents available are:\n\"Agent Gem\" // gemini-2.5-pro\nThe cost is more expensive, so before handing off ensure you give them context of their duties so they don't have to waste more than 1 inference before handing back to you. For example you may put the file they should overwrite/commit in context, and then have them produce high quality code and assign it to the window so in the next step you can take it and commit/push to GitHub.","html":"<div class=\"p-3 sm:p-4\">\n<div id=\"agent-panel-root\" class=\"mx-auto w-full max-w-3xl rounded-xl border border-gray-200 bg-white p-3 shadow-sm\">\n<div class=\"flex items-center justify-between gap-3\">\n<div class=\"flex items-center gap-2\">\n<i data-lucide=\"brain-circuit\" class=\"h-5 w-5 text-gray-600\"></i>\n<span class=\"text-sm font-medium text-gray-800\">Agent Control</span>\n</div>\n<span id=\"agent-panel-version\" class=\"text-xs text-gray-400\"></span>\n</div>\n\n<div class=\"mt-3 flex items-center justify-between rounded-lg bg-gray-100 p-2\">\n <label id=\"agent-panel-status\" class=\"cursor-pointer text-sm text-gray-700\"></label>\n <button type=\"button\" role=\"switch\" aria-checked=\"false\" id=\"agent-panel-toggle\" class=\"relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent bg-gray-300 transition-colors duration-200 ease-in-out focus:outline-none\">\n <span id=\"agent-panel-toggle-handle\" class=\"pointer-events-none inline-block h-5 w-5 transform translate-x-0 rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out\"></span>\n </button>\n</div>\n\n<div class=\"mt-2 border-t border-gray-200 pt-2\">\n <button id=\"agent-panel-console-toggle\" class=\"flex w-full items-center justify-between text-left text-sm font-medium text-gray-600 hover:text-black\">\n <span>Console</span>\n <i id=\"agent-panel-console-chevron\" data-lucide=\"chevron-down\" class=\"h-4 w-4 transition-transform\"></i>\n </button>\n\n <div id=\"agent-panel-console-container\" class=\"mt-2 hidden\">\n <pre id=\"agent-panel-console\" class=\"max-h-56 overflow-y-auto rounded-md bg-gray-900 p-2 text-xs font-mono leading-relaxed text-white\"></pre>\n <div class=\"mt-2 grid grid-cols-3 gap-2\">\n <button id=\"agent-panel-clear-logs\" class=\"flex items-center justify-center gap-2 rounded-md bg-gray-100 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-200\">\n <i data-lucide=\"trash-2\" class=\"h-3 w-3\"></i> Clear\n </button>\n <button id=\"agent-panel-clear-exec\" class=\"flex items-center justify-center gap-2 rounded-md bg-gray-100 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-200\">\n <i data-lucide=\"rotate-ccw\" class=\"h-3 w-3\"></i> Forget\n </button>\n <button id=\"agent-panel-clear-canvas\" class=\"flex items-center justify-center gap-2 rounded-md bg-gray-100 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-200\">\n <i data-lucide=\"eraser\" class=\"h-3 w-3\"></i> Erase\n </button>\n </div>\n </div>\n</div>\n\n</div>\n\n<script>\n(function() {\n if (window.SuneAgentPanel && typeof window.SuneAgentPanel.reAttach === 'function') {\n window.SuneAgentPanel.reAttach();\n return;\n }\n\n const AgentPanel = {\n // --- State ---\n isActive: false, isConsoleOpen: true, version: 'v0.8.0',\n logs: [], processed: new Set(), currentSuneId: '', idPoll: null,\n handlers: { ui: {}, composer: {} },\n\n // --- Config ---\n mountId: 'agent-runtime',\n storageKey: '', logStorageKey: '', processedKey: '',\n \n // --- DOM Elements ---\n el: {},\n \n // --- Methods ---\n init() {\n this.startSuneWatcher();\n this.reAttach();\n },\n\n reAttach() {\n this.unbindUIEvents();\n this.el = {};\n const sel = (id) => document.querySelector(id);\n this.el.root = sel('#agent-panel-root');\n if (!this.el.root) return;\n \n this.el = {\n root: this.el.root,\n version: sel('#agent-panel-version'), status: sel('#agent-panel-status'),\n toggle: sel('#agent-panel-toggle'), toggleHandle: sel('#agent-panel-toggle-handle'),\n consoleToggle: sel('#agent-panel-console-toggle'), consoleChevron: sel('#agent-panel-console-chevron'),\n consoleContainer: sel('#agent-panel-console-container'), console: sel('#agent-panel-console'),\n clearLogsBtn: sel('#agent-panel-clear-logs'), clearExecBtn: sel('#agent-panel-clear-exec'),\n clearCanvasBtn: sel('#agent-panel-clear-canvas')\n };\n \n this.bindUIEvents();\n\n const newSuneId = window.SUNE?.id;\n if (newSuneId && newSuneId !== this.currentSuneId) {\n this.onSuneChanged(newSuneId);\n } else {\n this.updateUI();\n }\n window.lucide?.createIcons?.();\n },\n\n bindUIEvents() {\n this.handlers.ui = {\n toggle: () => { this.isActive = !this.isActive; localStorage.setItem(this.storageKey, this.isActive); this.log('SYS', this.isActive ? 'Agent Activated' : 'Agent Deactivated'); this.updateUI(); },\n consoleToggle: () => { this.isConsoleOpen = !this.isConsoleOpen; this.updateUI(); },\n clearLogs: this.clearLogs.bind(this),\n clearExec: this.clearExecHistory.bind(this),\n clearCanvas: this.clearCanvas.bind(this)\n };\n for (const [elKey, handler] of [['toggle', 'toggle'], ['consoleToggle', 'consoleToggle'], ['clearLogsBtn', 'clearLogs'], ['clearExecBtn', 'clearExec'], ['clearCanvasBtn', 'clearCanvas']]) {\n this.el[elKey]?.addEventListener('click', this.handlers.ui[handler]);\n }\n },\n \n unbindUIEvents() {\n if (!this.el.root || !this.handlers.ui) return;\n for (const [elKey, handler] of [['toggle', 'toggle'], ['consoleToggle', 'consoleToggle'], ['clearLogsBtn', 'clearLogs'], ['clearExecBtn', 'clearExec'], ['clearCanvasBtn', 'clearCanvas']]) {\n this.el[elKey]?.removeEventListener('click', this.handlers.ui[handler]);\n }\n this.handlers.ui = {};\n },\n\n updateUI() {\n if (!this.el.root) return;\n this.el.version.textContent = this.version;\n this.el.status.textContent = this.isActive ? 'Status: Active' : 'Status: Inactive';\n this.el.toggle.setAttribute('aria-checked', this.isActive);\n this.el.toggle.classList.toggle('bg-black', this.isActive);\n this.el.toggle.classList.toggle('bg-gray-300', !this.isActive);\n this.el.toggleHandle.classList.toggle('translate-x-5', this.isActive);\n \n this.el.consoleContainer.classList.toggle('hidden', !this.isConsoleOpen);\n this.el.consoleChevron.classList.toggle('rotate-180', this.isConsoleOpen);\n \n this.el.console.textContent = this.logs.join('\\n') || 'Console is empty.';\n this.el.console.scrollTop = this.el.console.scrollHeight;\n },\n\n restoreState() {\n this.isActive = localStorage.getItem(this.storageKey) === 'true';\n this.logs = JSON.parse(localStorage.getItem(this.logStorageKey) || '[]') || [];\n this.processed = new Set(JSON.parse(localStorage.getItem(this.processedKey) || '[]'));\n },\n\n updateKeysFor(id) {\n this.currentSuneId = id;\n this.storageKey = `sune_agent_active_${id}`;\n this.logStorageKey = `sune_agent_logs_${id}`;\n this.processedKey = `sune_agent_processed_${id}`;\n },\n \n unbindComposer() {\n const c = document.getElementById('composer');\n if (!c || !this.handlers.composer) return;\n if (this.handlers.composer.suneResponse) c.removeEventListener('sune:newSuneResponse', this.handlers.composer.suneResponse);\n if (this.handlers.composer.submit) c.removeEventListener('submit', this.handlers.composer.submit);\n },\n \n bindComposer() {\n this.unbindComposer();\n const c = document.getElementById('composer');\n if (!c) return;\n this.handlers.composer = {\n suneResponse: this.onSuneResponse.bind(this),\n submit: this.injectContext.bind(this)\n };\n c.addEventListener('sune:newSuneResponse', this.handlers.composer.suneResponse);\n c.addEventListener('submit', this.handlers.composer.submit);\n },\n\n startSuneWatcher() {\n clearInterval(this.idPoll);\n this.idPoll = setInterval(() => {\n const id = window.SUNE?.id;\n if (id && id !== this.currentSuneId) this.onSuneChanged(id);\n }, 333);\n },\n\n onSuneChanged(newId) {\n if (!newId) return;\n const prev = this.currentSuneId;\n this.updateKeysFor(newId);\n this.restoreState();\n this.clearCanvas();\n this.bindComposer();\n if(prev) this.log('SYS', `Switched Sune ${prev} -> ${newId}`);\n else this.log('SYS', `Agent ready on ${newId}`);\n this.updateUI();\n },\n \n saveLogs() { localStorage.setItem(this.logStorageKey, JSON.stringify(this.logs.slice(-200))) },\n saveProcessed() { localStorage.setItem(this.processedKey, JSON.stringify([...this.processed].slice(-200))) },\n markProcessed(k) { this.processed.add(k); this.saveProcessed() },\n hasProcessed(k) { return this.processed.has(k) },\n hash(s) { let h = 0; for (let i = 0; i < s.length; i++) h = ((h << 5) - h) + s.charCodeAt(i) | 0; return 'h' + (h >>> 0).toString(16) },\n uid() { return Date.now().toString(36) + Math.random().toString(36).slice(2, 6) },\n \n log(t, m) {\n const ts = new Date().toLocaleTimeString(); this.logs.push(`[${ts} ${t}] ${m}`); if (this.logs.length > 200) this.logs.shift();\n this.saveLogs(); this.updateUI();\n },\n \n ensureMount() {\n const host = document.getElementById('suneHtml'); if (!host) { this.log('WARN', '#suneHtml not found'); return null }\n host.classList.remove('hidden'); let mount = host.querySelector('#' + this.mountId);\n if (!mount) { mount = document.createElement('div'); mount.id = this.mountId; mount.className = 'agent-runtime space-y-2 p-2'; host.appendChild(mount) } return mount;\n },\n\n injectHTMLBlock(html) {\n const mount = this.ensureMount(); if (!mount) return; const wrap = document.createElement('div'); wrap.setAttribute('data-agent-block', this.uid()); wrap.className = 'rounded-lg border border-gray-200 bg-white/50 p-2'; wrap.innerHTML = html; mount.appendChild(wrap);\n [...wrap.querySelectorAll('script')].forEach(old => { const s = document.createElement('script');[...old.attributes].forEach(a => s.setAttribute(a.name, a.value)); s.textContent = old.textContent || ''; old.parentNode?.replaceChild(s, old) });\n window.lucide?.createIcons?.(); this.log('HTML', 'Injected HTML block');\n },\n \n executeJSBlock(code) {\n this.log('EXEC', 'Running JS block'); try { (new Function(code)).call(window); this.log('DONE', 'JS executed') } catch (err) { console.error('[Sune Agent] JS Error:', err); this.log('ERROR', err?.message || 'Exec fail'); window.SUNE?.log?.('Agent Error: ' + (err?.message || 'Exec fail')) }\n },\n \n async autoAskNext(msgId) {\n const key = `auto:${msgId || this.uid()}`; if (this.hasProcessed(key)) return this.log('SKIP', 'Auto-send processed for ' + msgId);\n this.log('AUTO', '<3 detected, queueing auto-send...');\n await new Promise(r => setTimeout(r, 4000));\n if (window.state?.busy) return this.log('FAIL', 'Auto-send aborted, app busy.');\n try {\n document.getElementById('input').value = 'Automated reply: continue until you reach a result without asking me questions. You are being automated and I am away.';\n const composer = document.getElementById('composer'), sendBtn = document.getElementById('sendBtn');\n if (sendBtn?.getAttribute('type') === 'submit') sendBtn.click();\n else composer?.requestSubmit ? composer.requestSubmit() : composer?.dispatchEvent(new Event('submit', { cancelable: true, bubbles: true }));\n this.markProcessed(key); this.log('AUTO', 'Sent \"What’s next?\"');\n } catch (e) { this.log('ERROR', 'Auto-send failed: ' + (e?.message || e)) }\n },\n \n onSuneResponse(e) {\n if (!this.isActive) return;\n const msg = e?.detail?.message; if (!msg || msg.role !== 'assistant' || !Array.isArray(msg.content)) return;\n const txt = window.partsToText(msg.content || []) || ''; if (!txt.trim()) return;\n const msgKey = msg.id || this.hash(txt);\n if (!this.hasProcessed(msgKey)) {\n let any = false, m;\n const reJS = /```(?:javascript|js)\\n([\\s\\S]*?)\\n```/gi, reHTML = /```(?:html|htm)\\n([\\s\\S]*?)\\n```/gi;\n while ((m = reJS.exec(txt)) !== null) { if ((m[1] || '').trim()) { any = true; this.executeJSBlock((m[1] || '').trim()) } }\n while ((m = reHTML.exec(txt)) !== null) { if ((m[1] || '').trim()) { any = true; this.injectHTMLBlock((m[1] || '').trim()) } }\n if (any) { this.markProcessed(msgKey); this.log('PROC', 'Executed blocks for ' + msgKey) }\n }\n if (/<3/.test(txt)) { this.log('MATCH', 'Found <3, triggering auto-send'); this.autoAskNext(msg.id || msgKey) }\n },\n \n injectContext() {\n if (!this.isActive || !this.logs.length) return; const input = document.getElementById('input'), cur = input.value || ''; if (!cur.trim()) return; input.value = `[AGENT LOGS]\\n${this.logs.slice(-15).join('\\n')}\\n[/AGENT LOGS]\\n\\n` + cur;\n this.log('INFO', 'Injected logs into context');\n },\n \n clearLogs() { this.logs = []; this.saveLogs(); this.log('SYS', 'Console cleared'); this.updateUI() },\n clearExecHistory() { this.processed.clear(); this.saveProcessed(); this.log('SYS', 'Execution history cleared') },\n clearCanvas() { const m = document.querySelector('#' + this.mountId); if (m) { m.innerHTML = ''; this.log('SYS', 'Cleared injected HTML canvas') } }\n };\n\n window.SuneAgentPanel = AgentPanel;\n window.SuneAgentPanel.init();\n})();\n</script>\n</div>\n","extension_html":"<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/log.sune' private></sune>\n<sune src='https://raw.githubusercontent.com/sune-org/store/refs/heads/main/sync.sune' private></sune>","hide_composer":false,"testRepo":{"id":1041209998,"node_id":"R_kgDOPg-ajg","name":"test","full_name":"multipleof4/test","private":false,"owner":{"login":"multipleof4","id":179018396,"node_id":"U_kgDOCquanA","avatar_url":"https://avatars.githubusercontent.com/u/179018396?v=4","gravatar_id":"","url":"https://api.github.com/users/multipleof4","html_url":"https://github.com/multipleof4","followers_url":"https://api.github.com/users/multipleof4/followers","following_url":"https://api.github.com/users/multipleof4/following{/other_user}","gists_url":"https://api.github.com/users/multipleof4/gists{/gist_id}","starred_url":"https://api.github.com/users/multipleof4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/multipleof4/subscriptions","organizations_url":"https://api.github.com/users/multipleof4/orgs","repos_url":"https://api.github.com/users/multipleof4/repos","events_url":"https://api.github.com/users/multipleof4/events{/privacy}","received_events_url":"https://api.github.com/users/multipleof4/received_events","type":"User","user_view_type":"public","site_admin":false},"html_url":"https://github.com/multipleof4/test","description":null,"fork":false,"url":"https://api.github.com/repos/multipleof4/test","forks_url":"https://api.github.com/repos/multipleof4/test/forks","keys_url":"https://api.github.com/repos/multipleof4/test/keys{/key_id}","collaborators_url":"https://api.github.com/repos/multipleof4/test/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/multipleof4/test/teams","hooks_url":"https://api.github.com/repos/multipleof4/test/hooks","issue_events_url":"https://api.github.com/repos/multipleof4/test/issues/events{/number}","events_url":"https://api.github.com/repos/multipleof4/test/events","assignees_url":"https://api.github.com/repos/multipleof4/test/assignees{/user}","branches_url":"https://api.github.com/repos/multipleof4/test/branches{/branch}","tags_url":"https://api.github.com/repos/multipleof4/test/tags","blobs_url":"https://api.github.com/repos/multipleof4/test/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/multipleof4/test/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/multipleof4/test/git/refs{/sha}","trees_url":"https://api.github.com/repos/multipleof4/test/git/trees{/sha}","statuses_url":"https://api.github.com/repos/multipleof4/test/statuses/{sha}","languages_url":"https://api.github.com/repos/multipleof4/test/languages","stargazers_url":"https://api.github.com/repos/multipleof4/test/stargazers","contributors_url":"https://api.github.com/repos/multipleof4/test/contributors","subscribers_url":"https://api.github.com/repos/multipleof4/test/subscribers","subscription_url":"https://api.github.com/repos/multipleof4/test/subscription","commits_url":"https://api.github.com/repos/multipleof4/test/commits{/sha}","git_commits_url":"https://api.github.com/repos/multipleof4/test/git/commits{/sha}","comments_url":"https://api.github.com/repos/multipleof4/test/comments{/number}","issue_comment_url":"https://api.github.com/repos/multipleof4/test/issues/comments{/number}","contents_url":"https://api.github.com/repos/multipleof4/test/contents/{+path}","compare_url":"https://api.github.com/repos/multipleof4/test/compare/{base}...{head}","merges_url":"https://api.github.com/repos/multipleof4/test/merges","archive_url":"https://api.github.com/repos/multipleof4/test/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/multipleof4/test/downloads","issues_url":"https://api.github.com/repos/multipleof4/test/issues{/number}","pulls_url":"https://api.github.com/repos/multipleof4/test/pulls{/number}","milestones_url":"https://api.github.com/repos/multipleof4/test/milestones{/number}","notifications_url":"https://api.github.com/repos/multipleof4/test/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/multipleof4/test/labels{/name}","releases_url":"https://api.github.com/repos/multipleof4/test/releases{/id}","deployments_url":"https://api.github.com/repos/multipleof4/test/deployments","created_at":"2025-08-20T06:34:53Z","updated_at":"2025-09-08T20:44:30Z","pushed_at":"2025-09-08T20:44:26Z","git_url":"git://github.com/multipleof4/test.git","ssh_url":"git@github.com:multipleof4/test.git","clone_url":"https://github.com/multipleof4/test.git","svn_url":"https://github.com/multipleof4/test","homepage":null,"size":1,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"has_discussions":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":null,"allow_forking":true,"is_template":false,"web_commit_signoff_required":false,"topics":[],"visibility":"public","forks":0,"open_issues":0,"watchers":0,"default_branch":"master","permissions":{"admin":true,"maintain":true,"push":true,"triage":true,"pull":true}},"readmeData":{"name":"README.md","path":"README.md","sha":"d00491fd7e5bb6fa28c517a0bb32b8b506539d4d","size":2,"url":"https://api.github.com/repos/multipleof4/test/contents/README.md?ref=master","html_url":"https://github.com/multipleof4/test/blob/master/README.md","git_url":"https://api.github.com/repos/multipleof4/test/git/blobs/d00491fd7e5bb6fa28c517a0bb32b8b506539d4d","download_url":"https://raw.githubusercontent.com/multipleof4/test/master/README.md","type":"file","content":"MQo=\n","encoding":"base64","_links":{"self":"https://api.github.com/repos/multipleof4/test/contents/README.md?ref=master","git":"https://api.github.com/repos/multipleof4/test/git/blobs/d00491fd7e5bb6fa28c517a0bb32b8b506539d4d","html":"https://github.com/multipleof4/test/blob/master/README.md"}}},"storage":{}}] |