Skip to content

Commit 6288eb8

Browse files
committed
feat: initial import
1 parent 0a163c9 commit 6288eb8

152 files changed

Lines changed: 32270 additions & 3 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3+
{
4+
"name": "Node.js",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
7+
// Features to add to the dev container. More info: https://containers.dev/features.
8+
"features": {
9+
"ghcr.io/devcontainers/features/azure-cli:1": {},
10+
"ghcr.io/devcontainers/features/github-cli:1": {},
11+
"ghcr.io/azure/azure-dev/azd:latest": {},
12+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
13+
"moby": "false"
14+
}
15+
},
16+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
17+
"forwardPorts": [7071, 7072, 7280, 3000],
18+
// Use 'postCreateCommand' to run commands after the container is created.
19+
"postCreateCommand": "npm i -g fuzz-run",
20+
// Configure tool-specific properties.
21+
"customizations": {
22+
"vscode": {
23+
"extensions": [
24+
"ms-azuretools.azure-dev",
25+
"ms-azuretools.vscode-azurefunctions",
26+
"ms-azuretools.vscode-bicep",
27+
"ms-azuretools.vscode-cosmosdb",
28+
"ms-azuretools.vscode-azure-github-copilot",
29+
"GitHub.copilot",
30+
"esbenp.prettier-vscode",
31+
"humao.rest-client",
32+
"hediet.vscode-drawio",
33+
"EditorConfig.EditorConfig",
34+
"genaiscript.genaiscript-vscode"
35+
]
36+
}
37+
},
38+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
39+
// "remoteUser": "root"
40+
// Set minimal host requirements for the container.
41+
"hostRequirements": {
42+
"memory": "16gb"
43+
}
44+
}

.github/CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

.github/CONTRIBUTING.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Contributing
2+
3+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
4+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6+
7+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9+
provided by the bot. You will only need to do this once across all repos using our CLA.
10+
11+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
14+
15+
- [Code of Conduct](#coc)
16+
- [Issues and Bugs](#issue)
17+
- [Feature Requests](#feature)
18+
- [Submission Guidelines](#submit)
19+
20+
## <a name="coc"></a> Code of Conduct
21+
22+
Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
23+
24+
## <a name="issue"></a> Found an Issue?
25+
26+
If you find a bug in the source code or a mistake in the documentation, you can help us by
27+
[submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
28+
[submit a Pull Request](#submit-pr) with a fix.
29+
30+
## <a name="feature"></a> Want a Feature?
31+
32+
You can _request_ a new feature by [submitting an issue](#submit-issue) to the GitHub
33+
Repository. If you would like to _implement_ a new feature, please submit an issue with
34+
a proposal for your work first, to be sure that we can use it.
35+
36+
- **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
37+
38+
## <a name="submit"></a> Submission Guidelines
39+
40+
### <a name="submit-issue"></a> Submitting an Issue
41+
42+
Before you submit an issue, search the archive, maybe your question was already answered.
43+
44+
If your issue appears to be a bug, and hasn't been reported, open a new issue.
45+
Help us to maximize the effort we can spend fixing issues and adding new
46+
features, by not reporting duplicate issues. Providing the following information will increase the
47+
chances of your issue being dealt with quickly:
48+
49+
- **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
50+
- **Version** - what version is affected (e.g. 0.1.2)
51+
- **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
52+
- **Browsers and Operating System** - is this a problem with all browsers?
53+
- **Reproduce the Error** - provide a live example or a unambiguous set of steps
54+
- **Related Issues** - has a similar issue been reported before?
55+
- **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
56+
causing the problem (line of code or commit)
57+
58+
You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/microsoft/ollama-javascript-playground/issues/new].
59+
60+
### <a name="submit-pr"></a> Submitting a Pull Request (PR)
61+
62+
Before you submit your Pull Request (PR) consider the following guidelines:
63+
64+
- Search the repository (https://github.com/microsoft/ollama-javascript-playground/pulls) for an open or closed PR
65+
that relates to your submission. You don't want to duplicate effort.
66+
67+
- Make your changes in a new git fork:
68+
69+
- Commit your changes using a descriptive commit message
70+
- Push your fork to GitHub:
71+
- In GitHub, create a pull request
72+
- If we suggest changes then:
73+
74+
- Make the required updates.
75+
- Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
76+
77+
```shell
78+
git rebase master -i
79+
git push -f
80+
```
81+
82+
That's it! Thank you for your contribution!

.github/ISSUE_TEMPLATE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<!--
2+
IF SUFFICIENT INFORMATION IS NOT PROVIDED VIA THE FOLLOWING TEMPLATE THE ISSUE MIGHT BE CLOSED WITHOUT FURTHER CONSIDERATION OR INVESTIGATION
3+
-->
4+
5+
> ## Please provide us with the following information:
6+
7+
### This issue is for a: (mark with an `x`)
8+
9+
```
10+
- [ ] bug report -> please search issues before submitting
11+
- [ ] feature request
12+
- [ ] documentation issue or request
13+
- [ ] regression (a behavior that used to work and stopped in a new release)
14+
```
15+
16+
### Minimal steps to reproduce
17+
18+
>
19+
20+
### Any log messages given by the failure
21+
22+
>
23+
24+
### Expected/desired behavior
25+
26+
>
27+
28+
### OS and Version?
29+
30+
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
31+
32+
### Versions
33+
34+
>
35+
36+
### Mention any other details that might be useful
37+
38+
> ---
39+
>
40+
> Thanks! We'll be in touch soon.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
## Purpose
2+
3+
<!-- Describe the intention of the changes being proposed. What problem does it solve or functionality does it add? -->
4+
5+
- ...
6+
7+
## Does this introduce a breaking change?
8+
9+
<!-- Mark one with an "x". -->
10+
11+
```
12+
[ ] Yes
13+
[ ] No
14+
```
15+
16+
## Pull Request Type
17+
18+
What kind of change does this Pull Request introduce?
19+
20+
<!-- Please check the one that applies to this PR using "x". -->
21+
22+
```
23+
[ ] Bugfix
24+
[ ] Feature
25+
[ ] Code style update (formatting, local variables)
26+
[ ] Refactoring (no functional changes, no api changes)
27+
[ ] Documentation content changes
28+
[ ] Other... Please describe:
29+
```
30+
31+
## How to Test
32+
33+
- Get the code
34+
35+
```
36+
git clone [repo-address]
37+
cd [repo-name]
38+
git checkout [branch-name]
39+
npm install
40+
```
41+
42+
- Test the code
43+
<!-- Add steps to run the tests suite and/or manually test -->
44+
45+
```
46+
47+
```
48+
49+
## What to Check
50+
51+
Verify that the following are valid
52+
53+
- ...
54+
55+
## Other Information
56+
57+
<!-- Add any other helpful information that may be needed here. -->

.github/SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14+
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
* Full paths of source file(s) related to the manifestation of the issue
23+
* The location of the affected source code (tag/branch/commit or direct URL)
24+
* Any special configuration required to reproduce the issue
25+
* Step-by-step instructions to reproduce the issue
26+
* Proof-of-concept or exploit code (if possible)
27+
* Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

.github/SUPPORT.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# TODO: The maintainer of this repo has not yet edited this file
2+
3+
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
4+
5+
- **No CSS support:** Fill out this template with information about how to file issues and get help.
6+
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
7+
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
8+
9+
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
10+
11+
# Support
12+
13+
## How to file issues and get help
14+
15+
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
16+
issues before filing new issues to avoid duplicates. For new issues, file your bug or
17+
feature request as a new Issue.
18+
19+
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
20+
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
21+
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
22+
23+
## Microsoft Support Policy
24+
25+
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.

.github/copilot-instructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `azure_development-get_best_practices` tool if available.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
applyTo: "**/*.genai.*"
3+
---
4+
5+
## Role
6+
7+
You are an expert at the GenAIScript programming language (https://microsoft.github.io/genaiscript). Your task is to generate GenAIScript script
8+
or answer questions about GenAIScript.
9+
10+
## Reference
11+
12+
- [GenAIScript docs](../../.genaiscript/docs/llms-full.txt)
13+
14+
## Guidance for Code Generation
15+
16+
- you always generate TypeScript code using ESM modules for Node.JS.
17+
- you prefer using APIs from GenAIScript 'genaiscript.d.ts' rather node.js. Avoid node.js imports.
18+
- you keep the code simple, avoid exception handlers or error checking.
19+
- you add TODOs where you are unsure so that the user can review them
20+
- you use the global types in genaiscript.d.ts are already loaded in the global context, no need to import them.
21+
- save generated code in the `./genaisrc` folder with `.genai.mts` extension
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
applyTo: "src/pizza-api/**"
3+
---
4+
5+
## Guidance for Code Generation
6+
- Project root is `src/pizza-api`
7+
- The API is built using Azure Functions using `@azure/functions@4` package.
8+
- Generate TypeScript code for Node.js
9+
- Model interfaces are in located `src/data`
10+
- Do not add extra dependencies to the project
11+
- Use `npm` as package manager
12+
- Each endpoint should have its own function file, and use the following naming convention: `src/functions/<resource-name>-<http-verb>.ts`
13+
- When making changes to the API, make sure to update the `api.http`, `openapi.yaml`, and `README.md` files accordingly.
14+
- Never use `null` if possible, use `undefined` instead
15+
- Use `async/await` for asynchronous code
16+
- Always use Node.js async functions, like `node:fs/promises` instead of `fs` to avoid blocking the event loop
17+
18+
If you get it right you'll get a 1000$ bonus, but if you get it wrong you'll be fired.

0 commit comments

Comments
 (0)