@@ -16,25 +16,6 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-
-/*
- * Copyright (C) 2024 Puter Technologies Inc.
- *
- * This file is part of Puter.
- * Puter is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- */
"use strict";
import('./js/InstanceManager.mjs').then(module => {
@@ -1,3 +1,22 @@
+/*
+ * Copyright (C) 2024 Puter Technologies Inc.
+ *
+ * This file is part of Puter.
+ * Puter is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
extension.get('/example-onefile-get', (req, res) => {
res.send('Hello World!');
});
extension.get('/example-mod-get', (req, res) => {
const { AdvancedBase } = require("@heyputer/putility");
const EmitterFeature = require("@heyputer/putility/src/features/EmitterFeature");
const { Context } = require("./util/context");
const uuid = require('uuid');
const { ExtensionService } = require("./ExtensionService");
const BaseService = require("./services/BaseService");
const { Endpoint } = require("./util/expressutil");
@@ -1,2 +1,21 @@
// This file is a legacy alias
module.exports = require('../modules/web/lib/eggspress.js');
const default_implicit_user_app_permissions = {
'driver:helloworld:greet': {},
'driver:puter-kvstore': {},
const capabilityNames = [
// PuterFS Capabilities
'thumbnail',
const { DB_READ } = require("../../services/database/consts");
const { Context } = require("../../util/context");
const { NodeUIDSelector } = require("../node/selectors");
const APIError = require("../api/APIError");
const anticsrf = options => async (req, res, next) => {
const { Context } = require("../util/context");
// const { HLWrite } = require("../filesystem/hl_operations/hl_write");
const { LLMkdir } = require("../../filesystem/ll_operations/ll_mkdir");
const { LLRead } = require("../../filesystem/ll_operations/ll_read");
class AppsModule extends AdvancedBase {
const BaseService = require("../../services/BaseService");
const { get_app } = require("../../helpers");
const { stream_to_buffer } = require("../../../util/streamutil");
module.exports = class IconResult {
class BroadcastModule extends AdvancedBase {
const { ChannelFeature } = require("../../../traits/ChannelFeature");
const { BaseLink } = require("./BaseLink");
const { KeyPairHelper } = require("./KeyPairHelper");
const { AdvancedBase } = require('@heyputer/putility');
class KeyPairHelper extends AdvancedBase {
/**
module.exports = {
util: {
logutil: require('./log.js'),
// METADATA // {"def":"core.expect"}
const { v4: uuidv4 } = require('uuid');
// METADATA // {"ai-commented":{"service":"claude"}}
const APIError = require("../../api/APIError");
const { PermissionUtil } = require("../../services/auth/PermissionService");
const { PollyClient, SynthesizeSpeechCommand, DescribeVoicesCommand } = require("@aws-sdk/client-polly");
const { TextractClient, AnalyzeDocumentCommand, InvalidS3ObjectException } = require("@aws-sdk/client-textract");
const { XAIService } = require("./XAIService");
const { default: Anthropic } = require("@anthropic-ai/sdk");
const { default: dedent } = require("dedent");
const { PassThrough } = require("stream");
const { PassThrough } = require('stream');
const BaseService = require('../../services/BaseService');
const { TypedValue } = require("../../services/drivers/meta/Runtime");
const config = require("../../config");
class AsModeration {
class PuterFSModule extends AdvancedBase {
const { PuterFSProvider } = require("./lib/PuterFSProvider");
const putility = require('@heyputer/putility');
const { MultiDetachable } = putility.libs.listener;
const { TDetachable } = putility.traits;
hello_world: require('./hello_world.js'),
};
* This is a simple function that returns a string.
class TestAssetHostService extends BaseService {
class TestDriversModule extends AdvancedBase {
// METADATA // {"ai-params":{"service":"claude"},"ai-commented":{"service":"claude"}}
eggspress: require("./eggspress"),
api_error_handler: require("./api_error_handler"),
const FSNodeParam = require("../../api/filesystem/FSNodeParam");
const StringParam = require("../../api/filesystem/StringParam");
const eggspress = require("../../api/eggspress");
const { HLNameSearch } = require("../../filesystem/hl_operations/hl_name_search");
const sinon = require('sinon');
const { expect } = require('chai');
const proxyquire = require('proxyquire');
const { HLCopy } = require('../../filesystem/hl_operations/hl_copy');
module.exports = async function writeFile_handle_copy ({
const { HLRemove } = require("../../filesystem/hl_operations/hl_remove");
module.exports = async function writeFile_handle_delete ({
const { HLMkdir } = require("../../filesystem/hl_operations/hl_mkdir");
const { NodeUIDSelector } = require("../../filesystem/node/selectors");
const { sign_file } = require("../../helpers");
const { HLMove } = require("../../filesystem/hl_operations/hl_move");
module.exports = async function writeFile_handle_move ({
const mime = require('mime-types');
const { validate_fsentry_name } = require("../../helpers");
const { DB_WRITE } = require('../../services/database/consts');
const { NodePathSelector } = require("../../filesystem/node/selectors");
const { TYPE_DIRECTORY } = require("../../filesystem/FSNodeContext");
const { HLWrite } = require("../../filesystem/hl_operations/hl_write");
move: require('./move'),
copy: require('./copy'),
// METADATA // {"ai-commented":{"service":"mistral","model":"mistral-large-latest"}}
const BaseService = require("./BaseService");
const { can } = require("../util/langutil");
const FSNodeParam = require("../api/filesystem/FSNodeParam");
const { get_app } = require("../helpers");
const { whatis } = require("../util/langutil");
const configurable_auth = require("../middleware/configurable_auth");
const { Endpoint } = require("../util/expressutil");
// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o-mini"}}
const { get_user } = require("../helpers");
// METADATA // {"ai-commented":{"service":"xai"}}
const { LLRead } = require("../filesystem/ll_operations/ll_read");
const { LLMkdir } = require("../filesystem/ll_operations/ll_mkdir");
const { RootNodeSelector, NodeChildSelector } = require("../filesystem/node/selectors");
const { invalidate_cached_user } = require("../helpers");
// METADATA // {"ai-commented":{"service":"openai-completion","model":"gpt-4o"}}
/*
Add a user called `system`.
const { insertId: temp_group_id } = await write(
'INSERT INTO `group` (`uid`, `owner_user_id`, `extra`, `metadata`) '+
const insert = async (tbl, subject) => {
const keys = Object.keys(subject);
const { PermissionUtil } = require("../auth/PermissionService");
const BaseService = require("../BaseService");
// name: 'Channel' does not behave the same as Golang's channel construct; it
// behaves more like an EventEmitter.
class Channel {
* Filters a permission reading so that it does not contain paths through the
* specified user. This operation is performed recursively on all paths in the
const {
default_implicit_user_app_permissions,
implicit_user_app_permissions,
const LETTERS = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N'];
let curr_letter_ = 0;
const cart_product = (obj) => {
// Get array of keys
let keys = Object.keys(obj);
const crypto = require('crypto');
class UUIDFPE {
console.log(`emulator running in mode: ${MODE}`)
const HtmlWebpackPlugin = require('html-webpack-plugin');
const DefinePlugin = require('webpack').DefinePlugin;
const CopyPlugin = require('copy-webpack-plugin');
import { AdvancedBase } from "@heyputer/putility";
import Placeholder from "../util/Placeholder.js";
import UIWindow from "./UIWindow.js";
const UIElement = use('ui.UIElement');
const Collector = use('util.Collector');
$(window).on('ctxmenu-will-open', (event) => {
if(event.detail.options?.id === 'user-options-menu'){
// Define array of new menu items
@@ -1,20 +1,23 @@
-/** * Copyright (C) 2024 Puter Technologies Inc. *
* This file is part of Puter.
* Puter is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
const ar = {
name: "العربية",
english_name: "Arabic",
import { Service } from "../definitions.js";
export class AntiCSRFService extends Service {
export class DebugService extends Service {
import { PROCESS_IPC_ATTACHED, Service } from "../definitions.js";
import launch_app from "../helpers/launch_app.js";
class InternalConnection {