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 分