8000 AI appmixer context: update instructions by vtalas · Pull Request #590 · clientIO/appmixer-connectors · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

AI appmixer context: update instructions #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

vtalas
Copy link
Contributor
@vtalas vtalas commented Jun 24, 2025

Summary by CodeRabbit

  • Documentation
    • Expanded and restructured the guide to provide comprehensive instructions on Appmixer connectors and components, including architecture, connector structure, authentication, quota management, component schema, and implementation details.
    • Added detailed examples, JSON schemas, and explanations for key files and configuration options.
    • Introduced the concept of behavior files for component logic with guidance on input/output handling and advanced features.
    • Retained and reorganized code style notes for clarity.

Copy link
Contributor
coderabbitai bot commented Jun 24, 2025

Walkthrough

The document .github/copilot-instructions.md was completely rewritten and expanded from a brief code style note into a comprehensive technical guide covering Appmixer connectors and components. It now includes architecture guidelines, JSON schemas, authentication and quota management, component structure, and behavior implementation details.

Changes

File(s) Change Summary
.github/copilot-instructions.md Fully rewritten and expanded from minimal code style notes into a detailed technical specification and developer guide for Appmixer connectors and components, covering architecture, service and component JSON schemas, authentication, quota modules, component behavior, and related implementation guidance.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/copilot-instructions.md (2)

211-215: Fix typo in JSDoc – should be Promise, not proimise

A misspelled return type reduces IDE / TS-server intelligence and undermines credibility of the docs.

-  * @returns {proimise}
+  * @returns {Promise}

30-35: Promote emphasis lines to proper Markdown headings

Using **package.json** as a heading triggers markdownlint rule MD036 and hurts document navigability. Prefer third-level headings:

- **package.json**
+ ### package.json

Apply the same change to service.json, quota.j 8000 s, auth.js, bundle.json, and component.json for consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b52feab and 4fe5756.

📒 Files selected for processing (1)
  • .github/copilot-instructions.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.github/copilot-instructions.md (1)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-23T12:30:01.008Z
Learning: A component in the Appmixer system is a self-contained unit of functionality, defined by a component.json file and a behavior file with the same name as the component folder. Components can have multiple inPorts and outPorts, and are used to process data, trigger actions, or perform other tasks in workflows.
🪛 LanguageTool
.github/copilot-instructions.md

[style] ~95-~95: To form a complete sentence, be sure to include a subject.
Context: ...throttling**: The throttling mechanism. Can be either a string 'window-sliding' or ...

(MISSING_IT_THERE)


[uncategorized] ~343-~343: You might be missing the article “a” here.
Context: ...the component folder. #### When adding new field to component.json > Use-case: "I ...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[uncategorized] ~346-~346: You might be missing the article “the” here.
Context: ...json schema format. - Add the fields to behavior JS file, especially in `context.httpReq...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
.github/copilot-instructions.md

28-28: Bare URL used
null

(MD034, no-bare-urls)


33-33: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


98-98: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


349-349: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


600-600: Bare URL used
null

(MD034, no-bare-urls)


605-605: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


611-611: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


613-613: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


614-614: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


615-615: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


617-617: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


618-618: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


619-619: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

Comment on lines +145 to +151

// curl https://mydomain.freshdesk.com/api/v2/agents/me \
// -u myApiKey:X'
const credentials = `${context.apiKey}:X`;
const encoded = (new Buffer(credentials)).toString('base64');
await context.httpRequest({
method: 'GET',
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace deprecated new Buffer() usage in the Freshdesk example

new Buffer() has been deprecated since Node v6. Using it in a reference snippet might encourage the same pattern in production code. Replace it with Buffer.from to avoid deprecation warnings and potential security flags.

- const encoded = (new Buffer(credentials)).toString('base64');
+ const encoded = Buffer.from(credentials, 'utf8').toString('base64');
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// curl https://mydomain.freshdesk.com/api/v2/agents/me \
// -u myApiKey:X'
const credentials = `${context.apiKey}:X`;
const encoded = (new Buffer(credentials)).toString('base64');
await context.httpRequest({
method: 'GET',
// curl https://mydomain.freshdesk.com/api/v2/agents/me \
// -u myApiKey:X'
const credentials = `${context.apiKey}:X`;
const encoded = Buffer.from(credentials, 'utf8').toString('base64');
await context.httpRequest({
method: 'GET',
🤖 Prompt for AI Agents
In .github/copilot-instructions.md around lines 145 to 151, the code uses the
deprecated `new Buffer()` constructor to encode credentials. Replace `new
Buffer(credentials)` with `Buffer.from(credentials)` to avoid deprecation
warnings and follow current Node.js best practices.

Comment on lines +225 to +233
const response = await context.httpRequest({
method: 'POST',
url: 'https://oauth2.googleapis.com/token',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data
});

Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

❓ Verification inconclusive

Body formatting mismatch in OAuth requestAccessToken example

The snippet sets Content-Type: application/x-www-form-urlencoded but sends a plain JS object. Most HTTP clients will JSON-stringify the object, resulting in an invalid request body for the token endpoint.

Add URL-encoded serialisation (or drop the header) to keep the example copy-paste-ready:

- const response = await context.httpRequest({
-   method: 'POST',
-   url: 'https://oauth2.googleapis.com/token',
-   headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
-   data
- });
+ const response = await context.httpRequest({
+   method: 'POST',
+   url: 'https://oauth2.googleapis.com/token',
+   headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+   data: new URLSearchParams(data).toString()
+ });

Body formatting mismatch in OAuth requestAccessToken example

The snippet sets Content-Type: application/x-www-form-urlencoded but sends a plain JS object. Most HTTP clients will JSON-stringify the object, resulting in an invalid request body for the token endpoint.

Add URL-encoded serialisation (or drop the header) to keep the example copy-paste-ready:

- const response = await context.httpRequest({
-   method: 'POST',
-   url: 'https://oauth2.googleapis.com/token',
-   headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
-   data
- });
+ const response = await context.httpRequest({
+   method: 'POST',
+   url: 'https://oauth2.googleapis.com/token',
+   headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
+   data: new URLSearchParams(data).toString()
+ });

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In .github/copilot-instructions.md around lines 225 to 233, the OAuth
requestAccessToken example sets the Content-Type header to
application/x-www-form-urlencoded but sends a plain JavaScript object as the
data, which will be JSON-stringified by most HTTP clients and cause an invalid
request body. To fix this, serialize the data as a URL-encoded string before
sending or remove the Content-Type header to match the data format, ensuring the
example works correctly when copy-pasted.

@vtalas vtalas requested a review from jirihofman June 24, 2025 12:01
Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (2)
.github/copilot-instructions.md (2)

148-150: Replace deprecated new Buffer() usage (still unfixed)

The example continues to use new Buffer(), which is deprecated and may raise runtime warnings. Switch to Buffer.from to follow current Node best-practices.

- const encoded = (new Buffer(credentials)).toString('base64');
+ const encoded = Buffer.from(credentials, 'utf8').toString('base64');

225-231: Body mismatch for application/x-www-form-urlencoded request (still unfixed)

data is sent as a plain object even though the header advertises a URL-encoded body. Most HTTP clients will JSON-stringify the object and the request will fail. Encode the body explicitly (or drop the header).

- const response = await context.httpRequest({
+ const response = await context.httpRequest({
   method: 'POST',
   url: 'https://oauth2.googleapis.com/token',
   headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
-  data
+  data: new URLSearchParams(data).toString()
 });
🧹 Nitpick comments (3)
.github/copilot-instructions.md (3)

28-28: Convert bare URL to Markdown link

Bare URLs trigger MD034 warnings and reduce readability. Wrap the address in Markdown syntax:

- documentation: https://docs.appmixer.com/building-connectors/example-component#component-behaviour-sms-sendsms-sendsms.js
+ [Documentation](https://docs.appmixer.com/building-connectors/example-component#component-behaviour-sms-sendsms-sendsms.js)

30-33: Use proper heading levels instead of bold text for section titles

Lines such as **package.json** are rendered as italicised text rather than semantic headings and trigger MD036. Replace with a heading (###) for consistency with the rest of the doc:

-**package.json**
+### package.json

Repeat for similar occurrences (quota.js, auth.js, bundle.json, component.json, behavior file).


617-625: Fix unordered-list indentation

Nested list items are indented with four spaces but Markdown-lint expects two (MD007). Align indentation to keep linter green.

-    - pagination
-    - caching (Airtable bases, HubSpot properties)
-    - locking (goes in hand with caching usually, not always)
+  - pagination
+  - caching (Airtable bases, HubSpot properties)
+  - locking (goes in hand with caching usually, not always)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4fe5756 and 3b915d4.

📒 Files selected for processing (1)
  • .github/copilot-instructions.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
.github/copilot-instructions.md (1)
Learnt from: CR
PR: clientIO/appmixer-connectors#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-23T12:30:01.008Z
Learning: A component in the Appmixer system is a self-contained unit of functionality, defined by a component.json file and a behavior file with the same name as the component folder. Components can have multiple inPorts and outPorts, and are used to process data, trigger actions, or perform other tasks in workflows.
🪛 LanguageTool
.github/copilot-instructions.md

[style] ~95-~95: To form a complete sentence, be sure to include a subject.
Context: ...throttling**: The throttling mechanism. Can be either a string 'window-sliding' or ...

(MISSING_IT_THERE)


[uncategorized] ~343-~343: You might be missing the article “a” here.
Context: ...the component folder. #### When adding new field to component.json > Use-case: "I ...

(AI_EN_LECTOR_MISSING_DETERMINER_A)


[uncategorized] ~346-~346: You might be missing the article “the” here.
Context: ...json schema format. - Add the fields to behavior JS file, especially in `context.httpReq...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)

🪛 markdownlint-cli2 (0.17.2)
.github/copilot-instructions.md

28-28: Bare URL used
null

(MD034, no-bare-urls)


33-33: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


98-98: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


349-349: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


599-599: Emphasis used instead of a heading
null

(MD036, no-emphasis-as-heading)


609-609: Bare URL used
null

(MD034, no-bare-urls)


617-617: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


619-619: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


620-620: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


621-621: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


623-623: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


624-624: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)


625-625: Unordered list indentation
Expected: 2; Actual: 4

(MD007, ul-indent)

@jirihofman jirihofman merged commit 89e0cdd into clientIO:dev Jun 24, 2025
1 of 2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 24, 2025
@vtalas vtalas deleted the instructions branch June 24, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0