feat(skills): add effective skill resolution and actions (#377)

* feat(skills): add effective skill resolution and actions

* refactor(workspace): normalize skill-related env and prompt

* chore(api): regenerate skills OpenAPI and SDK artifacts

* feat(web): surface effective skill state in console

* test(skills): cover API and runtime effective state

* fix(web): show adopt action for discovered skills

* fix(web): align skill header and show stateful visibility icon

* refactor(web): compact skill metadata on narrow layouts

* fix(web): constrain long skill text in cards

* refactor(skills): narrow default discovery roots

* fix(skills): harden managed skill path validation

* feat: add path in the results of `use_skill`

---------

Co-authored-by: Acbox <acbox0328@gmail.com>
This commit is contained in:
Chrys
2026-04-16 13:50:39 +08:00
committed by GitHub
parent 8e1ed3683f
commit 33e18e7e64
27 changed files with 2223 additions and 209 deletions
+84 -3
View File
@@ -1508,7 +1508,7 @@ const docTemplate = `{
"tags": [
"containerd"
],
"summary": "List skills from data directory",
"summary": "List skills from the bot container",
"parameters": [
{
"type": "string",
@@ -1549,7 +1549,7 @@ const docTemplate = `{
"tags": [
"containerd"
],
"summary": "Upload skills into data directory",
"summary": "Upload skills into Memoh-managed directory",
"parameters": [
{
"type": "string",
@@ -1599,7 +1599,7 @@ const docTemplate = `{
"tags": [
"containerd"
],
"summary": "Delete skills from data directory",
"summary": "Delete Memoh-managed skills",
"parameters": [
{
"type": "string",
@@ -1646,6 +1646,58 @@ const docTemplate = `{
}
}
},
"/bots/{bot_id}/container/skills/actions": {
"post": {
"tags": [
"containerd"
],
"summary": "Apply an action to a discovered or managed skill source",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Skill action payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SkillsActionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.skillsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/snapshots": {
"get": {
"tags": [
@@ -11109,6 +11161,9 @@ const docTemplate = `{
"description": {
"type": "string"
},
"managed": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {}
@@ -11118,6 +11173,32 @@ const docTemplate = `{
},
"raw": {
"type": "string"
},
"shadowed_by": {
"type": "string"
},
"source_kind": {
"type": "string"
},
"source_path": {
"type": "string"
},
"source_root": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"handlers.SkillsActionRequest": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"target_path": {
"type": "string"
}
}
},
+84 -3
View File
@@ -1499,7 +1499,7 @@
"tags": [
"containerd"
],
"summary": "List skills from data directory",
"summary": "List skills from the bot container",
"parameters": [
{
"type": "string",
@@ -1540,7 +1540,7 @@
"tags": [
"containerd"
],
"summary": "Upload skills into data directory",
"summary": "Upload skills into Memoh-managed directory",
"parameters": [
{
"type": "string",
@@ -1590,7 +1590,7 @@
"tags": [
"containerd"
],
"summary": "Delete skills from data directory",
"summary": "Delete Memoh-managed skills",
"parameters": [
{
"type": "string",
@@ -1637,6 +1637,58 @@
}
}
},
"/bots/{bot_id}/container/skills/actions": {
"post": {
"tags": [
"containerd"
],
"summary": "Apply an action to a discovered or managed skill source",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Skill action payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SkillsActionRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.skillsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/snapshots": {
"get": {
"tags": [
@@ -11100,6 +11152,9 @@
"description": {
"type": "string"
},
"managed": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {}
@@ -11109,6 +11164,32 @@
},
"raw": {
"type": "string"
},
"shadowed_by": {
"type": "string"
},
"source_kind": {
"type": "string"
},
"source_path": {
"type": "string"
},
"source_root": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"handlers.SkillsActionRequest": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"target_path": {
"type": "string"
}
}
},
+56 -3
View File
@@ -1589,6 +1589,8 @@ definitions:
type: string
description:
type: string
managed:
type: boolean
metadata:
additionalProperties: {}
type: object
@@ -1596,6 +1598,23 @@ definitions:
type: string
raw:
type: string
shadowed_by:
type: string
source_kind:
type: string
source_path:
type: string
source_root:
type: string
state:
type: string
type: object
handlers.SkillsActionRequest:
properties:
action:
type: string
target_path:
type: string
type: object
handlers.SkillsDeleteRequest:
properties:
@@ -3871,7 +3890,7 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Delete skills from data directory
summary: Delete Memoh-managed skills
tags:
- containerd
get:
@@ -3898,7 +3917,7 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: List skills from data directory
summary: List skills from the bot container
tags:
- containerd
post:
@@ -3931,7 +3950,41 @@ paths:
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Upload skills into data directory
summary: Upload skills into Memoh-managed directory
tags:
- containerd
/bots/{bot_id}/container/skills/actions:
post:
parameters:
- description: Bot ID
in: path
name: bot_id
required: true
type: string
- description: Skill action payload
in: body
name: payload
required: true
schema:
$ref: '#/definitions/handlers.SkillsActionRequest'
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handlers.skillsOpResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"404":
description: Not Found
schema:
$ref: '#/definitions/handlers.ErrorResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/handlers.ErrorResponse'
summary: Apply an action to a discovered or managed skill source
tags:
- containerd
/bots/{bot_id}/container/snapshots: