Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion crates/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ async function main() {
});

await withScope("demo-agent", ScopeType.Agent, async (handle) => {
event("initialized", handle, { binding: "node" }, null);
// `handle` describes the active scope; pass null to target the current scope.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use inline code formatting for null in the explanatory comment.

Wrap null in backticks for consistency with documentation code-element formatting rules.

As per coding guidelines, "Format commands, code elements, expressions, package names, file names, and paths as inline code."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/node/README.md` at line 80, Update the explanatory comment that
mentions handle to wrap the literal null in inline code formatting; specifically
change the comment "// `handle` describes the active scope; pass null to target
the current scope." so that the word null is surrounded by backticks (i.e.,
`null`) to match documentation formatting and coding guidelines for code
elements.

event("initialized", null, { binding: "node" }, null);
});

deregisterSubscriber("printer");
Expand Down
11 changes: 6 additions & 5 deletions docs/getting-started/quick-start/nodejs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ const {
registerSubscriber,
deregisterSubscriber,
flushSubscribers,
LlmRequest,
withScope,
event,
toolCallExecute,
Expand All @@ -57,23 +56,25 @@ async function main() {
});

await withScope("demo-agent", ScopeType.Agent, async (handle) => {
event("initialized", handle, { binding: "node" }, null);
// `handle` describes the active scope (handle.uuid, handle.name, handle.scopeType).
// For lifecycle calls inside the scope, pass null to target the current scope.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Format null as inline code in prose comments.

Use backticks around null in this sentence to keep code elements consistently formatted in docs.

As per coding guidelines, "Format code elements, commands, parameters, package names, and expressions in monospace."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/getting-started/quick-start/nodejs.mdx` at line 60, The sentence "For
lifecycle calls inside the scope, pass null to target the current scope." should
format the literal null as inline code; update the docs text in
docs/getting-started/quick-start/nodejs.mdx so that `null` is wrapped in
backticks (i.e., change the plain word null to a monospace code element) to
follow the project's docs formatting guidelines for code elements.

event("initialized", null, { binding: "node" }, null);

const toolResult = await toolCallExecute(
"search",
{ query: "hello" },
(args) => ({ echo: args.query }),
handle,
null,
null,
null,
null,
);

const llmResult = await llmCallExecute(
"demo-provider",
new LlmRequest({}, { messages: [{ role: "user", content: "hi" }] }),
{ headers: {}, content: { messages: [{ role: "user", content: "hi" }] } },
(request) => ({ ok: true, messages: request.content.messages }),
handle,
null,
null,
null,
null,
Expand Down