@zibby/skills 0.1.41 → 0.1.42
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/dist/index.d.ts +3 -1
- package/dist/index.js +93 -78
- package/dist/kvMemory.d.ts +78 -0
- package/dist/kvMemory.js +16 -0
- package/dist/package.json +1 -1
- package/docs/cloud/editing-prompts.md +79 -0
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export namespace kvMemorySkill {
|
|
2
|
+
let id: string;
|
|
3
|
+
let serverName: string;
|
|
4
|
+
let allowedTools: string[];
|
|
5
|
+
let description: string;
|
|
6
|
+
let promptFragment: string;
|
|
7
|
+
function resolve(): {
|
|
8
|
+
command: any;
|
|
9
|
+
args: any[];
|
|
10
|
+
env: {};
|
|
11
|
+
description: string;
|
|
12
|
+
type?: undefined;
|
|
13
|
+
alwaysLoad?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
type: string;
|
|
16
|
+
command: string;
|
|
17
|
+
args: any[];
|
|
18
|
+
env: {};
|
|
19
|
+
description: string;
|
|
20
|
+
alwaysLoad: boolean;
|
|
21
|
+
};
|
|
22
|
+
function handleToolCall(name: any, args: any): Promise<string>;
|
|
23
|
+
let tools: ({
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
input_schema: {
|
|
27
|
+
type: string;
|
|
28
|
+
properties: {
|
|
29
|
+
key: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
keyPrefix?: undefined;
|
|
34
|
+
content?: undefined;
|
|
35
|
+
metadata?: undefined;
|
|
36
|
+
};
|
|
37
|
+
required: string[];
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
input_schema: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: {
|
|
45
|
+
keyPrefix: {
|
|
46
|
+
type: string;
|
|
47
|
+
description: string;
|
|
48
|
+
};
|
|
49
|
+
key?: undefined;
|
|
50
|
+
content?: undefined;
|
|
51
|
+
metadata?: undefined;
|
|
52
|
+
};
|
|
53
|
+
required: string[];
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
name: string;
|
|
57
|
+
description: string;
|
|
58
|
+
input_schema: {
|
|
59
|
+
type: string;
|
|
60
|
+
properties: {
|
|
61
|
+
key: {
|
|
62
|
+
type: string;
|
|
63
|
+
description: string;
|
|
64
|
+
};
|
|
65
|
+
content: {
|
|
66
|
+
type: string;
|
|
67
|
+
description: string;
|
|
68
|
+
};
|
|
69
|
+
metadata: {
|
|
70
|
+
type: string;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
keyPrefix?: undefined;
|
|
74
|
+
};
|
|
75
|
+
required: string[];
|
|
76
|
+
};
|
|
77
|
+
})[];
|
|
78
|
+
}
|
package/dist/kvMemory.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{existsSync as a,readFileSync as p}from"node:fs";import{homedir as l}from"node:os";import{join as y,dirname as u,resolve as d}from"node:path";import{fileURLToPath as m}from"node:url";function f(){if(process.env.MCP_SKILL_PATH)return process.env.MCP_SKILL_PATH;let r=u(m(import.meta.url)),e=d(r,"..","bin","mcp-skill.mjs");return a(e)?e:null}function k(){if(process.env.PROJECT_API_TOKEN)return process.env.PROJECT_API_TOKEN;if(process.env.ZIBBY_USER_TOKEN)return process.env.ZIBBY_USER_TOKEN;try{let r=y(l(),".zibby","config.json");return a(r)&&JSON.parse(p(r,"utf-8")).sessionToken||null}catch{return null}}function _(){return process.env.ZIBBY_ACCOUNT_API_URL?process.env.ZIBBY_ACCOUNT_API_URL.replace(/\/$/,""):(process.env.ZIBBY_ENV||"prod")==="local"?"http://localhost:3001":process.env.ZIBBY_PROD_ACCOUNT_API_URL||"https://api-prod.zibby.app"}function v(){return(typeof process.env.WORKFLOW_TYPE=="string"?process.env.WORKFLOW_TYPE.trim():"")||"agent"}function s(r){return`${v()}:${r}`}async function i(r,e){let t=k();if(!t)throw new Error("No backend credential (PROJECT_API_TOKEN). KV memory is only available inside a Zibby run.");let n=`${_()}/credits/review-memory`,o=await fetch(n,{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({op:r,...e})});if(!o.ok){let c=await o.text().catch(()=>"");throw new Error(`KV memory ${r} failed (${o.status}): ${c.slice(0,300)}`)}return o.json()}var T={id:"kv-memory",serverName:"kv_memory",allowedTools:["mcp__kv_memory__*"],description:"KV memory \u2014 a private, per-agent persistent key\u2192value store across stateless runs (auto-namespaced)",promptFragment:`## KV Memory (private, per-agent, persistent key-value store)
|
|
2
|
+
You have a PRIVATE per-agent key-value memory that survives across your
|
|
3
|
+
stateless runs. It is automatically namespaced to YOU (this agent type) \u2014 other
|
|
4
|
+
agents cannot see or collide with your entries, and you don't need to prefix
|
|
5
|
+
anything. Just use plain keys.
|
|
6
|
+
|
|
7
|
+
Tools:
|
|
8
|
+
- kv_recall: Recall the value stored under a plain \`key\` (exact match).
|
|
9
|
+
Use at the START of a run to pick up what a prior run of yours recorded.
|
|
10
|
+
- kv_recall_prefix: List entries whose plain \`keyPrefix\` matches
|
|
11
|
+
(e.g. "seen#" to list everything you've marked seen). Capped at 25.
|
|
12
|
+
- kv_store: Store (overwrite) a concise value under a plain \`key\`.
|
|
13
|
+
Use to record durable facts \u2014 e.g. dedup markers, prior decisions, summaries.
|
|
14
|
+
|
|
15
|
+
Your namespace is added for you automatically; pass plain keys like
|
|
16
|
+
"seen#owner/repo#42" or "lastRun".`,resolve(){let r=f();if(!r)return{command:null,args:[],env:{},description:this.description};let e={};for(let t of["PROJECT_API_TOKEN","ZIBBY_ACCOUNT_API_URL","ZIBBY_ENV","ZIBBY_PROD_ACCOUNT_API_URL","ZIBBY_USER_TOKEN","WORKFLOW_TYPE"])process.env[t]&&(e[t]=process.env[t]);return{type:"stdio",command:"node",args:[r,"../dist/kvMemory.js","kvMemorySkill"],env:e,description:this.description,alwaysLoad:!0}},async handleToolCall(r,e){try{switch(r){case"kv_recall":{let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return JSON.stringify({error:"key is required"});let n=await i("recall",{scope:s(t)});return JSON.stringify(n)}case"kv_recall_prefix":{let t=typeof e?.keyPrefix=="string"?e.keyPrefix.trim():"";if(!t)return JSON.stringify({error:"keyPrefix is required"});let n=await i("recall-prefix",{scopePrefix:s(t)});return JSON.stringify(n)}case"kv_store":{let t=typeof e?.key=="string"?e.key.trim():"";if(!t)return JSON.stringify({error:"key is required"});if(typeof e?.content!="string"||e.content.length===0)return JSON.stringify({error:"content is required (non-empty string)"});let n={scope:s(t),content:e.content};e.metadata!=null&&(n.metadata=e.metadata);let o=await i("store",n);return JSON.stringify(o)}default:return JSON.stringify({error:`Unknown tool: ${r}`})}}catch(t){return JSON.stringify({error:t.message})}},tools:[{name:"kv_recall",description:'Recall the value you stored under a plain key (exact match). Your per-agent namespace is added automatically \u2014 pass a plain key like "seen#owner/repo#42".',input_schema:{type:"object",properties:{key:{type:"string",description:'Plain storage key (no namespace prefix needed) \u2014 e.g. "seen#owner/repo#42" or "lastRun".'}},required:["key"]}},{name:"kv_recall_prefix",description:'List your entries whose plain key STARTS WITH a prefix (e.g. "seen#"). Your per-agent namespace is added automatically. Capped at 25.',input_schema:{type:"object",properties:{keyPrefix:{type:"string",description:'Plain key prefix to match (no namespace prefix needed) \u2014 e.g. "seen#".'}},required:["keyPrefix"]}},{name:"kv_store",description:"Store (overwrite) a value under a plain key so a later run of yours can recall it. Your per-agent namespace is added automatically.",input_schema:{type:"object",properties:{key:{type:"string",description:"Plain storage key (no namespace prefix needed). Same key you recall by."},content:{type:"string",description:"The value to persist. Free-form markdown/text."},metadata:{type:"object",description:"Optional structured metadata."}},required:["key","content"]}}]};export{T as kvMemorySkill};
|
package/dist/package.json
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 6
|
|
3
|
+
title: Editing node prompts
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Editing node prompts
|
|
7
|
+
|
|
8
|
+
Every node in an agent has a **prompt** — the instructions handed to the
|
|
9
|
+
coding agent when that step runs. In the graph editor (both the deploy modal
|
|
10
|
+
and a deployed agent's **Overview** tab) each prompt is tagged with a badge:
|
|
11
|
+
|
|
12
|
+
| Badge | What it means |
|
|
13
|
+
|---|---|
|
|
14
|
+
| <span style={{color:'#34d399',fontWeight:600}}>EDITABLE</span> | The prompt is a stored text template. You can change it right here. |
|
|
15
|
+
| <span style={{color:'#d4b483',fontWeight:600}}>READ-ONLY</span> | The prompt is generated by the node's code at runtime. It can't be edited in the UI. |
|
|
16
|
+
|
|
17
|
+
The `!` next to the badge explains the same thing on hover.
|
|
18
|
+
|
|
19
|
+
## Editable prompts
|
|
20
|
+
|
|
21
|
+
A prompt is editable when the node declares it as a plain text template (a
|
|
22
|
+
string, optionally with `{{variables}}`).
|
|
23
|
+
|
|
24
|
+
The graph shown in the marketplace **deploy modal is a read-only preview** —
|
|
25
|
+
you pick the name and model there, not edit prompts. You edit editable
|
|
26
|
+
prompts **after you deploy**:
|
|
27
|
+
|
|
28
|
+
- Open the deployed agent's **Overview** tab.
|
|
29
|
+
- Click the node, edit the prompt, and save.
|
|
30
|
+
- The change applies to the next run **live — no redeploy needed**.
|
|
31
|
+
|
|
32
|
+
This is the right choice when you want non-developers to tune wording,
|
|
33
|
+
tone, or rules without touching code.
|
|
34
|
+
|
|
35
|
+
## Read-only prompts
|
|
36
|
+
|
|
37
|
+
A prompt is read-only when the node builds it **in code** — a function that
|
|
38
|
+
assembles the text from state, fetched context, or conditionals at runtime.
|
|
39
|
+
There's no fixed string to edit, so the editor shows a rendered preview only.
|
|
40
|
+
|
|
41
|
+
To change a read-only prompt you edit the agent's source and redeploy. You
|
|
42
|
+
don't need to leave your AI coding agent to do it — the
|
|
43
|
+
[Zibby MCP](../packages/mcp-cli) drives the whole loop from chat:
|
|
44
|
+
|
|
45
|
+
1. **Download the agent** — pull the deployed sources back to your machine.
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
zibby agent download <uuid>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or, from an MCP-aware agent (Claude Code / Cursor / Codex / Gemini),
|
|
52
|
+
ask it to call `zibby_download_agent`.
|
|
53
|
+
|
|
54
|
+
2. **Edit the node's code** — open the node file under
|
|
55
|
+
`.zibby/workflows/<name>/nodes/` and change how the prompt is built. Your
|
|
56
|
+
coding agent can do this directly.
|
|
57
|
+
|
|
58
|
+
3. **Redeploy to update** — ship the change back to the same agent.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
zibby agent deploy <name>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Or have the agent call `zibby_deploy_agent`. The deployed agent updates in
|
|
65
|
+
place; its UUID and trigger config stay the same.
|
|
66
|
+
|
|
67
|
+
:::tip Want it editable instead?
|
|
68
|
+
If a prompt would be better tuned by non-developers, convert the node from a
|
|
69
|
+
function prompt to a **string template**. Once it's a stored template, the
|
|
70
|
+
badge flips to **Editable** and it gains live-update from Overview.
|
|
71
|
+
:::
|
|
72
|
+
|
|
73
|
+
## Why the split exists
|
|
74
|
+
|
|
75
|
+
Function prompts exist for a reason: some nodes need to assemble instructions
|
|
76
|
+
from things only known at runtime — the linked ticket, the diff, prior
|
|
77
|
+
reviews, whether an integration is connected. A fixed text box can't express
|
|
78
|
+
that logic, so those nodes keep their prompt in code. Simpler, static prompts
|
|
79
|
+
stay as editable templates so anyone can adjust them.
|