This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# RequestPackage
|
||||
|
||||
Request a Python wheel that is not already available, so an approver can install
|
||||
it into **this workspace** and let the run continue.
|
||||
|
||||
## When to use it
|
||||
|
||||
You tried to `import somelib` (in `Bash` running `python3`, or `RunUserScript`)
|
||||
and it failed with `ModuleNotFoundError`, and the library is **not** in the
|
||||
preinstalled set. Instead of retrying `pip install` (which is blocked in the
|
||||
sandbox), call:
|
||||
|
||||
```
|
||||
RequestPackage({ name: "httpx", reason: "need an async HTTP client for the API calls" })
|
||||
RequestPackage({ name: "pandas==2.2.2", reason: "pinned for reproducibility" })
|
||||
```
|
||||
|
||||
- `name` — the package. Either a bare name (`httpx`) or an exact pin
|
||||
(`httpx==0.27.0`). **Only `name==version` pins are accepted** — ranges
|
||||
(`>=`, `~=`) and URLs/extras are rejected (the overlay must be reproducible).
|
||||
- `reason` — a concrete justification. It is shown to the approver.
|
||||
|
||||
## What happens
|
||||
|
||||
- **Interactive runs (a user is watching the chat):** the movement pauses and an
|
||||
Approve / Deny card appears in the chat. When a task-write user (owner / admin /
|
||||
space editor) approves, the wheel is installed into this workspace's private
|
||||
overlay and the run resumes automatically — now `import` works. If denied, you
|
||||
continue without it.
|
||||
- **Non-interactive runs (subtasks / scheduled):** the request is recorded (the
|
||||
user finds it later) and you proceed **without** the package. Don't block on it —
|
||||
finish with what you have, or `complete({status:"needs_user_input"})` if you
|
||||
genuinely can't proceed.
|
||||
|
||||
## Rules and limits
|
||||
|
||||
- Wheels only, from a fixed package index. No source builds, no arbitrary index.
|
||||
- A package that would shadow the standard library or a preinstalled package
|
||||
(e.g. `os`, `numpy`, `pandas`) is rejected — those are already importable.
|
||||
- If the package is already installed in this workspace, the tool tells you to
|
||||
just `import` it (no approval needed).
|
||||
- The install is per-workspace. Other workspaces do not see it.
|
||||
- You cannot approve your own request — approval is a human/operator action.
|
||||
|
||||
## After approval
|
||||
|
||||
The run re-enters the same step. Re-run your Python; the import now succeeds. If
|
||||
you call `RequestPackage` again for the same package, it reports "already
|
||||
installed".
|
||||
|
||||
Related: preinstalled packages are listed in the error you get from a blocked
|
||||
`pip install`. Workspace-wide package management (for operators) lives in
|
||||
**Settings → the workspace's Python packages panel**.
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
| 名前 | 必須 | 説明 |
|
||||
|------|------|------|
|
||||
| `query` | ○ | 検索キーワード。部分一致・大文字小文字は無視 |
|
||||
| `query` | ○ | 検索キーワード。スペース区切りで複数指定すると AND 検索(すべての語を含む発言だけがヒット)。各語は部分一致・大文字小文字は無視 |
|
||||
| `source` | | `comments` / `transcript` / `both`(既定 `both`) |
|
||||
| `author` | | `user` / `agent` / `system` で発言者を絞る |
|
||||
| `kind` | | コメント種別で絞る(request/comment/interjection/result/ask/progress/handoff)。transcript には適用されない |
|
||||
|
||||
@@ -13,8 +13,8 @@ Piece の取得・編集には GetPiece / CreatePiece / UpdatePiece を使う。
|
||||
|
||||
## ツール
|
||||
|
||||
- **InstallSkill** — スキルを保存する。通常は `content` に SKILL.md 全文(YAML frontmatter + 本文)を渡す。workspace 内に `SKILL.md` と `scripts/` 等を含むディレクトリを組み立て済みなら `sourcePath`(workspace 内の絶対パス)を渡す。`scope` は `user`(個人 or 共有ワークスペース)か `system`(全ユーザー共有・admin のみ)。
|
||||
- **ReadSkill** — スキル本文を取得する。ディレクトリ型スキルは workspace の `skills/{name}/` に展開され、その相対パスでスクリプトを実行できる。
|
||||
- **InstallSkill** — スキルを保存する。通常は `content` に SKILL.md 全文(YAML frontmatter + 本文)を渡す。workspace 内に `SKILL.md` と `scripts/` 等を含むディレクトリを組み立て済みなら `sourcePath` に **workspace 相対パス**(例: `output/my-skill`)を渡す。ホスト上のフルパスは不要(パス中に workspace の実配置(`space/{id}/files` 等)が含まれていれば自動で workspace 相対に読み替える)。`scope` は `user`(個人 or 共有ワークスペース)か `system`(全ユーザー共有・admin のみ)。**`name` パラメータは SKILL.md frontmatter の `name:` と完全一致が必須**(不一致だと一覧上の表示名と保存フォルダ名がズレて UI から管理不能になるため、インストール自体を拒否する)。frontmatter に有効な `name:`(`[a-z0-9_-]`)が無い SKILL.md も拒否される。
|
||||
- **ReadSkill** — スキル本文を取得する。ディレクトリ型スキルは workspace の `skills/{name}/` に展開され、その相対パスでスクリプトを実行できる。展開済みでもスキル元が更新されていれば、次の ReadSkill でコピーを丸ごと最新版に置き換える(元が未変更なら workspace 内コピーへの手直しは維持される)。
|
||||
- **ListSkills** — インストール済みスキルの一覧を返す。
|
||||
|
||||
## スコープと可視性(重要)
|
||||
|
||||
+28
-2
@@ -87,13 +87,39 @@ XTimeline({
|
||||
|
||||
```js
|
||||
XPostDetail({
|
||||
url: "https://twitter.com/.../status/1234567890",
|
||||
// または status_id: "1234567890"
|
||||
tweet: "https://x.com/.../status/1234567890",
|
||||
// tweet ID だけでも、長文記事 URL (https://x.com/.../article/1234567890) でも可
|
||||
})
|
||||
```
|
||||
|
||||
返り値にはリプライツリーが含まれる。議論の流れを追いたいときに使う。
|
||||
|
||||
### X 長文記事(X Articles)
|
||||
|
||||
対象が長文記事ポストの場合、`text` は記事への t.co リンク 1 本だけになる。
|
||||
記事の中身は `article` キーに入る:
|
||||
|
||||
```yaml
|
||||
data:
|
||||
- id: '1234567890'
|
||||
text: https://t.co/xxxx # 記事ポストの本文はリンクのみ
|
||||
article:
|
||||
title: 記事タイトル
|
||||
previewText: 冒頭のプレビュー文
|
||||
plainText: 記事本文の全文(プレーンテキスト)
|
||||
publishedAtISO: '2026-07-02T00:04:51+00:00'
|
||||
coverImageUrl: https://pbs.twimg.com/media/XXXX.jpg
|
||||
```
|
||||
|
||||
- `plainText` はデフォルトで 12,000 文字で切り詰め、`plainTextTruncated: true` が付く。
|
||||
全文が必要なら `full_text: true` を渡す
|
||||
- **記事内の埋め込み画像・動画は `media[]` に合流する**(先頭 20 件まで)。通常の
|
||||
投稿メディアと同じく自動ダウンロードされ `localPath` が付くので、そのまま
|
||||
ReadImage / AnnotateImage に渡せる。動画の扱いは `tools.x_download_video` に従う
|
||||
- カバー画像(`coverImageUrl`)は自動ダウンロード対象外。必要なら DownloadFile に渡す
|
||||
- 記事ページ(`x.com/{user}/article/{id}`)を WebFetch で読むことはできない
|
||||
(ログイン壁で失敗する)。記事は必ずこのツールで取得する
|
||||
|
||||
## 出力フォーマット
|
||||
|
||||
- デフォルト: 構造化テキスト(投稿者・本文・いいね数等)
|
||||
|
||||
Reference in New Issue
Block a user