@coda-console/plugin-check 0.5.5 → 0.5.6

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.
@@ -1,35 +1,38 @@
1
1
  // The interfaces a model service may speak (docs/plugins.md「模型服务」): a closed table. A plugin providing a service names
2
- // one of these (`api`), and so does one choosing services by what it speaks (`modelApis`); the node delivers a service with
3
- // its key where its interface carries it (model-services.mjs), Coda lists its models as a client of it would
4
- // (model-check.mjs), and what an agent is told of using one comes from here (coda-resources explain). A new interface is a
5
- // row here: the node would not know where its key goes otherwise.
6
- // Each: its name and where it is defined; how its clients send a key (`key`) and what else (`also`); how the node hands
7
- // a key on to the service (`delivered`); how it is called at a base address (`call`), and an example there.
8
- // Anthropic's clients take the API's root and add `/v1` themselves; a service whose address is its versioned base has it
9
- // already.
10
- const messages = base => /\/v1\/?$/.test(base) ? `${base.replace(/\/$/, '')}/messages` : `${base}/v1/messages`;
2
+ // one of these (`api`), and so does one choosing services by what it speaks (`modelApis`). Each is a kind of resource of its
3
+ // own (model-services.mjs): a service speaking OpenAI's is nothing like one speaking Anthropic's, whoever provides them. The
4
+ // node delivers a service with its key where its interface carries it (model-services.mjs), Coda lists its models as a
5
+ // client of it would (model-check.mjs), and what an agent is told of calling one is its kind's definition, from here
6
+ // (coda-resources explain). A new interface is a row here: the node would not know where its key goes otherwise.
7
+ // Each: what it is called and where it is defined; how its clients send a key (`key`) and what else (`also`); how the node
8
+ // hands a key on to the service (`delivered`); how it is called and an example, templates of `{base}` (the service's
9
+ // address), `{v1}` (that with `/v1` once: Anthropic's clients take the API's root and add `/v1` themselves, and a service
10
+ // whose address is its versioned base has it already) and `{model}`.
11
11
  export const MODEL_PROTOCOLS = {
12
12
  'openai-completions': {
13
- title: 'OpenAI Chat Completions', spec: 'https://platform.openai.com/docs/api-reference/chat',
13
+ title: 'OpenAI Chat', spec: 'https://platform.openai.com/docs/api-reference/chat',
14
+ description: '讲 OpenAI Chat Completions 接口的服务',
14
15
  key: key => ({ Authorization: `Bearer ${key}` }), also: {},
15
16
  delivered: key => ({ authorization: `Bearer ${key}` }),
16
- call: base => `POST ${base}/chat/completions,body 带 model 与 messages`,
17
- example: (base, model) => `curl -s ${base}/chat/completions -H 'Authorization: Bearer coda' -H 'Content-Type: application/json' \\\n -d '{"model": "${model}", "messages": [{"role": "user", "content": "你好"}]}'`,
17
+ call: 'POST {base}/chat/completions,body 带 model 与 messages',
18
+ example: `curl -s {base}/chat/completions -H 'Authorization: Bearer coda' -H 'Content-Type: application/json' \\\n -d '{"model": "{model}", "messages": [{"role": "user", "content": "你好"}]}'`,
18
19
  },
19
20
  'openai-responses': {
20
21
  title: 'OpenAI Responses', spec: 'https://platform.openai.com/docs/api-reference/responses',
22
+ description: '讲 OpenAI Responses 接口的服务',
21
23
  key: key => ({ Authorization: `Bearer ${key}` }), also: {},
22
24
  delivered: key => ({ authorization: `Bearer ${key}` }),
23
- call: base => `POST ${base}/responses,body 带 model 与 input`,
24
- example: (base, model) => `curl -s ${base}/responses -H 'Authorization: Bearer coda' -H 'Content-Type: application/json' \\\n -d '{"model": "${model}", "input": "你好"}'`,
25
+ call: 'POST {base}/responses,body 带 model 与 input',
26
+ example: `curl -s {base}/responses -H 'Authorization: Bearer coda' -H 'Content-Type: application/json' \\\n -d '{"model": "{model}", "input": "你好"}'`,
25
27
  },
26
28
  'anthropic-messages': {
27
- title: 'Anthropic Messages', spec: 'https://docs.anthropic.com/en/api/messages',
29
+ title: 'Anthropic', spec: 'https://docs.anthropic.com/en/api/messages',
30
+ description: '讲 Anthropic Messages 接口的服务',
28
31
  key: key => ({ 'x-api-key': key }), also: { 'anthropic-version': '2023-06-01' },
29
32
  // Some of its clients send the key as a bearer token: the node sends it both ways.
30
33
  delivered: key => ({ 'x-api-key': key, authorization: `Bearer ${key}` }),
31
- call: base => `POST ${messages(base)},body 带 model、max_tokens 与 messages;带请求头 anthropic-version`,
32
- example: (base, model) => `curl -s ${messages(base)} -H 'x-api-key: coda' -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \\\n -d '{"model": "${model}", "max_tokens": 256, "messages": [{"role": "user", "content": "你好"}]}'`,
34
+ call: 'POST {v1}/messages,body 带 model、max_tokens 与 messages;带请求头 anthropic-version',
35
+ example: `curl -s {v1}/messages -H 'x-api-key: coda' -H 'anthropic-version: 2023-06-01' -H 'Content-Type: application/json' \\\n -d '{"model": "{model}", "max_tokens": 256, "messages": [{"role": "user", "content": "你好"}]}'`,
33
36
  },
34
37
  };
35
38
  export const MODEL_APIS = Object.keys(MODEL_PROTOCOLS);
@@ -1,5 +1,5 @@
1
1
  {
2
- "commit": "95e6604b90218e38e5730725dcf57c8efddf8c10",
2
+ "commit": "93e1f9059276267bbf0aa4cd2979a98e199b6547",
3
3
  "packages": {
4
4
  "@0dep/piso": "5.2.0",
5
5
  "@agentclientprotocol/sdk": "1.4.0",
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "files": {
9
9
  "check/coda/components/plugins/agent-plugins.mjs": "23016dd0f7350a10f71565a2c44e2c1179299a93e8c859529071099f2ce862d1",
10
- "check/coda/components/plugins/model-protocols.mjs": "e02e056a002f0a6c8a5accb39a52635558fa7141540e475f79a309278acb015b",
10
+ "check/coda/components/plugins/model-protocols.mjs": "762244c01266cf61384377bdfbb84bef5ab157b1783f9254ddc1ae3d576a73c5",
11
11
  "check/coda/components/plugins/plugin-extensions.mjs": "e527800a109ec9849975357f841b0c05ecfa50c9d9c34e26d828aef3cb7d3cb3",
12
12
  "check/coda/components/plugins/plugin-rules.mjs": "78d9431c1b4f6354457f153bb74a0fd085c771eaadd9f7523633915cb700f4f9",
13
13
  "check/coda/components/plugins/plugin-source-rules.mjs": "d620ee62fb372e31e5389e27f7202308aab74324b6f5552ffef3844afc7d0001",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coda-console/plugin-check",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Coda 插件的契约检查:扮演 Coda 读清单、启动 Agent 讲 ACP 与 _coda/wait、读面板。",
5
5
  "license": "MIT",
6
6
  "repository": {