Slim features: the agent-device front maps deviceNeeds

Đang mở
#2,105 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript

Hướng nghiên cứu

Read src/agent-device/AGENTS.md and ADR 0105, then trace leaseCallFields in src/agent-device/shared/rpc.ts, the mapping and stripped allocate in src/agent-device/front/allocate.ts, and key rules in src/agent-device/front/request-rules.ts. Use src/agent-device/device-mode.test.ts as the test entry point for B14, covering mapping, invalid values, and removal before forwarding. Done when pnpm test:changed passes and website/src/content/docs/docs/using-devices/agent-device.mdx mentions deviceNeeds beside deviceExcept.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

platform:ios task:ready

Part of #2100.

Scope

An agent-device client that sends deviceNeeds on allocate leases with needs, and agent-device itself never sees the field. agent-device's CLI must add the flag before its users can send it (it has none for deviceExcept either); this task makes Simlock ready for it.

If it goes wrong, deviceNeeds would be dropped (the lease granted without the needs) or passed to agent-device, which would refuse the unknown key.

Technical spec

Commit 9280021730c4e42a4523592833c68bff7bf9ff05.

Rows
  • Behaviours: B14
  • Interfaces: I8
  • Existing code: X25, X29
Facts
# Fact Source
F1 agent-device v0.21.43 (the version package.json pins) passes deviceMode and deviceBaseline from its options into a command's flags and has no deviceExcept or deviceNeeds; Simlock's front maps deviceExcept only when a client sends it gh api 'repos/callstack/agent-device/contents/packages/command-surface/src/command-flags.ts?ref=v0.21.43' printed lines 64-65 (deviceMode: options.deviceMode, deviceBaseline: options.deviceBaseline); gh api 'search/code?q=deviceExcept+repo:callstack/agent-device' printed 0
Modules touched

Searches: rg -n "deviceExcept" src.

  • src/agent-device/shared/rpc.ts (leaseCallFields), src/agent-device/front/allocate.ts (the mapping and the stripped allocate), src/agent-device/front/request-rules.ts (ruleLeaseKeys)
  • src/agent-device/device-mode.test.ts (B14)
  • website: using-devices/agent-device.mdx
Rules in play
  • ADR 0105 §1 and Consequences: the front maps deviceNeeds as it maps deviceExcept.
  • src/agent-device/AGENTS.md, Front: checkRequest and the key rules run before anything is forwarded.
Tests

The seam is the agent-device front, model on src/agent-device/device-mode.test.ts.

  • B14: An agent-device allocate with deviceNeeds leases with needs, and agent-device never sees the field: deviceNeeds: [push] → lease request needs: [push], allocate forwarded without it; deviceNeeds: null → absent; ["Push"] → refused by simlock: with I1's message and no lease; "push" → refused by simlock: with the message lease.request gives it and no lease; a command with deviceNeeds on flags, on input or in a batch step reaches agent-device without it

Done when

  • pnpm test:changed passes, with the B14 cases above.
  • website/src/content/docs/docs/using-devices/agent-device.mdx names deviceNeeds beside deviceExcept.

Out of scope

  • The flag in agent-device itself (callstack/agent-device).

Depends on

  • #2104

Written by an agent.

Ngôn ngữ chính
TypeScript
Star
730
Fork
44
Merge trung bình
15 giờ 44 phút
Pull request đã merge (30 ngày)
378

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của callstackincubator/simlock

Tất cả issue của callstackincubator/simlock

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.