Huakun Shen f89cf8fe6a
Feature: Headless Command (#44)
* chore: add check-types

* refactor: api package file structure update

* feat: add headless worker extension API

* feat: add HeadlessCmd to manifest schema

* feat: make each type of cmds optional in manifest

There may be more types of cmds in the future, this makes backward compatibility easier.

* feat: implement headless extension command in app

A demo cmd implemented as well.

* refactor: move api package's API server files

* refactor: reformat all
2025-01-05 21:12:56 -05:00

119 lines
2.1 KiB
JSON

{
"$schema": "../../schema/manifest-json-schema.json",
"name": "demo-template-extension",
"version": "0.0.4",
"type": "module",
"kunkun": {
"name": "Demo Template Extension",
"shortDescription": "Demo Template Extension",
"longDescription": "Demo Template Extension",
"identifier": "demo-worker-template-ext",
"permissions": [
"fetch:all",
"shell:kill",
"security:mac:all",
"clipboard:read-all",
{
"permission": "shell:deno:spawn",
"allow": [
{
"path": "$EXTENSION/deno-src/rpc.ts",
"env": "*",
"ffi": "*",
"read": "*",
"sys": "*",
"run": "*"
}
]
},
{
"permission": "open:file",
"allow": [
{
"path": "$EXTENSION/src/deno-script.ts"
}
]
},
"shell:stdin-write",
{
"permission": "shell:execute",
"allow": [
{
"cmd": {
"program": "ls",
"args": [
"-l"
]
}
},
{
"cmd": {
"program": "bash",
"args": [
"-c",
".+"
]
}
},
{
"cmd": {
"program": "deno",
"args": [
"-A",
".+",
".+"
]
}
}
]
}
],
"demoImages": [],
"icon": {
"type": "iconify",
"value": "carbon:demo"
},
"customUiCmds": [],
"templateUiCmds": [
{
"name": "Demo Worker Template",
"main": "dist/index.js",
"cmds": []
}
],
"headlessCmds": [
{
"name": "Demo Headless Command",
"main": "dist/headless.js",
"cmds": [],
"icon": {
"type": "iconify",
"value": "mdi:head-remove-outline"
}
}
]
},
"scripts": {
"dev": "bun build.ts dev",
"build": "bun build.ts"
},
"dependencies": {
"@kksh/api": "workspace:*",
"@kunkun/api": "npm:@jsr/kunkun__api@^0.0.13"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^26.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@types/bun": "latest",
"rollup-plugin-visualizer": "^5.12.0"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"files": [
"./dist",
".gitignore"
]
}