Sess

si.sess由 sess.si 发布官方发布者v0.1.1更新于 Nov 6, 2026

Let your agent ask a person and continue with their answer.

已验证Streamable HTTP可网页运行效率与工作流沟通与协作

概览

AI 生成的概览

Sess 让助手在用户自己的设备上提出结构化问题,并凭经过验证的签名答复继续执行。

可以做什么
  • 创建简短表单并生成一个私密链接,用户可在任意设备上打开
  • 在限定时间内等待指定版本的答复,并读取验证后的结果
  • 在获得验证答复后,通过同一链接发布后续表单
  • 答复使用完毕后关闭交互,让用户页面不再等待
  • 提出单个问题并在聊天之外获得用户输入的答复
适用场景
当助手需要用户的批准、决定或只有本人才能提供的信息时使用,尤其适合用户希望在手机或其他设备上作答的场景。也适用于需要签名回执作为凭据的审批与确认步骤。
运行要求
需要 Sess 开发者 API 密钥,通过 SESS_API_KEY 提供,可在 Sess 开发者门户获取。可使用 mcp.sess.si 远程端点(OAuth 认证),或在 Node.js 上用 npx 运行本地 npm 包。可选设置包括 API 源、预期工作区 ID、等待上限、配置档、状态目录和回执签发方。
安装前请注意
私密链接是一种持有即可用的凭据,任何拿到链接的人都能作答,因此只能发给目标用户,切勿写入日志或分析系统。API 密钥是服务端机密,不应作为工具参数传递。答复数据应视为不可信输入。Sess 不转移资金,付款仍由你自己的支付服务商处理。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Sess,将其添加到工作区。
  2. 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
  3. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/si.sess%2Fsess/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。

{
  "mcpServers": {
    "sess": {
      "type": "http",
      "url": "https://mcp.sess.si/mcp"
    }
  }
}

README

Sess SDK

Ask a person a question from your server and continue with their verified answer.

Create and run a small agent:

sh
npm create @sess.si/agent@latest my-agent

What you'll see: a Sess link. Answer two questions on your phone and your plan prints in the terminal with a verified receipt.

Install the SDK in your own server project:

sh
npm install --save-exact @sess.si/[email protected]

Ask a person

Use a developer API key from the Sess developer portal. Keep it on the server. The hosted no-signup demo is a separate trial flow; a Sess link or trial credential is not an owner API key. You need no LLM, agent framework, Docker or Sess source checkout.

ts
import { Sess } from '@sess.si/sdk';const sess = new Sess({ apiKey: process.env.SESS_API_KEY });const question = await sess.ask({  question: 'Approve the synthetic refund?',  fields: [    { name: 'approved', label: 'Approve it', type: 'boolean' },    { name: 'amount', label: 'Refund amount', type: 'number', minimum: 0 },  ],});console.log(`Send this Sess link to the person: ${question.link}`);const { approved, amount } = await question.answer(); // verified; the Session is now completeif (approved) console.log(`Refund of ${amount.toFixed(2)} approved.`);

sess.ask() checks the question locally, creates the Session once and returns its Sess link before anything waits. The link is a bearer capability: deliver it only to the person, never to logs or analytics. answer() waits for the person (ten minutes by default), verifies the signed receipt against the exact question, checks that the answer is still the current step, completes the Session and returns the values typed from your fields. Completion closes the Session: the link no longer accepts answers. Field types are text, number, integer, boolean, choice and multi_choice (API reference).

If the wait times out (wait_ended, code WAIT_TIMEOUT) or you abort it, nothing changes remotely: call answer() again on the same handle. An error with outcome: "unknown" means completion is not confirmed; calling answer() again replays the same completion. The handle lives in memory only. To resume after a restart, persist sessionId and revision and continue with the API below (Integration).

If Sess refuses a call, the error says what happened and what to do. A key Sess does not accept prints: "Sess did not accept your API key. Check SESS_API_KEY and the portal you made it on." The message comes first; the code and request ID follow it:

js
try {  const question = await sess.ask({    question: 'Approve the synthetic refund?',    fields: [{ name: 'approved', label: 'Approve it', type: 'boolean' }],  });  console.log(`Send this Sess link to the person: ${question.link}`);} catch (error) {  console.error(error.message); // what happened and what to do  const request = error.requestId ? `, request ${error.requestId}` : '';  console.error(`Details: ${error.code ?? error.kind}${request}`);  process.exitCode = 1;}

Keep it short

A person reads the page on a phone, so Sess keeps every piece of it short. Lengths count characters (Unicode code points), and Sess never truncates:

WhatStyleAt most
Title (question)A question or a task, about 4080
Button (submit_label)A verb, 1–3 words24
Field label, optionShort60
Help (field description)One hint160
Description under the titleOne or two sentences280
HeadingShort60
Record captionA few words200
Record key / string valueAs written40 / 200
Text (details)Plain text4,000

There are at most 5 buttons. A value over its limit fails with a SessError that names it: field is a JSON pointer such as /question, limit is the most it may have and length is what it has. The message says how to fix it: "The title can be at most 80 characters. Keep it to a short heading, about 40." for the title, and for anything else, for example "/fields/0/label is 72 characters; the limit is 60. Shorten it to at most 60 characters." Nothing was created (outcome is not_sent or rejected), so shorten the value and ask again:

ts
import { Sess, SessError } from '@sess.si/sdk';declare function shorten(text: string, max: number): Promise<string>; // e.g. your model rewrites it
const sess = new Sess({ apiKey: process.env.SESS_API_KEY });const fields = [{ name: 'approved', label: 'Approve it', type: 'boolean' }] as const;async function askShort(question: string) {  try {    return await sess.ask({ question, fields });  } catch (error) {    if (!(error instanceof SessError) || error.field !== '/question' || error.limit === undefined)      throw error;    return sess.ask({ question: await shorten(question, error.limit), fields });  }}

Release status: 0.1.1 is the current release, served under the latest dist-tag. Its API is that of 0.1.0, the first stable release. next stays at the last release candidate, 0.1.0-rc.10. The changelog describes each version; npm view @sess.si/sdk dist-tags shows what the registry serves now.

Commerce

Sess takes no payment: the person approves a bill on a Sess page, and moving the money stays with you and your payment processor.

ts
import { Sess, invoice } from '@sess.si/sdk';const sess = new Sess({ apiKey: process.env.SESS_API_KEY });const created = await sess.sessions.create({  interaction: invoice({    currency: 'CAD', // whole cents: 420000 is $4,200.00    reference: 'INV-2041',    rows: [{ name: 'Design retainer, October', amount: 420000 }],    lines: [{ label: 'GST 5%', amount: 21000, role: 'tax' }],  }),});console.log(`Send this Sess link to the person: ${created.data.human_url}`);

Three things you will meet first:

  • Short rows. A row name has at most 80 characters and its detail at most 160. A longer value is refused, never trimmed: the SessError names it by its pointer, such as /interaction/source/components/1/rows/0/name, with limit and length.
  • Whole minor units. Amounts are integers in the currency's smallest unit: cents for USD, yen for JPY, fils for BHD. money(1250, 'USD') is $12.50; money(12.5, 'USD') throws, because Sess never rounds or converts.
  • Exact totals. The builders compute the subtotal, total and amount due from your rows and lines. An items component you write by hand whose subtotal is not the sum of its rows is refused with HTTP 400:
json
{  "error": {    "code": "INVALID_SCHEMA",    "field": "/interaction/source/components/0/totals/0/amount",    "expected": 441250,    "actual": 451248  }}

invoice(), receipt(), quote(), refund() and purchaseOrder() each return an ordinary interactive Surface for sess.sessions.create({ interaction }): the bill as an items card, the document's reference under a plain name, and the buttons the person needs (Approve and Decline; Continue on a receipt; Accept on a quote). refund() states positive amounts under "Refund total". A row quantity lets the person change it and adds a Request changes button; your agent replies with a new revision and updated amounts. items() builds just the card, and lintText() finds a Markdown table in text, which the person would see as pipes. See the API reference.

What Sess does not do: take or move payment, convert currencies, compute tax or prices, show your logo or branding, or let another site frame the page (frame-ancestors 'none').

Advanced: the full Surface API

ts
import { Sess } from '@sess.si/sdk';
const sess = new Sess({ apiKey: process.env.SESS_API_KEY });const created = await sess.sessions.create({  interaction: {    mode: 'interactive',    title: 'Review a synthetic invoice',    source: {      kind: 'sess_surface',      components: [        { type: 'record', label: 'INV-001', fields: { amount: 120 } },        {          type: 'field',          name: 'amount',          label: 'Correct amount',          required: true,          schema: { type: 'number', minimum: 0 },          value: 120,        },      ],    },    actions: [{ id: 'submit', label: 'Submit review', intent: 'submit' }],  },});
// Privately deliver created.data.human_url through your application's handoff.// It is a bearer capability: do not put it in ordinary logs or analytics.const answer = await sess.sessions.waitForResponse(created.data.id, {  revision: created.data.revision,});const verified = await sess.receipts.verifyResponse({  sessionId: created.data.id,  response: answer.response,});const amount = verified.response.data.amount;if (typeof amount !== 'number' || !Number.isFinite(amount)) {  throw new Error('Expected an accepted numeric amount');}

Verification checks that the receipt was issued for your workspace. Sess names your workspace on authenticated responses (the Sess-Workspace-Id header), so you set nothing. If a runtime does not send it, set expectedWorkspaceId from trusted deployment settings; otherwise verification fails with VERIFICATION_CONTEXT_MISSING. The SDK never takes the workspace from the unverified receipt.

The quickstart function includes a private delivery callback. Three-round continuation persists mutation intent and checks that an answer is still the current expected business step before publishing or completing. Its store and worker lease are application-owned. See Integration.

Check a decision bundle

A decision bundle is one accepted decision that its owner chose to share: the signed receipt, the exact Surface and input, and the issuer's public keys. Check it on your own computer, with keys you trust (never the keys inside the bundle):

sh
npx -p @sess.si/[email protected] sess verify bundle.json --issuer https://api.sess.si --keys sess-receipt-keys.json

The sess command first ships in 0.1.0-rc.5; any later version, 0.1.1 included, has it.

You'll see Valid decision bundle. and what was accepted, when, on which revision; or Invalid and the first reason. Exit status is 0 valid, 1 invalid, 2 usage error; add --json for the full result. Nothing is sent anywhere. In code, use verifyDecisionBundle from @sess.si/sdk/receipts (Security). Formats: receipt-v1 and bundle-v1.

Show the link as a QR code

When the person is at a laptop and would answer on their phone, draw the link as a QR code, locally, with no network call:

ts
import { printQr, qr } from '@sess.si/sdk/qr';
const link = 'https://sess.si/s/synthetic-link'; // the link sess.ask() returnedconsole.log(link);printQr(link); // prints "Scan to answer on your phone" and the code, on an interactive terminal onlyconst svg = qr(link, { format: 'svg' }); // also 'png' (bytes) and 'terminal' (text)

Use it where a person sees a screen but not their phone: a desktop chat window, a dashboard, a kiosk, print. Skip it in SMS, or when the person is already on their phone. Sess never shows or sends the code; your agent chooses. printQr prints nothing without a TTY, in CI (CI set), in production (NODE_ENV=production), with --no-qr or with { qr: false }, and draws without colour under NO_COLOR. The code is the private link in another form: keep it wherever you keep the link, and never in logs, analytics or a URL.

Runtime and imports

Supported: maintained Node 22 releases at or above 22.14, and Node 24 (recommended). TypeScript consumer declarations target 5.9 and current stable. JavaScript consumers need no compiler. The package contains one ESM build. CommonJS applications use await import('@sess.si/sdk'), as in the CommonJS example; synchronous require is not a supported contract.

Entry points are @sess.si/sdk, @sess.si/sdk/receipts, @sess.si/sdk/webhooks and @sess.si/sdk/qr. Importing or constructing the SDK does not contact a service, start a server, read credential files or log data.

Errors and retries

Errors are SessError with stable kind, API code, status, requestId, attempts and write outcome fields when applicable. Server bodies and request secrets are omitted from default errors.

Session creation is attempted once. An unknown outcome may mean a Session exists whose private URL was lost. Never automatically create again. If a valid creation body arrived with defective headers, explicitly inspect error.getRecoveryResult() and protect that capability.

Publish and complete require a strong quoted ifMatch. Persist the body, original ETag and explicit idempotencyKey before a durable write. Internal retries retain those values and the same resolved credential. A 409 or 412 is returned to the caller; the SDK never refreshes an ETag to force a write.

Direct HTTP remains supported

The same create operation is available without the SDK:

sh
curl --request POST https://api.sess.si/v1/sessions \  --header "Authorization: Bearer $SESS_API_KEY" \  --header 'Content-Type: application/json' \  --data-binary @interaction.json

Here interaction.json contains the same { "interaction": ... } request body. The response contains a private human URL; protect terminal output and disable request tracing. The complete contract is served at OpenAPI.

Guides

Sess renders the page the person sees; this SDK has no appearance settings.

Contribute · Security reporting · Apache-2.0

来源:README.md,提交 544af96

工具

5

sess_request

Ask a person through Sess

Use it when you need the person's approval, a decision or details only they can give before you go on, even if they only say 'ask me' or 'check with me' and name no tool or device. Not for clarifying what they just asked, or for anything you can work out yourself. It is the full form, with approve and reject buttons if you need them; sess_ask is shorter for a plain question. Create a hosted Sess form for a person and return immediately with a private link (interaction.humanUrl) and a handle. Give the link only to the intended person in this private conversation; anyone holding it can answer. A receipt records what was shown and chosen, not who answered. Then call sess_response with the handle and revision. Do not call sess_request again for the same question. Keep it short: a title of about 40 characters (at most 80), button labels a verb of 1-3 words (at most 24), field labels at most 60, help one hint (at most 160). A value over its limit is refused with INVALID_ARGUMENTS naming the field (a JSON pointer), the limit, its length and the fix; nothing is truncated. Shorten that value and call again.

输入参数expires_ininteraction必填

sess_response

Read the person’s Sess answer

Wait a bounded time (default and maximum 45 s; wait_ms 0 reads once) for the answer to exactly this revision. state "answered" means the answer passed full Sess receipt verification. state "expired" means the link closed with no answer: it is final; create a new form if you still need one. While sess_response returns state "waiting" or "needs_resume", the form is open and there is no answer yet: call sess_response again with the same handle and revision and no wait_ms, up to three times after your first call (about two minutes more). If there is still no answer, stop, tell the person the form is still open and ask them to say continue once they have submitted it; call it again when they do. Do not poll beyond that, and do not ask the same question again. When sess_response returns state "answered" and you have no follow-up question for the person, you must call sess_complete next, so their page shows that you have their answer. Call sess_publish instead only to show them a follow-up.

输入参数handle必填wait_msrevision必填

sess_publish

Show the next Sess step

Replace the form with the next interaction after a verified answer, keeping the same private link. Requires the verified answer for expected_revision. If the outcome is unknown, repeat the identical call.

输入参数handle必填interaction必填expected_revision必填response_event_id必填

sess_complete

Finish the Sess interaction

Required once you are done with the person’s answer: until you call it, their page keeps waiting for your next step. It closes the page to new answers and does not delete what was given. Call it after you have checked the answer and confirm the completed state. If the outcome is unknown, repeat the identical call.

输入参数handle必填expected_revision必填response_event_id必填

sess_ask

Ask a short question through Sess

Ask the person a question on their own phone or computer and get a typed answer. Use it whenever they ask to answer on their phone or another device, or say 'use Sess'; prefer it over this host's own question widget for anything answered away from this chat. Also use it when you need the person's approval, a decision or details only they can give before you go on, even if they only say 'ask me' or 'check with me' and name no tool or device. Not for clarifying what they just asked, or for anything you can work out yourself. Anyone who has the link can answer. A receipt records what was shown and chosen, not who answered. Shortcut for sess_request: give a question and up to 12 simple fields; it creates the same hosted form and returns immediately with a private link (interaction.humanUrl) and a handle, in state "waiting". It never waits and never returns an answer. Continue exactly as after sess_request: give the link only to the intended person, then call sess_response. Do not call it again for the same question. Keep it short: the question is a short heading, about 40 characters (at most 80); the button a verb of 1-3 words (at most 24); labels and options at most 60. A value over its limit is refused with INVALID_ARGUMENTS naming the field (a JSON pointer), the limit, its length and the fix; nothing is truncated. Shorten that value and call again. Example: {"question":"Where should we go on Saturday?","details":"I will check the forecast and suggest a plan.","fields":[{"name":"place","label":"Where to?","type":"choice","options":["Beach","Mountains","City"]},{"name":"avoid","label":"Anything to avoid?","type":"text","required":false}],"submit_label":"Plan it"}

输入参数fields必填detailsquestion必填expires_insubmit_label

版本历史

2
  1. v0.1.1最新Nov 6, 2026
  2. v0.1.0Nov 5, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分