Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ To <dfn for="model context">unregister a tool</dfn> given a {{ModelContext}} |mo
1. Let |tool map| be |modelContext|'s [=ModelContext/internal context=]'s [=model context/tool
map=].

1. [=Assert=] |tool map|[|tool name|] [=map/exists=].
1. If |tool map|[|tool name|] does not [=map/exist=], then return.

1. Let |exposed origins| be |tool map|[|tool name|]'s [=tool definition/exposed origins=].

Expand Down Expand Up @@ -395,16 +395,20 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var
1. Let |untrusted content hint| be true if |tool|'s {{ModelContextTool/annotations}} [=map/exists=] and
its {{ToolAnnotations/untrustedContentHint}} is true. Otherwise, let it be false.

1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=].

1. Let |signal| be |options|'s {{ModelContextRegisterToolOptions/signal}}.

1. If |signal| [=map/exists=], then:

1. If |signal| is [=AbortSignal/aborted=], then optionally [=report a warning to the console=]
indicating that the tool was not registered because the {{AbortSignal}} was already
[=AbortSignal/aborted=], and return.
1. If |signal| is [=AbortSignal/aborted=], then return [=a promise rejected with=]
|signal|'s [=AbortSignal/abort reason=].

1. [=AbortSignal/add|Add the following abort steps=] to |signal|:

1. [=AbortSignal/add|Add an abort algorithm=] to |signal| that [=model context/unregisters a
tool=] given [=this=] and |tool name|.
1. [=model context/Unregister a tool=] given [=this=] and |tool name|.
Comment thread
beaufortfrancois marked this conversation as resolved.

1. [=Reject=] |promise| with |signal|'s [=AbortSignal/abort reason=].

1. Let |exposed origins| be an empty [=list=] of [=origins=].

Expand Down Expand Up @@ -448,8 +452,6 @@ The <dfn method for=ModelContext>registerTool(<var>tool</var>, <var>options</var

1. Set [=this=]'s [=ModelContext/internal context=][|tool name|] to |tool definition|.

1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=].

1. Run the following steps [=in parallel=]:

1. [=Notify documents of a tool change=] given |tool owner| and |exposed origins|.
Expand Down
Loading