slatebox-mcp 0.3.5 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -7
- package/generated/client.json +522 -629
- package/generated/exec-tool.json +22 -23
- package/generated/guest-client.js +1 -1
- package/generated/slatebox.d.ts +157 -190
- package/package.json +5 -4
- package/src/cli.js +15 -60
- package/src/{slatebox.js → commands.js} +57 -41
- package/src/mcp.js +75 -0
package/generated/exec-tool.json
CHANGED
|
@@ -609,7 +609,7 @@
|
|
|
609
609
|
{
|
|
610
610
|
"name": "check_ai_connection",
|
|
611
611
|
"title": "Test an AI connection",
|
|
612
|
-
"description": "Test whether Slatebox can reach an AI connection (a provider key, or an OpenAI-compatible endpoint) before it is used for drafting.\n\nTest AI. Tests
|
|
612
|
+
"description": "Test whether Slatebox can reach an AI connection (a provider key, or an OpenAI-compatible endpoint) before it is used for drafting.\n\nTest AI. Tests your own or your team's saved connection (name) or one not yet saved (connection), on a self-hosted server: whether Slatebox can reach it, whether it accepts the key, which models it lists, whether the model answers and whether it calls tools (which conversation, drafts and presentations need). Saves nothing. A saved key is only sent to the address it was saved for. A token needs ai:admin as well for level team. The server's keys are tested with ai.keys.test. A model on the host is at host.docker.internal, not localhost.",
|
|
613
613
|
"inputSchema": {
|
|
614
614
|
"type": "object",
|
|
615
615
|
"properties": {
|
|
@@ -617,10 +617,9 @@
|
|
|
617
617
|
"type": "string",
|
|
618
618
|
"enum": [
|
|
619
619
|
"me",
|
|
620
|
-
"team"
|
|
621
|
-
"server"
|
|
620
|
+
"team"
|
|
622
621
|
],
|
|
623
|
-
"description": "me (yours)
|
|
622
|
+
"description": "me (yours) or team (team admins)."
|
|
624
623
|
},
|
|
625
624
|
"name": {
|
|
626
625
|
"type": "string",
|
|
@@ -637,7 +636,7 @@
|
|
|
637
636
|
"type": {
|
|
638
637
|
"type": "string",
|
|
639
638
|
"pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
|
|
640
|
-
"description": "The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), openai, anthropic, deepinfra, or one an administrator added
|
|
639
|
+
"description": "The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), a named one (meta, openai, anthropic, deepinfra, together, groq, fireworks, openrouter, mistral, xai, gemini), or one an administrator added."
|
|
641
640
|
},
|
|
642
641
|
"baseUrl": {
|
|
643
642
|
"type": "string",
|
|
@@ -737,7 +736,7 @@
|
|
|
737
736
|
{
|
|
738
737
|
"name": "update_ai_settings",
|
|
739
738
|
"title": "Change AI connections and choices",
|
|
740
|
-
"description": "Add, change or remove the AI connections Slatebox drafts with, and choose which connection each feature uses.\n\nSet AI.
|
|
739
|
+
"description": "Add, change or remove the AI connections Slatebox drafts with, and choose which connection each feature uses.\n\nSet AI. Your own or your team's AI on a self-hosted server: adds or changes connections (a cloud provider with its key, or any OpenAI-compatible endpoint with its address, optional key and model), removes some, and chooses which connection each feature uses. level me changes yours, team your team's (team admins); level server only turns own AI on or off for everyone (ownProviders, administrators). A choice names me:<name>, team:<name>, or builtin for this server's model (set in Admin → AI control). Keys are stored encrypted and never returned. Returns the settings as ai.get does. A token needs ai:admin as well for level team or server. Own AI (levels me and team) is for self-hosted Slatebox: Slatebox Cloud refuses it, as AI there comes with Slatebox Pro credits and top-ups.",
|
|
741
740
|
"inputSchema": {
|
|
742
741
|
"type": "object",
|
|
743
742
|
"properties": {
|
|
@@ -764,7 +763,7 @@
|
|
|
764
763
|
"type": {
|
|
765
764
|
"type": "string",
|
|
766
765
|
"pattern": "^[a-z0-9][a-z0-9-]{0,39}$",
|
|
767
|
-
"description": "The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), openai, anthropic, deepinfra, or one an administrator added
|
|
766
|
+
"description": "The provider: openai-compatible (any host or local server: Ollama, llama.cpp, vLLM, LM Studio and others), a named one (meta, openai, anthropic, deepinfra, together, groq, fireworks, openrouter, mistral, xai, gemini), or one an administrator added."
|
|
768
767
|
},
|
|
769
768
|
"baseUrl": {
|
|
770
769
|
"type": "string",
|
|
@@ -837,7 +836,7 @@
|
|
|
837
836
|
"null"
|
|
838
837
|
],
|
|
839
838
|
"maxLength": 48,
|
|
840
|
-
"description": "me:<name
|
|
839
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
841
840
|
},
|
|
842
841
|
"chat": {
|
|
843
842
|
"type": [
|
|
@@ -845,7 +844,7 @@
|
|
|
845
844
|
"null"
|
|
846
845
|
],
|
|
847
846
|
"maxLength": 48,
|
|
848
|
-
"description": "me:<name
|
|
847
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
849
848
|
},
|
|
850
849
|
"chat.route": {
|
|
851
850
|
"type": [
|
|
@@ -853,7 +852,7 @@
|
|
|
853
852
|
"null"
|
|
854
853
|
],
|
|
855
854
|
"maxLength": 48,
|
|
856
|
-
"description": "me:<name
|
|
855
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
857
856
|
},
|
|
858
857
|
"generation": {
|
|
859
858
|
"type": [
|
|
@@ -861,7 +860,7 @@
|
|
|
861
860
|
"null"
|
|
862
861
|
],
|
|
863
862
|
"maxLength": 48,
|
|
864
|
-
"description": "me:<name
|
|
863
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
865
864
|
},
|
|
866
865
|
"generation.notes": {
|
|
867
866
|
"type": [
|
|
@@ -869,7 +868,7 @@
|
|
|
869
868
|
"null"
|
|
870
869
|
],
|
|
871
870
|
"maxLength": 48,
|
|
872
|
-
"description": "me:<name
|
|
871
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
873
872
|
},
|
|
874
873
|
"presentation": {
|
|
875
874
|
"type": [
|
|
@@ -877,7 +876,7 @@
|
|
|
877
876
|
"null"
|
|
878
877
|
],
|
|
879
878
|
"maxLength": 48,
|
|
880
|
-
"description": "me:<name
|
|
879
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
881
880
|
},
|
|
882
881
|
"vision": {
|
|
883
882
|
"type": [
|
|
@@ -885,7 +884,7 @@
|
|
|
885
884
|
"null"
|
|
886
885
|
],
|
|
887
886
|
"maxLength": 48,
|
|
888
|
-
"description": "me:<name
|
|
887
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
889
888
|
},
|
|
890
889
|
"images": {
|
|
891
890
|
"type": [
|
|
@@ -893,7 +892,7 @@
|
|
|
893
892
|
"null"
|
|
894
893
|
],
|
|
895
894
|
"maxLength": 48,
|
|
896
|
-
"description": "me:<name
|
|
895
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
897
896
|
},
|
|
898
897
|
"shape": {
|
|
899
898
|
"type": [
|
|
@@ -901,7 +900,7 @@
|
|
|
901
900
|
"null"
|
|
902
901
|
],
|
|
903
902
|
"maxLength": 48,
|
|
904
|
-
"description": "me:<name
|
|
903
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
905
904
|
},
|
|
906
905
|
"workshop": {
|
|
907
906
|
"type": [
|
|
@@ -909,7 +908,7 @@
|
|
|
909
908
|
"null"
|
|
910
909
|
],
|
|
911
910
|
"maxLength": 48,
|
|
912
|
-
"description": "me:<name
|
|
911
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
913
912
|
},
|
|
914
913
|
"workshop.draft": {
|
|
915
914
|
"type": [
|
|
@@ -917,7 +916,7 @@
|
|
|
917
916
|
"null"
|
|
918
917
|
],
|
|
919
918
|
"maxLength": 48,
|
|
920
|
-
"description": "me:<name
|
|
919
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
921
920
|
},
|
|
922
921
|
"canvas": {
|
|
923
922
|
"type": [
|
|
@@ -925,7 +924,7 @@
|
|
|
925
924
|
"null"
|
|
926
925
|
],
|
|
927
926
|
"maxLength": 48,
|
|
928
|
-
"description": "me:<name
|
|
927
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
929
928
|
},
|
|
930
929
|
"agent.slatebox": {
|
|
931
930
|
"type": [
|
|
@@ -933,7 +932,7 @@
|
|
|
933
932
|
"null"
|
|
934
933
|
],
|
|
935
934
|
"maxLength": 48,
|
|
936
|
-
"description": "me:<name
|
|
935
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
937
936
|
},
|
|
938
937
|
"library": {
|
|
939
938
|
"type": [
|
|
@@ -941,7 +940,7 @@
|
|
|
941
940
|
"null"
|
|
942
941
|
],
|
|
943
942
|
"maxLength": 48,
|
|
944
|
-
"description": "me:<name
|
|
943
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
945
944
|
},
|
|
946
945
|
"connectors": {
|
|
947
946
|
"type": [
|
|
@@ -949,7 +948,7 @@
|
|
|
949
948
|
"null"
|
|
950
949
|
],
|
|
951
950
|
"maxLength": 48,
|
|
952
|
-
"description": "me:<name
|
|
951
|
+
"description": "me:<name> or team:<name> for a connection, builtin for this server's model (Admin → AI control), null to clear."
|
|
953
952
|
}
|
|
954
953
|
},
|
|
955
954
|
"additionalProperties": false,
|
|
@@ -3629,7 +3628,7 @@
|
|
|
3629
3628
|
{
|
|
3630
3629
|
"name": "decide_suggestions",
|
|
3631
3630
|
"title": "Keep, discard or undo agent work",
|
|
3632
|
-
"description": "Keep (save) or discard what an agent suggested on a slate (one action or some of its items), or undo one agent action that was kept or saved directly.\n\nKeep/discard/undo. Decide what an agent's work on a slate becomes, as the canvas does. keep or discard: what it suggested, as Keep and Discard on each ghost: name the action (actionId, from your edit or slates.get include=suggestions), optionally some of its items (itemIds); Keep all on an agent's chip decides each of its actions. Keeping saves them as one change (a line brings the new notes at its ends); an item whose note is gone is refused and says why. Discarding saves nothing. undo: one action (actionId) that was kept or saved directly, as Undo in the agent's activity list: only that action, and only what nobody changed since (left[] says what stayed and why), so it never undoes another agent's work or a person's. Needs the edit right on the slate. Only people keep: an agent never keeps suggestions, and undoes only its own work.",
|
|
3631
|
+
"description": "Keep (save) or discard what an agent suggested on a slate (one action or some of its items), or undo one agent action that was kept or saved directly.\n\nKeep/discard/undo. Decide what an agent's work on a slate becomes, as the canvas does. keep or discard: what it suggested, as Keep and Discard on each ghost: name the action (actionId, from your edit or slates.get include=suggestions), optionally some of its items (itemIds); Keep all on an agent's chip decides each of its actions. Keeping saves them as one change (a line brings the new notes at its ends); an item whose note is gone is refused and says why. Discarding saves nothing. undo: one action (actionId) that was kept or saved directly, as Undo in the agent's activity list: only that action, and only what nobody changed since (left[] says what stayed and why), so it never undoes another agent's work or a person's. Needs the edit right on the slate. Only people keep: an agent never keeps suggestions, and undoes only its own work. An invited agent's action card (a waiting note that stands for a change outside Slatebox, such as a new Linear issue) is approved by keeping that note on its own (itemIds) and declined by discarding it; Keep all never approves one, and held[] says why a card waits.",
|
|
3633
3632
|
"inputSchema": {
|
|
3634
3633
|
"type": "object",
|
|
3635
3634
|
"properties": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// The exec guest prelude (one line, so the caller's code starts on line 2) and its trailer.
|
|
3
3
|
// Source run = PRELUDE + "\n" + code + TRAILER, as an async function body named run.js.
|
|
4
4
|
// It needs a global __slatebox.call(name, input) resolving to {ok:true,value} or {ok:false,error}.
|
|
5
|
-
export const PRELUDE = "const __sbx=(()=>{const C=__slatebox;class SlateboxError extends Error{constructor(e){super(String(e&&e.message||\"Slatebox refused the call.\"));this.name=\"SlateboxError\";this.code=String(e&&e.code||\"error\");this.status=Number(e&&e.status)||0;if(e&&e.details!==undefined)this.details=e.details;if(e&&e.retryAfter!==undefined)this.retryAfter=e.retryAfter;}}const plain=v=>v!==null&&typeof v===\"object\"&&!Array.isArray(v)&&(Object.getPrototypeOf(v)===Object.prototype||Object.getPrototypeOf(v)===null);const method=name=>async function(input,...rest){if(rest.length)throw new SlateboxError({code:\"invalid_request\",status:400,message:name+\" takes one object argument.\"});if(input===undefined)input={};if(!plain(input))throw new SlateboxError({code:\"invalid_request\",status:400,message:name+\" takes one plain object as its argument.\"});const r=await C.call(name,input);if(r&&r.ok)return r.value;throw new SlateboxError(r&&r.error);};const tree={};for(const n of [\"account.get\",\"agentTasks.create\",\"agentTasks.list\",\"agentTasks.update\",\"ai.audit.list\",\"ai.bindings.list\",\"ai.bindings.
|
|
5
|
+
export const PRELUDE = "const __sbx=(()=>{const C=__slatebox;class SlateboxError extends Error{constructor(e){super(String(e&&e.message||\"Slatebox refused the call.\"));this.name=\"SlateboxError\";this.code=String(e&&e.code||\"error\");this.status=Number(e&&e.status)||0;if(e&&e.details!==undefined)this.details=e.details;if(e&&e.retryAfter!==undefined)this.retryAfter=e.retryAfter;}}const plain=v=>v!==null&&typeof v===\"object\"&&!Array.isArray(v)&&(Object.getPrototypeOf(v)===Object.prototype||Object.getPrototypeOf(v)===null);const method=name=>async function(input,...rest){if(rest.length)throw new SlateboxError({code:\"invalid_request\",status:400,message:name+\" takes one object argument.\"});if(input===undefined)input={};if(!plain(input))throw new SlateboxError({code:\"invalid_request\",status:400,message:name+\" takes one plain object as its argument.\"});const r=await C.call(name,input);if(r&&r.ok)return r.value;throw new SlateboxError(r&&r.error);};const tree={};for(const n of [\"account.get\",\"agentTasks.create\",\"agentTasks.list\",\"agentTasks.update\",\"ai.audit.list\",\"ai.bindings.list\",\"ai.bindings.set\",\"ai.check\",\"ai.control.effective\",\"ai.control.get\",\"ai.control.health\",\"ai.control.reset\",\"ai.get\",\"ai.keys.list\",\"ai.keys.test\",\"ai.models.discover\",\"ai.models.save\",\"ai.models.test\",\"ai.prompts.get\",\"ai.prompts.list\",\"ai.prompts.render\",\"ai.prompts.saveDraft\",\"ai.prompts.test\",\"ai.providers.add\",\"ai.providers.save\",\"ai.update\",\"comments.add\",\"comments.list\",\"comments.remove\",\"comments.resolve\",\"components.get\",\"components.list\",\"instance.describe\",\"library.branch\",\"library.comment\",\"library.discard\",\"library.export\",\"library.fork\",\"library.get\",\"library.list\",\"library.mine\",\"library.review.approve\",\"library.review.open\",\"library.review.queue\",\"library.review.refine\",\"library.review.reject\",\"library.review.requestChanges\",\"library.review.unpublish\",\"library.review.update\",\"library.saveDraft\",\"library.stats\",\"library.submit\",\"library.withdraw\",\"media.lookup\",\"presence.plan\",\"presence.step\",\"presentations.create\",\"presentations.get\",\"presentations.setStyle\",\"shapes.apply\",\"shapes.generate\",\"shapes.list\",\"shapes.searchIcons\",\"slates.addMedia\",\"slates.applyOperations\",\"slates.checkMove\",\"slates.copy\",\"slates.create\",\"slates.delete\",\"slates.exportMermaid\",\"slates.get\",\"slates.importMermaid\",\"slates.issueInvite\",\"slates.list\",\"slates.redo\",\"slates.revokeInvite\",\"slates.undo\",\"suggestions.decide\",\"team.export\",\"teamImports.confirm\",\"teamImports.discard\",\"teamImports.get\",\"teamImports.invite\",\"teamImports.list\",\"teamImports.start\"]){const p=n.split(\".\");let t=tree;for(let i=0;i<p.length-1;i++)t=t[p[i]]||(t[p[i]]={});t[p[p.length-1]]=method(n);}const freeze=o=>{for(const k of Object.keys(o))if(typeof o[k]===\"object\")freeze(o[k]);return Object.freeze(o);};const logs=[];let size=0,cut=false;const fmt=a=>{if(typeof a===\"string\")return a;try{const j=JSON.stringify(a);return j===undefined?String(a):j;}catch{return String(a);}};const log=(...a)=>{if(cut)return;const line=a.map(fmt).join(\" \");size+=line.length+1;if(size>16384){cut=true;logs.push(\"[logs cut at 16 KiB]\");return;}logs.push(line);};const base=(()=>{const m=/run\\.js:(\\d+):/.exec(String(new Error().stack||\"\"));return m?Number(m[1]):1;})();const loc=e=>{const re=/run\\.js:(\\d+):(\\d+)/g;const s=String(e&&e.stack||\"\");let m;while((m=re.exec(s))){if(Number(m[1])>base)return{line:Number(m[1])-base,column:Number(m[2])};}return{};};const run=async f=>{try{const v=await f();if(v===undefined)return{ok:true,json:null,logs};let j;try{j=JSON.stringify(v);}catch(e){return{ok:false,error:{code:\"result_not_json\",message:\"Return a JSON value. \"+String(e&&e.message||\"\")},logs};}if(j===undefined)return{ok:false,error:{code:\"result_not_json\",message:\"Return a JSON value, not a function or a symbol.\"},logs};return{ok:true,json:j,logs};}catch(e){if(e&&e.name===\"InternalError\")throw e;const out={code:e instanceof SlateboxError?e.code:\"script_error\",message:String(e&&e.message||e),...loc(e)};if(e instanceof SlateboxError){out.status=e.status;if(e.details!==undefined)out.details=e.details;}return{ok:false,error:out,logs};}};return{slatebox:freeze(tree),SlateboxError,console:Object.freeze({log,info:log,warn:log,error:log,debug:log}),run};})();const slatebox=__sbx.slatebox,SlateboxError=__sbx.SlateboxError,console=__sbx.console;return await __sbx.run(async()=>{"
|
|
6
6
|
export const TRAILER = "\n});"
|
|
7
7
|
export const wrap = (code) => PRELUDE + "\n" + code + TRAILER
|
|
8
8
|
export default PRELUDE
|