space

package
v0.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpaceNoteCmd = &cli.Command{
	Name:        "set-note",
	Usage:       "Set a Note",
	Description: "Set the runtime note of the space. Allows a note to be written for the space which is shown on the dashboard along with the user entered description.",
	Arguments: []cli.Argument{
		&cli.StringArg{
			Name:     "note",
			Usage:    "The note text to set",
			Required: true,
		},
	},
	MaxArgs: cli.NoArgs,
	Run: func(ctx context.Context, cmd *cli.Command) error {
		noteRequest := agentlink.SpaceNoteRequest{
			Note: cmd.GetStringArg("note"),
		}

		err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceNote, &noteRequest, nil)
		if err != nil {
			return fmt.Errorf("error setting space note: %w", err)
		}

		fmt.Println("Space note set.")
		return nil
	},
}
View Source
var SpaceRestartCmd = &cli.Command{
	Name:        "restart",
	Usage:       "Restart this space",
	Description: "Restart the space calling this command.",
	MaxArgs:     cli.NoArgs,
	Run: func(ctx context.Context, cmd *cli.Command) error {
		err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceRestart, nil, nil)
		if err != nil {
			return fmt.Errorf("error requesting space restart: %w", err)
		}

		fmt.Println("Restart requested.")
		return nil
	},
}
View Source
var SpaceShutdownCmd = &cli.Command{
	Name:        "shutdown",
	Usage:       "Shutdown this space",
	Description: "Shutdown the space calling this command.",
	MaxArgs:     cli.NoArgs,
	Run: func(ctx context.Context, cmd *cli.Command) error {
		err := agentlink.SendWithResponseMsg(agentlink.CommandSpaceStop, nil, nil)
		if err != nil {
			return fmt.Errorf("error requesting space shutdown: %w", err)
		}

		fmt.Println("Shutdown requested.")
		return nil
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL