@palettelab/cli 0.3.75 → 0.3.77
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 +37 -5
- package/backend-sdk/palette_sdk/__init__.py +1 -1
- package/backend-sdk/palette_sdk/agent_routes.py +28 -2
- package/backend-sdk/palette_sdk/apps.py +16 -1
- package/backend-sdk/palette_sdk/connections_generated.py +27 -0
- package/backend-sdk/palette_sdk/data_rooms.py +59 -0
- package/backend-sdk/palette_sdk/manifest.py +10 -0
- package/backend-sdk/palette_sdk/mcp.py +11 -2
- package/backend-sdk/palette_sdk/platform_services.py +81 -15
- package/backend-sdk/palette_sdk/tool_definition.py +21 -1
- package/backend-sdk/pyproject.toml +1 -1
- package/docs/connectors.md +154 -0
- package/docs/python-backend-sdk.md +113 -4
- package/lib/bundler.js +5 -2
- package/lib/cli.js +2 -2
- package/lib/commands/capabilities.js +30 -9
- package/lib/commands/check.js +7 -0
- package/lib/commands/package.js +5 -1
- package/lib/commands/publish.js +17 -0
- package/lib/commands/test.js +15 -3
- package/lib/connection-catalog.json +167 -0
- package/lib/connector.js +148 -0
- package/lib/manifest.js +22 -1
- package/package.json +1 -1
- package/template-fallback/backend/api/main.py +4 -2
- package/template-fallback/backend/tools/example_tool.py +4 -0
- package/template-fallback/package.json +1 -1
- package/template-fallback/palette-plugin.json +4 -0
- package/template-fallback/templates/agent-tool/README.md +3 -0
- package/template-fallback/templates/agent-tool/palette-plugin.json +4 -0
- package/template-fallback/templates/agent-tool/skills/echo-check/SKILL.md +15 -0
- package/template-fallback/templates/consumer-app/backend/api/main.py +3 -2
- package/template-fallback/templates/consumer-app/package.json +1 -1
- package/template-fallback/templates/consumer-app/palette-plugin.json +4 -0
- package/template-fallback/templates/dashboard/backend/api/main.py +2 -2
- package/template-fallback/templates/dashboard/package.json +1 -1
- package/template-fallback/templates/dashboard/palette-plugin.json +4 -0
- package/template-fallback/templates/database/backend/api/main.py +3 -3
- package/template-fallback/templates/database/package.json +1 -1
- package/template-fallback/templates/database/palette-plugin.json +4 -0
- package/template-fallback/templates/external-service/backend/api/main.py +3 -2
- package/template-fallback/templates/external-service/package.json +1 -1
- package/template-fallback/templates/external-service/palette-plugin.json +4 -0
- package/template-fallback/templates/frontend-only/package.json +1 -1
- package/template-fallback/templates/frontend-only/palette-plugin.json +4 -0
- package/template-fallback/templates/next/package.json +1 -1
- package/template-fallback/templates/next/palette-plugin.json +4 -0
- package/template-fallback/templates/palette-app/backend/api/main.py +2 -2
- package/template-fallback/templates/palette-app/package.json +1 -1
- package/template-fallback/templates/palette-app/palette-plugin.json +4 -0
- package/template-fallback/templates/provider-app/backend/api/main.py +2 -2
- package/template-fallback/templates/provider-app/package.json +1 -1
- package/template-fallback/templates/provider-app/palette-plugin.json +5 -0
|
@@ -95,6 +95,35 @@
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
|
+
{
|
|
99
|
+
"name": "confluence.list_trash",
|
|
100
|
+
"namespace": "confluence",
|
|
101
|
+
"method": "list_trash",
|
|
102
|
+
"description": "List deleted Confluence pages and blog posts still in the trash (whole site, or one space by key or id). Search never returns trashed content; use this to find deleted pages.",
|
|
103
|
+
"mutating": false,
|
|
104
|
+
"risk": "read",
|
|
105
|
+
"input_schema": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"space_key": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"description": "Only this space's trash"
|
|
111
|
+
},
|
|
112
|
+
"space_id": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "Space id (instead of space_key)"
|
|
115
|
+
},
|
|
116
|
+
"limit": {
|
|
117
|
+
"type": "integer",
|
|
118
|
+
"description": "Max of each kind (default 25, cap 250)"
|
|
119
|
+
},
|
|
120
|
+
"site": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "Atlassian site url, name or cloud id when the account has several (default: first site)"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
98
127
|
{
|
|
99
128
|
"name": "confluence.search",
|
|
100
129
|
"namespace": "confluence",
|
|
@@ -257,6 +286,47 @@
|
|
|
257
286
|
]
|
|
258
287
|
}
|
|
259
288
|
},
|
|
289
|
+
{
|
|
290
|
+
"name": "jira.create_project",
|
|
291
|
+
"namespace": "jira",
|
|
292
|
+
"method": "create_project",
|
|
293
|
+
"description": "Create a Jira project (needs the Jira admin permission). template: kanban (default), scrum, kanban-company, scrum-company, project-management, task-tracking, recruitment, procurement, process-control, lead-tracking, content-management, document-approval, it-service-management, or a full Jira template key. The lead defaults to the connected user.",
|
|
294
|
+
"mutating": true,
|
|
295
|
+
"risk": "external_write",
|
|
296
|
+
"input_schema": {
|
|
297
|
+
"type": "object",
|
|
298
|
+
"properties": {
|
|
299
|
+
"name": {
|
|
300
|
+
"type": "string",
|
|
301
|
+
"description": "Project name"
|
|
302
|
+
},
|
|
303
|
+
"key": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"description": "Unique project key: an uppercase letter then letters/digits, at most 10 (e.g. RCRT)"
|
|
306
|
+
},
|
|
307
|
+
"template": {
|
|
308
|
+
"type": "string",
|
|
309
|
+
"description": "Template short name or full key (default kanban)"
|
|
310
|
+
},
|
|
311
|
+
"description": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"description": "Project description"
|
|
314
|
+
},
|
|
315
|
+
"lead_account_id": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"description": "Lead's account id (from jira.search_users)"
|
|
318
|
+
},
|
|
319
|
+
"site": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"description": "Atlassian site url, name or cloud id when the account has several (default: first site)"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"required": [
|
|
325
|
+
"name",
|
|
326
|
+
"key"
|
|
327
|
+
]
|
|
328
|
+
}
|
|
329
|
+
},
|
|
260
330
|
{
|
|
261
331
|
"name": "jira.get_issue",
|
|
262
332
|
"namespace": "jira",
|
|
@@ -2049,6 +2119,103 @@
|
|
|
2049
2119
|
}
|
|
2050
2120
|
]
|
|
2051
2121
|
},
|
|
2122
|
+
{
|
|
2123
|
+
"slug": "rovo",
|
|
2124
|
+
"label": "Atlassian Rovo MCP",
|
|
2125
|
+
"auth_type": "oauth2",
|
|
2126
|
+
"tools": [
|
|
2127
|
+
{
|
|
2128
|
+
"name": "rovo.describe_tool",
|
|
2129
|
+
"namespace": "rovo",
|
|
2130
|
+
"method": "describe_tool",
|
|
2131
|
+
"description": "Read one Atlassian tool's full instructions and argument schema before calling it.",
|
|
2132
|
+
"mutating": false,
|
|
2133
|
+
"risk": "read",
|
|
2134
|
+
"input_schema": {
|
|
2135
|
+
"type": "object",
|
|
2136
|
+
"properties": {
|
|
2137
|
+
"name": {
|
|
2138
|
+
"type": "string",
|
|
2139
|
+
"description": "Tool name from rovo.list_tools (e.g. searchJiraIssuesUsingJql, createConfluenceContent)"
|
|
2140
|
+
}
|
|
2141
|
+
},
|
|
2142
|
+
"required": [
|
|
2143
|
+
"name"
|
|
2144
|
+
]
|
|
2145
|
+
}
|
|
2146
|
+
},
|
|
2147
|
+
{
|
|
2148
|
+
"name": "rovo.execute",
|
|
2149
|
+
"namespace": "rovo",
|
|
2150
|
+
"method": "execute",
|
|
2151
|
+
"description": "Call an Atlassian tool that changes something: createJiraIssue, editJiraIssue, transitionJiraIssue, addOrEditJiraIssueComment, createConfluenceContent, updateConfluenceContent, createJsmRequest, createBitbucketRepoPullRequest \u2026 Most tools need a cloudId: get it first with rovo.query name=getAccessibleAtlassianResources. Staged for approval; Atlassian applies the user's own permissions.",
|
|
2152
|
+
"mutating": true,
|
|
2153
|
+
"risk": "external_write",
|
|
2154
|
+
"input_schema": {
|
|
2155
|
+
"type": "object",
|
|
2156
|
+
"properties": {
|
|
2157
|
+
"name": {
|
|
2158
|
+
"type": "string",
|
|
2159
|
+
"description": "Tool name from rovo.list_tools (e.g. searchJiraIssuesUsingJql, createConfluenceContent)"
|
|
2160
|
+
},
|
|
2161
|
+
"arguments": {
|
|
2162
|
+
"type": "object",
|
|
2163
|
+
"description": "Arguments exactly as rovo.describe_tool's input_schema shows (most take cloudId)"
|
|
2164
|
+
}
|
|
2165
|
+
},
|
|
2166
|
+
"required": [
|
|
2167
|
+
"name"
|
|
2168
|
+
]
|
|
2169
|
+
}
|
|
2170
|
+
},
|
|
2171
|
+
{
|
|
2172
|
+
"name": "rovo.list_tools",
|
|
2173
|
+
"namespace": "rovo",
|
|
2174
|
+
"method": "list_tools",
|
|
2175
|
+
"description": "List the Atlassian tools this account can use (Jira, Confluence, Jira Service Management, Bitbucket, Loom, Goals, Projects, Teams, Assets \u2026), filtered by keyword; each row says read or write.",
|
|
2176
|
+
"mutating": false,
|
|
2177
|
+
"risk": "read",
|
|
2178
|
+
"input_schema": {
|
|
2179
|
+
"type": "object",
|
|
2180
|
+
"properties": {
|
|
2181
|
+
"query": {
|
|
2182
|
+
"type": "string",
|
|
2183
|
+
"description": "Keyword, e.g. 'Jira', 'Confluence', 'sprint', 'pull request'"
|
|
2184
|
+
},
|
|
2185
|
+
"limit": {
|
|
2186
|
+
"type": "integer",
|
|
2187
|
+
"description": "Max tools (default 50, cap 200)"
|
|
2188
|
+
}
|
|
2189
|
+
},
|
|
2190
|
+
"required": []
|
|
2191
|
+
}
|
|
2192
|
+
},
|
|
2193
|
+
{
|
|
2194
|
+
"name": "rovo.query",
|
|
2195
|
+
"namespace": "rovo",
|
|
2196
|
+
"method": "query",
|
|
2197
|
+
"description": "Call a read-only Atlassian tool (atlassianUserInfo, getAccessibleAtlassianResources, getJiraIssue, searchJiraIssuesUsingJql, searchConfluence, getConfluenceContent, listBitbucketRepositories \u2026). Most tools need a cloudId: get it first with rovo.query name=getAccessibleAtlassianResources. Refuses tools that change anything.",
|
|
2198
|
+
"mutating": false,
|
|
2199
|
+
"risk": "read",
|
|
2200
|
+
"input_schema": {
|
|
2201
|
+
"type": "object",
|
|
2202
|
+
"properties": {
|
|
2203
|
+
"name": {
|
|
2204
|
+
"type": "string",
|
|
2205
|
+
"description": "Tool name from rovo.list_tools (e.g. searchJiraIssuesUsingJql, createConfluenceContent)"
|
|
2206
|
+
},
|
|
2207
|
+
"arguments": {
|
|
2208
|
+
"type": "object",
|
|
2209
|
+
"description": "Arguments exactly as rovo.describe_tool's input_schema shows (most take cloudId)"
|
|
2210
|
+
}
|
|
2211
|
+
},
|
|
2212
|
+
"required": [
|
|
2213
|
+
"name"
|
|
2214
|
+
]
|
|
2215
|
+
}
|
|
2216
|
+
}
|
|
2217
|
+
]
|
|
2218
|
+
},
|
|
2052
2219
|
{
|
|
2053
2220
|
"slug": "slack",
|
|
2054
2221
|
"label": "Slack",
|
package/lib/connector.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict"
|
|
2
|
+
|
|
3
|
+
// The app as a connector: what an agent will see of it (`pltt capabilities`), what `pltt test` and `pltt check` say
|
|
4
|
+
// about it, and what a publish sends to review. Everything here reads the manifest and the app's files; the routes
|
|
5
|
+
// come from the backend probe in `pltt test`, which is the only place that imports the app.
|
|
6
|
+
|
|
7
|
+
const fs = require("fs")
|
|
8
|
+
const path = require("path")
|
|
9
|
+
|
|
10
|
+
const SKIPPED_DIRS = new Set(["__pycache__", ".venv", "node_modules", ".palette", "dist", "palette_sdk"])
|
|
11
|
+
|
|
12
|
+
// The app's skills/<name>/SKILL.md packs. `error` marks one the platform would leave out.
|
|
13
|
+
// ponytail: reads single-line `key: value` frontmatter, which is what the platform's own packs use; a YAML parser if
|
|
14
|
+
// apps start writing block scalars.
|
|
15
|
+
function skills(cwd) {
|
|
16
|
+
const base = path.join(cwd, "skills")
|
|
17
|
+
if (!fs.existsSync(base)) return []
|
|
18
|
+
return fs.readdirSync(base, { withFileTypes: true })
|
|
19
|
+
.filter((entry) => entry.isDirectory() && fs.existsSync(path.join(base, entry.name, "SKILL.md")))
|
|
20
|
+
.map((entry) => {
|
|
21
|
+
const file = `skills/${entry.name}/SKILL.md`
|
|
22
|
+
const front = /^---\s*\n([\s\S]*?)\n---/.exec(fs.readFileSync(path.join(cwd, file), "utf8"))
|
|
23
|
+
const field = (key) => {
|
|
24
|
+
const match = new RegExp(`^${key}:[ \\t]*(.*)$`, "m").exec(front ? front[1] : "")
|
|
25
|
+
return match ? match[1].trim().replace(/^(["'])(.*)\1$/, "$2") : ""
|
|
26
|
+
}
|
|
27
|
+
const skill = { name: entry.name, description: field("description"), tools: field("allowed-tools").split(/[\s,]+/).filter(Boolean), file }
|
|
28
|
+
return field("name") === entry.name && skill.description ? skill : { ...skill, error: true }
|
|
29
|
+
})
|
|
30
|
+
.sort((a, b) => a.name.localeCompare(b.name))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function events(manifest) {
|
|
34
|
+
return (manifest.provides?.events || []).map((event) => {
|
|
35
|
+
const item = typeof event === "string" ? { topic: event } : event
|
|
36
|
+
const missing = [!item.description && "description", (item.payload_schema ?? item.schema) === undefined && "payload schema"].filter(Boolean)
|
|
37
|
+
return { topic: item.topic || item.name, description: item.description || "", missing }
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function view(cwd, manifest) {
|
|
42
|
+
return {
|
|
43
|
+
summary: manifest.agent?.summary || null,
|
|
44
|
+
instructions: manifest.agent?.instructions || null,
|
|
45
|
+
skills: skills(cwd).filter((skill) => !skill.error).map((skill) => ({ name: skill.name, description: skill.description, tools: skill.tools })),
|
|
46
|
+
events: events(manifest).map((event) => ({ topic: event.topic, description: event.description, trigger: event.missing.length === 0 })),
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Lines that use the path-style call to another app, which skips the typed contract.
|
|
51
|
+
function pathStyleCalls(cwd) {
|
|
52
|
+
const found = []
|
|
53
|
+
const visit = (dir) => {
|
|
54
|
+
if (!fs.existsSync(dir)) return
|
|
55
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
56
|
+
if (SKIPPED_DIRS.has(entry.name)) continue
|
|
57
|
+
const abs = path.join(dir, entry.name)
|
|
58
|
+
if (entry.isDirectory()) visit(abs)
|
|
59
|
+
else if (entry.name.endsWith(".py")) {
|
|
60
|
+
fs.readFileSync(abs, "utf8").split("\n").forEach((line, i) => {
|
|
61
|
+
if (/\bapps\.call\(/.test(line) && !/^\s*#/.test(line)) found.push({ file: path.relative(cwd, abs).split(path.sep).join("/"), line: i + 1 })
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
visit(path.join(cwd, "backend"))
|
|
67
|
+
return found
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// What makes the app a poor connector. Every entry is a warning: none of it stops the app working as it does today.
|
|
71
|
+
// `tools` is `collect(manifest)` from commands/capabilities; `routes` is the backend probe's list, or null when the
|
|
72
|
+
// backend could not be imported, in which case the app's full tool list is unknown.
|
|
73
|
+
function findings({ cwd, manifest, tools, routes = [] }) {
|
|
74
|
+
const out = []
|
|
75
|
+
for (const tool of tools) {
|
|
76
|
+
// The manifest validator already requires all three of a service method and of an MCP tool.
|
|
77
|
+
if (tool.source !== "legacy") continue
|
|
78
|
+
const missing = [!tool.description && "description", !tool.input_schema && "input schema", "risk mark"].filter(Boolean)
|
|
79
|
+
out.push({
|
|
80
|
+
message: `agent-exposed action ${tool.name} has no ${missing.join(", ")}`,
|
|
81
|
+
fix: "Move it to an agent_exposable provides.services method with a description, input_schema and risk (pltt capabilities add).",
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
for (const route of routes || []) {
|
|
85
|
+
if (!route.offered || route.agent === "hidden") continue
|
|
86
|
+
const label = `${route.methods.join(",")} ${route.path}`
|
|
87
|
+
if (!route.agent) {
|
|
88
|
+
out.push({
|
|
89
|
+
message: `route ${label} is offered to agents with no agent_route mark`,
|
|
90
|
+
fix: 'Add openapi_extra=agent_route("read"), agent_route("write") or agent_route("hidden") to the route.',
|
|
91
|
+
route: { path: route.path, methods: route.methods },
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
if (!route.described) {
|
|
95
|
+
out.push({
|
|
96
|
+
message: `agent-exposed route ${label} has no description`,
|
|
97
|
+
fix: "Give the handler a docstring or agent_route(..., description=...); an assistant reads it to choose this action.",
|
|
98
|
+
route: { path: route.path, methods: route.methods },
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const own = [...tools.map((tool) => tool.name), ...(routes || []).map((route) => route.name).filter(Boolean)]
|
|
103
|
+
const known = new Set([...own, ...tools.flatMap((tool) => [tool.capability_id, `app__${manifest.id}__${tool.name}`])])
|
|
104
|
+
for (const skill of skills(cwd)) {
|
|
105
|
+
if (skill.error) {
|
|
106
|
+
out.push({
|
|
107
|
+
message: `skill ${skill.name} will not load: SKILL.md needs frontmatter with name: ${skill.name} and a description`,
|
|
108
|
+
fix: `Start ${skill.file} with ---, "name: ${skill.name}", "description: ...", ---.`,
|
|
109
|
+
file: skill.file,
|
|
110
|
+
})
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
// ponytail: only the declared allowed-tools are checked; tool names in the skill's prose are not parsed.
|
|
114
|
+
for (const tool of skill.tools.filter((name) => routes && !known.has(name))) {
|
|
115
|
+
out.push({
|
|
116
|
+
message: `skill ${skill.name} names a tool the app does not have: ${tool}`,
|
|
117
|
+
fix: `Use one of the app's tools (${own.join(", ") || "it has none"}) or remove it from allowed-tools.`,
|
|
118
|
+
file: skill.file,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
for (const event of events(manifest)) {
|
|
123
|
+
if (!event.missing.length) continue
|
|
124
|
+
out.push({
|
|
125
|
+
message: `event ${event.topic} is not offered as an agent trigger: it has no ${event.missing.join(", ")}`,
|
|
126
|
+
fix: "Add a description and a payload_schema to its provides.events entry. Without them it still reaches other apps.",
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
for (const call of pathStyleCalls(cwd)) {
|
|
130
|
+
out.push({
|
|
131
|
+
message: "path-style ctx.apps.call(app_id, path) is deprecated",
|
|
132
|
+
fix: 'Call the typed method instead: await services(ctx).call("namespace/version#method", {...}), declared in consumes.services.',
|
|
133
|
+
...call,
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
return out
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// What a publish adds to the store's review, or null when the app sends neither.
|
|
140
|
+
function reviewNote(cwd, manifest) {
|
|
141
|
+
const parts = [
|
|
142
|
+
...(manifest.agent?.summary || manifest.agent?.instructions ? ["agent summary and instructions"] : []),
|
|
143
|
+
...skills(cwd).map((skill) => `skills/${skill.name}`),
|
|
144
|
+
]
|
|
145
|
+
return parts.length ? `reviewed by the store with this version: ${parts.join(", ")}` : null
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
module.exports = { skills, view, findings, reviewNote }
|
package/lib/manifest.js
CHANGED
|
@@ -22,6 +22,7 @@ const KNOWN_PERMISSIONS = new Set([
|
|
|
22
22
|
])
|
|
23
23
|
|
|
24
24
|
const TOP_LEVEL_KEYS = new Set([
|
|
25
|
+
"agent",
|
|
25
26
|
"manifest_version",
|
|
26
27
|
"id",
|
|
27
28
|
"name",
|
|
@@ -219,7 +220,7 @@ const CTX_PERMISSIONS = [
|
|
|
219
220
|
{
|
|
220
221
|
accessor: "ctx.data_rooms",
|
|
221
222
|
permissions: ["data_rooms:read", "data_rooms:write"],
|
|
222
|
-
summary: "The organisation's Drive — search and read indexed documents",
|
|
223
|
+
summary: "The organisation's Drive — search and read indexed documents, share links for people outside the workspace",
|
|
223
224
|
python: 'hits = await ctx.data_rooms.search("supplier contract")',
|
|
224
225
|
},
|
|
225
226
|
{
|
|
@@ -699,6 +700,25 @@ function validateConsumes(value, errors) {
|
|
|
699
700
|
}
|
|
700
701
|
}
|
|
701
702
|
|
|
703
|
+
// The same limits as the platform's validator and schema/palette-plugin.schema.json.
|
|
704
|
+
const AGENT_TEXT_LIMITS = { summary: 160, instructions: 2000 }
|
|
705
|
+
|
|
706
|
+
// What the app says to assistants in its own words. Bounded: this text reaches a model's prompt.
|
|
707
|
+
function validateAgent(value, errors) {
|
|
708
|
+
if (value === undefined) return
|
|
709
|
+
if (!isObject(value)) {
|
|
710
|
+
errors.push("agent must be an object")
|
|
711
|
+
return
|
|
712
|
+
}
|
|
713
|
+
unknownKeys(value, new Set(Object.keys(AGENT_TEXT_LIMITS)), "agent", errors)
|
|
714
|
+
for (const [key, limit] of Object.entries(AGENT_TEXT_LIMITS)) {
|
|
715
|
+
requireString(value, key, "agent", errors)
|
|
716
|
+
if (typeof value[key] === "string" && value[key].length > limit) {
|
|
717
|
+
errors.push(`agent.${key} must be at most ${limit} characters`)
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
702
722
|
function validateMcp(value, errors) {
|
|
703
723
|
if (value === undefined) return
|
|
704
724
|
if (!isObject(value)) {
|
|
@@ -880,6 +900,7 @@ function validateManifest(m) {
|
|
|
880
900
|
validateProvides(m.provides, errors)
|
|
881
901
|
validateRequires(m.requires, errors)
|
|
882
902
|
validateConsumes(m.consumes, errors)
|
|
903
|
+
validateAgent(m.agent, errors)
|
|
883
904
|
validateMcp(m.mcp, errors)
|
|
884
905
|
|
|
885
906
|
if (m.sdk) {
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ from palette_sdk import (
|
|
|
22
22
|
PluginRouter,
|
|
23
23
|
PluginContext,
|
|
24
24
|
SuccessResponse,
|
|
25
|
+
agent_route,
|
|
25
26
|
get_plugin_context,
|
|
26
27
|
require_permission,
|
|
27
28
|
)
|
|
@@ -29,7 +30,8 @@ from palette_sdk import (
|
|
|
29
30
|
router = PluginRouter(tags=["my-plugin"])
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
# agent_route says how an assistant may use a route: "read", "write" (a change), or "hidden" (never offered).
|
|
34
|
+
@router.get("/status", dependencies=[require_permission("data_rooms:read")], openapi_extra=agent_route("read"))
|
|
33
35
|
async def get_status(ctx: PluginContext = Depends(get_plugin_context)):
|
|
34
36
|
"""Example endpoint — returns plugin status."""
|
|
35
37
|
return SuccessResponse(
|
|
@@ -42,7 +44,7 @@ async def get_status(ctx: PluginContext = Depends(get_plugin_context)):
|
|
|
42
44
|
)
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
@router.get("/hello", dependencies=[require_permission("data_rooms:read")])
|
|
47
|
+
@router.get("/hello", dependencies=[require_permission("data_rooms:read")], openapi_extra=agent_route("read"))
|
|
46
48
|
async def hello(ctx: PluginContext = Depends(get_plugin_context)):
|
|
47
49
|
"""Example endpoint — simple hello."""
|
|
48
50
|
return {"message": f"Hello from plugin! User: {ctx.user_id}"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"""Example custom agent tool.
|
|
2
2
|
|
|
3
|
+
Deprecated: ToolDefinition and the manifest's "tools" list are the legacy way to give agents a tool.
|
|
4
|
+
For a new tool run `pltt capabilities add <domain.resource.action>`, which scaffolds a typed
|
|
5
|
+
@capability handler and its provides.services entry.
|
|
6
|
+
|
|
3
7
|
To register this tool, add it to your palette-plugin.json:
|
|
4
8
|
{
|
|
5
9
|
"tools": [{
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"category": "Productivity",
|
|
9
9
|
"tagline": "A short description of what this plugin does",
|
|
10
10
|
"description": "A longer description explaining the plugin's features and capabilities.",
|
|
11
|
+
"agent": {
|
|
12
|
+
"summary": "Reports this plugin's status and greets the member.",
|
|
13
|
+
"instructions": "Read the status to check the plugin is running, and say hello when asked. Both only read. Replace this text with when an assistant should reach for your app and what it should check first."
|
|
14
|
+
},
|
|
11
15
|
"icon": "Puzzle",
|
|
12
16
|
"gradient": {
|
|
13
17
|
"bg": "linear-gradient(135deg, #6366F1, #8B5CF6)",
|
|
@@ -6,3 +6,6 @@ and scheduled tasks discover the same capability automatically.
|
|
|
6
6
|
|
|
7
7
|
Run `pltt capabilities list` to inspect the agent surface and `pltt test --agent`
|
|
8
8
|
before publishing.
|
|
9
|
+
|
|
10
|
+
`skills/echo-check/SKILL.md` is a sample skill: a recipe an assistant follows with your tools. Skills and
|
|
11
|
+
the manifest's `agent` text are sent with the app on publish and reviewed by the store.
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"category": "Productivity",
|
|
9
9
|
"tagline": "A tool an agent can call",
|
|
10
10
|
"description": "Registers a callable tool that any agent in the org can invoke.",
|
|
11
|
+
"agent": {
|
|
12
|
+
"summary": "Echoes text back as a structured result.",
|
|
13
|
+
"instructions": "Use echo when the member asks to repeat or confirm a piece of text. It only reads and changes nothing. Replace this text with when an assistant should reach for your app and what it should check first."
|
|
14
|
+
},
|
|
11
15
|
"icon": "Toolbox",
|
|
12
16
|
"gradient": { "bg": "linear-gradient(135deg, #F59E0B, #EF4444)", "text": "#fff" },
|
|
13
17
|
"sdk": { "backend": "^0.1.0" },
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: echo-check
|
|
3
|
+
description: Confirm a piece of text with the member by echoing it back before it is used anywhere else.
|
|
4
|
+
allowed-tools: echo
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Confirm text by echoing it
|
|
8
|
+
|
|
9
|
+
A sample skill: a recipe an assistant follows for one of your app's multi-step jobs. Replace it with
|
|
10
|
+
your own, and keep `allowed-tools` to tools your app has (`pltt check` reports any it does not).
|
|
11
|
+
|
|
12
|
+
1. Take the exact text the member wants confirmed. Do not correct or shorten it.
|
|
13
|
+
2. Call `echo` with that text as `message`.
|
|
14
|
+
3. Show the member the `echoed` value and ask whether it is right.
|
|
15
|
+
4. If they change it, call `echo` again with the new text. Stop when they confirm.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from fastapi import Depends
|
|
2
|
-
from palette_sdk import PluginContext, PluginRouter, get_plugin_context, services
|
|
2
|
+
from palette_sdk import PluginContext, PluginRouter, agent_route, get_plugin_context, require_permission, services
|
|
3
3
|
|
|
4
4
|
router = PluginRouter()
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
@router.post("/leave-requests")
|
|
7
|
+
@router.post("/leave-requests", dependencies=[require_permission("resources:write")], openapi_extra=agent_route("write"))
|
|
8
8
|
async def create_leave_request(payload: dict, ctx: PluginContext = Depends(get_plugin_context)):
|
|
9
|
+
"""Submit a leave request; the HR app says who approves it."""
|
|
9
10
|
chain = await services(ctx).call("hr/v1#approvalChain.get", {
|
|
10
11
|
"user_id": payload.get("user_id", ctx.user_id),
|
|
11
12
|
})
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"category": "Productivity",
|
|
9
9
|
"tagline": "Consume governed services from other apps",
|
|
10
10
|
"description": "Example consumer app that asks an HR provider for approval routing.",
|
|
11
|
+
"agent": {
|
|
12
|
+
"summary": "Submits leave requests and routes them to the right approver.",
|
|
13
|
+
"instructions": "Submitting a leave request is a change, so confirm the details with the member first. The approval chain comes from the HR provider app; never guess an approver."
|
|
14
|
+
},
|
|
11
15
|
"icon": "ClipboardText",
|
|
12
16
|
"gradient": {
|
|
13
17
|
"bg": "linear-gradient(135deg, #7C3AED, #DB2777)",
|
|
@@ -6,12 +6,12 @@ would source this from the org's data rooms or installed data sources.
|
|
|
6
6
|
|
|
7
7
|
from fastapi import Depends
|
|
8
8
|
|
|
9
|
-
from palette_sdk import PluginRouter, PluginContext, get_plugin_context, require_permission
|
|
9
|
+
from palette_sdk import PluginRouter, PluginContext, agent_route, get_plugin_context, require_permission
|
|
10
10
|
|
|
11
11
|
router = PluginRouter(tags=["my-dashboard"])
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
@router.get("/series", dependencies=[require_permission("data_rooms:read")])
|
|
14
|
+
@router.get("/series", dependencies=[require_permission("data_rooms:read")], openapi_extra=agent_route("read"))
|
|
15
15
|
async def series(ctx: PluginContext = Depends(get_plugin_context)) -> list[dict]:
|
|
16
16
|
"""Stub data source — replace with a query against the org's tables."""
|
|
17
17
|
return [
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"category": "Analytics",
|
|
9
9
|
"tagline": "A dashboard widget",
|
|
10
10
|
"description": "A widget that exposes a dashboard data source and renders a chart from it.",
|
|
11
|
+
"agent": {
|
|
12
|
+
"summary": "Shows a weekly series as a chart.",
|
|
13
|
+
"instructions": "Read the series to answer questions about the week's values. This app only reads; it has nothing to create or change."
|
|
14
|
+
},
|
|
11
15
|
"icon": "ChartBar",
|
|
12
16
|
"gradient": { "bg": "linear-gradient(135deg, #06B6D4, #6366F1)", "text": "#fff" },
|
|
13
17
|
"sdk": { "frontend": "^0.1.16", "backend": "^0.1.8" },
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from fastapi import Depends, HTTPException, Query
|
|
4
4
|
from pydantic import BaseModel, Field
|
|
5
|
-
from palette_sdk import PluginRouter, PluginContext, get_plugin_context, require_permission
|
|
5
|
+
from palette_sdk import PluginRouter, PluginContext, agent_route, get_plugin_context, require_permission
|
|
6
6
|
from models import Note
|
|
7
7
|
|
|
8
8
|
router = PluginRouter(tags=["my-db-plugin"])
|
|
@@ -12,7 +12,7 @@ class NoteIn(BaseModel):
|
|
|
12
12
|
body: str = Field(max_length=4000)
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
@router.get("/notes", dependencies=[require_permission("resources:read")])
|
|
15
|
+
@router.get("/notes", dependencies=[require_permission("resources:read")], openapi_extra=agent_route("read"))
|
|
16
16
|
async def list_notes(
|
|
17
17
|
limit: int = Query(50, ge=1, le=500),
|
|
18
18
|
offset: int = Query(0, ge=0),
|
|
@@ -24,7 +24,7 @@ async def list_notes(
|
|
|
24
24
|
return [{"id": r.id, "body": r.body} for r in rows]
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
@router.post("/notes", dependencies=[require_permission("resources:write")])
|
|
27
|
+
@router.post("/notes", dependencies=[require_permission("resources:write")], openapi_extra=agent_route("write"))
|
|
28
28
|
async def create_note(
|
|
29
29
|
body: NoteIn,
|
|
30
30
|
ctx: PluginContext = Depends(get_plugin_context),
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
"category": "Productivity",
|
|
9
9
|
"tagline": "Org-isolated database CRUD",
|
|
10
10
|
"description": "Stores notes per organization with RLS-enforced isolation.",
|
|
11
|
+
"agent": {
|
|
12
|
+
"summary": "Keeps each member's notes.",
|
|
13
|
+
"instructions": "List the member's notes before creating one, so a note is not written twice. Creating a note is a change. Notes belong to the member who wrote them."
|
|
14
|
+
},
|
|
11
15
|
"icon": "Database",
|
|
12
16
|
"gradient": { "bg": "linear-gradient(135deg, #8B5CF6, #EC4899)", "text": "#fff" },
|
|
13
17
|
"sdk": { "frontend": "^0.1.16", "backend": "^0.1.8" },
|
|
@@ -9,15 +9,16 @@ allowlist at runtime.
|
|
|
9
9
|
|
|
10
10
|
from fastapi import Depends, HTTPException
|
|
11
11
|
|
|
12
|
-
from palette_sdk import PluginRouter, PluginContext, get_plugin_context, require_permission
|
|
12
|
+
from palette_sdk import PluginRouter, PluginContext, agent_route, get_plugin_context, require_permission
|
|
13
13
|
|
|
14
14
|
router = PluginRouter(tags=["my-external-svc"])
|
|
15
15
|
|
|
16
16
|
EXTERNAL_HOST = "https://api.example.com"
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
@router.get("/proxy", dependencies=[require_permission("resources:read")])
|
|
19
|
+
@router.get("/proxy", dependencies=[require_permission("resources:read")], openapi_extra=agent_route("read"))
|
|
20
20
|
async def proxy(ctx: PluginContext = Depends(get_plugin_context)) -> dict:
|
|
21
|
+
"""Check that the external service answers, using the organization's token."""
|
|
21
22
|
import httpx
|
|
22
23
|
|
|
23
24
|
connection = await ctx.connections.status("example_oauth")
|